From 3da470048a43ffb1175680f3673e41acded0e582 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Sun, 1 Sep 2024 09:53:24 +0200 Subject: [PATCH 1/2] build/gowin/apicula: append _synth_opts with specific requirements according to FPGA model --- litex/build/gowin/apicula.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/litex/build/gowin/apicula.py b/litex/build/gowin/apicula.py index 7b631ba52..364e4771d 100644 --- a/litex/build/gowin/apicula.py +++ b/litex/build/gowin/apicula.py @@ -40,6 +40,10 @@ class GowinApiculaToolchain(YosysNextPNRToolchain): elif devicename == "GW2AR-18": devicename = "GW2A-18" + # yosys doesn't know that some variant doesn't have lutram so we tell it + if devicename in ["GW1NS-4"]: + self._synth_opts += " -nolutram" + pnr_opts = "--write {top}_routed.json --top {top} --device {device}" + \ " --vopt family={devicename} --vopt cst={top}.cst" self._pnr_opts += pnr_opts.format( From babe233407fe8a9c86ba5dcff6cc000543ec3d08 Mon Sep 17 00:00:00 2001 From: Gwenhael Goavec-Merou Date: Sun, 1 Sep 2024 09:55:01 +0200 Subject: [PATCH 2/2] build/gowin/apicula: only append _packer_opts with known use_xxx (drop options only required by Gowin's software) --- litex/build/gowin/apicula.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litex/build/gowin/apicula.py b/litex/build/gowin/apicula.py index 364e4771d..83d3dea8b 100644 --- a/litex/build/gowin/apicula.py +++ b/litex/build/gowin/apicula.py @@ -60,7 +60,9 @@ class GowinApiculaToolchain(YosysNextPNRToolchain): # use_mspi_as_gpio and friends for option, value in self.options.items(): if option.startswith("use_") and value: - self._packer_opts += " --" + option[4:] + # Not all options are supported and may be just Gowin's software check + if option not in ["use_mode_as_gpio"]: + self._packer_opts += " --" + option[4:] YosysNextPNRToolchain.finalize(self)