From 02b3bda7f6ecec2e6896e46b03938871c236a52d Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Fri, 27 Jul 2018 19:52:45 -0700 Subject: [PATCH] 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; }