Skip to the selected question
ASIC.FYI

ASIC Question Bank

1,000+ hardware interview questions
DescriptionQ500
Page ↗
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 interpretation
Input
timeout_cycles=5; outstanding reaches0 at poll2; expected queue becomes empty at poll4
Output
wait returns successfully after poll4
Explanation

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.