From 3ada159bd758e868f0d39c80e57f4c758278b59e Mon Sep 17 00:00:00 2001 From: Christophe Alexandre Date: Mon, 5 May 2008 11:07:14 +0000 Subject: [PATCH] new format for technology technology is now a private property of Hurricane Technology --- chamsin/src/CMakeLists.txt | 3 +- chamsin/src/technology/ATechnology.cpp | 44 +++++++++++++++++++ chamsin/src/technology/ATechnology.h | 8 ++++ chamsin/src/technology/CMakeLists.txt | 8 ++++ .../src/technology/TechnologyXmlParser.cpp | 43 ++++++++++++++++++ chamsin/src/technology/TechnologyXmlParser.h | 15 +++++++ 6 files changed, 120 insertions(+), 1 deletion(-) create mode 100644 chamsin/src/technology/ATechnology.cpp create mode 100644 chamsin/src/technology/ATechnology.h create mode 100644 chamsin/src/technology/CMakeLists.txt create mode 100644 chamsin/src/technology/TechnologyXmlParser.cpp create mode 100644 chamsin/src/technology/TechnologyXmlParser.h diff --git a/chamsin/src/CMakeLists.txt b/chamsin/src/CMakeLists.txt index 77d85dcb..bc1092e4 100644 --- a/chamsin/src/CMakeLists.txt +++ b/chamsin/src/CMakeLists.txt @@ -1,4 +1,5 @@ ADD_SUBDIRECTORY(dtr) +ADD_SUBDIRECTORY(technology) ADD_SUBDIRECTORY(analogic) ADD_SUBDIRECTORY(device) -ADD_SUBDIRECTORY(tests) +ADD_SUBDIRECTORY(tests) \ No newline at end of file diff --git a/chamsin/src/technology/ATechnology.cpp b/chamsin/src/technology/ATechnology.cpp new file mode 100644 index 00000000..1f47193c --- /dev/null +++ b/chamsin/src/technology/ATechnology.cpp @@ -0,0 +1,44 @@ +#include "Technology.h" +#include "Property.h" +using namespace Hurricane; + +#include "ATechnology.h" + +namespace { + +static Name ATechnologyPropertyName("ATechnologyProperty"); + +class ATechnologyProperty : public PrivateProperty { + public: + typedef PrivateProperty Inherit; + static ATechnologyProperty* create(Technology* technology); + ATechnologyProperty(); + virtual Name getName() const { + return ATechnologyPropertyName; + } + virtual string _getTypeName() const { + return _TName("ATechnologyProperty"); + } +}; + + +ATechnologyProperty::ATechnologyProperty(): + Inherit() + {} + +ATechnologyProperty* ATechnologyProperty::create(Technology* technology) { + ATechnologyProperty* prop = new ATechnologyProperty(); + + prop->_postCreate(); + + technology->put(prop); + + return prop; +} + +} + + + + + diff --git a/chamsin/src/technology/ATechnology.h b/chamsin/src/technology/ATechnology.h new file mode 100644 index 00000000..c99a0f37 --- /dev/null +++ b/chamsin/src/technology/ATechnology.h @@ -0,0 +1,8 @@ +#ifndef ATECHNOLOGY_H_ +#define ATECHNOLOGY_H_ + +class ATechnology { + +}; + +#endif /* ATECHNOLOGY_H_*/ \ No newline at end of file diff --git a/chamsin/src/technology/CMakeLists.txt b/chamsin/src/technology/CMakeLists.txt new file mode 100644 index 00000000..4ee31e95 --- /dev/null +++ b/chamsin/src/technology/CMakeLists.txt @@ -0,0 +1,8 @@ +INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${HURRICANE_INCLUDE_DIR}) + +ADD_LIBRARY(atechnology SHARED +ATechnology.cpp TechnologyXmlParser.cpp) + +TARGET_LINK_LIBRARIES(atechnology ${HURRICANE_LIBRARIES} ${LIBXML2_LIBRARIES}) + +INSTALL(TARGETS atechnology DESTINATION /lib) diff --git a/chamsin/src/technology/TechnologyXmlParser.cpp b/chamsin/src/technology/TechnologyXmlParser.cpp new file mode 100644 index 00000000..fa98e006 --- /dev/null +++ b/chamsin/src/technology/TechnologyXmlParser.cpp @@ -0,0 +1,43 @@ +#include +#include + +#include "Technology.h" +using namespace Hurricane; + +#include "TechnologyXmlParser.h" + +namespace { + +ATechnology* parseFileAsTechnology(const char* filePath) { + xmlDocPtr doc; /* the resulting document tree */ + + doc = xmlReadFile(filePath, NULL, 0); + if (doc == NULL) { + fprintf(stderr, "Failed to parse %s\n", filePath); + exit(5); + } + + /*Get the design element node */ + xmlNode* rootElement = xmlDocGetRootElement(doc); + if (rootElement->type == XML_ELEMENT_NODE && xmlStrEqual(rootElement->name, (xmlChar*)"technology")) { + } + +} + +} + +ATechnology* parseTechnologyFromXml(const char* filePath, Technology* technology) { + + LIBXML_TEST_VERSION + + // Cell* rootCell = parseFileAsCell(filePath.c_str()); + + xmlCleanupParser(); + /* + * this is to debug memory for regression tests + */ + + xmlMemoryDump(); + + return NULL; +} diff --git a/chamsin/src/technology/TechnologyXmlParser.h b/chamsin/src/technology/TechnologyXmlParser.h new file mode 100644 index 00000000..d4ad5345 --- /dev/null +++ b/chamsin/src/technology/TechnologyXmlParser.h @@ -0,0 +1,15 @@ +#ifndef TECHNOLOGYXMLPARSER_H_ +#define TECHNOLOGYXMLPARSER_H_ + +namespace Hurricane { + class Technology; +} + +class ATechnology; + +class TechnologyXmlParser { + public: + static ATechnology* parseTechnologyFromXml(const char* filePath, Hurricane::Technology* technology); +}; + +#endif /*TECHNOLOGYXMLPARSER_H_*/