'covergroup' and 'coverpoint'

SystemVerilog Assertions and Functional Coverage From Scratch SystemVerilog Functional Coverage Language Features
12 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.29
List Price:  €143.74
You save:  €105.44
£31.77
List Price:  £119.28
You save:  £87.50
CA$57.42
List Price:  CA$215.55
You save:  CA$158.12
A$63.89
List Price:  A$239.84
You save:  A$175.94
S$54.15
List Price:  S$203.27
You save:  S$149.11
HK$310.77
List Price:  HK$1,166.48
You save:  HK$855.70
CHF 35.69
List Price:  CHF 133.99
You save:  CHF 98.29
NOK kr452.23
List Price:  NOK kr1,697.43
You save:  NOK kr1,245.20
DKK kr285.70
List Price:  DKK kr1,072.38
You save:  DKK kr786.67
NZ$70.62
List Price:  NZ$265.06
You save:  NZ$194.44
د.إ146.73
List Price:  د.إ550.76
You save:  د.إ404.03
৳4,772.63
List Price:  ৳17,913.82
You save:  ৳13,141.18
RM180.09
List Price:  RM675.97
You save:  RM495.88
₦61,904.12
List Price:  ₦232,353.52
You save:  ₦170,449.40
₨11,116.95
List Price:  ₨41,726.84
You save:  ₨30,609.88
฿1,366.34
List Price:  ฿5,128.49
You save:  ฿3,762.15
₺1,405.98
List Price:  ₺5,277.29
You save:  ₺3,871.30
B$243.13
List Price:  B$912.59
You save:  B$669.46
R731.47
List Price:  R2,745.56
You save:  R2,014.08
Лв74.84
List Price:  Лв280.91
You save:  Лв206.07
₩57,784.47
List Price:  ₩216,890.67
You save:  ₩159,106.20
₪145.99
List Price:  ₪547.96
You save:  ₪401.97
₱2,350.45
List Price:  ₱8,822.30
You save:  ₱6,471.85
¥6,250.37
List Price:  ¥23,460.42
You save:  ¥17,210.05
MX$802.11
List Price:  MX$3,010.68
You save:  MX$2,208.56
QR145.59
List Price:  QR546.49
You save:  QR400.89
P552.01
List Price:  P2,071.96
You save:  P1,519.94
KSh5,163.53
List Price:  KSh19,381.03
You save:  KSh14,217.50
E£2,032.78
List Price:  E£7,629.93
You save:  E£5,597.15
ብር5,099.95
List Price:  ብር19,142.37
You save:  ብር14,042.42
Kz36,674.10
List Price:  Kz137,654.10
You save:  Kz100,980
CLP$39,516.54
List Price:  CLP$148,323.04
You save:  CLP$108,806.50
CN¥291.49
List Price:  CN¥1,094.09
You save:  CN¥802.60
RD$2,432.05
List Price:  RD$9,128.57
You save:  RD$6,696.52
DA5,387.89
List Price:  DA20,223.15
You save:  DA14,835.26
FJ$92.54
List Price:  FJ$347.35
You save:  FJ$254.81
Q307.73
List Price:  Q1,155.07
You save:  Q847.33
GY$8,355.84
List Price:  GY$31,363.19
You save:  GY$23,007.34
ISK kr5,558.24
List Price:  ISK kr20,862.54
You save:  ISK kr15,304.30
DH401.96
List Price:  DH1,508.75
You save:  DH1,106.78
L733.83
List Price:  L2,754.42
You save:  L2,020.58
ден2,357.31
List Price:  ден8,848.03
You save:  ден6,490.72
MOP$319.73
List Price:  MOP$1,200.11
You save:  MOP$880.37
N$735.30
List Price:  N$2,759.90
You save:  N$2,024.60
C$1,469.67
List Price:  C$5,516.35
You save:  C$4,046.67
रु5,432.74
List Price:  रु20,391.49
You save:  रु14,958.74
S/148.72
List Price:  S/558.21
You save:  S/409.49
K161.95
List Price:  K607.90
You save:  K445.94
SAR150.07
List Price:  SAR563.29
You save:  SAR413.22
ZK1,105.31
List Price:  ZK4,148.72
You save:  ZK3,043.41
L190.62
List Price:  L715.48
You save:  L524.86
Kč962.48
List Price:  Kč3,612.64
You save:  Kč2,650.15
Ft15,857.35
List Price:  Ft59,519.65
You save:  Ft43,662.30
SEK kr440.74
List Price:  SEK kr1,654.32
You save:  SEK kr1,213.57
ARS$40,817.16
List Price:  ARS$153,204.84
You save:  ARS$112,387.68
Bs275.98
List Price:  Bs1,035.90
You save:  Bs759.91
COP$174,170.97
List Price:  COP$653,740.61
You save:  COP$479,569.64
₡20,150.72
List Price:  ₡75,634.56
You save:  ₡55,483.84
L1,013.84
List Price:  L3,805.38
You save:  L2,791.54
₲311,423.76
List Price:  ₲1,168,910.99
You save:  ₲857,487.22
$U1,787.69
List Price:  $U6,710.01
You save:  $U4,922.31
zł163.27
List Price:  zł612.85
You save:  zł449.57
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 lecture number three. In this lecture we will cover the fundamentals of this language mainly the cover group and the cover point. Okay, let's start with the basics of a cover group. If you look at this particular blog, what I'm doing is first you have to declare a cover group with the keyword cover group. And you also need to provide it with a name a label, so to say, and it is required, you cannot omit the name and and then you also need to provide it with a sampling edge. This sampling edges when the cover points and bins of these cover groups will be sampled, or in other words evaluated to see if they have been covered.

So the sampling edge is required but in case Let's say you omit the sampling age then you have to procedurally trigger the coverage sampling using a built in method called sample. And I will show an example in upcoming lectures on how you can do that. But I personally suggest that always provide a sampling age. Also, the sampling as should be meaningful here, I'm simply giving it a clock that means that every pauses of clock evaluate to see if your score points have been covered. But you can have more meaningful edges as I will show you in one of the examples. So declare a cover group give it a name, provide a sampling edge.

Now inside this cover group, you have to provide cover points, cover points for the variables of your design. And here I'm saying cover point offset. offset is a variable to meet variable and now also saying cover using the keyboard cover point address. Which is also a variable a big wide and you're you may or you may not provide labels to these PowerPoints, I very highly recommend that you provide the labels meaningful labels, if you don't provide this labels in the simulator will provide its own naming convention, which I can assure you will not make much sense to you. So after you declare the PowerPoints, you enter group with the keyboard and group and then you have to instantiate this group until then the memory won't be allocated for it and the cover group is simply sit there. So we take the cover group name, we give it an instance name and equal to new and new This is a very basic way you women insane share the class.

So this is where we instantiate a cover group. Now these are very basic points of how you Get going, declaring a cover group. And we can see a lot more detail on this. One final note here is that if you do not provide any cover points in the core cover group, then the covered rope is basically meaningless. It's not going to cover anything. But the bad part is the compilers normally don't give you any warnings or errors when the cover group is empty, because you make it empty for a while.

And later, you can put some more points in it. So compiler doesn't want to give you unnecessary warnings or errors. So this is basically fundamentals of a covered group. Let's continue with the same core group and I'm only showing one variable of set. The goal group has been defined here. And here's our point offset.

And you can provide a condition saying that if and only if reset is not asserted that this PowerPoint should be evaluated. To see if it has been covered, which makes sense because during the reset, we're really not doing anything the design is still under the reset condition. The other thing I'm showing here is two squiggly brackets. In the earlier slide, you didn't see those, which is fine. And I will tell you what happens if you don't put those in the upcoming slides. But if you do put the squiggly brackets, it means that you haven't specified explicit bins.

Now you don't know what a bin is. But basically a bin is something where you collect the coverage information. So for example, when I put this squiggly brackets, it basically says that create four automatically generated means why four because offset is two bit wide. So in in auto, auto means zero. This is the name that the simulator will provide because I'm not saying anything about the base. I'm just saying create as many bins as necessary, because I'm providing this tool squiggly brackets.

So it creates four bins in named Sam, you can end up being yourself as we'll see in upcoming slides. And you base the similar basically says auto bin zero we'll cover offset zero or been one, we'll keep track of how many times offset one has been covered and so on and so forth. So, we have introduced you to new concepts here. One is the reset condition control condition as I call it, and also a very high level view of how you can provide or as a simulator to create explicit veins. Now here's a log that comes from one of the popular simulators your simulator may be different and the log may look different. But here basically the simulator created for auto been zero 123 and this log shows that they have been covered thousands of times which is rather redundant, but this is just an example.

And it says that the all the core points have been covered. And hence the covered group also have been covered 100%. So at the end of the day, we need to make sure that the cover group is covered, and if not, we need to look at the bins and the PowerPoint. In this case, everything is covered. Now, let's look at an example of how we can use a PowerPoint. So, I have an enum and I'm from the old fashioned parallel PCI bus service you may or may not be familiar with.

But a PCI bus has a lot of different cycle types. I ag IO read I write memory, read, memorize, so on and so forth. So I've created an enum with this 12 different Second types and give it a name, PCI commands. Then I create a cover group and give it a name PCI commands underscore cover, always give a meaningful name. And as I was just telling you the sampling edge also should be meaningful. I could have said add pauses of clock here, but then it is very redundant and it will slow down my simulation.

So what I'm doing is always a negative frame. What in the PC or the PCI cycle starts at the negative of the frame? So what I'm saying is that the edge of the frame, evaluate this PowerPoint called PowerPoint for the nm PC commands. Here is a PCI commands, goer evaluate PCI command to see if it has been covered. And I've given it a meaningful label. We can say you should.

So you you can now see that the How you can cover all possible cycles of this particular verse, PCI command and byte enable bus. Now again, I'm not providing it any beans because I haven't discussed beans yet, but if you don't provide any bids, simply put a semicolon there or two squiggly brackets as I just showed you. Then implicit set of 12 auto generated beans are created for 12 values in the enumerated IP segments. So basically, whenever you cover point, a given variable, and don't tell doesn't matter what kind of beans you want to create, it will create all possible beans based on the width of this variable. In this case, it's an enum time so the number of enums enum values you have in this particular enum type, so it will create 12 of those. Now this is again basic of how you can start with some coverage.

Now, some of you who are familiar with code coverage may say wait a minute, code coverage also covers enum type. So why do I need this cover group and the whole functional coverage code and everything? The answer is yes, code coverage will cover these two. but bear with me. What I'm going to do is I'm going to take the same example and then expand it and expand it further, so that you will see how effective your functional coverage becomes. And that's where you will see the code coverage will fail.

I some more points on goer groups. So back to the same goer group but what I've now done is I have parameterised the cover group of each I highly recommend because you may create certain cover groups and then you can instantiate it multiple times for different values. So I have in claw Hi, and big 720 address of reference type. And I'll tell you why you need a reference type here. And my sampling edges and pauses of code. Inside the cover group, I'm saying cover point address name or take our point.

And inside this God mind is the first time I'm trying to do some bins which again, bear with me We will discuss in detail. I'm saying in this ADR bin goer the address at r1 from low to high and I'm what I'm doing is when I insane shed, like we discussed that all the girls intervene Sanchez. I'm gonna take the same code group and instantiate it twice. And at one time, I'm going Give it zero to 127. And I'm going to give it 80 or 180, or one is this particular variable that we declared here. Note that in our group, I have a generic name called address.

And that's why I'm saying called mind address. But when I instantiate I'm going to give you the real name of the variable that's in the in the design. Now, the reason for the ref type is because address one and address two are variables, they are not constants. So if you have which makes sense. You have multiple instances with the variables, then you have to declare the formal as of as of type reference. So that's all pretty much it here.

You can, you should as a matter of fact, as part of your methodology, create what I call generic cover groups, and then use them multiple times rather than creating a new cover group for different addresses and different low to high bins that you want. Cover. So that's all folks, this is rather straightforward. We have seen how to declare a cover group, how to declare a cover point, what's the sampling age that you need to provide to make sure that you sample or evaluate the variables at the right time. Thanks a lot for your time and I'll see you in the next lecture.

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.