diff options
author | gatecat <gatecat@ds0.me> | 2021-02-18 10:47:39 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-18 10:47:39 +0000 |
commit | cbff1e13712438648c595e5a62d7cfd34304e2f2 (patch) | |
tree | 6ad8348efbbde8635ab4e29775de644e750634fd /common | |
parent | f6dc2dd1986719f73c91c76d24248d6097dc7039 (diff) | |
parent | 456688a49d30960f14234bb890fbeaa0bf1de3fc (diff) | |
download | nextpnr-cbff1e13712438648c595e5a62d7cfd34304e2f2.tar.gz nextpnr-cbff1e13712438648c595e5a62d7cfd34304e2f2.tar.bz2 nextpnr-cbff1e13712438648c595e5a62d7cfd34304e2f2.zip |
Merge pull request #590 from cbalint13/master
Expose ice40 arch placer-heap internal parameters.
Diffstat (limited to 'common')
-rw-r--r-- | common/command.cc | 28 | ||||
-rw-r--r-- | common/placer_heap.cc | 8 |
2 files changed, 32 insertions, 4 deletions
diff --git a/common/command.cc b/common/command.cc index d3e8af8d..2303ad91 100644 --- a/common/command.cc +++ b/common/command.cc @@ -161,6 +161,11 @@ po::options_description CommandHandler::getGeneralOptions() general.add_options()("no-print-critical-path-source", "disable printing of the line numbers associated with each net in the critical path"); + general.add_options()("placer-heap-alpha", po::value<float>(), "placer heap alpha value (float, default: 0.1)"); + general.add_options()("placer-heap-beta", po::value<float>(), "placer heap beta value (float, default: 0.9)"); + general.add_options()("placer-heap-critexp", po::value<int>(), "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()("placed-svg", po::value<std::string>(), "write render of placement to SVG file"); general.add_options()("routed-svg", po::value<std::string>(), "write render of routing to SVG file"); @@ -258,6 +263,18 @@ void CommandHandler::setupContext(Context *ctx) if (vm.count("no-tmdriv")) ctx->settings[ctx->id("timing_driven")] = false; + if (vm.count("placer-heap-alpha")) + ctx->settings[ctx->id("placerHeap/alpha")] = std::to_string(vm["placer-heap-alpha"].as<float>()); + + if (vm.count("placer-heap-beta")) + ctx->settings[ctx->id("placerHeap/beta")] = std::to_string(vm["placer-heap-beta"].as<float>()); + + if (vm.count("placer-heap-critexp")) + ctx->settings[ctx->id("placerHeap/criticalityExponent")] = std::to_string(vm["placer-heap-critexp"].as<int>()); + + if (vm.count("placer-heap-timingweight")) + ctx->settings[ctx->id("placerHeap/timingWeight")] = std::to_string(vm["placer-heap-timingweight"].as<int>()); + // Setting default values if (ctx->settings.find(ctx->id("target_freq")) == ctx->settings.end()) ctx->settings[ctx->id("target_freq")] = std::to_string(12e6); @@ -275,6 +292,15 @@ void CommandHandler::setupContext(Context *ctx) ctx->settings[ctx->id("arch.name")] = std::string(ctx->archId().c_str(ctx)); ctx->settings[ctx->id("arch.type")] = std::string(ctx->archArgsToId(ctx->archArgs()).c_str(ctx)); ctx->settings[ctx->id("seed")] = ctx->rngstate; + + if (ctx->settings.find(ctx->id("placerHeap/alpha")) == ctx->settings.end()) + ctx->settings[ctx->id("placerHeap/alpha")] = std::to_string(0.1); + if (ctx->settings.find(ctx->id("placerHeap/beta")) == ctx->settings.end()) + ctx->settings[ctx->id("placerHeap/beta")] = std::to_string(0.9); + if (ctx->settings.find(ctx->id("placerHeap/criticalityExponent")) == ctx->settings.end()) + ctx->settings[ctx->id("placerHeap/criticalityExponent")] = std::to_string(2); + if (ctx->settings.find(ctx->id("placerHeap/timingWeight")) == ctx->settings.end()) + ctx->settings[ctx->id("placerHeap/timingWeight")] = std::to_string(10); } int CommandHandler::executeMain(std::unique_ptr<Context> ctx) @@ -421,6 +447,8 @@ int CommandHandler::exec() setupArchContext(ctx.get()); int rc = executeMain(std::move(ctx)); printFooter(); + log_break(); + log_info("Program finished normally.\n"); return rc; } catch (log_execution_error_exception) { printFooter(); diff --git a/common/placer_heap.cc b/common/placer_heap.cc index 7d529401..92caaf09 100644 --- a/common/placer_heap.cc +++ b/common/placer_heap.cc @@ -1764,10 +1764,10 @@ bool placer_heap(Context *ctx, PlacerHeapCfg cfg) { return HeAPPlacer(ctx, cfg). PlacerHeapCfg::PlacerHeapCfg(Context *ctx) { - alpha = ctx->setting<float>("placerHeap/alpha", 0.1); - beta = ctx->setting<float>("placerHeap/beta", 0.9); - criticalityExponent = ctx->setting<int>("placerHeap/criticalityExponent", 2); - timingWeight = ctx->setting<int>("placerHeap/timingWeight", 10); + alpha = ctx->setting<float>("placerHeap/alpha"); + beta = ctx->setting<float>("placerHeap/beta"); + criticalityExponent = ctx->setting<int>("placerHeap/criticalityExponent"); + timingWeight = ctx->setting<int>("placerHeap/timingWeight"); timing_driven = ctx->setting<bool>("timing_driven"); solverTolerance = 1e-5; placeAllAtOnce = false; |