RTL Studio Open IDE

5.2 · RISC-V CLASS

The rv32i_core module interface

Connect the rv32i_core module to memory interfaces and verify execution of a simple program.

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

What you practice

The rv32i_core module interface (5.2). Connect the rv32i_core module to memory interfaces and verify execution of a simple program. It is in rv32i_core module shell — Part 5 · Core Capstone of the RISC-V RV32I Core Masterclass.

The RV32I core is Verilog you simulate in the browser IDE. Verilator runs the program; the waveform shows PC, the instruction, and the register write.

What you will learn

You will connect the rv32i_core module to its memory interfaces in the top-level design. This lesson focuses on freezing the core port list to ensure correct communication between the CPU and memory. Mastering this interface is essential for building a functional RISC-V processor.

Learning objectives

  • Instantiate the rv32i_core module in the top-level design.
  • Connect the instruction memory (imem) and data memory (dmem) interfaces.
  • Verify the core halts correctly on an ECALL instruction.
  • Inspect debug signals like debug_pc and debug_x10 in the testbench.

Theory

The rv32i_core module acts as the central processing unit for the RISC-V implementation. It requires a clock, reset, and interrupt signal to operate correctly. The core communicates with memory through separate address and data buses for instructions and data. The instruction memory provides the current instruction word to the core. The data memory handles read and write operations based on the core's control signals. The testbench monitors the halted signal to determine when the program execution is complete. Debug signals allow you to inspect the program counter and register values during simulation.

SignalDirectionDescription
clkInputSystem clock signal for synchronous logic.
rst_nInputActive-low reset signal to initialize the core.
irq_iInputInterrupt request signal from external peripherals.
imem_addrOutputAddress bus for instruction memory access.
imem_rdataInputData bus receiving instructions from memory.
dmem_addrOutputAddress bus for data memory access.
dmem_wdataOutputData bus for writing data to memory.
dmem_weOutputWrite enable mask for data memory bytes.
dmem_reOutputRead enable signal for data memory.
dmem_rdataInputData bus receiving data from memory.
haltedOutputIndicates when the core has stopped execution.
debug_pcOutputCurrent program counter for debugging.

Practice

  1. Open RtlStudio and select this chapter to load the workspace.
  2. Open student/tb/tb_top.sv in the editor to view the top-level design and testbench.
  3. Open student/rtl/ip/riscv/rv32i_core.sv to see the core implementation.
  4. Open student/tb/tb_top.sv to view the testbench structure and stimulus.
  5. Ensure the rv32i_core instance u_core in student/tb/tb_top.sv is connected correctly.
  6. Connect the imem_addr and imem_rdata ports to the rv32i_imem instance in student/tb/tb_top.sv.
  7. Connect the dmem_addr, dmem_wdata, dmem_we, dmem_re, and dmem_rdata ports to the rv32i_dmem instance in student/tb/tb_top.sv.
  8. Run Simulation from the sidebar and check the Log panel for results.

Summary

You successfully froze the rv32i_core interface by connecting the clock, reset, interrupt, and memory ports to the instruction and data memory modules. This practice reinforced the critical contract between the CPU and system memory for correct instruction fetching and data access. Running the simulation confirmed that the core executes instructions and halts appropriately on an ECALL. This stable interface definition is essential for integrating the core into larger system designs.

© 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 RV32I lesson in the IDE. Fetch, decode, and execute are source you can simulate.
  2. Run Verilator and watch PC, the instruction, and the register write on the waveform.
  3. Treat a program printout as done only after the ISA step this lesson names matches the wave.
  4. Change the RTL in the editor, rerun Verilator, and read the waveform again in the same tab.

The lesson is done when the simulation matches The rv32i_core module interface. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.