Skip to content
/ apicula Public
forked from YosysHQ/apicula

Project Apicula 🐝: bitstream documentation for Gowin FPGAs

License

Notifications You must be signed in to change notification settings

uis246/apicula

 
 

Repository files navigation

Project Apicula

Documentation and open source tools for the Gowin FPGA bitstream format.

Project Apicula uses a combination of fuzzing and parsing of the vendor data files to provide Python tools for generating bitstreams.

This project is supported by our generous sponsors. Have a look at our contributors and sponsor them with via the various platforms linked on our github.

Getting Started

Install the latest git yosys, nextpnr-gowin, openFPGALoader, and Python 3.6 or higher. Yowasp versions of Yosys and Nextpnr are also supported.

Currently supported boards are

  • Trenz TEC0117: GW1NR-UV9QN881C6/I5
  • Sipeed Tang Nano: GW1N-LV1QN48C6/I5
  • Sipeed Tang Nano 1K: GW1NZ-LV1QN48C6/I5
  • Sipeed Tang Nano 4K: GW1NSR-LV4CQN48PC7/I6
  • Sipeed Tang Nano 9K: GW1NR-LV9QN88PC6/I5 1
  • Seeed RUNBER: GW1N-UV4LQ144C6/I5
  • @Disasm honeycomb: GW1NS-UX2CQN48C5/I4

Install the tools with pip.

pip install apycula

Note that on some systems the installed binaries might not be on the path. Either add the binaries to the path, or use the path of the installed binary directly. (running the source files will lead to import errors)

which gowin_bba # check if binaries are on the path
python -m site --user-base # find the site packages base directory
ls $HOME/.local/bin # confirm the binaries are installed in this folder
export PATH="$HOME/.local/bin:$PATH" # add binaries to the path

From there, compile a blinky.

The example below is for the Trenz TEC0117. For other devices, use the model numbers listed above for --device, and replace tec0117 with runber, tangnano, tangnano4k or honeycomb accordingly. Also note the number of LEDs on your board: 8 for tec0117 and runber, 3 for honeycomb and tangnano. You can also use the Makefile in the examples folder to build the examples.

cd examples
yosys -D LEDS_NR=8 -p "read_verilog blinky.v; synth_gowin -json blinky.json"
DEVICE='GW1NR-UV9QN881C6/I5'  # change to your device
BOARD='tec0117' # change to your board
nextpnr-gowin --json blinky.json \
              --write pnrblinky.json \
              --device $DEVICE \
              --cst $BOARD.cst
gowin_pack -d $DEVICE -o pack.fs pnrblinky.json # chango to your device
# gowin_unpack -d $DEVICE -o unpac