Skip to content

Commit 1a911ec

Browse files
add doxygen comments for load_block_rr_indices()
1 parent b11be13 commit 1a911ec

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

libs/librrgraph/src/base/rr_spatial_lookup.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ void RRSpatialLookup::resize_nodes(int layer,
338338
|| (x >= int(rr_node_indices_[type].dim_size(1)))
339339
|| (y >= int(rr_node_indices_[type].dim_size(2)))
340340
|| (size_t(side) >= rr_node_indices_[type].dim_size(3))) {
341-
rr_node_indices_[type].resize({std::max(rr_node_indices_[type].dim_size(0),size_t(layer)+1),
341+
rr_node_indices_[type].resize({std::max(rr_node_indices_[type].dim_size(0), size_t(layer)+1),
342342
std::max(rr_node_indices_[type].dim_size(1), size_t(x) + 1),
343343
std::max(rr_node_indices_[type].dim_size(2), size_t(y) + 1),
344344
std::max(rr_node_indices_[type].dim_size(3), size_t(side) + 1)});

vpr/src/route/rr_graph2.cpp

+13
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,18 @@ static void load_chan_rr_indices(const int max_chan_width,
3333
RRGraphBuilder& rr_graph_builder,
3434
int* index);
3535

36+
/**
37+
* @brief Assigns and loads rr_node indices for block-level routing resources (SOURCE, SINK, IPIN, OPIN).
38+
*
39+
* This function walks through the device grid and assigns unique rr_node indices to the routing resources
40+
* associated with each block (tiles).
41+
*
42+
* For SINKs and SOURCEs, it uses side 0 by convention (since they have no geometric side). For IPINs and OPINs,
43+
* it determines the correct sides based on the tile's position in the grid, following special rules for
44+
* edge and corner tiles.
45+
*
46+
* The index counter is passed and updated as rr_nodes are added.
47+
*/
3648
static void load_block_rr_indices(RRGraphBuilder& rr_graph_builder,
3749
const DeviceGrid& grid,
3850
int* index,
@@ -1347,6 +1359,7 @@ static void load_block_rr_indices(RRGraphBuilder& rr_graph_builder,
13471359
}
13481360
}
13491361
}
1362+
13501363
static void add_pins_spatial_lookup(RRGraphBuilder& rr_graph_builder,
13511364
t_physical_tile_type_ptr physical_type_ptr,
13521365
const std::vector<int>& pin_num_vec,

0 commit comments

Comments
 (0)