What you practice
SoC platform tour (0.1). Tour the SoC memory map constants and RV32I opcodes, verifying the DUT routes them correctly via the testbench. It is in SoC map & mini_soc tour — Part 0 · Platform Recap 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
This lesson introduces the memory map constants and RV32I opcode definitions used in the mini-SoC platform. Understanding these constants is essential for writing correct address decoding and instruction handling logic.
Learning objectives
- Read the
soc_pkg.svmemory base address constants. - Read the
rv32_pkg.svRV32I opcode constants. - Verify the DUT correctly assigns these package constants to its output ports.
- Run the testbench to confirm the
INFO: PASSstatus.
Theory
The soc_pkg package defines the base addresses for the SoC peripherals. These addresses determine where the CPU will find RAM, GPIO, timers, and other devices. The rv32_pkg package defines the 7-bit opcode values for standard RV32I instructions. These opcodes are used by the control logic to identify load, store, and system instructions. The DUT simply passes these constant values from the packages to its output ports.
| Constant Name | Description | Value (Hex) |
|---|---|---|
BASE_RAM | Base address for system RAM | 0x20000000 |
BASE_GPIO | Base address for General Purpose I/O | 0x40000000 |
BASE_TIMER | Base address for the timer peripheral | 0x40001000 |
BASE_UART | Base address for the UART peripheral | 0x40002000 |
BASE_IRQ | Base address for the interrupt controller | 0x40003000 |
BASE_SYSCTRL | Base address for system control | 0x40004000 |
BASE_DMA | Base address for the DMA controller | 0x40005000 |
| Opcode Name | Description | Value (Binary) |
|---|---|---|
OP_STORE | Store instruction opcode | 0100011 |
OP_LOAD | Load instruction opcode | 0000011 |
OP_SYSTEM | System instruction opcode | 1110011 |
Practice
- Open RtlStudio and select this chapter.
- Confirm files appear in the Explore tree.
- Open
student/rtl/design.svin the editor. - Open
student/tb/tb_top.svin the editor. - Open Simulation from the left sidebar and click Run.
- Read the Log panel to verify the output values.
Summary
You practiced reading the mini-SoC memory map and RV32I opcode constants side by side to understand the platform configuration. This exercise reinforced how the design module instantiates package definitions to ensure the core and peripherals share a consistent address map. The key takeaway is the critical importance of matching MMIO base addresses and instruction opcodes for correct system operation.
© 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 SoC platform tour. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.