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.