Tidak Ada Deskripsi

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

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)