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

12 minutes
Share the link to this page
You need to have access to the item to view this lesson.
One-time Fee
List Price:  $149.95
You save:  $110
List Price:  ₹9,995
You save:  ₹8,515
List Price:  €138.32
You save:  €101.47
List Price:  £117.86
You save:  £86.46
List Price:  CA$205.69
You save:  CA$150.89
List Price:  A$226.64
You save:  A$166.26
List Price:  S$202.47
You save:  S$148.52
List Price:  HK$1,171.53
You save:  HK$859.41
CHF 36.54
List Price:  CHF 137.17
You save:  CHF 100.62
NOK kr424.24
List Price:  NOK kr1,592.36
You save:  NOK kr1,168.12
DKK kr274.95
List Price:  DKK kr1,032.01
You save:  DKK kr757.06
List Price:  NZ$245.38
You save:  NZ$180.01
List Price:  د.إ550.76
You save:  د.إ404.03
List Price:  ৳17,646.64
You save:  ৳12,945.18
List Price:  RM706.48
You save:  RM518.26
List Price:  ₦217,427.50
You save:  ₦159,500
List Price:  ₨41,866.58
You save:  ₨30,712.40
List Price:  ฿5,500.82
You save:  ฿4,035.28
List Price:  ₺4,835.10
You save:  ₺3,546.92
List Price:  B$771.44
You save:  B$565.91
List Price:  R2,756.78
You save:  R2,022.31
List Price:  Лв270.53
You save:  Лв198.46
List Price:  ₩204,814.98
You save:  ₩150,247.73
List Price:  ₪550.50
You save:  ₪403.83
List Price:  ₱8,728.73
You save:  ₱6,403.21
List Price:  ¥23,539
You save:  ¥17,267.69
List Price:  MX$2,503.75
You save:  MX$1,836.69
List Price:  QR548.59
You save:  QR402.43
List Price:  P2,034.61
You save:  P1,492.54
List Price:  KSh19,868.37
You save:  KSh14,575
List Price:  E£7,070.35
You save:  E£5,186.65
List Price:  ብር8,643.40
You save:  ብር6,340.61
List Price:  Kz127,525.42
You save:  Kz93,549.83
List Price:  CLP$136,414.01
You save:  CLP$100,070.30
List Price:  CN¥1,066.12
You save:  CN¥782.08
List Price:  RD$8,842.90
You save:  RD$6,486.95
List Price:  DA20,162.27
You save:  DA14,790.59
List Price:  FJ$340.03
You save:  FJ$249.44
List Price:  Q1,168.92
You save:  Q857.49
List Price:  GY$31,490.30
You save:  GY$23,100.59
ISK kr5,516.69
List Price:  ISK kr20,706.59
You save:  ISK kr15,189.90
List Price:  DH1,496.35
You save:  DH1,097.69
List Price:  L2,660.11
You save:  L1,951.40
List Price:  ден8,542.60
You save:  ден6,266.66
List Price:  MOP$1,209.87
You save:  MOP$887.54
List Price:  N$2,755.10
You save:  N$2,021.08
List Price:  C$5,537.39
You save:  C$4,062.10
List Price:  रु20,031.84
You save:  रु14,694.91
List Price:  S/561.49
You save:  S/411.90
List Price:  K584.67
You save:  K428.90
List Price:  SAR562.41
You save:  SAR412.57
List Price:  ZK3,982.84
You save:  ZK2,921.72
List Price:  L687.92
You save:  L504.64
List Price:  Kč3,420.64
You save:  Kč2,509.31
List Price:  Ft53,280.89
You save:  Ft39,085.68
SEK kr427.80
List Price:  SEK kr1,605.72
You save:  SEK kr1,177.92
List Price:  ARS$133,496.07
You save:  ARS$97,929.76
List Price:  Bs1,039.51
You save:  Bs762.56
List Price:  COP$574,450.12
You save:  COP$421,403.89
List Price:  ₡77,137.96
You save:  ₡56,586.70
List Price:  L3,717.90
You save:  L2,727.37
List Price:  ₲1,131,341.38
You save:  ₲829,926.98
List Price:  $U5,770.51
You save:  $U4,233.12
List Price:  zł589.17
You save:  zł432.20
per week
Payment Plan
per week
4 payments
Already have an account? Log In


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 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.