System-On-Chip template based on synthesizable processor compliant with the RISC-V architecture.
=====================
[![CI](https://github.com/sergeykhbr/riscv_vhdl/workflows/build/badge.svg)](https://github.com/sergeykhbr/riscv_vhdl/actions)
## Howto build FPGA bitstream or RTL simulation:
- To build KC705 bitstream file:
$ cd sv/prj/impl/kc705
$ make
- To build and run full system unisim RTL simulation:
$ cd sv/prj/impl/asic_sim
$ make build
$ make gui
- To build and run precise SystemC simulation (see github actions):
$ cmake -S ./debugger/cmake -B build
$ cd build
$ make
$ cd linuxbuild/bin
$ ./run_sysc_river_x1_gui.sh
Note: Information related to VHDL source code is obsolete and currently is updating.
This repository provides open source System-on-Chip implementation based on
open source RISC-V specifications. SOC project
includes general set of peripheries, FPGA CADs projects files, own
implementation of the Windows/Linux debugger and several examples that help
to run your firmware on almost any FPGA boards.
Satellite Navigation (GPS/GLONASS/Galileo) modules were stubbed in this
repository and can be requested separately.
## What is River CPU?
That's a VHDL RISC-V ISA implementation used in a several projects including
the multi-sytem Satellite Navigation receiver. It is great for an
embedded applications with active usage of 64-bits computations (like DSP).
**River CPU** includes the following tools and features:
1. Source code
- */debugger/cpu_fnc_plugin* - Functional RISC-V CPU model.
- */debugger/cpu_sysc_plugin* - Precise SystemC RIVER CPU model.
- */rtl/riverlib* - synthesisable VHDL model of a 64-bit processor compliant with the RISC-V architecture.
2. Floating Point Unit (FPU)
3. Multi-Core configuration
4. Advanced debugging features
- Test Access Points (TAPs) via Ethernet, UART and JTAG in one system.
- Compatible with the Standard RISC-V debug specification.
- System Bus tracer
- Pipeline statistic (CPI, HW stacktrace) in a real-time on HW level.
- Plug'n'Play information
You can find several **demonstration videos**
[here](https://github.com/sergeykhbr/riscv_vhdl/tree/master/debugger) of working with the
Dual-Core SoC on FPGA and with the emulated platforms.
## System-on-Chip structure
SoC documentation in [.pdf](docs/riscv_vhdl_trm.pdf) formats.
![SOC top](docs/doxygen/pics/soc_top_v5.png)
## Performance
Performance analysis is based on very compact
[**Dhrystone v2.1. benchmark**](http://fossies.org/linux/privat/old/dhrystone-2.1.tar.gz/)
application available as the bare-metal test in *$(TOP)/example/dhrystone21*
folder and entirely ported into Zephyr shell (see animated gif below). Benchmark was executed
with enabled (-O0) and disabled (-O2) optimization to define HW and GCC-compiler advantages.
All sources are available and could be run on the simulator or on the
different FPGA targets.
Target | Git tag | Dhrystone<br> per sec,<br> -O0, 60 MHz | Dhrystone<br> per sec,<br> -O2, 60 MHz | Information.
-------------------|:-------:|:------------------------------:|:------------------------------:|:------------
RISC-V simulator | latest | **76824.0** | **176469.0** | *GCC 7.1.1* with the compressed instructions set.
RISC-V simulator | latest | **77719.0** | **184074.0** | *GCC 8.3.1* with the compressed instructions set.
"River" CPU | latest | **48581** | **135432.0** | *GCC 8.3.1* with the compressed instructions set.
ARM simulator | latest | **78451.0** | **162600.0** | *arm-none-eabi-gcc 7.2.0*, ARM ISA only.
Cortex-R5 ARM | No | **20561.0** | **42401.0** | *arm-none-eabi-gcc 7.2.0*, custom FPGA system:<br> Single-Core, MPU enabled, **Caches disabled**.
Cortex-R5 ARM | No | **54052.0** | **132446.0** | *arm-none-eabi-gcc 7.2.0*, custom FPGA system:<br> Single-Core, MPU enabled, **Caches enabled**.
Cortex-M3 Thumb2 | [arm_vhdl](https://github.com/sergeykhbr/arm_vhdl) | soon | soon | *arm-none-eabi-gcc 7.2.0*, custom FPGA system
"LEON3" SPARC V8 | No | **48229.0** | **119515.0** | *sparc-elf-gcc 4.4.2*, custom FPGA system.
Access to all memory banks and peripheries for all targets (including ARM and Leon3) is made
in the same clock domain and always is one clock (without wait-states).
So, this benchmark result (**Dhrystone per seconds**) shows performance of
the CPU with integer instructions and degradation of the CPI relative ideal
(simulation) case.
CPU | Clocks-Per-Instruction,<br> CPI | Description.
------------|:-------:|:------------------------------
Cortext-R5 | 1.22 | This is **dual-issue** processor capable to execute a pair of instructions per<br> one clock. It's a very good but quite expensive CPU.
LEON3 | 1.5 | CPI information from [here](https://www.gaisler.com/index.php/products/simulators/tsim).
River | 1.35 | Free-to-use and highly customizable CPU. I/D caches are enabled: 4-ways, 16 KB each. [Reference Manual](docs/riscv_vhdl_trm.pdf).
Cortex-M3 | soon | RTL is under development.
**Since the tag 'v7.0' RIVER CPU is the main processor in the system and all issues
related to Rocket-chip instance will be supported only by request.**
## Repository structure
This repository consists of three sub-projects each in own subfolder:
- **rtl** is the folder with VHDL/Verilog sources of the SOC
including synthesizable processors *"Rocket"* and *"River"* and peripheries.
Source code is portable on almost any FPGA is due to the fact that
technology dependant modules (like *PLL*, *IO-buffers*
etc) instantiated inside of "virtual" components
in a similar to Gailser's *[GRLIB](www.gailser.com)* way.
Full SOC design without FPU occupies less than 5 % of FPGA resources (Virtex6).
*"Rocket-chip"* CPU itself is the modern **64-bits processor
with L1-cache, branch-predictor, MMU and virtualization support**.
This sub-project also contains:
* *fw_images*: directory with the ROM images in HEX-format.
* *prj*: project files for different CADs (Xilinx ISE, ModelSim).
* *tb*: VHDL testbech of the full system and utilities.
* *bit_files*: Pre-built FPGA images for ML605 and KC705 boards.
- **examples** folder contains several C-examples that could help start working
with the RISC-V system:
* *boot* is the code of the Boot Loader. It is also used for the SRAM
initialization with the FW image and it allows to run examples on
FPGA without using the debugger and external flash memory.
* *helloworld* the simplest example with UART output.
* *isrdemo* example with 1 second interrupt from timer and debug output.
* *zephyr* is ported on RISC-V 64-bits operation system.
Information about this Real-Time Operation System for Internet of
Things Devices provided by [Zephyr Project](https://www.zephyrproject.org/).
Early support for the Zephyr Project includes Intel Corporation,
NXP Semiconductors N.V., Synopsys, Inc. and UbiquiOS Technology Limited.
- **debugger**. The last piece of the ready-to-use open HW/SW system is
[Software Debugger (C++)](http://sergeykhbr.github.io/riscv_vhdl/sw_debugger_api_link.html)
with the full system simulator available as a plug-in.
Debugger interacts with the target (FPGA or Software Simulator)
via [Ethernet](http://sergeykhbr.github.io/riscv_vhdl/eth_link.html)
using EDCL protocol over UDP. To provide this functionality SOC includes
[**10/100 Ethernet MAC with EDCL**](http://sergeykhbr.github.io/riscv_vhdl/eth_link.html)
and [**Debug Support Unit (DSU)**](http://sergeykhbr.github.io/riscv_vhdl/periphery_page_1.html)
devices on AMBA AXI4 bus.
# Step I: Simple FPGA test.
You can use the pre-built FPGA image (for Xilinx ML605 or KC705 board) and any serial
console application (*putty*, *screen* or other) to run Dhrystone v2.1
没有合适的资源?快使用搜索试试~ 我知道了~
便携式 RISC-V 片上系统实现:RTL、调试器和模拟器
共1575个文件
h:336个
cpp:243个
sv:210个
需积分: 1 0 下载量 12 浏览量
2024-06-06
14:06:12
上传
评论
收藏 30.11MB ZIP 举报
温馨提示
**便携式 RISC-V 片上系统实现:RTL、调试器和模拟器** RISC-V 作为一种开源的指令集架构(ISA),在学术界和工业界受到了广泛关注和应用。为了便于开发和学习 RISC-V 系统,一个便携式 RISC-V 片上系统实现通常包含 RTL(Register Transfer Level)设计、调试器和模拟器。这些组件共同组成了一个完整的开发环境,使开发者能够设计、验证和调试 RISC-V 处理器和相关系统。 ### RTL(Register Transfer Level)设计 RTL 设计是 RISC-V 片上系统的核心,定义了处理器的逻辑结构和功能。常见的 RISC-V RTL 实现包括: 1. **Rocket Chip** - **描述**: Rocket Chip 是由加州大学伯克利分校开发的开源 RISC-V 处理器实现。它采用 Chisel 语言编写,支持多种配置和扩展,包括不同的核数和缓存层次。 - **特点**: 可配置、可扩展、高性能,支持自定义指令集扩展。 2. **PicoRV32** - **描述**: PicoRV32
资源推荐
资源详情
资源评论
收起资源包目录
便携式 RISC-V 片上系统实现:RTL、调试器和模拟器 (1575个子文件)
post_build_event.bat 1KB
makefile.bat 570B
makefile.bat 530B
makefile.bat 390B
makefile.bat 363B
makefile.bat 354B
makefile.bat 333B
makefile.bat 329B
makefile.bat 326B
post_build_event.bat 202B
_run_openocd.bat 31B
bbl-q 8.09MB
bbl-q-noprintf 7.97MB
loader1.bin 1024KB
bootimage 43KB
dhry_1.c 14KB
test_spi.c 12KB
uart.c 10KB
test_mmu.c 8KB
test_pmp.c 7KB
test_fpu.c 6KB
uart.c 6KB
test_pnp.c 5KB
dhry_2.c 5KB
main.c 5KB
main.c 5KB
sd_uefi.c 4KB
interrupts.c 4KB
main.c 3KB
trap.c 3KB
gcc_newlib.c 3KB
exceptions.c 3KB
gcc_startup.c 3KB
test_stackprotect.c 3KB
test_plic.c 3KB
trap.c 3KB
test_ddr.c 2KB
test_missaccess.c 2KB
spi.c 2KB
memanager.c 2KB
trap.c 2KB
fw_api.c 2KB
test_gnss_ss.c 2KB
isr_vector.c 2KB
test_swirq.c 2KB
test_l2coherence.c 2KB
hwthread1.c 2KB
hwthread2.c 2KB
hwthread3.c 2KB
test_mtimer.c 1KB
main.c 1KB
hwinit.c 1KB
utils.c 986B
stdtool.c 602B
bitbang.cfg 10KB
bitbang_gdb.cfg 1KB
kc705_river_smp.cfg 1KB
kc705_river_1core.cfg 852B
thumb.cpp 112KB
riscv-ext-f.cpp 65KB
csr.cpp 64KB
execute.cpp 59KB
tracer.cpp 57KB
fpu_func.cpp 51KB
disasm_riscv.cpp 48KB
disasm_thumb.cpp 47KB
arm7tdmi.cpp 43KB
riscv-rv64i-user.cpp 41KB
proc.cpp 36KB
dec_rv.cpp 35KB
riscv-ext-c.cpp 34KB
dcache_lru.cpp 30KB
mmu.cpp 27KB
dmidebug.cpp 27KB
api_core.cpp 27KB
attribute.cpp 25KB
sdctrl.cpp 24KB
riscv-ext-m.cpp 23KB
l2cache_lru.cpp 23KB
memaccess.cpp 22KB
attribute.cpp 22KB
riscv_disasm.cpp 21KB
cpu_generic.cpp 20KB
cpu_riscv_func.cpp 20KB
DbgMainWindow.cpp 19KB
river_amba.cpp 18KB
sdctrl_sdmode.cpp 18KB
gdbcmd.cpp 18KB
dec_rvc.cpp 17KB
fadd_d.cpp 17KB
cache_top.cpp 17KB
riscv_soc.cpp 16KB
sdctrl_spimode.cpp 16KB
dbg_port.cpp 16KB
riscv-ext-a.cpp 16KB
shift.cpp 16KB
decoder.cpp 16KB
sdctrl_cache.cpp 16KB
vip_sdcard_ctrl.cpp 15KB
disasm_arm.cpp 15KB
共 1575 条
- 1
- 2
- 3
- 4
- 5
- 6
- 16
资源评论
编程大全
- 粉丝: 764
- 资源: 123
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 学生成绩管理系统c++ (代码).zip
- c语言学生管理系统-项目代码资料.zip
- 课程设计机器学习报告,垃圾分类系统.zip
- app-release.apk.zip
- python-leetcode面试题解之第421题数组中两个数的最大异或值.zip
- python-leetcode面试题解之第416题分割等和子集.zip
- python-leetcode面试题解之第414题第三大的数.zip
- python-leetcode面试题解之第412题Fizz-Buzz.zip
- python-leetcode面试题解之第409题最长回文串.zip
- python-leetcode面试题解之第408题有效单词缩写.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功