.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
You need to have access to the item to view this lesson.
One-time Fee
List Price:  $149.95
You save:  $110
List Price:  ₹9,995
You save:  ₹8,515
List Price:  €137.84
You save:  €101.11
List Price:  £117.33
You save:  £86.07
List Price:  CA$204.35
You save:  CA$149.91
List Price:  A$225.08
You save:  A$165.11
List Price:  S$202.10
You save:  S$148.25
List Price:  HK$1,171.22
You save:  HK$859.18
CHF 36.38
List Price:  CHF 136.56
You save:  CHF 100.18
NOK kr418.80
List Price:  NOK kr1,571.95
You save:  NOK kr1,153.15
DKK kr274.02
List Price:  DKK kr1,028.53
You save:  DKK kr754.50
List Price:  NZ$243.44
You save:  NZ$178.58
List Price:  د.إ550.76
You save:  د.إ404.02
List Price:  ৳17,592.78
You save:  ৳12,905.67
List Price:  RM703.83
You save:  RM516.31
List Price:  ₦222,294.87
You save:  ₦163,070.60
List Price:  ₨41,723.59
You save:  ₨30,607.50
List Price:  ฿5,493.49
You save:  ฿4,029.90
List Price:  ₺4,825.54
You save:  ₺3,539.91
List Price:  B$775.78
You save:  B$569.09
List Price:  R2,756.77
You save:  R2,022.30
List Price:  Лв269.60
You save:  Лв197.77
List Price:  ₩203,755.80
You save:  ₩149,470.74
List Price:  ₪551.28
You save:  ₪404.41
List Price:  ₱8,695.52
You save:  ₱6,378.84
List Price:  ¥23,522.08
You save:  ¥17,255.27
List Price:  MX$2,501.42
You save:  MX$1,834.98
List Price:  QR546.54
You save:  QR400.92
List Price:  P2,035.64
You save:  P1,493.30
List Price:  KSh19,868.37
You save:  KSh14,575
List Price:  E£7,124.12
You save:  E£5,226.10
List Price:  ብር8,550.20
You save:  ብር6,272.24
List Price:  Kz127,733.40
You save:  Kz93,702.40
List Price:  CLP$135,200.23
You save:  CLP$99,179.89
List Price:  CN¥1,066.03
You save:  CN¥782.02
List Price:  RD$8,829.03
You save:  RD$6,476.78
List Price:  DA20,172.12
You save:  DA14,797.82
List Price:  FJ$334.11
You save:  FJ$245.10
List Price:  Q1,164.57
You save:  Q854.30
List Price:  GY$31,383.27
You save:  GY$23,022.07
ISK kr5,490.72
List Price:  ISK kr20,609.12
You save:  ISK kr15,118.40
List Price:  DH1,488.72
You save:  DH1,092.09
List Price:  L2,655.64
You save:  L1,948.11
List Price:  ден8,492.81
You save:  ден6,230.14
List Price:  MOP$1,205.86
You save:  MOP$884.59
List Price:  N$2,753.72
You save:  N$2,020.06
List Price:  C$5,518.33
You save:  C$4,048.12
List Price:  रु19,930.39
You save:  रु14,620.49
List Price:  S/561.21
You save:  S/411.69
List Price:  K582.99
You save:  K427.67
List Price:  SAR562.40
You save:  SAR412.56
List Price:  ZK4,014.20
You save:  ZK2,944.73
List Price:  L685.87
You save:  L503.14
List Price:  Kč3,398.63
You save:  Kč2,493.16
List Price:  Ft52,881.26
You save:  Ft38,792.52
SEK kr420.92
List Price:  SEK kr1,579.90
You save:  SEK kr1,158.98
List Price:  ARS$133,980.32
You save:  ARS$98,285
List Price:  Bs1,035.94
You save:  Bs759.94
List Price:  COP$580,181.64
You save:  COP$425,608.41
List Price:  ₡77,097.01
You save:  ₡56,556.66
List Price:  L3,704.82
You save:  L2,717.77
List Price:  ₲1,127,850.11
You save:  ₲827,365.86
List Price:  $U5,772.73
You save:  $U4,234.75
List Price:  zł586.17
You save:  zł430
per week
Payment Plan
per week
4 payments
Already have an account? Log In


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