rename circuit settings to openfpga arch and update sample architecture
This commit is contained in:
parent
264dc8458d
commit
e282f813bc
|
@ -7,7 +7,7 @@
|
|||
3. circuit models, where we define circuit-level details for
|
||||
each primitives in FPGA architecture
|
||||
-->
|
||||
<circuit_settings>
|
||||
<openfpga_architecture>
|
||||
<simulation_parameters>
|
||||
<options sim_temp="25" post="off" captab="off" fast="on"/>
|
||||
<monte_carlo mc_sim="off" num_mc_points="2" cmos_variation="off" rram_variation="off">
|
||||
|
@ -257,4 +257,4 @@
|
|||
<port type="output" prefix="sumout" size="1"/>
|
||||
</circuit_model>
|
||||
</circuit_library>
|
||||
</circuit_settings>
|
||||
</openfpga_architecture>
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef READ_XML_CIRCUIT_SETTINGS_H
|
||||
#define READ_XML_CIRCUIT_SETTINGS_H
|
||||
|
||||
#include <string>
|
||||
#include "circuit_settings.h"
|
||||
|
||||
CircuitSettings read_xml_circuit_settings(const char* arch_file_name);
|
||||
|
||||
#endif
|
|
@ -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 <circuit_settings> */
|
||||
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 <module_circuit_models>
|
||||
*/
|
||||
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;
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef READ_XML_OPENFPGA_ARCH_H
|
||||
#define READ_XML_OPENFPGA_ARCH_H
|
||||
|
||||
#include <string>
|
||||
#include "openfpga_arch.h"
|
||||
|
||||
OpenFPGAArch read_xml_openfpga_arch(const char* arch_file_name);
|
||||
|
||||
#endif
|
|
@ -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 */
|
||||
|
||||
|
|
Loading…
Reference in New Issue