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 /common/placer1.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 'common/placer1.cc')
-rw-r--r-- | common/placer1.cc | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/common/placer1.cc b/common/placer1.cc index 280dd02e..270430e9 100644 --- a/common/placer1.cc +++ b/common/placer1.cc @@ -167,13 +167,6 @@ class SAPlacer "\'%s\' of type \'%s\'\n", loc_name.c_str(), bel_type.c_str(ctx), cell->name.c_str(ctx), cell->type.c_str(ctx)); } - if (!ctx->isValidBelForCell(cell, bel)) { - IdString bel_type = ctx->getBelType(bel); - log_error("Bel \'%s\' of type \'%s\' is not valid for cell " - "\'%s\' of type \'%s\'\n", - loc_name.c_str(), bel_type.c_str(ctx), cell->name.c_str(ctx), cell->type.c_str(ctx)); - } - auto bound_cell = ctx->getBoundBelCell(bel); if (bound_cell) { log_error( @@ -182,6 +175,12 @@ class SAPlacer } ctx->bindBel(bel, cell, STRENGTH_USER); + if (!ctx->isBelLocationValid(bel)) { + IdString bel_type = ctx->getBelType(bel); + log_error("Bel \'%s\' of type \'%s\' is not valid for cell " + "\'%s\' of type \'%s\'\n", + loc_name.c_str(), bel_type.c_str(ctx), cell->name.c_str(ctx), cell->type.c_str(ctx)); + } locked_bels.insert(bel); placed_cells++; } @@ -444,7 +443,7 @@ class SAPlacer IdString targetType = cell->type; auto proc_bel = [&](BelId bel) { - if (ctx->isValidBelForCellType(targetType, bel) && ctx->isValidBelForCell(cell, bel)) { + if (ctx->isValidBelForCellType(targetType, bel)) { if (ctx->checkBelAvail(bel)) { uint64_t score = ctx->rng64(); if (score <= best_score) { @@ -480,10 +479,20 @@ class SAPlacer ctx->unbindBel(ripup_target->bel); best_bel = ripup_bel; } else { + ripup_target = nullptr; all_placed = true; } ctx->bindBel(best_bel, cell, STRENGTH_WEAK); + if (!ctx->isBelLocationValid(best_bel)) { + ctx->unbindBel(best_bel); + if (ripup_target != nullptr) { + ctx->bindBel(best_bel, ripup_target, STRENGTH_WEAK); + } + all_placed = false; + continue; + } + // Back annotate location cell->attrs[ctx->id("BEL")] = ctx->getBelName(cell->bel).str(ctx); cell = ripup_target; |