3 TODO: include tasyagle <https://www-soc.lip6.fr/en/team-cian/softwares/tasyagle/>
7 First set up an schroot debootstrap jail with debian 10.
8 These instructions are based on information taken from here:
9 <https://www.debian.org/releases/stretch/amd64/apds03.html.en>
11 In advance, on the host system, edit /etc/fstab and add mount points:
13 (edit: personally I prefer using mount --bind points. however if doing
14 that then after a reboot the chroot will lose the bind mountpoints
15 and the commands need to be re-run, without which the chroot is
18 /dev /home/chroot/coriolis/dev none bind 0 0
19 /dev/pts /home/chroot/coriolis/dev/pts none bind 0 0
20 /proc /home/chroot/coriolis/proc none bind 0 0
21 /sys /home/chroot/coriolis/sys none bind 0 0
22 /tmp /home/chroot/coriolis/tmp none bind 0 0
24 Then run these commands:
27 apt-get install debootstrap schroot
28 mkdir /opt/chroot/coriolis
29 /usr/sbin/debootstrap buster !$ http://ftp.us.debian.org/debian
30 mount /home/chroot/coriolis/dev
31 mount /home/chroot/coriolis/dev/pts
32 mount /home/chroot/coriolis/proc
33 mount /home/chroot/coriolis/sys
34 mount /home/chroot/coriolis/tmp
35 echo "coriolis2" > /home/chroot/coriolis/etc/debian_chroot
37 To do some preparation (users):
39 chroot /home/chroot/coriolis2 /bin/bash
40 adduser {yourpreferredusername}
42 It is best to make the username the same as the first user that
43 was added during the *main* (non-chroot) debian install, so that
44 uid 1000 matches between both main and chroot. You can check
45 this by looking at /etc/passwd as root, or by typing "id".
48 uid=1000(lkcl) gid=1000(lkcl) groups=1000(lkcl),5(tty),....
50 Alternatively, /etc/passwd and /etc/group may
51 be mount-bound as well as /home however if you later forget you did
52 this and decide to delete the chroot, you will delete the entire /home
53 of your main system, as well as /etc/passwd.
55 You may wish to follow some of the other things such as configuring apt,
56 locales and keyboard, from the above-linked debian-admin HOWTO.
58 bootloader, kernel, ssh access, are unnecessary. Do run "apt clean" to clear out /var/cache/apt/archives in the chroot.
62 Create an schroot file section for the coriolis chroot by
63 editing /etc/schroot/schroot.conf:
66 description=Debian Buster for Coriolis
67 directory=/home/chroot/coriolis
68 groups=sbuild-security,lkcl,users
70 Now as an *ordinary* user - not as root - you may type:
72 lkcl@fizzy:~$ schroot -c coriolis
74 and, due to the contents of /etc/debian\_chroot, and that you were in
75 fact logged in as uid 1000 and did in fact add a user to the chroot
76 as uid 1000, the prompt should become:
78 (coriolis2)lkcl@fizzy:~$
80 If however you need to run as root, then from outside the chroot,
81 as *root*, you run this:
83 lkcl@fizzy:~# schroot -c coriolis
85 and you will see this as a result:
87 (coriolis2)lkcl@fizzy:~#
91 These are nominally taken from
92 <https://www-soc.lip6.fr/equipe-cian/logiciels/coriolis/>
93 however there are errors in the original at the moment.
94 Do not try qt5, it will not work.
96 In ~/.bash\_profile add the following so that builds (rebuilds) if you need
97 them will be quicker, and you can run the GUI from the chroot:
99 export PATH=/usr/lib/ccache:"$PATH"
102 Second (or at a new terminal / xterm), log in as root on the host (not the chroot) then do schroot -c coriolis to get to be root in the chroot (or, you can install sudo in the chroot and then do "sudo bash" in the chroot).
104 Then run the following commands, as root, *in* the chroot:
107 apt-get install -y automake binutils-dev bison build-essential \
108 ccache clang cmake doxygen dvipng flex gcc git graphviz \
109 imagemagick libboost-all-dev libboost-python-dev libbz2-dev \
110 libmpfr-dev libgmp-dev libmotif-dev libreadline-dev \
111 libqwt-dev libtool libx11-dev libxaw7-dev libxml2-dev \
112 libxpm-dev libxt-dev python3.7 python3-jinja2 python3-pip \
113 python3-setuptools python-dev python-qt4 python-sphinx \
114 qt4-dev-tools rapidjson-dev tcl tcl-dev tcl-tclreadline \
115 texlive texlive-fonts-extra texlive-lang-french \
116 texlive-latex-extra texlive-pictures xfig yosys zlib1g-dev
118 Then, as the ordinary (non-root) user in the schroot:
120 mkdir -p ~/coriolis-2.x/src
121 cd ~/coriolis-2.x/src
122 git clone https://gitlab.lip6.fr/vlsi-eda/coriolis.git
125 ./bootstrap/ccb.py --project=coriolis --make="-j$(nproc) install"
127 To set up the coriolis2 environment, run this:
129 eval `~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py`
131 For convenience that may be placed in a file and "sourced", to avoid
132 having to look this page up every time
134 echo "`~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py`" > \
140 To run the graphical editor go to the bin directory
142 cd ~/coriolis-2.x/Linux.MyARCH/Release.Shared/install/bin
145 Then run the following commands from the menubar
147 Tutorials / Run Demo (Python Flavour)
149 If the following window appears you have an error.
151 [[!img chicken.png ]]
153 click on the chicken several times
155 If you have the following, congratulations:
157 [[!img demo_cell.png ]]
159 # Upgrading to latest yosys in the chroot
161 yosys in debian may not be enough to work with nmigen,
162 therefore it's probably a good idea to upgrade.
164 As root, in the chroot, run the following:
167 apt-get build-dep yosys
168 apt-get install clang
171 This will remove debian/buster yosys however getting the build dependencies is quick and easy enough.
173 As the ordinary user, the following instructions can be followed
174 (<http://www.clifford.at/yosys/download.html>)
177 git clone https://github.com/cliffordwolf/yosys.git
186 ## Check out alliance
188 Adapted from <https://www-soc.lip6.fr/en/team-cian/softwares/alliance/>
190 In the chroot, as the ordinary schroot user, in ~/.bash\_profile add the following so that builds (rebuilds, if you need them) will be quicker:
192 export PATH=/usr/lib/ccache:"$PATH"
194 In the chroot, as the ordinary schroot user:
196 mkdir -p alliance/build alliance/install
198 git clone https://gitlab.lip6.fr/vlsi-eda/alliance.git
199 mv alliance/alliance/src alliance
200 rm -rf alliance/alliance
204 export ALLIANCE_TOP=$HOME/alliance/install
205 export LD_LIBRARY_PATH=${ALLIANCE_TOP}/lib:${LD_LIBRARY_PATH}
206 export LD_LIBRARY_PATH=${ALLIANCE_TOP}/lib64:${LD_LIBRARY_PATH}
207 ../alliance/src/configure --prefix=$ALLIANCE_TOP --enable-alc-shared
210 The three exports are best added to ~/.bash_profile for later convenience
212 # Tutorials and checks
214 Install alliance-check-toolkit in the chroot:
216 * <https://gitlab.lip6.fr/vlsi-eda/alliance-check-toolkit.git>
217 * See coriolis-2.x/Linux.x86_64/Release.Shared/install/share/doc/coriolis2/en/html/main/PythonTutorial/index.html
219 Run the following (if not done already):
223 Git clone alliance-check-toolkit:
225 git clone https://gitlab.lip6.fr/vlsi-eda/alliance-check-toolkit.git
227 You must create a configuration for your user in alliance-check-toolkit to define where the various tools are installed:
229 touch alliance-check-toolkit/etc/mk/users.d/user-$USERNAME.mk
230 cat <<EOF >>alliance-check-toolkit/etc/mk/users.d/user-$USERNAME.mk
231 export CORIOLIS_TOP=/home/$USERNAME/coriolis-2.x/Linux.x86_64/Release.Shared/install
232 export ALLIANCE_TOP=/home/$USERNAME/alliance/install
233 export CHECK_TOOLKIT=/home/$USERNAME/alliance-check-toolkit
234 export YOSYS_TOP=/home/$USERNAME/yosys
237 You can try the ARM in alliance-check-toolkit:
239 cd alliance-check-toolkit/benchs/ARM/cmos/
242 This should take about five minutes. It's symbolic, but should be a configuration compatible with 180nm. To actually see the results:
248 Select File -> Open Cell or press CTRL + o
250 Enter as the cell name (without the single quotation marks):
254 As a very rough approximation, you can say that one lambda equals 180nm.
256 It depends on the zoom level and of the fact that you ask to see the inside of the cells.
258 To actually see the transistors:
260 Tools -> Controller -> Filter Tab -> check "Process Terminal Cells"
262 You can also tweak the layer display by selecting:
264 Tools -> Controller -> Layers & Go
266 You can quicly hide/show the Controller with:
270 The up-to-date documentation is supplied directly in the Coriolis repository:
272 coriolis/documentation/output/index.html
274 The links toward the doxygen doc will be invalid a this point, but everything else works.
276 After installation, it is put in:
278 coriolis-2.x/Linux.x86_64/Release.Shared/install/share/doc/coriolis2/en/html/index.html
280 ## More Information from Jean-Paul
282 There is a WIP documentation website for Alliance/Coriolis at <http://coriolis.lip6.fr/>.
284 There are also very cursory informations about installing Alliance here:
285 https://www-soc.lip6.fr/en/team-cian/softwares/alliance/
287 You also have a third repository for various blocks/chip/examples here:
288 https://gitlab.lip6.fr/jpc/alliance-check-toolkit
290 (with a basic doc under "doc/"...)
292 # Clone "soclayout" repository and place and route a layout experiment
294 In order to do the physical layout of the logical
295 netlists generated by yosys we use coriolis and
296 alliace installed above by doing the following
297 (using experiment9 as an example):
300 $ git clone https://git.libre-soc.org/git/soclayout.git
302 $ git submodule update --init --recursive
303 $ find . -type f -exec sed -i 's/'lkcl'/'"$USER"'/g' {} \;
308 yosys> read_ilang test_issuer.il
309 yosys> heirarchy -check -top test_issuer
310 yosys> synth -top test_issuer
311 yosys> dfflibmap -liberty /home/USERNAME/alliance/install/cells/sxlib/sxlib.lib
312 yosys> abc -liberty /home/USERNAME/alliance/install/cells/sxlib/sxlib.lib
314 yosys> write_blif test_issuer.blif
317 $ make layout (will take between 20min and 2 hours depending on your hardware)
320 A window should open with with contents that look like this (pretty isn't it?)
322 [[!img 180nm_Oct2020/2020-07-03_11-04.png size="825x" ]]
324 # Issues running from (e.g.) archlinux as host and debian as a chroot
326 You may run into difficulties firing up GUI applications from the chroot.
327 Try installing Xnest <https://box.matto.nl/xnest.html> which you should
328 do in the *host* system. Also remember to install a "basic" window manager
331 On the *host*, run Xnest and a window manager:
336 Then, in the chroot, change DISPLAY environment variable (permanently
337 in ~/.bash_profile if desired)
341 Then, in the chroot, follow the cgt instructions above, or use "make view"
342 in any of the soclayout experiments or alliance-check-toolkit bench tests
344 # Libre-SOC 180nm ASIC reproducible build<a name="ls180_repro_build"></a>
348 * machine with debian/10 (or if you absolutely must, ubuntu)
350 * minimum XEON processor or Intel i9 or IBM POWER9
351 * enough time to complete the build in full
352 * around 50 GB free space (this is more than enough)
354 **WARNING! DO NOT TRY RUNNING CORIOLIS2 IN QEMU OR OTHER VM!**
355 VLSI builds are far too CPU and memory intensive.
357 Follow these instructions to build the ls180 GDS-II files
359 * clone the dev-env-setup repository
360 * run the coriolis2-chroot script as root
361 * drop into the schroot
362 * navigate to the soclayout/experiments9 directory
363 * run the ./build_full_4k_sram.sh script
364 * run "make view" to see the results.
366 The FreePDK45 Chips4Makers FlexLib variant is slightly
367 different, in that it builds GDS-II rather than Alliance Symbolic
368 and so requires klayout to view the GDS-II. We do not yet
369 have a build script for klayout, it will be in dev-env-setup
370 when it is. In the meantime you can follow instructions
371 on the website <https://klayout.de/>
373 Please check these scripts before running them.
374 **This is your responsibility**. Also as explained in
375 the [[HDL_workflow]] the standard OS for reproducible
376 builds is debian/10. It is just about possible to use
377 ubuntu to run the debootstrap chroot setup but it is
383 $ git clone https://git.libre-soc.org/git/dev-env-setup.git
388 $ schroot -c cotiolis
389 $ cd soclayout/experiments9
390 $ ./build_full_4k_sram.sh
392 (now do something else for the next 90 minutes)