From 21d46fb633383909609a9f8adbb543ae6e7ed70c Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Thu, 26 Jul 2018 21:35:37 -0700 Subject: Move target_freq update after budget update --- common/timing.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'common/timing.cc') diff --git a/common/timing.cc b/common/timing.cc index 5534b1c8..7f28ef75 100644 --- a/common/timing.cc +++ b/common/timing.cc @@ -175,17 +175,8 @@ void assign_budget(Context *ctx) void update_budget(Context *ctx) { UpdateMap updates; - delay_t default_slack = delay_t(1.0e12 / ctx->target_freq); delay_t min_slack = compute_min_slack(ctx, &updates, nullptr); - // If user has not specified a frequency, adjust the frequency dynamically: - if (!ctx->user_freq) { - ctx->target_freq = 1e12 / (default_slack - min_slack); - if (ctx->verbose) - log_info("minimum slack for this update = %d, target Fmax for next update = %.2f MHz\n", min_slack, - ctx->target_freq / 1e6); - } - // Update the budgets for (auto &net : ctx->nets) { for (size_t i = 0; i < net.second->users.size(); ++i) { @@ -211,6 +202,15 @@ void update_budget(Context *ctx) } } } + + // If user has not specified a frequency, adjust the frequency dynamically: + if (!ctx->user_freq) { + delay_t default_slack = delay_t(1.0e12 / ctx->target_freq); + ctx->target_freq = 1e12 / (default_slack - min_slack); + if (ctx->verbose) + log_info("minimum slack for this update = %d, target Fmax for next update = %.2f MHz\n", min_slack, + ctx->target_freq / 1e6); + } } void compute_fmax(Context *ctx, bool print_fmax, bool print_path) -- cgit v1.2.3