aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/command.cc6
-rw-r--r--common/context.h2
-rw-r--r--common/report.cc20
-rw-r--r--common/timing.cc3
4 files changed, 22 insertions, 9 deletions
diff --git a/common/command.cc b/common/command.cc
index 954a3442..006a6217 100644
--- a/common/command.cc
+++ b/common/command.cc
@@ -179,6 +179,8 @@ po::options_description CommandHandler::getGeneralOptions()
general.add_options()("report", po::value<std::string>(),
"write timing and utilization report in JSON format to file");
+ general.add_options()("detailed-timing-report",
+ "Append detailed net timing data to the JSON report");
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");
@@ -328,6 +330,10 @@ void CommandHandler::setupContext(Context *ctx)
ctx->settings[ctx->id("placerHeap/criticalityExponent")] = std::to_string(2);
if (ctx->settings.find(ctx->id("placerHeap/timingWeight")) == ctx->settings.end())
ctx->settings[ctx->id("placerHeap/timingWeight")] = std::to_string(10);
+
+ if (vm.count("detailed-timing-report")) {
+ ctx->detailed_timing_report = true;
+ }
}
int CommandHandler::executeMain(std::unique_ptr<Context> ctx)
diff --git a/common/context.h b/common/context.h
index 1175caee..6adbbdb5 100644
--- a/common/context.h
+++ b/common/context.h
@@ -36,6 +36,8 @@ struct Context : Arch, DeterministicRNG
// Should we disable printing of the location of nets in the critical path?
bool disable_critical_path_source_print = false;
+ // True when detailed per-net timing is to be stored / reported
+ bool detailed_timing_report = false;
ArchArgs arch_args;
diff --git a/common/report.cc b/common/report.cc
index 5330583e..f2926c86 100644
--- a/common/report.cc
+++ b/common/report.cc
@@ -250,14 +250,18 @@ void Context::writeReport(std::ostream &out) const
{"constraint", kv.second.constraint},
};
}
- out << Json(Json::object{
- {"utilization", util_json},
- {"fmax", fmax_json},
- {"critical_paths", report_critical_paths(this)},
- {"detailed_net_timings", report_detailed_net_timings(this)}
- })
- .dump()
- << std::endl;
+
+ Json::object jsonRoot{
+ {"utilization", util_json},
+ {"fmax", fmax_json},
+ {"critical_paths", report_critical_paths(this)}
+ };
+
+ if (detailed_timing_report) {
+ jsonRoot["detailed_net_timings"] = report_detailed_net_timings(this);
+ }
+
+ out << Json(jsonRoot).dump() << std::endl;
}
NEXTPNR_NAMESPACE_END
diff --git a/common/timing.cc b/common/timing.cc
index 369b6579..76bcfd64 100644
--- a/common/timing.cc
+++ b/common/timing.cc
@@ -1216,7 +1216,8 @@ void timing_analysis(Context *ctx, bool print_histogram, bool print_fmax, bool p
DetailedNetTimings detailed_net_timings;
Timing timing(ctx, true /* net_delays */, false /* update */, (print_path || print_fmax) ? &crit_paths : nullptr,
- print_histogram ? &slack_histogram : nullptr, update_results ? &detailed_net_timings : nullptr);
+ print_histogram ? &slack_histogram : nullptr,
+ (update_results && ctx->detailed_timing_report) ? &detailed_net_timings : nullptr);
timing.walk_paths();
bool report_critical_paths = print_path || print_fmax || update_results;