aboutsummaryrefslogtreecommitdiffstats
path: root/gowin/main.cc
diff options
context:
space:
mode:
authorIcenowy Zheng <icenowy@aosc.io>2022-01-24 23:54:09 +0800
committerPepijn de Vos <pepijndevos@gmail.com>2022-02-06 12:01:51 +0100
commit230de1e68afb0f7c57f64bd1b35850e529395d92 (patch)
treebcf3bd6f7ef7088025d7406e67a16345fcc6c35f /gowin/main.cc
parent4b72f02255df435f4ed1c5eaaab03434aa8168fe (diff)
downloadnextpnr-230de1e68afb0f7c57f64bd1b35850e529395d92.tar.gz
nextpnr-230de1e68afb0f7c57f64bd1b35850e529395d92.tar.bz2
nextpnr-230de1e68afb0f7c57f64bd1b35850e529395d92.zip
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 <icenowy@aosc.io>
Diffstat (limited to 'gowin/main.cc')
-rw-r--r--gowin/main.cc17
1 files 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<std::string>(), "device name");
+ specific.add_options()("family", po::value<std::string>(), "family name");
specific.add_options()("cst", po::value<std::string>(), "physical constraints file");
return specific;
}
@@ -62,12 +63,16 @@ std::unique_ptr<Context> GowinCommandHandler::createContext(dict<std::string, Pr
}
ArchArgs chipArgs;
chipArgs.gui = vm.count("gui") != 0;
- 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;
+ if (vm.count("family")) {
+ chipArgs.family = vm["family"].as<std::string>();
+ } 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<Context>(new Context(chipArgs));
}