Skip to content

Commit 43bde82

Browse files
add declaration for process_rr_edge_override()
1 parent 16870df commit 43bde82

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

libs/librrgraph/src/io/rr_graph_reader.cpp

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@
3030
# include "mmap_file.h"
3131
#endif
3232

33+
/**
34+
* @brief Parses a line from the RR edge attribute override file.
35+
*
36+
* @details Expected formats:
37+
* edge_id Tdel [R] [Cin] [Cout] [Cinternal]
38+
* (source_node_id, sink_node_id) Tdel [R] [Cin] [Cout] [Cinternal]
39+
* Attributes in [brackets] are optional.
40+
*
41+
* @param line The line to parse.
42+
* @param overridden_values Parsed override values.
43+
* @param rr_graph The RR graph for edge lookup using source-sink nodes.
44+
* @return The RR edge whose attributes are to be overridden.
45+
*/
46+
static RREdgeId process_rr_edge_override(const std::string& line,
47+
std::vector<float>& overridden_values,
48+
const RRGraphView& rr_graph);
49+
3350
/************************ Subroutine definitions ****************************/
3451
/* loads the given RR_graph file into the appropriate data structures
3552
* as specified by read_rr_graph_name. Set up correct routing data
@@ -39,6 +56,7 @@
3956
* parameters are a workaround to passing the data structures of DeviceContext.
4057
* Needs a solution to reduce the number of parameters passed in.*/
4158

59+
4260
void load_rr_file(RRGraphBuilder* rr_graph_builder,
4361
RRGraphView* rr_graph,
4462
const std::vector<t_physical_tile_type>& physical_tile_types,
@@ -117,9 +135,9 @@ void load_rr_file(RRGraphBuilder* rr_graph_builder,
117135
}
118136
}
119137

120-
RREdgeId process_line(const std::string& line,
121-
std::vector<float>& overridden_values,
122-
const RRGraphView& rr_graph) {
138+
static RREdgeId process_rr_edge_override(const std::string& line,
139+
std::vector<float>& overridden_values,
140+
const RRGraphView& rr_graph) {
123141
std::istringstream iss(line);
124142
char ch;
125143
RREdgeId edge_id;
@@ -231,7 +249,7 @@ void load_rr_edge_overrides(std::string_view filename,
231249

232250
if (!line.empty()) {
233251
overridden_values.clear();
234-
RREdgeId edge_id = process_line(line, overridden_values, rr_graph);
252+
RREdgeId edge_id = process_rr_edge_override(line, overridden_values, rr_graph);
235253
RRSwitchId curr_switch_id = (RRSwitchId)rr_graph.edge_switch(edge_id);
236254
t_rr_switch_inf switch_override_info = rr_graph.rr_switch_inf(curr_switch_id);
237255

0 commit comments

Comments
 (0)