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.40
List Price:  €144.15
You save:  €105.75
£31.87
List Price:  £119.64
You save:  £87.76
CA$57.46
List Price:  CA$215.67
You save:  CA$158.21
A$64.10
List Price:  A$240.61
You save:  A$176.50
S$54.26
List Price:  S$203.67
You save:  S$149.41
HK$310.31
List Price:  HK$1,164.76
You save:  HK$854.44
CHF 35.93
List Price:  CHF 134.87
You save:  CHF 98.94
NOK kr454.39
List Price:  NOK kr1,705.56
You save:  NOK kr1,251.16
DKK kr286.51
List Price:  DKK kr1,075.42
You save:  DKK kr788.90
NZ$70.83
List Price:  NZ$265.87
You save:  NZ$195.03
د.إ146.73
List Price:  د.إ550.76
You save:  د.إ404.03
৳4,766.44
List Price:  ৳17,890.59
You save:  ৳13,124.14
RM178.53
List Price:  RM670.12
You save:  RM491.59
₦61,746.72
List Price:  ₦231,762.72
You save:  ₦170,016
₨11,104.31
List Price:  ₨41,679.41
You save:  ₨30,575.09
฿1,365.49
List Price:  ฿5,125.29
You save:  ฿3,759.80
₺1,408.70
List Price:  ₺5,287.50
You save:  ₺3,878.79
B$269.52
List Price:  B$1,011.65
You save:  B$742.12
R744.22
List Price:  R2,793.40
You save:  R2,049.17
Лв75.14
List Price:  Лв282.05
You save:  Лв206.91
₩58,527.63
List Price:  ₩219,680.06
You save:  ₩161,152.43
₪146.39
List Price:  ₪549.46
You save:  ₪403.07
₱2,315.72
List Price:  ₱8,691.92
You save:  ₱6,376.20
¥6,289.74
List Price:  ¥23,608.20
You save:  ¥17,318.45
MX$805.86
List Price:  MX$3,024.77
You save:  MX$2,218.90
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,033.41
List Price:  E£7,632.32
You save:  E£5,598.90
ብር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,554.45
List Price:  CLP$148,465.34
You save:  CLP$108,910.89
CN¥291.59
List Price:  CN¥1,094.47
You save:  CN¥802.87
RD$2,429.65
List Price:  RD$9,119.56
You save:  RD$6,689.91
DA5,402.27
List Price:  DA20,277.14
You save:  DA14,874.86
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,572.22
List Price:  ISK kr20,915.02
You save:  ISK kr15,342.80
DH402.23
List Price:  DH1,509.75
You save:  DH1,107.52
L734.24
List Price:  L2,755.94
You save:  L2,021.69
ден2,364.09
List Price:  ден8,873.48
You save:  ден6,509.39
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
SAR149.98
List Price:  SAR562.97
You save:  SAR412.98
ZK1,103.85
List Price:  ZK4,143.26
You save:  ZK3,039.40
L191.10
List Price:  L717.30
You save:  L526.19
Kč964.41
List Price:  Kč3,619.86
You save:  Kč2,655.45
Ft15,736.81
List Price:  Ft59,067.22
You save:  Ft43,330.41
SEK kr442.03
List Price:  SEK kr1,659.16
You save:  SEK kr1,217.12
ARS$40,962.17
List Price:  ARS$153,749.14
You save:  ARS$112,786.96
Bs275.61
List Price:  Bs1,034.52
You save:  Bs758.90
COP$176,459.02
List Price:  COP$662,328.69
You save:  COP$485,869.66
₡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.81
List Price:  zł614.88
You save:  zł451.06
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.