(no commit message)
[libreriscv.git] / HDL_workflow / coriolis2.mdwn
1 # Installing Coriolis2
2
3 ## debootstrap
4
5 First set up an schroot debootstrap jail with debian 9.0.
6 Follow these instructions taken from here:
7 <https://www.debian.org/releases/stretch/amd64/apds03.html.en>
8
9 In advance, edit /etc/fstab and add mount points: personally I prefer using
10 mount --bind points
11
12 /dev /home/chroot/coriolis/dev none bind 0 0
13 /dev/pts /home/chroot/coriolis/dev/pts none bind 0 0
14 /proc /home/chroot/coriolis/proc none bind 0 0
15 /sys /home/chroot/coriolis/sys none bind 0 0
16 /tmp /home/chroot/coriolis/tmp none bind 0 0
17
18 Then run these commands:
19
20 sudo bash
21 apt-get install debootstrap schroot
22 mkdir /opt/chroot/coriolis
23 /usr/sbin/debootstrap stretch !$ http://ftp.us.debian.org/debian
24 mount /home/chroot/coriolis/dev
25 mount /home/chroot/coriolis/dev/pts
26 mount /home/chroot/coriolis/proc
27 mount /home/chroot/coriolis/sys
28 mount /home/chroot/coriolis/tmp
29 echo "coriolis2" > /home/chroot/coriolis/etc/debian_chroot
30
31 To do some preparation (users):
32
33 chroot /home/chroot/coriolis2 /bin/bash
34 adduser {yourpreferredusername}
35
36 It is best to make the username the same as the first user that
37 was added during the *main* (non-chroot) debian install, so that
38 uid 1000 matches between both main and chroot. You can check
39 this by looking at /etc/passwd as root, or by typing "id".
40
41 lkcl@fizzy:~$ id
42 uid=1000(lkcl) gid=1000(lkcl) groups=1000(lkcl),5(tty),....
43
44 Alternatively, /etc/passwd and /etc/group may
45 be mount-bound as well as /home however if you later forget you did
46 this and decide to delete the chroot, you will delete the entire /home
47 of your main system, as well as /etc/passwd.
48
49 You may wish to follow some of the other things such as configuring apt,
50 locales and keyboard, from the above-linked debian-admin HOWTO.
51 bootloader, kernel, ssh access, all these are
52 unnecessary. do run "apt clean" to clear out /var/cache/apt/archives
53 in the chroot.
54
55 ## schroot
56
57 Create an schroot file section:
58
59 [coriolis]
60 description=Debian Stable for Coriolis
61 directory=/home/chroot/coriolis
62 groups=sbuild-security,lkcl,users
63
64 Now as an *ordinary* user - not as root - you may type:
65
66 lkcl@fizzy:~$ schroot -c coriolis
67
68 and, due to the contents of /etc/debian\_chroot, and that you were in
69 fact logged in as uid 1000 and did in fact add a user to the chroot
70 as uid 1000, the prompt should become:
71
72 (coriolis2)lkcl@fizzy:~$
73
74 ## check out alliance and alliance-check-toolkit
75
76 Adapted from <https://www-soc.lip6.fr/en/team-cian/softwares/alliance/>
77
78 in the schroot:
79
80 git clone https://gitlab.lip6.fr/jpc/alliance-check-toolkit.git
81
82 TODO: document how to build alliance, basically this:
83
84 In the chroot, as root:
85
86 apt-get update
87 apt-get install git build-essential libtool automake \
88 flex bison xfig imagemagick \
89 texlive texlive-pictures texlive-latex-extra \
90 libx11-dev libxt-dev libxaw7-dev libxpm-dev libmotif-dev
91
92 In the chroot, as the ordinary schroot user:
93
94 mkdir -p alliance/build alliance/install
95 cd ~/alliance
96 git clone https://www-soc.lip6.fr/git/alliance.git
97 cd alliance/src
98 ./autostuff
99 cd ~/alliance/build
100 export ALLIANCE_TOP=$HOME/alliance/install
101 export LD_LIBRARY_PATH=${ALLIANCE_TOP}/lib:${LD_LIBRARY_PATH}
102 ../alliance/src/configure --prefix=$ALLIANCE_TOP --enable-alc-shared
103 make -j1 install
104
105 the two exports are best added to ~/.bash_profile for later convenience
106
107 ## coriolis2
108
109 These are nominally taken from
110 <https://www-soc.lip6.fr/equipe-cian/logiciels/coriolis/>
111 however there are errors in the original at the moment.
112 Do not try qt5, it will not work.
113
114 In ~/.bash\_profile add the following so that builds (rebuilds) if you need
115 them will be quicker, and you can run the GUI from the chroot:
116
117 export PATH=/usr/lib/ccache:"$PATH"
118 export DISPLAY=:0.0
119
120 Second (or at a new terminal / xterm), log in as root on the host (not
121 the chroot) then do schroot -c coriolis to get to be root in the chroot
122 (or, you can install sudo in the chroot and then do "sudo bash" in the
123 chroot).
124
125 Then run the following commands, as root, *in* the chroot:
126
127 apt-get update
128 apt-get install -y build-essential binutils-dev \
129 git cmake bison flex gcc python-dev \
130 libboost-all-dev libboost-python-dev \
131 zlib1g-dev \
132 libbz2-dev libxml2-dev rapidjson-dev libbz2-dev \
133 doxygen dvipng graphviz python-sphinx \
134 texlive-fonts-extra texlive-lang-french \
135 libqwt-dev qt4-dev-tools python-qt4 \
136 libxt-dev libxpm-dev libmotif-dev \
137 yosys
138
139 Then, as the ordinary (non-root) user in the schroot:
140
141 mkdir -p ~/coriolis-2.x/src
142 cd ~/coriolis-2.x/src
143 git clone https://www-soc.lip6.fr/git/coriolis.git
144
145 cd coriolis
146 git checkout devel
147 ./bootstrap/ccb.py --project=coriolis --make="-j4 install"
148
149 To set up the alliance environment, run this:
150
151 eval `~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py`
152
153 For convenience that may be placed in a file and "sourced", to avoid
154 having to look this page up every time
155
156 echo "eval `~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py`" > \
157 ~/coriolisenv
158 source ~/coriolisenv
159
160 To run the graphical editor go to the bin directory
161
162 cd ~/coriolis-2.x/Linux.MyARCH/Release.Shared/install/bin
163 ./cgt
164
165 Then run the following commands from the menubar
166
167 Tutorials / Run Demo (Python Flavour)
168
169 The following window will appear
170
171 [[!img chicken.png ]]
172
173 click on the chicken several times
174
175 # Tutorials and checks
176
177 * <https://gitlab.com/Chips4Makers/alliance-check-toolkit>
178 * See coriolis-2.x/Linux.x86_64/Release.Shared/install/share/doc/coriolis2/en/html/main/PythonTutorial/index.html
179
180 ## Information from Jean-Paul
181
182 There should be very soon a website at https://coriolis.lip6.fr (it is not yet
183 online). Where I intend to put all the documentation about Alliance/Coriolis.
184
185 In the meantime did you find the doc shipped with Coriolis ?
186
187 There are also very cursory informations about installing Alliance here:
188 https://www-soc.lip6.fr/en/team-cian/softwares/alliance/
189
190 You also have a third repository for various blocks/chip/examples here:
191 https://gitlab.lip6.fr/jpc/alliance-check-toolkit
192
193 (with a basic doc under "doc/"...)
194
195 ## More from JP
196
197 You must create a configuration for alliance-check-toolkit:
198
199 alliance-check-toolkit/etc/mk/users.d/user-LOGIN.mk
200
201 where you define where the various tools are installed
202 (look in other ones to have an idea).
203
204 You can try the ARM in alliance-check-toolkit:
205
206 > cd alliance-check-toolkit/benchsARM/cmos/
207 > make lvx
208
209 Should take about five minutes. It's symbolic, but should be
210 a configuration compatible with 180nm. To actually see the
211 results:
212
213 > make cgt
214
215 Then "File -> Open", "arm_chip_cts_r"
216
217 To have a very rough approximation, you can say that one lambda
218 equal 180nm.
219
220 > i'd expect such a chip to be in the alliance-check-toolkit however we
221 > don't even know what we're looking at in order to know which bits we
222 > need, let alone know what to do or how to run them.
223 >
224 > we're *literally* completely in the dark, here, having never done this
225 > before - at all - so unless there's a specific tutorial which says, to
226 > make a chip layout do this: "step 1: install these tools. step 2: get
227 > this project repo. step 3: cd to this directory. step 4: run make or
228 > ./compile-place-and-route.sh" we're absolutely lost.
229 >
230 > thx jean-paul, and apologies for not knowing where to begin, here.
231
232 No problem. You're welcome.
233
234 The doc is mostly for people who already have a background in ASICs,
235 I will try to patch something from my lecture in VLSI to help people
236 to orient themselves.
237
238 The up-to-date documentation is supplied directly in the Coriolis
239 repository:
240
241 coriolis/documentation/output/index.html
242
243 The links toward the doxygen doc will be invalid a this point,
244 but everython else works.
245
246 After installation, it is put in:
247
248 coriolis-2.x/Linux.x86_64/Release.Shared/install/share/doc/coriolis2/en/html/index.html