CVA6 Platform is a multi-core CVA6 with CV-MESH intended for software testing and regression.
- Download the pre-built bitstream from downloads.openhwgroup.org.
- Put it on a FAT32 formatted USB stick.
- Insert the USB stick into the top USB port on the Genesys II board. Set the JP5 to switch to USB/SD and JP4 to USB, this will use the bitstream on the pendrive (more detailed instructions can be found here).
- Download the Fedora image from downloads.openhwgroup.org.
gunzip
and flash the image on an SDCard using BalenaEtcher.- Power on the board and play
tetris
.
- Compile bitstream
- Generate fw_payload.bin
- Build Linux
- Copy fw_payload.bin and Image into /boot/
- Boot Linux
Detailed Look:
- Initialization
We assume you have a xpack-riscv-none-embed prebuilt riscv cross-compiler installed in
~/tools/
and have
export RISCV_TOOLCHAIN=$HOME/tools/xpack-riscv-none-embed-gcc-10.2.0-1.2
export PATH=$PATH:$RISCV_TOOLCHAIN/bin
in your .bashrc.
- Compiling Bitstream
To compile the bitstream, clone the openpiton repo (openpiton-dev branch) and then
git clone [email protected]:PrincetonUniversity/openpiton.git -b openpiton-dev
cd openpiton
Make sure the necessary submodules are updated using:
git submodule update --init --recursive piton/design/chip/tile/ariane
git submodule update --init --recursive piton/design/chipset/rv64_platform/bootrom/u-boot/uboot
Navigate to the openpiton directory and run
export PITON_ROOT=$PWD
export ARIANE_ROOT=$PITON_ROOT/piton/design/chip/tile/ariane
source piton/piton_settings.bash
Then run source your Vivado setup, e.g.:
source /tools/Xilinx/Vivado/2022.1/settings64.sh
Generate the bitstream with
protosyn -b genesys2 -d system -c ariane --x_tiles=2 --y_tiles=1 --linux_bootrom=uboot
- Generating fw_payload.bin
Navigate to ./piton/design/chipset/rv64_platform/bootrom/u-boot/uboot
.
Run make distclean
.
Apply the non-spl defconfig using make ARCH=riscv CROSS_COMPILE=riscv-none-embed- openpiton_riscv64_defconfig
.
Re-build u-boot-nodtb
using make ARCH=riscv CROSS_COMPILE=riscv-none-embed- -j8
.
Clone opensbi 1.0 to your preferred directory using:
git clone [email protected]:riscv-software-src/opensbi.git
cd opensbi
git checkout v1.0
ARCH=riscv CROSS_COMPILE=riscv-none-embed- make PLATFORM=fpga/openpiton FW_PAYLOAD_PATH=$PITON_ROOT/piton/design/chipset/rv64_platform/bootrom/u-boot/uboot/u-boot-nodtb.bin
- Building Linux
git clone [email protected]:openpiton/linux.git -b cva6platform-6.2
Here we assume you'll use the committed .config for your build.
Build the kernel using make ARCH=riscv CROSS_COMPILE=riscv-none-embed- -j8
(assuming you want to use 8 threads).
- Copying into SD card
First, mount the SD card. Run lsblk
to find out the name of the disk's first partition, e.g. /dev/sdb1
but please be very careful and double and triple check. Then, run e.g. sudo mount /dev/sdb1 mntdir/
where mntdir/
is the name of an empty directory. Alternatively if your distro automounts the SD, you can just move on to copying the files below.
Copy arch/riscv/boot/Image
(from your linux build) and build/platform/fpga/openpiton/firmware/fw_payload.bin
(from your opensbi build) into mntdir/boot/
of the SD card, and run sync
to ensure the data is copied properly, and then run sudo umount mntdir/
to safely remove the SD card.
Copy your build/genesys2/system/genesys2_system/genesys2_system.runs/impl_1/system.bit
(from your openpiton build) onto a USB drive for programming the FPGA.
- Boot
Plug the USB into the top USB port and insert the SD card and boot up the FPGA.