$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.37
List Price:  €144.04
You save:  €105.66
£31.27
List Price:  £117.40
You save:  £86.12
CA$57.24
List Price:  CA$214.87
You save:  CA$157.62
A$63.98
List Price:  A$240.15
You save:  A$176.17
S$53.95
List Price:  S$202.50
You save:  S$148.55
HK$310.44
List Price:  HK$1,165.23
You save:  HK$854.79
CHF 35.35
List Price:  CHF 132.70
You save:  CHF 97.35
NOK kr450.20
List Price:  NOK kr1,689.81
You save:  NOK kr1,239.61
DKK kr286.56
List Price:  DKK kr1,075.59
You save:  DKK kr789.03
NZ$70.67
List Price:  NZ$265.25
You save:  NZ$194.58
د.إ146.73
List Price:  د.إ550.76
You save:  د.إ404.02
৳4,766.44
List Price:  ৳17,890.59
You save:  ৳13,124.14
RM179.25
List Price:  RM672.82
You save:  RM493.57
₦61,746.71
List Price:  ₦231,762.69
You save:  ₦170,015.98
₨11,104.31
List Price:  ₨41,679.41
You save:  ₨30,575.09
฿1,365.09
List Price:  ฿5,123.79
You save:  ฿3,758.70
₺1,406.05
List Price:  ₺5,277.53
You save:  ₺3,871.48
B$254.73
List Price:  B$956.12
You save:  B$701.39
R749.07
List Price:  R2,811.62
You save:  R2,062.54
Лв75.11
List Price:  Лв281.93
You save:  Лв206.82
₩58,217.52
List Price:  ₩218,516.08
You save:  ₩160,298.56
₪145.79
List Price:  ₪547.22
You save:  ₪401.43
₱2,343.46
List Price:  ₱8,796.06
You save:  ₱6,452.60
¥6,279.14
List Price:  ¥23,568.39
You save:  ¥17,289.24
MX$805.55
List Price:  MX$3,023.62
You save:  MX$2,218.06
QR145.06
List Price:  QR544.49
You save:  QR399.42
P553.96
List Price:  P2,079.26
You save:  P1,525.30
KSh5,155.14
List Price:  KSh19,349.54
You save:  KSh14,194.40
E£2,030.82
List Price:  E£7,622.58
You save:  E£5,591.75
ብር5,078.52
List Price:  ብር19,061.93
You save:  ብር13,983.41
Kz36,434.40
List Price:  Kz136,754.40
You save:  Kz100,320
CLP$39,522.13
List Price:  CLP$148,344.03
You save:  CLP$108,821.90
CN¥291.59
List Price:  CN¥1,094.48
You save:  CN¥802.89
RD$2,429.65
List Price:  RD$9,119.56
You save:  RD$6,689.91
DA5,397.29
List Price:  DA20,258.44
You save:  DA14,861.14
FJ$92.63
List Price:  FJ$347.68
You save:  FJ$255.05
Q307.23
List Price:  Q1,153.19
You save:  Q845.95
GY$8,344.93
List Price:  GY$31,322.21
You save:  GY$22,977.28
ISK kr5,575.02
List Price:  ISK kr20,925.52
You save:  ISK kr15,350.50
DH402.23
List Price:  DH1,509.75
You save:  DH1,107.52
L735.91
List Price:  L2,762.22
You save:  L2,026.30
ден2,360.77
List Price:  ден8,861.04
You save:  ден6,500.26
MOP$319.08
List Price:  MOP$1,197.67
You save:  MOP$878.58
N$741.65
List Price:  N$2,783.77
You save:  N$2,042.11
C$1,467.69
List Price:  C$5,508.89
You save:  C$4,041.20
रु5,432.30
List Price:  रु20,389.82
You save:  रु14,957.52
S/148.52
List Price:  S/557.48
You save:  S/408.95
K161.88
List Price:  K607.63
You save:  K445.74
SAR150.01
List Price:  SAR563.08
You save:  SAR413.06
ZK1,103.85
List Price:  ZK4,143.26
You save:  ZK3,039.40
L191.13
List Price:  L717.40
You save:  L526.27
Kč966.07
List Price:  Kč3,626.09
You save:  Kč2,660.01
Ft15,773.33
List Price:  Ft59,204.28
You save:  Ft43,430.95
SEK kr434.74
List Price:  SEK kr1,631.79
You save:  SEK kr1,197.04
ARS$41,032.15
List Price:  ARS$154,011.80
You save:  ARS$112,979.65
Bs275.61
List Price:  Bs1,034.52
You save:  Bs758.90
COP$176,291.67
List Price:  COP$661,700.54
You save:  COP$485,408.87
₡20,252.23
List Price:  ₡76,015.58
You save:  ₡55,763.35
L1,013.41
List Price:  L3,803.80
You save:  L2,790.38
₲311,072.84
List Price:  ₲1,167,593.83
You save:  ₲856,520.98
$U1,775.42
List Price:  $U6,663.96
You save:  $U4,888.53
zł163.57
List Price:  zł613.95
You save:  zł450.38
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.