VLSI DV Interview Puzzles · All levels
option.weight zero removes metric influence
Compute each coverpoint percentage and final group percentage when one coverpoint has weight 0.
Puzzle
Difficulty: Medium · Puzzle 6 of 6 · Topic: Coverage Options Puzzles
Compute each coverpoint percentage and final group percentage when one coverpoint has weight 0.
Code
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);
endHint
Calculate cp_main and cp_debug first, then apply weights in group aggregation.
Step-by-step solution
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
Answer: cp_main=66.67%, cp_debug=50%, group coverage=66.67% because cp_debug has zero weight.
Why candidates get it wrong
A low-quality auxiliary metric can look harmless in top-line numbers if its weight is 0; reviewers must inspect component coverage too.
Interviewer follow-up
When is setting weight 0 justified, and what governance rule would you add to prevent abuse?