undefined01 / riscv Goto Github PK
View Code? Open in Web Editor NEWAn FPGA-based RISC-V CPU
An FPGA-based RISC-V CPU
目前( f84fd39 )的测试使用ModelSim
的testbench
进行驱动。
编写了Makefile
脚本以及bin2hexfile
工具,能够从汇编自动编译并生成初始化 RAM 需要的hex
文件(为readmemh
所需格式,非Quartus
中的Hexadecimal (Intel Format) File
格式)。
需要手动向riscv-test.vt
中加载测试用例、手动设置执行步数以及设置assert
断言。
需要手动向riscv-test.vt
中加载测试用例,可以自动执行直到程序退出,然后手动设置断言。
针对指令本身功能编写更多测试用例
针对可能出现的时序问题编写更完善的测试用例
移植官方测试用例( https://github.com/riscv/riscv-tests )
配置更自动化的测试脚本
一键回归测试(可能是在想 Peach)
自动通过测试用例(汇编文件)生成REF
输出(可能是在想 Peach)
由于暂时没有设计好如何让内存模块在一次读写中支持不同的长度,为了快速开发出原型进行验证和迭代,暂时放弃对非对齐地址以及非四字节读写的支持。
id.v
两处
Lines 104 to 115 in f84fd39
Lines 117 to 127 in f84fd39
后续可能需要在ID
、EX
、MEM
阶段之间额外传递内存访问长度,对流水线接口进行破坏性更改。
Core
的实例化
riscv/fpga/testbench/riscv_test.vt
Lines 18 to 24 in f84fd39
仍旧沿用32位宽的 RAM 模块。读取时读取所在 4 Byte 的区块再进行分发。
但是写入时不能影响区块的其他数据,而写入必须在一个周期内完成。可能需要同时使用上升沿和下降沿:上升沿进行读取,组合电路修改,再在下降沿写回。
这样可能造成时序不稳定。
使用的流水线大致如图
在实现过程中有部分修改。
有部分流水线可以利用组合电路缩短周期。但是否适合缩短需要等待时序分析并设计时序约束后再进一步优化。
将IF
逻辑独立成一个模块(或IF
模块和IF_ID
衔接模块)
将IF
获取pc
对应指令的逻辑进行简化
ID
、EX
、MEM
、WB
流水线中指令信号传递的优化
包括但不限于传递给下一个流水线的数据,流水线模块间的交互逻辑,全局信号由哪个模块驱动
分支预测
时序约束
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.