Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

1And in Conclusion\dots

Our single-cycle datapath is a synchronous digital system that has the capabilities of executing RISC-V instructions in one cycle each. It is divided into multiple stages of execution, where each stage is responsible for a completing a certain task.

  1. IF Instruction Fetch:

    • Send address to the instruction memory (IMEM), and read IMEM at that address.

    • Hardware units: PC register, +4 adder, PCSel mux, IMEM

  2. ID Instruction Decode:

    • Generate control signals from the instruction bits, generate the immediate, and read registers from the RegFile.

    • Hardware units: RegFile, ImmGen

  3. EX Execute:

    • Perform ALU operations, and do branch comparison.

    • Hardware units: ASel mux, BSel mux, branch comparator, ALU

  4. MEM Memory

    • Read from or write to the data memory (DMEM).

    • Hardware units: DMEM

  5. WB Writeback

    • Write back either PC + 4, the result of the ALU operation, or data from memory to the RegFile.

    • Hardware units: WBSel mux, RegFile

2Textbook Readings

P&H 4.1, 4.3, 4.4

2.1Short Exercises

  1. True/False: If the logic delay of reading from IMEM is reduced, then any (non-empty) program using the single cycle datapath will speed up

  1. True/False: It is possible to feed both the immediate generator’s output and the value in rs2 to the ALU in a single instruction.