Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Wait for drain with a deadline

Hardware interview practice

Wait for drain with a deadline

MediumTemporal ChecksSystemVerilog

Wait for all outstanding work and expected transactions to drain, but fail if the deadline expires.

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
timeout_cycles=5; outstanding reaches0 at poll2; expected queue becomes empty at poll4
Expected output
wait returns successfully after poll4

Drain requires both conditions simultaneously; completion before the fifth poll avoids the fatal deadline.

What to cover

Requirements

  1. Check both the outstanding counter and expected queue.
  2. Count at most timeout_cycles.
  3. Report a fatal error when either remains non-empty.
asic.fyi · Learn silicon end to end.info@asic.fyi