diff options
author | Arjen Roodselaar <arjen@oxide.computer> | 2022-12-19 22:58:52 -0800 |
---|---|---|
committer | Arjen Roodselaar <arjen@oxide.computer> | 2022-12-19 22:58:52 -0800 |
commit | d5299f144f0dc8cdcca9195d8ffbbd5a77cff77e (patch) | |
tree | bafa90652a5ffe19dd0b1e0ea0921df505949135 /common/place | |
parent | 2712cbf6e4289eb9c1830e367d68072e3d1f7564 (diff) | |
download | nextpnr-d5299f144f0dc8cdcca9195d8ffbbd5a77cff77e.tar.gz nextpnr-d5299f144f0dc8cdcca9195d8ffbbd5a77cff77e.tar.bz2 nextpnr-d5299f144f0dc8cdcca9195d8ffbbd5a77cff77e.zip |
Add --no-placer-timeout flag to override timeout during refinement
Diffstat (limited to 'common/place')
-rw-r--r-- | common/place/placer_heap.cc | 12 | ||||
-rw-r--r-- | common/place/placer_heap.h | 1 |
2 files changed, 8 insertions, 5 deletions
diff --git a/common/place/placer_heap.cc b/common/place/placer_heap.cc index 4ee9b909..69edd325 100644 --- a/common/place/placer_heap.cc +++ b/common/place/placer_heap.cc @@ -828,6 +828,11 @@ class HeAPPlacer // Strict placement legalisation, performed after the initial HeAP spreading void legalise_placement_strict(bool require_validity = false) { + int placement_timeout = cfg.no_placement_timeout ? 0 : + // Set a conservative timeout. This is a rather large number and could probably be + // shaved down, but for now it will keep the process from running indefinite. + std::max(10000, (int(ctx->cells.size()) * int(ctx->cells.size()) / 8) + 1); + auto startt = std::chrono::high_resolution_clock::now(); // Unbind all cells placed in this solution @@ -879,11 +884,7 @@ class HeAPPlacer } while (!placed) { - // Set a conservative timeout. This is a rather large number and could probably be - // shaved down, but for now it will keep the process from running indefinite. - int timeout_limit = (int(ctx->cells.size()) * int(ctx->cells.size()) / 8) + 1; - - if (total_iters_for_cell > std::max(10000, timeout_limit)) + if (placement_timeout > 0 && total_iters_for_cell > placement_timeout) 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); @@ -1818,6 +1819,7 @@ PlacerHeapCfg::PlacerHeapCfg(Context *ctx) timing_driven = ctx->setting<bool>("timing_driven"); solverTolerance = 1e-5; placeAllAtOnce = false; + no_placement_timeout = ctx->setting<bool>("placerHeap/noTimeout", false); hpwl_scale_x = 1; hpwl_scale_y = 1; diff --git a/common/place/placer_heap.h b/common/place/placer_heap.h index 9c62869e..680e1dc7 100644 --- a/common/place/placer_heap.h +++ b/common/place/placer_heap.h @@ -42,6 +42,7 @@ struct PlacerHeapCfg float solverTolerance; bool placeAllAtOnce; bool parallelRefine; + bool no_placement_timeout; int hpwl_scale_x, hpwl_scale_y; int spread_scale_x, spread_scale_y; |