Thoses installation instructions are for the complete design flow, which comprise the following components:
Software | Design flow part |
---|---|
nMigen | hdl language in Python |
Yosys | Logic synthesis |
Alliance | Full cad flow, partially replaced |
Coriolis | Physical synthesis (mainly P&R) |
alliance-check-toolkit | Examples & regression tests |
To install a specific components, installation instructions are available here:
Thoses installation instructions are based on Libre-SOC Coriolis2 installation.
In this case, we will setup a Debian 10 buster installation of Alliance/Coriolis under a Scientific Linux 7 os. This should also work for rhel or CentOS.
Debian 10 will be referred as the guest OS or the chrooted. Scientific Linux will be referred as the host OS.
We need the debootstrap and schroot packages (from the epel repository).
root@pc:~# yum install debootstrap schroot
In this case, both guest OS (chrooted) and host OS are Debian.
Installing the pre requisite packages:
root@pc:~# apt-get install debootstrap schroot
On the host os, as the root user, create the directory into which the whole chrooted os will reside:
root@pc:~# mkdir -p /home/chroot/debian10.coriolis
root@pc:~# debootstrap buster /home/chroot/debian10.coriolis http://ftp.us.debian.org/debian
root@pc:~# echo "debian10.coriolis" > /home/chroot/debian10.coriolis/etc/debian_chroot
Then, we need to give access the chrooted distribution to some kernel filesystem of the host, namely dev, proc, sys & tmp. On the host filesytem, add to /etc/fstab:
# Your host normal mounts.
# ...
# For Jail chroot of Debian10.
/dev /home/chroot/debian10.coriolis/dev none bind 0 0
/dev/pts /home/chroot/debian10.coriolis/dev/pts none bind 0 0
/proc /home/chroot/debian10.coriolis/proc none bind 0 0
/sys /home/chroot/debian10.coriolis/sys none bind 0 0
/tmp /home/chroot/debian10.coriolis/tmp none bind 0 0
Mount them:
root@pc:~# mount -a
Note
The mount -a must be issued after each reboot in order for the chrooted system to be kept usable.
Edit /etc/schroot.d/schroot.conf as follow:
[debian10.coriolis]
description=Debian 10 buster
directory=/home/chroot/debian10.coriolis
users=ego
Note
Users in the schrooted environment. They must exists on both the host system and in the chrooted one. It is best if they also have the same uid / gid and home directories (relative to their respectives root). For example, for a ego user:
On the Host | In the chrooted os |
---|---|
/home/ego | N/A |
/home/chroot/debian10.coriolis/home/ego | /home/ego |
Now that schroot is set, we can log in the guest os as root and add the minimal needed package set to build Alliance / Coriolis.
root@pc:~# schroot -c debian10.coriolis -u root
(debian10.coriolis)root@pc:~# export DEBIAN_FRONTEND=noninteractive
(debian10.coriolis)root@pc:~# apt-get update
(debian10.coriolis)root@pc:~# apt-get -y install build-essential binutils-dev \
git cmake bison flex gcc python-dev \
libboost-all-dev libboost-python-dev \
zlib1g-dev libxml2-dev rapidjson-dev \
libbz2-dev \
qt4-dev-tools libqwt-dev python-qt4 \
autotools-dev automake \
libxt-dev libxpm-dev libmotif-dev \
python3-setuptools \
transfig texlive texlive-latex-extra \
texlive-plain-generic texlive-pictures \
imagemagick \
yosys \
vim
(debian10.coriolis)root@pc:~# apt-get clean
As stated before, we must create in the guest os a user that also exist on the host os, and with the same uid and home directory. Here we assume that ego has an uid of 20000.
(debian10.coriolis)root@pc:~# adduser --uid 20000 ego
Adding user `ego' ...
Adding new group `ego' (20000) ...
Adding new user `ego' (20000) with group `ego' ...
Creating home directory `/home/ego' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for ego
Enter the new value, or press ENTER for the default
Full Name []: Me Myself and I
Room Number []: 404
Work Phone []: 666 666 666
Home Phone []: 3615
Other []:
Is the information correct? [Y/n] Y
(debian10.coriolis)root@pc:~#
Download the installer script: socInstaller.py. And put it in the home directory of the user ego in the guest os.
Note
As it is more easier to download it from the host os, you may do so and just copy it under /home/chroot/debian10.coriolis/home/ego. As they share the same uid, the copy is allowed.
Now we can connect as the ego user on the guest os and run the installer. The installer should take care of everything: clone all the repositories then build & install. You may take a coffee break...
ego@pc:~> schroot -c debian10.coriolis -u ego
(debian10.coriolis)jpc@pc:~> chmod u+x ./socInstaller.py
(debian10.coriolis)jpc@pc:~> ./socInstaller.py --chroot --profile=Debian10 \
--do-alliance --do-coriolis
To run the regression tests of alliance-check-toolkit you need to create a user's configuration file that describe where the tools are installed. The filename is derived from the login of the user:
${HOME}/coriolis-2.x/src/alliance-check-toolkit/etc/mk/users.d/user-LOGIN.mk
For our ego user, this gives:
${HOME}/coriolis-2.x/src/alliance-check-toolkit/etc/mk/users.d/user-ego.mk
The content of the file (which is part of a Makefile) is:
DEBUG_OPTION =
BUILD_TYPE_DIR = Release.Shared
export CORIOLIS_TOP = $(HOME)/coriolis-2.x/$(BUILD_VARIANT)$(LIB_SUFFIX_)/$(BUILD_TYPE_DIR)/install
export ALLIANCE_TOP = $(HOME)/coriolis-2.x/$(BUILD_VARIANT)$(LIB_SUFFIX_)/$(BUILD_TYPE_DIR)/install
export CHECK_TOOLKIT = $(HOME)/coriolis-2.x/src/alliance-check-toolkit
export YOSYS_TOP = /usr
For a complete description of the toolkit see Alliance Check Toolkit.
Finally, to avoid setting up the Alliance / Coriolis environment each time you log into the ego chrooted account, add the two following lines at the end of the ~/.bashrc file (in the ego chrooted account).
. ${HOME}/coriolis-2.x/Linux.el7_64/Release.Shared/install/etc/profile.d/alc_env.sh
evel `${HOME}/coriolis-2.x/Linux.el7_64/Release.Shared/install/etc/coriolis2/coriolisEnv.py`
As a prerequisite, you must have docker installed and the ego user must be part of its unix group (Docker CE for CentOS)
To avoid rebuilding everything, everytime, we split build three images, each one on top of the last:
Note
There is a chicken and egg effect, as you need to clone the Coriolis repository to get the docker configuration files and scripts, which, in turn will clone again inside the docker image of Coriolis.
Docker configuration files are provided for:
ego@pc:~> mkdir -p ~/coriolis-2.x/src
ego@pc:~> cd ~/coriolis-2.x/src
ego@pc:src> git clone https://gitlab.lip6.fr/jpc/coriolis.git
ego@pc:src> cd coriolis/bootstrap/docker/debian-10
ego@pc:debian-10> ../../dockerManage.sh -scb # Build images.
ego@pc:debian-10> ../../dockerManage.sh -r # Run shell container.