Replace FIFO assumptions with ID-aware reconstruction, per-ID expected queues, and a memory model that checks address visibility across interleaved traffic.
Trace the mechanism from failure signature through independent evidence, component ownership, stress, and recovery.
A worked mechanism
Judge the read in its recorded history.
A checker can delay analysis, but it cannot move a read to a later time.
01
Initial state
x = 0
The architecture and test establish the initial memory value.
↓
02
Concurrent observations
write(x,1) pending; read(x) returns 0
Record ordering, forwarding and visibility evidence for this read.
↓
03
Later write visibility
x becomes 1
A future model update must not overwrite the read’s original candidate-value set.
Follow the stated ordering; spacing does not represent elapsed time.
Work it through
Analyze an allowed-outcome trace
Whether the earlier read may return zero depends on preserved order, reads-from choices, dependencies and fences in the selected memory model.
Defer the verdict if needed; retain the events that determine the verdict.
Watch for this
A single mutable shadow[address] value cannot describe all legal outcomes of concurrent memory operations.
Check your reasoning
Run litmus traces whose outcomes differ under the supported models; verify the checker distinguishes them without imposing a global FIFO.
Mechanism and evidence
Guided verification lab
Match identity before comparing order.
Step through three responses and distinguish a legal cross-ID interleave from a same-ID violation.
STEP THROUGH
STATE & OBSERVATIONLegal interleaving / 1 of 4
ID A · OLDEST EXPECTEDA0
ID B · OLDEST EXPECTEDB0
↓ Independent queues converge on the observed response
OBSERVED RESPONSE—
ready
Checkpoint 1 · Keep separate expectation queues.
OBSERVED
—
ID A HEAD
A0
ID B HEAD
B0
VERDICT
ready
Compare all 4 checkpoints
1 · Keep separate expectation queues.
OBSERVED
—
ID A HEAD
A0
ID B HEAD
B0
VERDICT
ready
2 · Response B0 arrives.
OBSERVED
B0
ID A HEAD
A0
ID B HEAD
empty
VERDICT
legal
3 · Response A0 arrives.
OBSERVED
A0
ID A HEAD
A1
ID B HEAD
empty
VERDICT
legal
4 · Response A1 arrives.
OBSERVED
A1
ID A HEAD
empty
ID B HEAD
empty
VERDICT
complete
Legal interleaving · one column per checkpoint
Signal / state
1
2
3
4
OBSERVED
—
B0
A0
A1
ID A HEAD
A0
A0
A1
empty
ID B HEAD
B0
empty
empty
empty
VERDICT
ready
legal
legal
complete
Inspect the contract
Keep separate expectation queues.
ID A
A0 → A1
ID B
B0
The scoreboard expects A0 then A1 for ID A, and B0 for ID B. It does not impose a global FIFO on both IDs.
Evidence to inspect
Inspect the oldest expected item in each ordering domain.
Checkpoint 1 / 4
Inspect the checker Selected checkpoint pseudocode
Conceptual checker / selected checkpoint
expected[A] = [A0, A1];
expected[B] = [B0];
Example contract & limitations
Example contract. One read channel and one destination are modeled. A0 precedes A1 in ID A; B0 belongs to ID B. Per-ID matching alone does not prove architectural memory consistency or ordering across channels. Checkpoints show selected state changes, not equally spaced simulation cycles.
Read the complete walkthrough
Legal interleaving
Keep separate expectation queues.. The scoreboard expects A0 then A1 for ID A, and B0 for ID B. It does not impose a global FIFO on both IDs. Evidence: Inspect the oldest expected item in each ordering domain.
Response B0 arrives.. Compare B0 to the oldest eligible item in its own ID queue. Other IDs may interleave independently. Evidence: Retain the observed ID, expected queue head, and response sequence.
Response A0 arrives.. Compare A0 to the oldest eligible item in its own ID queue. Other IDs may interleave independently. Evidence: Retain the observed ID, expected queue head, and response sequence.
Response A1 arrives.. Compare A1 to the oldest eligible item in its own ID queue. Other IDs may interleave independently. Evidence: Retain the observed ID, expected queue head, and response sequence.
Same-ID reorder
Keep separate expectation queues.. The scoreboard expects A0 then A1 for ID A, and B0 for ID B. It does not impose a global FIFO on both IDs. Evidence: Inspect the oldest expected item in each ordering domain.
Response A1 arrives.. A1 arrives while A0 is still the oldest expected response for ID A. Report the order violation without consuming A0. Evidence: Retain the observed ID, expected queue head, and response sequence.
Response B0 arrives.. Compare B0 to the oldest eligible item in its own ID queue. Other IDs may interleave independently. Evidence: Retain the observed ID, expected queue head, and response sequence.
Response A0 arrives.. Compare A0 to the oldest eligible item in its own ID queue. Other IDs may interleave independently. Evidence: Retain the observed ID, expected queue head, and response sequence.
Related implementation: Compare the oldest expected transaction for the returning ID
protected mac_item expected_buckets[int][$];
functionvoid mac_scoreboard::predict(mac_item tr);
expected_buckets[tr.id].push_back(tr);
endfunction
functionvoid mac_scoreboard::write(mac_item act);
mac_item exp;
if (!expected_buckets.exists(act.id) ||
expected_buckets[act.id].size() == 0) begin
uvm_report_error("SCB_OOO", "Unexpected response ID");
return;
end
exp = expected_buckets[act.id].pop_front();
if (!act.compare(exp))
uvm_report_error("SCB_MISMATCH", "Data mismatch for response ID");
endfunction
Across-ID order no longer matters. Each actual response selects and advances only its own ordered expected stream.
Legal interleaving, checkpoint 1: Keep separate expectation queues.. Inspect the contract.Understand the failure+
ID-aware reconstructionArrival order may change; the legal ordering domain may not.
Per-ID expected queues absorb cross-ID reordering, while a separate memory model checks when writes become visible to reads at the architecture’s chosen observation point.
ID 0W0W1expect W0 → W1ID 3R0R1expect R0 → R1ObservedR0W0R1W1cross-ID interleave is legal
Accepted writeaddress A = 0x2A→Visibility pointmemory model commits A→Later readexpected A = 0x2A
compare within protocol ordering scope · never impose a global FIFO unless the architecture requires one
ID-aware response reconstruction
Protocol order is checked per ID, while shadow memory and dependency edges enforce address visibility across IDs.
Request collector
Captures ID, address, Thread_ID, Global_Order, and accept time.
pending_addrs[id]
Preserves the ordered request-address stream for each ID.
Response collector
Captures ID, data, and completion time.
expected_buckets[id]
Predictor-owned expected FIFO for each independently ordered ID.
Per-ID comparison
Pops only the bucket selected by the actual returning ID.
Shadow memory
Stores candidate visible values and pending writes by address inside the architectural outcome model.
Consistency policy
Defines preserved order, reads-from, coherence order, fences, dependencies, and the legal outcome set.
Request collector -> pending_addrs[id]
pending_addrs[id] + Response collector -> Reconstructed actual transaction
Reconstructed actual transaction + expected_buckets[id] -> Per-ID comparison
Writes -> Shadow memory
Reads -> Shadow memory -> Per-ID comparison
Consistency policy -> Shadow memory
Why it matters
High-performance fabrics such as AXI can legally complete transactions out of order.
A testbench that ignores memory-consistency rules can miss a stale read caused by a buffered or delayed write.
Correct data is not enough. Responses must obey per-ID protocol order and the architecture's selected global-visibility rules.
What is difficult
Different transaction IDs may pass one another while transactions sharing an ID must remain ordered.
Request metadata and response data often travel on independent channels and must be reconstructed by ID.
A FIFO scoreboard reports false mismatches as soon as a legal later-ID response arrives first.
Address dependencies can cross transaction IDs, so per-ID queues alone cannot prove read-after-write behavior.
Transport ordering and architectural memory consistency are different contracts. TSO and relaxed models require explicit preserved-order, reads-from, coherence-order, fence, and dependency rules rather than a looser FIFO.
Failure signatures
A same-ID response returns in the wrong order.
A response arrives for an ID with no pending request.
A legal across-ID reorder causes a false FIFO-scoreboard failure.
A read observes stale data before a previous write to the same address becomes globally visible.
A posted write is treated as visible when only its protocol response, not its memory acknowledgement, has completed.
The scoreboard applies TSO rules to a relaxed configuration or vice versa.
Compare approaches+
Two viable approaches—and their cost
ID-indexed multi-queue
Maintain one expected FIFO for each transaction ID and compare within the ID that actually returned.
Strengths
Simple implementation for protocols that guarantee in-order completion within an ID.
Naturally accepts legal interleaving across different IDs.
Costs
Does not model address dependencies across IDs.
Cannot by itself prove read-after-write visibility or a global memory model.
Shadow memory and dependency graph
Track the current visible value of every address plus explicit predecessor relationships.
Strengths
Detects deep cross-ID consistency violations.
Can represent CPU-visible global ordering and posted-write state.
Costs
Computationally more expensive than per-ID queues.
Requires a precise definition of completion, visibility, and the active memory model.
Explain it in an interview+
Interview answer, built from the mechanism
A
First separate transport order from architectural memory consistency. Use an ID-tagged transport scoreboard with one expected queue per protocol ordering domain, such as ID, channel, and destination, rather than one global FIFO.
Run request and response collectors independently. Store pending request addresses by ID, then attach the oldest same-ID address when a response returns.
For memory consistency, add an architectural outcome model that records writes, reads-from choices, coherence order, preserved program order, fences, and dependencies. Shadow memory is one value store inside that model, not the complete policy.
Represent posted writes as pending until the architecture's visibility event, then validate each observed read against the set of outcomes allowed by the selected TSO or relaxed contract.
Assign responsibilities+
Component responsibility contract
Component responsibilities and required verification changes for Out-of-Order Ordering and Memory Consistency
Component
Responsibility
Required change
ComponentTransaction
ResponsibilityTracking tags
Required changeCarry ID, Thread_ID, and Global_Order metadata.
ComponentMonitor
ResponsibilityOrdering metadata
Required changeCapture request acceptance and response completion times.
ComponentScoreboard
ResponsibilityReordering logic
Required changeUse an associative array of expected queues indexed by ID.
ComponentReference model
ResponsibilityGlobal visibility
Required changeTrack values plus reads-from, coherence order, preserved program order, fences, dependencies, and pending visibility events.
ComponentGlobal config
ResponsibilityMemory-model policy
Required changeSelect the explicit TSO or relaxed allowed-outcome rules, not a generic strictness level.
Build the checker+
Implementation patterns
Reconstruct responses with pending addresses by IDsystemverilog
protected logic [31:0] pending_addrs[int][$];
uvm_analysis_port #(mac_item) ap;
task mac_monitor::run_phase(uvm_phase phase);
fork
collect_requests();
collect_responses();
join
endtasktask mac_monitor::collect_requests();
forever begin
@(posedge vif.clk);
if (vif.req_valid && vif.req_ready)
pending_addrs[vif.req_id].push_back(vif.req_addr);
endendtasktask mac_monitor::collect_responses();
forever begin
@(posedge vif.clk);
if (vif.rsp_valid && vif.rsp_ready) begin
mac_item tr = mac_item::type_id::create("tr");
tr.id = vif.rsp_id;
tr.data = vif.rsp_data;
if (pending_addrs.exists(tr.id) && pending_addrs[tr.id].size() > 0)
tr.addr = pending_addrs[tr.id].pop_front();
elsebegin
uvm_report_error("MON_PROTOCOL", "Response arrived without a request");
continue; // do not publish an item with an unassigned addressend
ap.write(tr);
endendendtask
Two collectors follow independent channels and join each response to the oldest pending address for its ID. This sketch assumes signals are stable at sampling and the request was queued at least one clock earlier. A same-edge zero-latency response needs one coherent clocking-block snapshot and deterministic reconciliation, rather than racing collectors. An unmatched response reports an error without publishing a malformed item.
Compare the oldest expected transaction for the returning IDsystemverilog
protected mac_item expected_buckets[int][$];
functionvoid mac_scoreboard::predict(mac_item tr);
expected_buckets[tr.id].push_back(tr);
endfunction
functionvoid mac_scoreboard::write(mac_item act);
mac_item exp;
if (!expected_buckets.exists(act.id) ||
expected_buckets[act.id].size() == 0) begin
uvm_report_error("SCB_OOO", "Unexpected response ID");
return;
end
exp = expected_buckets[act.id].pop_front();
if (!act.compare(exp))
uvm_report_error("SCB_MISMATCH", "Data mismatch for response ID");
endfunction
Across-ID order no longer matters. Each actual response selects and advances only its own ordered expected stream.
Judge a read at its architectural observation pointtext
on_read_complete(read):
record read.value, read.address, read.accept_time, read.complete_time
preserve candidate writes and the observed ordering relations
when enough events are available:
allowed = architecture.allowed_values_for(recorded_read, observed_trace)
require recorded_read.value belongs to allowed
For a separately specified drain-before-read protocol:
require the drain acknowledgement BEFORE the dependent read is issued
compare the read with that contract's visible value
A checker may defer its verdict while collecting trace evidence, but it must preserve the read's original observation point. It must not compare an old read against a value written later. A required drain-before-read relationship is a distinct protocol obligation.
Stress the design+
Stress recipe
Issue multiple requests on each of several IDs and randomize response latency independently by ID.
Force the earliest request to have the longest latency so later IDs must pass it.
Attempt same-ID reordering and require the checker to reject it.
Post a write, return its protocol response, then issue a read to the same address before memory acknowledgement.
Run litmus-style traces under the explicit TSO and relaxed policies and confirm only outcomes permitted by each architecture pass.
Follow-up questions
How do you handle write posting when a response arrives before data reaches memory?
Record the posted write and read with their ordering and visibility evidence. Validate the read against values allowed at its observation point under the selected memory model. If the programming contract requires a drain before the read, check that ordering explicitly; waiting in the scoreboard does not repair an illegally early read.
How do you stress the reordering logic?
Send many IDs concurrently and make the first transaction unusually slow so later IDs complete ahead of it. Then verify legal across-ID passing and strict same-ID order.
What if the DUT supports TSO and relaxed memory models?
Select a formalized allowed-outcome policy for the active architecture. Model preserved program order, reads-from, coherence order, dependencies, and fences for that policy; do not approximate the difference by simply making a FIFO checker more or less strict.