Skip to question
ASIC.FYI
DesignVerificationSystemVerilogFirmwareArchitectureInterviews
ASIC.FYI/Interview questions/Detect a starving arbiter requester

Q182·Free·SystemVerilog

Detect a starving arbiter requester

Difficulty
Medium
Topic
Arbiters
Language
SV
Interview prompt

Question

Add a watchdog that flags any port that remains continuously asserted but ungranted for more than K sampled cycles.

Starting point

Question code

class StarvationWatchdog #(int N = 8);
  function void sample(int grant_idx, bit [N-1:0] reqs);
  function bit port_starving(int port);
  function bit any_starving();
endclass
Reviewed example

Trace one case

Input
K=2; port1 requests without a grant on sampled cycles0,1,2, then wins on cycle3
Expected output
wait counts=1,2,3 with starvation asserted after cycle2; cycle3 clears count and flag

Continuous ungranted assertion increments through cycles with no winner, and an accepted grant resets that port's watchdog state.

What to cover

Requirements

  1. Maintain a wait count and starvation flag per port.
  2. Increment a port only while it requests and does not receive the accepted grant.
  3. Clear a port's state when it wins or stops requesting.
  4. Set a global alert when any per-port count exceeds K.
  5. Count asserted requesters during cycles in which there is no grant.
  6. Expose both per-port status and the global alert.
Exact question handoffPractice Q182

Solve it in the question bank, keep your progress, and reveal the reviewed solution when your access allows.

Open in question bank →
Solution accessA Free account unlocks the complete reviewed solution.
Continue learning

SystemVerilog

  • Arbiters
  • Fairness
  • Watchdog
  • Starvation
RTL design questions →
Continue practicing

Related questions

Q292 · ArbitersPredict a strict round-robin grant→Q293 · ArbitersSelect round-robin winners with rotate and isolate→Q038 · Clock Domain CrossingModel a CDC-safe asynchronous FIFO→
ASIC.FYI · Learn silicon end to end.info@asic.fyi