Skip to content

Commit

Permalink
[interchange] Provide estimateDelay when USE_LOOKAHEAD is not defined.
Browse files Browse the repository at this point in the history
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
  • Loading branch information
litghost committed Apr 6, 2021
1 parent c43ad2f commit ae2f755
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion fpga_interchange/arch.cc
Expand Up @@ -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
}

Expand Down

0 comments on commit ae2f755

Please sign in to comment.