https://github.com/zephray/rocket-chip-sim
Another Verilator-based simulator setup for rocket-chip
https://github.com/zephray/rocket-chip-sim
Last synced: 28 days ago
JSON representation
Another Verilator-based simulator setup for rocket-chip
- Host: GitHub
- URL: https://github.com/zephray/rocket-chip-sim
- Owner: zephray
- Created: 2023-01-27T13:20:09.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-12T15:13:14.000Z (about 3 years ago)
- Last Synced: 2026-01-14T16:01:32.122Z (5 months ago)
- Language: C
- Size: 59.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rocket-chip-sim
My own wrapper for simulating rocket-chip in Verilator.
## Usage
Make sure the dependencies are installed:
```
sudo apt install libverilog-perl
```
Verilator could be either installed from distribution or built from source.
Set ```ROCKET_CHIP``` env var to point to the rocket-chip installation, if not, clone from official repo.
```
git clone https://github.com/chipsalliance/rocket-chip
export ROCKET_CHIP=$(pwd)/rocket-chip
```
Run ```./scripts/build.sh```. Alternatively, run ```./scripts/genrtl.sh``` to generate individual RTL files, or run ```./scripts/build-sim.sh``` to rebuild simulator binary.
The example folder has some programs that can be run on the simulator.
For example, to run hello world (assuming it has been compiled):
```
./sim/sim --ram example/asm/hello.bin --trace
```
To customize the core configuration, modify the ```config/CustomConfigs.scala``` and re-build.
## Why
The rocket-chip comes with a bundled simulator/ emulator. That works fine for most purposes. However personally I found it a bit slow due to the way it simulates the RAM and how it loads the program. I want my own binary to run as soon as the simulator is up (maybe after a few instructions, but definitely not after thousands or instructions or GBs of waveform dumps), so I created this. Many of the infrastructure shares with the projects I have done before so this is like 2 hours of work, making it justified.
## License
Unless otherwise noted, the source code is licensed under MIT license.