update meeting notes
[libreriscv.git] / HDL_workflow / gen_core_with_svp64.mdwn
1 # Generating a Microwatt-compatible Libre-SOC core with SVP64
2
3 Useful links (Libre-SOC):
4
5 * Libre-SOC page covering our workflow: [[HDL_workflow]]
6 * Devscripts Libre-SOC page: [[devscripts]]
7 * Microwatt tutorial Libre-SOC page: [[microwatt]]
8 * ls2 tutorial Libre-SOC page: [[ls2]]
9 * [Libre-SOC Microwatt repo branch](https://git.libre-soc.org/?p=microwatt.git;a=tree;hb=refs/heads/verilator_trace)
10 * [Libre-SOC devscripts repo](https://git.libre-soc.org/?p=dev-env-setup.git;a=tree)
11 * [Bug #1127](https://bugs.libre-soc.org/show_bug.cgi?id=1126)
12
13 Other Tutorials (Libre-SOC):
14
15 * First steps for working with PowerISA instructions Libre-SOC page:
16 [[/docs/firststeps]]
17
18 ## Development environment scripts
19
20 If you haven't already, clone Libre-SOC's development environment setup scripts.
21 These are bash scripts, and greatly simplify the time it takes to create a:
22
23 - Stable environment
24 - With all software and libraries at specific versions
25 (which are known to work).
26
27 These attributes are absolutely critical, and no support will be
28 provided, unless you use these scripts to setup a development environment. This
29 helps us fix any bugs in the scripts, and make sure everyone runs on the same
30 page.
31
32 ## Setting up chroot for core generation
33
34 Scripts we will be using for the setup are:
35
36 * `mk-deb-chroot`, `cp-scripts-to-chroot` for chroot setup
37 * `install-hdl-apt-reqs`, `hdl-dev-repos`, `hdl-tools-yosys` for working with
38 soc repo.
39
40 (*Current limitation for `mk-deb-chroot`, is that you must be the first user on
41 the host machine, having user ID 1000.*)
42
43 Commands to run in terminal to setup a new chroot environment for generating
44 LS soc cores.
45
46 Currently, need to checkout an older commit of `openpower-isa`, for details
47 see [Bug #1127 comment #0](https://bugs.libre-soc.org/show_bug.cgi?id=1127#c0)
48
49 $ cd dev-env-setup
50 $ sudo bash
51 # ./mk-deb-chroot gen_cores
52 # ./cp-scripts-to-chroot gen_cores
53 # exit
54 $ schroot -c gen_cores
55 (gen_cores):$ cd dev-env-setup
56 (gen_cores):$ sudo bash
57 (gen_cores):# ./install-hdl-apt-reqs
58 (gen_cores):# ./hdl-tools-yosys
59 (gen_cores):# ./hdl-dev-repos
60 (gen_cores):# exit
61 (gen_cores):$ cd ~/src/openpower-isa/
62 (gen_cores):$ git checkout 1bbfcce929c9a1d6b1dc0fc68c84296bcc58eea1
63 (gen_cores):$ sudo python3 setup.py develop
64 (gen_cores):$ make svanalysis
65 (gen_cores):$ make pywriter
66 (gen_cores):$ make pyfnwriter
67 (gen_cores):$ cd ../soc/
68 (gen_cores):$ make microwatt_external_core_svp64
69
70 At this point you should end up with `external_core_top.v` verilog file, which
71 contains the Libre-SOC core (with Microwatt-compatible interfaces).
72
73 ## Setting up chroot for simulation in Microwatt SoC
74
75 Using the microwatt repo's soc for verilator simulation works well, so this
76 is a good option if you just need to run/test programs compiled for POWER SFFS.
77
78 Please see [[microwatt]] page for details how to setup a microwatt chroot.
79
80 ## Setting up chroot for FPGA synthesis with ls2 SoC peripheral fabric
81
82 At the moment this is not working yet. TODO:
83
84 Please see [[ls2]] page for details how to setup a ls2 chroot.
85