From 73330cbd4d74056c5116fd5fbd785548f2c60e12 Mon Sep 17 00:00:00 2001 From: Patrick Leiser Date: Sat, 7 Sep 2024 19:03:31 -0700 Subject: [PATCH 1/2] add untested support for tang nano, tang nano 1k, tang nano 4k, and tang nano 9k gowin-based boards --- apio/resources/boards.json | 44 +++++++++++++++++++++++++++++++++ apio/resources/fpgas.json | 18 ++++++++++++++ apio/resources/programmers.json | 16 ++++++++++++ 3 files changed, 78 insertions(+) diff --git a/apio/resources/boards.json b/apio/resources/boards.json index 69f99334..62af8361 100644 --- a/apio/resources/boards.json +++ b/apio/resources/boards.json @@ -807,6 +807,50 @@ "desc": "ETH4K" } }, + "Sipeed-Tang-Nano": { + "name":"Sipeed Tang Nano", + "fpga": "GW1N-LV1QN48C6/I5", + "programmer": { + "type": "openfpgaloader_tangnano" + }, + "usb": { + "vid": "0403", + "pid": "6010" + } + }, + "Sipeed-Tang-Nano-1k": { + "name":"Sipeed Tang Nano 1k", + "fpga": "GW1NZ-LV1QN48C6/I5", + "programmer": { + "type": "openfpgaloader_tangnano1k" + }, + "usb": { + "vid": "0403", + "pid": "6010" + } + }, + "Sipeed-Tang-Nano-4k": { + "name":"Sipeed Tang Nano 4k", + "fpga": "GW1NSR-LV4CQN48PC7/I6", + "programmer": { + "type": "openfpgaloader_tangnano4k" + }, + "usb": { + "vid": "0403", + "pid": "6010" + } + }, + "Sipeed-Tang-Nano-9k": { + "name":"Sipeed Tang Nano 9k", + "fpga": "GW1NR-LV9QN88PC6/I5", + "programmer": { + "type": "openfpgaloader_tangnano9k" + }, + "usb": { + "vid": "0403", + "pid": "6010" + } + }, "Sipeed-Tang-Nano-20k": { "name":"Sipeed Tang Nano 20k", "fpga": "GW2AR-LV18QN88C8/I7", diff --git a/apio/resources/fpgas.json b/apio/resources/fpgas.json index 4a37c8f5..2943b32a 100644 --- a/apio/resources/fpgas.json +++ b/apio/resources/fpgas.json @@ -410,6 +410,24 @@ "size": "85k", "pack": "CSFBGA285" }, + "GW1NZ-LV1QN48C6/I5": { + "arch": "gowin", + "type": "gw1nz-1", + "size": "1k", + "pack": "QN48" + }, + "GW1NSR-LV4CQN48PC7/I6": { + "arch": "gowin", + "type": "gw1ns-4", + "size": "4k", + "pack": "QN48P" + }, + "GW1NR-LV9QN88PC6/I5": { + "arch": "gowin", + "type": "gw1n-9c", + "size": "9k", + "pack": "QN88P" + }, "GW2AR-LV18QN88C8/I7": { "arch": "gowin", "type": "gw2a-18c", diff --git a/apio/resources/programmers.json b/apio/resources/programmers.json index 181fb04f..6859b680 100644 --- a/apio/resources/programmers.json +++ b/apio/resources/programmers.json @@ -74,6 +74,22 @@ "command": "openFPGALoader", "args": "-c usb-blaster -v --file-type bin" }, + "openfpgaloader_tangnano": { + "command": "openFPGALoader", + "args": "-b tangnano" + }, + "openfpgaloader_tangnano1k": { + "command": "openFPGALoader", + "args": "-b tangnano1k -f" + }, + "openfpgaloader_tangnano4k": { + "command": "openFPGALoader", + "args": "-b tangnano4k -f" + }, + "openfpgaloader_tangnano9k": { + "command": "openFPGALoader", + "args": "-b tangnano9k -f" + }, "openfpgaloader_tangnano20k": { "command": "openFPGALoader", "args": "-b tangnano20k -f" From e2a62fc1a4434a5a7e48d558c04183b6d3877e08 Mon Sep 17 00:00:00 2001 From: Patrick Leiser Date: Sat, 7 Sep 2024 19:19:50 -0700 Subject: [PATCH 2/2] adjust sconstruct file to reflect other valid fpga types, and get updated versions of apicula when available --- apio/resources/distribution.json | 2 +- apio/resources/gowin/SConstruct | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apio/resources/distribution.json b/apio/resources/distribution.json index 1dcad16a..36e5e35a 100644 --- a/apio/resources/distribution.json +++ b/apio/resources/distribution.json @@ -11,6 +11,6 @@ "tinyfpgab": ">=1.1.0,<1.2.0", "tinyprog": ">=1.0.21,<1.1.0", "icefunprog": ">=2.0.3,<3.0.0", - "apycula": "0.12" + "apycula": ">=0.12" } } diff --git a/apio/resources/gowin/SConstruct b/apio/resources/gowin/SConstruct index 369c311c..e7e7d1ea 100644 --- a/apio/resources/gowin/SConstruct +++ b/apio/resources/gowin/SConstruct @@ -42,15 +42,15 @@ for warn in VERILATOR_WARN: -# -- Size. Possible values: 20k -# -- Type. Possible values: gw2ar +# -- Size. Possible values: 1k, 4k, 9k, 20k +# -- Type. Possible values: gw1nz-1, gw1ns-4, gw1n-9c, gw2a-18c # -- Package. Unused. # -- Add the FPGA flags as variables to be shown with the -h scons option vars = Variables() -vars.Add('fpga_size', 'Set the Gowin FPGA size (25k)', FPGA_SIZE) -vars.Add('fpga_type', 'Set the Gowin FPGA type (gw5a)', FPGA_TYPE) +vars.Add('fpga_size', 'Set the Gowin FPGA size (20k)', FPGA_SIZE) +vars.Add('fpga_type', 'Set the Gowin FPGA type (gw2a-18c)', FPGA_TYPE) vars.Add('fpga_pack', 'Set the Gowin FPGA packages', FPGA_PACK) vars.Add('fpga_model', 'Set a specific Gowin FPGA model', FPGA_MODEL)