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