Allow setting cell placement timeout
This commit is contained in:
parent
d5299f144f
commit
923458a2c9
@ -189,7 +189,8 @@ po::options_description CommandHandler::getGeneralOptions()
|
|||||||
general.add_options()("placer-heap-critexp", po::value<int>(),
|
general.add_options()("placer-heap-critexp", po::value<int>(),
|
||||||
"placer heap criticality exponent (int, default: 2)");
|
"placer heap criticality exponent (int, default: 2)");
|
||||||
general.add_options()("placer-heap-timingweight", po::value<int>(), "placer heap timing weight (int, default: 10)");
|
general.add_options()("placer-heap-timingweight", po::value<int>(), "placer heap timing weight (int, default: 10)");
|
||||||
general.add_options()("no-placer-timeout", "allow the placer to attempt placement without timeout");
|
general.add_options()("placer-heap-cell-placement-timeout", po::value<int>(),
|
||||||
|
"allow placer to attempt up to the given number of iterations to place the cell (int, default: design size^2 / 8, 0 for no timeout)");
|
||||||
|
|
||||||
#if !defined(__wasm)
|
#if !defined(__wasm)
|
||||||
general.add_options()("parallel-refine", "use new experimental parallelised engine for placement refinement");
|
general.add_options()("parallel-refine", "use new experimental parallelised engine for placement refinement");
|
||||||
@ -329,8 +330,9 @@ void CommandHandler::setupContext(Context *ctx)
|
|||||||
if (vm.count("placer-heap-timingweight"))
|
if (vm.count("placer-heap-timingweight"))
|
||||||
ctx->settings[ctx->id("placerHeap/timingWeight")] = std::to_string(vm["placer-heap-timingweight"].as<int>());
|
ctx->settings[ctx->id("placerHeap/timingWeight")] = std::to_string(vm["placer-heap-timingweight"].as<int>());
|
||||||
|
|
||||||
if (vm.count("no-placer-timeout"))
|
if (vm.count("placer-heap-cell-placement-timeout"))
|
||||||
ctx->settings[ctx->id("placerHeap/noTimeout")] = true;
|
ctx->settings[ctx->id("placerHeap/cellPlacementTimeout")] =
|
||||||
|
std::to_string(std::max(0, vm["placer-heap-cell-placement-timeout"].as<int>()));
|
||||||
|
|
||||||
if (vm.count("parallel-refine"))
|
if (vm.count("parallel-refine"))
|
||||||
ctx->settings[ctx->id("placerHeap/parallelRefine")] = true;
|
ctx->settings[ctx->id("placerHeap/parallelRefine")] = true;
|
||||||
|
@ -218,6 +218,9 @@ class HeAPPlacer
|
|||||||
|
|
||||||
heap_runs.push_back(all_buckets);
|
heap_runs.push_back(all_buckets);
|
||||||
// The main HeAP placer loop
|
// The main HeAP placer loop
|
||||||
|
if (cfg.cell_placement_timeout > 0)
|
||||||
|
log_info("Running main analytical placer, max placement attempts per cell = %d.\n", cfg.cell_placement_timeout);
|
||||||
|
else
|
||||||
log_info("Running main analytical placer.\n");
|
log_info("Running main analytical placer.\n");
|
||||||
while (stalled < 5 && (solved_hpwl <= legal_hpwl * 0.8)) {
|
while (stalled < 5 && (solved_hpwl <= legal_hpwl * 0.8)) {
|
||||||
// Alternate between particular bel types and all bels
|
// Alternate between particular bel types and all bels
|
||||||
@ -828,11 +831,6 @@ class HeAPPlacer
|
|||||||
// Strict placement legalisation, performed after the initial HeAP spreading
|
// Strict placement legalisation, performed after the initial HeAP spreading
|
||||||
void legalise_placement_strict(bool require_validity = false)
|
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();
|
auto startt = std::chrono::high_resolution_clock::now();
|
||||||
|
|
||||||
// Unbind all cells placed in this solution
|
// Unbind all cells placed in this solution
|
||||||
@ -884,8 +882,8 @@ class HeAPPlacer
|
|||||||
}
|
}
|
||||||
|
|
||||||
while (!placed) {
|
while (!placed) {
|
||||||
if (placement_timeout > 0 && total_iters_for_cell > placement_timeout)
|
if (cfg.cell_placement_timeout > 0 && total_iters_for_cell > cfg.cell_placement_timeout)
|
||||||
log_error("Unable to find legal placement for cell '%s' after %d attempts, check constraints and utilisation.\n",
|
log_error("Unable to find legal placement for cell '%s' after %d attempts, check constraints and utilisation. Use `--placer-heap-cell-placement-timeout` to change the number of attempts.\n",
|
||||||
ctx->nameOf(ci), total_iters_for_cell);
|
ctx->nameOf(ci), total_iters_for_cell);
|
||||||
|
|
||||||
// Determine a search radius around the solver location (which increases over time) that is clamped to
|
// Determine a search radius around the solver location (which increases over time) that is clamped to
|
||||||
@ -1819,7 +1817,10 @@ PlacerHeapCfg::PlacerHeapCfg(Context *ctx)
|
|||||||
timing_driven = ctx->setting<bool>("timing_driven");
|
timing_driven = ctx->setting<bool>("timing_driven");
|
||||||
solverTolerance = 1e-5;
|
solverTolerance = 1e-5;
|
||||||
placeAllAtOnce = false;
|
placeAllAtOnce = false;
|
||||||
no_placement_timeout = ctx->setting<bool>("placerHeap/noTimeout", false);
|
cell_placement_timeout = ctx->setting<int>("placerHeap/cellPlacementTimeout",
|
||||||
|
// Set a conservative default. 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));
|
||||||
|
|
||||||
hpwl_scale_x = 1;
|
hpwl_scale_x = 1;
|
||||||
hpwl_scale_y = 1;
|
hpwl_scale_y = 1;
|
||||||
|
@ -42,7 +42,7 @@ struct PlacerHeapCfg
|
|||||||
float solverTolerance;
|
float solverTolerance;
|
||||||
bool placeAllAtOnce;
|
bool placeAllAtOnce;
|
||||||
bool parallelRefine;
|
bool parallelRefine;
|
||||||
bool no_placement_timeout;
|
int cell_placement_timeout;
|
||||||
|
|
||||||
int hpwl_scale_x, hpwl_scale_y;
|
int hpwl_scale_x, hpwl_scale_y;
|
||||||
int spread_scale_x, spread_scale_y;
|
int spread_scale_x, spread_scale_y;
|
||||||
|
Loading…
Reference in New Issue
Block a user