[Tool] Bug fix in parser for bitstream settings

This commit is contained in:
tangxifan 2021-02-01 18:01:42 -07:00
parent f102e84497
commit d5b1cc5ec7
3 changed files with 27 additions and 1 deletions

View File

@ -14,6 +14,7 @@
#include "write_xml_circuit_library.h"
#include "write_xml_technology_library.h"
#include "write_xml_simulation_setting.h"
#include "write_xml_bitstream_setting.h"
#include "write_xml_config_protocol.h"
#include "write_xml_routing_circuit.h"
#include "write_xml_tile_annotation.h"
@ -92,3 +93,25 @@ void write_xml_openfpga_simulation_settings(const char* fname,
/* Close the file stream */
fp.close();
}
/********************************************************************
* A writer to output an OpenFPGA bitstream setting database to XML format
*******************************************************************/
void write_xml_openfpga_bitstream_settings(const char* fname,
const openfpga::BitstreamSetting& openfpga_bitstream_setting) {
vtr::ScopedStartFinishTimer timer("Write OpenFPGA bitstream settings");
/* Create a file handler */
std::fstream fp;
/* Open the file stream */
fp.open(std::string(fname), std::fstream::out | std::fstream::trunc);
/* Validate the file stream */
openfpga::check_file_stream(fname, fp);
/* Write the simulation */
write_xml_bitstream_setting(fp, fname, openfpga_bitstream_setting);
/* Close the file stream */
fp.close();
}

View File

@ -16,5 +16,8 @@ void write_xml_openfpga_arch(const char* xml_fname,
void write_xml_openfpga_simulation_settings(const char* xml_fname,
const openfpga::SimulationSetting& openfpga_sim_setting);
void write_xml_openfpga_bitstream_settings(const char* fname,
const openfpga::BitstreamSetting& openfpga_bitstream_setting);
#endif

View File

@ -16,7 +16,7 @@ int main(int argc, const char** argv) {
VTR_ASSERT((2 == argc) || (3 == argc));
/* Parse the simulation settings from an XML file */
const openfpga::BitstreamSetting& openfpga_sim_setting = read_xml_openfpga_bitstream_settings(argv[1]);
const openfpga::BitstreamSetting& openfpga_bitstream_setting = read_xml_openfpga_bitstream_settings(argv[1]);
VTR_LOG("Parsed bitstream settings from XML %s.\n",
argv[1]);