jamesbowman / swapforth

Swapforth is a cross-platform ANS Forth
BSD 3-Clause "New" or "Revised" License
279 stars 56 forks source link

add initial J1b support for ULX3S board #78

Open stuij opened 2 years ago

stuij commented 2 years ago

This patch adds initial J1b support for the ULX3S board, which is based on the Lattice ECP5 FPGA and can be programmed with either the Trellis (Yosys) or Diamond (vendor) toolchain.

Currently only the J1b core and UART are hooked up. So no LEDs, GPIO ports, buttons, SDRAM, etc.. support yet.

You can connect to the core with the shell.py script, and you can replicate the bootstap process: compiling swapforth.fs, writing out a new nuc.hex file containing the new words and creating a new bitstream containing the new .hex file. Flashing that on the ULX3S seems to replicate a functioning Forth system.

The bram and ram16k modules were split out from the xilinx-top.v file into ram.v to foster some code reuse. Thanks to improved handling of bram within Yosys, the modules could be reused as is.

Note that the changes weren't tested on either the Diamond or Xilinx toolchains. The changes to Xilinx parts were minimal so hopefully no regression was introduced. As for Diamond, it made sense to me to include the Makefile-related parts needed to compile for Diamond to aid others wanting to make this work.

stuij commented 2 years ago

Added support for LEDs, GPIO ports, buttons.