libopenfpga/libarchopenfpga/src/write_xml_circuit_library.cpp
/********************************************************************
 * A writer to output a circuit library to XML format
 * Note: 
 * This function should be run after that the following methods of 
 * CircuitLibrary are executed 
 * 1. build_model_links();
 * 2. build_timing_graph();
 *******************************************************************/
A writer to output a circuit library to XML format
Note:
This function should be run after that the following methods of
CircuitLibrary are executed
1.
A writer to output a circuit library to XML format Note : This function should be run after that the following methods of CircuitLibrary are executed 1 .
void write_xml_circuit_library(std::fstream& fp,
                               const char* fname,
                               const CircuitLibrary& circuit_lib) {
  openfpga::check_file_stream(fname, fp);
  fp << "\t" << "<circuit_library>" << "\n";
  for (const CircuitModelId& model : circuit_lib.models()) {
    write_xml_circuit_model(fp, fname, circuit_lib, model);
  } 
  fp << "\t" << "</circuit_library>" << "\n";
}
void write_xml_circuit_library ( std :: fstream & fp , const char * fname , const CircuitLibrary & circuit_lib ) { openfpga :: check_file_stream ( fname , fp ) ; fp << " \t " << " " << " \n " ; for ( const CircuitModelId & model : circuit_lib . models ( ) ) { write_xml_circuit_model ( fp , fname , circuit_lib , model ) ; } fp << " \t " << " " << " \n " ; }
A writer to output a circuit library to XML format
 Note:
 This function should be run after that the following methods of
 CircuitLibrary are executed
 1. build_model_links();
 2. build_timing_graph();
A writer to output a circuit library to XML format Note : This function should be run after that the following methods of CircuitLibrary are executed 1 . build_model_links () ; 2 . build_timing_graph () ;
/* Validate the file stream */ /* Write the root node for circuit_library, 
   * we apply a tab becuase circuit library is a subnode 
   * under the root node <openfpga_arch>
   */ /* Write circuit model one by one */ /* Write the root node for circuit_library */