(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 -a
25 echo "coriolis2" > /home/chroot/coriolis/etc/debian_chroot
26
27 To do some preparation (users):
28
29 chroot /home/chroot/coriolis2 /bin/bash
30 adduser {yourpreferredusername}
31
32 It is best to make the username the same as the first user that
33 was added during the *main* (non-chroot) debian install, so that
34 uid 1000 matches between both main and chroot. You can check
35 this by looking at /etc/passwd as root, or by typing "id".
36
37 lkcl@fizzy:~$ id
38 uid=1000(lkcl) gid=1000(lkcl) groups=1000(lkcl),5(tty),....
39
40 Alternatively, /etc/passwd and /etc/group may
41 be mount-bound as well as /home however if you later forget you did
42 this and decide to delete the chroot, you will delete the entire /home
43 of your main system, as well as /etc/passwd.
44
45 You may wish to follow some of the other things such as configuring apt,
46 locales and keyboard, from the above-linked debian-admin HOWTO.
47 bootloader, kernel, ssh access, all these are
48 unnecessary. do run "apt clean" to clear out /var/cache/apt/archives
49 in the chroot.
50
51 ## schroot
52
53 Create an schroot file section:
54
55 [coriolis]
56 description=Debian Stable for Coriolis
57 directory=/home/chroot/coriolis
58 groups=sbuild-security,lkcl,users
59
60 Now as an *ordinary* user - not as root - you may type:
61
62 lkcl@fizzy:~$ schroot -c coriolis
63
64 and, due to the contents of /etc/debian\_chroot, and that you were in
65 fact logged in as uid 1000 and did in fact add a user to the chroot
66 as uid 1000, the prompt should become:
67
68 (coriolis2)lkcl@fizzy:~$
69
70 ## check out alliance and alliance-check-toolkit
71
72 in the schroot:
73
74 git clone https://gitlab.lip6.fr/jpc/alliance-check-toolkit.git
75
76 TODO: document how to build alliance, basically this:
77
78 In the chroot, as root:
79
80 apt-get update
81 apt-get install git build-essential libtool automake aclocal \
82 flex bison xfig imagemagick \
83 texlive texlive-pictures texlive-latex-extra \
84 libx11-dev libxt-dev libxaw7-dev libxpm-dev libmotif-dev
85
86 In the chroot, as the ordinary schroot user:
87
88 mkdir -p alliance/build alliance/install
89 cd ~/alliance
90 git clone https://www-soc.lip6.fr/git/alliance.git
91 cd alliance/src
92
93 Modify the following file (may not be necessary later):
94
95 diff --git a/alliance/src/pat/src/pat_desc_y.y b/alliance/src/pat/src/pat_desc_y.y
96 index 14720dbc..5390d2a4 100644
97 --- a/alliance/src/pat/src/pat_desc_y.y
98 +++ b/alliance/src/pat/src/pat_desc_y.y
99 @@ -85,8 +85,8 @@ unsigned short position; /* # of statement since last comment */
100 static struct papat *lcl_addpapat (lastpapat, label, line)
101
102 struct papat *lastpapat; /* pointer on the last papat structure */
103 -char *label; /* pattern's label */
104 -unsigned short line; /* pattern' line number */
105 +char *label;
106 +unsigned short line;
107
108 {
109 struct papat *ptpat;
110
111 Continue running as user:
112
113 ./autostuff
114 cd ~/alliance/build
115 export ALLIANCE_TOP=$HOME/alliance/install
116 export LD_LIBRARY_PATH=${ALLIANCE_TOP}/lib:${LD_LIBRARY_PATH}
117 ../alliance/src/configure --prefix=$ALLIANCE_TOP --enable-alc-shared
118 make -j1 install
119
120 the two exports are best added to ~/.bash_profile for later convenience
121
122 ## coriolis2
123
124 These are nominally taken from
125 <https://www-soc.lip6.fr/equipe-cian/logiciels/coriolis/>
126 however there are errors in the original at the moment.
127 Do not try qt5, it will not work.
128
129 In ~/.bash\_profile add the following so that builds (rebuilds) if you need
130 them will be quicker, and you can run the GUI from the chroot:
131
132 export PATH=/usr/lib/ccache:"$PATH"
133 export DISPLAY=:0.0
134
135 Second (or at a new terminal / xterm), log in as root on the host (not
136 the chroot) then do schroot -c coriolis to get to be root in the chroot
137 (or, you can install sudo in the chroot and then do "sudo bash" in the
138 chroot).
139
140 Then run the following commands, as root, *in* the chroot:
141
142 apt-get update
143 apt-get install -y build-essential binutils-dev \
144 git cmake bison flex gcc python-dev \
145 libboost-all-dev libboost-python-dev \
146 zlib1g-dev \
147 libbz2-dev libxml2-dev rapidjson-dev libbz2-dev \
148 doxygen dvipng graphviz python-sphinx \
149 texlive-fonts-extra texlive-lang-french \
150 libqwt-dev qt4-dev-tools python-qt4 \
151 libxt-dev libxpm-dev libmotif-dev \
152 yosys
153
154 Then, as the ordinary (non-root) user in the schroot:
155
156 mkdir -p ~/coriolis-2.x/src
157 cd ~/coriolis-2.x/src
158 git clone https://www-soc.lip6.fr/git/coriolis.git
159
160 cd coriolis
161 git checkout devel
162 ./bootstrap/ccb.py --project=coriolis --make="-j4 install"
163
164 To set up the alliance environment, run this:
165
166 eval `~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py`
167
168 For convenience that may be placed in a file and "sourced", to avoid
169 having to look this page up every time
170
171 echo "eval `~/coriolis-2.x/src/coriolis/bootstrap/coriolisEnv.py`" > \
172 ~/coriolisenv
173 source ~/coriolisenv
174
175 To run the graphical editor go to the bin directory
176
177 cd ~/coriolis-2.x/Linux.MyARCH/Release.Shared/install/bin
178 ./cgt
179
180 Then run the following commands from the menubar
181
182 Tutorials / Run Demo (Python Flavour)
183
184 The following window will appear
185
186 [[!img chicken.png ]]
187
188 click on the chicken several times
189
190 # Tutorials and checks
191
192 * <https://gitlab.com/Chips4Makers/alliance-check-toolkit>
193
194 ## Information from Jean-Paul
195
196 There should be very soon a website at https://coriolis.lip6.fr (it is not yet
197 online). Where I intend to put all the documentation about Alliance/Coriolis.
198
199 In the meantime did you find the doc shipped with Coriolis ?
200
201 There are also very cursory informations about installing Alliance here:
202 https://www-soc.lip6.fr/en/team-cian/softwares/alliance/
203
204 You also have a third repository for various blocks/chip/examples here:
205 https://gitlab.lip6.fr/jpc/alliance-check-toolkit
206
207 (with a basic doc under "doc/"...)
208