1 # Installation instructions for Symbiflow with Xilinx Artix7 100T Board
3 * <https://symbiflow.github.io/>
4 * <https://github.com/SymbiFlow>
5 * <https://bugs.libre-soc.org/show_bug.cgi?id=654>
7 This is now possible with the automated devscript
8 <https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=symbiflow-install;hb=HEAD>
10 It is, as always, your responsibility to check the contents of any
11 script before running it.
17 These are notes taken during the process of developing the above
18 script. you **do not** need to go through this manual process unless
19 you are very paranoid. warning: it took several days to get right.
21 ## Setting up new debootstrap and chroot into it
23 Run the following if you wish to isolate the symbiflow build
24 from other software (reproducible builds) or use the schroot
25 auto-preparation script here:
26 <https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=mk-deb-chroot;hb=HEAD>
28 export MY_CHROOT=/stable-chroot
30 debootstrap buster $MY_CHROOT http://deb.debian.org/debian/
31 mount -t proc proc $MY_CHROOT/proc
32 mount -t sysfs sysfs $MY_CHROOT/sys
33 mount -t devpts devpts $MY_CHROOT/dev/pts/
34 chroot $MY_CHROOT /bin/bash
36 ## Add Buster Backports Repo and Update
38 ""buster backports is needed for cmake""
40 cat << EOF > /etc/apt/sources.list.d/buster_backports.list
41 deb http://deb.debian.org/debian buster-backports main
44 ""oooo annoying, pin preferences for buster-backports""
46 cat << EOF > /etc/apt/preferences.d/99buster-backports
48 Pin: release a=buster-backports
52 ""upgrade to buster-backports""
58 ## Download necessary softwares
60 apt-get install -y libcurl3-gnutls/buster git/buster wget
62 git clone https://github.com/steveicarus/iverilog.git
63 git clone https://github.com/YosysHQ/yosys.git
64 git clone https://github.com/YosysHQ/abc.git
65 git clone https://github.com/oneapi-src/oneTBB.git
66 git clone https://github.com/verilog-to-routing/vtr-verilog-to-routing.git
67 git clone https://github.com/yosyshq/icestorm.git
68 git clone https://github.com/SymbiFlow/prjxray.git
69 git clone https://github.com/SymbiFlow/prjxray-db.git
70 git clone https://github.com/SymbiFlow/yosys-symbiflow-plugins.git
71 git clone https://github.com/SymbiFlow/symbiflow-examples.git
72 git clone https://github.com/SymbiFlow/symbiflow-arch-defs.git
73 git clone https://github.com/QuickLogic-Corp/quicklogic-fasm.git
74 git clone https://github.com/QuickLogic-Corp/quicklogic-fasm-utils.git
75 git clone https://github.com/SymbiFlow/python-fpga-interchange.git
76 git clone https://github.com/capnproto/capnproto.git
77 git clone https://github.com/capnproto/pycapnp.git
79 wget http://xmlsoft.org/sources/libxml2-2.9.12.tar.gz
80 wget http://xmlsoft.org/sources/libxslt-1.1.34.tar.gz
82 ## Steps to compile Icarus Verilog
84 ### Necessary software to install
86 apt-get install -y build-essential autoconf make g++ bison flex gperf \
89 ### Build Icarus Verilog
94 ./configure --prefix=/usr/local/symbiflow/iverilog
98 export PATH=/usr/local/symbiflow/iverilog/bin:$PATH
101 ## Steps to compile Yosys
103 ### Necessary software to install
105 apt-get install -y cmake
106 apt-get install -y python3 clang libreadline-dev gawk tcl-dev \
107 libffi-dev pkg-config libboost-system-dev libboost-python-dev \
108 libboost-filesystem-dev zlib1g-dev
113 git checkout 4f5f73d18b137930fb3048c0b385c82fa078db38
115 git checkout f44110c62561b21fa673f44d8e115c3ee70d2900
117 make -j $(nproc) PREFIX=/usr/local/symbiflow/yosys
118 make PREFIX=/usr/local/symbiflow/yosys install
119 install -d -m 0755 /usr/local/symbiflow/share
120 ln -s ../yosys/share/yosys /usr/local/symbiflow/share
121 export PATH=/usr/local/symbiflow/yosys/bin:$PATH
124 ## Steps to compile oneTBB
126 * Note: TBB is needed for multi-threading VTR-Verilog-to-routing
127 * If not need multi-threading do not build TBB and VTR with TBB
129 ### Necessary software to install
131 apt-get install -y libhwloc-dev
137 make -j$(nproc) tbb tbbmalloc tbbproxy tbbbind
138 install -d -m 0755 /usr/local/symbiflow/oneTBB/lib
139 cp -dpr include /usr/local/symbiflow/oneTBB
140 install -Dm755 build/linux_*/*.so* -t /usr/local/symbiflow/oneTBB/lib
141 cmake -DINSTALL_DIR=/usr/local/symbiflow/oneTBB/lib/cmake/TBB \
142 -DTBB_VERSION_FILE=/usr/local/symbiflow/oneTBB/include/tbb/tbb_stddef.h \
143 -DSYSTEM_NAME=Linux -P cmake/tbb_config_installer.cmake
144 echo "/usr/local/symbiflow/oneTBB/lib" > /etc/ld.so.conf.d/symbiflow.conf
148 ## Steps to compile vtr-verilog-to-routing
150 ### Necessary software to install
152 apt-get install -y libeigen3-dev
154 # Only if want GUI place and route
155 #apt-get install libcairo2-dev libfontconfig1-dev libx11-dev libxft-dev \
160 cd vtr-verilog-to-routing
161 git checkout 77a3df829fdf509a76b9d7b941376f3835c2576a
162 mkdir build; cd build
163 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/symbiflow/vtr ..
166 install -d -m 0755 /usr/local/symbiflow/share/vtr
167 install -m 0644 ../libs/libvtrcapnproto/gen/rr_graph_uxsdcxx.capnp \
168 /usr/local/symbiflow/share/vtr
169 export PATH=/usr/local/symbiflow/vtr/bin:$PATH
174 cd vtr-verilog-to-routing
175 git checkout 77a3df829fdf509a76b9d7b941376f3835c2576a
176 mkdir build-tbb; cd build-tbb
177 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/symbiflow/vtr-tbb \
178 -DTBB_INCLUDE_DIR=/usr/local/symbiflow/oneTBB/include \
179 -DTBB_LIBRARY=/usr/local/symbiflow/oneTBB/lib -DBUILD_TYPE=Release ..
180 LIBRARY_PATH=/usr/local/symbiflow/oneTBB/lib make -j $(nproc)
181 LIBRARY_PATH=/usr/local/symbiflow/oneTBB/lib make install
182 install -d -m 0755 /usr/local/symbiflow/share/vtr
183 install -m 0644 ../libs/libvtrcapnproto/gen/rr_graph_uxsdcxx.capnp \
184 /usr/local/symbiflow/share/vtr
185 # Choose either one of path for vtr-binaries
186 # This one or above one
187 #export PATH=/usr/local/symbiflow/vtr-tbb/bin:$PATH
190 ## Steps to compile libxml2
192 * Newer version is needed which fixes a integer overflow error and is not
195 ### Necessary software to install
197 apt-get install -y python3-dev
201 tar -xf libxml2-2.9.12.tar.gz
203 ./configure --prefix=/usr/local/symbiflow/libxml2 --with-history \
204 --with-python=/usr/bin/python3
207 echo "/usr/local/symbiflow/libxml2/lib" >> /etc/ld.so.conf.d/symbiflow.conf
209 export PATH=/usr/local/symbiflow/libxml2/bin:$PATH
212 ## Steps to compile libxslt
214 * Needed by python3 lxml
218 tar -xf libxslt-1.1.34.tar.gz
220 sed -i s/3000/5000/ libxslt/transform.c doc/xsltproc.{1,xml}
221 sed -i -r '/max(Parser)?Depth/d' ./tests/fuzz/fuzz.c
222 ./configure --prefix=/usr/local/symbiflow/libxslt --disable-static \
224 PKG_CONFIG_PATH=/usr/local/symbiflow/libxml2/lib/pkgconfig
227 echo "/usr/local/symbiflow/libxslt/lib" >> /etc/ld.so.conf.d/symbiflow.conf
229 export PATH=/usr/local/symbiflow/libxslt/bin:$PATH
232 ## Steps to compile prjxray
234 ### Necessary software to install
239 git checkout f7f06896ad26bb7c94680dc323d4b871eded1f4e
240 git submodule update --init --recursive
241 mkdir build; cd build
242 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/symbiflow ..
245 export PATH=/usr/local/symbiflow/bin:$PATH
248 ## Steps to compile yosys-symbiflow-plugins
250 ### Necessary software to install
252 ### Build yosys-symbiflow-plugins
254 cd yosys-symbiflow-plugins
255 git checkout b170f1d3575568d87901422f846b700169e299be
256 sed -i -e 's@-include third_party/make-env/conda.mk@#-include third_party/make-env/conda.mk@' Makefile
261 ## Steps to compile prjxray-db
263 ### Install prjxray-db
266 git archive --format=tar --prefix=prjxray-db/ \
267 cd41f08a8a4d2a60053750a0fe10623b1e2e35da | \
268 tar -C /usr/local/symbiflow -xf -
270 cat > /usr/local/symbiflow/bin/prjxray-config << EOF
272 echo /usr/local/symbiflow/prjxray-db
275 chmod +x /usr/local/symbiflow/bin/prjxray-config
278 ## Steps to compile Icestorm
280 ### Necessary software to install
282 apt-get install -y libftdi-dev
287 git checkout 83b8ef947f77723f602b706eac16281e37de278c
288 make -j $(nproc) PREFIX=/usr/local/symbiflow/icestorm
289 make PREFIX=/usr/local/symbiflow/icestorm install
290 export PATH=/usr/local/symbiflow/icestorm/bin:$PATH
293 ## Steps to compile capnproto
295 ### Necessary software to install
297 apt-get install -y automake autoconf libtool
305 ./configure --prefix=/usr/local/symbiflow/capnproto
308 echo "/usr/local/symbiflow/capnproto/lib" >> /etc/ld.so.conf.d/symbiflow.conf
310 export PATH=/usr/local/symbiflow/capnproto/bin:$PATH
313 ## Steps to compile pycapnp
315 ### Necessary software to install
317 apt-get install -y python3-pip cython3
322 git checkout v1.0.0b1
326 ## Git checkout python-fpga-interchange
328 cd python-fpga-interchange
329 git checkout 1959b40e998db987c604c0a75664ccb209df13f7
332 ## Git checkout quicklogic-fasm-utils
334 cd quicklogic-fasm-utils
335 git checkout 3d6a375ddb6b55aaa5a59d99e44a207d4c18709f
338 ## Git checkout quicklogic-fasm
341 git checkout ee546ff09b2ee25894db3f419366afaf3c4bfe32
344 ## Steps to compile symbiflow-arch-defs
346 ## Necessary software to install
348 apt-get install -y nodejs npm python-pytest openocd flake8 python3-numpy \
349 python3-intervaltree python3-simplejson python3-intelhex \
350 python3-importlib-metadata python3-jsonschema python3-packaging \
351 python3-pyparsing python3-pyrsistent python3-tqdm python3-zipp \
352 python3-typing-extensions python3-ply
354 pip3 install textx fasm pyjson5 pyyaml tinyfpgab tinyprog pyjson lxml \
355 progressbar2 hilbertcurve==1.0.5 python-constraint parameterized \
356 yapf==0.26.0 python-sat
360 cd symbiflow-arch-defs
361 git checkout c2c0f00960baf538eb31e4c42bf5d09dca87bad7
363 git submodule update --init --recursive
364 pip3 install ../python-fpga-interchange
365 pip3 install -e third_party/prjxray
366 pip3 install -e third_party/xc-fasm
367 pip3 install ../quicklogic-fasm-utils
368 pip3 install ../quicklogic-fasm
369 pip3 install -e third_party/qlf-fasm
370 pip3 install -e quicklogic/common/utils/quicklogic-timings-importer
371 pip3 install -e third_party/vtr-xml-utils
372 pip3 install -e third_party/python-symbiflow-v2x
373 pip3 install -e third_party/python-sdf-timing
374 pip3 install -e third_party/symbiflow-xc-fasm2bels
376 mkdir -p env/conda/envs
377 ln -s /usr/local/symbiflow env/conda/envs/symbiflow_arch_def_base
379 sed -i -e 's@add_subdirectory(litex)@#add_subdirectory(litex)@g' \
380 -e 's@add_subdirectory(ibex)@#add_subdirectory(ibex)@g' \
381 xc/xc7/tests/soc/CMakeLists.txt
383 ### Build symbiflow-arch-defs-xc7-artix7-100t
385 export VPR_NUM_WORKERS=$(nproc)
387 mkdir build; cd build
388 cmake -DUSE_CONDA=FALSE -DPRJXRAY_DB_DIR=/usr/local/symbiflow/prjxray-db \
389 -DINSTALL_FAMILIES=xc7 -DINSTALL_ARCHS=artix7_100t \
390 -DINSTALL_DEVICES=xc7a100t -DCMAKE_INSTALL_PREFIX=/usr/local/symbiflow ..
391 cd xc/xc7/archs/artix7_100t
394 make PINMAP_INSTALL_arty100t-full_xc7a100t_test_arty100t-full_pinmap.csv
395 install -d -m 0755 /usr/local/symbiflow/share/symbiflow/arch/xc7a100t_test/xc7a100tcsg324-1
396 install -m 0644 arty100t-full_pinmap.csv /usr/local/symbiflow/share/symbiflow/arch/xc7a100t_test/xc7a100tcsg324-1/pinmap.csv
398 # Now you can skip to symbiflow-examples.git for external test
400 # To do builtin counter test; it should build top.bit as final bitstream
402 make counter_arty100t_bit
404 # see file counter_arty100t/artix7_100t-xc7a100t-virt-xc7a100t-test/top.bit
405 # it is the bitstream file and if built then success
409 ### Build symbiflow-arch-defs-xc7-artix7 (xc7a50t)
411 "If you do not want this target skip"
413 export VPR_NUM_WORKERS=$(nproc)
415 mkdir build_artix7; cd build_artix7
416 cmake -DUSE_CONDA=FALSE -DPRJXRAY_DB_DIR=/usr/local/symbiflow/prjxray-db \
417 -DINSTALL_FAMILIES=xc7 -DINSTALL_ARCHS=artix7_100t \
418 -DINSTALL_DEVICES=xc7a50t \
419 -DCMAKE_INSTALL_PREFIX=/usr/local/symbiflow ..
420 cd xc/xc7/archs/artix7
423 make PINMAP_INSTALL_arty-full_xc7a50t_test_arty-full_pinmap.csv
424 install -d -m 0755 /usr/local/symbiflow/share/symbiflow/arch/xc7a50t_test/xc7a50tfgg484-1
425 install -m 0644 arty-full_pinmap.csv /usr/local/symbiflow/share/symbiflow/arch/xc7a50t_test/xc7a50tfgg484-1/pinmap.csv
426 install -d -m 0755 /usr/local/symbiflow/share/symbiflow/arch/xc7a50t_test/xc7a35tcsg324-1
427 ln -s ../xc7a50tfgg484-1/pinmap.csv /usr/local/symbiflow/share/symbiflow/arch/xc7a50t_test/xc7a35tcsg324-1
429 # Now you can skip to symbiflow-examples.git for external test
431 # To do builtin counter test; it should build top.bit as final bitstream
433 make counter_arty100t_bit
435 # see file counter_arty/artix7-xc7a50t-arty-swbut-roi-virt-xc7a50t-arty-swbut-test/top.bit
436 # it is the bitstream file and if built then success
440 ## Steps to compile symbiflow-examples
442 ### Build counter test for arty_100
444 cd symbiflow-examples
445 git checkout 07a6353627e0b6083728d1022ce30f9093d4c2de
448 TARGET="arty_100" make -C counter_test
450 # Should produce top.bit bitstream
451 # see file counter_test/build/arty_100/top.bit
453 ### Build counter test for arty_35
455 TARGET="arty_35" make -C counter_test
457 # Should produce top.bit bitstream
458 # see file counter_test/build/arty_/top.bit
460 ### Build picosoc demo for arty_100
462 TARGET="arty_100" make -C picosoc_demo
464 # Should produce top.bit bitstream
465 # see file picosoc_demo/build/arty_100/top.bit
467 ### Build picosoc demo for arty_35
469 TARGET="arty_35" make -C picosoc_demo
471 # Should produce top.bit bitstream
472 # see file picosoc_demo/build/arty_35/top.bit
474 ### Build Linux Litex Demo for arty_100
476 TARGET="arty_100" make -C linux_litex_demo
478 # Should produce top.bit bitstream
479 # see file linux_litex_demo/build/arty_100/top.bit
481 ### Build Linux Litex Demo for arty_35
483 TARGET="arty_35" make -C linux_litex_demo
485 # Should produce top.bit bitstream
486 # see file linux_litex_demo/build/arty_35/top.bit
490 ## Steps to compile symbiflow-examples Litex
497 git clone https://github.com/m-labs/migen
498 git clone https://github.com/litex-hub/pythondata-software-compiler_rt
499 git clone https://github.com/enjoy-digital/litex
500 git clone https://github.com/enjoy-digital/litedram
501 git clone https://github.com/enjoy-digital/liteeth
502 git clone https://github.com/enjoy-digital/liteiclink
503 git clone https://github.com/enjoy-digital/litesdcard
504 git clone https://github.com/litex-hub/litespi
505 git clone https://github.com/litex-hub/litex-boards
506 git clone https://github.com/litex-hub/pythondata-cpu-picorv32
507 git clone https://github.com/litex-hub/pythondata-cpu-vexriscv
508 git clone https://github.com/litex-hub/pythondata-software-picolibc.git
514 migen=6e3f8e565704b4293174aedfb15b3470d233f528
515 pythondata-software-compiler_rt=fcb03245613ccf3079cc833a701f13d0beaae09d
516 litex=db20cb172dc982c5879aa8080ec7aa18de181cc5
517 litedram=1d5192f572c2eb97bc85eb56667e25dc88d725f1
518 liteeth=8ecc3ca6d9476dd1a8b32b2b6bf3584cd6dcfc02
519 liteiclink=3d8ecdbcf9f0260292221ff63b0ad3f5e409a955
520 litesdcard=4edf05e627a8b5f03e632215accec8ab588737e3
521 litespi=4cb907881bb75999e4c6bb68e211dd5cfc301de9
522 litex-boards=9e18d9bc34bafb18839512a55dc66ba62e0d4824
523 pythondata-cpu-picorv32=2e8be513726fb6ffd960f7e18d24e3a86d895107
524 pythondata-cpu-vexriscv=c4eca1837ebca20b637a0a61e3a93d9446488459
525 pythondata-software-picolibc=e27c8a7ef8a8e75b6474823aae338efb1a2ca1a9
527 for pkg in migen pythondata-software-compiler_rt litex litedram \
528 liteeth liteiclink litesdcard litespi litex-boards \
529 pythondata-cpu-picorv32 pythondata-cpu-vexriscv \
530 pythondata-software-picolibc; do
532 eval git checkout $`echo $pkg`
537 #### Build Litex Demo
542 ./litex_boards/targets/digilent_arty.py --toolchain=symbiflow \
543 --cpu-type=picorv32 --sys-clk-freq 80e6 --variant a7-100 \
544 --output-dir build/picorv32/arty_100 --build --no-compile-software
545 # see file build/picorv32/arty_100/gateware/digilent_arty.bit
546 # this is the built bitstream
550 ./litex_boards/targets/digilent_arty.py --toolchain=symbiflow \
551 --cpu-type=vexriscv --sys-clk-freq 80e6 --variant a7-100 \
552 --output-dir build/vexriscv/arty_100 --build --no-compile-software
553 # see file build/vexriscv/arty_100/gateware/digilent_arty.bit
554 # this is the built bitstream
558 ./litex_boards/targets/digilent_arty.py --toolchain=symbiflow \
559 --cpu-type=picorv32 --sys-clk-freq 80e6 --variant a7-35 \
560 --output-dir build/picorv32/arty_35 --build --no-compile-software
561 # see file build/picorv32/arty_35/gateware/digilent_arty.bit
562 # this is the built bitstream
566 ./litex_boards/targets/digilent_arty.py --toolchain=symbiflow \
567 --cpu-type=vexriscv --sys-clk-freq 80e6 --variant a7-35 \
568 --output-dir build/vexriscv/arty_35 --build --no-compile-software
569 # see file build/vexriscv/arty_35/gateware/digilent_arty.bit
570 # this is the built bitstream