Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Match transactions in strict order

Hardware interview practice

Match transactions in strict order

MediumReference ModelsSystemVerilog

Implement the core of an in-order scoreboard. Expected and actual transactions arrive independently, but every actual transaction must match the oldest unmatched expected transaction.

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 →
Reviewed example

Work through one case

Input
push expected=(id=1,data=A), then (id=2,data=B); actual arrivals=(1,A), then (2,B)
Expected output
two ordered matches; expected queue empty at finish

Each actual compares only with the cloned queue front and consumes exactly one expectation, so reversing the actual arrivals would fail immediately.

What to cover

Requirements

  1. Clone expected transactions before storing them so later producer edits cannot mutate scoreboard state.
  2. Report an actual transaction when no expected item is available.
  3. Compare against the queue front and consume exactly one expected entry per actual entry.
  4. At end of test, report any expected transactions that never arrived.
Continue practicing

Related questions

Reference ModelsMatch out-of-order packets by ID→Reference ModelsScoreboard a maximum-interval accelerator→Reference ModelsMonitor an independently stalled binary adder→
asic.fyi · Learn silicon end to end.info@asic.fyi