Merge pull request #38 from eddiehung/assign_budget_evenly

Restore original assign_budget behaviour (to distribute slack evenly)
This commit is contained in:
Eddie Hung 2018-08-06 12:02:55 -07:00 committed by GitHub
commit 0b1c67cad3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 8 deletions

View File

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

View File

@ -32,15 +32,17 @@ typedef std::map<int, unsigned> DelayFrequency;
struct Timing
{
Context *ctx;
bool net_delays;
bool update;
delay_t min_slack;
PortRefVector current_path;
PortRefVector *crit_path;
DelayFrequency *slack_histogram;
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)
{
}
@ -58,7 +60,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);
@ -149,10 +151,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) {
@ -194,7 +196,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();

View File

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