Sampled Value Functions (Part 1): $rose, $fell

SystemVerilog Assertions and Functional Coverage From Scratch Concurrent Assertions – Sampled Value Function
13 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 eight. In this lecture, we will examine and study what is known as sample value functions. And I will explain to you, of course, why they are called sample value functions. So let's start with two of the sample value functions. One is dollar rows, dollar rows, here's the syntax, dollar rows have an expression, and you can have an explicit clocking event. Or you don't need it.

It's, it's, it's an optional thing. And I will show you when you really need it. The important thing to understand here is that it will return true if the least significant bit of the expression change to one from the previous take of the talking event. So let's say if you have a bus of 32 bits, and you said dollar rose, it won't look for the entire 32 big buzz to go from From zero to one, it will only look at the least significant bit of that buzz. And if that significant bit goes from zero to one, then dollar roses will be considered to be true. Also note that, just like in Verilog, it's it's a transition could be zero to one x to one or zero to one, anything that goes to one or that rises to one.

But now I want to point out a very important difference. dollar Rose is not dollar balls edge is a big difference. Balls edge means anytime, anytime a signal goes from zero to one, it's a positive in very low cost system or low. dollar rose on the other hand is at this clock. Any clock at a given clock if the sample value or The expression in the pre pond region is one. And if the sample value of the expression in the previous Clarke's pre pond region was zero, or x or z, then it dollar rose will be considered to pass.

So it's between two clocks. And it's not an immediate project kind of semantic is between two clocks. And between these two clocks, one clock now and one clock in the past the sample value of the expression in the pre pond region. If you're not familiar, or you did not get the concept, please go back to the lecture where I talk about frequent region. And because it's a sample value between two clocks, that gets evaluated and then you determine whether dollar rolls occurred or not, is why they are called sample value functions. Similar to dollar rows there is Dollar fell identical, only that the least significant bit should be zero from the previous state of the grokking event again, the current sample value in the proposed region is zero, the sample value in the prepon region of the previous clock was one or X or Z, then Dollar fell is considered to pass.

So, the the other point I want to point out and some people miss this, let's say at the very first clock, this is your very first clock day, you don't really have the previous clock, then obviously the value is compared against x. And this is something that you need to know because many times during initial time, assertions fire they fail, they don't fail and is easy to miss that everything is compared against x because There is no previous talk. And and the as I just said the clocking event is optional. And it's usually derived from the clocking event of the assertion either the assertion like we have seen or from the input clock of the procedural block. And I will show you in in in just the next couple of slides what that means. So, this functions can be used in properties of sequences, as well as procedural code and I'll show you an example of all three on how they can be used.

Okay, let's see dollar rose. So here I'm saying property check, I act at pauses of clock, you need an edge in any concurrent assertions. So I pause of talk, which is a sampling edge, dollar rose interrupt, non overlapping implies dollar rows. Many if at this clock you see dollar rows interrupt interrupt has gone to one in the pre porn region and was zero in the previous clock prepon region then at the next clock I should go Hi. So, here is the timing diagram and you can see that at this clock edge interrupt goes interrupt does not go higher this clock edge in the pre pawn region it was one which is here before clock went high in the prepon region right here right now Delta before the clock edge and it goes zero in the pre planned region of the previous clock tick and said this this clock edge is considered dollar rose.

Same theory applies. So, at this clock a it's considered dollar rose I egg or rise I And then the property passes. But if dollar rose interrupt takes place at this college of clock, and is indeed one at this quality of clock, it's a level sensitive one, what we expected was that it should rise from the previous clock, it doesn't end the property phase. Now, why is edge detection useful? Why Why is it useful? Why can't I just use level sensitive?

So let's say you use level sensitive in in this example we did a sensitive interrupt at sensitive I. In this example I'm doing level sensitive interrupt implies that I will be true the next clock. Okay. So this was going to happen, let's say DeRose and dollar rose here and dollars. Rose is here at the clock edge, it goes up on here in the prepon region, it was a one here it was a one here in the pre pond region and this property will pass because the level was one it before the interrupt Anya is at two clocks and as required by the property will pass. But So will this there is an edge here, but at level level was one and at the next clock level was one and the property will pass you if you are expecting an edge on an ayah that you have made a mistaken identity assertion.

But more importantly, and this is an it's a very important point that you need to remember when you design your assertions. See what's happening here is we have a level sensitive interrupt and level sensitive. I remember when I say level sensitive is the antecedent. That's levels in To do and if the consequences level sensitive, not the sampling edge, sampling edge will always be edge sensitive. Okay, so interrupt, as you can see in this diagram, for example, entropy is one at this clock is one, it's one, and it says one, every clause that it will sample interrupt will be one, it will keep firing this property, again and again and again. So if you're simply trying to say that whenever there is interrupt that I actually come the next clock and then you're done.

That's not that's not what's going to happen with this particular property. So I strongly recommend that your antecedent should be as sensitive to the extent possible, there will be times when you cannot have an as sensitive and just hit it, and that's fine. But in this case, if you were expecting this behavior, The left hand side of the timing diagram here, then this assertion will simply consume your simulation time for no reason. And you will get false positive. So So let's say you go ahead and say okay, I'll go ahead and do an edge sensitive on the consequent. But remember interrupt is still level sensitive.

So what's going to happen? This will pass because dollar Rose is at this pause, it is true. And intervals one doesn't matter whether it went to one or it was one at this sampling edge in the prepon region and this will pass but guess what? Since this is level sensitive, the next clock right here, interrupt a sample highs so the property is going to fire again and that is going to look for door rolls is Well guess what, once the IQ is high, it's just going to remain high. And this will fake. So if you're designing this way, and if there's a failure, you will be totally confused as to why is it failing?

It did pass. I did get my iron for the intro, but now why is it failing? So the bottom line is you, you basically have to have in this particular case, and I'm just showing you the Dollar fell and as sensitive behavior on both the antecedent and consequent, so Dollar fell request, and I'm saying es fel grad, as well as a sequence I'm just making it a bit more interesting. And inside there is a formula called a which gets the actual grind and everything dollar for dollar fell grant. And he has a very simple application, but I'm showing you Simple applications, but these applications are very useful. So, and you will see that some of the simpler assertions will give you more bang for your buck.

So, here I'm saying whenever right enable is asserted, that means it goes lower is an active low signal that at the same time because this is an overlapping implication, that right data cannot be a No, we haven't seen a reason not but you can logically intuitively figure out what that means. Now, as I was telling you earlier, dollar rows and Dollar fell can be used in sequence property or procedural block also. Now here, let's say in this procedural block, were saying always at positive clock, cordon is equal to send cnn And dollar rose ice cream down. This is amazingly powerful, you have a level sensitive that is done bitwise AND with an X sensitive or sampled quote unquote value function can be combined in a in a Boolean. Now you can see that dollar rose I assumed and does not have a clock. So, the clock is infer from the always block, which is the part of the dollar rose or Dollar fell definition.

More interestingly, for example, I want to assert system exception, if two interrupts go higher at the same time it's unknown and the entire system is going to fall apart. You can do that you This is impossible in Verilog. You cannot have two edge sensitive constructs anded together So you can do this and again for both of dollar rows, the clock is inferred from the previous or the always at pause, positive clock. You can use dollar rows and dollar fail even in continuous assignment. These are very powerful continuous assignment, you can use them. Procedural block, you can use them sequences, you can use them properties, you can use them.

And here the key thing you need to note is that it's a continuous assignment. There is no inference of cloud from a procedural blog. There is no inference of cloud from sequence or property. So you have to explicitly provide the sampling edge within the continuous assignment. So that's the key unit to remember if you use that in the continuous assignment.

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.