aboutsummaryrefslogtreecommitdiffstats
path: root/gowin/main.cc
diff options
context:
space:
mode:
authorGwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>2021-06-18 09:20:24 +0200
committerGwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>2021-07-06 11:40:41 +0200
commit96263058c3682debdbb8d6605373af8dd954fcd0 (patch)
tree66247553e2e287510630441a73296bf685cd8d19 /gowin/main.cc
parent8a9fb810369aeb5eed128ef4e7d4de456ef1ec8f (diff)
downloadnextpnr-96263058c3682debdbb8d6605373af8dd954fcd0.tar.gz
nextpnr-96263058c3682debdbb8d6605373af8dd954fcd0.tar.bz2
nextpnr-96263058c3682debdbb8d6605373af8dd954fcd0.zip
add support for GW1NS-2 family
Signed-off-by: Gwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
Diffstat (limited to 'gowin/main.cc')
-rw-r--r--gowin/main.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/gowin/main.cc b/gowin/main.cc
index 95a7e2c1..01fcf25b 100644
--- a/gowin/main.cc
+++ b/gowin/main.cc
@@ -54,7 +54,7 @@ po::options_description GowinCommandHandler::getArchOptions()
std::unique_ptr<Context> GowinCommandHandler::createContext(dict<std::string, Property> &values)
{
- std::regex devicere = std::regex("GW1N([A-Z]*)-(LV|UV)([0-9])([A-Z]{2}[0-9]+)(C[0-9]/I[0-9])");
+ std::regex devicere = std::regex("GW1N([A-Z]*)-(LV|UV|UX)([0-9])(C?)([A-Z]{2}[0-9]+)(C[0-9]/I[0-9])");
std::smatch match;
std::string device = vm["device"].as<std::string>();
if (!std::regex_match(device, match, devicere)) {
@@ -62,12 +62,13 @@ std::unique_ptr<Context> GowinCommandHandler::createContext(dict<std::string, Pr
}
ArchArgs chipArgs;
char buf[36];
- snprintf(buf, 36, "GW1N%s-%s", match[1].str().c_str(), match[3].str().c_str());
+ snprintf(buf, 36, "GW1N%s-%s%s", match[1].str().c_str(), match[3].str().c_str(),
+ match[4].str().c_str());
chipArgs.device = buf;
- snprintf(buf, 36, "GW1N-%s", match[3].str().c_str());
+ snprintf(buf, 36, "GW1N%s-%s", match[1].str().c_str(), match[3].str().c_str());
chipArgs.family = buf;
- chipArgs.package = match[4];
- chipArgs.speed = match[5];
+ chipArgs.package = match[5];
+ chipArgs.speed = match[6];
return std::unique_ptr<Context>(new Context(chipArgs));
}