RTL Studio Open IDE

4.5 · SOC CLASS

Peripheral-to-memory DMA

Implement a state machine to capture peripheral stream data and write it to memory via AXI handshakes.

Video coming soon. This lesson page stays at the same URL when the lecture publishes.

What you practice

Peripheral-to-memory DMA (4.5). Implement a state machine to capture peripheral stream data and write it to memory via AXI handshakes. It is in Periph-to-Mem DMA — Part 4 · Data Movement of the SoC Masterclass. Move data with AXI-Stream slices, mem↔stream FIFOs, and a small DMA engine.

SoC lessons simulate the fabric and the peripheral together in the IDE. Verilator is the simulator; the waveform is where address and response show up.

What you will learn

You will implement a state machine that captures data from a peripheral stream and writes it to memory via AXI. This lesson covers the essential handshake protocols for data movement in SoC designs.

Learning objectives

  • Implement a finite state machine to manage AXI write transactions.
  • Handle backpressure and ready/valid handshakes correctly.
  • Manage data buffering and counter logic for multi-beat transfers.

Theory

DMA engines move data between peripherals and memory without CPU intervention. The peripheral-to-memory path requires capturing data from a stream interface and issuing AXI write transactions. The AXI protocol uses a three-phase handshake for writes: AW (address), W (data), and B (response). Each phase has valid and ready signals that must both be high for a transfer to occur. The state machine must wait for each handshake to complete before proceeding to the next phase. Counters track the number of remaining words to transfer. The busy signal indicates when the DMA is actively processing data.

Practice

Open RtlStudio and select this chapter in the Examples list. The workspace loads automatically with all files in the Explore panel. Open student/rtl/ip/soc/periph_to_mem_dma.sv to implement the DMA logic. Open student/tb/tb_top.sv to observe the testbench stimulus. Implement the logic as described in Your TODO below. Run Simulation from the sidebar and check the Log panel for results. The testbench provides a simple AXI mock that accepts all writes immediately.

Summary

You implemented a peripheral-to-memory DMA controller to capture stream data and write it directly to memory. This exercise demonstrated how to integrate data movement logic within the SoC design for efficient transfer. The simulation confirmed successful operation by printing an INFO: PASS message upon completion.

© 2026 RtlStudio. Licensed under CC BY-NC-ND 4.0. Commercial use and modifications by third parties are not permitted.

Run it in the Verilog IDE

  1. Open the lesson workspace in the IDE. The fabric and the peripheral are one simulation.
  2. Run Verilator and follow the address, write data, and read response on the waveform.
  3. A passing log is not enough when decode or an IRQ line is the point of the lesson — those show up on the VCD.
  4. Run Yosys on the RTL island you just integrated when you want the mapped cells.

The lesson is done when the simulation matches Peripheral-to-memory DMA. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.