Hello and welcome to this quiz. In this quiz, we will see how to check for bus protocols. Bus interfaces are some of the most common places where you will be required to add assertions to make sure that the bus interface adheres to the specification. So here's a very simple bus protocol that I have created. It has D valid data and diac. And some of the places where you need to add assertions are among these three signals.
So the way the bus protocol works is when the valid is high, that means data is available and when the target so master puts the data and the target will receive the data by acknowledging diac and the D valid must remain asserted for at least two blocks just for the data can arrive, but it should not remain asserted for more than four clocks. Now says it must remain asserted for two clocks diac cannot come in. After one clock, it should it can come in only after two clocks, three clocks or four clocks. And data can come in after two clocks, three clocks or four drops, and everything must end after the full clock as you can see here. So, let's look at what kind of assertions you need to add. So, the first check as I call it, you need to add is to make sure that once the valid goes high that it is consecutively asserted for a minimum of two clocks.
Maximum of four costs no more. The second check we need to write is check that data is not unknown. So when D valid goes high data must be known, and it must remain stable after D well it goes high until the ad goes high. So here, once the valid goes high data must remain stable and must be known data until dia goes high after Diego's high data can be removed. And the third check that's interesting check and that's where some thought processes required. Basically, I'm saying check that the DA can be a valid relationship is maintained.
So, the going higher signifies that data have accepted data as I just explained, and once data is accepted, meaning dia goes high, the very next grog devalued must go low and dx can come after one clock, I mean in the second clock, third clock or four o'clock and So, d valid follows the diac. So, d can come in the third clock for clock, I the end of second clock at the end of third clock or at the end of clock. So, this particular relationship between the valid and diac is what you need to check, you need to write an assertion to check for it. So, in this quiz, you will learn about add sensitive sample value functions, consecutive reputation, Boolean expressions etc. So, there are all before I go into that all the files are available on my website define new.com slash Udemy lifelines. And here's the web page.
On this web page. All the files are given All you have to do is download the files, and then follow the instructions given in the readme file. So let's look at these files, one by one. So the first file is bus protocol dot v, which is something that I created to explicitly drive the bus protocol, which is shown here. And you don't really need to understand this file at all, is just my way of driving the bus. And what I've done in this file is I've introduced bots as purposely so that if you have not written the assertion correct, then the bug won't be caught.
And I have also provided provisions so that you can run it without any bugs, just to see how the bus protocol works. So the second file is burst protocol property dot MSG. Now. This is the file of interest to you. Let me bring that up. Okay here.
So in this file, what I've done is I've created a property module, bus protocol property. And there are three checks, check one, check two, and check three that you need to go. But just so you can compile the files when you download, and you can make sure that you have all the files. What I've done is this for each of the check I have created a property, but inside the property I have created what I call a dummy line. This is just some totally dummy assertion. That is simply to help you compile the files.
So what you need to do is remove this dummy line and put the correct assertion that you need to code similarly for check to there is a dummy line and check Also there is a dummy line. And I have repeated here, what is it that you are trying to check. So put your assertion where the dummy line is deleted me line, and then try different flavors of it. And I'll show you how to do that. And there is another simple file called test bus protocol that again, you don't need to worry about. It's all done for you.
I'm instantiating, the bus protocol to UT. And I'm binding the bus protocol with bus protocol property module. So this is the way you can now keep your assertions in a separate file and then bind it with the duty. And then when I say race, it's just a simple reset sequence. So let's look at the readme file. So I have put the readme file in the PowerPoint presentation and what this is a step by step guide for you.
To see how you need to run this particular quiz. So first download all the files, then go to a directory that you can create whatever name you want to call it, I just call it Test Lab lab five. And the first thing you should do is by the way this crepes are for mentors Cuesta simulator. Now if you are running cadence incisor or synopsis VCs, you can look into this do file is a very, very simple, go fi and you can just convert that to what incisive or VCs requires. So let's look at Ron nobles.do. So he has a Ron nobles.
So very simple file. And this is all question related. commands. So here it is that I'm compiling all the files. So v log, I'm giving it the protocol module, test module, bus protocol module and bus protocol property module. And what I've done is in my test bench I have different ticket tabs.
So you are simply going to say define plus if I press no box, so what this is going to do is it will simulate the entire design without any bugs. And you can look at the waveform or the submission law requires to see how the bus protocol works. So that's the first thing you will do. Then as I just explained, you will open the bus protocol property.sv remove that dummy line and code your property and then you know, save the fight after saving the While after coding your property for check one, you will simply say do run underscore check one dot two. Now if you have gotten the property correct, you will see a failure check number one that we just saw what it's supposed to do and it will create a test was protocol check one dot log and see that the bug has been detected.
If if it has not been detected, then you need to go back and change your property. Similarly for check to he will remove a dummy property from the bus protocol property file and save the file do the same thing run it and see that you get a failure. And similarly for check three you will do the same thing. And so all this right jack fries I have just I'm just showing you one final year from Okay, so just one second. Let's look at just run check one.do check to check three.do files are the same. So the only thing here is you while compiling you say plus define plus check one.
And that's what that is. So if you are using NCIC or VCs, just replace v log with whatever the command that they require, and we say with whatever the command they require to simulate the design, there is another file that is of importance. So this why this file is run check all so when you use a run, check all do. Then it will introduce all the three bucks Same time, so you should see three failures. This is just to show that in any given duty, you can have multiple bugs present at the same time. So this will allow you to simulate all the three bugs at the same time.
So again, everything is in the readme file, as well as on in the slides on what you need to do to simulate the design. And this is run check all I just explained. So I am going to give you the solution. Now my request is that sure you can see the solution and you will not want to try writing your own properties. But there are a couple of things here. One is if you don't write the properties, obviously you won't get the experience but more importantly, I have written properties in a certain way.
That is no one way to write the properties. So you can Try to write the same property in a different way and see if it catches the ball. So, this is just a reputation for the specification, such as one requires again that once devalued goes high that it is consecutively asserted for minimum two clocks, maximum floor clocks. So this is the property at Paul's edge of clock. I always say disable every sec or you can put any condition that you like. dollar rose devalued, when the value goes from zero to one, that the next dog starting next claw devalued should remain asserted meaning remain high for consecutively because of the star operator.
For minimum two crops and maximum for crops. No more and ever whenever less after two clocks. The da comes in, then you will have to do a survey or after three clubs or after four crafts Maximo for crop after wheat, you must do that many developers should go low. If any of this is violated that will be a failure. And when you run, run into score check one.io, I will introduce an error for Brazil is that you can verify writing this assertion. Now, the second check we needed to do was to make sure that once D valid is asserted, meaning goes high, that data remains stable and that data is no So, again the antecedent what is it that triggers the property that's the first thing you need to determine whenever you read some specification.
Here everything starts when the value goes high. So when the value goes high starting next class We are making sure that data is not unknown, where because of the bank operator here, and data is stable. Now, we don't know when the EC is going to come. So this entire expression are known, not unknown data and stable data will continue to consecutively repeat. For in our case for two clocks are three clocks or four clocks. And we don't know that so we simply say consecutively, check for it from here from after one clock to forever until Diego's high so once the ad goes high, that means the data have been accepted by the target and then we don't care for the data or that data is stable.
So this is one way to check for this particular specification. And third one is a interesting one as I described before. So, here we basically need to make sure all these three signals follow the protocol as as described. So, again see the data must be valid for two cycles, the act cannot go high in this law, the first law Otherwise, the very next rock here the valley will be forced to go low, and that is not the specification. So the first time we can go high is in the second block. And then once it goes high, I then the second clock in the third clock or in the fourth clock, then the valley must go low, the very following clock, third, third clock and second clock and a third clock and no folklore.
So the way I have coded this and again, you can try a different way of coding this thing I have gotten is again And when does everything that does specification start? They start when the valid goes high, so that becomes my antecedent. So I'm saying dollar rose D valid. And now, the way I have coded This is I'm saying that from what I see here d valid and this relationship of D valid high and D low must consecutively remain true for at least one o'clock, or two clocks or three clocks. And in the fourth clock, we must go Hi. Otherwise, data transfer in four graphs is not satisfied.
So what I've done is I've sent dollar rose D valid, devalued and bang ba Muslim and consecutively true for either one clock or up for up to three clocks, but whenever it is done This relationship is done either after one o'clock or two clocks or three clocks, that very next after three, it must go high. It cannot remain low after three clocks. And then once it goes high D valid must fall. So this is one way to write the property, I can assure you there are other ways to write the same property. So, please try it. And since I have given the solution, you may be tempted to not try anything, but at least I suggest typing whatever I have as a solution, type into the bus protocol property dot CSV file and then run the run underscore check one, two, check two dot two and check three.do to see that the wireless and does occur.
So, that's all for this quiz. I wish you the best and hopefully this helps. Thank you