Memo for installing the toolchain manually when you want to use litex or SpinalHDL with ECP5.
!!! If you are looking for an easy way to set up your environment, this link is for you.
=> YosysHQ / oss-cad-suite-build
Required libraries
sudo apt-get install build-essential clang bison flex \
libreadline-dev gawk tcl-dev libffi-dev git \
graphviz xdot pkg-config python3 libboost-system-dev \
libeigen3-dev libboost-python-dev libboost-filesystem-dev zlib1g-dev cmake
Prjtrellis Install
git clone --recursive https://github.com/YosysHQ/prjtrellis
sudo apt-get install libboost-all-dev
cd prjtrellis/libtrellis
cmake -DCMAKE_INSTALL_PREFIX=/usr .
make
sudo make install
Yosys Install
git clone --recursive https://github.com/YosysHQ/yosys.git
cd yosys
make config-clang
make
sudo make install
nextpnr-ecp5 Install
git clone --recursive https://github.com/YosysHQ/nextpnr.git
cd nextpnr
cmake . -DARCH=ecp5 -DTRELLIS_INSTALL_PREFIX=/usr
make
sudo make install
LiteX & RISC-V Toolchain Install
pip3 install meson
sudo apt install ninja-build
sudo apt-get install device-tree-compiler
mkdir litex
cd litex
wget https://raw.githubusercontent.com/enjoy-digital/litex/master/litex_setup.py
chmod +x litex_setup.py
./litex_setup.py init install --user
# !!! x86 gcc toolchain
./litex_setup.py gcc