WIP docs how to build the kernel
[libreriscv.git] / HDL_workflow / microwatt.mdwn
1 # Build instructions for Microwatt
2
3 After installing ghdl-yosys-plugin use schroot to switch environment
4
5 schroot -c bullseye_ghdl
6 git clone https://github.com/antonblanchard/microwatt
7 export FPGA_TARGET=verilator
8 make microwatt-verilator
9
10 Then run the resulting binary
11
12 time ./microwatt-verilator
13
14 If everything works correcly it will print out an light bulb in ascii art
15 with the message Microwatt, it works. On my ASUS KGPE D16 this takes
16
17 real 1m4.986s
18 user 1m4.373s
19 sys 0m0.013s
20
21 ## Building the kernel
22 On a POWER9 there is no need to install a cross compiler,
23 you can omit CROSS_COMPILE and ARCH in this case
24
25 apt install gcc-powerpc64le-linux-gnu
26 apt install flex bison
27 git clone -b microwatt-5.7 https://git.kernel.org/pub/scm/linux/kernel/git/joel/microwatt.git
28 cd microwatt
29 wget https://ozlabs.org/~paulus/rootfs.cpio.xz FIXME 404
30 unxz rootfs.cpio.xz
31 CROSS_COMPILE="ccache powerpc64le-linux-gnu-" ARCH=powerpc make -j8 O=microwatt microwatt_defconfig
32 CROSS_COMPILE="ccache powerpc64le-linux-gnu-" ARCH=powerpc make -j8 O=microwatt