(no commit message)
[libreriscv.git] / HDL_workflow / nextpnr-xilinx.mdwn
1 # nextpnr-xilinx
2
3 **Page under development**
4
5 Installation instructions for Nextpnr-xilinx with Digilent Arty A7-100t
6 with Xilinx Artix7 100T
7
8 Use of the automated install scripts recommended
9
10 * Source code: <https://github.com/gatecat/nextpnr-xilinx>
11 * Bugzilla page <https://bugs.libre-soc.org/show_bug.cgi?id=790>
12 * Auto-install script: <https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=nextpnr-xilinx;hb=HEAD>
13 * Prerequisites: yosys <https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=hdl-tools-yosys;hb=HEAD>
14
15
16
17 # Setting up new debootstrap and chroot into it
18
19 Run the following if you wish to isolate the nextpnr-xilinx build
20 from other software (reproducible builds) or use the schroot
21 auto-preparation script here:
22 <https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=mk-deb-chroot;hb=HEAD>
23
24 export MY_CHROOT=/stable-chroot
25 mkdir $MY_CHROOT
26 debootstrap buster $MY_CHROOT http://deb.debian.org/debian/
27 mount -t proc proc $MY_CHROOT/proc
28 mount -t sysfs sysfs $MY_CHROOT/sys
29 mount -t devpts devpts $MY_CHROOT/dev/pts/
30 chroot $MY_CHROOT /bin/bash
31
32 # Download neccessary softwares
33
34 apt-get install -y libcurl3-gnutls/buster git/buster
35
36 git clone https://github.com/f4pga/prjxray.git
37 git clone https://github.com/SymbiFlow/prjxray-db.git
38 git clone https://github.com/gatecat/nextpnr-xilinx.git
39
40 # Steps to compile prjxray
41
42 ## Necessary software to install
43
44 apt-get install -y python3-pip
45
46 ## Build prjxray
47
48 cd prjxray
49 git checkout 18b92012afe2b03f3f975a78c4372c74b60dca0c
50 git submodule update --init --recursive
51 mkdir build; cd build
52 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nx ..
53 make -j$(nproc)
54 make install
55 install -d -m 0755 /usr/local/nx/build/tools
56 install -m 0755 tools/{bitread,bittool,frame_address_decoder,gen_part_base_yaml,segmatch,xc7frames2bit,xc7patch} \
57 /usr/local/nx/build/tools
58 cd ..
59 cp -dpr utils /usr/local/nx
60 sed -i -e '/^# Vivado /,$d' /usr/local/nx/utils/environment.sh
61 pip3 install .
62 cd ..
63
64 # Steps to compile prjxray-db
65
66 ## Install prjxray-db
67
68 cd prjxray-db
69 git archive --format=tar --prefix=database/ \
70 0a0addedd73e7e4139d52a6d8db4258763e0f1f3 | \
71 tar -C /usr/local/nx -xf -
72 cd ..
73
74 # Steps to compile nextpnr-xilinx
75
76 ## Necessary software to install
77
78 apt-get install -y libboost-thread-dev libboost-iostreams-dev \
79 libboost-program-options-dev libeigen3-dev
80
81 ## Build nextpnr-xilinx
82
83 cd nextpnr-xilinx
84 git checkout 565588a69ea95a52f7c7592f4ed81d9bef6cfb60
85 cmake -DARCH=xilinx -DBUILD_GUI=OFF -DCMAKE_INSTALL_PREFIX=/usr/local/nx .
86 make -j$(nproc)
87 make install
88 python3 xilinx/python/bbaexport.py --device xc7a100tcsg324-1 \
89 --bba xilinx/xc7a100t.bba
90 ./bbasm --l xilinx/xc7a100t.bba xilinx/xc7a100t.bin
91 install -d -m 0755 /usr/local/nx/share/xilinx
92 install -m 0755 xilinx/xc7a100t.bin /usr/local/nx/share/xilinx
93 export XRAY_DIR=/usr/local/nx
94
95 # build attosoc example; it should build attosoc.bit as final bitstream
96
97 cd xilinx/examples
98 cp -dpr arty-a35 arty-a100
99 cd arty-a100
100 sed -i -e 's@xc7a35tcsg324-1@xc7a100tcsg324-1@g' \
101 -e 's@../../../nextpnr-xilinx@nextpnr-xilinx@g' \
102 -e 's@../../xc7a35t.bin@/usr/local/nx/share/xilinx/xc7a100t.bin@g' \
103 attosoc.sh
104 ./attosoc.sh
105
106 # see file attosoc.bit; it is the bitstream file and if built then success