VLSI DV Interview Puzzles · All levels

type_option.at_least across all instances

Compute each instance coverage and type-level average when type_option.at_least applies to every instance.

Puzzle

Difficulty: Hard · Puzzle 4 of 6 · Topic: Coverage Options Puzzles

Compute each instance coverage and type-level average when type_option.at_least applies to every instance.

Code

systemverilog
covergroup cg with function sample(bit err);
  option.per_instance = 1;
  cp_err: coverpoint err {
    type_option.at_least = 2;
    bins zero = {0};
    bins one  = {1};
  }
endgroup

initial begin
  cg c0 = new();
  cg c1 = new();
  c0.sample(0);
  c0.sample(1);
  c1.sample(1);
  c1.sample(1);
end

Hint

Each bin in each instance needs at least 2 hits due to type_option.at_least=2.

Step-by-step solution

diagram
1) For c0: zero count=1 and one count=1, neither reaches 2 -> 0/2 = 0%.
2) For c1: one count=2 reaches threshold, zero count=0 does not -> 1/2 = 50%.
3) Type-level average with per_instance=1 is (0 + 50)/2 = 25%.

Answer

Answer: c0=0%, c1=50%, type coverage=25%.

Why candidates get it wrong

Candidates often apply threshold only once globally; type_option still enforces threshold per instance/bin.

Interviewer follow-up

What minimum extra samples are needed to raise type coverage to at least 75%?

Related topics