Querying for Coverage

SystemVerilog Assertions and Functional Coverage From Scratch Performance Implications and Coverage Methodology
13 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$39.95
List Price:  $149.95
You save:  $110
₹1,480
List Price:  ₹9,995
You save:  ₹8,515
€37.59
List Price:  €141.11
You save:  €103.51
£32.09
List Price:  £120.47
You save:  £88.37
CA$55.11
List Price:  CA$206.88
You save:  CA$151.76
A$62.29
List Price:  A$233.80
You save:  A$171.51
S$54.51
List Price:  S$204.62
You save:  S$150.11
HK$312.87
List Price:  HK$1,174.35
You save:  HK$861.47
CHF 36.48
List Price:  CHF 136.93
You save:  CHF 100.45
NOK kr439.15
List Price:  NOK kr1,648.32
You save:  NOK kr1,209.17
DKK kr280.49
List Price:  DKK kr1,052.82
You save:  DKK kr772.32
NZ$67.89
List Price:  NZ$254.85
You save:  NZ$186.95
د.إ146.71
List Price:  د.إ550.68
You save:  د.إ403.96
৳4,382.39
List Price:  ৳16,449.07
You save:  ৳12,066.67
RM191.44
List Price:  RM718.56
You save:  RM527.12
₦47,986.60
List Price:  ₦180,114.94
You save:  ₦132,128.33
₨11,106.74
List Price:  ₨41,688.53
You save:  ₨30,581.78
฿1,465.12
List Price:  ฿5,499.26
You save:  ฿4,034.14
₺1,298.01
List Price:  ₺4,872.02
You save:  ₺3,574.01
B$207.14
List Price:  B$777.50
You save:  B$570.36
R761.49
List Price:  R2,858.21
You save:  R2,096.72
Лв73.54
List Price:  Лв276.04
You save:  Лв202.49
₩55,638.97
List Price:  ₩208,837.66
You save:  ₩153,198.68
₪150.71
List Price:  ₪565.71
You save:  ₪414.99
₱2,275.49
List Price:  ₱8,540.92
You save:  ₱6,265.43
¥6,176.13
List Price:  ¥23,181.77
You save:  ¥17,005.63
MX$671.62
List Price:  MX$2,520.89
You save:  MX$1,849.27
QR146.22
List Price:  QR548.84
You save:  QR402.61
P553.06
List Price:  P2,075.89
You save:  P1,522.82
KSh5,253.42
List Price:  KSh19,718.42
You save:  KSh14,465
E£1,938.49
List Price:  E£7,276.03
You save:  E£5,337.53
ብር2,281.30
List Price:  ብር8,562.74
You save:  ብር6,281.44
Kz33,320.27
List Price:  Kz125,065.69
You save:  Kz91,745.42
CLP$38,862.96
List Price:  CLP$145,869.86
You save:  CLP$107,006.90
CN¥289.18
List Price:  CN¥1,085.42
You save:  CN¥796.24
RD$2,369.36
List Price:  RD$8,893.26
You save:  RD$6,523.89
DA5,387.69
List Price:  DA20,222.38
You save:  DA14,834.69
FJ$91.02
List Price:  FJ$341.66
You save:  FJ$250.63
Q310.92
List Price:  Q1,167.04
You save:  Q856.12
GY$8,353.62
List Price:  GY$31,354.83
You save:  GY$23,001.20
ISK kr5,665.30
List Price:  ISK kr21,264.40
You save:  ISK kr15,599.10
DH405.88
List Price:  DH1,523.46
You save:  DH1,117.58
L711.11
List Price:  L2,669.11
You save:  L1,958
ден2,314.09
List Price:  ден8,685.83
You save:  ден6,371.73
MOP$321.99
List Price:  MOP$1,208.59
You save:  MOP$886.59
N$760.26
List Price:  N$2,853.60
You save:  N$2,093.34
C$1,475.95
List Price:  C$5,539.89
You save:  C$4,063.94
रु5,330.36
List Price:  रु20,007.20
You save:  रु14,676.84
S/148.60
List Price:  S/557.76
You save:  S/409.16
K151.77
List Price:  K569.66
You save:  K417.89
SAR149.85
List Price:  SAR562.47
You save:  SAR412.61
ZK1,005.44
List Price:  ZK3,773.88
You save:  ZK2,768.43
L187.08
List Price:  L702.20
You save:  L515.11
Kč949.09
List Price:  Kč3,562.37
You save:  Kč2,613.27
Ft14,848.49
List Price:  Ft55,732.95
You save:  Ft40,884.46
SEK kr437.74
List Price:  SEK kr1,643.04
You save:  SEK kr1,205.29
ARS$34,688.22
List Price:  ARS$130,200.22
You save:  ARS$95,511.99
Bs277.09
List Price:  Bs1,040.07
You save:  Bs762.97
COP$154,622.11
List Price:  COP$580,365.09
You save:  COP$425,742.98
₡20,083.17
List Price:  ₡75,381.03
You save:  ₡55,297.86
L989.93
List Price:  L3,715.67
You save:  L2,725.73
₲295,796.08
List Price:  ₲1,110,253.38
You save:  ₲814,457.30
$U1,554.12
List Price:  $U5,833.32
You save:  $U4,279.19
zł163
List Price:  zł611.84
You save:  zł448.83
Subscription
$149.95
$39.95
per week
Payment Plan
$149.96
$39.95
per week
4 payments
Already have an account? Log In

Transcript

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

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.