What you practice
AXI4-Lite slave FSM: enum states and case transitions (1.4). Control AXI4-Lite transactions with an enum-based FSM and case state transitions. It is in AXI4-Lite Slave FSM — Part 1 · AXI4-Lite RTL Design of the AXI Masterclass. Design an AXI4-Lite slave in pure SystemVerilog.
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
You will implement an AXI4-Lite slave state machine using a SystemVerilog enum to replace ad-hoc state variables, ensuring clean, synthesizable state transitions.
Learning objectives
- Define and use a SystemVerilog enum for finite state machine states.
- Map each state to a clear case branch in the sequential logic.
- Drive AXI4-Lite handshake signals (awready, wready, arready, rvalid, bvalid) via state transitions.
- Verify overlapping write and read transactions in simulation.
Theory
AXI4-Lite requires precise handshake sequencing: write address (AW), write data (W), write response (B), read address (AR), and read data (R). An FSM ensures correct ordering and prevents protocol violations.
Using an enum improves readability and synthesis robustness compared to raw logic [1:0] state variables. The four canonical AXI4-Lite states are:
| State | Purpose |
|---|---|
| IDLE | Wait for AW or AR valid |
| WRITE | Capture W data and write to register |
| READ | Drive R data and wait for RREADY |
| RESP | Assert BVALID and wait for BREADY |
The FSM transitions are driven entirely by the current state and valid/ready handshake conditions.
Practice
- Open
student/rtl/axi_lite_slave.svandstudent/tb/tb_top.svin RtlStudio. - In
student/rtl/axi_lite_slave.sv, replace__TODO__in thetypedef enumdeclaration with{IDLE, WRITE, READ, RESP}. - In the reset block, replace
__TODO__withIDLE. - In the
IDLEcase, replace the three__TODO__assignments withWRITE,READ, andREADrespectively. - Run Simulation and verify the Log panel shows expected INFO lines.
Summary
You implemented an AXI4-Lite slave state machine using a SystemVerilog enum to cleanly sequence control signals like awready, wready, arready, and rvalid. By replacing ad-hoc handshake logic with a structured case statement, you ensured predictable state transitions and improved design maintainability. The FSM correctly handled overlapping read and write requests in testbench, demonstrating robust transaction flow control.
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 AXI4-Lite slave FSM: enum states and case transitions. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.