gowin: Recognize models correctly

For example, clearly distinguish between
    GW1N-4
    GW1NR-4
    GW1NS-4
    GW1NSR-4
    GW1NSR-4

Signed-off-by: YRabbit <rabbit@yrabbit.cyou>
This commit is contained in:
YRabbit 2021-12-15 07:56:34 +10:00
parent 762125d3cf
commit 120ed0c42d

View File

@ -65,7 +65,7 @@ std::unique_ptr<Context> GowinCommandHandler::createContext(dict<std::string, Pr
// GW1N and GW1NR variants share the same database. // GW1N and GW1NR variants share the same database.
// Most Gowin devices are a System in Package with some SDRAM wirebonded to a GPIO bank. // 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. // However, it appears that the S series with embedded ARM core are unique silicon.
if (match[1].str() == "S") { if (match[1].str().length() && match[1].str()[0] == 'S') {
snprintf(buf, 36, "GW1NS-%s", match[3].str().c_str()); snprintf(buf, 36, "GW1NS-%s", match[3].str().c_str());
} else { } else {
snprintf(buf, 36, "GW1N-%s", match[3].str().c_str()); snprintf(buf, 36, "GW1N-%s", match[3].str().c_str());