Без опису

Tobias Platen 72ae258962 inital support for orangecrab0.2 2 роки тому
.github 93b2987b19 ci: use job.container 3 роки тому
constraints 9a967e764b found chiselwatt ulx3s constraint file 2 роки тому
fpga 72ae258962 inital support for orangecrab0.2 2 роки тому
hello_world bc4e6b7efe Reduce hello_world footprint to fit in 8kB 3 роки тому
include 9b5bd2d757 rrright. ok. these modifications to sdram_init allow it 2 роки тому
lib d654667304 console: Add support for the 16550 UART 3 роки тому
litedram d58b112a12 add EXTRA_CFLAGS to CFLAGS 2 роки тому
liteeth 8366710217 liteeth: Hook up LiteX LiteEth ethernet controller 3 роки тому
media 0cb0f78777 Add title image 4 роки тому
micropython 434962bc34 tests: Add updated micropython build with 16550 support 3 роки тому
openocd d92624f9c0 add ulx3s openocd config for ft232 2 роки тому
rust_lib_demo e3941109af console: Cleanup console API 3 роки тому
scripts 89a67a18d0 decode: Add a facility field to the instruction decode tables 3 роки тому
sim-unisim ee52fd4d80 Add a debug (DMI) bus and a JTAG interface to it on Xilinx FPGAs 4 роки тому
tests 81b96e024e add first cut of ulx3s constraint file 2 роки тому
uart16550 aae45583d7 Add uart16550 files from fusesoc 3 роки тому
verilator 81b96e024e add first cut of ulx3s constraint file 2 роки тому
.gitignore 3460afb557 Add yosys builds files to gitignore 3 роки тому
LICENSE 5a29cb4699 Initial import of microwatt 4 роки тому
Makefile 72ae258962 inital support for orangecrab0.2 2 роки тому
README.md 6326efaca4 Add Makefile command line variables to enable docker and podman 4 роки тому
cache_ram.vhdl ecaa5e2fb2 dcache: Rework RAM wrapper to synthetize better on Xilinx 4 роки тому
common.vhdl f636bb7c39 dcache: Fix bugs in pipelined operation 3 роки тому
control.vhdl 3cd3449b4b core: Move redirect and interrupt delivery logic to writeback 3 роки тому
core.vhdl 1610e1fa21 add verilator snoop of LDST request address 2 роки тому
core_debug.vhdl 3361c460b8 core_debug: Stop logging 256 cycles after trigger 3 роки тому
core_dram_tb.vhdl 02abb135a8 litedram: l2: Add support for more geometries 3 роки тому
core_dummy.vhdl 1610e1fa21 add verilator snoop of LDST request address 2 роки тому
core_flash_tb.vhdl bf7def5503 soc: Don't require dram wishbones signals to be wired by toplevel 4 роки тому
core_tb.vhdl bf7def5503 soc: Don't require dram wishbones signals to be wired by toplevel 4 роки тому
countzero.vhdl 9d285a265c core: Add support for single-precision FP loads and stores 3 роки тому
countzero_tb.vhdl ab86b58d95 Exit cleanly from testbench on success 4 роки тому
cr_file.vhdl 893d2bc6a2 core: Don't generate logic for log data when LOG_LENGTH = 0 3 роки тому
crhelpers.vhdl da0bd89c43 crhelpers: Constraint "crnum" integer 4 роки тому
dcache.vhdl f636bb7c39 dcache: Fix bugs in pipelined operation 3 роки тому
dcache_tb.vhdl ab86b58d95 Exit cleanly from testbench on success 4 роки тому
decode1.vhdl ae2afeca5c core: Track CR hazards and bypasses using tags 3 роки тому
decode2.vhdl 4fd8d9509c execute1: Move CR result to data path process 3 роки тому
decode_types.vhdl 4c61a71a62 core: Crack update-form loads into two internal ops 3 роки тому
divider.vhdl c9a2076dd3 execute1: Remember dest GPR, RC, OE, XER for slow operations 4 роки тому
divider_tb.vhdl ab86b58d95 Exit cleanly from testbench on success 4 роки тому
dmi_dtm_dummy.vhdl 8102e7863b Fix build issue in dmi_dtm_dummy.vhdl 4 роки тому
dmi_dtm_ecp5.vhdl 72ae258962 inital support for orangecrab0.2 2 роки тому
dmi_dtm_tb.vhdl 8e0389b973 ram: Rework main RAM interface 4 роки тому
dmi_dtm_xilinx.vhdl 5eb351b4be Reset JTAG/DMI 3 роки тому
dram_tb.vhdl 02abb135a8 litedram: l2: Add support for more geometries 3 роки тому
execute1.vhdl acb3d2d745 core: Send FPU interrupts to writeback rather than execute1 3 роки тому
fetch1.vhdl 3cd3449b4b core: Move redirect and interrupt delivery logic to writeback 3 роки тому
fpu.vhdl acb3d2d745 core: Send FPU interrupts to writeback rather than execute1 3 роки тому
glibc_random.vhdl 06392e7eaa Reformat glibc_random 4 роки тому
glibc_random_helpers.vhdl 06392e7eaa Reformat glibc_random 4 роки тому
helpers.vhdl 9d285a265c core: Add support for single-precision FP loads and stores 3 роки тому
icache.vhdl 0fb207be60 fetch1: Implement a simple branch target cache 3 роки тому
icache_tb.vhdl b5a7dbb78d core: Remove fetch2 pipeline stage 4 роки тому
icache_test.bin f74e8a4f79 icache_tb: Improve test and include test file 4 роки тому
insn_helpers.vhdl 4b2c23703c core: Implement quadword loads and stores 3 роки тому
loadstore1.vhdl f636bb7c39 dcache: Fix bugs in pipelined operation 3 роки тому
logical.vhdl 658feabfd4 core: Make result multiplexing explicit 3 роки тому
microwatt.core ae2afeca5c core: Track CR hazards and bypasses using tags 3 роки тому
mmu.vhdl 740f013284 Initialize PID register 3 роки тому
multiply.vhdl f1238299bd execute1: Take an extra cycle for OE=1 multiply instructions 3 роки тому
multiply_tb.vhdl 535341961d multiplier: Generalize interface to the multiplier 3 роки тому
nonrandom.vhdl 1a7aebeef8 Add random number generator and implement the darn instruction 3 роки тому
plru.vhdl e598188aca plru: Improve sensitivity list 4 роки тому
plru_tb.vhdl ab86b58d95 Exit cleanly from testbench on success 4 роки тому
ppc_fx_insns.vhdl 8edfbf638b core: Implement the cmpeqb and cmprb instructions 3 роки тому
random.vhdl 1a7aebeef8 Add random number generator and implement the darn instruction 3 роки тому
register_file.vhdl 45cd8f4fc3 core: Add support for floating-point loads and stores 3 роки тому
rotator.vhdl 8a0a907e2f Implement the extswsli instruction 4 роки тому
rotator_tb.vhdl ab86b58d95 Exit cleanly from testbench on success 4 роки тому
sim_16550_uart.vhdl cc10f6b289 uart: Add a simulation model for the 16550 compatible UART 3 роки тому
sim_bram.vhdl 8e0389b973 ram: Rework main RAM interface 4 роки тому
sim_bram_helpers.vhdl 8e0389b973 ram: Rework main RAM interface 4 роки тому
sim_bram_helpers_c.c 471c7e2197 Consolidate VHPI code 4 роки тому
sim_console.vhdl fd9e971b2c Reformat sim_console 4 роки тому
sim_console_c.c fc4e13ae67 sim_console: Fix polling to check for POLLIN 3 роки тому
sim_jtag.vhdl 554b753172 Add jtag support in simulation via a socket 4 роки тому
sim_jtag_socket.vhdl 554b753172 Add jtag support in simulation via a socket 4 роки тому
sim_jtag_socket_c.c 471c7e2197 Consolidate VHPI code 4 роки тому
sim_no_flash.vhdl a89e1469ef spi: Add simulation support 4 роки тому
sim_pp_uart.vhdl 4eae29801b uart: Rename sim_uart.vhdl to sim_pp_uart.vhdl 3 роки тому
sim_vhpi_c.c 471c7e2197 Consolidate VHPI code 4 роки тому
sim_vhpi_c.h 471c7e2197 Consolidate VHPI code 4 роки тому
soc.vhdl 79461a96bd link unused signals to undefined 2 роки тому
spi_flash_ctrl.vhdl c870040a20 Fix an issue in flash controller when BOOT_CLOCKS is false 3 роки тому
spi_rxtx.vhdl 3f1e2b3a4f Merge pull request #265 from antonblanchard/another-spi-rxtx-reset-issu 3 роки тому
sync_fifo.vhdl a3857aac94 litedram: Add an L2 cache with store queue 4 роки тому
syscon.vhdl 6431824a5f add SIM_BRAM_CHAINBOOT parameter to SYSCON 2 роки тому
utils.vhdl bf1b98b958 litedram: Add support for booting without BRAM 4 роки тому
wishbone_arbiter.vhdl cff4b13a9b wb_arbiter: Early master selection 4 роки тому
wishbone_bram_tb.bin 8e0389b973 ram: Rework main RAM interface 4 роки тому
wishbone_bram_tb.vhdl ab86b58d95 Exit cleanly from testbench on success 4 роки тому
wishbone_bram_wrapper.vhdl 2260ca654d gotten over the logic-dyslexia of what in/out mean in VHDL. 2 роки тому
wishbone_debug_master.vhdl fe789190e4 wishbone_debug_master: Fix address auto-increment for memory writes 4 роки тому
wishbone_types.vhdl c6dfc19d89 Make wishbone_master_out and wb_io_master_out match 3 роки тому
writeback.vhdl acb3d2d745 core: Send FPU interrupts to writeback rather than execute1 3 роки тому
xics.vhdl bb54af59de xics: Add support for reduced priority field size 3 роки тому
xilinx-mult.vhdl f1238299bd execute1: Take an extra cycle for OE=1 multiply instructions 3 роки тому

README.md

Microwatt

Microwatt

A tiny Open POWER ISA softcore written in VHDL 2008. It aims to be simple and easy to understand.

Simulation using ghdl

MicroPython running on Microwatt

You can try out Microwatt/Micropython without hardware by using the ghdl simulator. If you want to build directly for a hardware target board, see below.

  • Build micropython. If you aren't building on a ppc64le box you will need a cross compiler. If it isn't available on your distro grab the powerpc64le-power8 toolchain from https://toolchains.bootlin.com. You may need to set the CROSS_COMPILE environment variable to the prefix used for your cross compilers. The default is powerpc64le-linux-gnu-.
git clone https://github.com/micropython/micropython.git
cd micropython
cd ports/powerpc
make -j$(nproc)
cd ../../../

A prebuilt micropython image is also available in the micropython/ directory.

  • Microwatt uses ghdl for simulation. Either install this from your distro or build it. Microwatt requires ghdl to be built with the LLVM or gcc backend, which not all distros do (Fedora does, Debian/Ubuntu appears not to). ghdl with the LLVM backend is likely easier to build.

If building ghdl from scratch is too much for you, the microwatt Makefile supports using Docker or Podman.

  • Next build microwatt:
git clone https://github.com/antonblanchard/microwatt
cd microwatt
make

To build using Docker:

make DOCKER=1

and to build using Podman:

make PODMAN=1
  • Link in the micropython image:
ln -s ../micropython/ports/powerpc/build/firmware.bin main_ram.bin

Or if you were using the pre-built image:

ln -s micropython/firmware.bin main_ram.bin
  • Now run microwatt, sending debug output to /dev/null:
./core_tb > /dev/null

Synthesis on Xilinx FPGAs using Vivado

  • Install Vivado (I'm using the free 2019.1 webpack edition).

  • Setup Vivado paths:

source /opt/Xilinx/Vivado/2019.1/settings64.sh
  • Install FuseSoC:
pip3 install --user -U fusesoc

Fedora users can get FuseSoC package via

sudo dnf copr enable sharkcz/danny
sudo dnf install fusesoc
  • Create a working directory and point FuseSoC at microwatt:
mkdir microwatt-fusesoc
cd microwatt-fusesoc
fusesoc library add microwatt /path/to/microwatt/
  • Build using FuseSoC. For hello world (Replace nexys_video with your FPGA board such as --target=arty_a7-100):
fusesoc run --target=nexys_video microwatt --memory_size=16384 --ram_init_file=/path/to/microwatt/fpga/hello_world.hex

You should then be able to see output via the serial port of the board (/dev/ttyUSB1, 115200 for example assuming standard clock speeds). There is a know bug where initial output may not be sent - try the reset (not programming button) on your board if you don't see anything.

  • To build micropython (currently requires 1MB of BRAM eg an Artix-7 A200):
fusesoc run --target=nexys_video microwatt

Testing

  • A simple test suite containing random execution test cases and a couple of micropython test cases can be run with:
make -j$(nproc) check

Issues

This is functional, but very simple. We still have quite a lot to do:

  • There are a few instructions still to be implemented
  • Need to add caches and bypassing (in progress)
  • Need to add supervisor state (in progress)