From f7a7c5636618500171d078a60839b428a89619ea Mon Sep 17 00:00:00 2001 From: tangxifan Date: Thu, 16 Jan 2020 20:22:56 -0700 Subject: [PATCH] move OpenFPGAArch to openfpga namespace --- libopenfpga/libarchopenfpga/src/openfpga_arch.h | 7 ++++++- libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.cpp | 4 ++-- libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.h | 2 +- .../libarchopenfpga/src/write_xml_openfpga_arch.cpp | 2 +- libopenfpga/libarchopenfpga/src/write_xml_openfpga_arch.h | 2 +- libopenfpga/libarchopenfpga/test/main.cpp | 2 +- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/libopenfpga/libarchopenfpga/src/openfpga_arch.h b/libopenfpga/libarchopenfpga/src/openfpga_arch.h index 9ce746fb0..f33260218 100644 --- a/libopenfpga/libarchopenfpga/src/openfpga_arch.h +++ b/libopenfpga/libarchopenfpga/src/openfpga_arch.h @@ -3,11 +3,16 @@ #include "circuit_library.h" +/* namespace openfpga begins */ +namespace openfpga { + /* A unified data structure to store circuit-level settings, * including circuit library, technology library and simulation parameters */ -struct OpenFPGAArch { +struct Arch { CircuitLibrary circuit_lib; }; +} /* namespace openfpga ends */ + #endif diff --git a/libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.cpp b/libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.cpp index 236dac68c..fdaa73506 100644 --- a/libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.cpp +++ b/libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.cpp @@ -20,8 +20,8 @@ * Top-level function to parse an XML file and load data to : * 1. circuit library *******************************************************************/ -OpenFPGAArch read_xml_openfpga_arch(const char* arch_file_name) { - OpenFPGAArch openfpga_arch; +openfpga::Arch read_xml_openfpga_arch(const char* arch_file_name) { + openfpga::Arch openfpga_arch; pugi::xml_node Next; diff --git a/libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.h b/libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.h index 0e85ddc92..e23018c8f 100644 --- a/libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.h +++ b/libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.h @@ -10,6 +10,6 @@ /******************************************************************** * Function declaration *******************************************************************/ -OpenFPGAArch read_xml_openfpga_arch(const char* arch_file_name); +openfpga::Arch read_xml_openfpga_arch(const char* arch_file_name); #endif diff --git a/libopenfpga/libarchopenfpga/src/write_xml_openfpga_arch.cpp b/libopenfpga/libarchopenfpga/src/write_xml_openfpga_arch.cpp index c226eaa98..84bc681ef 100644 --- a/libopenfpga/libarchopenfpga/src/write_xml_openfpga_arch.cpp +++ b/libopenfpga/libarchopenfpga/src/write_xml_openfpga_arch.cpp @@ -15,7 +15,7 @@ * A writer to output an OpenFPGAArch to XML format *******************************************************************/ void write_xml_openfpga_arch(const char* fname, - const OpenFPGAArch& openfpga_arch) { + const openfpga::Arch& openfpga_arch) { /* Create a file handler */ std::fstream fp; /* Open the file stream */ diff --git a/libopenfpga/libarchopenfpga/src/write_xml_openfpga_arch.h b/libopenfpga/libarchopenfpga/src/write_xml_openfpga_arch.h index bd6eb6721..790d483f4 100644 --- a/libopenfpga/libarchopenfpga/src/write_xml_openfpga_arch.h +++ b/libopenfpga/libarchopenfpga/src/write_xml_openfpga_arch.h @@ -11,6 +11,6 @@ * Function declaration *******************************************************************/ void write_xml_openfpga_arch(const char* xml_fname, - const OpenFPGAArch& openfpga_arch); + const openfpga::Arch& openfpga_arch); #endif diff --git a/libopenfpga/libarchopenfpga/test/main.cpp b/libopenfpga/libarchopenfpga/test/main.cpp index 4280f84e4..2fdda7254 100644 --- a/libopenfpga/libarchopenfpga/test/main.cpp +++ b/libopenfpga/libarchopenfpga/test/main.cpp @@ -16,7 +16,7 @@ int main(int argc, const char** argv) { VTR_ASSERT((2 == argc) || (3 == argc)); /* Parse the circuit library from an XML file */ - const OpenFPGAArch& openfpga_arch = read_xml_openfpga_arch(argv[1]); + const openfpga::Arch& openfpga_arch = read_xml_openfpga_arch(argv[1]); VTR_LOG("Parsed %lu circuit models from XML into circuit library.\n", openfpga_arch.circuit_lib.num_models());