From d2007a386c1a2db7917d7048ea6206ae1218d141 Mon Sep 17 00:00:00 2001 From: gatecat Date: Thu, 29 Jul 2021 12:52:33 +0100 Subject: common: Add JSON timing and utilisation report Signed-off-by: gatecat --- common/command.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'common/command.cc') diff --git a/common/command.cc b/common/command.cc index 7f276193..c175cd27 100644 --- a/common/command.cc +++ b/common/command.cc @@ -173,6 +173,9 @@ po::options_description CommandHandler::getGeneralOptions() general.add_options()("router2-heatmap", po::value(), "prefix for router2 resource congestion heatmaps"); + general.add_options()("report", po::value(), + "write timing and utilization report in JSON format to file"); + general.add_options()("placed-svg", po::value(), "write render of placement to SVG file"); general.add_options()("routed-svg", po::value(), "write render of routing to SVG file"); @@ -424,6 +427,14 @@ int CommandHandler::executeMain(std::unique_ptr ctx) ctx->writeSDF(f, vm.count("sdf-cvc")); } + if (vm.count("report")) { + std::string filename = vm["report"].as(); + std::ofstream f(filename); + if (!f) + log_error("Failed to open report file '%s' for writing.\n", filename.c_str()); + ctx->writeReport(f); + } + #ifndef NO_PYTHON deinit_python(); #endif -- cgit v1.2.3