diff options
author | Eddie Hung <eddieh@ece.ubc.ca> | 2018-07-27 23:46:05 -0700 |
---|---|---|
committer | Eddie Hung <eddieh@ece.ubc.ca> | 2018-07-27 23:46:05 -0700 |
commit | 0be236ce05c90a5853b3285e0556737f663999c3 (patch) | |
tree | 59b870a3a92ec0321eaa1ecd00f4fc7b123510c9 | |
parent | 0bbe309a260dc690a27e882c52f12437a119b4b1 (diff) | |
download | nextpnr-0be236ce05c90a5853b3285e0556737f663999c3.tar.gz nextpnr-0be236ce05c90a5853b3285e0556737f663999c3.tar.bz2 nextpnr-0be236ce05c90a5853b3285e0556737f663999c3.zip |
Fix auto Fmax overconstraining during update_budget()
-rw-r--r-- | common/timing.cc | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/common/timing.cc b/common/timing.cc index f720b772..e0ddd2aa 100644 --- a/common/timing.cc +++ b/common/timing.cc @@ -143,18 +143,6 @@ void assign_budget(Context *ctx) UpdateMap updates; delay_t min_slack = compute_min_slack(ctx, &updates, nullptr); - // If user has not specified a frequency, adjust the target frequency dynamically - // TODO(eddieh): Tune these factors - if (!ctx->user_freq) { - if (min_slack < 0) - ctx->target_freq = 1e12 / (default_slack - 0.95 * min_slack); - else - ctx->target_freq = 1e12 / (default_slack - 1.2 * min_slack); - if (ctx->verbose) - log_info("minimum slack for this assign = %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) { @@ -180,6 +168,18 @@ void assign_budget(Context *ctx) } } + // If user has not specified a frequency, adjust the target frequency dynamically + // TODO(eddieh): Tune these factors + if (!ctx->user_freq) { + if (min_slack < 0) + ctx->target_freq = 1e12 / (default_slack - 0.95 * min_slack); + else + ctx->target_freq = 1e12 / (default_slack - 1.2 * min_slack); + if (ctx->verbose) + log_info("minimum slack for this assign = %d, target Fmax for next update = %.2f MHz\n", min_slack, + ctx->target_freq / 1e6); + } + log_info("Checksum: 0x%08x\n", ctx->checksum()); } @@ -215,12 +215,16 @@ void update_budget(Context *ctx) } } - // If user has not specified a frequency, adjust the frequency dynamically: + // If user has not specified a frequency, adjust the target frequency dynamically + // TODO(eddieh): Tune these factors if (!ctx->user_freq) { delay_t default_slack = delay_t(1.0e12 / ctx->target_freq); - ctx->target_freq = 1e12 / (default_slack - min_slack); + if (min_slack < 0) + ctx->target_freq = 1e12 / (default_slack - 0.95 * min_slack); + else + ctx->target_freq = 1e12 / (default_slack - 1.2 * min_slack); if (ctx->verbose) - log_info("minimum slack for this update = %d, target Fmax for next update = %.2f MHz\n", min_slack, + log_info("minimum slack for this assign = %d, target Fmax for next update = %.2f MHz\n", min_slack, ctx->target_freq / 1e6); } } |