diff --git a/common/kernel/command.cc b/common/kernel/command.cc index 5493173c..6adf7925 100644 --- a/common/kernel/command.cc +++ b/common/kernel/command.cc @@ -391,6 +391,8 @@ po::options_description CommandHandler::getGeneralOptions() "allow placer to attempt up to max(10000, total cells^2 / N) iterations to place a cell (int " "N, default: 8, 0 for no timeout)"); + general.add_options()("placer-heap-no-ctrl-set", "disable control set awareness in placer heap"); + general.add_options()("static-dump-density", "write density csv files during placer-static flow"); #if !defined(NPNR_DISABLE_THREADS) @@ -536,6 +538,9 @@ void CommandHandler::setupContext(Context *ctx) ctx->settings[ctx->id("placerHeap/cellPlacementTimeout")] = std::to_string(std::max(0, vm["placer-heap-cell-placement-timeout"].as())); + if (vm.count("placer-heap-no-ctrl-set")) + ctx->settings[ctx->id("placerHeap/noCtrlSet")] = true; + if (vm.count("parallel-refine")) ctx->settings[ctx->id("placerHeap/parallelRefine")] = true; diff --git a/common/place/placer_heap.cc b/common/place/placer_heap.cc index 7c1cf02e..2eefb950 100644 --- a/common/place/placer_heap.cc +++ b/common/place/placer_heap.cc @@ -559,7 +559,7 @@ class HeAPPlacer void alloc_control_sets() { - if (cfg.ff_bel_bucket == BelBucketId()) + if (cfg.ff_bel_bucket == BelBucketId() || cfg.disableCtrlSet) return; FastBels::FastBelsData *ff_bels; fast_bels.getBelsForBelBucket(cfg.ff_bel_bucket, &ff_bels); @@ -593,7 +593,7 @@ class HeAPPlacer } bool test_ctrl_set(BelId bel, IdString cell) { - if (cfg.ff_bel_bucket == BelBucketId()) + if (cfg.ff_bel_bucket == BelBucketId() || cfg.disableCtrlSet) return true; if (ctx->getBelBucketForBel(bel) != cfg.ff_bel_bucket) return true; @@ -602,7 +602,7 @@ class HeAPPlacer } void bind_ctrl_set(BelId bel, IdString cell) { - if (cfg.ff_bel_bucket == BelBucketId()) + if (cfg.ff_bel_bucket == BelBucketId() || cfg.disableCtrlSet) return; if (ctx->getBelBucketForBel(bel) != cfg.ff_bel_bucket) return; @@ -611,7 +611,7 @@ class HeAPPlacer } void unbind_ctrl_set(BelId bel) { - if (cfg.ff_bel_bucket == BelBucketId()) + if (cfg.ff_bel_bucket == BelBucketId() || cfg.disableCtrlSet) return; if (ctx->getBelBucketForBel(bel) != cfg.ff_bel_bucket) return; @@ -627,7 +627,7 @@ class HeAPPlacer int32_t get_cluster_control_set(ClusterId cluster) { int32_t ctrl_set = -1; - if (cfg.ff_bel_bucket == BelBucketId()) + if (cfg.ff_bel_bucket == BelBucketId() || cfg.disableCtrlSet) return -1; for (auto cell : cluster2cells.at(cluster)) { auto ofs = ctx->getClusterOffset(cell); @@ -1150,7 +1150,7 @@ class HeAPPlacer log_error("Unable to find legal placement for all cells, design is probably at utilisation limit.\n"); } - if (p->cfg.ff_bel_bucket != BelBucketId()) { + if (p->cfg.ff_bel_bucket != BelBucketId() && !p->cfg.disableCtrlSet) { // Try placing based on same control set in window first int32_t ctrl_set = -1; if (ci->cluster != ClusterId()) { @@ -2170,6 +2170,7 @@ PlacerHeapCfg::PlacerHeapCfg(Context *ctx) timingWeight = ctx->setting("placerHeap/timingWeight"); parallelRefine = ctx->setting("placerHeap/parallelRefine", false); netShareWeight = ctx->setting("placerHeap/netShareWeight", 0); + disableCtrlSet = ctx->setting("placerHeap/noCtrlSet", false); timing_driven = ctx->setting("timing_driven"); solverTolerance = 1e-5; @@ -2189,6 +2190,7 @@ PlacerHeapCfg::PlacerHeapCfg(Context *ctx) hpwl_scale_y = 1; spread_scale_x = 1; spread_scale_y = 1; + } NEXTPNR_NAMESPACE_END diff --git a/common/place/placer_heap.h b/common/place/placer_heap.h index 12e86913..8157a2c0 100644 --- a/common/place/placer_heap.h +++ b/common/place/placer_heap.h @@ -60,6 +60,7 @@ struct PlacerHeapCfg // this is an optional callback to prioritise certain cells/clusters for legalisation std::function get_cell_legalisation_weight = [](Context *, CellInfo *) { return 1; }; + bool disableCtrlSet; BelBucketId ff_bel_bucket = BelBucketId(); std::vector> ff_control_set_groups; int ctrl_set_max_radius = 10;