Add --slack_redist_iter for ice40

This commit is contained in:
Eddie Hung 2018-07-31 19:07:39 -07:00
parent 44671f8927
commit 720e815865
5 changed files with 14 additions and 8 deletions

View File

@ -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) {}

View File

@ -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 */);
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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")) {