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
€38.34
List Price:  €143.93
You save:  €105.58
£31.88
List Price:  £119.66
You save:  £87.78
CA$56.05
List Price:  CA$210.41
You save:  CA$154.35
A$61.43
List Price:  A$230.58
You save:  A$169.15
S$53.79
List Price:  S$201.92
You save:  S$148.12
HK$310.98
List Price:  HK$1,167.27
You save:  HK$856.28
CHF 35.69
List Price:  CHF 133.99
You save:  CHF 98.29
NOK kr442.35
List Price:  NOK kr1,660.33
You save:  NOK kr1,217.98
DKK kr285.97
List Price:  DKK kr1,073.38
You save:  DKK kr787.41
NZ$68.47
List Price:  NZ$257
You save:  NZ$188.53
د.إ146.73
List Price:  د.إ550.76
You save:  د.إ404.03
৳4,772.75
List Price:  ৳17,914.27
You save:  ৳13,141.51
RM178.49
List Price:  RM669.97
You save:  RM491.48
₦67,630.68
List Price:  ₦253,847.82
You save:  ₦186,217.14
₨11,098.11
List Price:  ₨41,656.11
You save:  ₨30,558
฿1,376.92
List Price:  ฿5,168.19
You save:  ฿3,791.27
₺1,380.37
List Price:  ₺5,181.14
You save:  ₺3,800.77
B$231.74
List Price:  B$869.85
You save:  B$638.11
R725.31
List Price:  R2,722.44
You save:  R1,997.12
Лв74.97
List Price:  Лв281.42
You save:  Лв206.44
₩56,110.17
List Price:  ₩210,606.27
You save:  ₩154,496.10
₪148.41
List Price:  ₪557.07
You save:  ₪408.65
₱2,354.61
List Price:  ₱8,837.90
You save:  ₱6,483.29
¥6,183.06
List Price:  ¥23,207.76
You save:  ¥17,024.70
MX$816.11
List Price:  MX$3,063.25
You save:  MX$2,247.13
QR145.65
List Price:  QR546.72
You save:  QR401.06
P546.19
List Price:  P2,050.11
You save:  P1,503.92
KSh5,172.27
List Price:  KSh19,413.84
You save:  KSh14,241.56
E£1,983.52
List Price:  E£7,445.04
You save:  E£5,461.51
ብር4,889.44
List Price:  ብር18,352.22
You save:  ብር13,462.78
Kz36,474.35
List Price:  Kz136,904.35
You save:  Kz100,430
CLP$39,068.11
List Price:  CLP$146,639.90
You save:  CLP$107,571.78
CN¥289.35
List Price:  CN¥1,086.08
You save:  CN¥796.73
RD$2,407.08
List Price:  RD$9,034.84
You save:  RD$6,627.76
DA5,364.28
List Price:  DA20,134.53
You save:  DA14,770.25
FJ$90.92
List Price:  FJ$341.27
You save:  FJ$250.35
Q308.30
List Price:  Q1,157.20
You save:  Q848.89
GY$8,355.77
List Price:  GY$31,362.93
You save:  GY$23,007.15
ISK kr5,578.69
List Price:  ISK kr20,939.31
You save:  ISK kr15,360.61
DH401.79
List Price:  DH1,508.10
You save:  DH1,106.31
L727.95
List Price:  L2,732.33
You save:  L2,004.38
ден2,358.96
List Price:  ден8,854.23
You save:  ден6,495.27
MOP$320.22
List Price:  MOP$1,201.94
You save:  MOP$881.72
N$724.29
List Price:  N$2,718.59
You save:  N$1,994.30
C$1,469.63
List Price:  C$5,516.17
You save:  C$4,046.54
रु5,393.89
List Price:  रु20,245.66
You save:  रु14,851.77
S/151.44
List Price:  S/568.45
You save:  S/417
K160.80
List Price:  K603.57
You save:  K442.76
SAR149.98
List Price:  SAR562.97
You save:  SAR412.98
ZK1,104.44
List Price:  ZK4,145.47
You save:  ZK3,041.02
L190.88
List Price:  L716.49
You save:  L525.60
Kč971.83
List Price:  Kč3,647.71
You save:  Kč2,675.88
Ft15,780.25
List Price:  Ft59,230.25
You save:  Ft43,450
SEK kr440.89
List Price:  SEK kr1,654.87
You save:  SEK kr1,213.98
ARS$40,099.21
List Price:  ARS$150,510.06
You save:  ARS$110,410.85
Bs275.98
List Price:  Bs1,035.88
You save:  Bs759.90
COP$175,370.51
List Price:  COP$658,243
You save:  COP$482,872.49
₡20,344.02
List Price:  ₡76,360.13
You save:  ₡56,016.10
L1,009.30
List Price:  L3,788.36
You save:  L2,779.05
₲311,796.57
List Price:  ₲1,170,310.31
You save:  ₲858,513.73
$U1,702.76
List Price:  $U6,391.24
You save:  $U4,688.47
zł166.33
List Price:  zł624.31
You save:  zł457.98
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.