What you practice
AXI4 slave memory controller: BRAM wrapper bridge (3.6). Map AXI4 write strobes to BRAM byte enables and verify burst write/readback. It is in AXI4 Slave Memory Controller — 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 the bridge between full AXI4 write traffic and a simple BRAM-style memory port by correctly mapping the AXI write strobe (wstrb) signals to byte-level write enables on the BRAM array.
Learning objectives
- Understand how AXI4 write strobes (
wstrb) control byte-level writes in memory. - Map 4-bit
wstrbto 4 byte lanes of a 32-bit BRAM word. - Verify burst write and readback correctness through testbench logs.
- Practice address decoding for BRAM indexing using
bram_index().
Theory
AXI4 write strobes (wstrb[3:0]) indicate which byte lanes are valid during a write transfer. In a 32-bit data path, each bit corresponds to one byte:
wstrb bit | Byte lane | BRAM slice |
|---|---|---|
wstrb[0] | LSB | data[7:0] |
wstrb[1] | data[15:8] | |
wstrb[2] | data[23:16] | |
wstrb[3] | MSB | data[31:24] |
The BRAM is modeled as an array of 32-bit words: logic [31:0] bram [0:MEM_WORDS-1]. To write selectively, assign each byte slice conditionally based on wstrb bits.
Practice
- Open RtlStudio and select Lesson 3.6.
Confirm student/rtl/axi_full_mem.sv and student/tb/tb_top.sv appear in Explore.
- In
student/rtl/axi_full_mem.sv, locate theif (|bus.wstrb)block inside the write data handling section. - Replace each
__TODO__comment with a BRAM assignment that writes the corresponding byte lane frombus.wdatatobram[idx]when the strobe bit is set. - Run Simulation and check the Log panel for
INFO:messages. - Verify the final
INFO: PASSline appears after readback comparison.
Summary
You implemented an AXI4 slave memory controller that bridges full AXI4 traffic to a simple BRAM interface. You mapped write strobes (WSTRB) to BRAM byte write enables and handled address decoding for burst reads and writes. Through simulation, you verified correct burst write and readback behavior, confirming the controller’s ability to manage out-of-order transactions. The key takeaway is that AXI4’s full feature set—including bursts and byte-level write strobes—can be reliably translated to basic memory primitives with careful signal mapping.
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 slave memory controller: BRAM wrapper bridge. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.