From 3d5dcda12c80175f5bfb2c2615de9cb5fadacb90 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 3 Aug 2018 19:53:32 -0700 Subject: Auto frequency only if --freq 0 is set --- ice40/main.cc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'ice40/main.cc') 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(); + if (vm.count("freq") && vm["freq"].as() == 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() * 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(); + if (freq > 0) + ctx->target_freq = freq * 1e6; } ctx->timing_driven = true; -- cgit v1.2.3