Merge branch 'redist_slack' into 'redist_slack'

Redist slack

See merge request eddiehung/nextpnr!12
This commit is contained in:
Eddie Hung 2018-07-28 02:55:37 +00:00
commit 48b9d05d85
2 changed files with 20 additions and 4 deletions

View File

@ -160,10 +160,10 @@ void assign_budget(Context *ctx)
for (size_t i = 0; i < net.second->users.size(); ++i) {
auto &user = net.second->users[i];
auto pi = &user.cell->ports.at(user.port);
auto budget = ctx->getNetinfoRouteDelay(net.second.get(), i);
auto it = updates.find(pi);
if (it == updates.end())
continue;
auto budget = ctx->getNetinfoRouteDelay(net.second.get(), i) - it->second;
if (it != updates.end())
budget += it->second;
user.budget = ctx->getBudgetOverride(net.second.get(), i, budget);
// Post-update check
@ -196,7 +196,7 @@ void update_budget(Context *ctx)
auto budget = ctx->getNetinfoRouteDelay(net.second.get(), i);
auto it = updates.find(pi);
if (it != updates.end())
budget -= it->second;
budget += it->second;
user.budget = ctx->getBudgetOverride(net.second.get(), i, budget);
// Post-update check

View File

@ -584,6 +584,22 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
// offset = 500;
// }
// Estimate for output mux
for (const auto& bp : getWireBelPins(src)) {
if (bp.pin == PIN_O && getBelType(bp.bel) == TYPE_ICESTORM_LC) {
offset += 330;
break;
}
}
// Estimate for input mux
for (const auto& bp : getWireBelPins(dst)) {
if ((bp.pin == PIN_I0 || bp.pin == PIN_I1 || bp.pin == PIN_I2 || bp.pin == PIN_I3) && getBelType(bp.bel) == TYPE_ICESTORM_LC) {
offset += 260;
break;
}
}
return xscale * abs(xd) + yscale * abs(yd) + offset;
}