$onehot, $onehot0, $isunknown, $countones and assertion execution control tasks

12 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$39.95
List Price:  $149.95
You save:  $110
₹1,480
List Price:  ₹9,995
You save:  ₹8,515
€38.34
List Price:  €143.93
You save:  €105.58
£31.88
List Price:  £119.66
You save:  £87.78
CA$56.05
List Price:  CA$210.41
You save:  CA$154.35
A$61.43
List Price:  A$230.58
You save:  A$169.15
S$53.79
List Price:  S$201.92
You save:  S$148.12
HK$310.98
List Price:  HK$1,167.27
You save:  HK$856.28
CHF 35.69
List Price:  CHF 133.99
You save:  CHF 98.29
NOK kr442.35
List Price:  NOK kr1,660.33
You save:  NOK kr1,217.98
DKK kr285.97
List Price:  DKK kr1,073.38
You save:  DKK kr787.41
NZ$68.47
List Price:  NZ$257
You save:  NZ$188.53
د.إ146.73
List Price:  د.إ550.76
You save:  د.إ404.03
৳4,772.75
List Price:  ৳17,914.27
You save:  ৳13,141.51
RM178.49
List Price:  RM669.97
You save:  RM491.48
₦67,630.68
List Price:  ₦253,847.82
You save:  ₦186,217.14
₨11,098.11
List Price:  ₨41,656.11
You save:  ₨30,558
฿1,376.92
List Price:  ฿5,168.19
You save:  ฿3,791.27
₺1,380.37
List Price:  ₺5,181.14
You save:  ₺3,800.77
B$231.74
List Price:  B$869.85
You save:  B$638.11
R725.31
List Price:  R2,722.44
You save:  R1,997.12
Лв74.97
List Price:  Лв281.42
You save:  Лв206.44
₩56,110.17
List Price:  ₩210,606.27
You save:  ₩154,496.10
₪148.41
List Price:  ₪557.07
You save:  ₪408.65
₱2,354.61
List Price:  ₱8,837.90
You save:  ₱6,483.29
¥6,183.06
List Price:  ¥23,207.76
You save:  ¥17,024.70
MX$816.11
List Price:  MX$3,063.25
You save:  MX$2,247.13
QR145.65
List Price:  QR546.72
You save:  QR401.06
P546.19
List Price:  P2,050.11
You save:  P1,503.92
KSh5,172.27
List Price:  KSh19,413.84
You save:  KSh14,241.56
E£1,983.52
List Price:  E£7,445.04
You save:  E£5,461.51
ብር4,889.44
List Price:  ብር18,352.22
You save:  ብር13,462.78
Kz36,474.35
List Price:  Kz136,904.35
You save:  Kz100,430
CLP$39,068.11
List Price:  CLP$146,639.90
You save:  CLP$107,571.78
CN¥289.35
List Price:  CN¥1,086.08
You save:  CN¥796.73
RD$2,407.08
List Price:  RD$9,034.84
You save:  RD$6,627.76
DA5,364.28
List Price:  DA20,134.53
You save:  DA14,770.25
FJ$90.92
List Price:  FJ$341.27
You save:  FJ$250.35
Q308.30
List Price:  Q1,157.20
You save:  Q848.89
GY$8,355.77
List Price:  GY$31,362.93
You save:  GY$23,007.15
ISK kr5,578.69
List Price:  ISK kr20,939.31
You save:  ISK kr15,360.61
DH401.79
List Price:  DH1,508.10
You save:  DH1,106.31
L727.95
List Price:  L2,732.33
You save:  L2,004.38
ден2,358.96
List Price:  ден8,854.23
You save:  ден6,495.27
MOP$320.22
List Price:  MOP$1,201.94
You save:  MOP$881.72
N$724.29
List Price:  N$2,718.59
You save:  N$1,994.30
C$1,469.63
List Price:  C$5,516.17
You save:  C$4,046.54
रु5,393.89
List Price:  रु20,245.66
You save:  रु14,851.77
S/151.44
List Price:  S/568.45
You save:  S/417
K160.80
List Price:  K603.57
You save:  K442.76
SAR149.98
List Price:  SAR562.97
You save:  SAR412.98
ZK1,104.44
List Price:  ZK4,145.47
You save:  ZK3,041.02
L190.88
List Price:  L716.49
You save:  L525.60
Kč971.83
List Price:  Kč3,647.71
You save:  Kč2,675.88
Ft15,780.25
List Price:  Ft59,230.25
You save:  Ft43,450
SEK kr440.89
List Price:  SEK kr1,654.87
You save:  SEK kr1,213.98
ARS$40,099.21
List Price:  ARS$150,510.06
You save:  ARS$110,410.85
Bs275.98
List Price:  Bs1,035.88
You save:  Bs759.90
COP$175,370.51
List Price:  COP$658,243
You save:  COP$482,872.49
₡20,344.02
List Price:  ₡76,360.13
You save:  ₡56,016.10
L1,009.30
List Price:  L3,788.36
You save:  L2,779.05
₲311,796.57
List Price:  ₲1,170,310.31
You save:  ₲858,513.73
$U1,702.76
List Price:  $U6,391.24
You save:  $U4,688.47
zł166.33
List Price:  zł624.31
You save:  zł457.98
Subscription
$149.95
$39.95
per week
Payment Plan
$149.96
$39.95
per week
4 payments
Already have an account? Log In

Transcript

Hello, and welcome to lecture number 15. In this lecture, we will see system functions and tasks. We are moving away a little bit from the operators because we have pretty much covered all the operators. And the system functions and tasks are rather straightforward. So let's look them. Look at them one by one.

One hot, I'm sure you're familiar with it, we all use one heart all the time in our RTL design, and basically returns true as long as there is only one beat in the expression and only one bit is high in the expression. So here's a very simple property. If the bus grand acknowledge is asserted, it implies that there's only one bus grant on the bus. That's what if there are multiple bus grands then we want a failure. So here's the simulation log. Basically, the first thing is here there is no there is not a single one and hence the property will fail.

There should be at least one here there is a one property passes. Now here there is an x as well as there is a one, that's okay because there is at least one, one and the property passes. Same thing here with z n one. And now here there are more than one, one ones. So the property is and here there is no one so the property fails. This is rather straightforward forward that I'm sure you have used it a lot in your design, and it's a meaning and the use is pretty much the same.

But as simple as this is, this is another system function. That is there's going to be very useful to you in your assertion, writing or photo design. And similarly there is 100 Zero, which basically returns true if all the bits of the expression are zero, or only one of the bet is a one rather self explanatory system function is unknown. So in addition to one heart one heart zero we have ease unknown. So he's anon actually returns a true this is very straightforward but still make sure that you understand that it returns true if there is a z or an X in an expression, okay. So most of the time what we are trying to do is for example, a there is the reset is taken away, none of the signals should be in unknown.

So, in in essence, you have to negate the result of dollar is unknown, which is very easy to miss some time. So, let's look at this example. Again going back to the bus grant buzzer and acknowledge example, if there is a bus grant ack, BG ack, if that is high, it implies that none of the bus lines are in a known state. So, either known is going to return or true if there is an X or Z and then we negate it. So, then we get the result that we want. So, if there is a z here, even though it's there is no other unknown, because there is a z here the bus can check will fail that cannot be zR x.

Similarly, for an x here, here, there is no x or z here that is z again there is an X again and here again that is no x or z and property passes. So, this like I was just saying you know, some of this functions as simple as they are Are they are sometimes the most powerful assertion weapons that you have in your pocket, like I was just saying once the cycle starts the control signal should never go at x or z. And I can assure you you put such a simple assertion in your design and there will be chances at least in the beginning phase of the RTL coding that there may be a norm floating around and you will catch them catch those right away. So, here is the valid control at pauses of clock. Disable if biocidal or reset it beside buses in idle state or we are in reset mode.

We don't want to do this check. If not, then if address strobe is high, then we are simply saying that the byte enable right address and write data. They cannot be in an old state. And that's what this property does. So then there is another system function called count once It basically does what it says it comes a number of ones in a bid packet expression. Obviously, if there is an X or a Z, it is not counted towards the number of ones.

I've just put that in a procedural statement. If again, if buzz grande acknowledges, hi, then we count the number of grants that are there. And that's what we are doing here. There are all axes, the number of one is zero if there is one, one is a one, if there are no ones, and then it's a zero and if all are one, then the number of ones is equal to eight, rather intuitive. Here's a very simple but important application many times you want to see that a bus conforms to gray code transition. So very simple.

Property, property check gray code Am I So I always try to make my properties generic generic with formals, quote unquote. So here I'm sending a pipe pointer and the pipe point that is supposed to conform to gray core transitions. So at pauses of clock, I count number of ones in first I look at the byte pointer, one clock in the past. Then I look at the pipe pointer in the current clock. And I look at this to sample values and I do an XOR. And the XOR must return the number of ones in the XOR should be less than or equal to one, it can only be zero or one, which is great for transition.

So as you can see, by combining past and all account ones, you have basically achieved a very simple but elegant solution to gray code transition Then in any simulation methodology, you need global controls. And we you must be familiar with dollar dump on dump off and so on and so forth. So similarly institutional assertions, unit assertion execution control tasks. And these are $1 sort of dollar assert on and dollar assert kill. These are the execution control tasks of 2005 LRM. Let's look at each one of them.

The the syntax is dollar set off and the same thing will apply to dollar dollar or set on and dollar assert kill. Or you have level you have list of module or instances or the assertion identifier. The level or this is again if you are familiar with john bond dump off it's it's the same thing. If level is equal to zero then turn on or off all levels Under the given modular instance, under a given modular instance, which is important to know. And if it's greater than zero, then turn on or off assertions, only at m levels of hierarchy below the specified modular instance level. The session identifier so one of the things you can do is you can explicitly give the label that you use when you asserted a property and you can say, okay, just on this particular walk, one assertion.

And then of course, you have the modular instance name. Now, the only thing that you need to saw set off is stop the checking of all specified assertions until a subsequent assert on and the only thing you need to carefully note here is that if an assertion is already executing, it's in the middle of execution, it will not be turned off, it won't be affected. So that's a sort of assert kill is similar to a set of only that it will abort execution of any currently executing specific specified assertion as well. And then stop checking of all specified assertion until a subsequent dollar assert on that very similar to a set up. The only difference is that if an assertion is already executing, that also will be killed, everything will be killed, and hence the word kill here as opposed to the word off in dollar assert off.

And by default, everything is turned on. So dollar or so on is always by default. And whenever you do $1 or set off, or dollar assert kill, then you need to call dollar assert on if you want to resurrect checking and studying fighting the assertions. So let's look at look at a very simple example. This is very typical of what you may do in your project methodology. So for example, here let's look at this module assertion control.

It has reset coming in and machine check exception coming in. And we can see that in the initial blog we can say that negative reset that means when reset is asserted, kill everything or kill everything under top dot PCM and top dot x i am module top has PCI master axi master and assertion control. And we are looking at the module assertion control. This is a very typical methodology that you may want to use in your project. So, at the edge of reset, we kill everything and at the edge of reset, we turn everything on again So this is instance level. And then obviously you can simply say top without the instance and everything under top will be killed and then turned on.

And then for. During this said, we want to kill everything, it simply doesn't make any sense to execute any assertion, even even those that are executing this will be killed. But let's say you get a machine check exception and add machine machine check exception, you want to turn off the assertions, but you don't necessarily want to kill or turn off the assertion that's already executing. This is from my experience. So basically we are going to say machine check exception or sort of this particular instance and that when we returned from the interrupt service routine of the machine check exception. Then we want to turn everything on again.

So this this is straightforward but very effective way of using the assertion system functions. This is a very short lecture. Hopefully, you understood the methodology on global assertion execution control, which is something you will most likely deploy in your project. So, thanks for attending the lecture and I will see you soon in the next lecture.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.