.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
€37.49
List Price:  €140.73
You save:  €103.23
£32.34
List Price:  £121.40
You save:  £89.06
CA$54.75
List Price:  CA$205.51
You save:  CA$150.76
A$61.92
List Price:  A$232.43
You save:  A$170.50
S$54.44
List Price:  S$204.37
You save:  S$149.92
HK$313.04
List Price:  HK$1,174.98
You save:  HK$861.94
CHF 36.43
List Price:  CHF 136.76
You save:  CHF 100.32
NOK kr440.04
List Price:  NOK kr1,651.67
You save:  NOK kr1,211.62
DKK kr279.73
List Price:  DKK kr1,049.95
You save:  DKK kr770.22
NZ$67.60
List Price:  NZ$253.75
You save:  NZ$186.15
د.إ146.72
List Price:  د.إ550.72
You save:  د.إ403.99
৳4,381.10
List Price:  ৳16,444.22
You save:  ৳12,063.12
RM190.96
List Price:  RM716.76
You save:  RM525.80
₦50,215.55
List Price:  ₦188,481.15
You save:  ₦138,265.60
₨11,109.61
List Price:  ₨41,699.27
You save:  ₨30,589.66
฿1,479.62
List Price:  ฿5,553.69
You save:  ฿4,074.07
₺1,302.46
List Price:  ₺4,888.73
You save:  ₺3,586.27
B$206.40
List Price:  B$774.71
You save:  B$568.31
R768.58
List Price:  R2,884.84
You save:  R2,116.25
Лв73.23
List Price:  Лв274.90
You save:  Лв201.66
₩55,047
List Price:  ₩206,615.74
You save:  ₩151,568.73
₪151.09
List Price:  ₪567.14
You save:  ₪416.04
₱2,299.20
List Price:  ₱8,629.92
You save:  ₱6,330.71
¥6,184.26
List Price:  ¥23,212.26
You save:  ¥17,028
MX$683.97
List Price:  MX$2,567.24
You save:  MX$1,883.27
QR145.58
List Price:  QR546.42
You save:  QR400.84
P552.91
List Price:  P2,075.34
You save:  P1,522.42
KSh5,373.27
List Price:  KSh20,168.27
You save:  KSh14,795
E£1,920.78
List Price:  E£7,209.54
You save:  E£5,288.76
ብር2,272.54
List Price:  ብር8,529.85
You save:  ብር6,257.31
Kz33,355.91
List Price:  Kz125,199.50
You save:  Kz91,843.58
CLP$38,057.56
List Price:  CLP$142,846.86
You save:  CLP$104,789.30
CN¥289.50
List Price:  CN¥1,086.65
You save:  CN¥797.14
RD$2,354.89
List Price:  RD$8,838.95
You save:  RD$6,484.06
DA5,371.99
List Price:  DA20,163.47
You save:  DA14,791.48
FJ$90.98
List Price:  FJ$341.48
You save:  FJ$250.50
Q310.55
List Price:  Q1,165.66
You save:  Q855.10
GY$8,351.80
List Price:  GY$31,348
You save:  GY$22,996.20
ISK kr5,635.34
List Price:  ISK kr21,151.94
You save:  ISK kr15,516.60
DH404.80
List Price:  DH1,519.42
You save:  DH1,114.61
L712.31
List Price:  L2,673.63
You save:  L1,961.31
ден2,307.78
List Price:  ден8,662.15
You save:  ден6,354.36
MOP$322.18
List Price:  MOP$1,209.30
You save:  MOP$887.12
N$762.08
List Price:  N$2,860.42
You save:  N$2,098.34
C$1,469.23
List Price:  C$5,514.70
You save:  C$4,045.46
रु5,324.31
List Price:  रु19,984.51
You save:  रु14,660.19
S/147.09
List Price:  S/552.12
You save:  S/405.02
K151.71
List Price:  K569.44
You save:  K417.73
SAR149.84
List Price:  SAR562.43
You save:  SAR412.59
ZK1,030.91
List Price:  ZK3,869.47
You save:  ZK2,838.55
L186.57
List Price:  L700.28
You save:  L513.71
Kč947.29
List Price:  Kč3,555.61
You save:  Kč2,608.32
Ft14,774.42
List Price:  Ft55,454.95
You save:  Ft40,680.52
SEK kr434.98
List Price:  SEK kr1,632.69
You save:  SEK kr1,197.70
ARS$34,847.04
List Price:  ARS$130,796.34
You save:  ARS$95,949.30
Bs276.83
List Price:  Bs1,039.07
You save:  Bs762.23
COP$156,092.45
List Price:  COP$585,883.94
You save:  COP$429,791.48
₡19,980.82
List Price:  ₡74,996.86
You save:  ₡55,016.04
L985.47
List Price:  L3,698.91
You save:  L2,713.44
₲295,798.83
List Price:  ₲1,110,263.70
You save:  ₲814,464.87
$U1,539.17
List Price:  $U5,777.18
You save:  $U4,238.01
zł161.98
List Price:  zł608
You save:  zł446.02
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.