diff options
author | Eddie Hung <eddieh@ece.ubc.ca> | 2018-08-03 23:51:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-03 23:51:21 -0700 |
commit | f5a1b93f0e9348437ece7fb7d46ac69af98536d0 (patch) | |
tree | 4b881ed0409bae10ac553dc5fe1771feb228712e /common | |
parent | 65d73eb9838e0bb8e6d089ecde3d4ffaf34e9e29 (diff) | |
parent | d66edf522348d1475f1b65d79804f37a751274b3 (diff) | |
download | nextpnr-f5a1b93f0e9348437ece7fb7d46ac69af98536d0.tar.gz nextpnr-f5a1b93f0e9348437ece7fb7d46ac69af98536d0.tar.bz2 nextpnr-f5a1b93f0e9348437ece7fb7d46ac69af98536d0.zip |
Merge pull request #30 from eddiehung/slack_redist_freq
Slack redistribution to auto-tune frequency only if --freq 0 set
Diffstat (limited to 'common')
-rw-r--r-- | common/nextpnr.h | 2 | ||||
-rw-r--r-- | common/timing.cc | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h index f49b982e..c87a98d9 100644 --- a/common/nextpnr.h +++ b/common/nextpnr.h @@ -472,7 +472,7 @@ struct Context : Arch, DeterministicRNG bool force = false; bool timing_driven = true; float target_freq = 12e6; - bool user_freq = false; + bool auto_freq = false; int slack_redist_iter = 0; Context(ArchArgs args) : Arch(args) {} diff --git a/common/timing.cc b/common/timing.cc index 9777ab7d..f422ee91 100644 --- a/common/timing.cc +++ b/common/timing.cc @@ -125,7 +125,7 @@ void assign_budget(Context *ctx, bool quiet) { if (!quiet) { log_break(); - log_info("Annotating ports with timing budgets\n"); + log_info("Annotating ports with timing budgets for target frequency %.2f MHz\n", ctx->target_freq/1e6); } // Clear delays to a very high value first @@ -142,7 +142,7 @@ void assign_budget(Context *ctx, bool quiet) for (auto &net : ctx->nets) { for (auto &user : net.second->users) { // Post-update check - if (ctx->user_freq && user.budget < 0) + 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), @@ -159,11 +159,11 @@ void assign_budget(Context *ctx, bool quiet) // For slack redistribution, if user has not specified a frequency // dynamically adjust the target frequency to be the currently // achieved maximum - if (!ctx->user_freq && ctx->slack_redist_iter > 0) { + if (ctx->auto_freq && ctx->slack_redist_iter > 0) { ctx->target_freq = 1e12 / (default_slack - 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); + 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); } if (!quiet) |