diff options
author | Eddie Hung <eddieh@ece.ubc.ca> | 2018-08-03 23:53:33 -0700 |
---|---|---|
committer | Eddie Hung <eddieh@ece.ubc.ca> | 2018-08-03 23:53:33 -0700 |
commit | dced12cbd2355604279c7277c8a48f584771dfb8 (patch) | |
tree | e802b563faf47c06c9022d4cde0ce79631623b19 | |
parent | 0a14e20f7332344d4c2f73c7ede54ef0258997f7 (diff) | |
parent | f5a1b93f0e9348437ece7fb7d46ac69af98536d0 (diff) | |
download | nextpnr-dced12cbd2355604279c7277c8a48f584771dfb8.tar.gz nextpnr-dced12cbd2355604279c7277c8a48f584771dfb8.tar.bz2 nextpnr-dced12cbd2355604279c7277c8a48f584771dfb8.zip |
Merge branch 'master' into slack_histogram
Conflicts:
common/timing.cc
-rw-r--r-- | common/nextpnr.h | 2 | ||||
-rw-r--r-- | common/timing.cc | 6 | ||||
-rw-r--r-- | ecp5/main.cc | 6 | ||||
-rw-r--r-- | ice40/main.cc | 17 |
4 files changed, 15 insertions, 16 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 0178a4a9..c046c76f 100644 --- a/common/timing.cc +++ b/common/timing.cc @@ -147,7 +147,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); } Timing timing(ctx, true /* update */); @@ -157,7 +157,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), @@ -174,7 +174,7 @@ 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) { delay_t default_slack = delay_t(1.0e12 / ctx->target_freq); ctx->target_freq = 1e12 / (default_slack - timing.min_slack); if (ctx->verbose) diff --git a/ecp5/main.cc b/ecp5/main.cc index f40a5e61..dac7a635 100644 --- a/ecp5/main.cc +++ b/ecp5/main.cc @@ -162,12 +162,8 @@ int main(int argc, char *argv[]) if (!ctx->pack() && !ctx->force) log_error("Packing design failed.\n"); - if (vm.count("freq")) { + if (vm.count("freq")) ctx->target_freq = vm["freq"].as<double>() * 1e6; - ctx->user_freq = true; - } else { - log_warning("Target frequency not specified. Will optimise for max frequency.\n"); - } assign_budget(ctx.get()); ctx->check(); print_utilisation(ctx.get()); diff --git a/ice40/main.cc b/ice40/main.cc index 37e18215..46cdce71 100644 --- a/ice40/main.cc +++ b/ice40/main.cc @@ -319,6 +319,13 @@ int main(int argc, char *argv[]) if (vm.count("slack_redist_iter")) { ctx->slack_redist_iter = vm["slack_redist_iter"].as<int>(); + if (vm.count("freq") && vm["freq"].as<double>() == 0) { + ctx->auto_freq = true; +#ifndef NO_GUI + if (!vm.count("gui")) +#endif + log_warning("Target frequency not specified. Will optimise for max frequency.\n"); + } } if (vm.count("cstrweight")) { @@ -385,13 +392,9 @@ int main(int argc, char *argv[]) } if (vm.count("freq")) { - ctx->target_freq = vm["freq"].as<double>() * 1e6; - ctx->user_freq = true; - } else { -#ifndef NO_GUI - if (!vm.count("gui")) -#endif - log_warning("Target frequency not specified. Will optimise for max frequency.\n"); + auto freq = vm["freq"].as<double>(); + if (freq > 0) + ctx->target_freq = freq * 1e6; } ctx->timing_driven = true; |