Go to file
Jenny Huang 5099a8c6f7 Marge python dev branch into master supporting chipyard-1.9.0 2024-07-21 22:35:11 +00:00
configs Update README with more firemarshal/firesim instructions and linux 2019-11-05 05:07:55 +00:00
deploy Add example makefile and software code 2023-09-23 18:27:39 -07:00
examples Remove chstone examples 2023-09-30 08:07:43 -07:00
libcf Just adding some boilerplate for libcf, not ready yet. 2019-11-03 14:28:42 -05:00
patches Add XSim patch 2019-11-01 02:00:03 -07:00
scripts Marge python dev branch into master supporting chipyard-1.9.0 2024-07-21 22:35:11 +00:00
workloads Move the bm to the hardcoded bm 2023-08-07 18:19:49 -07:00
.gitignore Add in wrapper generation code (build_sw command). Previous versions 2020-02-11 14:25:43 -05:00
.gitmodules Create base centrifuge linux workload with linux branch. Also adds in 2019-10-31 19:54:45 -04:00
LICENSE Create LICENSE 2019-11-04 22:15:31 -07:00
README.md Update README.md 2023-06-07 23:08:00 -07:00
env.sh export RDIR 2023-09-09 08:58:13 -07:00
perl-deps.txt Document perl packages needed on AWS default image. 2019-11-03 21:08:20 +00:00
python-requirements.txt Add HLS scripts 2020-02-05 15:56:54 -08:00
requirements.txt Add FireSim compile/run scripts 2020-03-31 11:34:56 +00:00

README.md

Centrifuge - A Unified Approach to Generate RISC-V Accelerator SoC

1. Centrifuge Setup

  1. Set up the Chipyard repo following the instruction here. For more Chipyard related info, visit the Chipyard page (https://chipyard.readthedocs.io/en/latest/). Please check out Chipyard version 1.8.1.

  2. (OPTIONAL for FPGA-accelerated simulation) Set up the FireSim repo. For more FireSim related info, please refer to FireSims documentation (https://docs.fires.im/en/latest/index.html). For using FireSim in Chipyard, refer to (https://chipyard.readthedocs.io/en/latest/Simulation/FPGA-Accelerated-Simulation.html).

  3. Clone Centrifuge and set up its dependencies. Git clone the current repo to the Chipard tools directory.

pushd chipyard/tools && git clone -b python-dev-new git@github.com:hqjenny/centrifuge.git && popd

Set up riscv-pk for accelerator calls and applies patches to existing tools.

cd tools/centrifuge && source scripts/hls-setup-a-machine.sh && cd ../..
pushd tools/centrifuge && pip3 install -r python-requirements.txt && popd

2. Running Centrifuge

  1. Before running Centrifuge, source the env setup scripts. It sets an environmental variable RDIR to the root directory of the Chipyard, which we used to construct paths in the scritps.
source tools/centrifuge/env.sh

2.1 Vector Add Example

Run Centrifuge to generate the accelerator SoC defined in vadd_soc.json.

cd $RDIR/tools/centrifuge/deploy
./centrifuge generate_hw -c ../examples/vadd_proj/vadd_soc.json
./centrifuge generate_sw -c ../examples/vadd_proj/vadd_soc.json 

This also generates the sw helper functions to invoke the accelerator. The generated sw wrapper accel_wrapper.c and accel_wrapper.his under the hardware path $RDIR/tools/centrifuge/examples/vadd_proj/centrifuge_wrappers/.

  1. Software Compilation

Run the following command to invoke compilation for bare-metal.

./centrifuge generate_sw -c ../examples/vadd_proj/vadd_soc.json 

We currently have the vadd RoCC example code and Makefile under example directory and are working on migrating the compilation flow from perl to python.

cd $RDIR/tools/centrifuge/examples/vadd && make

The generated vadd.bm.rv is a software only reference code for vadd and vadd.bm_accel.rv is the baremetal code for calling the RoCC vadd accelerator

  1. Run VCS/Verilator Simulation To run VCS simulation,
./centrifuge run_vcs -c ../examples/vadd_proj/vadd_soc.json 

Replace run_vcs with run_verilator for Verilator runs. This command generates a simulation executable called simv-example-HLSRocketConfig-debug under $RDIR/sims/vcs/. This executable is a simulator that has been compiled based on the design that was built.

You can then use this executable to run any compatible RV64 code. For instance, to invoke the accelerator in bare-metal software, run:

cd $RDIR/sims/vcs/
./simv-example-HLSRocketConfig-debug <sw binary>