Skip to content

Commit

Permalink
[vpr] fixed a bug on access invalid grid nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
tangxifan committed Jul 3, 2024
1 parent 46dd4bf commit c1f3c80
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vpr/src/tileable_rr_graph/rr_graph_view_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ std::vector<RRNodeId> find_rr_graph_grid_nodes(const RRGraphView& rr_graph,
VTR_ASSERT(rr_type == IPIN || rr_type == OPIN);

/* Ensure that (x, y) is a valid location in grids */
VTR_ASSERT(size_t(x) <= device_grid.width() && size_t(y) <= device_grid.height());
if (size_t(x) > device_grid.width() - 1 || size_t(y) > device_grid.height() - 1) {
return indices;
}

/* Ensure we have a valid side */
VTR_ASSERT(side != NUM_SIDES);
Expand All @@ -110,6 +112,7 @@ std::vector<RRNodeId> find_rr_graph_grid_nodes(const RRGraphView& rr_graph,
t_physical_tile_loc tile_loc(x, y, layer);
int width_offset = device_grid.get_width_offset(tile_loc);
int height_offset = device_grid.get_height_offset(tile_loc);

for (int pin = 0; pin < device_grid.get_physical_type(tile_loc)->num_pins; ++pin) {
/* Skip those pins have been ignored during rr_graph build-up */
if (true == device_grid.get_physical_type(tile_loc)->is_ignored_pin[pin]) {
Expand Down

0 comments on commit c1f3c80

Please sign in to comment.