diff options
Diffstat (limited to 'ice40/arch.cc')
-rw-r--r-- | ice40/arch.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ice40/arch.cc b/ice40/arch.cc index edc104f0..b429a1cd 100644 --- a/ice40/arch.cc +++ b/ice40/arch.cc @@ -1255,6 +1255,30 @@ void Arch::assignCellInfo(CellInfo *cell) } } +ArcBounds Arch::getRouteBoundingBox(WireId src, WireId dst) const +{ + ArcBounds bb; + + int src_x = chip_info->wire_data[src.index].x; + int src_y = chip_info->wire_data[src.index].y; + int dst_x = chip_info->wire_data[dst.index].x; + int dst_y = chip_info->wire_data[dst.index].y; + + bb.x0 = src_x; + bb.y0 = src_y; + bb.x1 = src_x; + bb.y1 = src_y; + + auto extend = [&](int x, int y) { + bb.x0 = std::min(bb.x0, x); + bb.x1 = std::max(bb.x1, x); + bb.y0 = std::min(bb.y0, y); + bb.y1 = std::max(bb.y1, y); + }; + extend(dst_x, dst_y); + return bb; +} + #ifdef WITH_HEAP const std::string Arch::defaultPlacer = "heap"; #else |