From 230de1e68afb0f7c57f64bd1b35850e529395d92 Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Mon, 24 Jan 2022 23:54:09 +0800 Subject: gowin: add an option to manually specify family In the vendor IDE, there's a device family named GW1N-9C (which seems to mean C revision of GW1N-9), in which the model numbers are all the same with GW1N-9. Add an option to nextpnr-gowin to allow manually specified family for this situation. Signed-off-by: Icenowy Zheng --- gowin/main.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/gowin/main.cc b/gowin/main.cc index fb9df48d..343d922b 100644 --- a/gowin/main.cc +++ b/gowin/main.cc @@ -48,6 +48,7 @@ po::options_description GowinCommandHandler::getArchOptions() { po::options_description specific("Architecture specific options"); specific.add_options()("device", po::value(), "device name"); + specific.add_options()("family", po::value(), "family name"); specific.add_options()("cst", po::value(), "physical constraints file"); return specific; } @@ -62,12 +63,16 @@ std::unique_ptr GowinCommandHandler::createContext(dict(); + } else { + char buf[36]; + // GW1N and GW1NR variants share the same database. + // Most Gowin devices are a System in Package with some SDRAM wirebonded to a GPIO bank. + // However, it appears that the S series with embedded ARM core are unique silicon. + snprintf(buf, 36, "GW1N%s-%s", match[1].str().c_str(), match[3].str().c_str()); + chipArgs.family = buf; + } chipArgs.partnumber = match[0]; return std::unique_ptr(new Context(chipArgs)); } -- cgit v1.2.3