DescriptionQ292
Q292DesignArchASIC interview problem
Predict a strict round-robin grant
TechniquesDesignArchDVRound robinCircular priority
DifficultyMedium
TopicArbiters
LanguageSystemVerilog
Requirements5 checkpoints
01
Problem
Build a stateful predictor for an N-port strict round-robin arbiter. Given a request vector, return the winning port, return -1 when idle, and move priority to the port immediately after each accepted winner.

Class declarationSystemVerilog
class RRPredictor #(int N = 8);
function int predict_next(bit [N-1:0] reqs);
function void update_state(int grant_idx);
function void reset();
endclassExample input and output
Use this case to check your interpretationInput
N=4,next_priority=0; active request ports={1,3}; predict twiceOutput
grant port1 then port3; next_priority returns to0Explanation
The strict circular scan begins at the saved pointer and moves priority to the port immediately after each accepted winner.
02
Requirements (5)
- Give port zero first priority after reset.
- Search circularly from the current next-priority port.
- Return one winning index or -1 when no request is active.
- Update state only for a valid grant index.
- Preserve fairness for continuously asserted requesters.
