Skip to content

Commit 7b9c226

Browse files
add doxygen comment for load_chan_rr_indices()
1 parent 0cb4c48 commit 7b9c226

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

vpr/src/route/rr_graph_generation/rr_node_indices.cpp

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "globals.h"
66
#include "physical_types_util.h"
77

8-
98
/**
109
* @brief Assigns and loads rr_node indices for block-level routing resources (SOURCE, SINK, IPIN, OPIN).
1110
*
@@ -22,13 +21,28 @@ static void load_block_rr_indices(RRGraphBuilder& rr_graph_builder,
2221
const DeviceGrid& grid,
2322
int* index);
2423

24+
/**
25+
* @brief Populates the lookup indices for channel (CHANX or CHANY) RR nodes.
26+
*
27+
* This function builds part of the RR spatial lookup structure, specifically
28+
* the RR nodes associated with routing channels (CHANX or CHANY).
29+
*
30+
* @param max_chan_width Maximum channel width (number of tracks).
31+
* @param grid Device grid layout.
32+
* @param chan_len Length of the channel being processed.
33+
* @param num_chans Total number of channels in the direction being processed.
34+
* @param type RR node type: should be CHANX or CHANY.
35+
* @param chan_details Channel details used to determine segment and track information.
36+
* @param node_lookup Spatial RR node lookup to be filled by this function.
37+
* @param index The next available RR node index.
38+
*/
2539
static void load_chan_rr_indices(const int max_chan_width,
2640
const DeviceGrid& grid,
2741
const int chan_len,
2842
const int num_chans,
2943
const e_rr_type type,
3044
const t_chan_details& chan_details,
31-
RRGraphBuilder& rr_graph_builder,
45+
RRSpatialLookup& node_lookup,
3246
int* index);
3347

3448
static void add_classes_spatial_lookup(RRGraphBuilder& rr_graph_builder,
@@ -152,7 +166,7 @@ static void load_chan_rr_indices(const int max_chan_width,
152166
const int num_chans,
153167
const e_rr_type type,
154168
const t_chan_details& chan_details,
155-
RRGraphBuilder& rr_graph_builder,
169+
RRSpatialLookup& node_lookup,
156170
int* index) {
157171
const auto& device_ctx = g_vpr_ctx.device();
158172

@@ -170,7 +184,7 @@ static void load_chan_rr_indices(const int max_chan_width,
170184
const t_chan_seg_details* seg_details = chan_details[x][y].data();
171185

172186
// Reserve nodes in lookup to save memory
173-
rr_graph_builder.node_lookup().reserve_nodes(layer, x, y, type, max_chan_width);
187+
node_lookup.reserve_nodes(layer, x, y, type, max_chan_width);
174188

175189
for (int track = 0; track < max_chan_width; ++track) {
176190
/* TODO: May let the length() == 0 case go through, to model muxes */
@@ -182,15 +196,15 @@ static void load_chan_rr_indices(const int max_chan_width,
182196
int node_start_y = (type == e_rr_type::CHANX) ? chan : start;
183197

184198
// If the start of the wire doesn't have an RRNodeId, assign one to it.
185-
RRNodeId inode = rr_graph_builder.node_lookup().find_node(layer, node_start_x, node_start_y, type, track);
199+
RRNodeId inode = node_lookup.find_node(layer, node_start_x, node_start_y, type, track);
186200
if (!inode) {
187201
inode = RRNodeId(*index);
188202
++(*index);
189-
rr_graph_builder.node_lookup().add_node(inode, layer, node_start_x, node_start_y, type, track);
203+
node_lookup.add_node(inode, layer, node_start_x, node_start_y, type, track);
190204
}
191205

192206
// Assign RRNodeId of start of wire to current position
193-
rr_graph_builder.node_lookup().add_node(inode, layer, x, y, type, track);
207+
node_lookup.add_node(inode, layer, x, y, type, track);
194208
}
195209
}
196210
}
@@ -305,9 +319,9 @@ void alloc_and_load_rr_node_indices(RRGraphBuilder& rr_graph_builder,
305319

306320
/* Load the data for x and y channels */
307321
load_chan_rr_indices(nodes_per_chan.x_max, grid, grid.width(), grid.height(),
308-
e_rr_type::CHANX, chan_details_x, rr_graph_builder, index);
322+
e_rr_type::CHANX, chan_details_x, rr_graph_builder.node_lookup(), index);
309323
load_chan_rr_indices(nodes_per_chan.y_max, grid, grid.height(), grid.width(),
310-
e_rr_type::CHANY, chan_details_y, rr_graph_builder, index);
324+
e_rr_type::CHANY, chan_details_y, rr_graph_builder.node_lookup(), index);
311325
}
312326

313327
void alloc_and_load_inter_die_rr_node_indices(RRGraphBuilder& rr_graph_builder,
@@ -597,4 +611,4 @@ bool verify_rr_node_indices(const DeviceGrid& grid,
597611
}
598612

599613
return true;
600-
}
614+
}

0 commit comments

Comments
 (0)