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
| Name | Type | Default | Description |
|---|---|---|---|
NUM_IN | int unsigned | 64 | Number of inputs to arbitrate. |
DATA_WIDTH | int unsigned | 32 | Payload width in bits; unused when data_t is overridden. |
EXT_PRIO | bit | 1'b0 | 1 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_RDY | bit | 1'b0 | 1 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_IN | bit | 1'b0 | 1 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_ARB | bit | 1'b1 | 1 spreads throughput evenly across inputs; 0 advances the pointer by one per grant. Ignored when EXT_PRIO is 1. |
IdxWidth | int unsigned | (NUM_IN > 32'd1) ? unsigned'($clog2(NUM_IN)) : 32'd1 | Dependent width of priority and index; do not overwrite. |
Ports
| Name | Direction | Type | Description |
|---|---|---|---|
clk_i | input | logic | Clock, positive-edge triggered. |
rst_ni | input | logic | Active-low reset, sampled synchronously. |
flush_i | input | logic | Synchronously clears the RR pointer and, with LOCK_IN, the lock state; no effect when EXT_PRIO is 1. |
rr_priority_i | input | idx_t | External RR priority; used only when EXT_PRIO is 1. |
request_i | input | logic [NUM_IN-1:0] | Per-port arbitration requests. |
grant_o | output | logic [NUM_IN-1:0] | Per-port grants. |
data_i | input | data_t [NUM_IN-1:0] | Per-port payloads. |
request_o | output | logic | Winning request toward the destination. |
grant_i | input | logic | Destination grant for the winner. |
data_o | output | data_t | Winning payload. |
index_o | output | idx_t | Index of the winning input; valid while request_o is high. |