What you practice
Multi-master arbiter RTL: round-robin grant logic (5.4). Implement round-robin arbitration for simultaneous master requests. It is in Multi-Master Arbitration RTL — Part 5 · SVA and System Integration of the AXI Masterclass. SVA protocol checkers, multi-master systems, and the capstone.
AXI only counts when the handshake simulates. RTL Studio is the Verilog and SystemVerilog IDE where you edit the RTL and prove each beat on a VCD.
What you will learn
This lesson teaches how to implement round-robin arbitration in an AXI crossbar to resolve simultaneous master requests and ensure fair access to shared slaves.
Learning objectives
- Understand round-robin priority logic for multi-master arbitration.
- Implement grant selection and priority update in
always_ffblocks. - Track write transactions per master to avoid stale grant state.
- Handle simultaneous requests on the same slave port.
- Verify arbitration fairness with competing write bursts.
Theory
Round-robin arbitration rotates grant priority between masters when both request the same slave simultaneously. The rr_turn signal tracks which master was granted last; when both request, the *other* master wins, and rr_turn flips. This prevents starvation and ensures fairness over time.
| Condition | Grant to | Next rr_turn |
|---|---|---|
| Only M0 requests S0 | M0 | unchanged |
| Only M1 requests S0 | M1 | unchanged |
Both request S0, rr_turn==0 | M0 | 1'b1 |
Both request S0, rr_turn==1 | M1 | 1'b0 |
The priority update occurs *only* when a write address phase completes on the selected slave (awready), and only when there was a clash. The wr_* flags track which master’s write is in-flight to clear grants on bvalid.
Practice
- Open RtlStudio and select this chapter.
Confirm files in Explore: student/rtl/axi_crossbar.sv, student/tb/tb_top.sv.
- Open
student/rtl/axi_crossbar.svin the editor. - In the
always_ffblock, replace each__TODO__with the correct reset value and priority flip logic:
- Reset rr_turn to 1'b0. - When M0 wins a clash on S0, set rr_turn <= 1'b1. - When M1 wins a clash on S0, set rr_turn <= 1'b0. - When M0 wins a clash on S1, set rr_turn <= 1'b1. - When M1 wins a clash on S1, set rr_turn <= 1'b0. > 💡 Note: Round-robin updates happen *only* on awready && (m0_req || m1_req) — ensure your logic respects this condition to avoid stale state.
- Run Simulation and check Log for
INFO:messages.
Summary
You implemented round-robin arbitration logic in the AXI crossbar to resolve simultaneous master requests by rotating grant priority. This ensures fair access to shared resources across multiple masters without starvation. The SVA assertions validated correct grant behavior under concurrent request scenarios, confirming robust system integration.
Run it in the Verilog IDE
- Open the lesson in the IDE and find the valid/ready or AXI channel ports in the editor.
- Simulate with Verilator. Confirm the beat on the VCD, not only in the transcript.
- Check that data moves only on the beats this lesson describes, and that backpressure holds the transfer.
- Synthesize the RTL master, slave, or buffer with Yosys. Leave the UVM bench out of synthesis.
The lesson is done when the simulation matches Multi-master arbiter RTL: round-robin grant logic. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.