libopenfpga/libarchopenfpga/src/write_xml_openfpga_arch.cpp
/********************************************************************
 * A writer to output an OpenFPGA arch database to XML format
 *******************************************************************/
A writer to output an OpenFPGA arch database to XML format
A writer to output an OpenFPGA arch database to XML format
void write_xml_openfpga_arch(const char* fname, 
                             const openfpga::Arch& openfpga_arch) {
  vtr::ScopedStartFinishTimer timer("Write OpenFPGA architecture");
  std::fstream fp;
  fp.open(std::string(fname), std::fstream::out | std::fstream::trunc);
  openfpga::check_file_stream(fname, fp);
  fp << "<openfpga_architecture>" << "\n";
  write_xml_technology_library(fp, fname, openfpga_arch.tech_lib);
  write_xml_circuit_library(fp, fname, openfpga_arch.circuit_lib);
  write_xml_config_protocol(fp, fname, openfpga_arch.config_protocol, openfpga_arch.circuit_lib);
  write_xml_cb_switch_circuit(fp, fname, openfpga_arch.circuit_lib, openfpga_arch.cb_switch2circuit);
  write_xml_sb_switch_circuit(fp, fname, openfpga_arch.circuit_lib, openfpga_arch.sb_switch2circuit);
  write_xml_routing_segment_circuit(fp, fname, openfpga_arch.circuit_lib, openfpga_arch.routing_seg2circuit);
  write_xml_direct_circuit(fp, fname, openfpga_arch.circuit_lib, openfpga_arch.arch_direct);
  openfpga::write_xml_tile_annotations(fp, fname, openfpga_arch.tile_annotations);
  openfpga::write_xml_pb_type_annotations(fp, fname, openfpga_arch.pb_type_annotations);
  fp << "</openfpga_architecture>" << "\n";
  fp.close();
}
void write_xml_openfpga_arch ( const char * fname , const openfpga :: Arch & openfpga_arch ) { vtr :: ScopedStartFinishTimer timer ( " " ) ; std :: fstream fp ; fp . open ( std :: string ( fname ) , std :: fstream :: out | std :: fstream :: trunc ) ; openfpga :: check_file_stream ( fname , fp ) ; fp << " " << " \n " ; write_xml_technology_library ( fp , fname , openfpga_arch . tech_lib ) ; write_xml_circuit_library ( fp , fname , openfpga_arch . circuit_lib ) ; write_xml_config_protocol ( fp , fname , openfpga_arch . config_protocol , openfpga_arch . circuit_lib ) ; write_xml_cb_switch_circuit ( fp , fname , openfpga_arch . circuit_lib , openfpga_arch . cb_switch2circuit ) ; write_xml_sb_switch_circuit ( fp , fname , openfpga_arch . circuit_lib , openfpga_arch . sb_switch2circuit ) ; write_xml_routing_segment_circuit ( fp , fname , openfpga_arch . circuit_lib , openfpga_arch . routing_seg2circuit ) ; write_xml_direct_circuit ( fp , fname , openfpga_arch . circuit_lib , openfpga_arch . arch_direct ) ; openfpga :: write_xml_tile_annotations ( fp , fname , openfpga_arch . tile_annotations ) ; openfpga :: write_xml_pb_type_annotations ( fp , fname , openfpga_arch . pb_type_annotations ) ; fp << " " << " \n " ; fp . close ( ) ; }
A writer to output an OpenFPGA arch database to XML format
A writer to output an OpenFPGA arch database to XML format
/* Create a file handler */ /* Open the file stream */ /* Validate the file stream */ /* Write the root node for openfpga_arch */ /* Write the technology library */ /* Write the circuit library */ /* Write the configuration protocol */ /* Write the connection block circuit definition */ /* Write the switch block circuit definition */ /* Write the routing segment circuit definition */ /* Write the direct connection circuit definition */ /* Write the pb_type annotations */ /* Write the pb_type annotations */ /* Close the file stream */