Fix correct commit hash for release 0.7.0 of openXC7
[dev-env-setup.git] / ice40k-toolchain
1 #!/bin/bash
2 if [ "$EUID" -ne 0 ]
3 then echo "Please run as root using 'sudo bash'"
4 exit
5 fi
6
7 # Make sure to install the following first:
8 # install-hdl-apt-req
9 # hdl-dev-repos
10 # hdl-tools-yosys
11
12 # change into $SUDO_USER home directory
13 cd /home/$SUDO_USER
14 mkdir -p src/ice40k
15 cd src/ice40k
16
17 apt install libeigen3-dev libboost-filesystem-dev libboost-system-dev \
18 libboost-thread-dev libboost-iostreams-dev
19
20 git clone https://github.com/YosysHQ/icestorm.git icestorm
21 git clone --recursive https://github.com/YosysHQ/nextpnr
22
23 ## Project icestorm
24 cd icestorm
25 make -j$(nproc)
26 make install
27
28 ## Project nextpnr
29 cd ../nextpnr
30 # Latest tag
31 git checkout nextpnr-0.6
32 cmake -DARCH=ice40 -DCMAKE_INSTALL_PREFIX=/usr/local .
33 make -j$(nproc)
34 make install
35
36 # tinyprog for programming FPGA
37 pip3 install tinyprog
38
39 cd /home/$SUDO_USER/src/ice40k
40 chown -R $SUDO_USER .
41 chgrp -R $SUDO_USER .
42