Skip to content

Commit

Permalink
gowin: Himbaechel. Specify the chip variant.
Browse files Browse the repository at this point in the history
For GW2A-18 and GW1N-9 you need to specify the family in addition to partno.

Signed-off-by: YRabbit <[email protected]>
  • Loading branch information
yrabbit authored and gatecat committed Sep 16, 2023
1 parent 682c914 commit 8e84006
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions himbaechel/uarch/gowin/gowin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,19 @@ void GowinImpl::init_database(Arch *arch)
if (args.options.count("family")) {
family = args.options.at("family");
} else {
bool GW2 = args.device == "GW2A-LV18PG256C8/I7";
bool GW2 = args.device.rfind("GW2A", 0) == 0;
if (GW2) {
family = "GW2A-18";
log_error("For the GW2A series you need to specify -vopt family=GW2A-18 or -vopt family=GW2A-18C\n");
} else {
std::regex devicere = std::regex("GW1N([SZ]?)[A-Z]*-(LV|UV|UX)([0-9])(C?).*");
std::smatch match;
if (!std::regex_match(args.device, match, devicere)) {
log_error("Invalid device %s\n", args.device.c_str());
}
family = stringf("GW1N%s-%s", match[1].str().c_str(), match[3].str().c_str());
if (family.rfind("GW1N-9", 0) == 0) {
log_error("For the GW1N-9 series you need to specify -vopt family=GW1N-9 or -vopt family=GW1N-9C\n");
}
}
}

Expand Down

0 comments on commit 8e84006

Please sign in to comment.