Modeling Variable Delay Using Local Variables

SystemVerilog Assertions and Functional Coverage From Scratch Local Variables and Endpoint Sequence Methods
5 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
€36.76
List Price:  €137.98
You save:  €101.22
£31.41
List Price:  £117.91
You save:  £86.50
CA$54.45
List Price:  CA$204.40
You save:  CA$149.94
A$59.89
List Price:  A$224.81
You save:  A$164.91
S$53.80
List Price:  S$201.96
You save:  S$148.15
HK$311.75
List Price:  HK$1,170.14
You save:  HK$858.38
CHF 36.33
List Price:  CHF 136.38
You save:  CHF 100.04
NOK kr426.11
List Price:  NOK kr1,599.41
You save:  NOK kr1,173.29
DKK kr274.31
List Price:  DKK kr1,029.63
You save:  DKK kr755.31
NZ$65.47
List Price:  NZ$245.75
You save:  NZ$180.27
د.إ146.73
List Price:  د.إ550.75
You save:  د.إ404.02
৳4,682.25
List Price:  ৳17,574.58
You save:  ৳12,892.32
RM187.46
List Price:  RM703.64
You save:  RM516.17
₦60,056.87
List Price:  ₦225,419.99
You save:  ₦165,363.11
₨11,127.48
List Price:  ₨41,766.35
You save:  ₨30,638.87
฿1,450.51
List Price:  ฿5,444.42
You save:  ฿3,993.90
₺1,286.39
List Price:  ₺4,828.42
You save:  ₺3,542.02
B$203.93
List Price:  B$765.44
You save:  B$561.51
R724.01
List Price:  R2,717.55
You save:  R1,993.53
Лв71.89
List Price:  Лв269.84
You save:  Лв197.94
₩54,411.49
List Price:  ₩204,230.37
You save:  ₩149,818.87
₪146.79
List Price:  ₪551
You save:  ₪404.20
₱2,325.74
List Price:  ₱8,729.56
You save:  ₱6,403.81
¥6,241
List Price:  ¥23,425.26
You save:  ¥17,184.25
MX$660.41
List Price:  MX$2,478.82
You save:  MX$1,818.41
QR145.81
List Price:  QR547.31
You save:  QR401.49
P540.32
List Price:  P2,028.06
You save:  P1,487.74
KSh5,263.41
List Price:  KSh19,755.91
You save:  KSh14,492.50
E£1,864.07
List Price:  E£6,996.69
You save:  E£5,132.62
ብር2,296.85
List Price:  ብር8,621.10
You save:  ብር6,324.25
Kz33,897.57
List Price:  Kz127,232.57
You save:  Kz93,335
CLP$35,583.46
List Price:  CLP$133,560.46
You save:  CLP$97,977
CN¥283.11
List Price:  CN¥1,062.64
You save:  CN¥779.53
RD$2,339.29
List Price:  RD$8,780.39
You save:  RD$6,441.09
DA5,370.49
List Price:  DA20,157.84
You save:  DA14,787.34
FJ$90.26
List Price:  FJ$338.80
You save:  FJ$248.53
Q310.65
List Price:  Q1,166.03
You save:  Q855.37
GY$8,365.17
List Price:  GY$31,398.17
You save:  GY$23,033
ISK kr5,525.48
List Price:  ISK kr20,739.58
You save:  ISK kr15,214.10
DH396.18
List Price:  DH1,487.06
You save:  DH1,090.87
L704.34
List Price:  L2,643.70
You save:  L1,939.36
ден2,262.44
List Price:  ден8,491.95
You save:  ден6,229.50
MOP$321.21
List Price:  MOP$1,205.67
You save:  MOP$884.45
N$728.17
List Price:  N$2,733.14
You save:  N$2,004.97
C$1,471.63
List Price:  C$5,523.68
You save:  C$4,052.05
रु5,328.39
List Price:  रु19,999.82
You save:  रु14,671.43
S/149.45
List Price:  S/560.97
You save:  S/411.52
K155.32
List Price:  K583.01
You save:  K427.68
SAR149.83
List Price:  SAR562.38
You save:  SAR412.55
ZK1,032.56
List Price:  ZK3,875.67
You save:  ZK2,843.11
L182.82
List Price:  L686.21
You save:  L503.39
Kč907.33
List Price:  Kč3,405.61
You save:  Kč2,498.28
Ft14,151.39
List Price:  Ft53,116.42
You save:  Ft38,965.03
SEK kr425.77
List Price:  SEK kr1,598.12
You save:  SEK kr1,172.35
ARS$35,505.60
List Price:  ARS$133,268.21
You save:  ARS$97,762.61
Bs276.30
List Price:  Bs1,037.07
You save:  Bs760.77
COP$153,043.23
List Price:  COP$574,438.85
You save:  COP$421,395.62
₡20,465.10
List Price:  ₡76,814.59
You save:  ₡56,349.48
L988.24
List Price:  L3,709.33
You save:  L2,721.08
₲299,327.33
List Price:  ₲1,123,507.72
You save:  ₲824,180.38
$U1,538.57
List Price:  $U5,774.95
You save:  $U4,236.38
zł156.39
List Price:  zł587
You save:  zł430.61
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 where I will show you a how to model variable delay. As you know, and the bond bound delay delay can not be a variable, it must be constant. So there are a couple of ways you may attempt to make this delay variable, for example, and this property I'm showing a local variable. And then what I'm saying is whatever data delay that I pass, store it in the local variable Lv, and then wait from zero to that value stored in AD V and then go read data. Now, this will give you an elaboration time error combined will pass because during elaboration, the simulator needs to know the delay. And if he's variable, it does not know that delay.

So it has to be a function. So this will give you an The other way you may try to model days is by simply saying that, when read falls, wait for the read latency which I have passed into the property. And then to read data equal to expected, this also will give an error. Because read latency is a variable, and it must be a constant. This is what the semantic specify. So what if you do want variable delay?

Let's look at this example. This is an example from CPU system, where the level two cache can have different read latencies. So if the range is at the end of the queue, then the data will come with maximum latency. If the read is at the beginning of the read queue, data will arrive with minimum latency and anything in between. data will come with that in between latency Now we know that we cannot write a property where I can pass a variable latency and let it wait as long as it's supposed to wait. So, I mean, there are ways that you can handle this variable latency one is simply creating, you know, let's say there are 100, latencies hundred different properties, each with a constant delay from one to 100.

Would you do that? I don't think so. That's a that's not a clean solution at all. Or someone can say, Well, I don't care for in between latencies I will create a property with min latency and Max latency, when in mission critical applications. This will not work because in between latency also is just as important. So how would you solve this problem?

Well, local variable again comes to rescue and this is how it works. So what I'm doing is in Property read latency check, I passing it a variable latency real latency, then I'm creating a local variable called l delay, then I'm saying that every part of claw, whenever read falls, store the read latency that have passed in this property and stored it in the local variable l delay. Then at every clock, I'm going to decrement this latency and delay by doing this particular small sequence here, saying that always because it's always true, at every passage of claw decrement the local variable add delay, and keep repeating this keep recommending add delay at every claw, with the conjugative reputation operator meaning keep deleting, keep subtracting add delay forever. Until add delay is equal to zero. So for example, as every latency is three, and the next was edge of clock eight will become two, then at the next clock, it will become one, and then at the next law, it becomes zero, and this particular sequence will end.

So, this is the way you can easily create a small property where you can check for read data equal to expected data based on variable latency. This is a very good use of local variables. So, do visit this slide again. And make sure you understand this because this will be a very useful application when you can indeed how variable delays in system Verilog assertions. So, 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.