1 Star 6 Fork 0

rainrime / very small single circle riscv cpu

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

very small single circle riscv cpu

介绍

完全按照《计算机组成与设计:硬件/软件接口》(Computer Organization and Design: The Hardware/Software Interface) RISC-V EDITION 第四章前半部分单周期 CPU 实现,线路图和端口命名基本一致,支持 add, sub, or, and, ori, lw, sw, beq

需要的软件

  • iverilog
  • gtkwave (option)

方便查看 markdown 的软件及顺手的编辑器

测试仿真

make
gtkwave test_alu_top.vcd

测试使用的指令在 test_8_Instr.txt 中,其 16 进制文件在 test_instr.dat 中,可以在 https://venus.cs61c.org 上运行仿真来对照结果,使用顺手的 Markdown 工具来查看生成的 test_cpu.md以便于对照

image-20210505143911140

其他

利用综合工具 yosys 来综合,测试一下生成 RTL 级别原理图

yosys -p "prep; show -stretch -prefix alu.v -format dot" ./src/alu.v
dot -Tpng ./alu.v.dot -o ./image/alu.png

扩展及测试

在扩展支持的 CPU 指令集到更多指令 (如完整实现 rv32i) 后,可以使用完整的 RISC-V Architecture Test SIG 来测试,其他奇奇怪怪的测试可以基于 RISC-V GNU Compiler Toolchainriscv64-unknown-elf-xxx (gcc, gdb, as, objdump 等完整工具链) 来生成及测试

image-20210505151522500

MIT License Copyright (c) 2021 rainrime Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

完全按照《计算机组成与设计:硬件/软件接口》(Computer Organization and Design: The Hardware/Software Interface) RISC-V EDITION 第四章前半部分单周期 CPU 实现 展开 收起
Verilog
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Verilog
1
https://gitee.com/rainrime/very-small-single-circle-riscv-cpu.git
git@gitee.com:rainrime/very-small-single-circle-riscv-cpu.git
rainrime
very-small-single-circle-riscv-cpu
very small single circle riscv cpu
master

搜索帮助