What you practice
Write data channel: WSTRB and WLAST for write bursts (3.2). Manage WSTRB, a write beat counter, and WLAST to terminate write bursts. It is in Write Data Channel — Part 3 · AXI4 Full RTL Design of the AXI Masterclass. Burst, outstanding, and a BRAM memory bridge.
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
Today you will implement write burst termination logic by tracking remaining beats and asserting WLAST on the final transfer, ensuring correct AXI4 write protocol compliance.
Learning objectives
- Understand how WLAST marks the final beat of a write burst.
- Implement a write beat counter to detect the last transfer.
- Use WSTRB to conditionally update the write address.
- Synchronize burst termination with the AXI4 handshake.
Theory
In AXI4, the write data channel uses WLAST to indicate the last beat of a write burst. The slave must assert WREADY before accepting WDATA, and the master asserts WLAST only on the final beat. The write address increments per beat based on AWSIZE, but only when WSTRB indicates valid byte lanes. The beat counter starts at AWLEN+1 and decrements until it reaches 1 on the last beat.
| Signal | Role |
|---|---|
WLAST | Asserted only on the final write data beat |
WSTRB | Byte strobe indicating which bytes are valid |
beats_left | Counter tracking remaining beats (starts at AWLEN+1) |
The write address update must be conditional: only when beats_left > 1 and |wstrb is non-zero.
Practice
- Open this chapter in RtlStudio; confirm
student/rtl/axi_full_mem.svandstudent/tb/tb_top.svappear in Explore. - Edit
student/rtl/axi_full_mem.svto initializebeats_lefttoawlen + 1on AW handshake and after each W transfer. - Add logic to assert
wr_activetermination only whenbeats_left == 1andwlastis high. - Run Simulation and check the Log panel for expected
INFO:messages.
Summary
You implemented a write beat counter to track progress through a write burst and asserted WLAST on the final beat to signal completion. You applied byte strobe (WSTRB) masking to ensure only valid bytes are written during each transfer. This reinforced AXI4 write burst semantics and ensured correct handshaking with the memory slave.
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 Write data channel: WSTRB and WLAST for write bursts. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.