prim_fair_rr_arb

Arbitrate NUM_IN requesters round-robin through a combinational binary tree.

request_o, data_o, index_o and grant_o are combinational; only the round-robin pointer and the optional lock state are registered. With NUM_IN of 1 the module is a pass-through. Select the arbitration behaviour with these parameters:

  • FAIR_ARB moves the pointer to the next requesting input after each grant, spreading grants evenly across inputs.
  • LOCK_IN holds a winner until grant_i completes.
  • EXT_PRIO replaces the internal RR counter with rr_priority_i so multiple arbiters can share rotating priorities in lock-step; tie rr_priority_i to '0 for static priority, lowest index first. FAIR_ARB and LOCK_IN apply only when EXT_PRIO is 0.
  • AXI_VLD_RDY treats request/grant as AXI-style valid/ready, so upstream valid must not depend on ready; it reduces arbiter delay and area.

Parameters

Table 1. Parameters
NameTypeDefaultDescription
NUM_INint unsigned64Number of inputs to arbitrate.
DATA_WIDTHint unsigned32Payload width in bits; unused when data_t is overridden.
EXT_PRIObit1'b01 overrides the internal RR counter with rr_priority_i. Share rr_priority_i across arbiters for lock-step rotation; tie to '0 for static priority.
AXI_VLD_RDYbit1'b01 treats request/grant as AXI valid/ready: upstream valid must not depend on ready, and grant_o may assert on the selected input without its request; reduces arbiter delay and area.
LOCK_INbit1'b01 freezes the request vector, and so the winning index, while request_o is high and grant_i is low; ignored when EXT_PRIO is 1.
FAIR_ARBbit1'b11 spreads throughput evenly across inputs; 0 advances the pointer by one per grant. Ignored when EXT_PRIO is 1.
IdxWidthint unsigned(NUM_IN > 32'd1) ? unsigned'($clog2(NUM_IN)) : 32'd1Dependent width of priority and index; do not overwrite.

Ports

Table 2. Ports
NameDirectionTypeDescription
clk_iinputlogicClock, positive-edge triggered.
rst_niinputlogicActive-low reset, sampled synchronously.
flush_iinputlogicSynchronously clears the RR pointer and, with LOCK_IN, the lock state; no effect when EXT_PRIO is 1.
rr_priority_iinputidx_tExternal RR priority; used only when EXT_PRIO is 1.
request_iinputlogic [NUM_IN-1:0]Per-port arbitration requests.
grant_ooutputlogic [NUM_IN-1:0]Per-port grants.
data_iinputdata_t [NUM_IN-1:0]Per-port payloads.
request_ooutputlogicWinning request toward the destination.
grant_iinputlogicDestination grant for the winner.
data_ooutputdata_tWinning payload.
index_ooutputidx_tIndex of the winning input; valid while request_o is high.