Skip to content

Commit faecc12

Browse files
committed
[vpr][route] add a condition to not increment delta_seg if the segment is on the edge
1 parent a9043e0 commit faecc12

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

vpr/src/route/router_lookahead_map_utils.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,14 @@ std::pair<int, int> get_xy_deltas(RRNodeId from_node, RRNodeId to_node) {
673673
Direction from_dir = rr_graph.node_direction(from_node);
674674
if (is_chan(from_type)
675675
&& ((to_seg < from_seg_low && from_dir == Direction::INC) || (to_seg > from_seg_high && from_dir == Direction::DEC))) {
676-
delta_seg++;
676+
// If the routing channel starts from the perimeter of the grid,
677+
// and it is heading towards the outside of the grid, we should
678+
// not increment the delta_seg by 1.
679+
if (!((from_seg_low == 0 && from_dir == Direction::DEC) ||
680+
(from_seg_low == static_cast<int>(device_ctx.grid.height()) - 1 &&
681+
from_dir == Direction::INC))) {
682+
delta_seg++;
683+
}
677684
}
678685

679686
if (from_type == CHANY) {

0 commit comments

Comments
 (0)