diff options
-rw-r--r-- | common/idstringlist.h | 2 | ||||
-rw-r--r-- | gowin/main.cc | 2 | ||||
-rw-r--r-- | ice40/pack.cc | 7 |
3 files changed, 6 insertions, 5 deletions
diff --git a/common/idstringlist.h b/common/idstringlist.h index 4af9801a..fd57540b 100644 --- a/common/idstringlist.h +++ b/common/idstringlist.h @@ -35,7 +35,7 @@ struct IdStringList { SSOArray<IdString, 4> ids; - IdStringList(){}; + IdStringList() : ids(1, IdString()){}; explicit IdStringList(size_t n) : ids(n, IdString()){}; explicit IdStringList(IdString id) : ids(1, id){}; template <typename Tlist> explicit IdStringList(const Tlist &list) : ids(list){}; diff --git a/gowin/main.cc b/gowin/main.cc index 1d40bdc4..a56cc8e8 100644 --- a/gowin/main.cc +++ b/gowin/main.cc @@ -67,7 +67,7 @@ std::unique_ptr<Context> GowinCommandHandler::createContext(dict<std::string, Pr // 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. - if(match[1].str() == "S") { + if (match[1].str() == "S") { snprintf(buf, 36, "GW1NS-%s", match[3].str().c_str()); } else { snprintf(buf, 36, "GW1N-%s", match[3].str().c_str()); diff --git a/ice40/pack.cc b/ice40/pack.cc index 67c3dbb7..0db78992 100644 --- a/ice40/pack.cc +++ b/ice40/pack.cc @@ -1271,11 +1271,12 @@ static void pack_special(Context *ctx) {std::make_tuple(id_SB_SPI, "0b0010"), Loc(25, 0, 1)}, {std::make_tuple(id_SB_I2C, "0b0011"), Loc(25, 31, 0)}, }; - if (map_ba74.find(std::make_tuple(ci->type, ci->params[ctx->id("BUS_ADDR74")].as_string())) == - map_ba74.end()) + std::string bus_addr74 = + str_or_default(ci->params, ctx->id("BUS_ADDR74"), is_sb_i2c(ctx, ci) ? "0b0001" : "0b0000"); + if (map_ba74.find(std::make_tuple(ci->type, bus_addr74)) == map_ba74.end()) log_error("Invalid value for BUS_ADDR74 for cell '%s' of type '%s'\n", ci->name.c_str(ctx), ci->type.c_str(ctx)); - Loc bel_loc = map_ba74.at(std::make_tuple(ci->type, ci->params[ctx->id("BUS_ADDR74")].as_string())); + Loc bel_loc = map_ba74.at(std::make_tuple(ci->type, bus_addr74)); BelId bel = ctx->getBelByLocation(bel_loc); if (bel == BelId() || ctx->getBelType(bel) != ci->type) log_error("Unable to find placement for cell '%s' of type '%s'\n", ci->name.c_str(ctx), |