Speedup critical path
This commit is contained in:
parent
be47fc3e9a
commit
831c7f2ef1
@ -219,7 +219,7 @@ class SAPlacer
|
|||||||
if ((placed_cells - constr_placed_cells) % 500 != 0)
|
if ((placed_cells - constr_placed_cells) % 500 != 0)
|
||||||
log_info(" initial placement placed %d/%d cells\n", int(placed_cells - constr_placed_cells),
|
log_info(" initial placement placed %d/%d cells\n", int(placed_cells - constr_placed_cells),
|
||||||
int(autoplaced.size()));
|
int(autoplaced.size()));
|
||||||
if (cfg.budgetBased && ctx->setting<int>("slack_redist_iter") > 0)
|
if (cfg.budgetBased && cfg.slack_redist_iter > 0)
|
||||||
assign_budget(ctx);
|
assign_budget(ctx);
|
||||||
ctx->yield();
|
ctx->yield();
|
||||||
auto iplace_end = std::chrono::high_resolution_clock::now();
|
auto iplace_end = std::chrono::high_resolution_clock::now();
|
||||||
@ -370,17 +370,16 @@ class SAPlacer
|
|||||||
ctx->shuffle(autoplaced);
|
ctx->shuffle(autoplaced);
|
||||||
|
|
||||||
// Legalisation is a big change so force a slack redistribution here
|
// Legalisation is a big change so force a slack redistribution here
|
||||||
if (ctx->setting<int>("slack_redist_iter") > 0 && cfg.budgetBased)
|
if (cfg.slack_redist_iter > 0 && cfg.budgetBased)
|
||||||
assign_budget(ctx, true /* quiet */);
|
assign_budget(ctx, true /* quiet */);
|
||||||
}
|
}
|
||||||
require_legal = false;
|
require_legal = false;
|
||||||
} else if (cfg.budgetBased && ctx->setting<int>("slack_redist_iter") > 0 &&
|
} else if (cfg.budgetBased && cfg.slack_redist_iter > 0 && iter % cfg.slack_redist_iter == 0) {
|
||||||
iter % ctx->setting<int>("slack_redist_iter") == 0) {
|
|
||||||
assign_budget(ctx, true /* quiet */);
|
assign_budget(ctx, true /* quiet */);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Invoke timing analysis to obtain criticalities
|
// Invoke timing analysis to obtain criticalities
|
||||||
if (!cfg.budgetBased && ctx->setting<bool>("timing_driven"))
|
if (!cfg.budgetBased && cfg.timing_driven)
|
||||||
get_criticalities(ctx, &net_crit);
|
get_criticalities(ctx, &net_crit);
|
||||||
// Need to rebuild costs after criticalities change
|
// Need to rebuild costs after criticalities change
|
||||||
setup_costs();
|
setup_costs();
|
||||||
@ -805,7 +804,7 @@ class SAPlacer
|
|||||||
if (ignore_net(ni))
|
if (ignore_net(ni))
|
||||||
continue;
|
continue;
|
||||||
net_bounds[ni->udata] = get_net_bounds(ni);
|
net_bounds[ni->udata] = get_net_bounds(ni);
|
||||||
if (ctx->setting<bool>("timing_driven") && int(ni->users.size()) < cfg.timingFanoutThresh)
|
if (cfg.timing_driven && int(ni->users.size()) < cfg.timingFanoutThresh)
|
||||||
for (size_t i = 0; i < ni->users.size(); i++)
|
for (size_t i = 0; i < ni->users.size(); i++)
|
||||||
net_arc_tcost[ni->udata][i] = get_timing_cost(ni, i);
|
net_arc_tcost[ni->udata][i] = get_timing_cost(ni, i);
|
||||||
}
|
}
|
||||||
@ -1022,7 +1021,7 @@ class SAPlacer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->setting<bool>("timing_driven") && int(pn->users.size()) < cfg.timingFanoutThresh) {
|
if (cfg.timing_driven && int(pn->users.size()) < cfg.timingFanoutThresh) {
|
||||||
// Output ports - all arcs change timing
|
// Output ports - all arcs change timing
|
||||||
if (port.second.type == PORT_OUT) {
|
if (port.second.type == PORT_OUT) {
|
||||||
int cc;
|
int cc;
|
||||||
@ -1062,7 +1061,7 @@ class SAPlacer
|
|||||||
if (md.already_bounds_changed_x[bc] == MoveChangeData::NO_CHANGE)
|
if (md.already_bounds_changed_x[bc] == MoveChangeData::NO_CHANGE)
|
||||||
md.wirelen_delta += md.new_net_bounds[bc].hpwl() - net_bounds[bc].hpwl();
|
md.wirelen_delta += md.new_net_bounds[bc].hpwl() - net_bounds[bc].hpwl();
|
||||||
|
|
||||||
if (ctx->setting<bool>("timing_driven")) {
|
if (cfg.timing_driven) {
|
||||||
for (const auto &tc : md.changed_arcs) {
|
for (const auto &tc : md.changed_arcs) {
|
||||||
double old_cost = net_arc_tcost.at(tc.first).at(tc.second);
|
double old_cost = net_arc_tcost.at(tc.first).at(tc.second);
|
||||||
double new_cost = get_timing_cost(net_by_udata.at(tc.first), tc.second);
|
double new_cost = get_timing_cost(net_by_udata.at(tc.first), tc.second);
|
||||||
@ -1139,6 +1138,8 @@ Placer1Cfg::Placer1Cfg(Context *ctx)
|
|||||||
budgetBased = ctx->setting<bool>("placer1/budgetBased", false);
|
budgetBased = ctx->setting<bool>("placer1/budgetBased", false);
|
||||||
startTemp = ctx->setting<float>("placer1/startTemp", 1);
|
startTemp = ctx->setting<float>("placer1/startTemp", 1);
|
||||||
timingFanoutThresh = std::numeric_limits<int>::max();
|
timingFanoutThresh = std::numeric_limits<int>::max();
|
||||||
|
timing_driven = ctx->setting<bool>("timing_driven");
|
||||||
|
slack_redist_iter = ctx->setting<int>("slack_redist_iter");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool placer1(Context *ctx, Placer1Cfg cfg)
|
bool placer1(Context *ctx, Placer1Cfg cfg)
|
||||||
|
@ -32,6 +32,8 @@ struct Placer1Cfg
|
|||||||
bool budgetBased;
|
bool budgetBased;
|
||||||
float startTemp;
|
float startTemp;
|
||||||
int timingFanoutThresh;
|
int timingFanoutThresh;
|
||||||
|
bool timing_driven;
|
||||||
|
int slack_redist_iter;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern bool placer1(Context *ctx, Placer1Cfg cfg);
|
extern bool placer1(Context *ctx, Placer1Cfg cfg);
|
||||||
|
@ -234,7 +234,7 @@ class HeAPPlacer
|
|||||||
std::chrono::duration<double>(run_stopt - run_startt).count());
|
std::chrono::duration<double>(run_stopt - run_startt).count());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->setting<bool>("timing_driven"))
|
if (cfg.timing_driven)
|
||||||
get_criticalities(ctx, &net_crit);
|
get_criticalities(ctx, &net_crit);
|
||||||
|
|
||||||
if (legal_hpwl < best_hpwl) {
|
if (legal_hpwl < best_hpwl) {
|
||||||
@ -1521,6 +1521,7 @@ PlacerHeapCfg::PlacerHeapCfg(Context *ctx)
|
|||||||
alpha = ctx->setting<float>("placerHeap/alpha", 0.1);
|
alpha = ctx->setting<float>("placerHeap/alpha", 0.1);
|
||||||
criticalityExponent = ctx->setting<int>("placerHeap/criticalityExponent", 2);
|
criticalityExponent = ctx->setting<int>("placerHeap/criticalityExponent", 2);
|
||||||
timingWeight = ctx->setting<int>("placerHeap/timingWeight", 10);
|
timingWeight = ctx->setting<int>("placerHeap/timingWeight", 10);
|
||||||
|
timing_driven = ctx->setting<bool>("timing_driven");
|
||||||
}
|
}
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_END
|
NEXTPNR_NAMESPACE_END
|
||||||
|
@ -38,6 +38,7 @@ struct PlacerHeapCfg
|
|||||||
float alpha;
|
float alpha;
|
||||||
float criticalityExponent;
|
float criticalityExponent;
|
||||||
float timingWeight;
|
float timingWeight;
|
||||||
|
bool timing_driven;
|
||||||
|
|
||||||
std::unordered_set<IdString> ioBufTypes;
|
std::unordered_set<IdString> ioBufTypes;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user