DescriptionQ500
Q500DVASIC interview problem
Wait for drain with a deadline
TechniquesEnd of testTimeoutQueues
DifficultyMedium
TopicTemporal Checks
LanguageSystemVerilog
Requirements3 checkpoints
01
Problem
Wait for all outstanding work and expected transactions to drain, but fail if the deadline expires.
Example input and output
Use this case to check your interpretationInput
timeout_cycles=5; outstanding reaches0 at poll2; expected queue becomes empty at poll4Output
wait returns successfully after poll4Explanation
Drain requires both conditions simultaneously; completion before the fifth poll avoids the fatal deadline.
02
Requirements (3)
- Check both the outstanding counter and expected queue.
- Count at most timeout_cycles.
- Report a fatal error when either remains non-empty.
