Skip to content

Commit 44ffae4

Browse files
author
Nathan Shreve
committed
Added check in check_rr_node
1 parent c3ba21c commit 44ffae4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

libs/librrgraph/src/base/check_rr_graph.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,12 +399,23 @@ void check_rr_node(const RRGraphView& rr_graph,
399399
"in check_rr_node: node %d (type %d) has endpoints (%d,%d) and (%d,%d)\n", inode, rr_type, xlow, ylow, xhigh, yhigh);
400400
}
401401
break;
402-
case SINK:
402+
case SINK: {
403403
if (type == nullptr) {
404404
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
405405
"in check_rr_node: node %d (type %d) is at an illegal clb location (%d, %d).\n", inode, rr_type, xlow, ylow);
406406
}
407+
408+
int tile_xlow = xlow - grid.get_width_offset({xlow, ylow, layer_num});
409+
int tile_ylow = ylow - grid.get_height_offset({xlow, ylow, layer_num});
410+
int tile_xhigh = tile_xlow + type->width - 1;
411+
int tile_yhigh = tile_ylow + type->height - 1;
412+
413+
if (xlow < tile_xlow || ylow < tile_ylow || xhigh > tile_xhigh || yhigh > tile_yhigh) {
414+
VPR_FATAL_ERROR(VPR_ERROR_ROUTE,
415+
"in check_rr_node: node %d (type %d) has endpoints (%d,%d) and (%d,%d)\n", inode, rr_type, xlow, ylow, xhigh, yhigh);
416+
}
407417
break;
418+
}
408419
case IPIN:
409420
case OPIN:
410421
if (type == nullptr) {

0 commit comments

Comments
 (0)