VLSI DV Interview Puzzles · All levels

Mismatch Cascade from Incorrect Pop Policy

After first mismatch, every subsequent compare fails with shifted values. Identify the scoreboard policy error.

Puzzle

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.

Code

systemverilog
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
end

Hint

Think about how to preserve alignment when one compare fails.

Step-by-step solution

diagram
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

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.

Why candidates get it wrong

A burst of errors can be secondary fallout from one initial mismatch.

Interviewer follow-up

How would you implement bounded resync without hiding real consecutive DUT bugs?

Related topics