From 6e0311efcaea8020d3e137e2708ec188eef8a74c Mon Sep 17 00:00:00 2001 From: Arjen Roodselaar Date: Sat, 17 Dec 2022 15:50:14 -0800 Subject: Timeout when legal placement can't be found for cell --- common/place/placer_heap.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/place/placer_heap.cc b/common/place/placer_heap.cc index 0dfc29e6..22b97a6c 100644 --- a/common/place/placer_heap.cc +++ b/common/place/placer_heap.cc @@ -862,6 +862,7 @@ class HeAPPlacer int radius = 0; int iter = 0; int iter_at_radius = 0; + int total_iters_for_cell = 0; bool placed = false; BelId bestBel; int best_inp_len = std::numeric_limits::max(); @@ -880,9 +881,9 @@ class HeAPPlacer while (!placed) { // Set a conservative timeout - if (iter > std::max(10000, 3 * int(ctx->cells.size()))) - log_error("Unable to find legal placement for cell '%s', check constraints and utilisation.\n", - ctx->nameOf(ci)); + if (total_iters_for_cell > std::max(10000, 3 * int(ctx->cells.size()))) + log_error("Unable to find legal placement for cell '%s' after %d attempts, check constraints and utilisation.\n", + ctx->nameOf(ci), total_iters_for_cell); // Determine a search radius around the solver location (which increases over time) that is clamped to // the region constraint for the cell (if applicable) @@ -1084,6 +1085,8 @@ class HeAPPlacer break; } } + + total_iters_for_cell++; } } auto endt = std::chrono::high_resolution_clock::now(); -- cgit v1.2.3