Skip to content

Commit 9bdaa71

Browse files
committed
[lib][rr_graph] pass template_id when creating rr graph switch
1 parent 1ea8a74 commit 9bdaa71

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

libs/librrgraph/src/base/rr_switch.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ struct t_rr_switch_inf {
3131
e_power_buffer_type power_buffer_type = POWER_BUFFER_TYPE_UNDEFINED;
3232
float power_buffer_size = 0.;
3333

34+
// The template ID of the switch. This is metadata stored for each switch to
35+
// simplify certain analyses. For example, when generating the CRR graph, the
36+
// template ID is used to determine which switch in the template is used most
37+
// or least frequently.
38+
std::string template_id = "";
39+
3440
/// Indicate whether this rr_switch is a switch type used inside clusters.
3541
/// These switch types are not specified in the architecture description file
3642
/// and are added when flat router is enabled.

vpr/src/route/rr_graph_generation/rr_graph_switch_utils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ void load_rr_switch_from_arch_switch(RRGraphBuilder& rr_graph_builder,
116116
rr_graph_builder.rr_switch()[rr_switch_idx].name = arch_sw_inf.at(arch_switch_idx).name;
117117
rr_graph_builder.rr_switch()[rr_switch_idx].power_buffer_type = arch_sw_inf.at(arch_switch_idx).power_buffer_type;
118118
rr_graph_builder.rr_switch()[rr_switch_idx].power_buffer_size = arch_sw_inf.at(arch_switch_idx).power_buffer_size;
119+
120+
rr_graph_builder.rr_switch()[rr_switch_idx].template_id = arch_sw_inf.at(arch_switch_idx).template_id;
119121
}
120122

121123
t_rr_switch_inf create_rr_switch_from_arch_switch(const t_arch_switch_inf& arch_sw_inf,
@@ -146,6 +148,8 @@ t_rr_switch_inf create_rr_switch_from_arch_switch(const t_arch_switch_inf& arch_
146148
rr_switch_inf.power_buffer_type = arch_sw_inf.power_buffer_type;
147149
rr_switch_inf.power_buffer_size = arch_sw_inf.power_buffer_size;
148150

151+
rr_switch_inf.template_id = arch_sw_inf.template_id;
152+
149153
rr_switch_inf.intra_tile = arch_sw_inf.intra_tile;
150154

151155
return rr_switch_inf;

0 commit comments

Comments
 (0)