add cesar
[libreriscv.git] / HDL_workflow / coriolis2.mdwn
index 41c9317a297f6b09f0fddb04a4367d8d9e388ffd..6f612f76a57f3e338fd388ae418b1de0076c1741 100644 (file)
 # Installing Coriolis2
 
-TODO: include tasyagle <https://www-soc.lip6.fr/en/team-cian/softwares/tasyagle/>
-
-## NEW IN PROGRESS - Automated Installation
-The new automated method of installing/setting coriolis2 is as follows:
-1. Clone the repo "dev-env-setup". Tutorial assumes the directory is located under your user's home.
-2. Run the script "mk-deb-chroot" to create a chroot environment. Tutorial assumes the name is "libresoc"
-3. Run the script "cp-scripts-to-chroot" to copy the dev-env-setup directory over to your new chroot environment.
-4. Login into the new scroot environment as a normal user (should be the same as your current user).
-5. Run the script "coriolis-install"
-6. Once cgt window appears, go to File, Open Cell, and type chip_r.
-7. You should now have a working Coriolis environment!
-
-In a terminal:
+Videos and links:
+
+* <https://www.youtube.com/watch?v=TN9AQgoVwDw&list=PLj2N46Uqs4huGN-redGHVEILPz17OBu37&index=11>
+* <http://coriolis.lip6.fr/>
+* <https://gitlab.lip6.fr/vlsi-eda>
+* <https://www.youtube.com/watch?v=C0diiTc7_VI&list=PLBtNqZjUZB80uByfZVm0gGYEtmTG0mZzm&index=5>
+* <https://www.youtube.com/watch?v=e0ATrAlNzWk>
+* <https://fosdem.org/2022/schedule/event/coriolis2/>
+* <https://archive.fosdem.org/2021/schedule/event/alliance/>
+* <https://www.youtube.com/watch?v=TN9AQgoVwDw>
+* HiTas (tasyagle) page: [[tasyagle]]
+
+## Automated Installation - One-liner
+
+The new automated method of installing/setting up Coriolis2 is as follows:
+
+1. Clone the repo "dev-env-setup".
+  <https://git.libre-soc.org/?p=dev-env-setup.git;a=summary>
+  Tutorial assumes the directory is located under user's home.
+2. Run the script "coriolis2-chroot" to create a new chroot environment,
+   and setup Coriolis2.
+3. Once cgt window appears, go to File, Open Cell, and type chip_r.
+4. You should now have a working Coriolis chroot!
+
+In a terminal (of course you checked what this does before running
+it because it is "commands downloaded off the internet", and you
+of course take absolute and complete and full responsibility):
+
+    $ git clone https://git.libre-soc.org/git/dev-env-setup.git
     $ cd ~/dev-env-setup
     $ sudo bash
-    # ./mk-deb-chroot libresoc
-    # ./cp-scripts-to-chroot libresoc
-
-In a separate terminal as normal user:
-    $ scroot -c libresoc
-    (libresoc)$ cd ~/dev-env-setup
-    (libresoc)$ ./coriolis-install
+    # ./coriolis2-chroot
 
-And now you wait...I suggest occasionally checking the status messages, especially after apt finished updating the packages and the script moves on to compiling yosys, coriolis2, alliance, as well as when alliance-check-toolkit generates the floorplan for you.
+And now you wait... (about 30-45min, depends on your CPU). 
+I suggest occasionallly checking the status messages, 
+especially after apt finished updating the packages and the script moves on 
+to compiling yosys, coriolis2, alliance, as well as when 
+alliance-check-toolkit generates the floorplan for you.
 
 This is what the chip floorplan should look like:
 
-[[!img chip_r_flooplan.png ]]
-
-# Sections to be updated...
-
-
-## debootstrap
-
-First set up an schroot debootstrap jail with debian 10.
-These instructions are based on information taken from here:
-<https://www.debian.org/releases/stretch/amd64/apds03.html.en>
-
-In advance, on the host system, edit /etc/fstab and add mount points:
-
-(edit: personally I prefer using mount --bind points.  however if doing
-that then after a reboot the chroot will lose the bind mountpoints
-and the commands need to be re-run, without which the chroot is
-unusable)
-
-    /dev    /home/chroot/coriolis/dev   none    bind    0   0
-    /dev/pts /home/chroot/coriolis/dev/pts  none    bind    0   0
-    /proc   /home/chroot/coriolis/proc  none    bind    0   0
-    /sys    /home/chroot/coriolis/sys   none    bind    0   0
-    /tmp    /home/chroot/coriolis/tmp   none    bind    0   0
-
-Then run these commands:
-
-    sudo bash
-    apt-get install debootstrap schroot
-    mkdir /opt/chroot/coriolis
-    /usr/sbin/debootstrap buster !$ http://ftp.us.debian.org/debian
-    mount /home/chroot/coriolis/dev
-    mount /home/chroot/coriolis/dev/pts
-    mount   /home/chroot/coriolis/proc
-    mount   /home/chroot/coriolis/sys
-    mount   /home/chroot/coriolis/tmp
-    echo "coriolis2" > /home/chroot/coriolis/etc/debian_chroot
-
-To do some preparation (users):
+[[!img chip_r_floorplan.png ]]
 
-    chroot /home/chroot/coriolis2 /bin/bash
-    adduser {yourpreferredusername}
+## Automated Installation - Separated Steps
+The steps performed by "coriolis2-chroot" can be done manually and are:
 
-It is best to make the username the same as the first user that
-was added during the *main* (non-chroot) debian install, so that
-uid 1000 matches between both main and chroot.  You can check
-this by looking at /etc/passwd as root, or by typing "id".
+1. Run the script "mk-deb-chroot" to create a chroot environment.
+Tutorial assumes the name is "coriolis"
+1. Run the script "cp-scripts-to-chroot" to copy the dev-env-setup directory 
+over to your new chroot environment.
+1. Login into the new scroot environment as a normal user 
+(should be the same as your current user).
+1. Run the script "coriolis-install"
 
-    lkcl@fizzy:~$ id
-    uid=1000(lkcl) gid=1000(lkcl) groups=1000(lkcl),5(tty),....
-
-Alternatively, /etc/passwd and /etc/group may
-be mount-bound as well as /home however if you later forget you did
-this and decide to delete the chroot, you will delete the entire /home
-of your main system, as well as /etc/passwd.
-
-You may wish to follow some of the other things such as configuring apt,
-locales and keyboard, from the above-linked debian-admin HOWTO.
-
-bootloader, kernel, ssh access, are unnecessary. Do run "apt clean" to clear out /var/cache/apt/archives in the chroot.
-
-## schroot
-
-Create an schroot file section for the coriolis chroot by
-editing /etc/schroot/schroot.conf:
-
-    [coriolis]
-    description=Debian Buster for Coriolis
-    directory=/home/chroot/coriolis
-    groups=sbuild-security,lkcl,users
+In a terminal:
 
-Now as an *ordinary* user - not as root - you may type:
+    $ cd ~/dev-env-setup
+    $ sudo bash
+    # ./mk-deb-chroot coriolis
+    # ./cp-scripts-to-chroot coriolis
 
-    lkcl@fizzy:~$ schroot -c coriolis
+In a separate terminal as normal user:
 
-and, due to the contents of /etc/debian\_chroot, and that you were in
-fact logged in as uid 1000 and did in fact add a user to the chroot
-as uid 1000, the prompt should become:
+    $ scroot -c coriolis
+    (coriolis)$ cd ~/dev-env-setup
+    (coriolis)$ ./coriolis-install
 
-    (coriolis2)lkcl@fizzy:~$
+# Further Details
 
-If however you need to run as root, then from outside the chroot,
-as *root*, you run this:
+## Python3 Coriolis Support
 
-    lkcl@fizzy:~# schroot -c coriolis
+A separate script will be written to use the latest development version of Coriolis2. 
+For now however, a stable version is pulled in, which still uses Python2.
 
-and you will see this as a result:
+## Chroot/Jail Environment
 
-    (coriolis2)lkcl@fizzy:~#
+See [[devscripts]] for explanation of the "mk-deb-chroot" script.
 
-## coriolis2
+## Coriolis2 Setup
 
 These are nominally taken from
 <https://www-soc.lip6.fr/equipe-cian/logiciels/coriolis/>
@@ -151,9 +113,12 @@ Then, as the ordinary (non-root) user in the schroot:
     cd ~/coriolis-2.x/src
     git clone https://gitlab.lip6.fr/vlsi-eda/coriolis.git
     cd coriolis
-    git checkout devel
+    git checkout LS180_RC7_FINAL
     ./bootstrap/ccb.py --project=coriolis --make="-j$(nproc) install"
 
+Note: Instead of "devel", "LS180_RC7_FINAL" is used as it is more stable.
+Once Python3 support is added, can switch to using "devel".
+
 To set up the coriolis2 environment, run this:
 
     eval `~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py`
@@ -161,10 +126,13 @@ To set up the coriolis2 environment, run this:
 For convenience that may be placed in a file and "sourced", to avoid
 having to look this page up every time
 
-    echo "`~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py`" > \
-            ~/coriolisenv
+    /bin/bash << EOF
+    /home/$USER/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py > /home/$USER/coriolisenv
+    EOF
     source ~/coriolisenv
 
+For now a workaround must be used for coriolisEnv.py to correctly detect the shell (Bash in this case).
+
 ## Testing coriolis2
 
 To run the graphical editor go to the bin directory
@@ -201,19 +169,22 @@ As root, in the chroot, run the following:
 This will remove debian/buster yosys however getting the build dependencies is quick and easy enough.
 
 As the ordinary user, the following instructions can be followed
-(<http://www.clifford.at/yosys/download.html>)
+(<https://github.com/YosysHQ/yosys>)
 
     cd ~
-    git clone https://github.com/cliffordwolf/yosys.git
+    git clone https://github.com/YosysHQ/yosys
     cd yosys
+    git checkout 049e3abf9baf795e69b9ecb9c4f19de6131f8418
     make config-clang
     make -j$(nproc)
 
+Note: For now a stable version of yosys is used!
+
 As root, run:
 
     make install
 
-## Check out alliance
+## Alliance
 
 Adapted from <https://www-soc.lip6.fr/en/team-cian/softwares/alliance/>
 
@@ -264,9 +235,9 @@ You must create a configuration for your user in alliance-check-toolkit to defin
     export YOSYS_TOP=/home/$USERNAME/yosys
     EOF
 
-You can try the ARM in alliance-check-toolkit:
+You can try the user adder benchmark in alliance-check-toolkit:
 
-    cd alliance-check-toolkit/benchs/ARM/cmos/
+    cd alliance-check-toolkit/benchs/adder/cmos
     make lvx
 
 This should take about five minutes. It's symbolic, but should be a configuration compatible with 180nm. To actually see the results:
@@ -279,7 +250,7 @@ Then:
 
 Enter as the cell name (without the single quotation marks):
 
-    'arm_chip_cts_r'
+    'chip_r'
 
 As a very rough approximation, you can say that one lambda equals 180nm.
 
@@ -326,6 +297,7 @@ netlists generated by yosys we use coriolis and
 alliace installed above by doing the following 
 (using experiment9 as an example):
 
+    $ source ~/coriolisenv  # if not done already
     $ cd ~/src
     $ git clone https://git.libre-soc.org/git/soclayout.git
     $ cd soclayout/
@@ -390,7 +362,9 @@ Follow these instructions to build the ls180 GDS-II files
 * run the coriolis2-chroot script as root
 * drop into the schroot
 * navigate to the soclayout/experiments9 directory
-* run the ./build_full_4k_sram.sh script
+* check out the final tag
+  <https://git.libre-soc.org/?p=soclayout.git;a=tag;h=refs/tags/LS180_RC8_FINAL>
+* run the ./build_full_4k_sram_recon.sh script
 * run "make view" to see the results.
 
 The FreePDK45 Chips4Makers FlexLib variant is slightly
@@ -415,9 +389,11 @@ $ cd dev-env-setup
 $ sudo bash
 # ./coriolis2-chroot
 # exit
-$ schroot -c cotiolis
+$ schroot -c coriolis
+$ source ~/coriolisenv
 $ cd soclayout/experiments9
-$ ./build_full_4k_sram.sh
+$ git checkout LS180_RC8_FINAL
+$ ./build_full_4k_sram_recon.sh
 ```
 (now do something else for the next 90 minutes)