VLSI DV Interview Puzzles · All levels
Three-way cross with only custom bins scored
Find the scored denominator and percentage for this 3-D cross model.
Puzzle
Difficulty: Hard · Puzzle 6 of 6 · Topic: Cross Coverage Puzzles
Find the scored denominator and percentage for this 3-D cross model.
Code
systemverilog
covergroup cg with function sample(bit [1:0] port, bit prio, bit drop);
cp_port: coverpoint port {
bins p0 = {0};
bins p1 = {1};
bins p2 = {2};
}
cp_prio: coverpoint prio {
bins lo = {0};
bins hi = {1};
}
cp_drop: coverpoint drop {
bins no = {0};
bins yes = {1};
}
x3: cross cp_port, cp_prio, cp_drop {
bins p0_hi_drop = binsof(cp_port.p0) && binsof(cp_prio.hi) && binsof(cp_drop.yes);
bins p1_lo_no = binsof(cp_port.p1) && binsof(cp_prio.lo) && binsof(cp_drop.no);
bins p2_hi_no = binsof(cp_port.p2) && binsof(cp_prio.hi) && binsof(cp_drop.no);
ignore_bins others = default;
}
endgroup
initial begin
cg c = new();
c.sample(0,1,1);
c.sample(1,0,0);
c.sample(2,1,0);
c.sample(2,0,1);
endHint
default ignore means only three named bins are scored.
Step-by-step solution
diagram
1) Denominator is exactly 3 scored bins.
2) First three samples hit p0_hi_drop, p1_lo_no, and p2_hi_no.
3) Final sample (2,0,1) is ignored by default rest space.
4) Coverage = 3/3 = 100%.Answer
Answer: Scored bins = 3 and coverage = 100%.
Why candidates get it wrong
In high-dimensional crosses, default ignore can make closure look easy; ensure selected bins truly represent spec risk.
Interviewer follow-up
Which additional named bin would you add first if silicon escapes were seen on p2 low-priority drops?