aboutsummaryrefslogtreecommitdiffstats
path: root/ice40/main.cc
diff options
context:
space:
mode:
authorDavid Shah <davey1576@gmail.com>2018-06-17 15:04:53 +0200
committerDavid Shah <davey1576@gmail.com>2018-06-17 15:04:53 +0200
commit748171dae29c65182e6360a12a9e2bdbbfc35163 (patch)
treedaddc1f0a38029f2c77f8c4253a3a5682a45033f /ice40/main.cc
parent681c9654d7c49d407a999b2b03c980d66bcefd8f (diff)
downloadnextpnr-748171dae29c65182e6360a12a9e2bdbbfc35163.tar.gz
nextpnr-748171dae29c65182e6360a12a9e2bdbbfc35163.tar.bz2
nextpnr-748171dae29c65182e6360a12a9e2bdbbfc35163.zip
place_sa: Adding seed option
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ice40/main.cc')
-rw-r--r--ice40/main.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/ice40/main.cc b/ice40/main.cc
index eb92d92f..c43bffa7 100644
--- a/ice40/main.cc
+++ b/ice40/main.cc
@@ -82,6 +82,8 @@ int main(int argc, char *argv[])
"PCF constraints file to ingest");
options.add_options()("asc", po::value<std::string>(),
"asc bitstream file to write");
+ options.add_options()("seed", po::value<int>(),
+ "seed value for random number generator");
options.add_options()("version,V", "show version");
options.add_options()("lp384", "set device type to iCE40LP384");
options.add_options()("lp1k", "set device type to iCE40LP1K");
@@ -223,8 +225,16 @@ int main(int argc, char *argv[])
pack_design(&design);
print_utilisation(&design);
+
+ int seed = 1;
+ if (vm.count("seed")) {
+ seed = vm["seed"].as<int>();
+ if (seed == 0)
+ log_error("seed must be non-zero value");
+ }
+
if (!vm.count("pack-only")) {
- place_design_sa(&design);
+ place_design_sa(&design, seed);
route_design(&design, verbose);
}
}