RTL Studio Open IDE

5.1 · RISC-V CLASS

Stitch the single-cycle datapath

Stitch the single-cycle datapath by connecting the RV32I core to instruction and data memories in student/rtl/design.sv and verify execution with the testbench.

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

What you practice

Stitch the single-cycle datapath (5.1). Stitch the single-cycle datapath by connecting the RV32I core to instruction and data memories in student/rtl/design.sv and verify execution with the testbench. It is in Stitch fetch-exec-LSU — 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 to its instruction and data memories to form a working single-cycle processor. This step transforms isolated IP blocks into a functional system capable of executing a simple program. Understanding how to wire these components is essential for building any complex CPU design.

Learning objectives

  • Instantiate rv32i_core, rv32i_imem, and rv32i_dmem within student/rtl/design.sv.
  • Connect all core ports to the appropriate memory and control signals.
  • Verify execution of a two-instruction program (ADDI and ECALL) using the testbench.
  • Interpret simulation logs to confirm correct register updates and halt behavior.

Theory

A single-cycle processor executes one instruction per clock cycle. The core fetches an instruction from the instruction memory (IMEM) using the program counter. It then decodes the instruction and accesses the data memory (DMEM) if required. The result is written back to the register file, and the program counter updates for the next instruction. Properly wiring these interfaces ensures data flows correctly between the core and memories.

ComponentRoleKey Ports
rv32i_coreCentral processing unitclk, rst_n, imem_addr, imem_rdata, dmem_addr, dmem_we, dmem_wdata, dmem_rdata
rv32i_imemInstruction storageaddr, rdata
rv32i_dmemData storageclk, addr, we, wdata, re, rdata

Practice

  1. Open RtlStudio and select this chapter from the Examples or Lecture list.
  2. Navigate to Explore and open student/rtl/design.sv.
  3. Locate the u_core instance and replace the __TODO__[0] placeholders with the correct signal names from the module port list.
  4. Ensure imem_addr connects to the IMEM address port and imem_rdata connects to the IMEM read data port.
  5. Ensure dmem_addr, dmem_wdata, dmem_we, dmem_re, and dmem_rdata are connected to the DMEM ports.
  6. Open student/tb/tb_top.sv to observe the test program loaded into memory.
  7. Run Simulation from the sidebar and check the Log panel for INFO: PASS.

Summary

You successfully stitched the single-cycle datapath by instantiating and connecting the RV32I core, instruction memory, and data memory modules. This integration enabled the design to correctly fetch and execute a two-instruction program, verifying proper signal routing between components. The simulation confirmed that the core halted with the expected register values, demonstrating a functional basic processor implementation.

© 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 Stitch the single-cycle datapath. Change the source, run the Verilog simulator again, and read the waveform without leaving the IDE. Simulation guide · Yosys guide.