RTL Studio Open IDE

2.6 · RISC-V CLASS

Execute datapath integration

Connect register file read ports to ALU operands to complete the RV32I execute stage datapath integration.

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

What you practice

Execute datapath integration (2.6). Connect register file read ports to ALU operands to complete the RV32I execute stage datapath integration. It is in Execute datapath top — Part 2 · Execute Path 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 register file read ports to the ALU operands to complete the RV32I execute stage datapath. This integration allows the processor to fetch operands and perform arithmetic operations in a single pipeline stage.

Learning objectives

  • Instantiate the rv32i_regfile module with correct port mappings.
  • Connect register read data outputs to the ALU input ports.
  • Verify the datapath by writing values to registers and reading them back via the ALU.
  • Interpret simulation logs to confirm correct arithmetic results.

Theory

The execute stage of a RISC-V pipeline typically consists of a register file and an Arithmetic Logic Unit (ALU). The register file provides two read ports (rdata1, rdata2) based on address inputs (raddr1, raddr2). The ALU takes these two operands and an operation code (alu_op) to produce a result (alu_y). Proper wiring ensures that the data flows from the register file directly into the ALU without interruption. This lesson focuses on the structural connectivity between these two IP blocks within the dut module.

Practice

  1. Open RtlStudio and select this chapter from the Examples or Lecture list.
  2. Confirm that student/rtl/design.sv and student/tb/tb_top.sv appear in the Explore tree.
  3. Open student/rtl/design.sv in the editor.
  4. Locate the u_rf instance of rv32i_regfile.
  5. Replace the __TODO__[0] placeholders in the instance port connections with the correct top-level dut signals.
  6. Ensure rdata1 and rdata2 are connected to the a and b inputs of the u_alu instance.
  7. Save the file and run Simulation from the left sidebar.
  8. Check the Log panel for INFO: lines and the final INFO: PASS message.

Summary

You successfully integrated the register file read ports with the ALU operands to complete the datapath connection. This wiring enables the processor to fetch values from storage and perform arithmetic operations correctly. The testbench verification confirmed that the ALU accurately computes the sum of the loaded register values.

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