Stable, the returns to the value of the expression did not change in dollar rose, it went from zero to $1 fairly, it went from one to zero here, it did not change. So it's a very obvious thing. And again clocking event is optional, but you need it if you're using dollar stable in continuous assignment, as I just showed you in the previous slide, here's a simple example Cisco can take read and config read Param. Basically, I'm passing this actuals to these formals. And I keep showing this kind of example, just to reiterate and reinforce the point that don't write your properties quote unquote, hard coded to a certain signaling, keep them generic and then reuse them. So whenever says at the bottom edge of syslog, if config read is hard Then the config read Param should have been stable from the previous term very simple and again like dollar rose or fail you can assign or use dollar stable in in continuous assignment, and because you do that you have to explicitly provide the clocking or sampling age.
So, here we are saying that if the config sake has remained stable from the previous clock, the or the previous sampling adage that if that is true then take seek value and apply to stable value or take an error value if the config says they change from the previous clock, then take our value and apply it to the same value. Just like Rosenfeld, you can use this in a procedural block. So, you Here we have a simple example always at positive clock a stable number equal to a stable num plus stable here what I'm trying to do is I'm trying to count how many times a clock sorry the a stable or a has remained stable. So, when this is true, it will be it will be a logic high and it will be added and continue to add for as many clock as it has remained stable, stable.
Okay, let me make sure we understand that stable does not mean high stable means either it goes low previously and low now or high previously and high now. And then if and you can use this for requests grant, all kinds of different signals. So here what I'm doing is if I A has been stable than display that is which we have been stable this way that he has been stable and I do a logical end of the two and it both have been several from the previous clock They say he be stable his clock and here's the simulation log of this particular assertion you can see that B was zero and B is zero now at positive clock, so, B is stable, a is not stable a change here, a has been stable from 15 to 25. So, a has been stable but we did change so B is not stable.
Similarly another example of and and at 35, both A and B changed. So nothing was stable. But then again at 45 A remain one so a stable. Now a is stable from 45 to 55. be stable from 45 to 55. So, we will get three a dismissiveness a stable be stable and a and b is stable this law. So, a very simple example, but you can use it very effectively in your design to make sure you you gauge certain spurious transitions.
This is probably one of the most important functions sent and in this case is a sample value function dollar passed dollar pass of this expression how many clock takes in the past and then I will explain to you what expression two is a gating expression meaning if it is not true then do not use do not evaluate dollar pass very simple and then again blocking event is is the Blocking event is optional, but for example, you're using it in a in a continuous assignment, then you do need the blocking event otherwise, like in the previous cases is derived from the assertion or from the procedural block. So, this is the syntax of the dollar passed. If you do not specify number of tags then it will only look for the expression value in the previous law just one clock date so, the default is one clock.
Now, remember that dollar rolls dollar fail dollar stable return a logic true meaning one or a logic false meaning zero. But here dollar pass returns a sample the sample value of the expression one that was present number of clock ticks prior to the current clocking sample value, it actually returns the value what is the value in the previous clock or in the previous 10 clocks? So here's a simple I'm purposely showing it in the procedural block. And again, I'm reiterating reiterating that is not a Boolean pass or fail, but it returns the value. So here dollar past, always at pauses of clock, if past value of a is hex five, then display past a, and here as you can see, you want to display pass am using dollar pasty, okay? So these dollar pass day, these dollar pass a they will all inherit or infer the clock from dollars wrong because none of them have their own clock.
Similarly, for B I'm saying if it's a hex a then display that I'm also saying that C is equal to whatever the value of a because remember, we are dealing with a value now, whatever the value of a was in the prior clock day, logically and it will be twice and with whatever the value we had one big plot prior, I'm just saying one take, because I'm not specifically assigning number of tickets. So default is one. And here is a simple simulation log. At at time 25, the past failure of a was five minutes at the previous glottic. It was phi and pass B was hacked. Say as we expected, of course, I made sure that my test bench is such that will give you the right results.
And that's pretty much it in the past. So here are some simple applications. The spec says that if the current state is cache, read Then the past state cannot be cache invalid, you can never read from an invalid line as if here are from the CPU cache world, you will know this. And here's a simple assertion for that at policies of law state equal to cache read implies that same clock, the past state that with the state in the previous clock, the sample value of state in the previous clock is not cash invalid. Similarly, there's a spec that says, If five Sol is asserted, and data ready was data was ready to be sent the last clause then the current state, you cannot send the data because the pipe stall is asserted in this law. So even if the data was ready to be sent in the previous clock, the current state must be data hold.
So Is this bag and he is he assertion for it or the property for it at policies of claw. If pipe stall is high and and logical end dollar past state was data same. And again I will keep repeating this everything is sample value, everything is sample, in this case that causes of clog in the pre pond region. So, if this condition is true if this antecedent is true, then the consequence states that the state must be equal to data hold. So, it's rather intuitive when you will get the hang of it. As you write more and more assertions, again, try to write simple assertions for a complex spec, break it down into simpler sequences and then tie them all together.
This is to enforce upon That dollar past returns the value of the audio expression. But Dollar fell dollar rose dollar stable they only look at the least significant bit of the signal. And then you know, consider it pass or fail. So for example, for example, let's say you have a 32 bit bus D bus. And you say that a B EC is high, it implies that the bus should go to zero. And you may forget that all of fel only works on the least significant bit.
You may forget that. So you may say that, hey, then that bus needs to go to zero all the 32 bits need to go to zero. Well, let's say only the least significant bit went to zero. He'll get an incorrect pass. So Remember that So, how do you deal with this What if I want to make sure that the entire bus goes to zero? So, that's where dollar boss comes to rescue again you have a 32 bit bus, you have a dx, what am I going to say is dx implies that one clock tick earlier the bus was the buses value was not equal to all zeros and the current value of the bus is all zeros.
That means you did transition from whatever the value was earlier. All the entire D buzz went to zero. Now, this is the correct assertion to compare because, again all the past returns value or the entire expression, why Dollar fell dollar rose all the stable only deals with the least significant bit of code that is dollar change. Which is also intuitive. If it changed whether one to zero or zero to one, then in the similar fashion, it will work. So here's a simple example dollar rose B implies that at the next clock dollar change z.
So, he has $1 Rose be in the pre porn region and he, he was zero in the pre porn region at this long it goes to one in the one region at this clock shot in the property will pass here it goes from one to zero here it goes from zero to one and this will pass as well. This will fail because a did not change. It remained level sensitive at this clock, because when we detected dollar rose We here at the next log, we did not see a change in it. So of course it fade very intuitive. But here's a very interesting example. Let's say your spec says That the toggle signal dollar sake toggles every clock very simple spec.
In other words see that called signal follows a pattern 10101001010 which is actually one in the same. So the first inclination you will you probably will have your writing assertion this way. You'll say assert property sampling edge at pauses of cloth dog say one clock later it should be not policy. Okay so if it is one next blog it will be it should be zero. And then if, if it's zero then the next vlog it should be one. Well, why wouldn't this work?
This property simply states now remember the the phenomenon of free porn region. So this property simply says that the toggle signal be true It simply says there is no implication here. There is no overlapping non overlapping implication here is simply say that every pause is of clock, this has to be true. And if it is, and this has to be true and one clock later it has to be false, or this has to be one, one clock later, it needs to be zero. So, one clock later, let's say it is zero, but at the same clock, this property is also going to expect the toggle set to be a one. I mean, how can a signal be zero and one at the same time.
And so this property will fail or it just doesn't work, it will give some garbage results. So that's why dollar changed is useful. So here you simply say that at pauses of clock, one, you have to wait for one clock because you're comparing the values that are clock dollar changed talk toggles it. So, every clock it will simply say hey, if the previous value was zero it should be one now, if it was one it should be zero and you will be able to detect this pattern. So, this is a very simple example, but also very power powerful in explaining what dollar changed means dollar sampled. Now this is interesting dollar sample like all these slides throughout the lectures I've been telling you that the expressions the values in tire assertion, meaning assert property, property cause a sequence all the variables, all the signal names are sampled in the frequent region.
Well, there is a sample value function called on a sample that does exactly the same. So what is the difference? First, let me show that. Let's say you have a property $1 sample A equal to dollar sample equal to equal to dollar sample B. This is the same as what we have written all the time because A and B are always sample values in the premium region or positive clock. So why do we need this dollar sample if everything is already sampled, there are a few cases where you do need it.
Let me give an example. We saw disabled live in earlier slides. Disabled if whatever the condition exists here is totally asynchronous. disabled by default is asynchronous, meaning disable if shuts off or triggers as soon as reset goes from high to low or low to high. The disable if signal or expression is not sampled. So, if you do want to have a synchronous reset, for example, and not an asynchronous reset, you can say disable if Dollar sample reset as opposed to reset.
So, as you can see, there are places and this is probably the only place in a property in an assert in a sequence where a particular signal is not sampled. And you can use dollar sampled to make it simple make it synchronous. In the LRM, 2009 and 2012. They added something called pass in future sample value function, they did not exist in the 2005 LRM. And these these symbol value functions are of two types one our past and one a future. We'll see that in the next slide.
There's a couple of slides. But what is what is global? Why, why are these called Global clocking sample value functions? So, first you need to understand what's the global clock clock is actually a system or a log construct, and it is used extensively. And if you want the real detail of it, you may you will have to refer to the system or log in, but you don't need that knowledge. What you need to know is right here that's all you need to know for similar decisions.
So here's a module and you have a clock of type logic and I'm saying global clocking keywords global clocking says clock name of the global clock, which is a clock and then clocking. So, this is the name of the global clocking event. So says clock is now considered a global clocking event. It is defined to occur if there is a change in clock at clock, not positive, not negative edge anytime clock changes. And you can access this global clock syslog by using dollar global clock and this is how so let's say I'm I'm I'm making much simpler I'm not giving it a name this is an optional name and global clocking block. So, I'm simply saying global clocking at clock like here and then clocking then I can say assert property add global clock, like I just say that you can use dollar global clock system function add global clock A.
So, global clock here is at clock. So, this property basically reads as a set property at clock A. So, as far as assertions are concerned, this is pretty much all you need to know in terms of understand what is the global clock because if you don't understand global clock you will definitely not understand what is global clock. past and future sample value functions are. The past sample value functions are dollar passed. Dollar rows n underscore g clock tells you that it's global clocking function sample value function we saw dollar past dollar rows dollar felt dollar stable and dollar change these are the global clock counterparts have the same functions in their work exactly the same day only differences these functions with an underscore g clock suffix they will work only for global clocking event has been defined.
Other than that, there is no difference in the execution in their semantics. So, I will not go into the detail of each of this log because we have already covered similarly, future. So, they in the in in in dollar past dollar rose file we always looked at the previous property and obviously as the name suggests the Future sample value functions instead of dollar pass you have dollar future instead of dollar rose you have dollar rising instead of dollar value of dollar falling similarly steady and stable versus steady and changing what is changed, these are past tenses these are future tenses so to say. So, basically it says that the sample the value of the expression in the time step step that subsequently and immediately follows the timestamp in which the function is gone score which is the future quantity. Okay. I will leave it at that because that's all you need to know for for applying this future simple value functions.
But note that in the in this boss simple function, we have account counterparts Dollar pass rows fell several changed without the G Cloud suffix like we just saw and all the previous slides. But for the future simple value functions, there are no non global clock counterparts, you don't have dollar future we don't have dollar rising, and so on and so forth. So as far as the future sample value functions are concerned, they only work off of a global clock. He has a very simple example. Very, if you just read this bag you're meeting, oh, how am I going to design an assertion? Here's a PCI type of bus example.
When frame underscore signal frame underscore signal should be stable between two consecutive clock ticks. Frame can change only the pauses of clock day and no glitch in between. The best way to solve this and go right in assertion is a set property at global clock. Disable if ready, I'm using all the available features of an assert property if dollar changing clock that means if frame is going to change the next clock, then it has to be a rising g clock. And this basically meets this requirement if dollar changing clock that means, the next has to be So, if there is a glitch and it goes to falling g clock you know that it has failed. So, between two consecutive clock ticks, the changing frame means rising g clock.
So, the next clock when frame changes at that next clock it has to be Rising free. That's pretty much a for all the simple value functions. It has been a long lecture. These simple value functions are not that difficult to comprehend. But thanks a lot for attending this lecture and I will see you soon in the next lecture.