vpr/src/route/rr_graph_reader.cpp
/*Only CHANX and CHANY components have a segment id. This function
 *reads in the segment id of each node*/
Only CHANX and CHANY components have a segment id. This function
reads in the segment id of each node
Only CHANX and CHANY components have a segment id . This function reads in the segment id of each node
void process_seg_id(pugi::xml_node parent, const pugiutil::loc_data& loc_data) {
    auto& device_ctx = g_vpr_ctx.mutable_device();
    pugi::xml_node segmentSubnode;
    pugi::xml_node rr_node;
    pugi::xml_attribute attribute;
    int id;
    rr_node = get_first_child(parent, "node", loc_data);
    while (rr_node) {
        id = get_attribute(rr_node, "id", loc_data).as_int();
        RRNodeId node = RRNodeId(id);
        segmentSubnode = get_single_child(rr_node, "segment", loc_data, pugiutil::OPTIONAL);
        if (segmentSubnode) {
            attribute = get_attribute(segmentSubnode, "segment_id", loc_data, pugiutil::OPTIONAL);
            if (attribute) {
                int seg_id = get_attribute(segmentSubnode, "segment_id", loc_data).as_int(0);
                device_ctx.rr_indexed_data[device_ctx.rr_graph.node_cost_index(node)].seg_index = seg_id;
                device_ctx.rr_graph.set_node_segment(node, RRSegmentId(seg_id));
            } else {
                device_ctx.rr_indexed_data[device_ctx.rr_graph.node_cost_index(node)].seg_index = -1;
            }
        }
        rr_node = rr_node.next_sibling(rr_node.name());
    }
}
void process_seg_id ( pugi :: xml_node parent , const pugiutil :: loc_data & loc_data ) { auto & device_ctx = g_vpr_ctx . mutable_device ( ) ; pugi :: xml_node segmentSubnode ; pugi :: xml_node rr_node ; pugi :: xml_attribute attribute ; int id ; rr_node = get_first_child ( parent , " " , loc_data ) ; while ( rr_node ) { id = get_attribute ( rr_node , " " , loc_data ) . as_int ( ) ; RRNodeId node = RRNodeId ( id ) ; segmentSubnode = get_single_child ( rr_node , " " , loc_data , pugiutil :: OPTIONAL ) ; if ( segmentSubnode ) { attribute = get_attribute ( segmentSubnode , " " , loc_data , pugiutil :: OPTIONAL ) ; if ( attribute ) { int seg_id = get_attribute ( segmentSubnode , " " , loc_data ) . as_int ( 0 ) ; device_ctx . rr_indexed_data [ device_ctx . rr_graph . node_cost_index ( node ) ] . seg_index = seg_id ; device_ctx . rr_graph . set_node_segment ( node , RRSegmentId ( seg_id ) ) ; } else { device_ctx . rr_indexed_data [ device_ctx . rr_graph . node_cost_index ( node ) ] . seg_index = -1 ; } } rr_node = rr_node . next_sibling ( rr_node . name ( ) ) ; } }
Only CHANX and CHANY components have a segment id.
Only CHANX and CHANY components have a segment id .
// Assign node to a segment //-1 for non chanx or chany nodes