Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Check a per-ID latency window

Hardware interview practice

Check a per-ID latency window

MediumReference ModelsPYTHON

Implement a checker requiring every response to arrive 3 through 6 cycles after its matching request. Multiple requests, including repeated IDs, may be in flight.

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 →
Per-ID request and response timeline pairing repeated ID-five requests with the oldest unmatched responses at latencies three and six.
Pair each response with the oldest unmatched request of the same ID before checking the latency window.
Reviewed example

Work through one case

Input
request id5 at cycle 10; request id5 at cycle 12; responses id5 at cycles 13 and 18
Expected output
oldest request latency=3 PASS; next request latency=6 PASS; no pending requests

Repeated IDs pair with their oldest unmatched send, and both inclusive legal boundaries 3 and 6 are exercised.

What to cover

Requirements

  1. Measure integer clock cycles, not simulator time units.
  2. Pair a response with the oldest unmatched send for its ID.
  3. Treat both latency boundaries as inclusive.
  4. Reject unexpected responses and report missing responses at the end.
Continue practicing

Related questions

Reference ModelsCheck arbitrarily reordered packets→
asic.fyi · Learn silicon end to end.info@asic.fyi