(no commit message)
[libreriscv.git] / HDL_workflow / devscripts.mdwn
1 # Dev setup scripts
2
3 Setting up the dependencies and repositories for Libre-SOC is big enough
4 that it is just much easier to do in an automated fashion. Follow these
5 steps after making sure that you review the scripts line by line because
6 they run as root and it is your responsibility to check them, not ours.
7
8 Note the reason for entering the chroot as a user (not root) and
9 then running sudo bash again is due to this procedure setting the
10 SUDO_USER environment, on which the scripts critically rely. Also:
11 the dev-env-setup repository is cloned twice, once to get the chroot
12 script and a second time to use scripts *inside* the chroot. Feel free
13 to simply copy the repository into the chroot to save bandwidth.
14
15 Note: these scripts assume that you are using debian/10 and that you
16 understand and accept why we have standardised on that as an OS
17 (reproduceability and minimising "support"). If you use anything
18 different it risks creating non-reproducible HDL. It's not about
19 "what's the favurite OS", it's about making sure that two developers
20 can produce the **exact** same GDS-II files.
21
22 $ git clone https://git.libre-soc.org/git/dev-env-setup.git
23 $ cd dev-env-setup
24 $ sudo bash
25 # ./mk-deb-chroot libresoc
26 # exit
27 $ schroot -c libresoc
28 (libresoc)$ git clone https://git.libre-soc.org/git/dev-env-setup.git
29 (libresoc)$ cd dev-env-setup
30 (libresoc)$ sudo bash
31 (libresoc)# ./install-hdl-apt-reqs
32 (libresoc)# ./hdl-dev-repos
33 (libresoc)# ./ppc64-gdb-gcc # needed for compiling unit tests
34 (libresoc)# exit
35 (libresoc)$
36
37 <https://git.libre-soc.org/?p=dev-env-setup.git;a=blob;f=hdl-dev-repos;hb=HEAD>
38
39 Additional scripts in the dev-env-setup repository will install yosys,
40 verilator, coriolis2, ghdl, gdb and so on: from the above it is pretty
41 straightforward and obvious to work out what to do (just run them).
42 There is an accompanying walkthrough video which goes through the above
43 <https://m.youtube.com/watch?v=1-4eJKTNrEk> and includes running some
44 unit tests, explaining some of the background, and also files some bugs.