This repository houses a set of RISCV tools for the CVA6 core. Most importantly it does not contain openOCD.
Included tools:
As of now, the SDK has been designed and tested for the Digilent Genesys 2 FPGA board. To implement and test SDK for other boards in this repository, you can volunteer to create and drive a new project at the OpenHW Group.
Requirements Ubuntu:
$ sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev
Requirements Fedora:
$ sudo dnf install autoconf automake @development-tools curl dtc libmpc-devel mpfr-devel gmp-devel libusb-devel gawk gcc-c++ bison flex texinfo gperf libtool patchutils bc zlib-devel expat-devel
You can select the XLEN by setting it in the Makefile. Then compile the Linux images with
$ git submodule update --init --recursive
$ make images
If you want to cross compile other projects for this target you can add buildroot/output/host/bin/
to your path in order to later make use of the installed tools after compiling them with :
$ make all
You can also build a compatible Linux image that boots Linux on the CVA6 fpga mapping:
$ make vmlinux # make only the elf Linux image
$ make uImage.bin # generate the Linux image with the u-boot wrapper
$ make fw_payload.bin # generate the OpenSBI + U-Boot payload
Or you can build everything directly with:
$ make images # generates all images and save them in install$(XLEN)
You can test your image on spike First, build spike with:
$ make isa-sim
Build the OpenSBI firmware with the Linux payload for the Spike platform:
$ make spike_payload
You can now launch Spike with OpenSBI + Linux
$ install$(XLEN)/bin/spike install$(XLEN)/spike_fw_payload.elf
Spike allows trace logging
$ install$(XLEN)/bin/spike --log-commits install$(XLEN)/spike_fw_payload.elf 2> trace.log.commits
First compile the SBI firmware and the Linux image:
$ make images
The flash-sdcard Makefile recipe handle the creation of the GPT partition table and the flashing of fw_payload.bin and uImage at there correct offset. Be careful to set the correct SDDEVICE.
$ sudo -E make flash-sdcard SDDEVICE=/dev/sdb
Similar steps as above but flashing is sligthly different. Get sgdisk
using homebrew
.
$ brew install gptfdisk
$ sudo -E make flash-sdcard SDDEVICE=/dev/sdb
If you really need and want to debug on an FPGA/ASIC target the installation instructions are here.
This patch incorporates an overlay to overcome the painful delay in generating public/private key pairs on the target (which happens every time because the root filing system is volatile). Do not use these keys on more than one device. Likewise it also incorporates a script (rootfs/etc/init.d/S40fixup) which replaces the MAC address with a valid Digilent value. This should be replaced by the unique value on the back of the Genesys2 board if more than one device is used on the same VLAN. Needless to say both of these values would need regenerating for anything other than development use.
There is a pretty basic Docker container you can use to get a stable build environment to build the image.
$ cd container
$ sudo docker build -t ghcr.io/pulp-platform/ariane-sdk -f Dockerfile .
And build the image:
$ cd ..
$ sudo docker run -it -v `pwd`:/repo -w /repo -u $(id -u ${USER}):$(id -g ${USER}) ghcr.io/pulp-platform/ariane-sdk