aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
Diffstat (limited to 'ice40')
-rw-r--r--ice40/main.cc12
-rw-r--r--ice40/pack.cc2
2 files changed, 12 insertions, 2 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);
}
}
diff --git a/ice40/pack.cc b/ice40/pack.cc
index 6840d8d1..3e852a91 100644
--- a/ice40/pack.cc
+++ b/ice40/pack.cc
@@ -280,7 +280,7 @@ static void insert_global(Design *design, NetInfo *net, bool is_reset,
bool is_cen)
{
std::string glb_name = net->name.str() + std::string("_$glb_") +
- (is_reset ? "sr" : (is_cen ? "ce" : "clk"));
+ (is_reset ? "sr" : (is_cen ? "ce" : "clk"));
CellInfo *gb = create_ice_cell(design, "SB_GB", "$gbuf_" + glb_name);
gb->ports["USER_SIGNAL_TO_GLOBAL_BUFFER"].net = net;
PortRef pr;