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