vpr/src/device/write_xml_rr_graph_obj.cpp
/* This function is used to write the rr_graph into xml format into a a file with name: file_name */
This function is used to write the rr_graph into xml format into a a file with name: file_name
This function is used to write the rr_graph into xml format into a a file with name : file_name
void write_xml_rr_graph_obj(const char *file_name, const RRGraph& rr_graph) {
    fstream fp;
    fp.open(file_name, fstream::out | fstream::trunc);
    if (!fp.is_open() || !fp.good()) {
        vpr_throw(VPR_ERROR_OTHER, __FILE__, __LINE__,
                "couldn't open file \"%s\" for generating RR graph file\n", file_name);
    }
    cout << "Writing RR graph" << endl;
    fp << "<rr_graph tool_name=\"vpr\" tool_version=\"" << vtr::VERSION <<
            "\" tool_comment=\"Generated from arch file "
            << get_arch_file_name() << "\">" << endl;
    write_rr_channel(fp);
    write_rr_graph_switches(fp, rr_graph);
    write_rr_graph_segments(fp, rr_graph);
    write_rr_block_types(fp);
    write_rr_grid(fp);
    write_rr_graph_node(fp, rr_graph);
    write_rr_graph_edges(fp, rr_graph);
    fp << "</rr_graph>";
    fp.close();
    cout << "Finished generating RR graph file named " << file_name << endl << endl;
}
void write_xml_rr_graph_obj ( const char * file_name , const RRGraph & rr_graph ) { fstream fp ; fp . open ( file_name , fstream :: out | fstream :: trunc ) ; if ( ! fp . is_open ( ) || ! fp . good ( ) ) { vpr_throw ( VPR_ERROR_OTHER , __FILE__ , __LINE__ , " \" \" \n " , file_name ) ; } cout << " " << endl ; fp << " \" \" \" " << vtr :: VERSION << " \" \" " << get_arch_file_name ( ) << " \" " << endl ; write_rr_channel ( fp ) ; write_rr_graph_switches ( fp , rr_graph ) ; write_rr_graph_segments ( fp , rr_graph ) ; write_rr_block_types ( fp ) ; write_rr_grid ( fp ) ; write_rr_graph_node ( fp , rr_graph ) ; write_rr_graph_edges ( fp , rr_graph ) ; fp << " " ; fp . close ( ) ; cout << " " << file_name << endl << endl ; }
This function is used to write the rr_graph into xml format into a a file with name: file_name
This function is used to write the rr_graph into xml format into a a file with name : file_name
/* Prints out general info for easy error checking*/ /* Write out each individual component
     * Use existing write_rr_* functions as much as possible
     * 1. For those using external data structures outside RRGraph, 
     *    leave as it is.
     * 2. For those using RRGraph internal data, 
     *    write new functions 
     */