RTL Studio Open IDE

Arbiters

Token-Ring Arbiter 4

A 4-input token-ring arbiter that rotates a one-hot grant token to the next active requester, ensuring fair access.

About this block

Simulate it in the Verilog IDE

Easyverilogsimsyn

Token-Ring Arbiter 4 is a Verilog reference block in the Arbiters catalog. Round-robin, fixed-priority, and grant-based resource arbiters. Marked Easy: a small block you can read, simulate, and synthesize in one sitting.

This IP implements a 4-input Token-Ring Arbiter in Verilog.

It provides fair, round-robin access to a shared resource among four requesters using a rotating one-hot token mechanism.

The design ensures deterministic, starvation-free arbitration and is fully verified and synthesis-ready.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Token-Ring Arbiter 4.
  2. Read the Verilog module in the editor. The catalog line for this block: A 4-input token-ring arbiter that rotates a one-hot grant token to the next active requester, ensuring fair access.
  3. Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
  4. 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

  • Fair Arbitration: Round-robin access ensures equitable distribution of resource access.
  • Low Latency: Combinational grant logic provides immediate response to active requests.
  • Synthesis Ready: Verified for standard CMOS processes.
  • Comprehensive Verification: 7 test cases covering reset, single/multi-request, and rotation scenarios.
  • Deterministic: No priority encoding; strictly follows token rotation.

Ports

PortDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low asynchronous reset
reqInput4Request signals [3:0]
grantOutput4Grant signals [3:0]

Architecture

The design consists of a sequential token register and combinational logic for next-token calculation and grant generation.

  1. Token Register: Updates on the positive edge of clk. Initialized to 4'b0001 (position 0) on reset.
  2. Next Token Logic: Prioritizes requests from req[0] to req[3]. If no requests are active, the token rotates to the next position.
  3. Grant Logic: Bitwise AND of the current token register and the request vector.

Verification

The testbench validates the following scenarios using Icarus Verilog:

Test CaseDescriptionResult
TC1Reset state checkPASS
TC2Single request at req[0]PASS
TC3Rotate to req[1]PASS
TC4Req at rotated tokenPASS
TC5Multiple requestsPASS
TC6No requests rotationPASS
TC7Token at position 3PASS

All test cases passed successfully. A VCD waveform is generated for inspection.

Integration

To integrate this IP into your design:

  1. Include rtl/token_ring_arbiter_4.v in your project.
  2. Instantiate the module:
  3. Connect your request and grant signals to the arbiter ports.

Limitations

  • Single Clock Domain: This IP assumes a single clock domain. For cross-clock domain applications, additional synchronization logic is required.
  • Priority: If multiple requests are active, the arbiter prioritizes lower-indexed requests (req[0] > req[1] > req[2] > req[3]) only if the token is not currently aligned with a higher-indexed active request. However, the token rotation ensures long-term fairness.

More in Arbiters

All Arbiters blocks