RTL Studio Open IDE

1.4 · AXI CLASS

AXI4-Lite slave FSM: enum states and case transitions

Control AXI4-Lite transactions with an enum-based FSM and case state transitions.

Watch on YouTube

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:

StatePurpose
IDLEWait for AW or AR valid
WRITECapture W data and write to register
READDrive R data and wait for RREADY
RESPAssert BVALID and wait for BREADY

The FSM transitions are driven entirely by the current state and valid/ready handshake conditions.

Practice

  1. Open student/rtl/axi_lite_slave.sv and student/tb/tb_top.sv in RtlStudio.
  2. In student/rtl/axi_lite_slave.sv, replace __TODO__ in the typedef enum declaration with {IDLE, WRITE, READ, RESP}.
  3. In the reset block, replace __TODO__ with IDLE.
  4. In the IDLE case, replace the three __TODO__ assignments with WRITE, READ, and READ respectively.
  5. 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

  1. Open the lesson in the IDE and find the valid/ready or AXI channel ports in the editor.
  2. Simulate with Verilator. Confirm the beat on the VCD, not only in the transcript.
  3. Check that data moves only on the beats this lesson describes, and that backpressure holds the transfer.
  4. 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.