aboutsummaryrefslogtreecommitdiffstats
path: root/common/command.cc
diff options
context:
space:
mode:
authorDavid Shah <dave@ds0.me>2020-02-03 11:54:38 +0000
committerDavid Shah <dave@ds0.me>2020-02-03 11:54:38 +0000
commit7123209324c93297efab6c2b2fc92286196be3fb (patch)
tree537ed003aa78a2d7d0548a6fa4d8f9fe96feb0ac /common/command.cc
parent25f57a1e387dd3155cf1dacb14657f000ad02fc8 (diff)
downloadnextpnr-7123209324c93297efab6c2b2fc92286196be3fb.tar.gz
nextpnr-7123209324c93297efab6c2b2fc92286196be3fb.tar.bz2
nextpnr-7123209324c93297efab6c2b2fc92286196be3fb.zip
Allow selection of router algorithm
Signed-off-by: David Shah <dave@ds0.me>
Diffstat (limited to 'common/command.cc')
-rw-r--r--common/command.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/common/command.cc b/common/command.cc
index 3866caca..f652ce67 100644
--- a/common/command.cc
+++ b/common/command.cc
@@ -132,6 +132,12 @@ po::options_description CommandHandler::getGeneralOptions()
"; default: " + Arch::defaultPlacer)
.c_str());
+ general.add_options()(
+ "router", po::value<std::string>(),
+ std::string("router algorithm to use; available: " + boost::algorithm::join(Arch::availableRouters, ", ") +
+ "; default: " + Arch::defaultPlacer)
+ .c_str());
+
general.add_options()("slack_redist_iter", po::value<int>(), "number of iterations between slack redistribution");
general.add_options()("cstrweight", po::value<float>(), "placer weighting for relative constraint satisfaction");
general.add_options()("starttemp", po::value<float>(), "placer SA start temperature");
@@ -214,6 +220,15 @@ void CommandHandler::setupContext(Context *ctx)
ctx->settings[ctx->id("placer")] = placer;
}
+ if (vm.count("router")) {
+ std::string router = vm["router"].as<std::string>();
+ if (std::find(Arch::availableRouters.begin(), Arch::availableRouters.end(), router) ==
+ Arch::availableRouters.end())
+ log_error("Router algorithm '%s' is not supported (available options: %s)\n", router.c_str(),
+ boost::algorithm::join(Arch::availableRouters, ", ").c_str());
+ ctx->settings[ctx->id("router")] = router;
+ }
+
if (vm.count("cstrweight")) {
ctx->settings[ctx->id("placer1/constraintWeight")] = std::to_string(vm["cstrweight"].as<float>());
}
@@ -244,6 +259,8 @@ void CommandHandler::setupContext(Context *ctx)
ctx->settings[ctx->id("auto_freq")] = false;
if (ctx->settings.find(ctx->id("placer")) == ctx->settings.end())
ctx->settings[ctx->id("placer")] = Arch::defaultPlacer;
+ if (ctx->settings.find(ctx->id("router")) == ctx->settings.end())
+ ctx->settings[ctx->id("router")] = Arch::defaultRouter;
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));