summaryrefslogtreecommitdiff
path: root/fpga-toolchain/build.sh
blob: e052da04a162f963ed4f62603ac43706376ef9a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/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

# Couldn't get it to compile...
#D=yodl
#SRC=https://github.com/forflo/yodl.git

D="vhd2vl"
if [ ! -d $D ]
then
                git clone https://github.com/ldoolitt/vhd2vl.git $D
                pushd $D/src
		make
                cp vhd2vl $ROOT/install/bin
                popd
fi

popd