Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Match out-of-order packets by ID

Hardware interview practice

Match out-of-order packets by ID

MediumReference ModelsSystemVerilog

Implement a scoreboard for responses that may arrive in any cross-ID order while preserving order within each ID. Support more than one outstanding packet with the same ID.

Try it in the question bankReason first. Then compare.

Keep this exact question selected while you check your answer and review the full solution.

Practice this question →
Scoreboard architecture with a FIFO of expected packets for each transaction ID and out-of-order actual responses matched within each ID.
The per-ID queues preserve order within an ID while allowing different IDs to complete out of order.
Reviewed example

Work through one case

Input
expected: id1=A, id1=B, id2=C; responses: id2=C, id1=A, id1=B
Expected output
all three match; per-ID queues empty

Cross-ID reordering is legal, but the two id1 responses still consume A before B from that ID's FIFO.

What to cover

Requirements

  1. Store a FIFO of expected transactions for every ID instead of one value per ID.
  2. Reject an output whose ID has no pending expectation.
  3. Compare with the oldest expected packet for that ID and remove it only after selecting it.
  4. Report every nonempty per-ID queue at end of test.
Continue practicing

Related questions

Reference ModelsTrack named bin hits→Reference ModelsMatch transactions in strict order→Reference ModelsScoreboard a maximum-interval accelerator→
asic.fyi · Learn silicon end to end.info@asic.fyi