5
5
#include " globals.h"
6
6
#include " physical_types_util.h"
7
7
8
-
9
8
/* *
10
9
* @brief Assigns and loads rr_node indices for block-level routing resources (SOURCE, SINK, IPIN, OPIN).
11
10
*
@@ -22,13 +21,28 @@ static void load_block_rr_indices(RRGraphBuilder& rr_graph_builder,
22
21
const DeviceGrid& grid,
23
22
int * index);
24
23
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
+ */
25
39
static void load_chan_rr_indices (const int max_chan_width,
26
40
const DeviceGrid& grid,
27
41
const int chan_len,
28
42
const int num_chans,
29
43
const e_rr_type type,
30
44
const t_chan_details& chan_details,
31
- RRGraphBuilder& rr_graph_builder ,
45
+ RRSpatialLookup& node_lookup ,
32
46
int * index);
33
47
34
48
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,
152
166
const int num_chans,
153
167
const e_rr_type type,
154
168
const t_chan_details& chan_details,
155
- RRGraphBuilder& rr_graph_builder ,
169
+ RRSpatialLookup& node_lookup ,
156
170
int * index) {
157
171
const auto & device_ctx = g_vpr_ctx.device ();
158
172
@@ -170,7 +184,7 @@ static void load_chan_rr_indices(const int max_chan_width,
170
184
const t_chan_seg_details* seg_details = chan_details[x][y].data ();
171
185
172
186
// 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);
174
188
175
189
for (int track = 0 ; track < max_chan_width; ++track) {
176
190
/* 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,
182
196
int node_start_y = (type == e_rr_type::CHANX) ? chan : start;
183
197
184
198
// 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);
186
200
if (!inode) {
187
201
inode = RRNodeId (*index );
188
202
++(*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);
190
204
}
191
205
192
206
// 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);
194
208
}
195
209
}
196
210
}
@@ -305,9 +319,9 @@ void alloc_and_load_rr_node_indices(RRGraphBuilder& rr_graph_builder,
305
319
306
320
/* Load the data for x and y channels */
307
321
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 );
309
323
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 );
311
325
}
312
326
313
327
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,
597
611
}
598
612
599
613
return true ;
600
- }
614
+ }
0 commit comments