vpr/src/device/write_xml_rr_graph_obj.cpp
/* Switch info is written out into xml format. This includes
 * general, sizing, and optional timing information
 */
Switch info is written out into xml format. This includes
general, sizing, and optional timing information
Switch info is written out into xml format . This includes general sizing and optional timing information
static 
void write_rr_graph_switches(fstream &fp, const RRGraph& rr_graph) {
  fp << "\t<switches>" << endl;
  for (auto rr_switch : rr_graph.switches()) {
    fp << "\t\t<switch id=\"" << rr_graph.switch_index(rr_switch);
    t_rr_switch_inf cur_switch = rr_graph.get_switch(rr_switch);
    if (cur_switch.type() == SwitchType::TRISTATE) {
      fp << "\" type=\"tristate";
    } else if (cur_switch.type() == SwitchType::MUX) {
      fp << "\" type=\"mux";
    } else if (cur_switch.type() == SwitchType::PASS_GATE) {
      fp << "\" type=\"pass_gate";
    } else if (cur_switch.type() == SwitchType::SHORT) {
      fp << "\" type=\"short";
    } else if (cur_switch.type() == SwitchType::BUFFER) {
      fp << "\" type=\"buffer";
    } else {
      VPR_THROW(VPR_ERROR_ROUTE, "Invalid switch type %d\n", cur_switch.type());
    }
    fp << "\"";
    if (cur_switch.name) {
      fp << " name=\"" << cur_switch.name << "\"";
    }
    fp << ">" << endl;
    fp << "\t\t\t<timing R=\"" << setprecision(FLOAT_PRECISION) << cur_switch.R <<
          "\" Cin=\"" << setprecision(FLOAT_PRECISION) << cur_switch.Cin <<
          "\" Cout=\"" << setprecision(FLOAT_PRECISION) << cur_switch.Cout <<
          "\" Cinternal=\"" << setprecision(FLOAT_PRECISION) << cur_switch.Cinternal <<
          "\" Tdel=\"" << setprecision(FLOAT_PRECISION) << cur_switch.Tdel << "\"/>" << endl;
    fp << "\t\t\t<sizing mux_trans_size=\"" << setprecision(FLOAT_PRECISION) << cur_switch.mux_trans_size <<
          "\" buf_size=\"" << setprecision(FLOAT_PRECISION) << cur_switch.buf_size << "\"/>" << endl;
    fp << "\t\t</switch>" << endl;
  }
  fp << "\t</switches>" << endl << endl;
  return;
}
static void write_rr_graph_switches ( fstream & fp , const RRGraph & rr_graph ) { fp << " \t " << endl ; for ( auto rr_switch : rr_graph . switches ( ) ) { fp << " \t \t \" " << rr_graph . switch_index ( rr_switch ) ; t_rr_switch_inf cur_switch = rr_graph . get_switch ( rr_switch ) ; if ( cur_switch . type ( ) == SwitchType :: TRISTATE ) { fp << " \" \" " ; } else if ( cur_switch . type ( ) == SwitchType :: MUX ) { fp << " \" \" " ; } else if ( cur_switch . type ( ) == SwitchType :: PASS_GATE ) { fp << " \" \" " ; } else if ( cur_switch . type ( ) == SwitchType :: SHORT ) { fp << " \" \" " ; } else if ( cur_switch . type ( ) == SwitchType :: BUFFER ) { fp << " \" \" " ; } else { VPR_THROW ( VPR_ERROR_ROUTE , " \n " , cur_switch . type ( ) ) ; } fp << " \" " ; if ( cur_switch . name ) { fp << " \" " << cur_switch . name << " \" " ; } fp << " " << endl ; fp << " \t \t \t \" " << setprecision ( FLOAT_PRECISION ) << cur_switch . R << " \" \" " << setprecision ( FLOAT_PRECISION ) << cur_switch . Cin << " \" \" " << setprecision ( FLOAT_PRECISION ) << cur_switch . Cout << " \" \" " << setprecision ( FLOAT_PRECISION ) << cur_switch . Cinternal << " \" \" " << setprecision ( FLOAT_PRECISION ) << cur_switch . Tdel << " \" " << endl ; fp << " \t \t \t \" " << setprecision ( FLOAT_PRECISION ) << cur_switch . mux_trans_size << " \" \" " << setprecision ( FLOAT_PRECISION ) << cur_switch . buf_size << " \" " << endl ; fp << " \t \t " << endl ; } fp << " \t " << endl << endl ; return ; }
Switch info is written out into xml format.
Switch info is written out into xml format .