diff options
author | gatecat <gatecat@ds0.me> | 2021-02-17 08:50:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-17 08:50:31 +0000 |
commit | a77ceec5cf5603542d87724d9fdc51d48fa29327 (patch) | |
tree | daba555e135e64e112e5167aa4eba4c3048a6b8e /ecp5/globals.cc | |
parent | a74d1a8b328252c2c07e7af7b9e9bb0e5f251bb5 (diff) | |
parent | c7c13cd95f7a25b2c8932ca00ad667ffca381c70 (diff) | |
download | nextpnr-a77ceec5cf5603542d87724d9fdc51d48fa29327.tar.gz nextpnr-a77ceec5cf5603542d87724d9fdc51d48fa29327.tar.bz2 nextpnr-a77ceec5cf5603542d87724d9fdc51d48fa29327.zip |
Merge pull request #585 from YosysHQ/gatecat/remove-ivbfc
Remove isValidBelForCell
Diffstat (limited to 'ecp5/globals.cc')
-rw-r--r-- | ecp5/globals.cc | 50 |
1 files changed, 26 insertions, 24 deletions
diff --git a/ecp5/globals.cc b/ecp5/globals.cc index 1a0b7f2f..36bec64c 100644 --- a/ecp5/globals.cc +++ b/ecp5/globals.cc @@ -403,33 +403,35 @@ class Ecp5GlobalRouter bool dedicated_routing = false; for (auto bel : ctx->getBels()) { if (ctx->getBelType(bel) == id_DCCA && ctx->checkBelAvail(bel)) { - if (ctx->isValidBelForCell(dcc, bel)) { - std::string belname = ctx->loc_info(bel)->bel_data[bel.index].name.get(); - if (belname.at(0) == 'D' && using_ce) - continue; // don't allow DCCs with CE at center - ctx->bindBel(bel, dcc, STRENGTH_LOCKED); - wirelen_t wirelen = get_dcc_wirelen(dcc, dedicated_routing); - if (wirelen < best_wirelen) { - if (dedicated_routing) { - best_bel_pclkcib = WireId(); - } else { - bool found_pclkcib = false; - for (WireId pclkcib : get_candidate_pclkcibs(bel)) { - if (used_pclkcib.count(pclkcib)) - continue; - found_pclkcib = true; - best_bel_pclkcib = pclkcib; - break; - } - if (!found_pclkcib) - goto pclkcib_fail; + std::string belname = ctx->loc_info(bel)->bel_data[bel.index].name.get(); + if (belname.at(0) == 'D' && using_ce) + continue; // don't allow DCCs with CE at center + ctx->bindBel(bel, dcc, STRENGTH_LOCKED); + if (!ctx->isBelLocationValid(bel)) { + ctx->unbindBel(bel); + continue; + } + wirelen_t wirelen = get_dcc_wirelen(dcc, dedicated_routing); + if (wirelen < best_wirelen) { + if (dedicated_routing) { + best_bel_pclkcib = WireId(); + } else { + bool found_pclkcib = false; + for (WireId pclkcib : get_candidate_pclkcibs(bel)) { + if (used_pclkcib.count(pclkcib)) + continue; + found_pclkcib = true; + best_bel_pclkcib = pclkcib; + break; } - best_bel = bel; - best_wirelen = wirelen; + if (!found_pclkcib) + goto pclkcib_fail; } - pclkcib_fail: - ctx->unbindBel(bel); + best_bel = bel; + best_wirelen = wirelen; } + pclkcib_fail: + ctx->unbindBel(bel); } } NPNR_ASSERT(best_bel != BelId()); |