A five-stages Harvard architecture CPU based on RISC-V.
README of zh_CN version is provided here ./README_zh_CN.md
-
Elegant open-source ISA RISC-V based.
-
Harvard architecture with ITCM and DTCM.
-
Five-stages pipelined architecture without data hazard.
-
2-bit dynamic branch prediction.
-
Radix-4 Booth-Wallace multiplier.
-
Radix-4 SRT divider with variable latency.
-
Supported ISA extended by RISC-V:
- RV32I, RV64I
- RV32M, RV64M
- RV32F, RV64F
The detailed design documentation is provided. ./docs/dv-cpu-doc.pdf
Part of the detailed design schemes (zh_CN ver.) is published to my blog. cnblog:devindd
-
install
riscv64-linux-gnu-gcc
; -
make alias:
alias rvgcc="riscv64-linux-gnu-gcc" alias rvobjdump="riscv64-linux-gnu-objdump"
-
compile
c
file to obtain assembly codes:rvgcc file.c -S [file.s]
-
use objdump to obtain machine codes:
rvobjdump -S file.c
Or, use online translater:
https://riscvasm.lucasteske.dev/
cd ./core/vsim
vsim -do sim.do
cd ./core/sim
make all
Examples to simulation associated to commits are described in the file ./docs/assembly.md
[1] Patterson, David. "Computer organization and design RISC-V edition" (2017).
[2] 胡伟武. 计算机体系结构基础. 第3版, 机械工业出版社, 2021. Link
[3] Koren, Israel. "Computer arithmetic algorithms". CRC Press, 2018.
Copyright (C) 2023 devin
This repository complies with the GPLv3.0 License.
You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.