diff options
author | David Shah <davey1576@gmail.com> | 2018-06-20 20:14:08 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-06-20 20:14:08 +0200 |
commit | 93ed8ca40519cc07b4719ea97a32f51d1a5631cb (patch) | |
tree | 1edddf2071d155b2818dfe3b212db25bdeb9264f /ice40/arch.cc | |
parent | c27c96f4f0ec66d13bea7d7cdea25fbeb2e189b7 (diff) | |
parent | f2ae9a713ba02f8160e64e199ea4203793f6ed90 (diff) | |
download | nextpnr-93ed8ca40519cc07b4719ea97a32f51d1a5631cb.tar.gz nextpnr-93ed8ca40519cc07b4719ea97a32f51d1a5631cb.tar.bz2 nextpnr-93ed8ca40519cc07b4719ea97a32f51d1a5631cb.zip |
Merge branch 'master' of gitlab.com:SymbioticEDA/nextpnr
Diffstat (limited to 'ice40/arch.cc')
-rw-r--r-- | ice40/arch.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc index d7673dd0..963b5994 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -306,14 +306,22 @@ void Arch::estimatePosition(BelId bel, int &x, int &y, bool &gb) const delay_t Arch::estimateDelay(WireId src, WireId dst) const { assert(src != WireId()); - delay_t x1 = chip_info->wire_data[src.index].x; - delay_t y1 = chip_info->wire_data[src.index].y; + int x1 = chip_info->wire_data[src.index].x; + int y1 = chip_info->wire_data[src.index].y; assert(dst != WireId()); - delay_t x2 = chip_info->wire_data[dst.index].x; - delay_t y2 = chip_info->wire_data[dst.index].y; + int x2 = chip_info->wire_data[dst.index].x; + int y2 = chip_info->wire_data[dst.index].y; - return delay_t(50 * (fabsf(x1 - x2) + fabsf(y1 - y2))); + 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; + // } + + return xscale * abs(xd) + yscale * abs(yd) + offset; } // ----------------------------------------------------------------------- |