From 83c4d895a9152c6450a09fb0dd4f785e273da8c7 Mon Sep 17 00:00:00 2001 From: R Veera Kumar Date: Wed, 13 Oct 2021 16:19:49 +0530 Subject: [PATCH] Update to latest symbiflow and support TBB --- HDL_workflow/symbiflow.mdwn | 420 ++++++++++++++++++++++++++++++------ 1 file changed, 349 insertions(+), 71 deletions(-) diff --git a/HDL_workflow/symbiflow.mdwn b/HDL_workflow/symbiflow.mdwn index 96a912971..aec2b2dac 100644 --- a/HDL_workflow/symbiflow.mdwn +++ b/HDL_workflow/symbiflow.mdwn @@ -3,16 +3,10 @@ * * -WORK IN PROGRESS - ## Bugzilla page * -## TODO - -* Installation with newest git commit of symbiflow-arch-defs - ## Setting up new debootstrap and chroot into it Run the following if you wish to isolate the symbiflow build @@ -28,6 +22,28 @@ auto-preparation script here: mount -t devpts devpts $MY_CHROOT/dev/pts/ chroot $MY_CHROOT /bin/bash +## Add Buster Backports Repo and Update + +* buster backports is needed for cmake + + cat << EOF > /etc/apt/sources.list.d/buster_backports.list + deb http://deb.debian.org/debian buster-backports main + EOF + +* oooo annoying, pin preferences for buster-backports + + cat << EOF > /etc/apt/preferences.d/99buster-backports + Package: * + Pin: release a=buster-backports + Pin-Priority: 900 + EOF + +* upgrade to buster-backports + + apt-get update -y + apt-get upgrade -y + + ## Download neccessary softwares apt-get install git wget @@ -35,20 +51,22 @@ auto-preparation script here: git clone https://github.com/steveicarus/iverilog.git git clone https://github.com/YosysHQ/yosys.git git clone https://github.com/YosysHQ/abc.git + git clone https://github.com/oneapi-src/oneTBB.git git clone https://github.com/verilog-to-routing/vtr-verilog-to-routing.git git clone https://github.com/cliffordwolf/icestorm.git git clone https://github.com/SymbiFlow/prjxray.git + git clone https://github.com/SymbiFlow/prjxray-db.git git clone https://github.com/SymbiFlow/yosys-symbiflow-plugins.git git clone https://github.com/SymbiFlow/symbiflow-examples.git git clone https://github.com/SymbiFlow/symbiflow-arch-defs.git git clone https://github.com/QuickLogic-Corp/quicklogic-fasm.git - git clone https://github.com/QuickLogic-Corp/quicklogic-fasm-utils - #git clone https://github.com/SymbiFlow/symbiflow-rr-graph.git + git clone https://github.com/QuickLogic-Corp/quicklogic-fasm-utils.git + git clone https://github.com/SymbiFlow/python-fpga-interchange.git + git clone https://github.com/capnproto/capnproto.git + git clone https://github.com/capnproto/pycapnp.git wget http://xmlsoft.org/sources/libxml2-2.9.12.tar.gz - wget https://anaconda.org/LiteX-Hub/prjxray-db/0.0_248_g2e51ad3/download/linux-64/prjxray-db-0.0_248_g2e51ad3-20210317_102909.tar.bz2 - - # get yosys-proc.patch from Bug attachment file. + wget http://xmlsoft.org/sources/libxslt-1.1.34.tar.gz ## Steps to compile Icarus Verilog @@ -61,12 +79,12 @@ auto-preparation script here: cd iverilog git checkout v11_0 sh autoconf.sh - ./configure --prefix=/usr/local/iverilog + ./configure --prefix=/usr/local/symbiflow/iverilog make -j$(nproc) make check make install - -Please adjust the install paths for iverilog. + export PATH=/usr/local/symbiflow/iverilog/bin:$PATH + cd .. ## Steps to compile Yosys @@ -79,30 +97,80 @@ Please adjust the install paths for iverilog. ### Build Yosys - cd yosys + cd abc + git checkout 4f5f73d18b137930fb3048c0b385c82fa078db38 + cd ../yosys ln -s ../abc . - make -j $(nproc) PREFIX=/usr/local/symbiflow - make PREFIX=/usr/local/symbiflow install + make -j $(nproc) PREFIX=/usr/local/symbiflow/yosys + make PREFIX=/usr/local/symbiflow/yosys install + install -d -m 0755 /usr/local/symbiflow/share + ln -s ../yosys/share/yosys /usr/local/symbiflow/share + export PATH=/usr/local/symbiflow/yosys/bin:$PATH + cd .. + +## Steps to compile oneTBB + +* Note: TBB is needed for multi-threading VTR-Verilog-to-routing +* If not need multi-threading do not build TBB and VTR with TBB + +### Necessary software to install + + apt-get install libhwloc-dev + +### Build TBB -""Please adjust the install paths for Yosys."" + cd oneTBB + git checkout v2020.3 + make tbb tbbmalloc tbbproxy tbbbind + install -d -m 0755 /usr/local/symbiflow/oneTBB/lib + cp -dpr include /usr/local/symbiflow/oneTBB + install -Dm755 build/linux_*/*.so* -t /usr/local/symbiflow/oneTBB/lib + cmake -DINSTALL_DIR=/usr/local/symbiflow/oneTBB/lib/cmake/TBB \ + -DTBB_VERSION_FILE=/usr/local/symbiflow/oneTBB/include/tbb/tbb_stddef.h \ + -DSYSTEM_NAME=Linux -P cmake/tbb_config_installer.cmake + cd .. ## Steps to compile vtr-verilog-to-routing ### Necessary software to install + apt-get install -y libeigen3-dev + # Only if want GUI place and route #apt-get install libcairo2-dev libfontconfig1-dev libx11-dev libxft-dev \ #libgtk-3-dev -### Build vtr-verilog-to-routing +### Build vtr cd vtr-verilog-to-routing + git checkout 77a3df829fdf509a76b9d7b941376f3835c2576a mkdir build; cd build - cmake -DBUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/symbiflow .. + cmake -DCMAKE_INSTALL_PREFIX=/usr/local/symbiflow/vtr \ make -j $(nproc) make install + install -d -m 0755 /usr/local/symbiflow/share/vtr + install -m 0644 ../libs/libvtrcapnproto/gen/rr_graph_uxsdcxx.capnp \ + /usr/local/symbiflow/share/vtr + export PATH=/usr/local/symbiflow/vtr/bin:$PATH + cd ../.. -""Please adjust the install paths for vtr-verilog-to-routing."" +### Build vtr-tbb + + cd vtr-verilog-to-routing + git checkout 77a3df829fdf509a76b9d7b941376f3835c2576a + mkdir build-tbb; cd build-tbb + cmake -DCMAKE_INSTALL_PREFIX=/usr/local/symbiflow/vtr-tbb \ + -DTBB_INCLUDE_DIR=/usr/local/symbiflow/oneTBB/include \ + -DTBB_LIBRARY=/usr/local/symbiflow/oneTBB/lib -DBUILD_TYPE=Release .. + LIBRARY_PATH=/usr/local/symbiflow/oneTBB/lib make -j $(nproc) + LIBRARY_PATH=/usr/local/symbiflow/oneTBB/lib make install + install -d -m 0755 /usr/local/symbiflow/share/vtr + install -m 0644 ../libs/libvtrcapnproto/gen/rr_graph_uxsdcxx.capnp \ + /usr/local/symbiflow/share/vtr + # Choose either one of path for vtr-binaries + # This one or above one + #export PATH=/usr/local/symbiflow/vtr-tbb/bin:$PATH + cd ../.. ## Steps to compile libxml2 @@ -117,11 +185,34 @@ Please adjust the install paths for iverilog. tar -xf libxml2-2.9.12.tar.gz libxml2-2.9.12 - ./configure --prefix=/usr/local/symbiflow --with-history --with-python=/usr/bin/python3 + ./configure --prefix=/usr/local/symbiflow/libxml2 --with-history \ + --with-python=/usr/bin/python3 make -j $(nproc) make install + echo "/usr/local/symbiflow/libxml2/lib" > /etc/ld.so.conf.d/symbiflow.conf + ldconfig + export PATH=/usr/local/symbiflow/libxml2/bin:$PATH + cd .. + +## Steps to compile libxslt + +* Needed by python3 lxml -""Please adjust the install paths for vtr-verilog-to-routing."" +### Build libxslt + + tar -xf libxslt-1.1.34.tar.gz + cd libxslt-1.1.34 + sed -i s/3000/5000/ libxslt/transform.c doc/xsltproc.{1,xml} + sed -i -r '/max(Parser)?Depth/d' ./tests/fuzz/fuzz.c + ./configure --prefix=/usr/local/symbiflow/libxslt --disable-static \ + --without-python \ + PKG_CONFIG_PATH=/usr/local/symbiflow/libxml2/lib/pkgconfig + make -j $(nproc) + make install + echo "/usr/local/symbiflow/libxslt/lib" >> /etc/ld.so.conf.d/symbiflow.conf + ldconfig + export PATH=/usr/local/symbiflow/libxslt/bin:$PATH + cd .. ## Steps to compile prjxray @@ -130,11 +221,14 @@ Please adjust the install paths for iverilog. ### Build prjxray cd prjxray + git checkout f7f06896ad26bb7c94680dc323d4b871eded1f4e git submodule update --init --recursive mkdir build; cd build cmake -DCMAKE_INSTALL_PREFIX=/usr/local/symbiflow .. make make install + export PATH=/usr/local/symbiflow/bin:$PATH + cd ../.. ## Steps to compile yosys-symbiflow-plugins @@ -142,10 +236,29 @@ Please adjust the install paths for iverilog. ### Build yosys-symbiflow-plugins - cd yosys-symbiflow-plugins/ - sed -i -e 's@include third_party/make-env/conda.mk@#include third_party/make-env/conda.mk@' Makefile + cd yosys-symbiflow-plugins + git checkout b170f1d3575568d87901422f846b700169e299be + sed -i -e 's@-include third_party/make-env/conda.mk@#-include third_party/make-env/conda.mk@' Makefile make make install + cd .. + +## Steps to compile prjxray-db + +### Install prjxray-db + + cd prjxray-db + git archive --format=tar --prefix=prjxray-db/ \ + cd41f08a8a4d2a60053750a0fe10623b1e2e35da | \ + tar -C /usr/local/symbiflow -xf - + + cat > /usr/local/symbiflow/bin/prjxray-config << EOF + #!/bin/bash + echo /usr/local/symbiflow/prjxray-db + EOF + + chmod +x /usr/local/symbiflow/bin/prjxray-config + cd .. ## Steps to compile Icestorm @@ -156,55 +269,94 @@ Please adjust the install paths for iverilog. ### Build Icestorm cd icestorm + git checkout 83b8ef947f77723f602b706eac16281e37de278c make -j $(nproc) PREFIX=/usr/local/symbiflow + make PREFIX=/usr/local/symbiflow/icestorm install + cd .. + +## Steps to compile capnproto + +### Necessary software to install + + apt-get install -y automake autoconf libtool + +### Build capnproto + + cd capnproto + git checkout v0.8.0 + cd c++ + autoreconf -i + ./configure --prefix=/usr/local/symbiflow/capnproto + make -j $(nproc) make install + echo "/usr/local/symbiflow/capnproto/lib" >> /etc/ld.so.conf.d/symbiflow.conf + ldconfig + export PATH=/usr/local/symbiflow/capnproto/bin:$PATH + cd ../.. -## Steps to compile prjxray-db +## Steps to compile pycapnp -### Install prjxray-db +### Necessary software to install - tar --strip-components=2 -xf prjxray-db-0.0_248_g2e51ad3-20210312_125539.tar.bz2 share/symbiflow/prjxray-db + apt-get install -y python3-pip cython3 - #!!ATTENTION!! +### Build pycapnp - cat > /usr/local/symbiflow/bin/prjxray-config <