aboutsummaryrefslogtreecommitdiffstats
path: root/fpga_interchange/arch.cc
diff options
context:
space:
mode:
authorKeith Rothman <537074+litghost@users.noreply.github.com>2021-04-02 16:23:29 -0700
committerKeith Rothman <537074+litghost@users.noreply.github.com>2021-04-06 10:42:05 -0700
commitae2f7551c11ebf24c96b3ac8d1315ff648183a49 (patch)
tree0ca02583c7dd0a49c4d62fd79098c37eb790cb69 /fpga_interchange/arch.cc
parentc43ad2fab6b35a4b9748ce4bb8807a8fe5205b0d (diff)
downloadnextpnr-ae2f7551c11ebf24c96b3ac8d1315ff648183a49.tar.gz
nextpnr-ae2f7551c11ebf24c96b3ac8d1315ff648183a49.tar.bz2
nextpnr-ae2f7551c11ebf24c96b3ac8d1315ff648183a49.zip
[interchange] Provide estimateDelay when USE_LOOKAHEAD is not defined.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'fpga_interchange/arch.cc')
-rw-r--r--fpga_interchange/arch.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/fpga_interchange/arch.cc b/fpga_interchange/arch.cc
index f1eeae6e..aab73b4d 100644
--- a/fpga_interchange/arch.cc
+++ b/fpga_interchange/arch.cc
@@ -925,7 +925,22 @@ delay_t Arch::estimateDelay(WireId src, WireId dst) const
#ifdef USE_LOOKAHEAD
return lookahead.estimateDelay(getCtx(), src, dst);
#else
- return 0;
+ // Note: Something is better than nothing when USE_LOOKAHEAD is not
+ // defined.
+ int src_tile = src.tile == -1 ? chip_info->nodes[src.index].tile_wires[0].tile : src.tile;
+ int dst_tile = dst.tile == -1 ? chip_info->nodes[dst.index].tile_wires[0].tile : dst.tile;
+
+ int src_x, src_y;
+ get_tile_x_y(src_tile, &src_x, &src_y);
+
+ int dst_x, dst_y;
+ get_tile_x_y(dst_tile, &dst_x, &dst_y);
+
+ delay_t base = 30 * std::min(std::abs(dst_x - src_x), 18) + 10 * std::max(std::abs(dst_x - src_x) - 18, 0) +
+ 60 * std::min(std::abs(dst_y - src_y), 6) + 20 * std::max(std::abs(dst_y - src_y) - 6, 0) + 300;
+
+ base = (base * 3) / 2;
+ return base;
#endif
}