What you practice
DMA descriptor kick (3.4). Program DMA descriptor registers and pulse GO from software to trigger a memory-to-peripheral transfer. It is in DMA descriptor kick (CSR) — Part 3 · Interrupts & DMA of the RISC-V on SoC & System Masterclass.
The core and the mini-SoC simulate as one workspace in the IDE. Follow MMIO, interrupts, and the program on the Verilator waveform, not only a pass line.
What you will learn
You will program the DMA descriptor registers and pulse the GO signal from software to trigger a memory-to-peripheral transfer. This lesson demonstrates how the CPU configures DMA hardware to move data without CPU intervention.
Learning objectives
- Understand the role of the DMA descriptor in defining transfer parameters.
- Learn to write software that programs descriptor registers before starting the transfer.
- Observe the DMA engine triggering a transfer and asserting the done interrupt.
- Verify that the destination GPIO registers reflect the transferred data.
Theory
The DMA (Direct Memory Access) engine allows peripherals to access memory without CPU involvement for every byte. A DMA descriptor is a data structure in memory that describes a single transfer operation. It typically contains the source address, destination address, transfer length, and control flags. The CPU writes these values into the descriptor registers or memory buffer before asserting a GO signal. Once GO is asserted, the DMA engine reads the descriptor and performs the transfer autonomously. When the transfer completes, the DMA engine asserts a done interrupt to notify the CPU. This mechanism frees the CPU to perform other tasks while data moves between memory and peripherals.
| Component | Role in DMA Transfer |
|---|---|
| CPU | Programs descriptor registers and asserts GO signal |
| DMA Descriptor | Stores source/dest addresses, length, and control bits |
| DMA Engine | Reads descriptor and manages data movement |
| Memory | Provides source data and receives destination data |
| Peripheral | Source or destination of the data transfer |
Practice
Open RtlStudio and select this chapter to load the workspace automatically. Navigate to student/rtl/design.sv in the Explore panel. You will see that the axi_if instance ports for cpu_bus, s_gpio, s_timer, and s_uart have placeholder __TODO__[0] values for ADDR_WIDTH. Replace the entire __TODO__[0] with 32 for each of these four instances to match the golden reference. The s_irq, s_sysctrl, s_dma, and dma_mem instances already have the correct ADDR_WIDTH(32). Save the file after making these changes. Next, open student/tb/tb_top.sv in the Explore panel. This testbench loads a program from tb/programs/03_04_dma_descriptor_kick.hex into the CPU's instruction memory. The program is responsible for programming the DMA descriptor and pulsing GO. Run the simulation by clicking Simulation in the left sidebar and then Run. Observe the Log panel for INFO: messages indicating progress and final results.
Summary
You practiced programming the DMA descriptor registers to configure memory-to-peripheral transfer parameters. You learned to pulse the GO signal from software to initiate the DMA operation without CPU intervention. This exercise demonstrated how the RV32I core leverages hardware peripherals to offload data movement tasks.
© 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
- Open the system lesson in the IDE. The RV32I core and the mini-SoC fabric simulate together.
- Run Verilator and trace the program through MMIO: address, load/store data, and the peripheral response.
- Interrupts and DMA belong on the waveform next to the instruction stream, not only in a pass/fail line.
- Edit the integration RTL, resimulate, and run Yosys on the structural block when you want a netlist.
The lesson is done when the simulation matches DMA descriptor kick. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.