/******************************************************************** * This file includes functions that outputs a circuit library to XML format *******************************************************************/ /* Headers from system goes first */ #include /* Headers from vtr util library */ #include "vtr_log.h" #include "openfpga_digest.h" /* Headers from readarchopenfpga library */ #include "write_xml_utils.h" #include "write_xml_circuit_library.h" /******************************************************************** * A writer to output a circuit model to XML format *******************************************************************/ static void write_xml_circuit_model(std::fstream& fp, const char* fname, const CircuitLibrary& circuit_lib, const CircuitModelId& model) { /* Validate the file stream */ openfpga::check_file_stream(fname, fp); /* Write the definition of circuit model */ fp << "\t\t" << "" << "\n"; /* Put an end to the XML definition of this circuit model */ fp << "\t\t" << "\n"; } /******************************************************************** * A writer to output a circuit library to XML format *******************************************************************/ void write_xml_circuit_library(std::fstream& fp, const char* fname, const CircuitLibrary& circuit_lib) { /* Validate the file stream */ openfpga::check_file_stream(fname, fp); /* Write the root node for circuit_library, * we apply a tab becuase circuit library is a subnode * under the root node */ fp << "\t" << "" << "\n"; /* Write circuit model one by one */ for (const CircuitModelId& model : circuit_lib.models()) { write_xml_circuit_model(fp, fname, circuit_lib, model); } /* Write the root node for circuit_library */ fp << "\t" << "" << "\n"; }