From b3b79122e1330f5c1e3fe5280fd3672227cc4d3d Mon Sep 17 00:00:00 2001 From: gatecat Date: Tue, 11 May 2021 11:35:43 +0100 Subject: [PATCH] command: Allow debug output for just placer or router Signed-off-by: gatecat --- common/command.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) 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(), "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 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(), "scale=50 hide_routing"); @@ -383,8 +390,12 @@ int CommandHandler::executeMain(std::unique_ptr 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(), "scale=500");