Fix correct commit hash for release 0.7.0 of openXC7 master
authorCesar Strauss <cesar.strauss@inpe.br>
Thu, 4 Apr 2024 09:25:34 +0000 (06:25 -0300)
committerCesar Strauss <cesar.strauss@inpe.br>
Thu, 4 Apr 2024 10:18:16 +0000 (07:18 -0300)
I used the hash mentioned in the Nix flake, which is a little newer.
Replace with the hash of the actual tagged release.

30 files changed:
README.mdwn [new file with mode: 0644]
binutils-gdb-install [new file with mode: 0755]
build_kestrel [new file with mode: 0755]
build_kestrel_firmware [new file with mode: 0755]
coriolis-install [new file with mode: 0755]
coriolis2-chroot
cp-scripts-to-chroot [new file with mode: 0755]
firmware-kestrel-repos [new file with mode: 0755]
fpga-boot-load-prog-install [new file with mode: 0755]
ghdl-install
hdl-dev-ls2 [new file with mode: 0755]
hdl-dev-repos
hdl-dev-repos-virtualenv
hdl-kestrel-repos [new file with mode: 0755]
hdl-tools-yosys
ice40k-toolchain [new file with mode: 0755]
install-firmware-apt-reqs [new file with mode: 0755]
install-hdl-apt-reqs
install-mesa-apt-reqs
iverilog-install
lsoc-mesa-dev-env-setup
mk-deb-chroot
nextpnr-ecp5-install
nextpnr-xilinx-install [new file with mode: 0755]
pia-install
ppc64-gdb-gcc
rm-deb-chroot [new file with mode: 0755]
symbiflow-install [new file with mode: 0755]
symbiflow-install-notes.txt [new file with mode: 0644]
tasyagle-install [new file with mode: 0755]

diff --git a/README.mdwn b/README.mdwn
new file mode 100644 (file)
index 0000000..5265d50
--- /dev/null
@@ -0,0 +1,97 @@
+# Libre-SOC Reproducible Build Scripts
+
+This repository contains the Libre-SOC "reproducible builds" scripts.
+Initially begun as a way to ensure that coriolis2 VLSI ASIC layouts
+were reproducible, they've turned into an easy way for developers to
+get started.  
+
+All packages are installed within a baseline debian/10 debootstrapped
+schroot.  For reproducible builds, you have to pick an OS, and debian/10
+is good enough.  Note, obviously, that adding security updates would
+completely defeat the purpose and object of being "reproducible", so
+it is *strongly recommended* that you do **not** make these chrooted
+installs internet-facing.
+
+Prerequisites:
+
+* Strongly recommended that you install a Host OS of Debian.
+* Confirmed working but not supported: ubuntu
+* Also confirmed working with a caveat on X11: archlinux,
+  (which happens to have a port of debootstrap)
+
+Installs (at recent but usually specific - reproducible - versions):
+
+* coriolis2
+* yosys
+* symbiyosys, z3 solver, yices, sby
+* ghdl
+* yosys-ghdl
+* nextpnr-ecp5
+* nextpnr-xilinx
+* symbiflow
+* nmigen (a Registered Trademark of M-Labs)
+* verilator
+* icarus verilog
+* cocotb
+* a ton of FPGA loader tools, dfu-util, openFPGALoader, ecpprog,
+  fujprog, and associated udev.d rules files.
+
+Note: we don't use conda.  we don't use docker.
+
+# Why reproducible?
+
+Imagine that you are about to drop USD 16 million on 7nm mask charges.
+Two - or more - engineers run the VLSI build scripts, to create the
+Multi-Terabyte GDS-II Files.  You have a week before the deadline: it
+takes 48 hours to run the VLSI build.  You find that, after 48 hours,
+a comparison of all the engineer's GDS-II files show differences.
+
+More than a week's worth of investigation - long after the deadline
+has been missed to submit the Masks to the Foundry (which you paid for
+up-front and now cannot recover) - you discover that one developer
+used Ubuntu and had a PRNG library that created a different Place-and-Route
+sequence, another used BSD which had an older library with a bug, and yet
+another had installed security updates which changed memory-allocation.
+
+The "perfect" reproducible build system uses absolutely identical hardware,
+installs on bare-metal (no Virtual Machines), does a complete and full
+OS wipe and automated install, and, after running, if two *Drives* are
+compared, they should be bit-level identical.  This is of course a little
+extreme (but hey, you're spending USD 16 million on 7nm masks then you're
+entitled to a little paranoia) so the closest we can get is:
+
+* (a) pick an OS
+* (b) don't add updates and
+* (c) pin as many packages with explicit versions and git tags as possible.
+
+It works. don't knock it.
+
+# Installation Notes
+
+During their development, each install script had notes taken which,
+if followed carefully, should result in the replication of the script.
+These notes can be found here:
+
+* <https://libre-soc.org/HDL_workflow/>
+* <https://libre-soc.org/HDL_workflow/coriolis2/>
+* <https://libre-soc.org/HDL_workflow/nextpnr/>
+* <https://libre-soc.org/HDL_workflow/nextpnr-xilinx/>
+* <https://libre-soc.org/HDL_workflow/verilator/>
+* <https://libre-soc.org/HDL_workflow/ghdl/>
+* <https://libre-soc.org/HDL_workflow/iverilog/>
+* <https://libre-soc.org/HDL_workflow/cocotb/>
+* <https://libre-soc.org/HDL_workflow/symbiflow/>
+* <https://libre-soc.org/HDL_workflow/fpga-boot-loaders-progs/>
+
+# Contact details
+
+Any questions, improvements, bug-fixes or patches, most welcome:
+please join Libera.Chat IRC #libre-soc, or join the mailing list:
+<https://lists.libre-soc.org/mailman/listinfo/libre-soc-dev>
+
+# Charter
+
+Covered by the Libre-SOC Charter <https://libre-soc.org/charter/discussion/>
+we particularly welcome appropriate Dilbert Cartoons illustrating the
+antithetical polar opposite of the points that make up the fundamental
+existential existence of the Charter. y'ken.
diff --git a/binutils-gdb-install b/binutils-gdb-install
new file mode 100755 (executable)
index 0000000..21fe7b5
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/bash
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root using 'sudo bash'"
+  exit
+fi
+
+# change into $SUDO_USER home directory
+cd /home/$SUDO_USER
+mkdir -p src/binutils-gdb
+cd src/binutils-gdb
+
+apt-get install -y libcurl3-gnutls git git-man
+
+git clone https://git.libre-soc.org/git/binutils-gdb.git
+
+# Steps to compile binutils-gdb
+
+## Necessary software to install
+
+apt-get install -y build-essential libgmp-dev libmpfr-dev libmpc-dev \
+                   libisl-dev bison flex file texinfo dejagnu
+
+if [ "`arch`" = "x86_64" ]; then
+ apt-get install -y g++-powerpc64le-linux-gnu
+fi
+
+## Build binutils-gdb
+
+cd binutils-gdb
+git checkout svp64
+mkdir ../binutils-gdb-build
+cd ../binutils-gdb-build
+AR=ar AS=as ../binutils-gdb/configure \
+                     --target=powerpc64le-linux-gnu \
+                     --disable-nls --enable-shared \
+                     --enable-64-bit-bfd --disable-multilib \
+                     --enable-ld=default --enable-gold=yes \
+                     --enable-plugins --enable-threads
+make # -j$(nproc)
+# make check |& tee chk.log
+make install
+ldconfig
+cd ..
+
+cd /home/$SUDO_USER/src/binutils-gdb
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .
diff --git a/build_kestrel b/build_kestrel
new file mode 100755 (executable)
index 0000000..84a2e40
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/bash
+#
+# Copyright 2022 Raptor Engineering, LLC
+# Licensed under the terms of the GNU LGPLv3+
+#
+# Ensure that the LibreSoC packages and HDL tools
+# are installed prior to running this script,
+# as well as the kestrel repos
+#
+#   ./install-hdl-apt-reqs
+#   ./hdl-dev-repos
+#   ./hdl-tools-yosys
+#   ./ppc64-gdb-gcc
+#   ./nextpnr-ecp5
+#   ./hdl-kestrel-repos
+
+set -e
+
+export PATH=/usr/local/libtrellis/bin:$PATH
+export PATH=/usr/local/nextpnr-ecp5/bin:$PATH
+
+export KESTREL=/home/$SUDO_USER/src/kestrel
+echo "Refreshing Python data files from current LibreSoC sources..."
+cd /home/$SUDO_USER/src/soc
+python3 src/soc/simple/issuer_verilog.py --fabric-compat --enable-core \
+                                    --enable-mmu --enable-xics \
+                                    --disable-svp64 --disable-pll \
+                                    --debug dmi external_core_top.v
+cp -Rp external_core_top.v \
+    $KESTREL/pythondata-cpu-libresoc/pythondata_cpu_libresoc/hdl/external_core_top.v
+
+echo "Building Kestrel..."
+cd $KESTREL/litex-boards/litex_boards/targets
+./rcs_arctic_tern_bmc_card.py --device=LFE5UM --cpu-type=libresoc \
+                              --cpu-variant=standard+irq \
+                              --with-ethernet --with-video \
+                              --build --nextpnr-seed 1 \
+                              --sys-clk-freq=50e6 --remote-ip 192.168.1.1
diff --git a/build_kestrel_firmware b/build_kestrel_firmware
new file mode 100755 (executable)
index 0000000..ea7b629
--- /dev/null
@@ -0,0 +1,53 @@
+#!/bin/bash
+#
+# Copyright 2022 Raptor Engineering, LLC
+# Licensed under the terms of the GNU LGPLv3+
+#
+# Ensure that the LibreSoC packages and HDL tools
+# are installed prior to running this script,
+# as well as the kestrel repos
+#
+#   ./install-hdl-apt-reqs
+#   ./hdl-dev-repos
+#   ./hdl-tools-yosys
+#   ./ppc64-gdb-gcc
+#   ./nextpnr-ecp5
+#   ./hdl-kestrel-repos
+
+set -e
+
+export PATH=/usr/local/libtrellis/bin:$PATH
+export PATH=/usr/local/nextpnr-ecp5/bin:$PATH
+
+export KESTREL=/home/$SUDO_USER/src/kestrel
+echo "Building ppc64el soft floating point library..."
+cd $KESTREL/firmware/gcc/libgcc/soft-fp
+# Ignore expected errors
+set +e
+gcc -c -O2 -msoft-float -mno-string -mno-multiple -mno-vsx \
+           -mno-altivec -mlittle-endian -mstrict-align \
+           -fno-stack-protector -m64 -mabi=elfv2 -mcmodel=small \
+           -I../config/rs6000/ -I../../include -I.. *.c &> /dev/null
+set -e
+ar -crv libsoft-fp.a *.o
+cp -Rp libsoft-fp.a ../../../
+
+echo "Building Zephyr..."
+cd $KESTREL/firmware
+export SOURCE_ROOT_DIR=$(pwd)
+cd zephyr-rtos
+rm -rf build
+mkdir build
+cd build
+export ZEPHYR_MODULES="${SOURCE_ROOT_DIR}/zephyr-littlefs"
+export ZEPHYR_MODULES="${ZEPHYR_MODULES};${SOURCE_ROOT_DIR}/zephyr-mbedtls;"
+export ZEPHYR_MODULES="${ZEPHYR_MODULES};${SOURCE_ROOT_DIR}/zephyr-civetweb"
+ZEPHYR_BASE=${SOURCE_ROOT_DIR}/zephyr-rtos \
+           ZEPHYR_TOOLCHAIN_VARIANT=host \
+           cmake -DZEPHYR_MODULES="${ZEPHYR_MODULES}" \
+           -DBOARD=litex_kestrel ${SOURCE_ROOT_DIR}/zephyr-firmware
+cp -Rp ../../libsoft-fp.a zephyr/
+make -j32
+
+echo -n "Zephyr firmware binary now in "
+echo    "$KESTREL/firmware/zephyr-rtos/build/zephyr/zephyr.bin"
diff --git a/coriolis-install b/coriolis-install
new file mode 100755 (executable)
index 0000000..c1b3b7e
--- /dev/null
@@ -0,0 +1,127 @@
+#!/bin/bash
+
+if [ "$EUID" -eq 0 ]; then
+  echo "Please run as a normal user!"
+  echo "This script is NOT intended to run as root."
+  exit
+fi
+
+echo "Current USER=$USER"
+
+# Install apt dependencies
+echo Installing necessary apt dependencies in the chroot
+sudo apt-get update -y
+sudo apt-get install -y automake binutils-dev bison build-essential \
+       sysvinit-utils sysvinit-core \
+       ccache clang cmake doxygen dvipng flex gcc git graphviz \
+       imagemagick libboost-all-dev libboost-python-dev libbz2-dev \
+       libmpfr-dev libgmp-dev libmotif-dev libreadline-dev \
+       libqwt-dev libtool libx11-dev libxaw7-dev libxml2-dev \
+       python2.7 python2.7-dev \
+       libxpm-dev libxt-dev python3.7 python3-jinja2 python3-pip \
+       python3-setuptools python-dev python-qt4 python-sphinx \
+       qt4-dev-tools rapidjson-dev tcl tcl-dev tcl-tclreadline \
+       texlive texlive-fonts-extra texlive-lang-french \
+       texlive-latex-extra texlive-pictures xfig zlib1g-dev wget
+
+# Add convenience variable to chroot user .bash_profile
+vars_for_bash_profile="export PATH=/usr/lib/ccache:\044PATH
+export DISPLAY=:0.0
+export ALLIANCE_TOP=/home/$USER/alliance/install
+export YOSYS_TOP=/home/$USER/yosys
+export LD_LIBRARY_PATH=\044{ALLIANCE_TOP}/lib:\044{LD_LIBRARY_PATH}
+export LD_LIBRARY_PATH=\044{ALLIANCE_TOP}/lib64:\044{LD_LIBRARY_PATH}"
+
+echo -e "$vars_for_bash_profile" > /home/$USER/.bash_profile
+
+echo "Setting /home/$USER/.bash_profile file to (for faster rebuilds):
+$vars_for_bash_profile"
+
+sudo chown $USER /home/$USER/.bash_profile
+sudo chgrp $USER /home/$USER/.bash_profile
+
+# Build and install yosys from source
+# note that a specific version of yosys is needed for ls180 at the moment
+echo "deb-src http://ftp.debian.org/debian buster main" > /etc/apt/sources.list.d/bustersrc.list
+sudo apt-get update -y
+sudo apt-get build-dep yosys -y
+
+cd /home/$USER
+git clone https://github.com/YosysHQ/yosys.git
+cd yosys
+git checkout 049e3abf9baf795e69b9ecb9c4f19de6131f8418
+make config-clang
+# WAY too heavy a load (18+) - make -j$(nproc)
+make
+
+cd /home/$USER/yosys
+sudo make install
+
+# Install coriolis2 from source
+cd /home/$USER
+source .bash_profile
+mkdir -p /home/$USER/coriolis-2.x/src
+cd /home/$USER/coriolis-2.x/src
+git clone https://gitlab.lip6.fr/vlsi-eda/coriolis.git
+cd coriolis
+# check out Libre-SOC 180nm ASIC version - uses stable python2 version
+#git checkout devel
+git checkout LS180_RC7_FINAL
+# guaranteed to fail ./bootstrap/ccb.py --projecrt=coriolis --make="-j$(nproc) install"
+./bootstrap/ccb.py --project=coriolis --make="-j1 install"
+
+# Setup and test coriolisenv
+# Have to use workaround as coriolisEnv.py can't detect the shell when ran inside a script.
+/bin/bash << EOF
+/home/$USER/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py > /home/$USER/coriolisenv
+EOF
+
+# Set the environment variables needed for Coriolis2 and Alliance
+# coriolisenv overwrites env vars, so should occur first
+source /home/$USER/coriolisenv
+source /home/$USER/.bash_profile
+
+# Install alliance from source
+cd /home/$USER
+git clone https://gitlab.lip6.fr/vlsi-eda/alliance.git
+mkdir -p /home/$USER/alliance/build /home/$USER/alliance/install
+mv alliance/alliance/src alliance
+rm -rf alliance/alliance
+# Compile Alliance
+cd alliance/src
+./autostuff
+cd /home/$USER/alliance/build
+../src/configure --prefix=/home/$USER/alliance/install --enable-alc-shared
+# Make/Install as local user
+make -j1 install
+
+# Install and configure alliance-check-toolkit
+cd /home/$USER
+git clone https://gitlab.lip6.fr/vlsi-eda/alliance-check-toolkit.git
+cd alliance-check-toolkit
+git checkout 3f40be93f1552 # specific version needed
+cd ..
+touch alliance-check-toolkit/etc/mk/users.d/user-$USER.mk
+
+# Environment variables for alliance-check-toolkit in a single script variable
+vars_for_alliance_check="export CORIOLIS_TOP=/home/$USER/coriolis-2.x/Linux.x86_64/Release.Shared/install
+export ALLIANCE_TOP=/home/$USER/alliance/install
+export CHECK_TOOLKIT=/home/$USER/alliance-check-toolkit
+export YOSYS_TOP=/home/$USER/yosys"
+
+echo -e "$vars_for_alliance_check" > /home/$USER/alliance-check-toolkit/etc/mk/users.d/user-$USER.mk
+
+echo "Setting /home/$USER/alliance-check-toolkit/etc/mk/users.d/user-$USER.mk file to:
+$vars_for_alliance_check"
+
+example_cell="chip_r"
+cd alliance-check-toolkit/benchs/adder/cmos
+make lvx
+echo -e "
+\e[1;91mSelect File -> Open Cell or press CTRL + o then enter as the cell name '$example_cell' without the single quotation marks.\e[0m
+"
+make cgt
+
+cd /home/$USER/
+sudo chown -R $USER *
+sudo chgrp -R $USER *
index a21f0235180c643ac72d601dd70702e6ac3c225c..1ba4e35ee7fdb9802d1a5a8feda234a711dc8ee3 100755 (executable)
@@ -3,159 +3,48 @@ if [ "$EUID" -ne 0 ]
   then echo "Please run as root"
   exit
 fi
-# Setup fstab mount points
-cat <<'EOF' >> /etc/fstab
-/dev      /opt/chroot/coriolis/dev      none   bind   0   0
-/dev/pts  /opt/chroot/coriolis/dev/pts  none   bind   0   0
-/proc     /opt/chroot/coriolis/proc     none   bind   0   0
-/sys      /opt/chroot/coriolis/sys      none   bind   0   0
-/tmp      /opt/chroot/coriolis/tmp      none   bind   0   0
-EOF
-# Create coriolis chroot dir in /opt
-mkdir -p /opt/chroot/coriolis
-# Install debootstrap and schroot via apt
-apt install -y debootstrap schroot
-# Install debian/buster chroot using debootstrap
-/usr/sbin/debootstrap buster /opt/chroot/coriolis http://ftp.debian.org/debian
-# Mount all chroot mount points from fstab
-mount /opt/chroot/coriolis/dev
-mount /opt/chroot/coriolis/dev/pts
-mount /opt/chroot/coriolis/proc
-mount /opt/chroot/coriolis/sys
-mount /opt/chroot/coriolis/tmp
-echo "coriolis2" > /opt/chroot/coriolis/etc/debian_chroot
-# Install apt dependencies in the chroot
-chroot /opt/chroot/coriolis /bin/bash << EOF
-echo Installing necessary apt dependencies in the chroot
-apt-get update -y
-apt-get upgrade -y
-apt-get install -y automake binutils-dev bison build-essential \
-sysvinit-utils sysvinit-core \
-ccache clang cmake doxygen dvipng flex gcc git graphviz \
-imagemagick libboost-all-dev libboost-python-dev libbz2-dev \
-libmpfr-dev libgmp-dev libmotif-dev libreadline-dev \
-libqwt-dev libtool libx11-dev libxaw7-dev libxml2-dev \
-libxpm-dev libxt-dev python3.7 python3-jinja2 python3-pip \
-python3-setuptools python-dev python-qt4 python-sphinx \
-qt4-dev-tools rapidjson-dev tcl tcl-dev tcl-tclreadline \
-texlive texlive-fonts-extra texlive-lang-french \
-texlive-latex-extra texlive-pictures xfig yosys zlib1g-dev
-
-# yeah don't add systemd in a chroot.  not funny joke
-apt-get remove -y systemd
-
-# Create user with same UID in the chroot
-useradd -m -p `python -c 'import crypt; print crypt.crypt("1234","Fx")'` -s /bin/bash $SUDO_USER -k /etc/skel
-echo -e "
-Added user ${SUDO_USER} with \e[1;91mpassword: 1234\e[0m"
+# Terminal echo colours
+RED='\033[1;91m'
+NC='\033[0m'
+
+# Default name for the new chroot
+chroot_name="coriolis"
+
+# Check if default chroot name should be used or not
+if [ -z $1 ]; then
+    echo "Not provided a chroot name, using default chroot \"$chroot_name\""
+else
+       chroot_name="$1"
+       echo "Using specified chroot name \"$chroot_name\""
+fi
 
-echo -e "
-\e[1;91mPlease use command 'passwd ${SUDO_USER}' to change this immediately after this script is run for security purposes.\e[0m
+if [ -e /opt/chroot/$chroot_name ]; then
+    echo -e "
+${RED}Chroot \"$chroot_name\" exists! Delete with \"rm-deb-chroot\" or
+run parts of this script separately${NC}
 "
-
-# Add convenience variable to chroot user .bash_profile
-echo -e 'export PATH=/usr/lib/ccache:"\044PATH"\nexport DISPLAY=:0.0\nexport ALLIANCE_TOP=/home/$SUDO_USER/alliance/install\nexport YOSYS_TOP=/home/$SUDO_USER/yosys\nexport LD_LIBRARY_PATH=\044{ALLIANCE_TOP}/lib:\044{LD_LIBRARY_PATH}\nexport LD_LIBRARY_PATH=\044{ALLIANCE_TOP}/lib64:\044{LD_LIBRARY_PATH}' > /home/$SUDO_USER/.bash_profile
-chown $SUDO_USER /home/$SUDO_USER/.bash_profile
-chgrp $SUDO_USER /home/$SUDO_USER/.bash_profile
-
-echo -e "Added 'export PATH=/usr/lib/ccache:\"\044PATH\"\nexport DISPLAY=:0.0' to /home/$SUDO_USER/.bash_profile to speed up rebuilds"
-EOF
-
-# Add coriolis config to schroot.conf
-cat <<EOF >>/etc/schroot/schroot.conf
-[coriolis]
-description=Debian Buster for Coriolis
-directory=/opt/chroot/coriolis
-groups=sbuild-security,$SUDO_USER,users
-EOF
-
-echo "Adding the following coriolis section to /etc/schroot/schroot.conf:
-
-[coriolis]
-description=Debian Buster for Coriolis
-directory=/opt/chroot/coriolis
-groups=sbuild-security,$SUDO_USER,users
-
-This enables you to chroot into coriolis as an unprivileged user by running
-'schroot -c coriolis /bin/bash'
+    echo "See https://libre-soc.org/HDL_workflow/coriolis2/ for more info.
 "
+    exit
+fi
 
-# Build and install yosys from source
-# note that a specific version of yosys is needed for ls180 at the moment
-chroot /opt/chroot/coriolis /bin/bash << EOF
-apt-get update -y 
-apt-get build-dep yosys -y
-apt-get remove yosys -y
-EOF
-runuser $SUDO_USER --preserve-environment -c 'schroot -c coriolis /bin/bash << EOF
-cd /home/$SUDO_USER
-git clone https://github.com/cliffordwolf/yosys.git
-cd yosys
-git checkout 049e3abf9baf795e69b9ecb9c4f19de6131f8418
-make config-clang
-make -j$(nproc)
-EOF'
-
-chroot /opt/chroot/coriolis /bin/bash << EOF
-cd /home/$SUDO_USER/yosys
-make install
-EOF
-
-# Install coriolis2 from source
-runuser $SUDO_USER --preserve-environment -c 'schroot -c coriolis /bin/bash << EOF
-cd /home/$SUDO_USER
-source .bash_profile
-mkdir -p /home/$SUDO_USER/coriolis-2.x/src
-cd /home/$SUDO_USER/coriolis-2.x/src
-git clone https://gitlab.lip6.fr/vlsi-eda/coriolis.git
-cd coriolis
-git checkout devel
-./bootstrap/ccb.py --project=coriolis --make="-j$(nproc) install"
-
-# Setup and test coriolisenv
-/home/$SUDO_USER/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py > /home/$SUDO_USER/coriolisenv
-source /home/$SUDO_USER/.bash_profile
-source /home/$SUDO_USER/coriolisenv
-EOF'
+echo "Creating a new chroot \"$chroot_name\" using \"mk-deb-chroot\""
+./mk-deb-chroot $chroot_name
+echo "Copying scripts to chroot \"$chroot_name\" using \"cp-scripts-to-chroot\""
+./cp-scripts-to-chroot $chroot_name
 
-# Install alliance from source
-runuser $SUDO_USER --preserve-environment -c 'schroot -c coriolis /bin/bash <<    EOF
-cd /home/$SUDO_USER
-source coriolisenv
-git clone https://gitlab.lip6.fr/vlsi-eda/alliance.git
-mkdir -p /home/$SUDO_USER/alliance/build /home/$SUDO_USER/alliance/install
-mv alliance/alliance/src alliance
-rm -rf alliance/alliance
-cd alliance/src
-./autostuff
-cd /home/$SUDO_USER/alliance/build
-../src/configure --prefix=/home/$SUDO_USER/alliance/install --enable-alc-shared
-EOF'
+# Run coriolis installation script as a normal user
+echo "Entering \"$chroot_name\" and setting Coriolis and its dependencies!"
+runuser $SUDO_USER -c "schroot -c $chroot_name --directory=/tmp /bin/bash << EOF
+cd /home/$SUDO_USER/dev-env-setup
+./coriolis-install
+EOF"
 
-chroot /opt/chroot/coriolis /bin/bash << EOF
-cd /home/$SUDO_USER/alliance/build
-source /home/$SUDO_USER/coriolisenv
-make -j1 install
-EOF
 
-# Install and configure alliance-check-toolkit
-runuser $SUDO_USER --preserve-environment -c 'schroot -c coriolis /bin/bash << EOF
-cd /home/$SUDO_USER
-git clone https://gitlab.lip6.fr/vlsi-eda/alliance-check-toolkit.git
-source coriolisenv
-touch alliance-check-toolkit/etc/mk/users.d/user-$SUDO_USER.mk
-cat <<EOG >>alliance-check-toolkit/etc/mk/users.d/user-$SUDO_USER.mk
-export CORIOLIS_TOP=/home/$SUDO_USER/coriolis-2.x/Linux.x86_64/Release.Shared/install
-export ALLIANCE_TOP=/home/$SUDO_USER/alliance/install
-export CHECK_TOOLKIT=/home/$SUDO_USER/alliance-check-toolkit
-export YOSYS_TOP=/home/$SUDO_USER/yosys
-EOG
-source /home/$SUDO_USER/.bash_profile
-cd alliance-check-toolkit/benchs/ARM/cmos
-make lvx
+echo "Your new Coriolis chroot should now be setup and ready to go!"
+echo -e "
+${RED}To get inside the new chroot, execute the following (as normal user):${NC}"
 echo -e "
-\e[1;91mSelect File -> Open Cell or press CTRL + o then enter as the cell name 'arm_chip_cts_r' without the single quotation marks.\e[0m
+${RED}schroot -c $chroot_name --directory=/home/$SUDO_USER${NC}
 "
-make cgt
-EOF'
 
diff --git a/cp-scripts-to-chroot b/cp-scripts-to-chroot
new file mode 100755 (executable)
index 0000000..3543af2
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/bash
+# useful script which copies dev-env-setup into a named chroot.
+# (when setting up chroots, this is needed every time)
+
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root"
+  exit
+fi
+if [ -z "$1"  ]
+  then echo "Need arg $1 to specify which chroot to copy scripts to!"
+  exit
+fi
+
+chrootdir="$1"
+
+if [ -e /opt/chroot/$chrootdir ]; then
+
+       cur_dir=$(pwd | grep -o '[^/]*$')
+       if [ "$cur_dir" == "dev-env-setup" ]; then
+               echo "Copy over the dev-env-setup scripts to $chrootdir environment"
+               cp -R ../dev-env-setup /opt/chroot/$chrootdir/home/$SUDO_USER/
+               chown -R $SUDO_USER /opt/chroot/$chrootdir/home/$SUDO_USER/dev-env-setup
+               chgrp -R $SUDO_USER /opt/chroot/$chrootdir/home/$SUDO_USER/dev-env-setup
+       else
+               echo "This script must be run from dev-env-setup directory!"
+       fi
+else
+       echo "$chrootdir environment does not exist, cannot copy scripts!"
+fi
+
diff --git a/firmware-kestrel-repos b/firmware-kestrel-repos
new file mode 100755 (executable)
index 0000000..c010ba0
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/bash
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root using 'sudo bash'"
+  exit
+fi
+
+runuser $SUDO_USER --preserve-environment -c '
+cd /home/$SUDO_USER
+mkdir -p src/kestrel/firmware
+cd src/kestrel/firmware
+git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-firmware/zephyr-rtos
+git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-firmware/zephyr-firmware
+cd zephyr-firmware
+git submodule init
+git submodule update
+cd ..
+git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-firmware/zephyr-littlefs
+git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-firmware/zephyr-mbedtls
+git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-firmware/zephyr-civetweb
+git clone https://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-tooling/gcc
+'
+cd ../
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .
+echo -e "
+\e[1;91mAll Libre-SOC Kestrel firmware dependencies should now be installed.\e[0m
+"
+
diff --git a/fpga-boot-load-prog-install b/fpga-boot-load-prog-install
new file mode 100755 (executable)
index 0000000..526c1de
--- /dev/null
@@ -0,0 +1,145 @@
+#!/bin/bash
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root using 'sudo bash'"
+  exit
+fi
+
+# change into $SUDO_USER home directory
+cd /home/$SUDO_USER
+mkdir -p src/fpga-boot-load-prog
+cd src/fpga-boot-load-prog
+
+apt-get install -y libcurl3-gnutls git git-man
+
+git clone https://git.code.sf.net/p/dfu-util/dfu-util
+git clone https://github.com/trabucayre/openFPGALoader.git
+git clone https://github.com/f32c/tools.git
+git clone https://github.com/kost/fujprog.git
+git clone https://github.com/xtrx-sdr/xc3sprog.git
+git clone https://github.com/gregdavill/ecpprog.git
+
+# Steps to compile dfu-util
+
+## Necessary software to install
+
+apt-get install -y build-essential make autoconf libusb-dev \
+ libusb-1.0-0-dev pkg-config
+
+## Build dfu-util
+
+cd dfu-util
+git checkout v0.11
+./autogen.sh
+./configure
+make -j$(nproc)
+make install
+cd ..
+
+# Steps to compile openFPGALoader
+
+## Necessary software to install
+
+apt-get install -y cmake libftdi1-2 libftdi1-dev libhidapi-hidraw0 \
+ libhidapi-dev libudev-dev zlib1g-dev
+
+## Build openFPGALoader
+
+cd openFPGALoader
+git checkout v0.8.0
+mkdir build; cd build
+cmake ..
+make -j$(nproc)
+make install
+cd ..
+cp 99-openfpgaloader.rules /etc/udev/rules.d
+cd ..
+
+# Steps to compile ujprog
+
+## Build ujprog
+
+cd tools
+git checkout 0698352b0e912caa9b8371b8f692e19aac547a69
+cd ujprog
+cp Makefile.linux Makefile
+sed -i -e 's@ -static@@g' \
+ -e 's@/usr/lib/${ARCHNAME}/libftdi.a@$(shell pkg-config --cflags --libs libftdi1)@g' \
+ -e 's@^USBLIB@#USBLIB@' Makefile
+sed -i -e 's@usb_reset@ftdi_usb_reset@g' ujprog.c
+make
+install -v -m 4755 ujprog /usr/local/bin
+
+cat > /etc/udev/rules.d/80-fpga-ulx3s.rules << EOF
+# this is for usb-serial tty device
+SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", \
+ MODE="664", GROUP="dialout"
+# this is for ujprog libusb access
+ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", \
+ GROUP="dialout", MODE="666"
+EOF
+cd ../..
+
+# Steps to compile fujprog
+
+## Build fujprog
+
+cd fujprog
+git checkout v4.8
+mkdir build; cd build
+cmake ..
+make -j$(nproc)
+make install
+cd ../..
+
+# Steps to compile xc3sprog
+
+## Build xc3sprog
+
+cd xc3sprog
+git checkout 99e7de20aa8323712e5f70ff74d2079d5fb45bc7
+sed -i -e 's@^if(NOT LIBUSB3380_FOUND)@if(NOT LIBUSB3380_FOUND)\n  include(FindPkgConfig)@' Findlibusb3380.cmake
+mkdir build; cd build
+cmake -DLIBFTDI_FOUND=YES -DLIBFTDI_INCLUDE_DIR="/usr/include/libftdi1" \
+ -DLIBFTDI_LIBRARIES="ftdi1" -DLIBUSB_FOUND=YES \
+ -DLIBUSB_INCLUDE_DIR="/usr/include" -DLIBUSB_LIBRARIES="usb" \
+ -DUSE_FTD2XX=OFF -DUSE_LIBUSB3380=OFF ..
+make -j$(nproc)
+make install
+cd ../..
+
+# Steps to compile ecpprog
+
+## Build ecpprog
+
+cd ecpprog
+git checkout 7212b56a9d2fc6de534e06636a1c6d8b0c6f80ab
+cd ecpprog
+make
+make install
+cd ../..
+
+# Install udev rules for boards
+
+cat > /etc/udev/rules.d/90-ecp5.rules << EOF
+SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6020", \
+ GROUP="users", MODE="0666"
+EOF
+
+cat > /etc/udev/rules.d/90-ftdi-orangecrab.rules << EOF
+SUBSYSTEM=="usb", ATTRS{idVendor}=="1209", ATTRS{idProduct}=="5af0", \
+ GROUP="users", MODE="0666"
+EOF
+
+cat > /etc/udev/rules.d/90-arty7-100t.rules << EOF
+SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", \
+ GROUP="users", MODE="0666"
+EOF
+
+# Run finally this to update udev
+# udevadm control --reload-rules && udevadm trigger
+# usermod -a $USER -G plugdev
+
+cd /home/$SUDO_USER/src/fpga-boot-load-prog
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .
+
index adcd752d65e538552e151c1f116e500575383c25..0377f327cb4207025e4aaff27460162c68cbc56f 100755 (executable)
@@ -1,4 +1,6 @@
 #!/bin/bash
+# really this is covered by hdl-tools-yosys already, it's best to
+# use that (and install yosys at the same time, you'll need it anyway)
 if [ "$EUID" -ne 0 ]
   then echo "Please run as root using 'sudo bash'"
   exit
@@ -31,8 +33,11 @@ tar -xf ../isl-0.18.tar.bz2
 mv isl-0.18 isl
 cd ..
 
+# see hdl-tools-yosys, a *very* specific version is needed to work
+# with yosys and the yosys-ghdl-plugin
 cd ghdl
-git checkout v1.0.0
+#git checkout v1.0.0
+git checkout 263c843ed49f59cb4cc3038bafcac2b9238ebad4
 mkdir build
 cd build
 ../configure --with-gcc=../../gcc-10.3.0 --prefix=/usr/local/ghdl
diff --git a/hdl-dev-ls2 b/hdl-dev-ls2
new file mode 100755 (executable)
index 0000000..0fe6cad
--- /dev/null
@@ -0,0 +1,43 @@
+#!/bin/bash
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root using 'sudo bash'"
+  exit
+fi
+
+runuser $SUDO_USER --preserve-environment -c '
+cd /home/$SUDO_USER
+mkdir -p src
+cd src
+git clone https://git.libre-soc.org/git/ls2.git
+git clone https://git.libre-soc.org/git/gram.git
+git clone https://git.libre-soc.org/git/lambdasoc.git
+git clone https://git.libre-soc.org/git/microwatt.git tercel-qspi
+git clone https://github.com/freecores/uart16550
+git clone https://github.com/freecores/ethmac
+git clone https://github.com/alexforencich/verilog-wishbone
+'
+
+# verilog-wishbone checkout at specific tag
+cd /home/$SUDO_USER/src/verilog-wishbone
+git checkout d1fa24a0
+
+# lambdasoc
+cd /home/$SUDO_USER/src/lambdasoc
+git tag | xargs git tag -d # very annoying
+python3 setup.py develop
+
+# gram
+cd ../gram
+git tag | xargs git tag -d # very annoying
+python3 setup.py develop
+
+# ls2
+# does not need an "install"... yet.
+
+cd ../
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .
+echo -e "
+\e[1;91mAll Libre-SOC dev dependencies should now be installed.\e[0m
+"
+
index d1751d2f68516575ab191c743b69635b053e47e0..032182f9c630fc6ba83ea4fa615b31cf5143eba9 100755 (executable)
@@ -8,24 +8,60 @@ runuser $SUDO_USER --preserve-environment -c '
 cd /home/$SUDO_USER
 mkdir -p src
 cd src
-git clone https://github.com/nmigen/nmigen.git
+git clone https://github.com/westerndigitalcorporation/pyvcd.git
+git clone https://gitlab.com/nmigen/nmigen-boards.git
+git clone https://gitlab.com/nmigen/nmigen.git
 git clone https://git.libre-soc.org/git/c4m-jtag.git
 git clone https://git.libre-soc.org/git/nmutil.git
 git clone https://git.libre-soc.org/git/openpower-isa.git
 git clone https://git.libre-soc.org/git/ieee754fpu.git
-git clone https://git.libre-soc.org/git/nmigen-soc.git
+git clone https://gitlab.com/nmigen/nmigen-soc.git
+git clone https://gitlab.com/nmigen/nmigen-stdio.git
 git clone https://git.libre-soc.org/git/soc.git
+git clone https://git.libre-soc.org/git/pytest-output-to-files.git
+git clone https://git.libre-soc.org/git/mdis.git
+git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git --depth=1 --branch v6.5.8
 '
+
+# pytest
+python3 -m pip install pytest-xdist==3.3.1 pytest==7.3.1 \
+    pytest-subtests==0.11.0
+
+# pytest-output-to-files
+cd /home/$SUDO_USER/src/pytest-output-to-files
+python3 setup.py develop
+
+# pyvcd - needed for nmigen
+cd /home/$SUDO_USER/src/pyvcd
+git checkout 0.2.4
+python3 setup.py develop --no-deps
+
 # nmigen
 cd /home/$SUDO_USER/src/nmigen
 git tag | xargs git tag -d # very annoying
 python3 setup.py develop
 
+# nmigen-boards
+cd /home/$SUDO_USER/src/nmigen-boards
+git tag | xargs git tag -d # very annoying
+python3 setup.py develop --no-deps
+
 # nmigen-soc
 cd ../nmigen-soc
 git tag | xargs git tag -d # very annoying
 python3 setup.py develop
 
+# nmigen-stdio
+cd ../nmigen-stdio
+git tag | xargs git tag -d # very annoying
+python3 setup.py develop
+
+# XXX GRRR run this again: TODO, resolve dependencies
+# nmigen
+cd /home/$SUDO_USER/src/nmigen
+git tag | xargs git tag -d # very annoying
+python3 setup.py develop
+
 # c4m-jtag
 cd ../c4m-jtag
 git tag | xargs git tag -d # very annoying
@@ -35,12 +71,17 @@ python3 setup.py develop
 cd ../nmutil
 python3 setup.py develop
 
+# mdis
+cd ../mdis
+python3 setup.py develop
+
 # openpower-isa
 cd ../openpower-isa
 python3 setup.py develop
 make svanalysis
 make pywriter
 make pyfnwriter
+python3 -m openpower.syscalls json ../linux > src/openpower/syscalls/syscalls.json
 
 # ieee754fpy
 cd ../ieee754fpu
@@ -51,6 +92,10 @@ python3 setup.py develop
 cd ../soc
 make gitupdate
 python3 setup.py develop
+# sigh sort out pinmux
+cd pinmux
+git checkout d96f737c0a53dde983
+cd ..
 make mkpinmux
 
 cd ../
index ff8b2facbefbb2469acb69befc1e1eba5cb0b164..33cd7f19e5dd4853819183c5309a4f6ea3305044 100755 (executable)
@@ -3,19 +3,37 @@ python3 -m venv .env
 . .env/bin/activate
 pip3 install nose
 
-git clone https://github.com/nmigen/nmigen.git
+git clone https://github.com/westerndigitalcorporation/pyvcd.git
+git clone https://gitlab.com/nmigen/nmigen-boards.git
+git clone https://gitlab.com/nmigen/nmigen.git
 git clone https://git.libre-soc.org/git/c4m-jtag.git
 git clone https://git.libre-soc.org/git/nmutil.git
 git clone https://git.libre-soc.org/git/openpower-isa.git
 git clone https://git.libre-soc.org/git/ieee754fpu.git
-git clone https://git.libre-soc.org/git/nmigen-soc.git
+git clone https://gitlab.com/nmigen/nmigen-soc.git
 git clone https://git.libre-soc.org/git/soc.git
+git clone https://git.libre-soc.org/git/pytest-output-to-files.git
+
+# pytest-output-to-files
+pushd pytest-output-to-files
+python3 setup.py develop
+popd
+
+# pyvcd - needed for nmigen
+cd /home/$SUDO_USER/src/pyvcd
+git checkout 0.2.4
+python3 setup.py develop --no-deps
 
 # nmigen
 cd /home/$SUDO_USER/src/nmigen
 git tag | xargs git tag -d # very annoying
 python3 setup.py develop
 
+# nmigen-boards
+cd /home/$SUDO_USER/src/nmigen-boards
+git tag | xargs git tag -d # very annoying
+python3 setup.py develop
+
 # nmigen-soc
 cd ../nmigen-soc
 git tag | xargs git tag -d # very annoying
@@ -46,6 +64,11 @@ python3 setup.py develop
 cd ../soc
 make gitupdate
 python3 setup.py develop
+# sigh sort out pinmux
+cd pinmux
+git checkout d96f737c0a53dde983
+cd ..
+
 make mkpinmux
 
 # comment this out - takes too long.  run it manually
diff --git a/hdl-kestrel-repos b/hdl-kestrel-repos
new file mode 100755 (executable)
index 0000000..fed59de
--- /dev/null
@@ -0,0 +1,120 @@
+#!/bin/bash
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root using 'sudo bash'"
+  exit
+fi
+
+runuser $SUDO_USER --preserve-environment -c '
+cd /home/$SUDO_USER
+mkdir -p src/kestrel
+cd src/kestrel
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/migen
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/litex.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/litex-boards.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/liteiclink.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/liteeth.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/litedram.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-cpu-libresoc.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/tercelspi.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-peripheral-tercelspi.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/aquilalpc.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-peripheral-aquilalpc.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/swiftfsi.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-peripheral-swiftfsi.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/opencoresi2c.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-peripheral-opencoresi2c.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/simplertc.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-peripheral-simplertc.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/simplepwm.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-peripheral-simplepwm.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/arcticterngpio.git
+git clone http://gitlab.raptorengineering.com/kestrel-collaboration/kestrel-litex/pythondata-peripheral-arcticterngpio.git
+'
+
+# litex
+cd /home/$SUDO_USER/src/kestrel/litex
+python3 setup.py develop
+
+# litex-boards
+cd /home/$SUDO_USER/src/kestrel/litex-boards
+python3 setup.py develop
+
+# liteiclink
+cd /home/$SUDO_USER/src/kestrel/liteiclink
+python3 setup.py develop
+
+# liteeth
+cd /home/$SUDO_USER/src/kestrel/liteeth
+python3 setup.py develop
+
+# litedram
+cd /home/$SUDO_USER/src/kestrel/litedram
+python3 setup.py develop
+
+# pythondata-cpu-libresoc
+cd /home/$SUDO_USER/src/kestrel/pythondata-cpu-libresoc
+python3 setup.py develop
+
+# tercelspi
+cd /home/$SUDO_USER/src/kestrel/tercelspi
+python3 setup.py develop
+
+# pythondata-peripheral-tercelspi
+cd /home/$SUDO_USER/src/kestrel/pythondata-peripheral-tercelspi
+python3 setup.py develop
+
+# aquilalpc
+cd /home/$SUDO_USER/src/kestrel/aquilalpc
+python3 setup.py develop
+
+# pythondata-peripheral-aquilalpc
+cd /home/$SUDO_USER/src/kestrel/pythondata-peripheral-aquilalpc
+python3 setup.py develop
+
+# swiftfsi
+cd /home/$SUDO_USER/src/kestrel/swiftfsi
+python3 setup.py develop
+
+# pythondata-peripheral-swiftfsi
+cd /home/$SUDO_USER/src/kestrel/pythondata-peripheral-swiftfsi
+python3 setup.py develop
+
+# opencoresi2c
+cd /home/$SUDO_USER/src/kestrel/opencoresi2c
+python3 setup.py develop
+
+# pythondata-peripheral-opencoresi2c
+cd /home/$SUDO_USER/src/kestrel/pythondata-peripheral-opencoresi2c
+python3 setup.py develop
+
+# simplertc
+cd /home/$SUDO_USER/src/kestrel/simplertc
+python3 setup.py develop
+
+# pythondata-peripheral-simplertc
+cd /home/$SUDO_USER/src/kestrel/pythondata-peripheral-simplertc
+python3 setup.py develop
+
+# simplepwm
+cd /home/$SUDO_USER/src/kestrel/simplepwm
+python3 setup.py develop
+
+# pythondata-peripheral-simplepwm
+cd /home/$SUDO_USER/src/kestrel/pythondata-peripheral-simplepwm
+python3 setup.py develop
+
+# arcticterngpio
+cd /home/$SUDO_USER/src/kestrel/arcticterngpio
+python3 setup.py develop
+
+# pythondata-peripheral-arcticterngpio
+cd /home/$SUDO_USER/src/kestrel/pythondata-peripheral-arcticterngpio
+python3 setup.py develop
+
+cd ../
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .
+echo -e "
+\e[1;91mAll Libre-SOC Kestrel dependenices should now be installed.\e[0m
+"
+
index a27e8aac492ac8c5dddc6a95fb175125a59de319..5b54555e527669039e32d945d15236f39b04629f 100755 (executable)
@@ -7,26 +7,70 @@ fi
 # this is a bit of a cheat, by relying on debian to pull in all the
 # build dependencies.  saves time researching how to get and list them
 # by hand.
-apt-get update -y 
+apt-get update -y
 apt-get build-dep yosys -y
 apt-get remove yosys -y
+apt-get build-dep ghdl -y # this is sort-of what ghdl-install does, hmmm
+apt-get install -y default-jre-headless python3-pip curl
+python3 -m pip install toml
 
 mkdir -p /home/$SUDO_USER/src
 cd /home/$SUDO_USER/src
 mkdir -p hdl_tools
 cd hdl_tools
 
-git clone https://github.com/cliffordwolf/yosys.git
-git clone https://github.com/YosysHQ/SymbiYosys.git sby
+git clone https://git.libre-soc.org/git/yosys.git
+git clone https://git.libre-soc.org/git/SymbiYosys.git sby
 git clone https://github.com/SRI-CSL/yices2.git
 git clone https://github.com/Z3Prover/z3.git
+# XXX see ghdl-install this is really best done with that
+git clone https://github.com/ghdl/ghdl
+git clone https://github.com/ghdl/ghdl-yosys-plugin
+# both of these need adding https://bugs.libre-soc.org/show_bug.cgi?id=883
+git clone https://github.com/bitwuzla/bitwuzla.git
+git clone -b cvc5-1.0.1 https://github.com/cvc5/cvc5.git cvc5
 
+# yosys 0.13 has been found to be stable...
 cd yosys
+git checkout smtlib2-expr-support-on-0.13
 make config-clang
 make -j$(nproc)
 make install
 
-cd ../sby
+# ... but things are in the middle of a transition so use this version of ghdl
+cd ../ghdl
+git checkout 263c843ed49f59cb4cc3038bafcac2b9238ebad4
+./configure --with-llvm-config
+make
+make install
+
+# ...with this specific version of the yosys-ghdl-plugin
+cd ../ghdl-yosys-plugin
+git checkout c9b05e481423c55ffcbb856fd5296701f670808c
+make
+make install
+
+# ... cvc5
+cd ../cvc5
+git rev-parse HEAD
+./configure.sh --poly --auto-download
+cd build
+make -j$(nproc)
+make install
+
+# ... bitwuzla
+cd ../../bitwuzla
+git checkout 19dd987a6e246990619751cca07996fac505fd0b
+./contrib/setup-cadical.sh
+./contrib/setup-btor2tools.sh
+./contrib/setup-symfpu.sh
+./configure.sh
+cd build
+make -j$(nproc)
+make install
+
+# symbiyosys should be fine though
+cd ../../sby
 make install
 
 cd ../yices2
@@ -41,6 +85,6 @@ cd build
 make -j$(nproc)
 make install
 
-cd /home/$SUDO_USER/src/hdl_tools
-chown -R $SUDO_USER hdl_tools
-chgrp -R $SUDO_USER hdl_tools
+cd /home/$SUDO_USER/src
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .
diff --git a/ice40k-toolchain b/ice40k-toolchain
new file mode 100755 (executable)
index 0000000..e47cd96
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/bash
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root using 'sudo bash'"
+  exit
+fi
+
+# Make sure to install the following first:
+# install-hdl-apt-req
+# hdl-dev-repos
+# hdl-tools-yosys
+
+# change into $SUDO_USER home directory
+cd /home/$SUDO_USER
+mkdir -p src/ice40k
+cd src/ice40k
+
+apt install libeigen3-dev libboost-filesystem-dev libboost-system-dev \
+                       libboost-thread-dev libboost-iostreams-dev
+
+git clone https://github.com/YosysHQ/icestorm.git icestorm
+git clone --recursive https://github.com/YosysHQ/nextpnr
+
+## Project icestorm
+cd icestorm
+make -j$(nproc)
+make install
+
+## Project nextpnr
+cd ../nextpnr
+# Latest tag
+git checkout nextpnr-0.6
+cmake -DARCH=ice40 -DCMAKE_INSTALL_PREFIX=/usr/local .
+make -j$(nproc)
+make install
+
+# tinyprog for programming FPGA
+pip3 install tinyprog
+
+cd /home/$SUDO_USER/src/ice40k
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .
+
diff --git a/install-firmware-apt-reqs b/install-firmware-apt-reqs
new file mode 100755 (executable)
index 0000000..ef7ec4f
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+#
+# Relies on install-hdl-apt-reqs being run first
+# which has already added buster-backports (and pinned libcurl3-gnutls, sigh)
+
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root"
+  exit
+
+apt-get update -y
+apt-get install -y python3-pykwalify \
+       python3-pyelftools
index 9ef6dd5ef727eb79dadd38bbfdf0519c8eaba04c..6ade3986d671f5187b41a3fdfbbac98f0e2e169c 100755 (executable)
@@ -4,7 +4,6 @@ if [ "$EUID" -ne 0 ]
   exit
 fi
 apt-get update -y
-apt-get upgrade -y
 apt-get install -y autoconf \
     bison \
     build-essential \
@@ -14,7 +13,6 @@ apt-get install -y autoconf \
     flex \
     g++ \
     gawk \
-    gcc-8-powerpc64-linux-gnu \
     git \
     gperf \
     graphviz \
@@ -23,16 +21,20 @@ apt-get install -y autoconf \
     libboost-program-options-dev \
     libevent-dev \
     libffi-dev \
+    libgtest-dev \
     libjson-c-dev \
     libftdi-dev \
     libgmp-dev \
     libmpfr-dev \
     libpng++-dev \
+    libpython3.7-dev \
     libreadline-dev \
     libreadline7 \
+    minicom \
     ninja-build \
     pkg-config \
     python \
+    python2.7 \
     python-dev \
     python-setuptools \
     python-virtualenv \
@@ -40,14 +42,37 @@ apt-get install -y autoconf \
     python3.7-dev \
     python3-nose \
     python3-setuptools \
+    python-svgwrite \
+    python3-svgwrite \
+    python3-cffi \
     python3-venv \
+    python3-jinja2 \
     python3-sphinx \
     python3-sphinx-rtd-theme \
     python3-recommonmark \
-    qemu-system-ppc \
+    python3-pandocfilters \
+    python3-toml \
+    pandoc \
+    rsync \
+    ssh \
+    texstudio \
+    texlive \
+    texlive-latex-extra \
+    texlive-xetex \
+    inkscape \
     tcl \
     tcl-dev \
     tcl-tclreadline \
     vim \
     wget \
     xdot
+
+# have to also upgrade sysvinit-core to stop it getting removed
+apt-get -t buster-backports install -y qemu-system-ppc/buster-backports
+
+# if doing this on ppc64le it may fail
+apt-get install -y gcc-8-powerpc64-linux-gnu
+apt-get install -y gcc-8-powerpc64le-linux-gnu
+# install the gcc binaries above, but without the trailing "8"
+apt-get install -y gcc-powerpc64-linux-gnu
+apt-get install -y gcc-powerpc64le-linux-gnu
index 169ca51a493c9e325668f0d92f27f87837f9fd92..2af8a304008eba2809e64680228e9d4c978555a3 100755 (executable)
@@ -1,12 +1,15 @@
 #!/bin/bash
+# Relies on mk-deb-chroot adding buster-backports
+
 if [ "$EUID" -ne 0 ]
   then echo "Please run as root"
   exit
 fi
-echo "deb http://deb.debian.org/debian buster-backports main" | tee \
-    -a /etc/apt/sources.list
+
 apt-get update -y
-apt-get upgrade -y
+apt-get install -y -t buster-backports meson
+apt-get -t buster-backports build-dep -y libdrm
+apt-get -t buster-backports build-dep -y mesa
 apt-get install -y build-essential \
     cmake \
     git \
@@ -18,12 +21,10 @@ apt-get install -y build-essential \
     libunwind-dev \
     llvm-8 \
     llvm-8-dev \
+    meson \
     python3.7 \
     python3.7-dev \
     python3-setuptools \
     libzstd-dev \
     libzstd1 \
     zlib1g
-apt-get install -y -t buster-backports meson
-apt-get build-dep -y libdrm
-apt-get build-dep -y mesa
index 0da8e4ab12c9c9bf1f159e6f56f7c9bf8a3baf7a..af910fb959bd270ea7c3a2a473f29aec01b72003 100755 (executable)
@@ -15,9 +15,10 @@ cd src/iverilog
 git clone https://github.com/steveicarus/iverilog.git
 
 cd iverilog
-git checkout v11_0
+#git checkout v11_0
+git checkout d8cb29f6e0 # works ok, better than v11_0 stable
 sh autoconf.sh
-./configure --prefix=/usr/local/iverilog
+./configure --prefix=/usr/local/
 make -j$(nproc)
 make check
 make install
index f40bb6a6c7320e42d0c971e76d9cd1de954d505f..94c0c85badc9234dee65720a67f53241c6eee5da 100755 (executable)
@@ -7,7 +7,7 @@ git clone https://gitlab.freedesktop.org/mesa/drm.git
 cd drm
 mkdir build && cd build
 meson -Dbuildtype=release -Dprefix=/home/$USER/src/lsoc_mesa ..
-ninja install
+ninja -f ~/src/build.ninja install
 
 export PKG_CONFIG_PATH=~/src/lsoc_mesa/lib/x86_64-linux-gnu/pkgconfig/
 export VK_ICD_FILENAMES=/home/$USER/src/lsoc_mesa/share/vulkan/icd.d/libresoc_icd.x86_64.json
@@ -23,4 +23,4 @@ mkdir build && cd build
 
 meson -Dbuildtype=debug -Dprefix=/home/$USER/src/lsoc_mesa \
       -Dvulkan-drivers=libre-soc ..
-ninja install
+ninja -f ~/src/build.ninja install
index 6267491c339a010ff4aa93bf9311fe7b0257624a..81b4a3cb79431214d73af47d8beda07fce447b6a 100755 (executable)
@@ -4,47 +4,162 @@ if [ "$EUID" -ne 0 ]
   exit
 fi
 if [ -z "$1"  ]
-  then echo "need arg $1 for chroot to make"
+  then echo "Need arg $1 for chroot to make"
   exit
 fi
 chrootdir="$1"
-echo "creating chroot '$chrootdir'"
-# Setup fstab mount points
-cat <<EOF >> /etc/fstab
-/dev      /opt/chroot/$chrootdir/dev      none   bind   0   0
-/dev/pts  /opt/chroot/$chrootdir/dev/pts  none   bind   0   0
-/proc     /opt/chroot/$chrootdir/proc     none   bind   0   0
-/sys      /opt/chroot/$chrootdir/sys      none   bind   0   0
-/tmp      /opt/chroot/$chrootdir/tmp      none   bind   0   0
-EOF
+
+if [ -e /opt/chroot/$chrootdir ]; then
+    echo "/opt/chroot/$chrootdir already exists"
+    exit
+fi
+
+
+echo "Creating chroot dir '$chrootdir'"
 
 # Create coriolis chroot dir in /opt
 mkdir -p /opt/chroot/$chrootdir
-# Install debootstrap and schroot via apt
-apt install -y debootstrap schroot
-# Install debian/buster chroot using debootstrap
-/usr/sbin/debootstrap buster /opt/chroot/$chrootdir http://ftp.debian.org/debian
-# Mount all chroot mount points from fstab
-mount /opt/chroot/$chrootdir/dev
-mount /opt/chroot/$chrootdir/dev/pts
-mount /opt/chroot/$chrootdir/proc
-mount /opt/chroot/$chrootdir/sys
-mount /opt/chroot/$chrootdir/tmp
+
+# argh apt with broken proxies and unreliable ISPs, getting fed up with it
+if [ -e /tmp/brokenproxy ]; then
+    echo "Temp file containing apt proxy fix configuration already exists, skipping!"
+else
+    cat <<EOF >/tmp/brokenproxy
+APT::Acquire::Retries "20";
+APT::Get::Fix-Broken "true";
+Acquire::http::Pipeline-Depth "0";
+Acquire::http::No-Cache=True;
+Acquire::BrokenProxy=true;
+EOF
+fi
+
+if [ -e /etc/apt/apt.conf.d/80-retries ]; then
+    echo "Host system apt.conf.d already has 80-retries, skipping!"
+else
+    cp /tmp/brokenproxy /etc/apt/apt.conf.d/80-retries
+fi
+
+# Install debootstrap and schroot
+if [ -e /etc/debian_version ]; then
+    # Debian detected: use apt
+    REQUIRED_PKG="debootstrap"
+    PKG_OK=$(dpkg-query -W --showformat='${Status}\n'\
+    $REQUIRED_PKG|grep "install ok installed")
+    echo Checking for $REQUIRED_PKG: $PKG_OK
+    if [ "" = "$PKG_OK" ]; then
+        apt install -y debootstrap
+    fi
+
+    REQUIRED_PKG="schroot"
+    PKG_OK=$(dpkg-query -W --showformat='${Status}\n'\
+    $REQUIRED_PKG|grep "install ok installed")
+    echo Checking for $REQUIRED_PKG: $PKG_OK
+    if [ "" = "$PKG_OK" ]; then
+        apt install -y schroot
+    fi
+elif [ -e /etc/arch-release ]; then
+    # Arch Linux detected: use pacman
+    pacman -S --needed debootstrap schroot
+fi
+
+# Debian mirror from where to download packages for the chroot
+CHROOT_DEBIAN_MIRROR=${CHROOT_DEBIAN_MIRROR:-http://ftp.uk.debian.org/debian}
+
+# Install debian/buster chroot using debootstrap,
+# any /etc/ config must be done after this point!
+/usr/sbin/debootstrap buster /opt/chroot/$chrootdir $CHROOT_DEBIAN_MIRROR
+
 echo "$chrootdir" > /opt/chroot/$chrootdir/etc/debian_chroot
 
+# make chroot profile
+mkdir -p /etc/schroot/$chrootdir
+cp /etc/schroot/default/copyfiles /etc/schroot/$chrootdir
+touch /etc/schroot/$chrootdir/nssdatabases
+
+# Copy over brokenproxy apt script to the new chroot environment
+cp /tmp/brokenproxy /opt/chroot/$chrootdir/etc/apt/apt.conf.d/80-retries
+
+# create special fstab not bind-mounting /home
+schroot_fstab="
+# <file system> <mount point>   <type>  <options>       <dump>  <pass>
+/proc           /proc           none    rw,bind         0       0
+/sys            /sys            none    rw,bind         0       0
+/dev            /dev            none    rw,bind         0       0
+/dev/pts        /dev/pts        none    rw,bind         0       0
+/tmp            /tmp            none    rw,bind         0       0
+"
+
+cat <<EOF >/etc/schroot/$chrootdir/fstab
+$schroot_fstab
+EOF
+
+echo "Adding the following fstab mounts to /etc/schroot/$chrootdir/fstab:
+
+$schroot_fstab
+
+These rules are for the virtual filesystems used by linux in the chroot env
+"
+
+schroot_profile="
+[$chrootdir]
+description=Debian Buster for $chrootdir
+directory=/opt/chroot/$chrootdir
+groups=sbuild-security,$SUDO_USER,users
+type=directory
+profile=$chrootdir
+"
+
+if grep -x "\[$chrootdir\]" /etc/schroot/schroot.conf; then
+    echo "Found [$chrootdir] section in /etc/schroot/schroot.conf"
+else
+    # Add chroot config to schroot.conf
+    cat <<EOF >>/etc/schroot/schroot.conf
+$schroot_profile
+EOF
+
+    echo "Adding the following $chrootdir section to /etc/schroot/schroot.conf:
+
+$schroot_profile
+
+This enables you to chroot into $chrootdir as an unprivileged user by running
+'schroot -c $chrootdir /bin/bash'
+"
+fi
+
+#!!! buster backports is needed for a lot of things
+cat << EOF > /opt/chroot/$chrootdir/etc/apt/sources.list.d/buster_backports.list
+deb http://deb.debian.org/debian buster-backports main
+deb-src http://deb.debian.org/debian buster-backports main
+EOF
+
+# oooo annoying, pin preferences for buster-backports
+# make it low pririty for reproduceability
+cat << EOF > /opt/chroot/$chrootdir/etc/apt/preferences.d/99buster-backports
+Package: *
+Pin: release a=buster-backports
+Pin-Priority: 100
+
+Package: libcurl3-gnutls
+Pin: version 7.64*
+Pin-Priority: 1001
+EOF
+
 # Install apt dependencies in the chroot
-chroot /opt/chroot/$chrootdir /bin/bash << EOF
+cd /tmp
+schroot -c $chrootdir /bin/bash --directory=/tmp << EOF
 echo Installing necessary apt dependencies in the chroot
 apt-get update -y
 apt-get upgrade -y
 apt-get install -y automake binutils-dev build-essential \
-ccache cmake gcc git \
-libtool \
-sysvinit-core \
-sysvinit-utils \
-sudo \
-python3 python3-pip \
-python3-setuptools python3-dev
+        ccache cmake gcc git \
+        libtool \
+        sysvinit-core \
+        sysvinit-utils \
+        sudo \
+        python2.7 \
+        python3 python3-pip \
+        python3-setuptools python3-dev \
+        python3-setuptools-scm
 
 # yeah systemd in a chroot? not very funny joke.
 apt-get remove -y systemd
@@ -53,7 +168,8 @@ apt-get remove -y systemd
 echo '$SUDO_USER ALL=NOPASSWD: ALL' >> /etc/sudoers.d/$chrootdir
 
 # Create user with same UID in the chroot
-useradd -m -p `python -c 'import crypt; print crypt.crypt("1234","Fx")'` -s /bin/bash $SUDO_USER -k /etc/skel
+useradd -m -p `python3 -c 'import crypt; print (crypt.crypt("1234","Fx"))'` \
+                -s /bin/bash $SUDO_USER -k /etc/skel
 echo -e "
 Added user ${SUDO_USER} with \e[1;91mpassword: 1234\e[0m"
 
@@ -72,23 +188,3 @@ chgrp $SUDO_USER /home/$SUDO_USER/.bash_profile
 
 echo -e "Added 'export PATH=/usr/lib/ccache:\"\044PATH\"\nexport DISPLAY=:0.0' to /home/$SUDO_USER/.bash_profile to speed up rebuilds"
 EOF
-
-# Add chroot config to schroot.conf
-cat <<EOF >>/etc/schroot/schroot.conf
-[$chrootdir]
-description=Debian Buster for $chrootdir
-directory=/opt/chroot/$chrootdir
-groups=sbuild-security,$SUDO_USER,users
-EOF
-
-echo "Adding the following $chrootdir section to /etc/schroot/schroot.conf:
-
-[$chrootdir]
-description=Debian Buster for $chrootdir
-directory=/opt/chroot/$chrootdir
-groups=sbuild-security,$SUDO_USER,users
-
-This enables you to chroot into $chrootdir as an unprivileged user by running
-'schroot -c $chrootdir /bin/bash'
-"
-
index 18b7b28fdfa85308a0692f2a38af1d0cedfc0784..be18e12178be5f68decdfbca8ef860dcd02a8ac0 100755 (executable)
@@ -15,9 +15,10 @@ cd /home/$SUDO_USER
 mkdir -p src/nextpnr
 cd src/nextpnr
 
-git clone --recursive https://github.com/YosysHQ/prjtrellis
+git clone --recursive -b 1.2.1 https://github.com/YosysHQ/prjtrellis
 git clone --recursive https://github.com/YosysHQ/nextpnr
 
+# prjtrellis
 cd prjtrellis
 cd libtrellis
 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/libtrellis .
@@ -25,8 +26,12 @@ make -j$(nproc)
 make install
 cd ../..
 
+# nextpnr, use a specific version for now
 cd nextpnr
+git checkout e069b3bc
 cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nextpnr-ecp5 \
+                    -DBUILD_PYTHON=OFF \
+                   -DBUILD_GUI=OFF \
                     -DARCH=ecp5 \
                     -DTRELLIS_INSTALL_PREFIX=/usr/local/libtrellis .
 make -j$(nproc)
diff --git a/nextpnr-xilinx-install b/nextpnr-xilinx-install
new file mode 100755 (executable)
index 0000000..6347b6f
--- /dev/null
@@ -0,0 +1,111 @@
+#!/bin/bash
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root using 'sudo bash'"
+  exit
+fi
+
+# change into $SUDO_USER home directory
+cd /home/$SUDO_USER
+mkdir -p src/nextpnr-xilinx
+cd src/nextpnr-xilinx
+
+apt-get install -y libcurl3-gnutls git git-man
+
+git clone https://github.com/f4pga/prjxray.git
+git clone https://github.com/SymbiFlow/prjxray-db.git
+# switch to the nextpnr-xilinx source provided by the openXC7 project
+# it seems more stable than upstream, for now
+# See: https://bugs.libre-soc.org/show_bug.cgi?id=1004#c13
+git clone https://github.com/openXC7/nextpnr-xilinx.git
+
+## Steps to compile prjxray
+
+### Necessary software to install
+
+apt-get install -y build-essential make cmake python3 python3-setuptools \
+                   python3-dev python3-numpy cython3 python3-pip
+
+pip3 install textx sortedcontainers
+
+# this really doesn't work properly, antlr is still not correctly
+# detected, (missing ANTLRconfig.cmake) but at least fasm falls back
+# to the python version
+sudo apt install -y cmake default-jre-headless uuid-dev libantlr4-runtime-dev
+
+apt-get install -y wget
+wget https://files.pythonhosted.org/packages/78/4c/94fb3bdb87bea21406c0e5da375f0b10d7b1e4b5103cea453a2de23b5d61/fasm-0.0.2.post88.tar.gz
+tar -xvzf fasm-0.0.2.post88.tar.gz
+cd fasm-0.0.2.post88
+python3 setup.py install
+cd ..
+
+### Build prjxray
+
+cd prjxray
+git checkout 76401bd93e493fd5ff4c2af4751d12105b0f4f6d
+git submodule update --init --recursive
+mkdir build; cd build
+cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nextpnr-xilinx ..
+make -j$(nproc)
+make install
+install -d -m 0755 /usr/local/nextpnr-xilinx/build/tools
+install -m 0755 tools/{bitread,bittool,frame_address_decoder,gen_part_base_yaml,segmatch,xc7frames2bit,xc7patch} \
+/usr/local/nextpnr-xilinx/build/tools
+cd ..
+cp -dpr utils /usr/local/nextpnr-xilinx
+sed -i -e '/^# Vivado /,$d' /usr/local/nextpnr-xilinx/utils/environment.sh
+python3 setup.py develop
+cd ..
+
+## Steps to compile prjxray-db
+
+### Install prjxray-db
+
+cd prjxray-db
+git archive --format=tar --prefix=database/ \
+ 0a0addedd73e7e4139d52a6d8db4258763e0f1f3 | \
+ tar -C /usr/local/nextpnr-xilinx -xf -
+cd ..
+
+## Steps to compile nextpnr-xilinx
+
+### Necessary software to install
+
+apt-get install -y libboost-thread-dev libboost-iostreams-dev \
+ libboost-program-options-dev libeigen3-dev libboost-python-dev \
+ libboost-filesystem-dev
+
+### Build nextpnr-xilinx from release 0.7.0 of openXC7
+
+cd nextpnr-xilinx
+git checkout 14c62813ba93258143c2551f4beb0b7e044c5912
+git submodule init
+git submodule update
+cmake -DARCH=xilinx -DBUILD_GUI=OFF \
+       -DCMAKE_INSTALL_PREFIX=/usr/local/nextpnr-xilinx .
+make -j$(nproc)
+make install
+
+# Generate database for fabric: XC7A100T
+ln -s xc7a100tcsg324-1 xilinx/external/prjxray-db/artix7/xc7a100t
+python3 xilinx/python/bbaexport.py --device xc7a100tcsg324-1 \
+ --bba xilinx/xc7a100t.bba
+./bbasm --l xilinx/xc7a100t.bba xilinx/xc7a100t.bin
+
+# Generate database for fabric: XC7A200T
+ln -s xc7a200tsbg484-1 xilinx/external/prjxray-db/artix7/xc7a200t
+python3 xilinx/python/bbaexport.py --device xc7a200tsbg484-1 \
+ --bba xilinx/xc7a200t.bba
+./bbasm --l xilinx/xc7a200t.bba xilinx/xc7a200t.bin
+
+install -d -m 0755 /usr/local/nextpnr-xilinx/share/xilinx
+install -m 0755 xilinx/xc7a100t.bin /usr/local/nextpnr-xilinx/share/xilinx
+install -m 0755 xilinx/xc7a200t.bin /usr/local/nextpnr-xilinx/share/xilinx
+
+export XRAY_DIR=/usr/local/nextpnr-xilinx
+cd ..
+
+cd /home/$SUDO_USER/src/nextpnr-xilinx
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .
+
index 7ed614777636ea9d2f920bb46bf21fb60c88c867..c800176cadf9e1483d1adfe2158fc1697ea9c0f9 100755 (executable)
@@ -1,14 +1,52 @@
 #!/bin/bash
-if ! command -v rustup &> /dev/null
-then
-    echo -e "Rustup could not be found, it can be installed by running the following command: curl --proto \047=https\047 --tlsv1.2 -sSf https://sh.rustup.rs | sh"
-    exit
+set -e
+if ! command -v rustup &> /dev/null; then
+    echo "Rustup could not be found, it can be installed by"
+    echo "running the following command: "
+    echo "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh" >& 2
+    exit 1
 fi
-cd /home/$USER/src
+cd ~/src
 rustup default stable
 rustup update
-cargo install maturin
-git clone https://salsa.debian.org/Kazan-team/power-instruction-analyzer.git pia
+
+# use the authorised copy controlled under the Libre-SOC git server,
+# not unauthorised uncontrolled servers (debian salsa)
+git clone https://git.libre-soc.org/git/power-instruction-analyzer.git pia
 cd pia
-maturin build --cargo-extra-args=--features=python-extension
-python3 -m pip install --user target/wheels/*.whl
+
+# do not use external scripts.
+
+function fail()
+{
+    echo "error: $@" >&2
+    exit 1
+}
+
+if [[ "$VIRTUAL_ENV" == "" ]]; then
+    user=( "--user" )
+else
+    user=()
+fi
+cargo_version="$(cargo --version)" || \
+            fail "can't find cargo, install it from https://rustup.rs/"
+[[ "$cargo_version" =~ ^'cargo 1.'([0-9]+)'.'[0-9]+' ' ]] || \
+            fail "can't parse cargo's version string"
+(( "${BASH_REMATCH[1]}" >= 53 )) || \
+            fail 'your rust version is not recent enough, update your rust version using `rustup update`'
+python3 -m pip install "${user[@]}" 'maturin>=0.11,<0.12'
+if [[ "$VIRTUAL_ENV" == "" ]]; then
+    scripts="$(python3 -m sysconfig | \
+            sed 's@^\tuserbase = "\([^"]\+\)"$@\1/bin@p; d')"
+else
+    scripts="$(python3 -m sysconfig | \
+            sed 's/^\tscripts = "\([^"]\+\)"$/\1/p; d')"
+fi
+echo "$scripts"
+[[ -d "$scripts" ]] || fail "can't find python's \`scripts\` directory"
+rm -f target/wheels/power_instruction_analyzer-*.whl
+"$scripts"/maturin build --compatibility linux \
+                         --cargo-extra-args=--features=python-extension \
+                         -i python3 --release --no-sdist
+python3 -m pip install --force "${user[@]}" \
+                         target/wheels/power_instruction_analyzer-*.whl
index 97794b75259640da97bad232263a986cd6b7e978..5f2ca95c9fff4f1752242935f2393272c03141d8 100755 (executable)
@@ -5,7 +5,9 @@ if [ "$EUID" -ne 0 ]
 fi
 
 # first install powerpc64 gcc-8 cross-compiler
-apt-get install gcc-8-powerpc64-linux-gnu wget texinfo
+apt-get -y install gcc-8-powerpc64-linux-gnu \
+                gcc-powerpc64-linux-gnu \
+                wget texinfo
 
 # it your responsibility to check that the archive downloaded below is
 # uncompromised!
diff --git a/rm-deb-chroot b/rm-deb-chroot
new file mode 100755 (executable)
index 0000000..f7a82d1
--- /dev/null
@@ -0,0 +1,69 @@
+#!/bin/bash
+if [ "$EUID" -ne 0 ]
+    then echo "Please run as root"
+    exit
+fi
+if [ -z "$1"  ]
+    then echo "Need arg $1 to specify which chroot to delete"
+    exit
+fi
+
+chrootdir="$1"
+chroot_path=/opt/chroot/$chrootdir
+chroot_config_path=/etc/schroot/$chrootdir
+
+schroot_main_config=/etc/schroot/schroot.conf
+backup_schroot_config="/tmp/schroot.conf.orig"
+sleep_time=1
+
+echo "----------------------------------------------"
+echo "WARNING! If the script finds directories:"
+echo "$chroot_path"
+echo "$chroot_config_path"
+echo "It will DELETE them!"
+echo ""
+echo "The [$chrootdir] chroot profile from:"
+echo "$schroot_main_config"
+echo "will also be removed."
+echo ""
+echo "The script will wait for $sleep_time second/s before starting"
+echo "Press Ctrl-C now to cancel."
+echo "----------------------------------------------"
+sleep $sleep_time
+
+if [ -e $chroot_path ]; then
+    echo "Deleting $chroot_path"
+    rm -rf $chroot_path
+else
+    echo "$chroot_path not found, skipping."
+fi
+
+if [ -e $chroot_config_path ]; then
+    echo "Deleting $chroot_config_path configuration directory"
+    rm -rf $chroot_config_path
+else
+    echo "$chroot_config_path not found, skipping."
+fi
+
+# Find where the entry for given scroot profile is in the file.
+# Return line number corresponding to the start.
+lin_num_start=$(grep -n "\[$chrootdir\]" $schroot_main_config | cut -d : -f 1)
+
+if [ -z $lin_num_start ]; then
+    echo "The [$chrootdir] chroot profile in $schroot_main_config does not exist"
+    echo "Skipping $schroot_main_config"
+else
+    echo "The [$chrootdir] chroot profile found in $schroot_main_config"
+    # Can't think of a good way to make this clean
+    # Assumption: the profile always ends with "profile=$chrootdir",
+    # which will indicate the last line to delete of the old chroot
+    lin_num_end=$(grep -n "profile=$chrootdir" $schroot_main_config | cut -d : -f 1)
+    lines="$lin_num_start,$lin_num_end"
+    echo "Line range to delete from $schroot_main_config: $lines"
+
+    echo "Creating backup copy of $schroot_main_config in $backup_schroot_config"
+    cp $schroot_main_config $backup_schroot_config
+    echo "Script will re-write $schroot_main_config by"
+    echo "removing the old $chrootdir profile"
+    sed -e "$lines"'d' $backup_schroot_config > $schroot_main_config
+fi
diff --git a/symbiflow-install b/symbiflow-install
new file mode 100755 (executable)
index 0000000..2527cbc
--- /dev/null
@@ -0,0 +1,372 @@
+#!/bin/bash
+# Relies on install-hdl-apt-reqs being run first
+# which has already added buster-backports (and pinned libcurl3-gnutls, sigh)
+
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root using 'sudo bash'"
+  exit
+fi
+
+# change into $SUDO_USER home directory
+cd /home/$SUDO_USER
+mkdir -p src/symbiflow
+cd src/symbiflow
+
+apt-get install -y libcurl3-gnutls/buster git/buster git-man/buster 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/oneapi-src/oneTBB.git
+git clone https://github.com/verilog-to-routing/vtr-verilog-to-routing.git
+git clone https://github.com/YosysHQ/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
+
+# debian/10 libxml2 has an integer overflow error. blech.
+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 ..
+
+## Steps to compile Yosys
+
+### Necessary software to install
+
+apt-get -t buster-backports install -y cmake # symbiflow-arch-defs needs newer 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 -v -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 ..
+
+# NOTE: Option to choose TBB and build vtr-verilog-to-routing with or
+# without or both. Set env var TBB_VTR.
+# TBB_VTR=0   --- Do not build TBB and so build vtr without TBB
+# TBB_VTR=1   --- Build TBB and build vtr with TBB only
+# TBB_VTR=2   --- Build TBB and build one vtr without TBB and another with TBB
+#                 Choose vtr without TBB as default
+# TBB_VTR=3   --- Build TBB and build one vtr without TBB and another with TBB
+#                 Choose vtr with TBB as default
+
+export TBB_VTR=0
+
+## 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
+
+[ $TBB_VTR != 0 ] && apt-get install -y libhwloc-dev
+
+### Build TBB
+
+if [ $TBB_VTR != 0 ]; then
+
+cd oneTBB
+git checkout v2020.3
+make -j$(nproc) tbb tbbmalloc tbbproxy tbbbind
+install -v -d -m 0755 /usr/local/symbiflow/oneTBB/lib
+cp -dpr include /usr/local/symbiflow/oneTBB
+install -v -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
+echo "/usr/local/symbiflow/oneTBB/lib" > /etc/ld.so.conf.d/symbiflow.conf
+ldconfig
+cd ..
+
+fi
+
+## 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
+
+if [ $TBB_VTR != 1 ]; then
+
+cd vtr-verilog-to-routing
+git checkout d15ed677472e5cc30e6b79717196ac61150652aa
+mkdir build; cd build
+cmake -DCMAKE_INSTALL_PREFIX=/usr/local/symbiflow/vtr ..
+make -j $(nproc)
+make install
+install -v -d -m 0755 /usr/local/symbiflow/share/vtr
+install -v -m 0644 ../libs/libvtrcapnproto/gen/rr_graph_uxsdcxx.capnp \
+  /usr/local/symbiflow/share/vtr
+[ $TBB_VTR == 0 ] || [ $TBB_VTR == 2 ] && \
+  export PATH=/usr/local/symbiflow/vtr/bin:$PATH
+cd ../..
+
+fi
+
+### Build vtr-tbb
+
+if [ $TBB_VTR != 0 ]; then
+
+cd vtr-verilog-to-routing
+git checkout d15ed677472e5cc30e6b79717196ac61150652aa
+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 ..
+LIBRARY_PATH=/usr/local/symbiflow/oneTBB/lib make -j $(nproc)
+LIBRARY_PATH=/usr/local/symbiflow/oneTBB/lib make install
+install -v -d -m 0755 /usr/local/symbiflow/share/vtr
+install -v -m 0644 ../libs/libvtrcapnproto/gen/rr_graph_uxsdcxx.capnp \
+  /usr/local/symbiflow/share/vtr
+# Choose either one of path for vtr-binaries
+[ $TBB_VTR == 1 ] || [ $TBB_VTR == 3 ] && \
+  export PATH=/usr/local/symbiflow/vtr-tbb/bin:$PATH
+cd ../..
+
+fi
+
+## 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 ..
+
+## 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 ..
+
+## 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 -j$(nproc)
+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 -j$(nproc)
+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 PREFIX=/usr/local/symbiflow/icestorm 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 ..
+
+## Git checkout python-fpga-interchange
+
+cd python-fpga-interchange
+git checkout 1959b40e998db987c604c0a75664ccb209df13f7
+cd ..
+
+##  Git checkout quicklogic-fasm-utils
+
+cd quicklogic-fasm-utils
+git checkout 3d6a375ddb6b55aaa5a59d99e44a207d4c18709f
+cd ..
+
+##  Git checkout quicklogic-fasm
+
+cd quicklogic-fasm
+git checkout ee546ff09b2ee25894db3f419366afaf3c4bfe32
+cd ..
+
+## Steps to compile symbiflow-arch-defs
+
+## Necessary software to install
+
+apt-get install -y nodejs npm python-pytest openocd flake8 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 \
+  python-utils==3.4.5 progressbar2 hilbertcurve==1.0.5 python-constraint \
+  parameterized yapf==0.26.0 python-sat
+
+cd symbiflow-arch-defs
+git checkout c2c0f00960baf538eb31e4c42bf5d09dca87bad7
+git submodule init
+git submodule update --init --recursive
+pip3 install ../python-fpga-interchange
+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
+
+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
+
+export VPR_NUM_WORKERS=$(nproc)
+
+mkdir build; cd build
+cmake -DUSE_CONDA=FALSE -DPRJXRAY_DB_DIR=/usr/local/symbiflow/prjxray-db \
+  -DINSTALL_FAMILIES=xc7 -DINSTALL_ARCHS=artix7_100t \
+  -DINSTALL_DEVICES=xc7a100t -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 -v -d -m 0755 /usr/local/symbiflow/share/symbiflow/arch/xc7a100t_test/xc7a100tcsg324-1
+install -v -m 0644 arty100t-full_pinmap.csv /usr/local/symbiflow/share/symbiflow/arch/xc7a100t_test/xc7a100tcsg324-1/pinmap.csv
+cd ../../../..
+
+cd /home/$SUDO_USER/src/symbiflow
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .
+
diff --git a/symbiflow-install-notes.txt b/symbiflow-install-notes.txt
new file mode 100644 (file)
index 0000000..5a73b59
--- /dev/null
@@ -0,0 +1,109 @@
+#!/bin/sh
+# Serious Amounts of Notes from attempting to install arty a7 without
+# conda.
+
+echo symbiflow-examples
+echo symbiflow-arch-defs
+echo yosys
+
+symbiflow:
+
+cython3
+
+cairosvg
+gitpython
+hilbertcurve==1.0.5
+intervaltree
+matplotlib
+numpy
+pdfminer.six
+ply
+progressbar2
+pycapnp==1.0.0b1
+pyjson5
+pytest
+python-constraint
+pyyaml
+scipy
+simplejson
+svgwrite
+termcolor
+textx
+tinyfpgab
+tinyprog
+yapf==0.26.0
+fasm
+git+https://github.com/QuickLogic-Corp/quicklogic-fasm.git#egg=quicklogic_fasm
+git+https://github.com/SymbiFlow/symbiflow-rr-graph.git#egg=rr-graph
+git+https://github.com/SymbiFlow/python-fpga-interchange.git#egg=python-fpga-interchange
+-e third_party/prjxray
+-e third_party/xc-fasm
+-e third_party/qlf-fasm
+-e third_party/python-sdf-timing
+-e third_party/python-symbiflow-v2x
+-e third_party/vtr-xml-utils
+-e third_party/symbiflow-xc-fasm2bels
+-e third_party/litex
+-e third_party/litex-boards
+-e third_party/litedram
+-e third_party/liteeth
+-e third_party/liteiclink
+-e third_party/migen
+-e quicklogic/common/utils/quicklogic-timings-importer
+third_party/pythondata-cpu-vexriscv
+third_party/pythondata-software-compiler_rt
+# Ibex dependencies
+git+https://github.com/lowRISC/edalize.git@ot
+git+https://github.com/lowRISC/fusesoc.git@ot
+mako
+
+ln -s /usr/bin/pip3 /usr/bin/pip
+apt-get install python3-pytest
+ln -s /usr/bin/pytest-3 /usr/bin/pytest
+
+
+xc7 requirements:
+
+intervaltree
+junit-xml
+numpy
+openpyxl
+ordered-set
+parse
+progressbar2
+pyjson5
+pytest
+pyyaml
+scipy>=1.2.1
+simplejson
+sympy
+textx
+yapf==0.24.0
+python-constraint
+fasm
+git+https://github.com/SymbiFlow/prjxray.git@e25c20a8f158cc5e94eb62e3b74e16fc9d6c1d26#egg=prjxray
+git+https://github.com/symbiflow/xc-fasm.git@14afc2bae24cbf6ee5e7d057a58b4cbd776358d0#egg=xc-fasm
+
+symbiflow_synth requires:
+    prjxray
+    prjxray-db
+
+    prjxray-config:
+        #!/bin/sh
+        echo /usr/share/xray/database
+
+    yosys-symbiflow-plugins
+    https://github.com/SymbiFlow/yosys-symbiflow-plugins
+        xdc
+        params
+        sdc
+        fasm
+
+    vpr (part of vtr)
+        https://github.com/verilog-to-routing/vtr-verilog-to-routing
+        https://docs.verilogtorouting.org/en/latest/building/building/
+        libeigen3-dev
+        libtbb-dev
+
+    xc7frames2bit (part of prjxray)
+        manually copied out
diff --git a/tasyagle-install b/tasyagle-install
new file mode 100755 (executable)
index 0000000..7e9d809
--- /dev/null
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+if [ "$EUID" -ne 0 ]
+  then echo "Please run as root"
+  exit
+fi
+
+apt-get install -y quilt tcsh swig libedit-dev tcl8.6-dev \
+       libmotif-dev libxpa1 libxt-dev libxpm-dev \
+       default-jre-headless default-jdk-headless \
+       libncurses5 libedit-dev \
+       libsaxon-java libsaxonb-java libservlet3.1-java fop\
+       groff # tex-live
+
+# Make sure to use the flex included with tasyagle
+apt-get remove flex
+
+mkdir -p /home/$SUDO_USER/src
+cd /home/$SUDO_USER/src
+git clone https://git.libre-soc.org/git/tas-yagle.git
+cd tas-yagle
+
+# Specify installation dir
+installDir="/usr/local"
+installDir=$installDir ./build.sh
+
+cd /home/$SUDO_USER/src
+chown -R $SUDO_USER .
+chgrp -R $SUDO_USER .
+
+STRING="source $installDir/bin/avt_env.sh"
+if  grep -q "$STRING" /home/$SUDO_USER/.bashrc ; then
+       echo 'avt_env.sh already in .bashrc'
+else
+       # Default .bashrc usually has a check if shell is
+       # interactive, so adding at the start is a workaround
+       echo 'Adding avt_env.sh to .bashrc'
+       sed -i "1i $STRING" /home/$SUDO_USER/.bashrc
+       chown -R $SUDO_USER /home/$SUDO_USER/.bashrc
+       chgrp -R $SUDO_USER /home/$SUDO_USER/.bashrc
+fi
+
+# Compile the documentation and example
+echo "Entering bash as $SUDO_USER to reload .bashrc and compile docs!"
+runuser $SUDO_USER -c "/bin/bash << EOF
+. ~/.bashrc
+cd /home/$SUDO_USER/src/tas-yagle/distrib/docxml2
+make
+cd /home/$SUDO_USER/src/tas-yagle/distrib/share/tutorials/hitas/inv
+./db.tcl
+EOF"
+
+echo "Finished tas-yagle compilation, make sure to source .bashrc!"