- 
                Notifications
    
You must be signed in to change notification settings  - Fork 79
 
gowin_pack
gowin_pack is a tool that generates bitstreams for Gowin FPGAs from nextpnr-generated JSON netlists. It's part of the Project Apicula toolchain.
- 
--device DEVICE- Specifies the target Gowin FPGA family
 - Examples:
- 
GW1N-9for GW1NR-LV9QN88PC6/I5 - 
GW1N-9Cfor GW1NR-LV9QN88C6/I5 (note the C suffix requires specifying the family) - 
GW2A-18for GW2A-LV18PG256C8/I7 
 - 
 - Required argument
 
 - 
netlist- Input JSON netlist file generated by nextpnr
 - Required positional argument
 
 
- 
--output FILENAME- Output bitstream filename
 - Default: 
pack.fs 
 - 
--compress- Enable bitstream compression
 - Useful for reducing bitstream size
 - Default: disabled
 
 
These flags allow configuring dual-function pins as GPIO:
- 
--jtag_as_gpio- Configure JTAG pins as GPIO
 - Default: disabled
 - Warning: This disables JTAG programming functionality
 
 - 
--sspi_as_gpio- Configure SSPI pins as GPIO
 - Default: disabled
 - Warning: This disables SSPI programming functionality
 
 - 
--mspi_as_gpio- Configure MSPI pins as GPIO
 - Default: disabled
 - Warning: This disables MSPI programming functionality
 
 - 
--ready_as_gpio- Configure READY pin as GPIO
 - Default: disabled
 
 - 
--done_as_gpio- Configure DONE pin as GPIO
 - Default: disabled
 
 - 
--reconfign_as_gpio- Configure RECONFIG_N pin as GPIO
 - Default: disabled
 - Warning: This disables the reconfiguration functionality
 
 
Generate an uncompressed bitstream:
gowin_pack --device GW1N-9 design.jsonGenerate a bitstream for a C-suffix device:
gowin_pack --device GW1N-9C design.jsonGenerate a compressed bitstream with custom output name:
gowin_pack --device GW2A-18 design.json --output compressed.fs --compressConfigure JTAG and MSPI pins as GPIO:
gowin_pack --device GW1N-9 design.json \
  --jtag_as_gpio \
  --mspi_as_gpioGenerate a compressed bitstream with GPIO configuration:
gowin_pack --device GW1N-9C design.json \
  --output final.fs \
  --compress \
  --jtag_as_gpio \
  --mspi_as_gpio \
  --done_as_gpioSupported device families include:
- GW1N-1
 - GW1NZ-1
 - GW1N-4
 - GW1NS-4
 - GW1N-9
 - GW1N-9C
 - GW2A-18
 - GW2A-18C
 
Note that for devices with a C suffix in their part number (e.g., GW1NR-LV9QN88C6/I5), you must specify the C suffix in the family name (e.g., GW1N-9C).
- 
The tool is designed to work with both legacy nextpnr and nextpnr-himbaechel outputs. It automatically detects the input format.
 - 
When using compressed bitstreams (--compress flag), ensure your programming tools support compressed format.
 - 
GPIO configuration flags should be used carefully as they can affect device functionality when these pins are needed for their primary functions.
 - 
When specifying the device family, remember to include the C suffix if your device has one, as this affects the internal configuration of the bitstream.