vpr/src/route/rr_graph.cpp
/* switch indices of each rr_node original point into the global device_ctx.arch_switch_inf array.
 * now we want to remap these indices to point into the global device_ctx.rr_switch_inf array
 * which contains switch info at different fan-in values */
switch indices of each rr_node original point into the global device_ctx.arch_switch_inf array.
now we want to remap these indices to point into the global device_ctx.rr_switch_inf array
which contains switch info at different fan-in values
switch indices of each rr_node original point into the global device_ctx . arch_switch_inf array . now we want to remap these indices to point into the global device_ctx . rr_switch_inf array which contains switch info at different fan - in values
static void remap_rr_node_switch_indices(const t_arch_switch_fanin& switch_fanin) {
    auto& device_ctx = g_vpr_ctx.mutable_device();
    for (const RRNodeId& inode : device_ctx.rr_graph.nodes()) {
        const RRNodeId& from_node = inode;
        for (const RREdgeId& iedge : device_ctx.rr_graph.node_out_edges(from_node)) {
            const RRNodeId& to_node = device_ctx.rr_graph.edge_sink_node(iedge);
            int switch_index = (int)size_t(device_ctx.rr_graph.edge_switch(iedge));
            int fanin = device_ctx.rr_graph.node_in_edges(to_node).size();
            if (switch_fanin[switch_index].count(UNDEFINED) == 1) {
                fanin = UNDEFINED;
            }
            auto itr = switch_fanin[switch_index].find(fanin);
            VTR_ASSERT(itr != switch_fanin[switch_index].end());
            int rr_switch_index = itr->second;
            device_ctx.rr_graph.set_edge_switch(iedge, RRSwitchId(rr_switch_index));
        }
    }
}
static void remap_rr_node_switch_indices ( const t_arch_switch_fanin & switch_fanin ) { auto & device_ctx = g_vpr_ctx . mutable_device ( ) ; for ( const RRNodeId & inode : device_ctx . rr_graph . nodes ( ) ) { const RRNodeId & from_node = inode ; for ( const RREdgeId & iedge : device_ctx . rr_graph . node_out_edges ( from_node ) ) { const RRNodeId & to_node = device_ctx . rr_graph . edge_sink_node ( iedge ) ; int switch_index = ( int ) size_t ( device_ctx . rr_graph . edge_switch ( iedge ) ) ; int fanin = device_ctx . rr_graph . node_in_edges ( to_node ) . size ( ) ; if ( switch_fanin [ switch_index ] . count ( UNDEFINED ) == 1 ) { fanin = UNDEFINED ; } auto itr = switch_fanin [ switch_index ] . find ( fanin ) ; VTR_ASSERT ( itr != switch_fanin [ switch_index ] . end ( ) ) ; int rr_switch_index = itr -> second ; device_ctx . rr_graph . set_edge_switch ( iedge , RRSwitchId ( rr_switch_index ) ) ; } } }
switch indices of each rr_node original point into the global device_ctx.arch_switch_inf array.
switch indices of each rr_node original point into the global device_ctx . arch_switch_inf array .
/* get the switch which this edge uses and its fanin */