This is a forked version of Hao He's RISC-V Simulator. In this repository, using pages to manage memory is disabled.
For project details, please refer to the PDF on BlackBoard.
# Clone the project
git clone https://github.com/EnderturtleOrz/CSC3050-2025-Spring-Project-3.git
cd CSC3050-2025-Spring-Project-3
# Make a build folder
mkdir build
cd build
# Build the project
cmake ..
makesrc: Source codeinclude: ELFIO headerstest-*: Test case folderspart2.s: The part2.s file. You can put part2_p2.s / part2_p3.s at the root path of the project.
You can use bash <script_name> to run the scripts.
build-test.sh: Builds ELF files for the following test cases. You can find the ELF files and objdumped files under/riscv-elf:build-test-basic.shbuild-test-inclass.shbuild-test-fused.shbuild-part2.sh
run-simulator.sh: Runs all ELF files under/riscv-elfand outputs results to/results;run-simulator-without-data-forwarding.sh: Run all ELF files without data forwarding.
bash build-test.sh
bash run-simulator.sh
bash run-simulator-without-data-forwarding.sh./Simulator riscv-elf-file-name [-v] [-s] [-d] [-x] [-b strategy]
Parameters:
-vfor verbose output, can redirect output to file for further analysis.-sfor single step execution, often used in combination with-v.-dfor creating memory and register history dump indump.txt.-bfor branch perdiction strategy (defaultBTFNT), accepted parameters areAT,NT,BTFNT. andBPB. You can ignore this one in this assignment.-xfor disabling data forwarding. You need to implement this one.
Hint: You can use -v -s for debugging.
| Test case | Data forwarding? | Handle WriteBack before Decode? * | Cycles |
|---|---|---|---|
| ackermann | ✔️ | / | 480358 |
| ackermann | ❌ | ✔️ | 623850 |
| ackermann | ❌ | ❌ | 719706 |
| fmadd / fmsub | ✔️ | / | 813 |
| fmadd / fmsub | ❌ | ✔️ | 1005 |
| fmadd / fmsub | ❌ | ❌ | 1113 |
| fnm | ✔️ | / | 811 |
| fnm | ❌ | ✔️ | 1002 |
| fnm | ❌ | ❌ | 1109 |
* Whether you handle WriteBack before Decode or not, we will give you full marks. If you are not aware of this case, please review the lecture: Page 12, Chapter 4: Pipeline Hazards.