From 3f865f90492f99362c639c62d5b76e874d0c2e8b Mon Sep 17 00:00:00 2001 From: Eddie Hung Date: Sun, 2 Sep 2018 23:38:53 -0700 Subject: [PATCH] Fix Arch::estimateDelay() --- xc7/delay.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xc7/delay.cc b/xc7/delay.cc index c85ec359..f6b74058 100644 --- a/xc7/delay.cc +++ b/xc7/delay.cc @@ -100,8 +100,12 @@ void ice40DelayFuzzerMain(Context *ctx) delay_t Arch::estimateDelay(WireId src, WireId dst) const { - //return 200 * (abs(src.location.x - dst.location.x) + abs(src.location.y - dst.location.y)); - return 0; + const auto &src_tw = torc_info->wire_to_tilewire[src.index]; + const auto &src_info = torc_info->tiles.getTileInfo(src_tw.getTileIndex()); + const auto &dst_tw = torc_info->wire_to_tilewire[dst.index]; + const auto &dst_info = torc_info->tiles.getTileInfo(dst_tw.getTileIndex()); + + return 200 * (abs(src_info.getCol() - dst_info.getCol()) + abs(src_info.getRow() - dst_info.getRow())); } delay_t Arch::predictDelay(const NetInfo *net_info, const PortRef &sink) const