Difficulty: Hard · Puzzle 4 of 6 · Topic: Scoreboard Puzzles: Mismatch or Ordering Bug?
After first mismatch, every subsequent compare fails with shifted values. Identify the scoreboard policy error.
if (exp_q.size() && got_q.size()) begin
exp = exp_q.pop_front();
got = got_q.pop_front();
if (!exp.compare(got)) begin
\`uvm_error("SB", "mismatch");
// bug: both queues already popped; alignment lost
end
endThink about how to preserve alignment when one compare fails.
1) Re-run with verbose queue dumps before and after mismatch.
2) Show first real mismatch consumes both entries and destroys synchronization context.
3) Change policy: peek first, pop only on successful match or key-based resolution.
4) For true mismatches, retain context and perform resynchronization by id/window.
5) Add a test with one intentional corrupt packet to verify single-fail containment.Answer: Bug: scoreboard pops both queues before confirming match, causing permanent misalignment after one error. Fix: use peek/deferred-pop or key-based recovery logic.
A burst of errors can be secondary fallout from one initial mismatch.
How would you implement bounded resync without hiding real consecutive DUT bugs?