From e282f813bc5701d0b53cf2425c90cf93da6f8801 Mon Sep 17 00:00:00 2001 From: tangxifan Date: Wed, 15 Jan 2020 20:28:04 -0700 Subject: [PATCH] rename circuit settings to openfpga arch and update sample architecture --- libopenfpga/libarchopenfpga/arch/sample_arch.xml | 4 ++-- .../src/{circuit_settings.h => openfpga_arch.h} | 6 +++--- .../libarchopenfpga/src/read_xml_circuit_settings.h | 9 --------- ...rcuit_settings.cpp => read_xml_openfpga_arch.cpp} | 12 ++++++------ .../libarchopenfpga/src/read_xml_openfpga_arch.h | 9 +++++++++ libopenfpga/libarchopenfpga/test/main.cpp | 6 +++--- 6 files changed, 23 insertions(+), 23 deletions(-) rename libopenfpga/libarchopenfpga/src/{circuit_settings.h => openfpga_arch.h} (72%) delete mode 100644 libopenfpga/libarchopenfpga/src/read_xml_circuit_settings.h rename libopenfpga/libarchopenfpga/src/{read_xml_circuit_settings.cpp => read_xml_openfpga_arch.cpp} (78%) create mode 100644 libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.h diff --git a/libopenfpga/libarchopenfpga/arch/sample_arch.xml b/libopenfpga/libarchopenfpga/arch/sample_arch.xml index c5a7014e3..42367c98a 100644 --- a/libopenfpga/libarchopenfpga/arch/sample_arch.xml +++ b/libopenfpga/libarchopenfpga/arch/sample_arch.xml @@ -7,7 +7,7 @@ 3. circuit models, where we define circuit-level details for each primitives in FPGA architecture --> - + @@ -257,4 +257,4 @@ - + diff --git a/libopenfpga/libarchopenfpga/src/circuit_settings.h b/libopenfpga/libarchopenfpga/src/openfpga_arch.h similarity index 72% rename from libopenfpga/libarchopenfpga/src/circuit_settings.h rename to libopenfpga/libarchopenfpga/src/openfpga_arch.h index db1f84f16..9ce746fb0 100644 --- a/libopenfpga/libarchopenfpga/src/circuit_settings.h +++ b/libopenfpga/libarchopenfpga/src/openfpga_arch.h @@ -1,12 +1,12 @@ -#ifndef CIRCUIT_SETTINGS_H -#define CIRCUIT_SETTINGS_H +#ifndef OPENFPGA_ARCH_H +#define OPENFPGA_ARCH_H #include "circuit_library.h" /* A unified data structure to store circuit-level settings, * including circuit library, technology library and simulation parameters */ -struct CircuitSettings { +struct OpenFPGAArch { CircuitLibrary circuit_lib; }; diff --git a/libopenfpga/libarchopenfpga/src/read_xml_circuit_settings.h b/libopenfpga/libarchopenfpga/src/read_xml_circuit_settings.h deleted file mode 100644 index 423e4ede2..000000000 --- a/libopenfpga/libarchopenfpga/src/read_xml_circuit_settings.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef READ_XML_CIRCUIT_SETTINGS_H -#define READ_XML_CIRCUIT_SETTINGS_H - -#include -#include "circuit_settings.h" - -CircuitSettings read_xml_circuit_settings(const char* arch_file_name); - -#endif diff --git a/libopenfpga/libarchopenfpga/src/read_xml_circuit_settings.cpp b/libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.cpp similarity index 78% rename from libopenfpga/libarchopenfpga/src/read_xml_circuit_settings.cpp rename to libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.cpp index b3aab5ae0..20f701028 100644 --- a/libopenfpga/libarchopenfpga/src/read_xml_circuit_settings.cpp +++ b/libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.cpp @@ -14,14 +14,14 @@ #include "read_xml_util.h" #include "read_xml_circuit_library.h" -#include "read_xml_circuit_settings.h" +#include "read_xml_openfpga_arch.h" /******************************************************************** * Top-level function to parse an XML file and load data to : * 1. circuit library *******************************************************************/ -CircuitSettings read_xml_circuit_settings(const char* arch_file_name) { - CircuitSettings circuit_settings; +OpenFPGAArch read_xml_openfpga_arch(const char* arch_file_name) { + OpenFPGAArch openfpga_arch; pugi::xml_node Next; @@ -33,18 +33,18 @@ CircuitSettings read_xml_circuit_settings(const char* arch_file_name) { loc_data = pugiutil::load_xml(doc, arch_file_name); /* Root node should be */ - auto xml_circuit_settings = get_single_child(doc, "circuit_settings", loc_data); + auto xml_circuit_settings = get_single_child(doc, "openfpga_architecture", loc_data); /* Parse circuit_models to circuit library * under the node */ auto xml_circuit_models = get_single_child(xml_circuit_settings, "circuit_library", loc_data); - circuit_settings.circuit_lib = read_xml_circuit_library(xml_circuit_models, loc_data); + openfpga_arch.circuit_lib = read_xml_circuit_library(xml_circuit_models, loc_data); } catch (pugiutil::XmlError& e) { archfpga_throw(arch_file_name, e.line(), "%s", e.what()); } - return circuit_settings; + return openfpga_arch; } diff --git a/libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.h b/libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.h new file mode 100644 index 000000000..c539d83ca --- /dev/null +++ b/libopenfpga/libarchopenfpga/src/read_xml_openfpga_arch.h @@ -0,0 +1,9 @@ +#ifndef READ_XML_OPENFPGA_ARCH_H +#define READ_XML_OPENFPGA_ARCH_H + +#include +#include "openfpga_arch.h" + +OpenFPGAArch read_xml_openfpga_arch(const char* arch_file_name); + +#endif diff --git a/libopenfpga/libarchopenfpga/test/main.cpp b/libopenfpga/libarchopenfpga/test/main.cpp index 2e54fafef..7e24167e8 100644 --- a/libopenfpga/libarchopenfpga/test/main.cpp +++ b/libopenfpga/libarchopenfpga/test/main.cpp @@ -5,13 +5,13 @@ *******************************************************************/ #include "vtr_log.h" -#include "read_xml_circuit_settings.h" +#include "read_xml_openfpga_arch.h" int main(int argc, const char** argv) { /* Parse the circuit library from an XML file */ - const CircuitSettings& circuit_settings = read_xml_circuit_settings(argv[1]); + const OpenFPGAArch& openfpga_arch = read_xml_openfpga_arch(argv[1]); VTR_LOG("Parsed %lu circuit models from XML into circuit library.\n", - circuit_settings.circuit_lib.num_models()); + openfpga_arch.circuit_lib.num_models()); /* Check the circuit library */