COMPAS’25 Tutorial - 0. Setup

Nicolas Derumigny

As any project, the CVA6 requires some dependencies (hopefully not much) to be assembled on your machine. Some are directly given by your package manager, but the RISC-V cross-compiler needs to be accessible from a (fixed) location, so we will download and install it manually to /opt using a statically compiled binary.

Required packages

Arch:

sudo pacman -S perl bison flex gnutls ncurses5-compat-libs xxd screen

Ubuntu:

sudo apt install perl bison flex libgnutls28-dev libncurses5 libncurses5-dev xxd screen libtinfo5

You may need to add the universe repository to be able to install all packages.

RISC-V Cross Compiler

A working RISC-V cross-compiler is needed to generate our bitstream, as the firmware (very first code executed by the softcore) is embedded on an on-chip ROM in binary format. The easiest way to have one is through the xPack GNU RISC-V Embedded GCC, whose installation method depends on your Linux distribution.

Arch:

Others:

pushd /tmp
wget 'https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v14.2.0-3/xpack-riscv-none-elf-gcc-14.2.0-3-linux-x64.tar.gz'
tar -xvzf xpack-riscv-none-elf-gcc-14.2.0-3-linux-x64.tar.gz
sudo mkdir -p /opt/xpack/
sudo cp -r xpack-riscv-none-elf-gcc-14.2.0-3 /opt/xpack/riscv-none-elf-gcc
popd

Content of the kit

For this tutorial, we will use the PYNQ-Z2 (see the introduction for more details). Three kits are available, containing each:

Serial connection to the board

The PYNQ-Z2 features a SoC that contains Arm cores. To boot the board, plug the AC adapter and use the power switch.

PYNQ-Z2 board

To connect to the board, plug the microUSB to USB cable to the JTAG / UART (Micro USB) port and the other end on your machine. As the PYNQ has a dual UART interface, Linux sees two canals: /dev/ttyUSB0 and /dev/ttyUSB1. Only the second one will work to obtain a shell (and only if you have sufficient permission to read/write to it!). Thus, execute:

screen /dev/ttyUSB1 115200
# If this fails, check permissions of /dev/ttyUSB1!

Congrats, you are now connected to the PYNQ using serial. Note its IP addrs, put your SSH key in ~/.ssh/authorized_keys, and unplug the USB cable: we will use it later.

Summary
Next page