@@ -12,7 +12,7 @@ static std::string get_crr_switch_name(const int delay_ps) {
1212 }
1313}
1414
15- static t_arch_switch_inf create_crr_switch (const int delay_ps) {
15+ static t_arch_switch_inf create_crr_switch (const int delay_ps, const std::string& sw_template_id ) {
1616 std::string switch_name = get_crr_switch_name (delay_ps);
1717
1818 t_arch_switch_inf arch_switch_inf;
@@ -27,23 +27,23 @@ static t_arch_switch_inf create_crr_switch(const int delay_ps) {
2727 arch_switch_inf.buf_size_type = e_buffer_size::ABSOLUTE;
2828 arch_switch_inf.buf_size = 0 .;
2929 arch_switch_inf.intra_tile = false ;
30+ arch_switch_inf.template_id = sw_template_id;
3031
3132 return arch_switch_inf;
3233}
3334
34- static RRSwitchId find_or_create_crr_switch_id (const int delay_ps) {
35+ static RRSwitchId find_or_create_crr_switch_id (const int delay_ps, const std::string& sw_template_id ) {
3536 std::vector<t_arch_switch_inf>& all_sw_inf = g_vpr_ctx.mutable_device ().all_sw_inf ;
36- std::string switch_name = get_crr_switch_name (delay_ps);
3737 int found_sw_id = -1 ;
3838 for (int sw_id = 0 ; sw_id < (int )all_sw_inf.size (); sw_id++) {
39- if (all_sw_inf[sw_id].name == switch_name ) {
39+ if (all_sw_inf[sw_id].template_id == sw_template_id ) {
4040 found_sw_id = sw_id;
4141 break ;
4242 }
4343 }
4444
4545 if (found_sw_id == -1 ) {
46- t_arch_switch_inf new_arch_switch_inf = create_crr_switch (delay_ps);
46+ t_arch_switch_inf new_arch_switch_inf = create_crr_switch (delay_ps, sw_template_id );
4747 found_sw_id = (int )all_sw_inf.size ();
4848 all_sw_inf.insert (std::make_pair (found_sw_id, new_arch_switch_inf));
4949 VTR_LOG (" Created new CRR switch: %s with ID: %d\n " , switch_name.c_str (), found_sw_id);
@@ -66,7 +66,7 @@ void build_crr_gsb_edges(RRGraphBuilder& rr_graph_builder,
6666 if (delay_ps == -1 ) {
6767 rr_switch_id = rr_node_driver_switches[connection.sink_node ()];
6868 } else {
69- rr_switch_id = find_or_create_crr_switch_id (delay_ps);
69+ rr_switch_id = find_or_create_crr_switch_id (delay_ps, connection. sw_template_id () );
7070 }
7171 VTR_ASSERT (rr_switch_id != RRSwitchId::INVALID ());
7272 rr_graph_builder.create_edge_in_cache (connection.src_node (),
0 commit comments