From 51d1363dfeb7005ec35a2acd10fe9ae2cd8631d5 Mon Sep 17 00:00:00 2001 From: David Shah Date: Wed, 21 Nov 2018 17:13:53 +0000 Subject: Change the log level of some timing-related messages Signed-off-by: David Shah --- common/router1.cc | 3 ++- common/timing.cc | 30 ++++++++++++++++-------------- common/timing.h | 3 ++- 3 files changed, 20 insertions(+), 16 deletions(-) (limited to 'common') diff --git a/common/router1.cc b/common/router1.cc index a3388fa8..8d19797b 100644 --- a/common/router1.cc +++ b/common/router1.cc @@ -812,7 +812,8 @@ bool router1(Context *ctx, const Router1Cfg &cfg) #endif log_info("Checksum: 0x%08x\n", ctx->checksum()); - timing_analysis(ctx, true /* slack_histogram */, true /* print_fmax */, true /* print_path */); + timing_analysis(ctx, true /* slack_histogram */, true /* print_fmax */, true /* print_path */, + true /* warn_on_failure */); ctx->unlock(); return true; diff --git a/common/timing.cc b/common/timing.cc index 80be554c..afe14e21 100644 --- a/common/timing.cc +++ b/common/timing.cc @@ -485,11 +485,11 @@ void assign_budget(Context *ctx, bool quiet) for (auto &user : net.second->users) { // Post-update check if (!ctx->auto_freq && user.budget < 0) - log_warning("port %s.%s, connected to net '%s', has negative " - "timing budget of %fns\n", - user.cell->name.c_str(ctx), user.port.c_str(ctx), net.first.c_str(ctx), - ctx->getDelayNS(user.budget)); - else if (ctx->verbose) + log_info("port %s.%s, connected to net '%s', has negative " + "timing budget of %fns\n", + user.cell->name.c_str(ctx), user.port.c_str(ctx), net.first.c_str(ctx), + ctx->getDelayNS(user.budget)); + else if (ctx->debug) log_info("port %s.%s, connected to net '%s', has " "timing budget of %fns\n", user.cell->name.c_str(ctx), user.port.c_str(ctx), net.first.c_str(ctx), @@ -513,7 +513,7 @@ void assign_budget(Context *ctx, bool quiet) log_info("Checksum: 0x%08x\n", ctx->checksum()); } -void timing_analysis(Context *ctx, bool print_histogram, bool print_fmax, bool print_path) +void timing_analysis(Context *ctx, bool print_histogram, bool print_fmax, bool print_path, bool warn_on_failure) { auto format_event = [ctx](const ClockEvent &e, int field_width = 0) { std::string value; @@ -689,15 +689,17 @@ void timing_analysis(Context *ctx, bool print_histogram, bool print_fmax, bool p for (auto &clock : clock_reports) { const auto &clock_name = clock.first.str(ctx); const int width = max_width - clock_name.size(); - if (ctx->nets.at(clock.first)->clkconstr) { - float target = 1000 / ctx->getDelayNS(ctx->nets.at(clock.first)->clkconstr->period.minDelay()); + float target = ctx->target_freq / 1e6; + if (ctx->nets.at(clock.first)->clkconstr) + target = 1000 / ctx->getDelayNS(ctx->nets.at(clock.first)->clkconstr->period.minDelay()); + + bool passed = target < clock_fmax[clock.first]; + if (!warn_on_failure || passed) log_info("Max frequency for clock %*s'%s': %.02f MHz (%s at %.02f MHz)\n", width, "", - clock_name.c_str(), clock_fmax[clock.first], - (target < clock_fmax[clock.first]) ? "PASS" : "FAIL", target); - } else { - log_info("Max frequency for clock %*s'%s': %.02f MHz\n", width, "", clock_name.c_str(), - clock_fmax[clock.first]); - } + clock_name.c_str(), clock_fmax[clock.first], passed ? "PASS" : "FAIL", target); + else + log_warning("Max frequency for clock %*s'%s': %.02f MHz (%s at %.02f MHz)\n", width, "", + clock_name.c_str(), clock_fmax[clock.first], passed ? "PASS" : "FAIL", target); } for (auto &eclock : empty_clocks) { if (eclock != ctx->id("$async$")) diff --git a/common/timing.h b/common/timing.h index 1fd76310..42f928dc 100644 --- a/common/timing.h +++ b/common/timing.h @@ -29,7 +29,8 @@ void assign_budget(Context *ctx, bool quiet = false); // Perform timing analysis and print out the fmax, and optionally the // critical path -void timing_analysis(Context *ctx, bool slack_histogram = true, bool print_fmax = true, bool print_path = false); +void timing_analysis(Context *ctx, bool slack_histogram = true, bool print_fmax = true, bool print_path = false, + bool warn_on_failure = false); NEXTPNR_NAMESPACE_END -- cgit v1.2.3