RTL Studio Open IDE

Arbiters

Fixed-Priority 4-Request Arbiter — L1 Upgrade — L2 Upgrade

Fixed-priority 4-request arbiter with mask, hold, grant-lock, and credit/almost-full.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Fixed-Priority 4-Request Arbiter — L1 Upgrade — 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 fixed-priority arbiter for four request lines. It supports request masking, state holding, grant locking, and credit-based almost-full detection. It is designed for L1 and L2 upgrade scenarios where deterministic latency and resource efficiency are critical.

This arbiter provides robust priority management with advanced features including:

  • Fixed Priority: Priority 0 is highest, Priority 3 is lowest.
  • Masking: Individual request lines can be disabled via the mask port.
  • Hold Functionality: The hold signal freezes the current grant state, preventing state changes during critical operations.
  • Grant Lock: The grant_lock_en signal allows the current grant to be maintained until explicitly released or pending requests drop to zero.
  • Credit-Based Almost-Full: Monitors pending request counts against a configurable threshold to prevent buffer overflow.

The design is fully synchronous, resettable, and verified against eight key test scenarios covering basic arbitration, masking, hold, lock, empty requests, and reset behavior.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Fixed-Priority 4-Request Arbiter — L1 Upgrade — L2 Upgrade.
  2. Read the Verilog module in the editor. The catalog line for this block: Fixed-priority 4-request arbiter with mask, hold, grant-lock, and credit/almost-full.
  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

  • Priority Encoding: Selects the highest priority valid request. Priority 0 is highest, Priority 3 is lowest.
  • Request Masking: Allows individual request lines to be ignored by the arbiter via the mask port.
  • State Hold: Prevents state transitions when hold is asserted, freezing the current grant.
  • Grant Lock: Maintains the current grant until grant_lock_en is deasserted or no pending requests remain.
  • Almost Full Detection: Triggers when pending requests exceed a configurable credit threshold.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low reset
reqInput4Request signals [3:0]
maskInput4Mask signals [3:0]; 1=ignore, 0=enable
holdInput1Hold current grant; freezes state machine
grant_lock_enInput1Enable grant lock; holds current grant
creditInput4Credit threshold [3:0] for almost-full detection
almost_full_enInput1Enable almost full logic
grantOutput1Grant signal; high if any request is granted
grant_idOutput2Granted request ID [1:0]
almost_fullOutput1Almost full status; high if pending >= credit

Architecture

The design uses a registered state machine to manage arbitration. Combinational logic determines the next grant ID based on priority, masking, and control signals. A pending request register tracks active requests for credit counting.

### State Machine Logic

  1. Hold Priority: If hold is asserted, the state machine retains the current grant, grant_id, and lock_state.
  2. Lock Priority: If not holding, and lock_state is active, the state machine retains the current grant until grant_lock_en is deasserted or pending_req is zero.
  3. Arbitration: If neither hold nor lock is active, the highest priority valid request is selected.
  4. Pending Count: The pending_req register is updated based on valid requests. A request is considered "pending" until it is granted.

Verification

The testbench covers eight key scenarios to ensure correct operation under various input conditions.

Test CaseDescriptionResult
TC1Basic priority arbitrationPASS
TC2MaskingPASS
TC3Hold functionalityPASS
TC4Grant LockPASS
TC5Grant Lock ReleasePASS
TC6Almost FullPASS
TC7No RequestsPASS
TC8ResetPASS

### Expected Simulation Output

After running the simulation, the Log panel should show:

  • TC1 PASS - Basic priority
  • TC2 PASS - Masking
  • TC3 PASS - Hold
  • TC4 PASS - Grant Lock
  • TC5 PASS - Grant Lock Release
  • TC6 PASS - Almost Full
  • TC7 PASS - No Requests
  • TC8 PASS - Reset

More in Arbiters

All Arbiters blocks