placer1: Implement non-timing-driven mode

Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
David Shah 2018-12-30 10:38:51 +01:00 committed by David Shah
parent 1780f42b9a
commit bd0a33022b

View File

@ -455,6 +455,7 @@ class SAPlacer
// Attempt a SA position swap, return true on success or false on failure
bool try_swap_position(CellInfo *cell, BelId newBel)
{
static const double epsilon = 1e-20;
moveChange.reset();
BelId oldBel = cell->bel;
CellInfo *other_cell = ctx->getBoundBelCell(newBel);
@ -496,8 +497,8 @@ class SAPlacer
new_dist = get_constraints_distance(ctx, cell);
if (other_cell != nullptr)
new_dist += get_constraints_distance(ctx, other_cell);
delta = lambda * (moveChange.timing_delta / last_timing_cost) +
(1 - lambda) * (double(moveChange.wirelen_delta) / last_wirelen_cost);
delta = lambda * (moveChange.timing_delta / std::max<double>(last_timing_cost, epsilon)) +
(1 - lambda) * (double(moveChange.wirelen_delta) / std::max<double>(last_wirelen_cost, epsilon));
delta += (cfg.constraintWeight / temp) * (new_dist - old_dist) / last_wirelen_cost;
n_move++;
// SA acceptance criterea
@ -728,6 +729,7 @@ class SAPlacer
if (ignore_net(ni))
continue;
net_bounds[ni->udata] = get_net_bounds(ni);
if (ctx->timing_driven)
for (size_t i = 0; i < ni->users.size(); i++)
net_arc_tcost[ni->udata][i] = get_timing_cost(ni, i);
}
@ -804,6 +806,7 @@ class SAPlacer
mc.bounds_changed_nets.push_back(pn->udata);
mc.already_bounds_changed[pn->udata] = true;
}
if (ctx->timing_driven) {
// Output ports - all arcs change timing
if (port.second.type == PORT_OUT) {
int cc;
@ -823,6 +826,7 @@ class SAPlacer
}
}
}
}
void compute_cost_changes(MoveChangeData &md)
{
@ -833,7 +837,7 @@ class SAPlacer
md.wirelen_delta += (bounds.hpwl() - old_hpwl);
md.already_bounds_changed[bc] = false;
}
if (ctx->timing_driven) {
for (const auto &tc : md.changed_arcs) {
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);
@ -842,6 +846,7 @@ class SAPlacer
md.already_changed_arcs[tc.first][tc.second] = false;
}
}
}
void commit_cost_changes(MoveChangeData &md)
{