vpr/src/device/write_xml_rr_graph_obj.cpp
/* Edges connecting to each rr node is printed out. The two nodes
 * it connects to are also printed
 */
Edges connecting to each rr node is printed out. The two nodes
it connects to are also printed
Edges connecting to each rr node is printed out . The two nodes it connects to are also printed
static 
void write_rr_graph_edges(fstream &fp, const RRGraph& rr_graph) {
  auto& device_ctx = g_vpr_ctx.device();
  fp << "\t<rr_edges>" << endl;
  for (auto node : rr_graph.nodes()) {
    std::vector<RREdgeId> sorted_out_edge_ids;
    for (auto edge: rr_graph.node_out_edges(node)) {
      fp << "\t\t<edge src_node=\"" << rr_graph.node_index(node) <<
            "\" sink_node=\"" << rr_graph.node_index(rr_graph.edge_sink_node(edge)) <<
            "\" switch_id=\"" << rr_graph.switch_index(rr_graph.edge_switch(edge)) << "\"";
      bool wrote_edge_metadata = false;
      const auto iter = device_ctx.rr_edge_metadata.find( std::make_tuple(rr_graph.node_index(node), 
                                                          rr_graph.node_index(rr_graph.edge_sink_node(edge)),
                                                          rr_graph.switch_index(rr_graph.edge_switch(edge))) );
      if(iter != device_ctx.rr_edge_metadata.end()) {
        fp << ">" << endl;
        const t_metadata_dict & meta = iter->second;
        add_metadata_to_xml(fp, "\t\t\t", meta);
        wrote_edge_metadata = true;
      }
      if(wrote_edge_metadata == false) {
        fp << "/>" << endl;
      } else {
        fp << "\t\t</edge>" << endl;
      }
    }
  }
  fp << "\t</rr_edges>" << endl << endl;
}
static void write_rr_graph_edges ( fstream & fp , const RRGraph & rr_graph ) { auto & device_ctx = g_vpr_ctx . device ( ) ; fp << " \t " << endl ; for ( auto node : rr_graph . nodes ( ) ) { std :: vector < RREdgeId > sorted_out_edge_ids ; for ( auto edge : rr_graph . node_out_edges ( node ) ) { fp << " \t \t \" " << rr_graph . node_index ( node ) << " \" \" " << rr_graph . node_index ( rr_graph . edge_sink_node ( edge ) ) << " \" \" " << rr_graph . switch_index ( rr_graph . edge_switch ( edge ) ) << " \" " ; bool wrote_edge_metadata = false ; const auto iter = device_ctx . rr_edge_metadata . find ( std :: make_tuple ( rr_graph . node_index ( node ) , rr_graph . node_index ( rr_graph . edge_sink_node ( edge ) ) , rr_graph . switch_index ( rr_graph . edge_switch ( edge ) ) ) ) ; if ( iter != device_ctx . rr_edge_metadata . end ( ) ) { fp << " " << endl ; const t_metadata_dict & meta = iter -> second ; add_metadata_to_xml ( fp , " \t \t \t " , meta ) ; wrote_edge_metadata = true ; } if ( wrote_edge_metadata == false ) { fp << " " << endl ; } else { fp << " \t \t " << endl ; } } } fp << " \t " << endl << endl ; }
Edges connecting to each rr node is printed out.
Edges connecting to each rr node is printed out .
/* Sort the edges by the ids of sink nodes */