← Design Verification Interviews
Interview Question · Code Writing
A Scoreboard for Out-of-Order Responses
The Question
The interviewer asks
Reads carry an ID, and the DUT may return different IDs in any order. Write the scoreboard.
You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Store the expected responses in an associative array of queues, keyed by ID. On a request, push its expected data onto the queue for its ID. On a response, pop the front of that ID's queue and compare. Use a queue per ID, because responses with the same ID must still return in order on buses such as AXI. At the end, every queue must be empty.
pending[3]. Arrows from a bank carry the response, and the arrow from pending[3] is the pop.- 55 ns
The first tag 3 read is taken. The scoreboard pushes its prediction, 22; the read goes to bank 1.
Follow the calls, values and waits
- data prediction 22: READ tag 3, bank 1 → pending[3]
- data READ tag 3 (bank 1): READ tag 3, bank 1 → Bank 1
- 65 ns
The second tag 3 read is taken. Its prediction, 11, goes behind 22; the read goes to bank 0.
Follow the calls, values and waits
- data prediction 11: READ tag 3, bank 0 → pending[3]
- data READ tag 3 (bank 0): READ tag 3, bank 0 → Bank 0
- 75 ns
Bank 0 is ready first, but an older tag 3 read is still in bank 1, so the same-tag rule holds it back.
Follow the calls, values and waits
- Waiting: Bank 0 — held behind the older tag 3
- 85 ns
Bank 1 drives 22 at 85 ns. The monitor samples it at the next edge.
- 95 ns
The monitor sees 22, and
pop_frontreturns 22: match. Bank 0 may now drive 11, at 95 ns.Follow the calls, values and waits
- data response tag 3 = 22: Bank 1 → Response tag 3 = 22
- data prediction 22: pending[3] → Response tag 3 = 22
- Released: Bank 0
- 105 ns
The monitor sees 11.
pop_frontreturns 11, the only entry left: match, andpending[3]is empty.Follow the calls, values and waits
- data response tag 3 = 11: Bank 0 → Response tag 3 = 11
Read the diagram as text
- READ tag 3, bank 1: taken at 55 ns; model says 22
- READ tag 3, bank 0: taken at 65 ns; model says 11
- pending[3]: [22] at 55 ns, [22, 11] at 65 ns
- Bank 1: ready and driven at 85 ns
- Bank 0: ready at 75 ns, held until the older tag 3 has gone; driven at 95 ns
- Response tag 3 = 22: seen at 95 ns: pop_front gives 22, match
- Response tag 3 = 11: seen at 105 ns: pop_front gives 11, match
- READ tag 3, bank 1 → pending[3]: push 22
- READ tag 3, bank 0 → pending[3]
- READ tag 3, bank 1 → Bank 1
- READ tag 3, bank 0 → Bank 0
- Bank 1 → Response tag 3 = 22: seen 95
- Bank 0 → Response tag 3 = 11: seen 105
- pending[3] → Response tag 3 = 22: pop_front
One queue per tag is the same-tag ordering rule, written as storage. Its front entry always belongs to the next response with that tag.
Search by data
idx = pending.find_first_index(d) with (d == data);
Accepts data that went to the wrong ID
Queue per ID
want = pending[id].pop_front();
Checks the ID and the order within it
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Mid-Level)
A good mid-level answer first asks which ordering rule the bus keeps. Then it stores expected items by ID, with a queue for each ID.
What Interviewers Listen For (Senior)
A good senior answer adds a time limit for each open request. It reports the oldest stuck ID, not just a count of leftovers at the end.
Cross-Questions
Where the interviewer goes next. Open a node to practise that follow-up.
What IfProve ItBreak ItCompareScale It
- A Scoreboard for Out-of-Order Responses
-
What IfChoosing the Key for Out-of-Order CheckingL2 Mid-Level
Asked if they key by address
What if the response carries no ID, only an address?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Key by whatever the response carries that names its request. If two open requests share a key, the protocol must define their order, or the scoreboard cannot tell them apart. Then ask the designers how the DUT orders them, and check that rule.
Self-Check
Tick each key point you covered in your answer.
Misconception
"Use the arrival time as the key."
The response does not carry the request's time, so the scoreboard cannot look it up. Time is a check on latency, not a key.
Source Verification Academy, UVM Cookbook, Scoreboards: out-of-order comparator keyed by index_id() (PDF p172)
-
CompareThe Cost of Out-of-Order CheckingL2 Mid-Level
Compare the cost of an out-of-order scoreboard with an in-order one.
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
The in-order version pops one queue, so each check costs constant time. The keyed version adds a lookup and must track what is still open for each key. Its errors are also harder to read, because a lost response shows only at the end or at a timeout. Use it only where the protocol really allows reordering.
Bank 0 overtakes bank 1 Both responses are correct. A scoreboard with one in-order queue pairs each with the wrong prediction and reports two mismatches.
Self-Check
Tick each key point you covered in your answer.
-
Break ItCatching a Response That Never ComesL2 Mid-LevelL3 Senior
How would a response that never comes show up, and how do you catch it early?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
With only an end-of-test check, it appears as one leftover entry after a long run. Stamp each expected entry with its request time. A watchdog then reports any entry older than the allowed latency, with its ID and address. That points straight at the stuck request.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Senior)
A good senior answer gives each expected entry a latency limit. It treats that limit as part of sign-off, not only as a debug aid.
-
Scale ItChecking an InterconnectL3 SeniorL4 Staff
Scale it: an interconnect with four masters and three slaves. How does the checking change?
2:30You have two and a half minutes. Speak or type, then press Get Feedback under your answer. No credits needed.
Speech-to-text runs in your browser. Chrome and Edge may send audio to their own speech service.
You can edit your answer before you send it. Feedback uses AI and checks your answer only against our written answer. No credits are used and your answer is not saved.
Reveal the Model Answer
Keep one keyed scoreboard per master port for its own responses. A routing model maps each address to its slave and checks that each request appears on the right slave port. The interconnect may widen or remap IDs, so the model must apply the same mapping. Finally, a global check makes sure every request ends exactly once.
Self-Check
Tick each key point you covered in your answer.
What Interviewers Listen For (Staff)
A good staff answer splits the checking into separate models for routing, ordering and data. It names ID remapping by the interconnect as the risky part.
Missed Corner
"Compare each master's requests with each slave's requests by ID."
Interconnects often add bits to the ID to route the response back. The slave sees a different ID from the one the master sent.
Source Arm IHI 0022L §A5.4 (interconnect use of transaction identifiers)
-
Prove ItSolve U8.2.1: Interleaved Read BurstsSimulator-graded
Show it, don't just say it: this Silicon Lab problem is graded by the simulator.
What People Get Wrong
Common wrong answers and why they fail. Run It shows the wrong belief failing on a real simulator.
Half-Truth
"Search the pending list for a response with matching data."
It finds a match even when the data went to the wrong ID. The twin swaps the data of two IDs, and the search reports no error.
Run It
A design that swaps the read data of IDs 1 and 2, checked by searching for matching data.
errors=0 FAIL: matching by data alone accepted responses that went to the wrong IDSee the Fix
// Reads tagged with an ID may return out of order. This design swaps the data of IDs 1 and 2.
class sb;
typedef bit [7:0] byte_q[$];
byte_q pending[int]; // the fix: one in-order queue per ID
int errors;
function void expect_read(int id, bit [7:0] data);
pending[id].push_back(data);
endfunction
function void got_read(int id, bit [7:0] data);
bit [7:0] want;
if (!pending.exists(id) || pending[id].size() == 0) begin errors++; $display("unexpected id %0d", id); return; end
want = pending[id].pop_front();
if (data != want) begin errors++; $display("id %0d: got %0h, expected %0h", id, data, want); end
endfunction
endclass
module tb;
sb s = new();
initial begin
s.expect_read(1, 8'haa); s.expect_read(2, 8'hbb);
s.got_read(2, 8'haa); s.got_read(1, 8'hbb);
$display("errors=%0d", s.errors);
if (s.errors == 2)
$display("PASS: keyed by ID, both swapped responses were caught");
end
endmodule
Prints: id 2: got aa, expected bb id 1: got bb, expected aa errors=2 PASS: keyed by ID, both swapped responses were caught
Misconception
"An in-order queue is fine; reordering is rare."
Every legal reordering then shows up as a mismatch, and the team starts waiving errors. Out-of-order checking needs storage keyed by something the response carries.
Source Verification Academy, UVM Cookbook, Scoreboards: comparing transactions out of order (PDF p172)
Missed Corner
"One stored entry per ID is enough."
A master may have several reads open on one ID. A single entry is overwritten by the second request. A queue per ID keeps them in their legal order.
Source Arm IHI 0022L §A5.3 (request ordering: same-ID responses return in request order)