libopenfpga/libarchopenfpga/src/write_xml_technology_library.cpp
/********************************************************************
 * A writer to output a technology library to XML format
 * Note: 
 * This function should be run after that the following methods of 
 * TechnologyLibrary are executed 
 * 1. link_models_to_variations();
 *******************************************************************/
A writer to output a technology library to XML format
Note:
This function should be run after that the following methods of
TechnologyLibrary are executed
1.
A writer to output a technology library to XML format Note : This function should be run after that the following methods of TechnologyLibrary are executed 1 .
void write_xml_technology_library(std::fstream& fp,
                                  const char* fname,
                                  const TechnologyLibrary& tech_lib) {
  openfpga::check_file_stream(fname, fp);
  fp << "\t" << "<technology_library>" << "\n";
  fp << "\t\t" << "<device_library>" << "\n";
  for (const TechnologyModelId& device_model : tech_lib.models()) {
    write_xml_device_model(fp, fname, tech_lib, device_model);
  }
  fp << "\t\t" << "</device_library>" << "\n";
  fp << "\t\t" << "<variation_library>" << "\n";
  for (const TechnologyVariationId& variation : tech_lib.variations()) {
    write_xml_device_variation(fp, fname, tech_lib, variation);
  }
  fp << "\t\t" << "</variation_library>" << "\n";
  fp << "\t" << "</technology_library>" << "\n";
}
void write_xml_technology_library ( std :: fstream & fp , const char * fname , const TechnologyLibrary & tech_lib ) { openfpga :: check_file_stream ( fname , fp ) ; fp << " \t " << " " << " \n " ; fp << " \t \t " << " " << " \n " ; for ( const TechnologyModelId & device_model : tech_lib . models ( ) ) { write_xml_device_model ( fp , fname , tech_lib , device_model ) ; } fp << " \t \t " << " " << " \n " ; fp << " \t \t " << " " << " \n " ; for ( const TechnologyVariationId & variation : tech_lib . variations ( ) ) { write_xml_device_variation ( fp , fname , tech_lib , variation ) ; } fp << " \t \t " << " " << " \n " ; fp << " \t " << " " << " \n " ; }
A writer to output a technology library to XML format
 Note:
 This function should be run after that the following methods of
 TechnologyLibrary are executed
 1. link_models_to_variations();
A writer to output a technology library to XML format Note : This function should be run after that the following methods of TechnologyLibrary are executed 1 . link_models_to_variations () ;
/* Validate the file stream */ /* Write the root node for technology_library, 
   * we apply a tab becuase technology library is a subnode 
   * under the root node <openfpga_arch>
   */ /* Write device library node */ /* Write device model one by one */ /* Finish writing device library node */ /* Write variation library node */ /* Write variation model one by one */ /* Finish writing variation library node */ /* Write the root node for circuit_library */