vpr/src/route/rr_graph_reader.cpp
/* All channel info is read in and loaded into device_ctx.chan_width*/
All channel info is read in and loaded into device_ctx.chan_width
All channel info is read in and loaded into device_ctx . chan_width
void process_channels(t_chan_width& chan_width, const DeviceGrid& grid, pugi::xml_node parent, const pugiutil::loc_data& loc_data) {
    pugi::xml_node channel, channelLists;
    channel = get_first_child(parent, "channel", loc_data);
    chan_width.max = get_attribute(channel, "chan_width_max", loc_data).as_uint();
    chan_width.x_min = get_attribute(channel, "x_min", loc_data).as_uint();
    chan_width.y_min = get_attribute(channel, "y_min", loc_data).as_uint();
    chan_width.x_max = get_attribute(channel, "x_max", loc_data).as_uint();
    chan_width.y_max = get_attribute(channel, "y_max", loc_data).as_uint();
    chan_width.x_list.resize(grid.height());
    chan_width.y_list.resize(grid.width());
    channelLists = get_first_child(parent, "x_list", loc_data);
    while (channelLists) {
        size_t index = get_attribute(channelLists, "index", loc_data).as_uint();
        if (index >= chan_width.x_list.size()) {
            VPR_FATAL_ERROR(VPR_ERROR_OTHER,
                            "index %d on x_list exceeds x_list size %u",
                            index, chan_width.x_list.size());
        }
        chan_width.x_list[index] = get_attribute(channelLists, "info", loc_data).as_float();
        channelLists = channelLists.next_sibling(channelLists.name());
    }
    channelLists = get_first_child(parent, "y_list", loc_data);
    while (channelLists) {
        size_t index = get_attribute(channelLists, "index", loc_data).as_uint();
        if (index >= chan_width.y_list.size()) {
            VPR_FATAL_ERROR(VPR_ERROR_OTHER,
                            "index %d on y_list exceeds y_list size %u",
                            index, chan_width.y_list.size());
        }
        chan_width.y_list[index] = get_attribute(channelLists, "info", loc_data).as_float();
        channelLists = channelLists.next_sibling(channelLists.name());
    }
}
void process_channels ( t_chan_width & chan_width , const DeviceGrid & grid , pugi :: xml_node parent , const pugiutil :: loc_data & loc_data ) { pugi :: xml_node channel , channelLists ; channel = get_first_child ( parent , " " , loc_data ) ; chan_width . max = get_attribute ( channel , " " , loc_data ) . as_uint ( ) ; chan_width . x_min = get_attribute ( channel , " " , loc_data ) . as_uint ( ) ; chan_width . y_min = get_attribute ( channel , " " , loc_data ) . as_uint ( ) ; chan_width . x_max = get_attribute ( channel , " " , loc_data ) . as_uint ( ) ; chan_width . y_max = get_attribute ( channel , " " , loc_data ) . as_uint ( ) ; chan_width . x_list . resize ( grid . height ( ) ) ; chan_width . y_list . resize ( grid . width ( ) ) ; channelLists = get_first_child ( parent , " " , loc_data ) ; while ( channelLists ) { size_t index = get_attribute ( channelLists , " " , loc_data ) . as_uint ( ) ; if ( index >= chan_width . x_list . size ( ) ) { VPR_FATAL_ERROR ( VPR_ERROR_OTHER , " " , index , chan_width . x_list . size ( ) ) ; } chan_width . x_list [ index ] = get_attribute ( channelLists , " " , loc_data ) . as_float ( ) ; channelLists = channelLists . next_sibling ( channelLists . name ( ) ) ; } channelLists = get_first_child ( parent , " " , loc_data ) ; while ( channelLists ) { size_t index = get_attribute ( channelLists , " " , loc_data ) . as_uint ( ) ; if ( index >= chan_width . y_list . size ( ) ) { VPR_FATAL_ERROR ( VPR_ERROR_OTHER , " " , index , chan_width . y_list . size ( ) ) ; } chan_width . y_list [ index ] = get_attribute ( channelLists , " " , loc_data ) . as_float ( ) ; channelLists = channelLists . next_sibling ( channelLists . name ( ) ) ; } }
All channel info is read in and loaded into device_ctx.chan_width
All channel info is read in and loaded into device_ctx . chan_width