diff options
-rw-r--r-- | ice40/arch.h | 7 | ||||
-rw-r--r-- | ice40/arch_place.cc | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/ice40/arch.h b/ice40/arch.h index e8c597c9..10255dbe 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -884,6 +884,13 @@ struct Arch : BaseCtx } NPNR_ASSERT_FALSE("Expected PLL pin to share an output with an SB_IO D_IN_{0,1}"); } + + int getDrivenGlobalNetwork(BelId bel) const + { + NPNR_ASSERT(getBelType(bel) == id_SB_GB); + IdString glb_net = getWireName(getBelPinWire(bel, id_GLOBAL_BUFFER_OUTPUT)); + return std::stoi(std::string("") + glb_net.str(this).back()); + } }; void ice40DelayFuzzerMain(Context *ctx); diff --git a/ice40/arch_place.cc b/ice40/arch_place.cc index 41f9b640..90bb62b9 100644 --- a/ice40/arch_place.cc +++ b/ice40/arch_place.cc @@ -165,8 +165,7 @@ bool Arch::isValidBelForCell(CellInfo *cell, BelId bel) const return true; NPNR_ASSERT(cell->ports.at(id_GLOBAL_BUFFER_OUTPUT).net != nullptr); const NetInfo *net = cell->ports.at(id_GLOBAL_BUFFER_OUTPUT).net; - IdString glb_net = getWireName(getBelPinWire(bel, id_GLOBAL_BUFFER_OUTPUT)); - int glb_id = std::stoi(std::string("") + glb_net.str(this).back()); + int glb_id = getDrivenGlobalNetwork(bel); if (net->is_reset && net->is_enable) return false; else if (net->is_reset) |