UVM Coding Practice · Senior

Out-of-Order Reorder Buffer

Reorder buffer, sequence IDs, timeout stale entries.

Interview prompt

AXI read responses can return out of order. Whiteboard a scoreboard that matches by ID.

diagram
WHITEBOARD CHAIN

1. DECLARE    interfaces / types / ports you need
2. SKELETON   class extends + utils macro + key methods
3. MECHANISM  fill one critical method while narrating
4. PITFALL    name one bug juniors make on this pattern
5. TEST       how you would smoke-test the component

Reference sketch (≤40 lines)

systemverilog
function void write_act(axi_txn t);
  int idx = find_exp_id(t.id);
  if (idx >= 0) compare_and_remove(idx, t);
  else act_q.push_back(t);
endfunction
function int find_exp_id(int id);
  foreach (exp_q[i]) if (exp_q[i].id == id) return i;
  return -1;
endfunction

Smoke test (5 minutes)

  • Two reads different IDs — responses reversed order.

  • Verify compare succeeds.

  • Timeout test: exp without act — policy fires.

Code lab drill

After reading, try Code lab exercise uvm-l8-int-scoreboard-ooo — topic reference: /topics/uvm/coding-practice/scoreboard/out-of-order-reorder

Common pitfalls

  • Head-only compare on OOO bus.

  • No stale entry timeout — memory leak in exp_q.

  • ID width mismatch between monitor and predictor.