diff options
author | gatecat <gatecat@ds0.me> | 2021-07-30 14:29:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 14:29:55 +0100 |
commit | ef1fbfc651ea328dfb703c3b79d5b9ea123f2f0d (patch) | |
tree | 41f9aec86a1d468a0302243c8f6c567d46c666b6 /common/command.cc | |
parent | 8466985bc709d6c2e0e6f5f030abec119ae2305a (diff) | |
parent | d2007a386c1a2db7917d7048ea6206ae1218d141 (diff) | |
download | nextpnr-ef1fbfc651ea328dfb703c3b79d5b9ea123f2f0d.tar.gz nextpnr-ef1fbfc651ea328dfb703c3b79d5b9ea123f2f0d.tar.bz2 nextpnr-ef1fbfc651ea328dfb703c3b79d5b9ea123f2f0d.zip |
Merge pull request #787 from YosysHQ/gatecat/report
Add JSON utilisation and timing report
Diffstat (limited to 'common/command.cc')
-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 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<std::string>(), "prefix for router2 resource congestion heatmaps"); + general.add_options()("report", po::value<std::string>(), + "write timing and utilization report in JSON format to file"); + 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"); @@ -424,6 +427,14 @@ int CommandHandler::executeMain(std::unique_ptr<Context> ctx) ctx->writeSDF(f, vm.count("sdf-cvc")); } + if (vm.count("report")) { + std::string filename = vm["report"].as<std::string>(); + 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 |