Skip to question
asic.fyi
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
asic.fyi/Interview questions/Fix event-loss and shared-state monitor bugs

Hardware interview practice

Fix event-loss and shared-state monitor bugs

MediumVerificationSystemVerilog

A monitor starts waiting for interrupt only after write_start, but an earlier interrupt must cancel the next write. Concurrent task calls also share static locals. Identify and fix both bugs.

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 →
Starting point

Question code

// Events: write_start, interrupt, reset
// Multiple re-entrant monitor calls may be active.
Reviewed example

Work through one case

Input
interrupt at cycle 5; write_start at cycle 6
Expected output
The cycle-6 write is canceled and the pending interrupt is consumed

A lifetime interrupt collector preserves the event before any write-specific task starts.

What to cover

Requirements

  1. Capture interrupts continuously in persistent state or a queue.
  2. Atomically consume a pending interrupt when a write begins.
  3. Use automatic per-call storage or transaction objects.
  4. Define reset to clear pending interrupts and cancel active work deterministically.
Continue practicing

Related questions

SystemVerilog SchedulingReason about same-region forked output order→
asic.fyi · Learn silicon end to end.info@asic.fyi