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_regfilemodule 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
- Open RtlStudio and select this chapter from the Examples or Lecture list.
- Confirm that
student/rtl/design.svandstudent/tb/tb_top.svappear in the Explore tree. - Open
student/rtl/design.svin the editor. - Locate the
u_rfinstance ofrv32i_regfile. - Replace the
__TODO__[0]placeholders in the instance port connections with the correct top-leveldutsignals. - Ensure
rdata1andrdata2are connected to theaandbinputs of theu_aluinstance. - Save the file and run Simulation from the left sidebar.
- Check the Log panel for
INFO:lines and the finalINFO: PASSmessage.
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
- Open the RV32I lesson in the IDE. Fetch, decode, and execute are source you can simulate.
- Run Verilator and watch PC, the instruction, and the register write on the waveform.
- Treat a program printout as done only after the ISA step this lesson names matches the wave.
- 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.