06a3bc0fee1abdb66a908c3b763e18168ef0e769
[microwatt.git] / README.md
1 # Microwatt
2
3 A tiny Open POWER ISA softcore written in VHDL 2008. It aims to be simple and easy
4 to understand.
5
6 ## Simulation using ghdl
7
8 - Build micropython. If you aren't building on a ppc64le box you
9 will need a cross compiler. If it isn't available on your distro
10 grab the powerpc64le-power8 toolchain from https://toolchains.bootlin.com
11
12 ```
13 git clone https://github.com/mikey/micropython
14 cd micropython
15 git checkout powerpc
16 cd ports/powerpc
17 make -j$(nproc)
18 cd ../../../
19 ```
20
21 - Microwatt uses ghdl for simulation. Either install this from your
22 distro or build it. Next build microwatt:
23
24 ```
25 git clone https://github.com/antonblanchard/microwatt
26 cd microwatt
27 make
28 ```
29
30 - Link in the micropython image:
31
32 ```
33 ln -s ../micropython/ports/powerpc/build/firmware.bin simple_ram_behavioural.bin
34 ```
35
36 - Now run microwatt, sending debug output to /dev/null:
37
38 ```
39 ./core_tb > /dev/null
40 ```
41
42 ## Synthesis on Xilinx FPGAs using Vivado
43
44 - Install Vivado (I'm using the free 2019.1 webpack edition).
45
46 - Setup Vivado paths:
47
48 ```
49 source /opt/Xilinx/Vivado/2019.1/settings64.sh
50 ```
51
52 - Install FuseSoC:
53
54 ```
55 pip3 install --user -U fusesoc
56 ```
57
58 - Create a working directory and point FuseSoC at microwatt:
59
60 ```
61 mkdir microwatt-fusesoc
62 cd microwatt-fusesoc
63 fusesoc library add microwatt /path/to/microwatt/
64 ```
65
66 - Build using FuseSoC. For hello world (Replace nexys_video with your FPGA board):
67
68 ```
69 fusesoc run --target=nexys_video microwatt --memory_size=8192 --ram_init_file=/path/to/microwatt/fpga/hello_world.hex
70 ```
71
72 - To build micropython (currently requires 1MB of BRAM eg an Artix-7 A200):
73
74 ```
75 fusesoc run --target=nexys_video microwatt
76 ```
77
78 ## Testing
79
80 - A simple test suite containing random execution test cases and a couple of
81 micropython test cases can be run with:
82
83 ```
84 make -j$(nproc) check
85 ```
86
87 ## Issues
88
89 This is functional, but very simple. We still have quite a lot to do:
90
91 - Need to implement a simple non pipelined divide
92 - There are a few instructions still to be implemented
93 - Need to add caches and bypassing (in progress)
94 - Need to add supervisor state (in progress)