Arbiters
Lock-Free N-Input Arbiter with Backpressure
A lock-free arbiter that grants access to the lowest-priority active request and holds the grant until acknowledgment, supporting backpressure.
About this block
Simulate it in the Verilog IDE
Lock-Free N-Input Arbiter with Backpressure is a SystemVerilog reference block in the Arbiters catalog. Round-robin, fixed-priority, and grant-based resource arbiters. Marked Medium: more state or a wider datapath, still one workspace in the IDE.
This IP implements a lock-free N-input arbiter with backpressure support. It uses a simple two-state finite state machine to manage grant cycles. The arbiter prioritizes the lowest-indexed request when multiple inputs are active. It holds the grant signal until the corresponding channel acknowledges receipt. The busy output indicates when the arbiter is waiting for an acknowledgment.
This lock-free arbiter provides a robust solution for managing multiple input requests. It guarantees fair priority based on bit index and supports backpressure. The design is simple, efficient, and fully verified.
- Choose Open in IDE. RTL Studio loads the packaged workspace for Lock-Free N-Input Arbiter with Backpressure.
- Read the SystemVerilog module in the editor. The catalog line for this block: A lock-free arbiter that grants access to the lowest-priority active request and holds the grant until acknowledgment, supporting backpressure.
- Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
- Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.
RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.
Features
- Lock-free operation: Ensures no deadlock conditions by using a simple state machine.
- Backpressure support: Holds the grant signal until an acknowledgment is received from the specific channel.
- Priority encoding: Favors the lowest bit index (bit 0 has highest priority).
- Synchronous design: Uses a single clock domain and synchronous reset.
- Verified: Verified with Verilator simulation.
Architecture
The design consists of a combinational priority encoder and a sequential state machine.
- Priority Encoder: In the
IDLEstate, if any request is active, the lowest-indexed bit is selected using the expressionreq & (~req + 1). - State Machine: Transitions between
IDLEandWAIT_ACKstates.
- IDLE: Checks for active requests. If present, calculates the grant mask and transitions to WAIT_ACK. - WAIT_ACK: Waits for the specific channel to acknowledge. If the acknowledgment matches the current grant, it returns to IDLE. Otherwise, it holds the grant and remains in WAIT_ACK.
Ports
| Port Name | Direction | Width | Description |
|---|---|---|---|
clk | Input | 1 | Clock input |
rst_n | Input | 1 | Active-low asynchronous reset |
req | Input | 4 | Request inputs from 4 channels |
grant | Output | 4 | Grant outputs to 4 channels |
ack | Input | 4 | Acknowledge inputs from 4 channels |
busy | Output | 1 | High when waiting for acknowledgment |
Verification
The testbench covers four key scenarios to ensure correctness:
- Single Request: Verifies proper grant/ack behavior for a single active request.
- Priority Selection: Verifies that the lowest bit index is selected when multiple requests are active.
- Backpressure: Verifies that the grant is held if no acknowledgment is received.
- Rapid Succession: Verifies handling of rapid request/grant cycles.
### Running Simulation
To verify the design, use Verilator:
Expected Output: The simulation log should end with:
More in Arbiters
- 2-Request Lock-Until-Idle Arbiter
- 2-Request Static Priority Grant
- 4-Channel Oldest-First (FIFO) Arbiter — L2 Upgrade
- 4-Channel Round-Robin Arbiter with Priority Rotation
- 4-Input Sliding Window Arbiter — L2 Upgrade
- 4-Request Masked Priority Grant
- Fair-Share Arbiter 2-Request — L2 Upgrade
- Fixed-Priority 4-Request Arbiter — L1 Upgrade — L2 Upgrade
- Fixed-Priority Arbiter with Grant Mask
- Grant-Hold Arbiter (4 req) — L2 Upgrade
- Least Recently Used (LRU) Arbiter — L2 Upgrade
- Matrix Arbiter 4-Port
- Sticky RR Hold Arbiter 4
- Token-Ring Arbiter 4
- Weighted Priority Arbiter (4 req) — L2 Upgrade
- Weighted Round-Robin Arbiter 4 — L2 Upgrade