VLSI DV Interview Puzzles · All levels

Pure auto cross count

No ignores, no custom bins. Compute auto cross denominator and percentage.

Puzzle

Difficulty: Easy · Puzzle 2 of 6 · Topic: Cross Coverage Puzzles

No ignores, no custom bins. Compute auto cross denominator and percentage.

Code

systemverilog
covergroup cg with function sample(bit [1:0] a, bit b);
  cp_a: coverpoint a {
    bins a0 = {0};
    bins a1 = {1};
    bins a2 = {2};
  }
  cp_b: coverpoint b {
    bins b0 = {0};
    bins b1 = {1};
  }
  x_ab: cross cp_a, cp_b;
endgroup

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

Hint

Cross denominator is product of coverpoint bin counts.

Step-by-step solution

diagram
1) cp_a has 3 bins and cp_b has 2 bins -> auto cross has 6 bins.
2) Hit tuples are (a0,b0), (a1,b1), (a2,b1), (a2,b0) -> 4 unique cross bins hit.
3) Coverage = 4/6 = 66.67%.

Answer

Answer: Cross denominator is 6 bins and achieved coverage is 66.67%.

Why candidates get it wrong

Repeated hits on one tuple do not increase covered-bin count; only unique bin hits matter.

Interviewer follow-up

Which exact two tuples are still uncovered after the shown traffic?

Related topics