Round-Robin Arbiter
Medium · Sequential · SystemVerilog · VHDL
Design a round-robin arbiter for N requesters.
req[i] is high while requester i asks for access. Each cycle the arbiter grants at most one asking requester: the first one at or after the requester following the last one granted, wrapping from N-1 to 0. Before the first grant the search starts at requester 0. A cycle with no requests grants nothing and leaves the search position unchanged.
grant is one-hot, with bit i set for the granted requester, or 0 when nothing is granted, and valid is high when a requester is granted. Both are registered: the grant decided from a cycle's req appears in the following cycle.
resetn is a synchronous, active-low reset; it clears grant and valid, and the search starts again at requester 0.
- Arbitration & flow control