aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2018-08-06 07:35:00 -0700
committerEddie Hung <eddieh@ece.ubc.ca>2018-08-06 07:35:00 -0700
commit665202e9361bf4229ec4e1fe833c5592624f1230 (patch)
treea4421365c658c11e92187af5e96a092898197db1
parente314ea761abd8f55b3341f733c01d13ce2d4fae5 (diff)
parent2fb934b107d63b43afcde0e724a91c33500fe95c (diff)
downloadnextpnr-665202e9361bf4229ec4e1fe833c5592624f1230.tar.gz
nextpnr-665202e9361bf4229ec4e1fe833c5592624f1230.tar.bz2
nextpnr-665202e9361bf4229ec4e1fe833c5592624f1230.zip
Merge branch 'assign_budget_evenly' into assign_budget_speedup
Conflicts: common/timing.cc
-rw-r--r--common/placer1.cc3
-rw-r--r--common/timing.cc16
-rw-r--r--ice40/main.cc1
3 files changed, 12 insertions, 8 deletions
diff --git a/common/placer1.cc b/common/placer1.cc
index 4ba0f3cf..1d00e77a 100644
--- a/common/placer1.cc
+++ b/common/placer1.cc
@@ -138,7 +138,8 @@ class SAPlacer
if ((placed_cells - constr_placed_cells) % 500 != 0)
log_info(" initial placement placed %d/%d cells\n", int(placed_cells - constr_placed_cells),
int(autoplaced.size()));
- assign_budget(ctx);
+ if (ctx->slack_redist_iter > 0)
+ assign_budget(ctx);
ctx->yield();
log_info("Running simulated annealing placer.\n");
diff --git a/common/timing.cc b/common/timing.cc
index 23fbd9f9..69fdd29f 100644
--- a/common/timing.cc
+++ b/common/timing.cc
@@ -33,6 +33,7 @@ typedef std::map<int, unsigned> DelayFrequency;
struct Timing
{
Context *ctx;
+ bool net_delays;
bool update;
delay_t min_slack;
PortRefVector current_path;
@@ -47,9 +48,10 @@ struct Timing
delay_t min_remaining_budget;
};
- Timing(Context *ctx, bool update, PortRefVector *crit_path = nullptr, DelayFrequency *slack_histogram = nullptr)
- : ctx(ctx), update(update), min_slack(1.0e12 / ctx->target_freq), crit_path(crit_path),
- slack_histogram(slack_histogram)
+ Timing(Context *ctx, bool net_delays, bool update, PortRefVector *crit_path = nullptr,
+ DelayFrequency *slack_histogram = nullptr)
+ : ctx(ctx), net_delays(net_delays), update(update), min_slack(1.0e12 / ctx->target_freq),
+ crit_path(crit_path), slack_histogram(slack_histogram)
{
}
@@ -67,7 +69,7 @@ struct Timing
net_budget = budget;
pl = std::max(1, path_length);
}
- auto delay = ctx->getNetinfoRouteDelay(net, usr);
+ auto delay = net_delays ? ctx->getNetinfoRouteDelay(net, usr) : delay_t();
net_budget = std::min(net_budget, follow_user_port(usr, pl, slack - delay));
if (update)
usr.budget = std::min(usr.budget, delay + net_budget);
@@ -308,10 +310,10 @@ void assign_budget(Context *ctx, bool quiet)
{
if (!quiet) {
log_break();
- log_info("Annotating ports with timing budgets for target frequency %.2f MHz\n", ctx->target_freq/1e6);
+ log_info("Annotating ports with timing budgets for target frequency %.2f MHz\n", ctx->target_freq / 1e6);
}
- Timing timing(ctx, true /* update */);
+ Timing timing(ctx, ctx->slack_redist_iter > 0 /* net_delays */, true /* update */);
timing.assign_budget();
if (!quiet || ctx->verbose) {
@@ -353,7 +355,7 @@ void timing_analysis(Context *ctx, bool print_histogram, bool print_path)
PortRefVector crit_path;
DelayFrequency slack_histogram;
- Timing timing(ctx, false /* update */, print_path ? &crit_path : nullptr,
+ Timing timing(ctx, true /* net_delays */, false /* update */, print_path ? &crit_path : nullptr,
print_histogram ? &slack_histogram : nullptr);
auto min_slack = timing.walk_paths();
diff --git a/ice40/main.cc b/ice40/main.cc
index 358bf3c5..78236af1 100644
--- a/ice40/main.cc
+++ b/ice40/main.cc
@@ -366,6 +366,7 @@ 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")) {