بدون توضیح

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 4 سال پیش
litedram d58b112a12 add EXTRA_CFLAGS to CFLAGS 2 سال پیش
liteeth 8366710217 liteeth: Hook up LiteX LiteEth ethernet controller 4 سال پیش
media 0cb0f78777 Add title image 4 سال پیش
micropython 434962bc34 tests: Add updated micropython build with 16550 support 4 سال پیش
openocd d92624f9c0 add ulx3s openocd config for ft232 2 سال پیش
rust_lib_demo e3941109af console: Cleanup console API 4 سال پیش
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 4 سال پیش
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 4 سال پیش
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 4 سال پیش
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 4 سال پیش
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)