From: Andrey Miroshnikov Date: Fri, 7 Jul 2023 17:27:54 +0000 (+0000) Subject: ice40k-toolchain: New script for installing icestorm, nextpnr, tinyprog. For small... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f51409f914e153ee3d71c4fb28d85775e858ba7e;p=dev-env-setup.git ice40k-toolchain: New script for installing icestorm, nextpnr, tinyprog. For small ice40 FPGAs --- diff --git a/ice40k-toolchain b/ice40k-toolchain new file mode 100755 index 0000000..e47cd96 --- /dev/null +++ b/ice40k-toolchain @@ -0,0 +1,42 @@ +#!/bin/bash +if [ "$EUID" -ne 0 ] + then echo "Please run as root using 'sudo bash'" + exit +fi + +# Make sure to install the following first: +# install-hdl-apt-req +# hdl-dev-repos +# hdl-tools-yosys + +# change into $SUDO_USER home directory +cd /home/$SUDO_USER +mkdir -p src/ice40k +cd src/ice40k + +apt install libeigen3-dev libboost-filesystem-dev libboost-system-dev \ + libboost-thread-dev libboost-iostreams-dev + +git clone https://github.com/YosysHQ/icestorm.git icestorm +git clone --recursive https://github.com/YosysHQ/nextpnr + +## Project icestorm +cd icestorm +make -j$(nproc) +make install + +## Project nextpnr +cd ../nextpnr +# Latest tag +git checkout nextpnr-0.6 +cmake -DARCH=ice40 -DCMAKE_INSTALL_PREFIX=/usr/local . +make -j$(nproc) +make install + +# tinyprog for programming FPGA +pip3 install tinyprog + +cd /home/$SUDO_USER/src/ice40k +chown -R $SUDO_USER . +chgrp -R $SUDO_USER . +