VLSI DV Interview Puzzles · All levels
illegal cross tuple does not close coverage
Calculate legal cross coverage and identify illegal activity.
Puzzle
Difficulty: Medium · Puzzle 5 of 6 · Topic: Cross Coverage Puzzles
Calculate legal cross coverage and identify illegal activity.
Code
systemverilog
covergroup cg with function sample(bit [2:0] len, bit [1:0] typ);
cp_len: coverpoint len {
bins short = {[1:2]};
bins long = {[3:4]};
}
cp_typ: coverpoint typ {
bins rd = {0};
bins wr = {1};
bins probe = {2};
}
x_len_typ: cross cp_len, cp_typ {
illegal_bins short_probe = binsof(cp_len.short) && binsof(cp_typ.probe);
}
endgroup
initial begin
cg c = new();
c.sample(1,0);
c.sample(4,1);
c.sample(2,2);
c.sample(3,2);
c.sample(1,1);
endHint
Start from 2x3 tuples, then remove the illegal tuple from legal denominator.
Step-by-step solution
diagram
1) Raw tuple count is 2 * 3 = 6.
2) short_probe is illegal, so legal scored bins are 5.
3) Legal tuples hit: short-rd, long-wr, long-probe, short-wr -> 4 legal bins.
4) short-probe is hit once but is illegal activity, not legal progress.
5) Legal cross coverage = 4/5 = 80%.Answer
Answer: Legal cross coverage is 80% with one illegal short-probe hit.
Why candidates get it wrong
An illegal tuple can be frequently exercised while legal closure remains incomplete.
Interviewer follow-up
Would you also assert that short+probe is forbidden, and why is that useful beyond coverage?