diff --git a/ice40/arch.cc b/ice40/arch.cc index fec35a0f..4e9baf7e 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -587,11 +587,18 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const return xscale * abs(xd) + yscale * abs(yd) + offset; } -delay_t Arch::getBudgetOverride(const PortRef &pr, delay_t v) const +delay_t Arch::getBudgetOverride(NetInfo *net_info, int user_idx, delay_t budget) const { - if (pr.port == id("COUT")) - return 0; - return v; + const auto& driver = net_info->driver; + if (driver.port == id_cout) { + const auto& sink = net_info->users[user_idx]; + auto driver_loc = getBelLocation(driver.cell->bel); + auto sink_loc = getBelLocation(sink.cell->bel); + if (driver_loc.y == sink_loc.y) + return 0; + return 250; + } + return budget; } // ----------------------------------------------------------------------- diff --git a/ice40/arch.h b/ice40/arch.h index 048a9053..e2d14e3c 100644 --- a/ice40/arch.h +++ b/ice40/arch.h @@ -688,7 +688,7 @@ struct Arch : BaseCtx delay_t getRipupDelayPenalty() const { return 200; } float getDelayNS(delay_t v) const { return v * 0.001; } uint32_t getDelayChecksum(delay_t v) const { return v; } - delay_t getBudgetOverride(const PortRef &pr, delay_t v) const; + delay_t getBudgetOverride(NetInfo *net_info, int user_idx, delay_t budget) const; // -------------------------------------------------