VLSI DV Interview Puzzles · All levels

Named cross bins plus default ignore

How many cross bins are actually scored, and what is final cross coverage?

Puzzle

Difficulty: Medium · Puzzle 1 of 6 · Topic: Cross Coverage Puzzles

How many cross bins are actually scored, and what is final cross coverage?

Code

systemverilog
covergroup cg with function sample(bit [2:0] len, bit [1:0] burst);
  cp_len: coverpoint len {
    bins short = {[0:3]};
    bins long  = {[4:5]};
    bins xlong = {[6:7]};
  }

  cp_burst: coverpoint burst {
    bins incr  = {0};
    bins wrap  = {1};
    bins fixed = {2};
  }

  x_len_burst: cross cp_len, cp_burst {
    bins smoke  = binsof(cp_len.short) && binsof(cp_burst.incr);
    bins stress = binsof(cp_len) intersect {[6:7]} && binsof(cp_burst.wrap);
    ignore_bins everything_else = default;
  }
endgroup

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

Hint

default ignore removes all unnamed auto cross tuples from scoring.

Step-by-step solution

diagram
1) Scored bins are only smoke and stress -> denominator 2.
2) sample(1,0) hits smoke.
3) sample(7,1) hits stress.
4) sample(5,2) falls in ignored default space.
5) Cross coverage = 2/2 = 100%.

Answer

Answer: Scored cross bins = 2 and final cross coverage = 100%.

Why candidates get it wrong

Without checking default ignore, engineers often assume a full 3x3 cross denominator of 9 bins.

Interviewer follow-up

If ignore_bins everything_else is removed, what would coverage be with the same three samples?

Related topics