From 02b3bda7f6ecec2e6896e46b03938871c236a52d Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 27 Jul 2018 19:52:45 -0700 Subject: [PATCH 1/2] ice40 estimateDelay to account for out/in muxes --- ice40/arch.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ice40/arch.cc b/ice40/arch.cc index 4e9baf7e..cfafa2d8 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -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; } From 0bbe309a260dc690a27e882c52f12437a119b4b1 Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 27 Jul 2018 19:52:58 -0700 Subject: [PATCH 2/2] Fix sign of slack redistribution again --- common/timing.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/timing.cc b/common/timing.cc index afaddbdf..f720b772 100644 --- a/common/timing.cc +++ b/common/timing.cc @@ -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