VLSI DV Interview Puzzles · All levels

Same traffic, different denominator

Two coverpoints observe the same signal. Compute both percentages and explain why they differ.

Puzzle

Difficulty: Hard · Puzzle 6 of 6 · Topic: Covergroup and Coverpoint Puzzles

Two coverpoints observe the same signal. Compute both percentages and explain why they differ.

Code

systemverilog
covergroup cg with function sample(bit [2:0] mode);
  cp_auto: coverpoint mode;

  cp_manual: coverpoint mode {
    bins legal[] = {[0:5]};
    ignore_bins svc = {6,7};
  }
endgroup

initial begin
  cg c = new();
  c.sample(0);
  c.sample(1);
  c.sample(2);
  c.sample(6);
  c.sample(7);
end

Hint

cp_auto on a 3-bit signal has 8 auto bins; cp_manual scores only legal[] bins.

Step-by-step solution

diagram
1) cp_auto bins are 0..7 -> 8 bins. Hits are 0,1,2,6,7 -> 5/8 = 62.5%.
2) cp_manual has legal[] over 0..5 -> 6 scored bins. Hits among legal bins are 0,1,2 -> 3/6 = 50%.
3) Samples 6 and 7 are ignored in cp_manual, but counted as valid bins in cp_auto.

Answer

Answer: cp_auto = 62.5%, cp_manual = 50%. Same samples, different scored bin sets.

Why candidates get it wrong

Coverage percentages are model-dependent metrics. You cannot compare them without checking denominator construction.

Interviewer follow-up

What model is better for signoff if 6 and 7 are service/debug modes excluded by spec?

Related topics