Taking Care of False Positive Using Local Variables

SystemVerilog Assertions and Functional Coverage From Scratch Local Variables and Endpoint Sequence Methods
8 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.23
List Price:  €139.77
You save:  €102.53
£31.92
List Price:  £119.84
You save:  £87.91
CA$54.56
List Price:  CA$204.79
You save:  CA$150.23
A$61.15
List Price:  A$229.52
You save:  A$168.37
S$54.36
List Price:  S$204.07
You save:  S$149.70
HK$312.74
List Price:  HK$1,173.85
You save:  HK$861.11
CHF 36.44
List Price:  CHF 136.79
You save:  CHF 100.35
NOK kr439.58
List Price:  NOK kr1,649.96
You save:  NOK kr1,210.37
DKK kr277.70
List Price:  DKK kr1,042.33
You save:  DKK kr764.63
NZ$67.15
List Price:  NZ$252.06
You save:  NZ$184.90
د.إ146.73
List Price:  د.إ550.75
You save:  د.إ404.01
৳4,383.25
List Price:  ৳16,452.29
You save:  ৳12,069.03
RM190.54
List Price:  RM715.18
You save:  RM524.64
₦52,183.48
List Price:  ₦195,867.68
You save:  ₦143,684.20
₨11,123.27
List Price:  ₨41,750.57
You save:  ₨30,627.29
฿1,476.02
List Price:  ฿5,540.17
You save:  ฿4,064.15
₺1,299.99
List Price:  ₺4,879.44
You save:  ₺3,579.45
B$206.11
List Price:  B$773.65
You save:  B$567.53
R753.55
List Price:  R2,828.41
You save:  R2,074.86
Лв72.76
List Price:  Лв273.13
You save:  Лв200.36
₩54,963.89
List Price:  ₩206,303.76
You save:  ₩151,339.87
₪152.13
List Price:  ₪571.04
You save:  ₪418.90
₱2,304.99
List Price:  ₱8,651.66
You save:  ₱6,346.66
¥6,264.82
List Price:  ¥23,514.64
You save:  ¥17,249.82
MX$688.89
List Price:  MX$2,585.73
You save:  MX$1,896.83
QR145.70
List Price:  QR546.89
You save:  QR401.19
P551.27
List Price:  P2,069.18
You save:  P1,517.90
KSh5,393.25
List Price:  KSh20,243.25
You save:  KSh14,850
E£1,913.66
List Price:  E£7,182.84
You save:  E£5,269.17
ብር2,274.67
List Price:  ብር8,537.87
You save:  ብር6,263.19
Kz33,385.68
List Price:  Kz125,311.21
You save:  Kz91,925.53
CLP$37,892.57
List Price:  CLP$142,227.57
You save:  CLP$104,335
CN¥289.50
List Price:  CN¥1,086.64
You save:  CN¥797.13
RD$2,346.54
List Price:  RD$8,807.63
You save:  RD$6,461.08
DA5,364.69
List Price:  DA20,136.06
You save:  DA14,771.36
FJ$90.28
List Price:  FJ$338.87
You save:  FJ$248.59
Q310.73
List Price:  Q1,166.33
You save:  Q855.59
GY$8,356.11
List Price:  GY$31,364.19
You save:  GY$23,008.07
ISK kr5,589
List Price:  ISK kr20,978
You save:  ISK kr15,389
DH404.19
List Price:  DH1,517.10
You save:  DH1,112.91
L709.91
List Price:  L2,664.60
You save:  L1,954.69
ден2,292.87
List Price:  ден8,606.18
You save:  ден6,313.30
MOP$321.89
List Price:  MOP$1,208.23
You save:  MOP$886.33
N$764.99
List Price:  N$2,871.35
You save:  N$2,106.36
C$1,469.89
List Price:  C$5,517.15
You save:  C$4,047.26
रु5,317.95
List Price:  रु19,960.64
You save:  रु14,642.68
S/149.01
List Price:  S/559.33
You save:  S/410.31
K153.84
List Price:  K577.43
You save:  K423.59
SAR149.83
List Price:  SAR562.39
You save:  SAR412.56
ZK1,051.42
List Price:  ZK3,946.47
You save:  ZK2,895.04
L185.30
List Price:  L695.51
You save:  L510.21
Kč936.50
List Price:  Kč3,515.12
You save:  Kč2,578.62
Ft14,615.73
List Price:  Ft54,859.30
You save:  Ft40,243.57
SEK kr435.47
List Price:  SEK kr1,634.51
You save:  SEK kr1,199.04
ARS$34,906.15
List Price:  ARS$131,018.21
You save:  ARS$96,112.06
Bs276.58
List Price:  Bs1,038.15
You save:  Bs761.56
COP$157,441.81
List Price:  COP$590,948.68
You save:  COP$433,506.87
₡20,076.59
List Price:  ₡75,356.33
You save:  ₡55,279.73
L986.13
List Price:  L3,701.41
You save:  L2,715.27
₲296,697.58
List Price:  ₲1,113,637.11
You save:  ₲816,939.52
$U1,532.08
List Price:  $U5,750.59
You save:  $U4,218.50
zł160.94
List Price:  zł604.08
You save:  zł443.14
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 this lecture. In this lecture we'll see how you may end up getting a false positive using the clock delay range operator if you're not careful, and we'll also see how to solve that problem using local variables. So let's start with a very simple property. And this property and as you have seen before, since our look assertions is a multi threaded language, so in this property, I'm saying that when ready is true, it implies at at that time with overlapping operator, that ready act must arrive from within one clock to five clocks, very simple property. But let me show you what happens. So he has ready, ready and claw.

Now let's say that he arrives at this clock and within one to five clocks 123 and four clock, let's say ready arrives when that happens the property will pass. But let's say that ready also arrives at the very next clock as shown yet in as well as also looks for RadioShack within one to five clocks and it says one two and three, three clock later already. So, it also passes. But how do you know that this ready either came for s one or s two for example ready I came for s one but it never came for s two you will still see a pass indication because as to have no idea that the radio game for as one. So this is a false positive. And this is very dangerous.

It's not a limitation of the language. It's just a way the multi threaded concepts or semantics of the language works. So you have to be very careful when you use clock delay range operator for false positives. So let me show you a simulation log on how this false positive can come. So add at 30 at 20. Ready becomes one.

And then at the next clock, we recognize it and enter v enter the sequence already arrives. So that's the first ready now we move along and then a second ready comes at 70. And we enter the sequence and we say second ready is detected. But at 90 radio comms and vote ready is will be considered acknowledged, and the property will pass. This is a real simulation log from my test bench. And as you can clearly see that the property passes on a single radio for border radius.

So how do we solve this problem? That's where the local variables come into picture. So the way to solve this problem is for every ready, you need to create a ready num, some number associated with ready in your test bench. And also for every ready act, you need to create another number that's associated with a ready EQ. This is very similar to ID bass bus, for example in axi reads or writes can be pipelined. Before one raid is over, you can issue another read and the Only way your hardware would know, or data came for which read is when an ID is associated with each read.

So the concept is the same here. So what I'm doing here is I'm creating a sequence ready, check, and I'm declaring a local variable called local data. Then in the sequence as we have seen with local variables, local variables must be attached to an expression. Since I don't have an expression, I simply say true. One, take B one, and at that time, remember or store the readiness that you created in your test went into local data. Also, notice that with any expression, you can attach any sub routine.

So here I'm simply attaching $1 display. So as a side note, this is a very useful way that you can put dollar this way statements in your sequences or properties to help you debug as you simulate your design. So I am storing writing them into local data, then I have to wait for one to five blocks. And then I'm checking to see that radio has arrived. And if radio is true, then I also check to see that that radio num is the same as the one that was stored in local data. So, this way, we know that this radio economic is associated with this ready and when you do this, you will not get a false positive because we are checking for every readiness, the associated radiate now.

So in our in our case, when first ready, comes, let's say ready now We ready equal to one and then when ready He comes reject to see that ready act now numbers also want and then less seven ready comes again and let's set for that we do not get ready then during the property when we are waiting for one to five clogs, you will see that if readin act numb did calm and it is still one than the property should fail. So this is how you will solve the problem using local variables. And this is a very important concept you must understand and see how local variables can help you with pipeline multithreaded assertions in system our log. So here's just a simple log. First radio arrives. And here this display statement is is coming.

It's coming from the display Man that is that I just shown short here, enter sequence local ready now we call the local data. So, first ready arrives then after some time when ready arrives, the sequence checks to see that is ready act number corresponds to the force ready now any of that is true then the property passes. So now we have made sure that the ready act that arrived is indeed for ready number one and then when second radio arrives we we check to see whenever ready arrives again like here that the red Vietnam do is equal to ready now. So now we know that they're ready, arrived for the second ready and if the numbers do not match the property phase so in this As of course I have may decide that they're ready now my ready economic match and the property passes. So please revisit the slides if you're not sure how it works.

And make sure that you take care of false positives in your design. That's all for this lecture. Thank you.

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.