Skip to content

Commit cf49863

Browse files
committed
[lib][rr_graph] apply comments for rr_graph_storage
1 parent 4a05ac1 commit cf49863

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

libs/librrgraph/src/base/rr_graph_storage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ void t_rr_graph_storage::init_fan_in() {
186186
node_fan_in_.resize(node_storage_.size(), 0);
187187
node_fan_in_.shrink_to_fit();
188188
//Walk the graph and increment fanin on all downstream nodes
189-
for(const auto& edge_id : edge_dest_node_.keys()) {
190-
node_fan_in_[edge_dest_node_[edge_id]] += 1;
189+
for(const auto& [_, dest_node] : edge_dest_node_.pairs()) {
190+
node_fan_in_[dest_node] += 1;
191191
}
192192
}
193193

libs/librrgraph/src/base/rr_graph_storage.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -705,10 +705,22 @@ class t_rr_graph_storage {
705705
void set_node_capacity(RRNodeId, short new_capacity);
706706
void set_node_direction(RRNodeId, Direction new_direction);
707707

708+
/**
709+
* @brief Set the ptc numbers for a node.
710+
* @param node The node id
711+
* @param ptc_str The ptc numbers string. Note that if tileable RR Graph is used,
712+
* multiple ptc numbers can be assigned to node of the type of CHANX or CHANY. If that's the case,
713+
* the ptc numbers are separated by commas.
714+
*/
708715
void set_node_ptc_nums(RRNodeId node, const std::string& ptc_str);
709-
void add_node_tilable_track_num(RRNodeId node, size_t node_offset, short track_id);
710716

711-
void emplace_back_node_tilable_track_num();
717+
/**
718+
* @brief Add a track number to a node.
719+
* @param node The node id
720+
* @param node_offset The offset of the node from the beginning of the node.
721+
* @param track_id The track number (ptc number) of the node at the given offset.
722+
*/
723+
void add_node_tilable_track_num(RRNodeId node, size_t node_offset, short track_id);
712724

713725
bool node_contain_multiple_ptc(RRNodeId node) const {
714726
if (node_tilable_track_nums_.empty()) {

0 commit comments

Comments
 (0)