aboutsummaryrefslogtreecommitdiffstats
path: root/ice40
diff options
context:
space:
mode:
authorEddie Hung <eddieh@ece.ubc.ca>2018-07-30 18:59:04 -0700
committerEddie Hung <eddieh@ece.ubc.ca>2018-07-30 18:59:04 -0700
commitd5049bf0eda113db9a218fe855c7e3d7d65b4384 (patch)
tree5df283caca55eba1883788a702ac1e6547c52be5 /ice40
parent8371c0dd09e5b59189a391fb1b867e5249442046 (diff)
parent0daffec2a0efdbea36201eeb5666d208a10d0226 (diff)
downloadnextpnr-d5049bf0eda113db9a218fe855c7e3d7d65b4384.tar.gz
nextpnr-d5049bf0eda113db9a218fe855c7e3d7d65b4384.tar.bz2
nextpnr-d5049bf0eda113db9a218fe855c7e3d7d65b4384.zip
Merge remote-tracking branch 'origin/estdelay' into redist_slack
Diffstat (limited to 'ice40')
-rw-r--r--ice40/arch.cc16
-rw-r--r--ice40/arch.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc
index 51df4cb0..4b28564a 100644
--- a/ice40/arch.cc
+++ b/ice40/arch.cc
@@ -584,6 +584,22 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
int xd = x2 - x1, yd = y2 - y1;
int xscale = 120, yscale = 120, offset = 0;
+ return xscale * abs(xd) + yscale * abs(yd) + offset;
+}
+
+delay_t Arch::predictDelay(WireId src, WireId dst) const
+{
+ NPNR_ASSERT(src != WireId());
+ int x1 = chip_info->wire_data[src.index].x;
+ int y1 = chip_info->wire_data[src.index].y;
+
+ NPNR_ASSERT(dst != WireId());
+ int x2 = chip_info->wire_data[dst.index].x;
+ int y2 = chip_info->wire_data[dst.index].y;
+
+ int xd = x2 - x1, yd = y2 - y1;
+ int xscale = 120, yscale = 120, offset = 0;
+
// if (chip_info->wire_data[src.index].type == WIRE_TYPE_SP4_VERT) {
// yd = yd < -4 ? yd + 4 : (yd < 0 ? 0 : yd);
// offset = 500;
diff --git a/ice40/arch.h b/ice40/arch.h
index ab7760d4..c2768efe 100644
--- a/ice40/arch.h
+++ b/ice40/arch.h
@@ -697,6 +697,7 @@ struct Arch : BaseCtx
// -------------------------------------------------
delay_t estimateDelay(WireId src, WireId dst) const;
+ delay_t predictDelay(WireId src, WireId dst) const;
delay_t getDelayEpsilon() const { return 20; }
delay_t getRipupDelayPenalty() const { return 200; }
float getDelayNS(delay_t v) const { return v * 0.001; }