move OpenFPGAArch to openfpga namespace

This commit is contained in:
tangxifan 2020-01-16 20:22:56 -07:00
parent d6adfa0821
commit f7a7c56366
6 changed files with 12 additions and 7 deletions

View File

@ -3,11 +3,16 @@
#include "circuit_library.h" #include "circuit_library.h"
/* namespace openfpga begins */
namespace openfpga {
/* A unified data structure to store circuit-level settings, /* A unified data structure to store circuit-level settings,
* including circuit library, technology library and simulation parameters * including circuit library, technology library and simulation parameters
*/ */
struct OpenFPGAArch { struct Arch {
CircuitLibrary circuit_lib; CircuitLibrary circuit_lib;
}; };
} /* namespace openfpga ends */
#endif #endif

View File

@ -20,8 +20,8 @@
* Top-level function to parse an XML file and load data to : * Top-level function to parse an XML file and load data to :
* 1. circuit library * 1. circuit library
*******************************************************************/ *******************************************************************/
OpenFPGAArch read_xml_openfpga_arch(const char* arch_file_name) { openfpga::Arch read_xml_openfpga_arch(const char* arch_file_name) {
OpenFPGAArch openfpga_arch; openfpga::Arch openfpga_arch;
pugi::xml_node Next; pugi::xml_node Next;

View File

@ -10,6 +10,6 @@
/******************************************************************** /********************************************************************
* Function declaration * Function declaration
*******************************************************************/ *******************************************************************/
OpenFPGAArch read_xml_openfpga_arch(const char* arch_file_name); openfpga::Arch read_xml_openfpga_arch(const char* arch_file_name);
#endif #endif

View File

@ -15,7 +15,7 @@
* A writer to output an OpenFPGAArch to XML format * A writer to output an OpenFPGAArch to XML format
*******************************************************************/ *******************************************************************/
void write_xml_openfpga_arch(const char* fname, void write_xml_openfpga_arch(const char* fname,
const OpenFPGAArch& openfpga_arch) { const openfpga::Arch& openfpga_arch) {
/* Create a file handler */ /* Create a file handler */
std::fstream fp; std::fstream fp;
/* Open the file stream */ /* Open the file stream */

View File

@ -11,6 +11,6 @@
* Function declaration * Function declaration
*******************************************************************/ *******************************************************************/
void write_xml_openfpga_arch(const char* xml_fname, void write_xml_openfpga_arch(const char* xml_fname,
const OpenFPGAArch& openfpga_arch); const openfpga::Arch& openfpga_arch);
#endif #endif

View File

@ -16,7 +16,7 @@ int main(int argc, const char** argv) {
VTR_ASSERT((2 == argc) || (3 == argc)); VTR_ASSERT((2 == argc) || (3 == argc));
/* Parse the circuit library from an XML file */ /* 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", VTR_LOG("Parsed %lu circuit models from XML into circuit library.\n",
openfpga_arch.circuit_lib.num_models()); openfpga_arch.circuit_lib.num_models());