@@ -1544,7 +1544,7 @@ static short get_delayless_switch_id (t_det_routing_arch* det_routing_arch,
1544
1544
short delayless_switch;
1545
1545
if (load_rr_graph) {
1546
1546
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++){
1548
1548
const auto & rr_switch = rr_switches[RRSwitchId (switch_id)];
1549
1549
if (rr_switch.name .find (" delayless" ) != std::string::npos) {
1550
1550
delayless_switch = static_cast <short >(switch_id);
@@ -2067,7 +2067,8 @@ static std::function<void(t_chan_width*)> alloc_and_load_rr_graph(RRGraphBuilder
2067
2067
/* If Fc gets clipped, this will be flagged to true */
2068
2068
*Fc_clipped = false ;
2069
2069
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.*/
2071
2072
bool switches_remapped = false ;
2072
2073
2073
2074
int num_edges = 0 ;
@@ -3008,11 +3009,13 @@ static void add_chain_node_fan_in_edges(RRGraphBuilder& rr_graph_builder,
3008
3009
is_rr_sw_id,
3009
3010
delay);
3010
3011
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)}});
3016
3019
}
3017
3020
3018
3021
rr_edges_to_create.emplace_back (src_pair.first , sink_rr_node_id, sw_id, is_rr_sw_id);
0 commit comments