/******************************************************************** * This file includes functions that outputs tile annotations to XML format *******************************************************************/ /* Headers from system goes first */ #include #include /* Headers from vtr util library */ #include "openfpga_digest.h" #include "vtr_assert.h" #include "vtr_log.h" /* Headers from readarchopenfpga library */ #include "write_xml_tile_annotation.h" #include "write_xml_utils.h" /* namespace openfpga begins */ namespace openfpga { /******************************************************************** * A writer to output a device variation in a technology library to XML format *******************************************************************/ static void write_xml_tile_annotation_global_port( std::fstream& fp, const char* fname, const openfpga::TileAnnotation& tile_annotation, const TileGlobalPortId& global_port_id) { /* Validate the file stream */ openfpga::check_file_stream(fname, fp); fp << "\t\t" << "" << "\n"; for (size_t tile_info_id = 0; tile_info_id < tile_annotation.global_port_tile_names(global_port_id).size(); ++tile_info_id) { fp << "\t\t\t" << ""; } fp << "\t\t" << ""; } /******************************************************************** * A writer to output tile annotations to XML format *******************************************************************/ void write_xml_tile_annotations(std::fstream& fp, const char* fname, const TileAnnotation& tile_annotation) { /* Validate the file stream */ openfpga::check_file_stream(fname, fp); /* Write the root node for pb_type annotations, * we apply a tab becuase pb_type annotations is just a subnode * under the root node */ fp << "\t" << "" << "\n"; /* Write device model one by one */ for (const TileGlobalPortId& global_port_id : tile_annotation.global_ports()) { write_xml_tile_annotation_global_port(fp, fname, tile_annotation, global_port_id); } /* Write the root node for pb_type annotations */ fp << "\t" << "" << "\n"; } } // namespace openfpga