summaryrefslogtreecommitdiff
path: root/fpga-toolchain/build.sh
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2017-12-12 21:06:30 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2017-12-12 21:06:30 +0100
commit44bb2b56b8a29ca74adcea62feb66b0b139f0cbd (patch)
tree0e60c1c013579794788bbe51b6dd40ce0d603004 /fpga-toolchain/build.sh
parentb0bb1d55d6f094b7db0a29aed941956faaac36ca (diff)
Added build script for icestorm fpga tool-chain.
Diffstat (limited to 'fpga-toolchain/build.sh')
-rwxr-xr-xfpga-toolchain/build.sh69
1 files changed, 69 insertions, 0 deletions
diff --git a/fpga-toolchain/build.sh b/fpga-toolchain/build.sh
new file mode 100755
index 0000000..7f7e873
--- /dev/null
+++ b/fpga-toolchain/build.sh
@@ -0,0 +1,69 @@
+#!/bin/bash
+PROGS="git hg gcc python3 make g++"
+for P in $PROGS
+do
+ which $P > /dev/null 2>&1
+ [ "$?" == "0" ] || (echo "Missing prog '$P'"; exit 1)
+done
+
+J=$(grep -c ^processor /proc/cpuinfo)
+# From:
+# http://www.clifford.at/icestorm/
+
+# Installing the IceStorm Tools (icepack, icebox, iceprog, icetime, chip databases):
+#
+# git clone https://github.com/cliffordwolf/icestorm.git icestorm
+# cd icestorm
+# make -j$(nproc)
+# sudo make install
+#
+# Installing Arachne-PNR (the place&route tool):
+#
+# git clone https://github.com/cseed/arachne-pnr.git arachne-pnr
+# cd arachne-pnr
+# make -j$(nproc)
+# sudo make install
+#
+# Installing Yosys (Verilog synthesis):
+#
+# git clone https://github.com/cliffordwolf/yosys.git yosys
+# cd yosys
+# make -j$(nproc)
+# sudo make install
+
+ROOT=$PWD
+mkdir -p sources
+pushd sources
+
+D="icestorm"
+if [ ! -d $D ]
+then
+ git clone https://github.com/cliffordwolf/icestorm.git $D
+ pushd $D
+ PREFIX=$ROOT/install make -j$J
+ PREFIX=$ROOT/install make install
+ popd
+fi
+
+D="arachne-pnr"
+if [ ! -d $D ]
+then
+ git clone https://github.com/cseed/arachne-pnr.git $D
+ pushd $D
+ PREFIX=$ROOT/install make -j$J
+ PREFIX=$ROOT/install make install
+ popd
+fi
+
+D="yosys"
+if [ ! -d $D ]
+then
+ git clone https://github.com/cliffordwolf/yosys.git $D
+ pushd $D
+ PREFIX=$ROOT/install make config-gcc
+ PREFIX=$ROOT/install make -j$J
+ PREFIX=$ROOT/install make install
+ popd
+fi
+
+popd sources