Skip to content

Commit 4657a7d

Browse files
committed
[vpr][rr_graph] add switch to rr switch if new arch switch is found
1 parent 84ef296 commit 4657a7d

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

vpr/src/route/rr_graph.cpp

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2476,17 +2476,6 @@ static void connect_tile_src_sink_to_pins(RRGraphBuilder& rr_graph_builder,
24762476
continue;
24772477
}
24782478
auto pin_type = get_pin_type_from_pin_physical_num(physical_type_ptr, pin_num);
2479-
/*int sw_id = -1;
2480-
* if (is_primitive || pin_type == RECEIVER) {
2481-
* VTR_ASSERT(logical_block != nullptr);
2482-
* float primitive_comb_delay = get_pin_primitive_comb_delay(physical_type_ptr,
2483-
* logical_block,
2484-
* pin_num);
2485-
* sw_id = find_create_intra_cluster_sw_arch_idx(arch_sw_inf_map,
2486-
* primitive_comb_delay);
2487-
* } else {
2488-
* sw_id = delayless_switch;
2489-
* }*/
24902479
if (class_type == DRIVER) {
24912480
VTR_ASSERT(pin_type == DRIVER);
24922481
rr_edges_to_create.emplace_back(class_rr_node_id, pin_rr_node_id, delayless_switch, false);
@@ -3009,15 +2998,6 @@ static void add_chain_node_fan_in_edges(RRGraphBuilder& rr_graph_builder,
30092998
is_rr_sw_id,
30102999
delay);
30113000

3012-
/*If the switch found inside the cluster has not seen before and RR graph is not read from a file,
3013-
we need to add this switch to switch_fanin_remap data strcutre which is used later to remap switch IDs
3014-
from architecture ID to RR graph switch ID. The reason why we don't this when RR graph is read from a file
3015-
is that in that case, the switch IDs of edges are alreay RR graph switch IDs. */
3016-
if (is_new_sw && !load_rr_graph) {
3017-
auto& switch_fanin_remap = g_vpr_ctx.mutable_device().switch_fanin_remap;
3018-
switch_fanin_remap.push_back({{UNDEFINED, size_t(sw_id)}});
3019-
}
3020-
30213001
rr_edges_to_create.emplace_back(src_pair.first, sink_rr_node_id, sw_id, is_rr_sw_id);
30223002
}
30233003
}
@@ -4976,6 +4956,18 @@ static std::pair<bool, int> find_create_intra_cluster_sw(RRGraphBuilder& rr_grap
49764956
// If this assumption proven to not be accurate, the implementation needs to be changed.
49774957
VTR_ASSERT(arch_sw.fixed_Tdel());
49784958

4959+
t_rr_switch_inf new_rr_switch_inf = create_rr_switch_from_arch_switch(create_internal_arch_sw(delay),
4960+
R_minW_nmos,
4961+
R_minW_pmos);
4962+
RRSwitchId rr_switch_id = rr_graph.add_rr_switch(new_rr_switch_inf);
4963+
4964+
/*If the switch found inside the cluster has not seen before and RR graph is not read from a file,
4965+
we need to add this switch to switch_fanin_remap data strcutre which is used later to remap switch IDs
4966+
from architecture ID to RR graph switch ID. The reason why we don't this when RR graph is read from a file
4967+
is that in that case, the switch IDs of edges are alreay RR graph switch IDs. */
4968+
auto& switch_fanin_remap = g_vpr_ctx.mutable_device().switch_fanin_remap;
4969+
switch_fanin_remap.push_back({{UNDEFINED, size_t(rr_switch_id)}});
4970+
49794971
return std::make_pair(true, new_key_num);
49804972
} else {
49814973
return std::make_pair(false, find_res->first);

0 commit comments

Comments
 (0)