rename files in fpga bitstream library to be consistent with conventions

This commit is contained in:
tangxifan 2020-06-21 13:06:39 -06:00
parent 2f33c35a4f
commit aded675633
4 changed files with 13 additions and 18 deletions

View File

@ -17,7 +17,7 @@
#include "openfpga_reserved_words.h" #include "openfpga_reserved_words.h"
#include "bitstream_manager_utils.h" #include "bitstream_manager_utils.h"
#include "arch_bitstream_writer.h" #include "write_xml_arch_bitstream.h"
/* begin namespace openfpga */ /* begin namespace openfpga */
namespace openfpga { namespace openfpga {
@ -166,9 +166,8 @@ void rec_write_block_bitstream_to_xml_file(std::fstream& fp,
* specific FPGAs * specific FPGAs
* 3. TODO: support FASM format * 3. TODO: support FASM format
*******************************************************************/ *******************************************************************/
void write_arch_independent_bitstream_to_xml_file(const BitstreamManager& bitstream_manager, void write_xml_architecture_bitstream(const BitstreamManager& bitstream_manager,
const std::string& top_block_name, const std::string& fname) {
const std::string& fname) {
/* Ensure that we have a valid file name */ /* Ensure that we have a valid file name */
if (true == fname.empty()) { if (true == fname.empty()) {
VTR_LOG_ERROR("Received empty file name to output bitstream!\n\tPlease specify a valid file name.\n"); VTR_LOG_ERROR("Received empty file name to output bitstream!\n\tPlease specify a valid file name.\n");
@ -188,9 +187,8 @@ void write_arch_independent_bitstream_to_xml_file(const BitstreamManager& bitstr
/* Find the top block, which has not parents */ /* Find the top block, which has not parents */
std::vector<ConfigBlockId> top_block = find_bitstream_manager_top_blocks(bitstream_manager); std::vector<ConfigBlockId> top_block = find_bitstream_manager_top_blocks(bitstream_manager);
/* Make sure we have only 1 top block and its name matches the top module */ /* Make sure we have only 1 top block */
VTR_ASSERT(1 == top_block.size()); VTR_ASSERT(1 == top_block.size());
VTR_ASSERT(0 == top_block_name.compare(bitstream_manager.block_name(top_block[0])));
/* Write bitstream, block by block, in a recursive way */ /* Write bitstream, block by block, in a recursive way */
rec_write_block_bitstream_to_xml_file(fp, bitstream_manager, top_block[0], 0); rec_write_block_bitstream_to_xml_file(fp, bitstream_manager, top_block[0], 0);

View File

@ -1,5 +1,5 @@
#ifndef ARCH_BITSTREAM_WRITER_H #ifndef WRITE_XML_ARCH_BITSTREAM_H
#define ARCH_BITSTREAM_WRITER_H #define WRITE_XML_ARCH_BITSTREAM_H
/******************************************************************** /********************************************************************
* Include header files that are required by function declaration * Include header files that are required by function declaration
@ -14,9 +14,8 @@
/* begin namespace openfpga */ /* begin namespace openfpga */
namespace openfpga { namespace openfpga {
void write_arch_independent_bitstream_to_xml_file(const BitstreamManager& bitstream_manager, void write_xml_architecture_bitstream(const BitstreamManager& bitstream_manager,
const std::string& top_block_name, const std::string& fname);
const std::string& fname);
} /* end namespace openfpga */ } /* end namespace openfpga */

View File

@ -9,7 +9,7 @@
/* Headers from fabric key */ /* Headers from fabric key */
#include "read_xml_arch_bitstream.h" #include "read_xml_arch_bitstream.h"
#include "arch_bitstream_writer.h" #include "write_xml_arch_bitstream.h"
int main(int argc, const char** argv) { int main(int argc, const char** argv) {
/* Ensure we have only one or two argument */ /* Ensure we have only one or two argument */
@ -24,7 +24,7 @@ int main(int argc, const char** argv) {
* This is optional only used when there is a second argument * This is optional only used when there is a second argument
*/ */
if (3 <= argc) { if (3 <= argc) {
openfpga::write_arch_independent_bitstream_to_xml_file(test_bitstream, std::string("fpga_top"), argv[2]); openfpga::write_xml_architecture_bitstream(test_bitstream, argv[2]);
VTR_LOG("Echo the bitstream to an XML file: %s.\n", VTR_LOG("Echo the bitstream to an XML file: %s.\n",
argv[2]); argv[2]);
} }

View File

@ -10,11 +10,10 @@
/* Headers from openfpgautil library */ /* Headers from openfpgautil library */
#include "openfpga_digest.h" #include "openfpga_digest.h"
#include "openfpga_reserved_words.h"
/* Headers from fpgabitstream library */ /* Headers from fpgabitstream library */
#include "read_xml_arch_bitstream.h" #include "read_xml_arch_bitstream.h"
#include "arch_bitstream_writer.h" #include "write_xml_arch_bitstream.h"
#include "build_device_bitstream.h" #include "build_device_bitstream.h"
#include "fabric_bitstream_writer.h" #include "fabric_bitstream_writer.h"
@ -51,9 +50,8 @@ int fpga_bitstream(OpenfpgaContext& openfpga_ctx,
/* Create directories */ /* Create directories */
create_directory(src_dir_path); create_directory(src_dir_path);
write_arch_independent_bitstream_to_xml_file(openfpga_ctx.bitstream_manager(), write_xml_architecture_bitstream(openfpga_ctx.bitstream_manager(),
std::string(FPGA_TOP_MODULE_NAME), cmd_context.option_value(cmd, opt_write_file));
cmd_context.option_value(cmd, opt_write_file));
} }
/* TODO: should identify the error code from internal function execution */ /* TODO: should identify the error code from internal function execution */