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

Hardware interview practice

Match out-of-order responses by ID

MediumUVMSystemVerilog

Requests use unique 8-bit IDs, and responses may return in any order. Build an ID-indexed scoreboard for operand-squared results, duplicate detection, exact comparison, and end-of-test leftovers.

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 →
Starting point

Question code

req: id[7:0], operand[15:0]
rsp: id[7:0], result[31:0]
expected result = operand * operand
maximum 32 outstanding requests
Reviewed example

Work through one case

Input
Requests (1,3), (2,4); responses (2,16), (1,9)
Expected output
Both responses pass and the associative array becomes empty

Each response is matched by ID rather than arrival position.

What to cover

Requirements

  1. On each request, compute the expected result and store it in an associative array indexed by ID; reject a duplicate outstanding ID.
  2. On each response, require the ID to exist, compare result exactly, then delete that ID after the comparison.
  3. Report an unexpected ID, duplicate request ID, data mismatch, and any entries still present at end of test as distinct errors.
  4. Do not compare responses by arrival order; the only ordering key is the response ID.
Continue practicing

Related questions

UVMOut-of-order scoreboard for a 2-by-4 router→UVMBuild a FIFO UVM testbench→SystemVerilog & UVMOut-of-order scoreboard for tagged pixel jobs→
asic.fyi · Learn silicon end to end.info@asic.fyi