VLSI DV Interview Puzzles · All levels
type_option.auto_bin_max bin grouping
Find the denominator and percentage for a wide coverpoint constrained by type_option.auto_bin_max.
Puzzle
Difficulty: Medium · Puzzle 5 of 6 · Topic: Coverage Options Puzzles
Find the denominator and percentage for a wide coverpoint constrained by type_option.auto_bin_max.
Code
systemverilog
covergroup cg with function sample(bit [5:0] addr);
cp_addr: coverpoint addr {
type_option.auto_bin_max = 8;
}
endgroup
initial begin
cg c = new();
c.sample(0);
c.sample(7);
c.sample(9);
c.sample(17);
c.sample(34);
endHint
6-bit space has 64 values. auto_bin_max=8 groups values into 8 bins.
Step-by-step solution
diagram
1) Denominator is 8 auto bins.
2) With roughly 8-value groups, samples map to groups: 0..7, 8..15, 16..23, 32..39.
3) Unique groups hit are four bins.
4) Coverage = 4/8 = 50%.Answer
Answer: Scored bins = 8 and coverage = 50%.
Why candidates get it wrong
People sometimes still assume one bin per value and incorrectly report 5/64 instead of grouped-bin coverage.
Interviewer follow-up
Why might you prefer explicit semantic bins over auto grouping for signoff reviews?