aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/main.cc
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2018-08-03 19:53:32 -0700
committerEddie Hung <eddieh@ece.ubc.ca>2018-08-03 19:53:32 -0700
commit3d5dcda12c80175f5bfb2c2615de9cb5fadacb90 (patch)
tree6d9bf44e2342833b79087ee4d627a8beb1561107 /ice40/main.cc
parent80e6b17ec9da25ff089a626b2fb5043876814307 (diff)
downloadnextpnr-3d5dcda12c80175f5bfb2c2615de9cb5fadacb90.tar.gz
nextpnr-3d5dcda12c80175f5bfb2c2615de9cb5fadacb90.tar.bz2
nextpnr-3d5dcda12c80175f5bfb2c2615de9cb5fadacb90.zip
Auto frequency only if --freq 0 is set
Diffstat (limited to 'ice40/main.cc')
-rw-r--r--ice40/main.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/ice40/main.cc b/ice40/main.cc
index 4a2e9532..2d8e3099 100644
--- a/ice40/main.cc
+++ b/ice40/main.cc
@@ -317,6 +317,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("svg")) {
@@ -379,13 +386,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;