From 528eddcaf797c5da3a75876817b6c4377e4dfd6f Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 4 Aug 2018 22:29:43 +0200 Subject: Fix bug in ice40 estimateDelay() Signed-off-by: Clifford Wolf --- ice40/delay.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'ice40/delay.cc') diff --git a/ice40/delay.cc b/ice40/delay.cc index 1fa4256e..7c9b3f29 100644 --- a/ice40/delay.cc +++ b/ice40/delay.cc @@ -183,11 +183,13 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const if (dx > 1 || dy > 1) v = (p.model0_offset + p.model0_norm1 * (dx + dy)) / 128; - if (type == WireInfoPOD::WIRE_TYPE_LOCAL) - v += p.delta_local; + if (dx == 0 && dy == 0) { + if (type == WireInfoPOD::WIRE_TYPE_LOCAL) + v += p.delta_local; - if (type == WireInfoPOD::WIRE_TYPE_LUTFF_IN || type == WireInfoPOD::WIRE_TYPE_LUTFF_IN_LUT) - v += (z1 == z2) ? p.delta_lutffin : 1000; + if (type == WireInfoPOD::WIRE_TYPE_LUTFF_IN || type == WireInfoPOD::WIRE_TYPE_LUTFF_IN_LUT) + v += (z1 == z2) ? p.delta_lutffin : 0; + } if (type == WireInfoPOD::WIRE_TYPE_SP4_V || type == WireInfoPOD::WIRE_TYPE_SP4_H) v += p.delta_sp4; -- cgit v1.2.3