Skip to content

Commit 84ef296

Browse files
committed
[vpr][rr_graph] fix iterator type
1 parent fe44c04 commit 84ef296

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

vpr/src/route/rr_graph.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ static short get_delayless_switch_id (t_det_routing_arch* det_routing_arch,
15441544
short delayless_switch;
15451545
if (load_rr_graph) {
15461546
const auto& rr_switches = device_ctx.rr_graph.rr_switch();
1547-
for (int switch_id = 0; switch_id < static_cast<int>(rr_switches.size()); switch_id++){
1547+
for (size_t switch_id = 0; switch_id < rr_switches.size(); switch_id++){
15481548
const auto& rr_switch = rr_switches[RRSwitchId(switch_id)];
15491549
if (rr_switch.name.find("delayless") != std::string::npos) {
15501550
delayless_switch = static_cast<short>(switch_id);
@@ -2067,7 +2067,8 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
20672067
/* If Fc gets clipped, this will be flagged to true */
20682068
*Fc_clipped = false;
20692069

2070-
/* This function is called to build the general routing graph resoruces. Thus, the edges are not remapped yet.*/
2070+
/* This function is called to build the general routing graph resoruces. Thus,
2071+
the edges are not remapped yet.*/
20712072
bool switches_remapped = false;
20722073

20732074
int num_edges = 0;
@@ -3008,11 +3009,13 @@ static void add_chain_node_fan_in_edges(RRGraphBuilder& rr_graph_builder,
30083009
is_rr_sw_id,
30093010
delay);
30103011

3011-
if (is_new_sw) {
3012-
if (!load_rr_graph) {
3013-
auto& switch_fanin_remap = g_vpr_ctx.mutable_device().switch_fanin_remap;
3014-
switch_fanin_remap.push_back({{UNDEFINED, size_t(sw_id)}});
3015-
}
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)}});
30163019
}
30173020

30183021
rr_edges_to_create.emplace_back(src_pair.first, sink_rr_node_id, sw_id, is_rr_sw_id);

0 commit comments

Comments
 (0)