Running Your First Program in Ripes
Experiment: Observing instruction execution in Ripes
Section titled “Experiment: Observing instruction execution in Ripes”Objectives
Section titled “Objectives”- Learn basic Ripes usage.
- Observe how registers change during instruction execution.
- Build an intuitive link between instructions and hardware behavior.
Principles
Section titled “Principles”This experiment is based on the RISC-V ISA and uses a visual processor model to observe instruction execution.
Environment
Section titled “Environment”- Simulator: Ripes
- CPU model: Single-Cycle Processor
Task: Step through an example program and observe registers
Section titled “Task: Step through an example program and observe registers”The following simple RISC-V assembly program adds two numbers:
addi x1, x0, 5 # x1 = 5addi x2, x0, 7 # x2 = 7add x3, x1, x2 # x3 = x1 + x2Steps:
- Open Ripes and select Single-Cycle Processor as the CPU model.
- Create a new program (or clear the editor) and paste the code above into the code editor.
- Use single-step execution and observe how registers
x1,x2, andx3change.
Results
Section titled “Results”- A screenshot of the running program (including the registers window).
- Briefly explain how each instruction affects the register state.
- Verify whether the final result matches the program logic.
Question
Section titled “Question”- If you switch the CPU model to a multi-cycle or pipelined model, how does the timing of register updates change?