.triggered, .matched, Calling Subroutines, Sequence as a Formal Argument

SystemVerilog Assertions and Functional Coverage From Scratch Local Variables and Endpoint Sequence Methods
16 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 lecture number 18. In this lecture, we'll try to cover quite a few things, all small but very important features of the language. We'll start with detecting and using endpoint of a sequence. mainly two different methods called or triggered and matched. And in addition, we'll also look at how to call sub routines attached to a sequence. How do you sequence as a formal argument and sequence as an antecedent, which is something we haven't seen so far, we have always seen sequence on the consequences side.

But before we move forward, I need to point out that until 2005, there used to be a method called dot ended. But in 2009, the LRM got rid of dot ended and in this plays now supports something called dot trigger. In other words, in this lecture you'll see that I use triggered because dot ended has been phased out. But if you're not using dollar 2009 or 2012 LRM, or your simulator does not support it, then literally replaced or triggered with dot ended in this particular lecture, and you're good to go. So the reason for how to say ending dot ended is that dot ended was a subset of dot triggered. So instead of having two different methods, what the alarm said was, let's get rid of dot ended and the dot ended was allowed only to be attached to a sequence.

But dot trigger can be used both in a sequence as well as in procedural block and also in level sensitive rates statement. I believe you're all familiar with level sensitive wage statement or variable Okay, so let's look at one feature at a time. dot trigger, as I just said or triggered is a method on a sequence. And as a method, it will not return a value, but it will simply return true or false. Let's look at an example first and then I will go into some of the detail. So, here's an example.

Here's an example, where racing property and cycle says that it pauses of clock dollar rows and branch implies non overlapping that branch must have ended or trigger and branch says a particular temporal domain relationship between ABC and D. For this example, it doesn't matter what the relationship is, it is some relationship. Now let's see what this really means. So when the N branch arises goes from zero to one at sensitive. What we're looking for is that at the very next clock, this entire sequence branch sequence must have ended or.or dot triggered. In other words, when we were waiting for an branch to go from zero to one, the simulator was also monitoring sequence branch in parallel. So, because it was doing that in parallel because of the method triggered attached to it, so when the end branch arrives at the next clock, this entire sequence must have ended.

It was again being monitored in parallel. If you removed or triggered or dot ended, there, what we know what we end up doing is after the riser branch, we will then trigger a sequence branch and then wait for the temporal domain. But that's not what we want when branch ended ends, we want the branch to have completed. If you want to accomplish something like that, then this is a very powerful and intuitive way to accomplish that. So again, whenever the endpoint of a sequence is reached, dollar dot triggered will be true, regardless of when the sequence started. It's only when the sequence ends.

That's what we are interested in. A couple of rules, indoor triggered, both This is called the source doc. The brand the clock in the sequence. This is the clock in the Properties called the destination clock. And with if you're going to use DOD triggered both the sole source and destination clocks must be the same. That is, it's not a restriction but that's how I got triggered work.

So what if you want two different jobs because most of the designs as we discussed earlier, uses different blocks between different logs. That will be accomplished by dot matched as we will soon see. And lastly, use of a method on an unplugged sequence is illegal. So for example here dot trigger is is on the sequence branch and as you can see branches explicitly clock. If this was unclogged, then there would be a compile time error. So that should clarify what dot triggered or earlier what used to be called dot ended works.

Let's take a couple of examples. Here purposely I'm showing how dot trigger can be used in level sensitive weight as I said, said earlier so wait until a bus triggered is but bus grant is dot trigger. And if it is then we can say that bus grant is given obvious. Now here there are two sequences one is ready and one frame is ready start and then two blocks later it ends frame starts and within one to six in clogs, it will end. Now what we are saying is on the antecedent side, if this sequence matches that is no doubt triggered or anything here it just when it matches the when the antecedent is true that we want to make sure that T aboard never asserts never goes low until frame is triggered. When framed or triggered.

That means when this sequence has ended t aborts should remain low. I haven't discussed the operator until which we will do later. But it's a very intuitive operator at the same time very powerful. So, as you can see, we do not care for when the frame started, but it should end it can end anytime when to abort should remain low. So these are the two simple examples of dot triggered Now let's look at DOT matched. It's also method on a sequence.

And basically as I just said, if the source clock and the destination clocks are differences source clock here is positive clock destination clock is positive of Cisco. They they are different and you cannot use dot dot triggered here. You have to use dot matched if your source and destination clocks are different So, let's look at this particular example. This is even more interesting than the one we saw in DOD triggered here what we're saying is in this sequence as well positive says clock, reset one clock later inst some variable or expression one calculator after inst this sequence II one must have matched or in other words that also is it has ended dot trigger dot ended and dot match do not we do not v as a user, the language semantics says that you do not care when they started, all three must end when you ask them to end.

So, when this sequence was in progress, after in this particular sequence was made Monitor in parallel, and it should end one clock after inst. If it doesn't, then the entire sequence sequence a two phase. And so what we're saying here is our friends, one paraglider, the sequence even should match, at least once this is the non consecutive go to operator, and then one clock later, you branch back. So, again, at what we're doing here is that we are using the dot matched in the middle of a sequence as a subsequence. And as you can see, this would be very difficult to do if we did not have dot matched, we would have to monitor the dot match and somehow trigger some kind of a variable that can be used here. And we have explicitly run sequence even in parallel to sequel See two dot matched does it for you.

Okay, so again to reiterate dot matched dot sugar, and dot ended dot and it has been phased out. But these three basically run in parallel, and is the endpoint that we are interested in. And that's what we get if we attach any of these three methods to a sequence. Now, let's look at some other features of the language. And I think I have shown this particular feature in my many of my examples before. So here, in this example, there's a property not as and not as says that if A is true, do make sure that the CD sequence CD holds.

Now as you can see With a we have a test sub routine. This can be any sub routine, this can be any task. I'm simply showing a display task. So please don't run away with the impression that the only method or only sub routine you can attach is display task. The reason I show this late asks so often is is my way of debugging an assertion is the best way I can debug an assertion because I know exactly when a became true. I know exactly when CD became true, and I would get a display.

So this is how you attach a sub routine to the expression in a property and to a sequence call. And within C, D, lo and behold, sure, you can have another separate pain attached to the expression. So basically the point is, you can attach a sub routine in a property as well as the city Words. This is another feature Actually, it's not a feature. It's the way you use the language. And I use this quite a bit to make my code modular, and I have emphasized this point many times before, try to create generic sequences, and then use the binding between formal and actual to create multiple sequences, they that use that generic sequence, but the generic sequence into a library.

But the powerful feature here is for example, let's say I have a sequence called reset sequence. Very simple. Bank we say to clock later reset, this is your reset sequence. And I want to use this reset sequence repeatedly in different properties. See how powerful this is. This property takes a sequence As a formal argument, a sequence.

So when we insert a property, what I'm doing is I'm taking a reset sequence, which is a sequence, and I'm passing the entire reset sequence to sequence which is used in the property. And this property said that when the sequence is true, which is reset sequence, the consequential hold. So, we can create a sequence, what I call a generic sequence or any sequence for you can call it whatever you like. You can create a sequence and pass the entire sequence as an actual to a property's formal. And I think this is by far one of the most powerful features of this language. Another way of using a sequence and so far we have seen that in all my examples, sequence Well as always use in the consequent.

We always say if ABC, whatever antecedent is true, it implies subsequence should hold. Here, what I'm doing is I'm combining a couple of features. So here I have a sequence, a C, D, called CQ. And I'm going to pause that sequence as an actual do this particular property s underscore RC one. In this, I'm going to attach a sub routine. And then I'm going to call this recursive property.

We will look at recursive property a bit later. But keeping that aside, what we have done is we have used a sequence as an antecedent this sequence so CD this sequence is uses an antecedent to trigger the consequent. What and you have to carefully understand what a sequence in antecedent means. Again, let's assume t sequence was on the right hand side the consequent side. If it fails, then the entire property fails. But if it's on the antecedent side, if it fails, the property does not fail.

Because it's on the antecedent side antecedent means that on the match on the trueness, when the antecedent is true, do something on the consequent side. So C sequent c underscore sequence is not true. Then antecedent is not true. And if antecedent is not true, either you get vacuous pass or you basically do nothing and you continue to wait till c underscore Sq is true. So this is a real difference when you use a sequence antecedent versus a sequence as a consequent. So I'll end this lecture at this point.

It's the few features that we have discussed are indeed very powerful sequence as an actual sequence as an antecedent and sub routine attached to a sequence. Thank you for attending the lecture, and I will soon see you in the next lecture.

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.