From c4d645858015cc92a6f543381928e5c41eff3bbd Mon Sep 17 00:00:00 2001 From: R Veera Kumar Date: Sun, 10 Oct 2021 00:08:54 +0530 Subject: [PATCH] Initial Symbiflow toolchain addition --- symbiflow-install | 290 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 290 insertions(+) create mode 100755 symbiflow-install diff --git a/symbiflow-install b/symbiflow-install new file mode 100755 index 0000000..4f2980d --- /dev/null +++ b/symbiflow-install @@ -0,0 +1,290 @@ +#!/bin/bash +if [ "$EUID" -ne 0 ] + then echo "Please run as root using 'sudo bash'" + exit +fi + +#!!! buster backports is needed for cmake + +apt-get update -y +apt-get upgrade -y + +# change into $SUDO_USER home directory +cd /home/$SUDO_USER +mkdir -p src/symbiflow +cd src/symbiflow + +apt-get install -y git wget + +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/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 +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 http://xmlsoft.org/sources/libxslt-1.1.34.tar.gz + +## Steps to compile Icarus Verilog + +### Necessary software to install + +apt-get install -y build-essential autoconf make g++ bison flex gperf \ + libreadline6-dev + +### Build Icarus Verilog + +cd iverilog +git checkout v11_0 +sh autoconf.sh +./configure --prefix=/usr/local/symbiflow/iverilog +make -j$(nproc) +make check +make install +export PATH=/usr/local/symbiflow/iverilog/bin:$PATH +cd .. + +#Please adjust the install paths for iverilog. + +## Steps to compile Yosys + +### Necessary software to install + +apt-get install -y -t buster_backports cmake +apt-get install -y python3 clang libreadline-dev gawk tcl-dev \ + libffi-dev pkg-config libboost-system-dev libboost-python-dev \ + libboost-filesystem-dev zlib1g-dev + +### Build Yosys + +cd abc +git checkout 4f5f73d18b137930fb3048c0b385c82fa078db38 +cd ../yosys +git checkout f44110c62561b21fa673f44d8e115c3ee70d2900 +ln -s ../abc . +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 .. + +#Please adjust the install paths for Yosys. + +## 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 + +cd vtr-verilog-to-routing +git checkout 77a3df829fdf509a76b9d7b941376f3835c2576a +mkdir build; cd build +cmake -DBUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local/symbiflow/vtr .. +make -j $(nproc) +make install +install -d -m 0755 /usr/local/symbiflow/share/vtr +cp 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. + +## Steps to compile libxml2 + +# Newer version is needed which fixes a integer overflow error and is not +# provided by Buster. + +### Necessary software to install + +apt-get install -y python3-dev + +### Build libxml2 + +tar -xf libxml2-2.9.12.tar.gz +cd libxml2-2.9.12 +./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 .. + +#Please adjust the install paths for libxml2 + +## Steps to compile libxslt + +# Needed by python3 lxml. + +### 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 .. + +#Please adjust the install paths for libxslt + +## Steps to compile prjxray + +### Necessary software to install + +### 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 + +### Build yosys-symbiflow-plugins + +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 + +### Necessary software to install + +apt-get install -y libftdi-dev + +### Build Icestorm + +cd icestorm +git checkout 83b8ef947f77723f602b706eac16281e37de278c +make -j $(nproc) PREFIX=/usr/local/symbiflow/icestorm +make install +export PATH=/usr/local/symbiflow/icestorm/bin:$PATH +cd .. + +## Steps to compile capnproto + +### Necessary software to install + +apt-get install -y automake autoconf libtool + +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 pycapnp + +### Necessary software to install + +apt-get install -y python3-pip cython3 + +cd pycapnp +git checkout v1.0.0b1 +pip3 install . +cd .. + +## Steps to compile symbiflow-arch-defs + +## Necessary software to install + +apt-get install -y nodejs npm python-pytest openocd flake8 \ + default-jre-headless libantlr4-runtime-dev python3-numpy \ + python3-intervaltree python3-simplejson python3-intelhex \ + python3-importlib-metadata python3-jsonschema python3-packaging \ + python3-pyparsing python3-pyrsistent python3-tqdm python3-zipp \ + python3-typing-extensions python3-ply + +pip3 install textx fasm pyjson5 pyyaml tinyfpgab tinyprog pyjson lxml \ + progressbar2 hilbertcurve==1.0.5 python-constraint parameterized \ + yapf==0.26.0 python-sat + +pip3 install python-fpga-interchange + +cd symbiflow-arch-defs +git submodule init +git submodule update --init --recursive +pip3 install -e third_party/prjxray +pip3 install -e third_party/xc-fasm +pip3 install ../quicklogic-fasm-utils +pip3 install ../quicklogic-fasm +pip3 install -e third_party/qlf-fasm +pip3 install -e quicklogic/common/utils/quicklogic-timings-importer +pip3 install -e third_party/vtr-xml-utils +pip3 install -e third_party/python-symbiflow-v2x +pip3 install -e third_party/python-sdf-timing +pip3 install -e third_party/symbiflow-xc-fasm2bels + +mkdir -p env/conda/envs +ln -s /usr/local/symbiflow env/conda/envs/symbiflow_arch_def_base + +git checkout c2c0f00960baf538eb31e4c42bf5d09dca87bad7 + +sed -i -e 's@add_subdirectory(litex)@#add_subdirectory(litex)@g' -e 's@add_subdirectory(ibex)@#add_subdirectory(ibex)@g' xc/xc7/tests/soc/CMakeLists.txt + +### Build symbiflow-arch-defs-xc7-artix7_100t + +mkdir build; cd build +cmake -DUSE_CONDA=FALSE -DPRJXRAY_DB_DIR=/usr/local/symbiflow/prjxray-db -DINSTALL_FAMILIES=xc7 -DINSTALL_ARCHS=artix7_100t -DCMAKE_INSTALL_PREFIX=/usr/local/symbiflow .. +cd xc/xc7/archs/artix7_100t +make install +cd ../..; +make PINMAP_INSTALL_arty100t-full_xc7a100t_test_arty100t-full_pinmap.csv +install -d -m 0755 /usr/local/symbiflow/share/symbiflow/arch/xc7a100t_test/xc7a100tcsg324-1 +cp arty100t-full_pinmap.csv /usr/local/symbiflow/share/symbiflow/arch/xc7a100t_test/xc7a100tcsg324-1/pinmap.csv + +cd /home/$SUDO_USER/src/symbiflow +chown -R $SUDO_USER . +chgrp -R $SUDO_USER . + -- 2.30.2