clangformat

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2023-11-07 09:02:35 +01:00
parent cf647463e4
commit 7b0e082000

View File

@ -293,7 +293,9 @@ class StaticPlacer
{ {
if (ci->udata == -1) { if (ci->udata == -1) {
// not handled? // not handled?
NPNR_ASSERT_MSG(ci->bel != BelId(), stringf("Cell %s of type %s has no bel", ci->name.c_str(ctx), ci->type.c_str(ctx)).c_str()); // already fixed NPNR_ASSERT_MSG(ci->bel != BelId(),
stringf("Cell %s of type %s has no bel", ci->name.c_str(ctx), ci->type.c_str(ctx))
.c_str()); // already fixed
return RealPair(ctx->getBelLocation(ci->bel), 0.5f); return RealPair(ctx->getBelLocation(ci->bel), 0.5f);
} else { } else {
return ref ? mcells.at(ci->udata).ref_pos : mcells.at(ci->udata).pos; return ref ? mcells.at(ci->udata).ref_pos : mcells.at(ci->udata).pos;
@ -767,7 +769,8 @@ class StaticPlacer
auto group = item.first; auto group = item.first;
auto wirelen = item.second; auto wirelen = item.second;
dens_penalty[group] = wirelen / force_sum.at(group); dens_penalty[group] = wirelen / force_sum.at(group);
log_info(" initial density penalty for %s: %f\n", cfg.cell_groups.at(group).name.c_str(ctx), dens_penalty[group]); log_info(" initial density penalty for %s: %f\n", cfg.cell_groups.at(group).name.c_str(ctx),
dens_penalty[group]);
} }
} }
// Third loop: compute total gradient, and precondition // Third loop: compute total gradient, and precondition
@ -784,7 +787,8 @@ class StaticPlacer
float precond = std::max(1.0f, float(cell.pin_count) + dens_penalty[cell.group] * cell.rect.area()); float precond = std::max(1.0f, float(cell.pin_count) + dens_penalty[cell.group] * cell.rect.area());
if (ref) { if (ref) {
cell.ref_total_grad = ((cell.ref_wl_grad * -1) - cell.ref_dens_grad * dens_penalty[cell.group]) / precond; cell.ref_total_grad =
((cell.ref_wl_grad * -1) - cell.ref_dens_grad * dens_penalty[cell.group]) / precond;
} else { } else {
cell.total_grad = ((cell.wl_grad * -1) - cell.dens_grad * dens_penalty[cell.group]) / precond; cell.total_grad = ((cell.wl_grad * -1) - cell.dens_grad * dens_penalty[cell.group]) / precond;
} }