Arbiters
Fair-Share Arbiter 2-Request — L2 Upgrade
Fair-share arbiter with grant-lock and credit-based backpressure for two requests.
About this block
Simulate it in the Verilog IDE
Fair-Share Arbiter 2-Request — L2 Upgrade is a Verilog 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 fair-share arbiter for two request lines, designed for high-performance systems requiring balanced resource allocation.
It supports configurable weighted priority and round-robin alternation for equal weights.
Key features include a grant-lock mechanism for stable transaction handling and credit-based backpressure to prevent resource overuse and manage flow control.
- Choose Open in IDE. RTL Studio loads the packaged workspace for Fair-Share Arbiter 2-Request — L2 Upgrade.
- Read the Verilog module in the editor. The catalog line for this block: Fair-share arbiter with grant-lock and credit-based backpressure for two requests.
- 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
- Dual Request Support: Handles two concurrent request inputs.
- Configurable Arbitration: Supports weighted priority and round-robin fairness.
- Grant Locking: Holds the current grant state to ensure transaction stability.
- Credit-Based Flow Control: Manages backpressure and stall conditions using a credit system.
- Status Indicators: Provides
almost_fullandstallsignals for system monitoring.
Ports
| Port Name | Direction | Width | Description |
|---|---|---|---|
clk | Input | 1 | Clock input |
rst_n | Input | 1 | Active-low reset |
req | Input | 2 | Request signals for two channels (req[0], req[1]) |
weight | Input | 2 | Priority weights for each channel. Higher weight wins. Equal weights trigger round-robin. |
lock | Input | 1 | Assert high to lock the current grant |
credit_en | Input | 1 | Enable credit-based backpressure logic |
grant | Output | 2 | Granted channel mask (2'b01 for ch0, 2'b10 for ch1) |
valid | Output | 1 | High when a valid grant is issued |
almost_full | Output | 1 | High when credits are low (≤ 2) |
stall | Output | 1 | High when backpressure is active (credits exhausted) |
Verification
The testbench (tb_fair_share_arbiter_2_grant_lock_credit.v) covers the following scenarios:
| Test Case | Description | Result |
|---|---|---|
| TC1 | Basic single request grant | PASS |
| TC2 | Weight priority | PASS |
| TC3 | Stall when credits exhausted | PASS |
| TC4 | Fair share alternation | PASS |
| TC5 | Lock functionality | PASS |
Running Tests: After running the simulation, the log should display:
TC1 PASSTC2 PASSTC3 PASS (Stall not asserted when credits likely available)TC4 PASSTC5 PASSSimulation ends with INFO: PASS.
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
- 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
- Lock-Free N-Input Arbiter with Backpressure
- 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