DescriptionQ023
Q023DVASIC interview problem
Match out-of-order packets by ID
TechniquesScoreboardOut-of-orderID matchingAssociative array
DifficultyMedium
TopicReference Models
LanguageSystemVerilog
Requirements4 checkpoints
01
Problem
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.

Example input and output
Use this case to check your interpretationInput
expected: id1=A, id1=B, id2=C; responses: id2=C, id1=A, id1=BOutput
all three match; per-ID queues emptyExplanation
Cross-ID reordering is legal, but the two id1 responses still consume A before B from that ID's FIFO.
02
Requirements (4)
- Store a FIFO of expected transactions for every ID instead of one value per ID.
- Reject an output whose ID has no pending expectation.
- Compare with the oldest expected packet for that ID and remove it only after selecting it.
- Report every nonempty per-ID queue at end of test.
