Difficulty: Medium · Puzzle 6 of 6 · Topic: Coverage Closure and Sampling Timing Puzzles
Bins are touched but report remains 50%. Compute exact status and next action. Options set: option.at_least = 5 on cp_lat (weight = 1).
covergroup cg with function sample(bit [1:0] latency);
cp_lat: coverpoint latency {
option.at_least = 5;
bins fast = {1};
bins slow = {2};
}
endgroup
initial begin
cg c = new();
repeat (5) c.sample(1);
repeat (2) c.sample(2);
endTouch count is not enough; threshold controls covered/not-covered state.
1) fast bin has 5 hits so it is covered.
2) slow bin has 2 hits, below at_least=5, so not covered.
3) Covered bins are 1 of 2 -> 50%.
4) Need 3 more slow samples to close cp_lat to 100%.Answer: Coverage is 50% because only fast meets threshold. slow needs 3 more hits.
Checked by running a model of the rule in a Python model. A model of the at_least rule: slow has 2 hits, below 5, so only fast is covered.
Seeing both bins in the log and assuming both are covered: with at_least = 5 a bin hit 2 times counts as not covered, so the report stays at 50% while slow looks touched.
How would you bias constraint distributions to close slow without overfitting stimulus? Model answer: Leave the base random test alone and add a closure test or soft constraint that raises the weight of latency 2 (for example a dist), so slow gets at least 3 more hits while fast keeps its natural mix. Check that the new hits come from varied scenarios, not one repeated directed pattern.
I would compare the hit counts with the threshold. With at_least of five, only the fast bin meets it, so coverage is 50 percent, and the slow bin needs three more hits. The trap is seeing both bins touched in the log and calling them covered. Next I would check whether the threshold is justified and bias stimulus toward the slow case.