DEveloping Computational Architectures
We highly recommend using docker for your development environment. Follow the instructions in rocket-chip-env for setting up the docker image associated with this project.
here is a detailed wiki blog to guide you to start quickly ! https://github.com/rhit-neuro/deca/wiki/multiplier
Following the next:
After cloning this repo, execute the following to download the chisel
code for building a rocket-chip
:
# It is critical you run this in your docker container if you're using docker
git submodule update --init --recursive
Start with the instructions in [sbt/] (rocc/sbt/) and accelerators/ to make your own accelerator.
Now executing the following will "install" custom accelerators into the rocket-chip
:
cd scripts
./install-symlinks.sh
cd ..
If you make changes to your acclerators, you'll need to "reinstall" your accelerators with:
cd scripts
./uininstall-symlinks.sh
./install-symlinks.sh
cd ..
When you're ready to build a new rocket-chip
with your accelerator, run the following commands:
# replace ZynqFPGAMyAcceleratorConfig with the name of your config
# if you followed the style in the README's, you'll just replace
# MyAccelerator with the name of your accelerator
make rocket CONFIG=ZynqFPGAMyAcceleratorConfig ROCKETCHIP_ADDONS=accelerators
make project CONFIG=ZynqFPGAMyAcceleratorConfig ROCKETCHIP_ADDONS=accelerators
make CONFIG=ZynqFPGAMyAcceleratorConfig ROCKETCHIP_ADDONS=accelerators
When you make changes to your accelerator, remember to "reinstall" your accelerator as mentioned in the previous section and then rerun the above 3 make
commands.
In order to change what events the Rocket Chip's hardware performance monitors count, you must rebuild linux. The following will build linux with our default hardware performance monitors enabled.
cd firesim-software
git submodule update --init
cd riscv-pk
git apply ../../patches/riscv-pk/bbl-perf-counters.patch
cd ..
./sw-manager -c br-disk.json build
This will compile Linux with your modified bootloader. This will create two files in the images
directory.
br-disk-bin
- This binary is the bootloader bundled with your RISC-V Linux kernel as its payload.br-disk.img
- This is your ext2 root filesystem for Linux.
If you want to change what events are counted, edit firesim-software/riscv-pk/machine/minit.c
then change to the firesim-software
directory and run:
./sw-manager -c br-disk.json build
The fpga-images-zedboard
within fpga-zynq
has an out of date fesvr-zynq
which doesn't let us boot Linux with a disk image. Whenever Josh's merge request here is accepted, you'll need to update the fpga-images-zedboard
submodule in fpga-zynq, submit a merge request, wait for that to be accepted, then update fpga-zynq
in this repository. After all of that, you can remove the fpga-images-zedboard
submodule from this repository.