Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Model a recent-ID replay stream

Hardware interview practice

Model a recent-ID replay stream

HardReference ModelsSystemVerilog

Verify a streaming detector that reports the first repeated transaction ID whose accepted positions differ by at most a configured distance K. Input gaps and output stalls must not affect the result.

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
K=2; accepted ID frame=[4,7,4] with idle gaps between transfers; stall the response
Expected output
replay_found=1; first_index=0; second_index=2; stalled fields remain stable

Only accepted transfers define positions, and the repeated 4 has distance two, meeting the configured inclusive window.

What to cover

Requirements

  1. Accept one configuration before a nonempty frame, number only accepted ID transfers, and limit K to 15 and the frame to 16 IDs.
  2. Choose the lowest second index and then the lowest first index among pairs whose inclusive distance is at most K.
  3. Treat K zero as no replay and distinguish repeated IDs that lie outside the configured window.
  4. Compare only on an accepted response and require the stalled response payload to remain stable.
  5. Flush configuration, partial-frame state, and pending expectations on reset.
Continue practicing

Related questions

Reference ModelsVerify a minimum energy-window engine→Reference ModelsTrack named bin hits→Reference ModelsScoreboard a maximum-interval accelerator→
asic.fyi · Learn silicon end to end.info@asic.fyi