A docker image containing all the required software dependancies is available on github-packages.
It is only required to install docker and pull the image.
docker pull ghcr.io/esl-epfl/x-heep-toolchain:latest
Assuming that X-HEEP has been cloned to X-HEEP-DIR=\absolute\path\to\x-HEEP\folder
, it is possible to directly run the docker mounting X-HEEP-DIR
to the path \workspace\x-heep
in the docker.
docker run -it -v ${X-HEEP-DIR}:/workspace/x-heep ghcr.io/esl-epfl/x-heep-toolchain
All the command listed in the README can be execute in the docker container, except for:
-
Simulation with Questasim and VCS, synthesis with Design Compiler (licenses are required to use these tools, so they are not installed in the container)
-
OpenRoad flow is not installed in the container, so it is not possible to run the related make commands
-
Synthesis with Vivado could be possible, but currently is untested
To use X-HEEP
, first make sure you have the following apt packages, or install them as:
sudo apt install lcov libelf1 libelf-dev libftdi1-2 libftdi1-dev libncurses5 libssl-dev libudev-dev libusb-1.0-0 lsb-release texinfo autoconf cmake flex bison libexpat-dev gawk tree xterm python3-venv python3-dev
In general, have a look at the Install required software section of the OpenTitan documentation.
We rely on either (a) miniconda
, or (b) virtual environment
enviroment.
Choose between 2.a
or 2.b
to setup your enviroment.
Install Miniconda python 3.8 version as described in the link, and create the Conda enviroment:
make conda
You need to do it only the first time, then just activate the environment everytime you work with X-HEEP
as
conda activate core-v-mini-mcu
Install the python virtual environment just as:
make venv
You need to do it only the first time, then just activate the environment everytime you work with X-HEEP
as
source .venv/bin/activate
git clone --branch 2022.01.17 --recursive https://github.com/riscv/riscv-gnu-toolchain
cd riscv-gnu-toolchain
./configure --prefix=/home/$USER/tools/riscv --with-abi=ilp32 --with-arch=rv32imc --with-cmodel=medlow
make
Then, set the RISCV
env variable as:
export RISCV=/home/$USER/tools/riscv
Optionally you can also compile with clang/LLVM instead of gcc. For that you must install the clang compiler into the same RISCV
path. The binaries of gcc and clang do not collide so you can have both residing in the same RISCV
directory. For this you can set the -DCMAKE_INSTALL_PREFIX
cmake variable to $RISCV
when building LLVM. This can be accomplished by doing the following:
git clone https://github.com/llvm/llvm-project.git
cd llvm-project
git checkout llvmorg-14.0.0
mkdir build && cd build
cmake -G "Unix Makefiles" -DLLVM_ENABLE_PROJECTS=clang -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$RISCV -DLLVM_TARGETS_TO_BUILD="RISCV" ../llvm
cmake --build . --target install
export VERILATOR_VERSION=4.210
git clone https://github.com/verilator/verilator.git
cd verilator
git checkout v$VERILATOR_VERSION
autoconf
./configure --prefix=/home/$USER/tools/verilator/$VERILATOR_VERSION
make
make install
Then, set the PATH
env variable to as:
export PATH=/home/$USER/tools/verilator/$VERILATOR_VERSION/bin:$PATH
In general, have a look at the Install Verilator section of the OpenTitan documentation.
If you want to see the vcd waveforms generated by the Verilator simulation, install GTKWAVE:
sudo apt install libcanberra-gtk-module libcanberra-gtk3-module
sudo apt-get install -y gtkwave
We use version v0.0-1824-ga3b5bedf
See: Install Verible
To format your RTL code type:
make verible
We use FuseSoC for all the tools we use.
The fusesoc
commands are inside the Makefile.