diff --git a/common/command.cc b/common/command.cc index c5c777e8..5070bf9c 100644 --- a/common/command.cc +++ b/common/command.cc @@ -102,6 +102,7 @@ po::options_description CommandHandler::getGeneralOptions() #endif general.add_options()("json", po::value(), "JSON design file to ingest"); general.add_options()("seed", po::value(), "seed value for random number generator"); + general.add_options()("randomize-seed,r", "randomize seed value for random number generator"); general.add_options()("slack_redist_iter", po::value(), "number of iterations between slack redistribution"); general.add_options()("cstrweight", po::value(), "placer weighting for relative constraint satisfaction"); general.add_options()("pack-only", "pack design only without placement or routing"); @@ -138,6 +139,15 @@ void CommandHandler::setupContext(Context *ctx) ctx->rngseed(vm["seed"].as()); } + if (vm.count("randomize-seed")) { + srand(time(NULL)); + int r; + do { + r = rand(); + } while(r == 0); + ctx->rngseed(r); + } + if (vm.count("slack_redist_iter")) { ctx->slack_redist_iter = vm["slack_redist_iter"].as(); if (vm.count("freq") && vm["freq"].as() == 0) {