Difficulty: Easy · Puzzle 6 of 6 · Topic: Coverage Options Puzzles
Compute each coverpoint percentage and final group percentage when one coverpoint has weight 0. Options set: cp_main option.weight = 1, cp_debug option.weight = 0 (at_least = 1).
covergroup cg with function sample(bit [1:0] main_mode, bit debug_mode);
cp_main: coverpoint main_mode {
option.weight = 1;
bins m[] = {[0:2]};
}
cp_debug: coverpoint debug_mode {
option.weight = 0;
bins d0 = {0};
bins d1 = {1};
}
endgroup
initial begin
cg c = new();
c.sample(0,0);
c.sample(1,0);
endCalculate cp_main and cp_debug first, then apply weights in group aggregation.
1) cp_main bins are 0,1,2 with hits on 0 and 1 -> 2/3 = 66.67%.
2) cp_debug bins are d0 and d1 with only d0 hit -> 1/2 = 50%.
3) Group aggregation uses weights: (1*66.67 + 0*50) / (1+0).
4) Final group coverage remains 66.67%.Answer: cp_main=66.67%, cp_debug=50%, group coverage=66.67% because cp_debug has zero weight.
Checked by running a model of the rule in a Python model. A model of weighted aggregation: weight 0 removes cp_debug from the group number.
A low-quality auxiliary metric can look harmless in top-line numbers if its weight is 0; reviewers must inspect component coverage too.
When is setting weight 0 justified, and what governance rule would you add to prevent abuse? Model answer: Justified for purely diagnostic or informational coverpoints that are not a spec requirement. Require a written reason for each weight 0 in review, list all weight-0 items in the coverage report so reviewers still read their own percentages, and make CI flag any new weight 0.
I would compute each coverpoint, then weight them. The main coverpoint is 66.67 percent and debug is 50 percent, and because debug has weight zero, the group coverage equals the main one, 66.67 percent. The trap is that a weak auxiliary metric looks harmless in the top-line number. I would inspect the component coverage too, not only the group figure.