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