1
Coveegroup x;
  C: Coverpoint a {type_option.weight=0;}
Endgroup

I want to set coverpoint C weight to 0, for all the instances of covergroup x. So I have used type_option, as option is for instance specific settings.

I have created 4 objects of this covergroup, but in each object, C is considered for calculation of coverage, despite of setting it's weight to 0.

Things works fine when I use option, instead of type_option.

Please explain me the reason behind this.

Karan Shah
  • 1,912
  • 1
  • 29
  • 42

1 Answers1

1

Typically in coverage, one cares not only about the percentage of bins covered in each individual instance of a given coverpoint but also the aggregate coverage of that coverpoint over all instances. If you look at the coverage report generated by most tools (I am mostly familiar with VCS; but I am sure other tools do a similar thing in their reports), you will see coverage for all instances of a given coverpoint in total and then the coverage on each instance broken down in per instance coverage numbers.

Here with where type_option.weight and option.weight come in. type_option.weight is the weight for this coverpoint in the aggregate report; setting it to 0 will make the aggregate coverage on that coverpoint count for nothing towards the aggregate coverage numbers; while the individual instances still have weight in their individual instance coverage numbers. option.weight is the weight for that coverpoint in each instance's coverage, so setting it to 0 will make that coverpoint count for nothing in each instance's coverage, but the coverpoint will still count towards the aggragate coverage for that group. Setting both to 0 gives that coverpoint no weight in any count; which can be helpful if you only care about using that coverpoint in a cross and care only about how coverage comes out in that cross.

See Chapter 19 in IEEE-1800 2012 SystemVerilog LRM (it probably is 19 in earlier LRMs but Im looking at 2012 right now).

AndresM
  • 1,293
  • 10
  • 19
Unn
  • 4,775
  • 18
  • 30
  • Yup i was also thinking the same, but what I actually found while analysing coverage report was, type_option didnt affect any of the coverage (So that bin was counted for individual instances also, as well as for aggregrate also.), but option set that coverpoint weight to 0, for all instances and aggregrate. – Karan Shah Mar 11 '15 at 06:06