1 # name of user running script
3 echo "Checking whoami for current user"
4 then SUDO_USER=$(whoami)
6 echo "Current SUDO_USER=$SUDO_USER"
8 # Install apt dependencies
9 echo Installing necessary apt dependencies in the chroot
10 sudo apt-get update -y
11 sudo apt-get upgrade -y
12 sudo apt-get install -y automake binutils-dev bison build-essential \
13 sysvinit-utils sysvinit-core \
14 ccache clang cmake doxygen dvipng flex gcc git graphviz \
15 imagemagick libboost-all-dev libboost-python-dev libbz2-dev \
16 libmpfr-dev libgmp-dev libmotif-dev libreadline-dev \
17 libqwt-dev libtool libx11-dev libxaw7-dev libxml2-dev \
18 python2.7 python2.7-dev \
19 libxpm-dev libxt-dev python3.7 python3-jinja2 python3-pip \
20 python3-setuptools python-dev python-qt4 python-sphinx \
21 qt4-dev-tools rapidjson-dev tcl tcl-dev tcl-tclreadline \
22 texlive texlive-fonts-extra texlive-lang-french \
23 texlive-latex-extra texlive-pictures xfig zlib1g-dev
25 # Add convenience variable to chroot user .bash_profile
26 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
28 chown $SUDO_USER /home/$SUDO_USER/.bash_profile
29 chgrp $SUDO_USER /home/$SUDO_USER/.bash_profile
31 echo -e "Added 'export PATH=/usr/lib/ccache:\"\044PATH\"\nexport DISPLAY=:0.0' to /home/$SUDO_USER/.bash_profile to speed up rebuilds"
33 # Build and install yosys from source
34 # note that a specific version of yosys is needed for ls180 at the moment
35 echo "deb-src http://ftp.debian.org/debian buster main" > /etc/apt/sources.list.d/bustersrc.list
36 sudo apt-get update -y
37 sudo apt-get build-dep yosys -y
40 git clone https://github.com/cliffordwolf/yosys.git
42 git checkout 049e3abf9baf795e69b9ecb9c4f19de6131f8418
46 cd /home/$SUDO_USER/yosys
49 # Install coriolis2 from source
52 mkdir -p /home/$SUDO_USER/coriolis-2.x/src
53 cd /home/$SUDO_USER/coriolis-2.x/src
54 git clone https://gitlab.lip6.fr/vlsi-eda/coriolis.git
57 ./bootstrap/ccb.py --project=coriolis --make="-j$(nproc) install"
59 # Setup and test coriolisenv
60 /home/$SUDO_USER/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py > /home/$SUDO_USER/coriolisenv
61 source /home/$SUDO_USER/.bash_profile
62 source /home/$SUDO_USER/coriolisenv
64 # Install alliance from source
67 git clone https://gitlab.lip6.fr/vlsi-eda/alliance.git
68 mkdir -p /home/$SUDO_USER/alliance/build /home/$SUDO_USER/alliance/install
69 mv alliance/alliance/src alliance
70 rm -rf alliance/alliance
73 cd /home/$SUDO_USER/alliance/build
74 ../src/configure --prefix=/home/$SUDO_USER/alliance/install --enable-alc-shared
76 cd /home/$SUDO_USER/alliance/build
77 source /home/$SUDO_USER/coriolisenv
80 # Install and configure alliance-check-toolkit
82 git clone https://gitlab.lip6.fr/vlsi-eda/alliance-check-toolkit.git
84 touch alliance-check-toolkit/etc/mk/users.d/user-$SUDO_USER.mk
85 cat <<EOG >>alliance-check-toolkit/etc/mk/users.d/user-$SUDO_USER.mk
86 export CORIOLIS_TOP=/home/$SUDO_USER/coriolis-2.x/Linux.x86_64/Release.Shared/install
87 export ALLIANCE_TOP=/home/$SUDO_USER/alliance/install
88 export CHECK_TOOLKIT=/home/$SUDO_USER/alliance-check-toolkit
89 export YOSYS_TOP=/home/$SUDO_USER/yosys
91 source /home/$SUDO_USER/.bash_profile
92 cd alliance-check-toolkit/benchs/ARM/cmos
95 \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
99 cd /home/$SUDO_USER/src/nextpnr
100 chown -R $SUDO_USER .
101 chgrp -R $SUDO_USER .