Install required packages
apt-get install build-essential libboost-all-dev clang llvm python3-setuptools libeigen3-dev tcl-dev
Fetch tooling sources
mkdir kestrel-tooling
cd kestrel-tooling
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-tooling/yosys
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-tooling/nextpnr
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-tooling/prjtrellis
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-tooling/ghdl
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-tooling/ghdl-yosys-plugin
cd nextpnr
git submodule init
git submodule update
cd ../
cd prjtrellis
git submodule init
git submodule update
cd ../
Install required tooling
cd prjtrellis/libtrellis
cmake -DCMAKE_INSTALL_PREFIX=/usr .
make
make install
cd ../../
cd nextpnr
cmake -DARCH=ecp5 -DTRELLIS_INSTALL_PREFIX=/usr .
make
make install
cd ../
cd ghdl
./configure --prefix=/usr --with-llvm-config
make
make install
cd ../
cd ghdl-yosys-plugin
make
make install
cd ../
Clone all LiteX repositories
mkdir litex-repos
cd litex-repos
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/migen
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/nmigen
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-software-compiler_rt
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/litex
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/liteeth
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/litedram
#git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/litepcie
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/liteiclink
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/aquilalpc
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/opencoresi2c
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/simplertc
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/swiftfsi
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/tercelspi
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/litex-boards
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-cpu-microwatt
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-peripheral-aquilalpc
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-peripheral-opencoresi2c
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-peripheral-simplertc
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-peripheral-swiftfsi
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-peripheral-tercelspi
git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-firmware/bare-metal-firmware
Install all packages
for d in */; do cd $d; python3 setup.py develop --user; cd ../; done
Build LiteX for Versa board
cd ../litex-boards/litex_boards/targets
./versa_ecp5.py --device=LFE5UM --cpu-type=microwatt --cpu-variant=standard+ghdl+irq --with-ethernet --build
Program Versa board
openocd --log_output openocd.log 3 -f "ecp5-versa5g.cfg" -c "transport select jtag; init; svf build/versa_ecp5/gateware/versa_ecp5.svf; exit"
Interact with SoC
Interact with serial console of bootloader using SCREEN
:
screen /dev/ttyUSB0 115200
Interact with serial console of bootloader using the special-purpose LiteX debugging tool:
python3 ../../../litex/litex/tools/litex_term.py --speed 115200 /dev/ttyUSB0
Build firmware image
cd bare-metal-firmware
mkdir build
cd build
cmake ..
make
cd ../
Upload firmware to SoC
python3 ../../../litex/litex/tools/litex_term.py --speed 115200 /dev/ttyUSB0 --kernel bare-metal-firmware/firmware.bin
reboot