aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-06-25 19:42:53 +0100
committerDavid Shah <dave@ds0.me>2020-06-25 19:42:53 +0100
commit1df8ac805a1e4dd1642312f45d21f1e707defa48 (patch)
tree7c00d191fec2aef513deb521310d0d6486130a3d
parent19a3095ecba7764cc91b0f026029a78f8d0d019f (diff)
downloadnextpnr-1df8ac805a1e4dd1642312f45d21f1e707defa48.tar.gz
nextpnr-1df8ac805a1e4dd1642312f45d21f1e707defa48.tar.bz2
nextpnr-1df8ac805a1e4dd1642312f45d21f1e707defa48.zip
HeAP: Add timeout to IO placement
Signed-off-by: David Shah <dave@ds0.me>
-rw-r--r--common/placer_heap.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/placer_heap.cc b/common/placer_heap.cc
index 8c43c433..790c2230 100644
--- a/common/placer_heap.cc
+++ b/common/placer_heap.cc
@@ -542,10 +542,14 @@ class HeAPPlacer
cell_locs[cell.first].global = ctx->getBelGlobalBuf(ci->bel);
} else if (ci->constr_parent == nullptr) {
bool placed = false;
+ int attempt_count = 0;
while (!placed) {
if (!available_bels.count(ci->type) || available_bels.at(ci->type).empty())
log_error("Unable to place cell '%s', no Bels remaining of type '%s'\n", ci->name.c_str(ctx),
ci->type.c_str(ctx));
+ ++attempt_count;
+ if (attempt_count > 25000)
+ log_error("Unable to find a placement location for cell '%s'\n", ci->name.c_str(ctx));
BelId bel = available_bels.at(ci->type).back();
available_bels.at(ci->type).pop_back();
Loc loc = ctx->getBelLocation(bel);