aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2019-11-26 10:16:27 +0000
committerDavid Shah <dave@ds0.me>2019-11-26 10:16:27 +0000
commit523ed4cfb2e37d23d40a56d77c082e3ea42f9082 (patch)
tree24caf8b43f2370b4d752f44b83ebcf7401e18d0b
parentdefafcf5fee8a6dac4a4d147751823aae7c2288b (diff)
downloadnextpnr-523ed4cfb2e37d23d40a56d77c082e3ea42f9082.tar.gz
nextpnr-523ed4cfb2e37d23d40a56d77c082e3ea42f9082.tar.bz2
nextpnr-523ed4cfb2e37d23d40a56d77c082e3ea42f9082.zip
HeAP: improve error handling when stuck
Signed-off-by: David Shah <dave@ds0.me>
-rw-r--r--common/placer_heap.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/common/placer_heap.cc b/common/placer_heap.cc
index bbca2014..4a380a04 100644
--- a/common/placer_heap.cc
+++ b/common/placer_heap.cc
@@ -774,6 +774,7 @@ class HeAPPlacer
}
int ripup_radius = 2;
int total_iters = 0;
+ int total_iters_noreset = 0;
while (!remaining.empty()) {
auto top = remaining.top();
remaining.pop();
@@ -793,13 +794,23 @@ class HeAPPlacer
int best_inp_len = std::numeric_limits<int>::max();
total_iters++;
+ total_iters_noreset++;
if (total_iters > int(solve_cells.size())) {
total_iters = 0;
ripup_radius = std::max(std::max(max_x, max_y), ripup_radius * 2);
}
+ if (total_iters_noreset > std::max(50000, 1000 * int(ctx->cells.size()))) {
+ log_error("Unable to find legal placement for all cells, design is probably at utilisation limit.\n");
+ }
+
while (!placed) {
+ // Set a conservative timeout
+ if (iter > std::max(1000, 3 * int(ctx->cells.size())))
+ log_error("Unable to find legal placement for cell '%s', check constraints and utilisation.\n",
+ ctx->nameOf(ci));
+
int rx = radius, ry = radius;
if (ci->region != nullptr) {