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