aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2018-07-31 19:07:39 -0700
committerEddie Hung <eddieh@ece.ubc.ca>2018-07-31 19:07:39 -0700
commit720e81586502f527cba7b9052b6bfed719c0b165 (patch)
tree8faf2240f52437fb4f5f61079972b1c0de55079d
parent44671f8927887d7edd592f3df291579f5802842d (diff)
downloadnextpnr-720e81586502f527cba7b9052b6bfed719c0b165.tar.gz
nextpnr-720e81586502f527cba7b9052b6bfed719c0b165.tar.bz2
nextpnr-720e81586502f527cba7b9052b6bfed719c0b165.zip
Add --slack_redist_iter for ice40
-rw-r--r--common/nextpnr.h1
-rw-r--r--common/placer1.cc2
-rw-r--r--common/router1.cc4
-rw-r--r--common/timing.cc9
-rw-r--r--ice40/main.cc6
5 files changed, 14 insertions, 8 deletions
diff --git a/common/nextpnr.h b/common/nextpnr.h
index 38a313fd..b163300a 100644
--- a/common/nextpnr.h
+++ b/common/nextpnr.h
@@ -476,6 +476,7 @@ struct Context : Arch, DeterministicRNG
bool timing_driven = true;
float target_freq = 12e6;
bool user_freq = false;
+ int slack_redist_iter = 0;
Context(ArchArgs args) : Arch(args) {}
diff --git a/common/placer1.cc b/common/placer1.cc
index f2777a08..278bf466 100644
--- a/common/placer1.cc
+++ b/common/placer1.cc
@@ -237,7 +237,7 @@ class SAPlacer
diameter *= post_legalise_dia_scale;
ctx->shuffle(autoplaced);
assign_budget(ctx);
- } else {
+ } else if (iter % ctx->slack_redist_iter == 0) {
assign_budget(ctx, true /* quiet */);
}
diff --git a/common/router1.cc b/common/router1.cc
index 0bd257fd..5fffbc6d 100644
--- a/common/router1.cc
+++ b/common/router1.cc
@@ -615,8 +615,8 @@ bool router1(Context *ctx)
if (ctx->verbose || iterCnt == 1)
log_info("routing queue contains %d jobs.\n", int(jobQueue.size()));
-
- assign_budget(ctx, true /* quiet */);
+ else if (iterCnt % ctx->slack_redist_iter == 0)
+ assign_budget(ctx, true /* quiet */);
bool printNets = ctx->verbose && (jobQueue.size() < 10);
diff --git a/common/timing.cc b/common/timing.cc
index 1d69861b..1b3fd040 100644
--- a/common/timing.cc
+++ b/common/timing.cc
@@ -157,11 +157,12 @@ void assign_budget(Context *ctx, bool quiet)
}
}
- // If user has not specified a frequency, dynamically adjust the target
- // frequency to be the current maximum
- if (!ctx->user_freq) {
+ // For slack redistribution, if user has not specified a frequency
+ // dynamically adjust the target frequency to be the currently
+ // achieved maximum
+ if (!ctx->user_freq && ctx->slack_redist_iter > 0) {
ctx->target_freq = 1e12 / (default_slack - min_slack);
- if (ctx->verbose)
+ /*if (ctx->verbose)*/
log_info("minimum slack for this assign = %d, target Fmax for next update = %.2f MHz\n", min_slack,
ctx->target_freq / 1e6);
}
diff --git a/ice40/main.cc b/ice40/main.cc
index 5c9678db..ab672ddc 100644
--- a/ice40/main.cc
+++ b/ice40/main.cc
@@ -105,6 +105,7 @@ int main(int argc, char *argv[])
options.add_options()("asc", po::value<std::string>(), "asc bitstream file to write");
options.add_options()("read", po::value<std::string>(), "asc bitstream file to read");
options.add_options()("seed", po::value<int>(), "seed value for random number generator");
+ options.add_options()("slack_redist_iter", po::value<int>(), "number of iterations between slack redistribution");
options.add_options()("version,V", "show version");
options.add_options()("tmfuzz", "run path delay estimate fuzzer");
options.add_options()("test", "check architecture database integrity");
@@ -302,6 +303,10 @@ int main(int argc, char *argv[])
ctx->rngseed(vm["seed"].as<int>());
}
+ if (vm.count("slack_redist_iter")) {
+ ctx->slack_redist_iter = vm["slack_redist_iter"].as<int>();
+ }
+
if (vm.count("svg")) {
std::cout << "<svg xmlns=\"http://www.w3.org/2000/svg\" "
"xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n";
@@ -411,7 +416,6 @@ int main(int argc, char *argv[])
if (!ctx->pack() && !ctx->force)
log_error("Packing design failed.\n");
- //assign_budget(ctx.get());
ctx->check();
print_utilisation(ctx.get());
if (!vm.count("pack-only")) {