1 # Generating a Microwatt-compatible Libre-SOC core with SVP64
3 Useful links (Libre-SOC):
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)
13 Other Tutorials (Libre-SOC):
15 * First steps for working with PowerISA instructions Libre-SOC page:
18 ## Development environment scripts
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:
24 - With all software and libraries at specific versions
25 (which are known to work).
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
32 ## Setting up chroot for core generation
34 Scripts we will be using for the setup are:
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
40 (*Current limitation for `mk-deb-chroot`, is that you must be the first user on
41 the host machine, having user ID 1000.*)
43 Commands to run in terminal to setup a new chroot environment for generating
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)
51 # ./mk-deb-chroot gen_cores
52 # ./cp-scripts-to-chroot gen_cores
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
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
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).
73 ## Setting up chroot for simulation in Microwatt SoC
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.
78 Please see [[microwatt]] page for details how to setup a microwatt chroot.
80 ## Setting up chroot for FPGA synthesis with ls2 SoC peripheral fabric
82 At the moment this is not working yet. TODO:
84 Please see [[ls2]] page for details how to setup a ls2 chroot.