Skip to content

Commit a658a76

Browse files
committed
[VPR] Rework get_channel_nodes() in RRSpatialLookup to filter out invalid nodes and avoid exposure on raw data
1 parent 785672f commit a658a76

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

vpr/src/device/rr_spatial_lookup.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ std::vector<RRNodeId> RRSpatialLookup::find_channel_nodes(int x,
124124
}
125125

126126
for (const auto& node : rr_node_indices_[type][node_x][node_y][node_side]) {
127-
channel_nodes.push_back(RRNodeId(node));
127+
if (RRNodeId(node)) {
128+
channel_nodes.push_back(RRNodeId(node));
129+
}
128130
}
129131

130132
return channel_nodes;

vpr/src/device/rr_spatial_lookup.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ class RRSpatialLookup {
7171
*
7272
* Note:
7373
* - Return an empty list if there are no routing channel at the given (x, y) location
74-
* - The node list returned may contain some holes (invalid ids), which means that
75-
* the routing track does not exist at a specific location
76-
* For example, if the 2nd element is an invalid id, it means the 2nd routing track does not exist
77-
* in a routing channel at (x, y) location
74+
* - The node list returned only contain valid ids
75+
* For example, if the 2nd routing track does not exist in a routing channel at (x, y) location,
76+
* while the 3rd routing track does exist in a routing channel at (x, y) location,
77+
* the node list will not contain the node for the 2nd routing track, but the 2nd element in the list
78+
* will be the node for the 3rd routing track
7879
*/
7980
std::vector<RRNodeId> find_channel_nodes(int x,
8081
int y,

vpr/src/route/router_lookahead_map.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,8 +564,6 @@ static RRNodeId get_start_node(int start_x, int start_y, int target_x, int targe
564564

565565
/* find first node in channel that has specified segment index and goes in the desired direction */
566566
for (const RRNodeId& node_id : device_ctx.rr_graph.node_lookup().find_channel_nodes(start_lookup_x, start_lookup_y, rr_type)) {
567-
if (!node_id) continue;
568-
569567
VTR_ASSERT(temp_rr_graph.node_type(node_id) == rr_type);
570568

571569
e_direction node_direction = rr_graph.node_direction(node_id);

vpr/src/route/router_lookahead_map_utils.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,6 @@ t_chan_ipins_delays compute_router_chan_ipin_lookahead() {
405405
for (int iy = min_y; iy < max_y; iy++) {
406406
for (auto rr_type : {CHANX, CHANY}) {
407407
for (const RRNodeId& node_id : device_ctx.rr_graph.node_lookup().find_channel_nodes(ix, iy, rr_type)) {
408-
if (!node_id) continue;
409-
410408
//Find the IPINs which are reachable from the wires within the bounding box
411409
//around the selected tile location
412410
dijkstra_flood_to_ipins(node_id, chan_ipins_delays);

0 commit comments

Comments
 (0)