diff options
author | gatecat <gatecat@ds0.me> | 2021-05-11 11:35:43 +0100 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-05-11 11:35:43 +0100 |
commit | b3b79122e1330f5c1e3fe5280fd3672227cc4d3d (patch) | |
tree | df117192557594fca60fe78d39967d1f4857e593 | |
parent | 466de95312c366aaf09b2f542b1e09d2ce9d1075 (diff) | |
download | nextpnr-b3b79122e1330f5c1e3fe5280fd3672227cc4d3d.tar.gz nextpnr-b3b79122e1330f5c1e3fe5280fd3672227cc4d3d.tar.bz2 nextpnr-b3b79122e1330f5c1e3fe5280fd3672227cc4d3d.zip |
command: Allow debug output for just placer or router
Signed-off-by: gatecat <gatecat@ds0.me>
-rw-r--r-- | common/command.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/common/command.cc b/common/command.cc index 0dabc1e5..5f19e01b 100644 --- a/common/command.cc +++ b/common/command.cc @@ -106,6 +106,9 @@ po::options_description CommandHandler::getGeneralOptions() general.add_options()("log,l", po::value<std::string>(), "log file, all log messages are written to this file regardless of -q"); general.add_options()("debug", "debug output"); + general.add_options()("debug-placer", "debug output from placer only"); + general.add_options()("debug-router", "debug output from router only"); + general.add_options()("force,f", "keep running after errors"); #ifndef NO_GUI general.add_options()("gui", "start gui"); @@ -374,8 +377,12 @@ int CommandHandler::executeMain(std::unique_ptr<Context> ctx) if (do_place) { run_script_hook("pre-place"); + bool saved_debug = ctx->debug; + if (vm.count("debug-placer")) + ctx->debug = true; if (!ctx->place() && !ctx->force) log_error("Placing design failed.\n"); + ctx->debug = saved_debug; ctx->check(); if (vm.count("placed-svg")) ctx->writeSVG(vm["placed-svg"].as<std::string>(), "scale=50 hide_routing"); @@ -383,8 +390,12 @@ int CommandHandler::executeMain(std::unique_ptr<Context> ctx) if (do_route) { run_script_hook("pre-route"); + bool saved_debug = ctx->debug; + if (vm.count("debug-router")) + ctx->debug = true; if (!ctx->route() && !ctx->force) log_error("Routing design failed.\n"); + ctx->debug = saved_debug; run_script_hook("post-route"); if (vm.count("routed-svg")) ctx->writeSVG(vm["routed-svg"].as<std::string>(), "scale=500"); |