$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
€37.39
List Price:  €140.35
You save:  €102.95
£32.14
List Price:  £120.65
You save:  £88.51
CA$54.66
List Price:  CA$205.17
You save:  CA$150.51
A$61.46
List Price:  A$230.72
You save:  A$169.25
S$54.37
List Price:  S$204.11
You save:  S$149.73
HK$312.91
List Price:  HK$1,174.51
You save:  HK$861.59
CHF 36.52
List Price:  CHF 137.09
You save:  CHF 100.57
NOK kr437.63
List Price:  NOK kr1,642.62
You save:  NOK kr1,204.99
DKK kr278.85
List Price:  DKK kr1,046.65
You save:  DKK kr767.80
NZ$67.31
List Price:  NZ$252.67
You save:  NZ$185.35
د.إ146.73
List Price:  د.إ550.75
You save:  د.إ404.01
৳4,379.34
List Price:  ৳16,437.61
You save:  ৳12,058.27
RM190.86
List Price:  RM716.38
You save:  RM525.52
₦50,356.97
List Price:  ₦189,011.97
You save:  ₦138,655
₨11,078.47
List Price:  ₨41,582.42
You save:  ₨30,503.94
฿1,479.01
List Price:  ฿5,551.39
You save:  ฿4,072.38
₺1,299.17
List Price:  ₺4,876.37
You save:  ₺3,577.20
B$205.03
List Price:  B$769.58
You save:  B$564.55
R764.52
List Price:  R2,869.60
You save:  R2,105.07
Лв73.13
List Price:  Лв274.49
You save:  Лв201.36
₩54,936.80
List Price:  ₩206,202.11
You save:  ₩151,265.30
₪150.26
List Price:  ₪563.99
You save:  ₪413.73
₱2,300.82
List Price:  ₱8,635.99
You save:  ₱6,335.17
¥6,189.71
List Price:  ¥23,232.72
You save:  ¥17,043.01
MX$678.11
List Price:  MX$2,545.26
You save:  MX$1,867.15
QR144.95
List Price:  QR544.06
You save:  QR399.11
P554.20
List Price:  P2,080.19
You save:  P1,525.98
KSh5,373.27
List Price:  KSh20,168.27
You save:  KSh14,795
E£1,912.60
List Price:  E£7,178.85
You save:  E£5,266.25
ብር2,263.10
List Price:  ብር8,494.41
You save:  ብር6,231.31
Kz33,355.91
List Price:  Kz125,199.50
You save:  Kz91,843.58
CLP$38,100.31
List Price:  CLP$143,007.31
You save:  CLP$104,907
CN¥289.48
List Price:  CN¥1,086.55
You save:  CN¥797.07
RD$2,358.27
List Price:  RD$8,851.64
You save:  RD$6,493.36
DA5,369.66
List Price:  DA20,154.72
You save:  DA14,785.06
FJ$91.61
List Price:  FJ$343.85
You save:  FJ$252.24
Q310.23
List Price:  Q1,164.43
You save:  Q854.20
GY$8,348.16
List Price:  GY$31,334.33
You save:  GY$22,986.17
ISK kr5,619.76
List Price:  ISK kr21,093.46
You save:  ISK kr15,473.70
DH403.24
List Price:  DH1,513.54
You save:  DH1,110.30
L711.11
List Price:  L2,669.11
You save:  L1,958
ден2,300.75
List Price:  ден8,635.74
You save:  ден6,334.98
MOP$322.07
List Price:  MOP$1,208.89
You save:  MOP$886.82
N$764.41
List Price:  N$2,869.17
You save:  N$2,104.76
C$1,463.02
List Price:  C$5,491.39
You save:  C$4,028.36
रु5,322.32
List Price:  रु19,977.02
You save:  रु14,654.70
S/147.05
List Price:  S/551.96
You save:  S/404.90
K151.07
List Price:  K567.06
You save:  K415.98
SAR149.84
List Price:  SAR562.41
You save:  SAR412.57
ZK1,028.45
List Price:  ZK3,860.25
You save:  ZK2,831.79
L186.04
List Price:  L698.31
You save:  L512.27
Kč943.79
List Price:  Kč3,542.47
You save:  Kč2,598.68
Ft14,707.23
List Price:  Ft55,202.73
You save:  Ft40,495.50
SEK kr434.09
List Price:  SEK kr1,629.35
You save:  SEK kr1,195.26
ARS$34,866.52
List Price:  ARS$130,869.47
You save:  ARS$96,002.95
Bs274.66
List Price:  Bs1,030.94
You save:  Bs756.27
COP$155,927.93
List Price:  COP$585,266.43
You save:  COP$429,338.49
₡20,023.88
List Price:  ₡75,158.48
You save:  ₡55,134.59
L981.04
List Price:  L3,682.28
You save:  L2,701.24
₲294,922.92
List Price:  ₲1,106,976.03
You save:  ₲812,053.11
$U1,532.67
List Price:  $U5,752.80
You save:  $U4,220.12
zł161.60
List Price:  zł606.56
You save:  zł444.96
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.