remove backports and installation of yosys, this is
[dev-env-setup.git] / nextpnr-xilinx-install
1 #!/bin/bash
2 if [ "$EUID" -ne 0 ]
3 then echo "Please run as root using 'sudo bash'"
4 exit
5 fi
6
7 # change into $SUDO_USER home directory
8 cd /home/$SUDO_USER
9 mkdir -p src/nextpnr-xilinx
10 cd src/nextpnr-xilinx
11
12 apt-get install -y libcurl3-gnutls git git-man
13
14 git clone https://github.com/f4pga/prjxray.git
15 git clone https://github.com/SymbiFlow/prjxray-db.git
16 git clone https://github.com/gatecat/nextpnr-xilinx.git
17
18 ## Steps to compile Yosys
19
20 ### Necessary software to install
21
22 apt-get install -y build-essential make g++ cmake bison flex python3 \
23 clang libreadline-dev gawk tcl-dev libffi-dev pkg-config zlib1g-dev \
24 libboost-system-dev libboost-python-dev libboost-filesystem-dev
25
26 ## Steps to compile prjxray
27
28 ### Necessary software to install
29
30 apt-get install -y python3-pip
31
32 ### Build prjxray
33
34 cd prjxray
35 git checkout 18b92012afe2b03f3f975a78c4372c74b60dca0c
36 git submodule update --init --recursive
37 mkdir build; cd build
38 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nextpnr-xilinx ..
39 make -j$(nproc)
40 make install
41 install -d -m 0755 /usr/local/nextpnr-xilinx/build/tools
42 install -m 0755 tools/{bitread,bittool,frame_address_decoder,gen_part_base_yaml,segmatch,xc7frames2bit,xc7patch} \
43 /usr/local/nextpnr-xilinx/build/tools
44 cd ..
45 cp -dpr utils /usr/local/nextpnr-xilinx
46 sed -i -e '/^# Vivado /,$d' /usr/local/nextpnr-xilinx/utils/environment.sh
47 pip3 install .
48 cd ..
49
50 ## Steps to compile prjxray-db
51
52 ### Install prjxray-db
53
54 cd prjxray-db
55 git archive --format=tar --prefix=database/ \
56 0a0addedd73e7e4139d52a6d8db4258763e0f1f3 | \
57 tar -C /usr/local/nextpnr-xilinx -xf -
58 cd ..
59
60 ## Steps to compile nextpnr-xilinx
61
62 ### Necessary software to install
63
64 apt-get install -y libboost-thread-dev libboost-iostreams-dev \
65 libboost-program-options-dev libeigen3-dev
66
67 ### Build nextpnr-xilinx
68
69 cd nextpnr-xilinx
70 git checkout 565588a69ea95a52f7c7592f4ed81d9bef6cfb60
71 git submodule init
72 git submodule update
73 cmake -DARCH=xilinx -DBUILD_GUI=OFF \
74 -DCMAKE_INSTALL_PREFIX=/usr/local/nextpnr-xilinx .
75 make -j$(nproc)
76 make install
77 ln -s xc7a100tcsg324-1 xilinx/external/prjxray-db/artix7/xc7a100t
78 python3 xilinx/python/bbaexport.py --device xc7a100tcsg324-1 \
79 --bba xilinx/xc7a100t.bba
80 ./bbasm --l xilinx/xc7a100t.bba xilinx/xc7a100t.bin
81 install -d -m 0755 /usr/local/nextpnr-xilinx/share/xilinx
82 install -m 0755 xilinx/xc7a100t.bin /usr/local/nextpnr-xilinx/share/xilinx
83 export XRAY_DIR=/usr/local/nextpnr-xilinx
84 cd ..
85
86 cd /home/$SUDO_USER/src/nextpnr-xilinx
87 chown -R $SUDO_USER .
88 chgrp -R $SUDO_USER .
89