Querying for Coverage

SystemVerilog Assertions and Functional Coverage From Scratch Performance Implications and Coverage Methodology
13 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 the lecture on querying for coverage. Specifically, we'll see how to you use the predefined coverage methods to get coverage information for our groups and cover points. And also we'll look into the user defined sample method. This table is borrowed from the system or log LRM and it shows the predefined coverage methods available for functional coverage language. We are familiar with samples start and stop. So the methods of interest for this lecture are get coverage and get into coverage.

Get coverage gives you the complete coverage of all instances of either a cover group or a cover point. While getting coverage will give you the coverage information for a particular group instance or a cover Find instance. And there are two flavors of those. When you pass parameters of ref, int, comma ref, and then basically you can have two variables as parameters. The first variable gives you the, how many bins have your car while the second parameter tells you how many Dogar bins were created. So that way you can see right off the bat, what kind of coverage you have received.

Let's look at an example. So, in this example, I am declaring a cover group CG with two parameters x V and Y v. And I'm covering a variable guard wind x with Ben's x bins create as many explicit bins as are required by zero colon x v, whatever the value of x V is. And similarly for our point y could add as many explicit bins, as required by the value zero followed by B. Now I'm instantiating that our group twice one is CB one or the other is CB two, with the CB one constructor and passing the x V and x y values as one comma two. What that means says if x is one, then it is zero or one that means two values, zero comma one, and so two beans are created. And y be equal to two that means zero colon two meaning zero comma one comma two, three minutes will be created.

Similarly, for the second one sense. See, we do dot x will have four bins and say we do dot y will have seven days. Now let's see how can we get coverage of this cover groups and instances. So first I'm saying CB one dot x get instant coverage. And I'm passing it to refund type variables covered and total. So CV one dot x basically gives you coverage for cover point instance x.

And you will get how many beans work our what is how many beans are created. The next line CB one dot get ins coverage is basically the CV one instance of cover group CG. And we'd like to know the coverage information for that particular instance. Note that When you want get in coverage the operator or the DeMarco here is our dot. But when you want to get get get coverage that the marker is double colon. So here I'm saying CG, colon colon x get coverage.

That means for CD cover group, give me the coverage information for all instances of x, which there are two because we are instantiating CD twice. So that's where you'll get the information about all these instances of PowerPoint x. And here I'm simply saying, Give me the coverage for everything under CG. That means all the instances of CG. And as you can see, for getting coverage, the total number of wins are due as I've shown here, But CV one for this particular instance getting's coverage, total are two plus three, so five. Now for the audience's Sins of PowerPoint eggs, the total are two plus four, six, and for everything under CG rehab, Oh, hold on one second.

Okay, we have a two plus three plus seven plus four equal to 616. Go Rubin's work create created. So this is how you can get coverage for instance, as well as for the entire cover group or PowerPoint. Just one more example. I have two variables, band requests and num matters. And in the cover group RG I'm covering fan requests as well as Nothing matters.

That's all I'm doing in the cover group. Then I'm instantiating my, the dollar group RG with the instance name my RT sorry about that particular line. Now, I am showing you a couple of things. One is as we have seen, you can start the coverage based on when you want to start the coverage. So yeah, that bother request. I'm saying my RG insensitive guard stock, which is a method that we saw in the first slide.

But at the pauses of grant, I'd like to sample that this is my sampling at at that time, I want to sample see how much coverage I got. And then I want to get that information for my RG instance. Through this method getting's coverage. And the beauty is this is coverage we'll go into will restore into the variable call and then you can very easily compare the curve if curve is greater than 90, that means is greater than 90%. I want to stop the coverage. This is an excellent way to manage coverage in order to have simulation perform better and not take up too much time when we don't need the coverage information.

One last thing here is that you can have dot sample here or dot Stroh dot sample is basically at the time this method is called it will sample the dollar points of our group our RG and they may or may not have settled down but RG dot stroll will sample the same government At the end of the timestamp, So, definitely you know what the final values are, I personally use artists draw more often than I do sample. Now, this is a very powerful feature. My example is very simple just to make the point, but you can have very elaborate board using this function. So what this function is is a user defined sample method. So far we have seen the sample method that the simulator provides us. And that sample method you can call it when you want to call when you want to sample but it does not allow you to determine what you want to sample.

So, the V function sample you can not only decide when you want to sample but also exactly what variable you want to sell. But at that time, so here I have a cover group cover sample. And these are the keyboard to read function sample. And I have one parameter x of type int, and I'm covering that input int x. I'm instantiating, the cover group. Now here, this is a system or a log assertions property. And I'm basically showing you how to combine soil assertions with functional coverage.

In addition to show you user defined sample method, so in this property, I have created a local variable called px. And I'm saying that at pauses of law, if I sick one is true, then store the value of Isaac to into the local variable p x. And if I say what is true, the next clock I say three must be true. And when it is true Drew, I want you to sample the color group. So and when I say sample, I'm passing it the local variable px. So, we have determined when we want to sample, but at the same time we are telling it cover px.

So, that is what you want to sample. Now, as I said, you know this weight function you can have very elaborate function, whether a lot of conditions and only under certain conditions, you want to sample some variables. So, that's why this is a very important method. Please, revisit, decide if you have to, so that you truly understand how this thing works. This is just something that I learned by mistake, so to say so, So, far what we have seen is you can get coverage for the PowerPoint and cover groups, but it is not possible to get coverage for bins. So, here I have a cover group GC that I am covering ADR one and in this ad r1 I have three bins, creating bins in this case transition bins and I essentially cover group Now, you may be tempted to find out what is the coverage of this particular bins or any of the three bins.

So, you may say gc ns.ad r1, which is a four point.ad or B two which is the base and get coverage for them. That is not allowed, you will get a runtime or maybe on compile time error. There is a solution which is probably not as elegant, but at least there is one so what I've done is the same Cover group, I have converted each of the beans into a PowerPoint. So I create a cover point for the variable ADL one. And in that I'm putting the same definition of beans that was here. Here it was explicitly defined by beans.

Here I put that under a PowerPoint and the same base definition. Now we know from previous lives that you can get get coverage for the cover point. And since cover point has only one beans, basically you're getting the coverage for the base. So this is a simple solution. If you have hundreds of bins, then this is not elegant. But for smaller cases, you can get coverage for bins by doing what I just showed you.

So that's all very simple and short lecture. We learned how to get coverage for our groups and go along And a workaround for getting coverage information for bids. Thank you.

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.