Technology in progress
This commit is contained in:
parent
de62ff741d
commit
ecef0bb749
|
@ -1,14 +1,15 @@
|
||||||
PROJECT(CHAMSIN)
|
project(CHAMSIN)
|
||||||
|
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.0)
|
cmake_minimum_required(VERSION 2.4.0)
|
||||||
|
|
||||||
SET(CMAKE_MODULE_PATH "$ENV{HURRICANE_TOP}/share/cmake_modules/"
|
set(CMAKE_MODULE_PATH "$ENV{HURRICANE_TOP}/share/cmake_modules/"
|
||||||
"$ENV{HURRICANE_TOP}/share/cmake_modules/")
|
"$ENV{HURRICANE_TOP}/share/cmake_modules/")
|
||||||
|
|
||||||
FIND_PACKAGE(BISON REQUIRED)
|
find_package(BISON REQUIRED)
|
||||||
FIND_PACKAGE(FLEX REQUIRED)
|
find_package(FLEX REQUIRED)
|
||||||
FIND_PACKAGE(HURRICANE REQUIRED)
|
find_package(HURRICANE REQUIRED)
|
||||||
FIND_PACKAGE(CORIOLIS REQUIRED)
|
find_package(CORIOLIS REQUIRED)
|
||||||
FIND_PACKAGE(LibXml2 REQUIRED)
|
find_package(Qt4 REQUIRED) # find and setup Qt4 for this project
|
||||||
|
find_package(LibXml2 REQUIRED)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(src)
|
add_subdirectory(src)
|
||||||
|
|
|
@ -19,7 +19,11 @@ Transistor::Transistor(Library* library, const Name& name, const Polarity& polar
|
||||||
_polarity(polarity),
|
_polarity(polarity),
|
||||||
_abutmentType(),
|
_abutmentType(),
|
||||||
_l(0.0),
|
_l(0.0),
|
||||||
_w(0.0)
|
_w(0.0),
|
||||||
|
_source20(NULL),
|
||||||
|
_source22(NULL),
|
||||||
|
_drain40(NULL),
|
||||||
|
_drain42(NULL)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,6 +45,10 @@ void Transistor::_postCreate() {
|
||||||
_grid->setExternal(true);
|
_grid->setExternal(true);
|
||||||
_bulk = Net::create(this, BulkName);
|
_bulk = Net::create(this, BulkName);
|
||||||
_bulk->setExternal(true);
|
_bulk->setExternal(true);
|
||||||
|
//_source20 = Contact::create(_source);
|
||||||
|
//_source22 = Contact::create(_source);
|
||||||
|
//_drain40 = Contact::create(_drain);
|
||||||
|
//_drain42 = Contact::create(_drain);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Transistor::createLayout() {
|
void Transistor::createLayout() {
|
||||||
|
|
|
@ -37,6 +37,10 @@ class Transistor : public Cell {
|
||||||
AbutmentType _abutmentType;
|
AbutmentType _abutmentType;
|
||||||
double _l;
|
double _l;
|
||||||
double _w;
|
double _w;
|
||||||
|
Contact* _source20;
|
||||||
|
Contact* _source22;
|
||||||
|
Contact* _drain40;
|
||||||
|
Contact* _drain42;
|
||||||
|
|
||||||
Transistor(Library* library, const Name& name, const Polarity& polarity);
|
Transistor(Library* library, const Name& name, const Polarity& polarity);
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,20 +3,27 @@
|
||||||
#include "Technology.h"
|
#include "Technology.h"
|
||||||
using namespace Hurricane;
|
using namespace Hurricane;
|
||||||
|
|
||||||
|
#include "crlcore/GraphicsParser.h"
|
||||||
|
#include "crlcore/TechnologyParser.h"
|
||||||
|
using namespace CRL;
|
||||||
|
|
||||||
#include "ATechnology.h"
|
#include "ATechnology.h"
|
||||||
#include "ATechnologyXmlParser.h"
|
#include "ATechnologyXmlParser.h"
|
||||||
|
|
||||||
#include "AEnv.h"
|
#include "AEnv.h"
|
||||||
|
|
||||||
void AEnv::create(const char* technoFilePath) {
|
void AEnv::create(const char* technoFilePath, const char* graphicFilePath, const char* analogTechnoFilePath) {
|
||||||
DataBase* db = getDataBase();
|
DataBase* db = getDataBase();
|
||||||
if (db) {
|
if (db) {
|
||||||
throw Error("");
|
throw Error("");
|
||||||
}
|
}
|
||||||
db = DataBase::create();
|
db = DataBase::create();
|
||||||
|
TechnologyParser::load(db, technoFilePath);
|
||||||
|
GraphicsParser::load(graphicFilePath);
|
||||||
|
|
||||||
Library* rootLibrary = Library::create(db, Name("RootLibrary"));
|
Library* rootLibrary = Library::create(db, Name("RootLibrary"));
|
||||||
Technology* techno = Technology::create(db, Name("AnalogicTechnology"));
|
Technology* techno = db->getTechnology();
|
||||||
ATechnologyXmlParser::parse(technoFilePath, techno);
|
ATechnologyXmlParser::parse(analogTechnoFilePath, techno);
|
||||||
}
|
}
|
||||||
|
|
||||||
ATechnology* AEnv::getATechnology() {
|
ATechnology* AEnv::getATechnology() {
|
||||||
|
|
|
@ -5,7 +5,7 @@ class ATechnology;
|
||||||
|
|
||||||
class AEnv {
|
class AEnv {
|
||||||
public:
|
public:
|
||||||
static void create(const char* technoFilePath);
|
static void create(const char* technoFilePath, const char* graphicFilePath, const char* analogTechnoFilePath);
|
||||||
static ATechnology* getATechnology();
|
static ATechnology* getATechnology();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
#include "Technology.h"
|
#include "Technology.h"
|
||||||
#include "Property.h"
|
|
||||||
using namespace Hurricane;
|
using namespace Hurricane;
|
||||||
|
|
||||||
#include "ATechnology.h"
|
#include "ATechnology.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
static Name ATechnologyPropertyName("ATechnologyProperty");
|
static Name ATechnologyPropertyName("ATechnologyProperty");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Name ATechnology::getName() const {
|
Name ATechnology::getName() const {
|
||||||
|
@ -16,13 +16,37 @@ string ATechnology::_getTypeName() const {
|
||||||
return _TName("ATechnologyProperty");
|
return _TName("ATechnologyProperty");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ATechnology::addPhysicalRule(const string& name, double value, const string& reference) {
|
void ATechnology::addPhysicalRule(const Name& name, double value, const string& reference) {
|
||||||
PhysicalRules::iterator prit = _physicalRules.find(name);
|
PhysicalRules::iterator prit = _noLayerPhysicalRules.find(name);
|
||||||
if (prit != _physicalRules.end()) {
|
if (prit != _noLayerPhysicalRules.end()) {
|
||||||
throw Error("");
|
throw Error("");
|
||||||
}
|
}
|
||||||
PhysicalRule* newPhysicalRule = new PhysicalRule(name, value, reference);
|
PhysicalRule* newPhysicalRule = new PhysicalRule(name, value, reference);
|
||||||
_physicalRules[newPhysicalRule->_name] = newPhysicalRule;
|
_noLayerPhysicalRules[newPhysicalRule->_name] = newPhysicalRule;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ATechnology::addPhysicalRule(const Name& name, const Name& layerName, double value, const string& reference) {
|
||||||
|
Layer* layer = getLayer(layerName);
|
||||||
|
OneLayerPhysicalRules::iterator olprit = _oneLayerPhysicalRules.find(layer);
|
||||||
|
if (olprit == _oneLayerPhysicalRules.end()) {
|
||||||
|
pair<OneLayerPhysicalRules::iterator, bool> result =
|
||||||
|
_oneLayerPhysicalRules.insert(make_pair(layer, PhysicalRules()));
|
||||||
|
assert(result.second);
|
||||||
|
olprit = result.first;
|
||||||
|
PhysicalRule* newPhysicalRule = new PhysicalRule(name, value, reference);
|
||||||
|
olprit->second[name] = newPhysicalRule;
|
||||||
|
} else {
|
||||||
|
PhysicalRules& physicalRules = olprit->second;
|
||||||
|
if (physicalRules.find(name) != physicalRules.end()) {
|
||||||
|
throw Error("duplicate rule");
|
||||||
|
}
|
||||||
|
PhysicalRule* newPhysicalRule = new PhysicalRule(name, value, reference);
|
||||||
|
physicalRules[name] = newPhysicalRule;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ATechnology::addPhysicalRule(const Name& name, const Name& layer1Name,
|
||||||
|
const Name& layer2Name, double value, const string& reference) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ATechnology* ATechnology::create(Technology* technology) {
|
ATechnology* ATechnology::create(Technology* technology) {
|
||||||
|
@ -46,9 +70,9 @@ ATechnology* ATechnology::getATechnology(Technology* technology) {
|
||||||
|
|
||||||
void ATechnology::print() {
|
void ATechnology::print() {
|
||||||
cout << "Printing ATechnology" << endl;
|
cout << "Printing ATechnology" << endl;
|
||||||
cout << " o Physical Rules" << endl;
|
cout << " o No Layer Physical Rules" << endl;
|
||||||
for (PhysicalRules::iterator prit = _physicalRules.begin();
|
for (PhysicalRules::iterator prit = _noLayerPhysicalRules.begin();
|
||||||
prit != _physicalRules.end();
|
prit != _noLayerPhysicalRules.end();
|
||||||
prit++) {
|
prit++) {
|
||||||
PhysicalRule* physicalRule = prit->second;
|
PhysicalRule* physicalRule = prit->second;
|
||||||
cout << " - name = " << physicalRule->_name <<
|
cout << " - name = " << physicalRule->_name <<
|
||||||
|
@ -57,10 +81,19 @@ void ATechnology::print() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const ATechnology::PhysicalRule* ATechnology::getPhysicalRule(const string& name) {
|
const ATechnology::PhysicalRule* ATechnology::getPhysicalRule(const Name& name) {
|
||||||
PhysicalRules::iterator prit = _physicalRules.find(name);
|
PhysicalRules::iterator prit = _noLayerPhysicalRules.find(name);
|
||||||
if (prit == _physicalRules.end()) {
|
if (prit == _noLayerPhysicalRules.end()) {
|
||||||
throw Error("Cannot find Physical Rule " + name);
|
throw Error("Cannot find Physical Rule " + getString(name));
|
||||||
}
|
}
|
||||||
return prit->second;
|
return prit->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Layer* ATechnology::getLayer(const Name& layerName) {
|
||||||
|
Technology* technology = static_cast<Technology*>(getOwner());
|
||||||
|
Layer* layer = technology->getLayer(layerName);
|
||||||
|
if (!layer) {
|
||||||
|
throw Error("cannot find layer");
|
||||||
|
}
|
||||||
|
return layer;
|
||||||
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ using namespace Hurricane;
|
||||||
|
|
||||||
namespace Hurricane {
|
namespace Hurricane {
|
||||||
class Technology;
|
class Technology;
|
||||||
|
class Layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
class ATechnology : public PrivateProperty {
|
class ATechnology : public PrivateProperty {
|
||||||
|
@ -14,7 +15,7 @@ class ATechnology : public PrivateProperty {
|
||||||
|
|
||||||
class PhysicalRule {
|
class PhysicalRule {
|
||||||
public:
|
public:
|
||||||
PhysicalRule(const string& name,
|
PhysicalRule(const Name& name,
|
||||||
double value,
|
double value,
|
||||||
const string& reference):
|
const string& reference):
|
||||||
_name(name),
|
_name(name),
|
||||||
|
@ -24,16 +25,23 @@ class ATechnology : public PrivateProperty {
|
||||||
_name(physicalRule._name),
|
_name(physicalRule._name),
|
||||||
_value(physicalRule._value),
|
_value(physicalRule._value),
|
||||||
_reference(physicalRule._reference) {}
|
_reference(physicalRule._reference) {}
|
||||||
const string _name;
|
const Name _name;
|
||||||
const double _value;
|
const double _value;
|
||||||
const string _reference;
|
const string _reference;
|
||||||
double getValue() const { return _value; }
|
double getValue() const { return _value; }
|
||||||
};
|
};
|
||||||
typedef map<string, ATechnology::PhysicalRule*> PhysicalRules;
|
typedef map<Name, ATechnology::PhysicalRule*> PhysicalRules;
|
||||||
|
typedef map<Layer*, PhysicalRules> OneLayerPhysicalRules;
|
||||||
|
typedef pair<Layer*, Layer*> LayerPair;
|
||||||
|
typedef map<LayerPair, PhysicalRules> TwoLayersPhysicalRules;
|
||||||
static ATechnology* create(Hurricane::Technology* technology);
|
static ATechnology* create(Hurricane::Technology* technology);
|
||||||
static ATechnology* getATechnology(Hurricane::Technology* technology);
|
static ATechnology* getATechnology(Hurricane::Technology* technology);
|
||||||
const PhysicalRule* getPhysicalRule(const string& name);
|
const PhysicalRule* getPhysicalRule(const Name& name);
|
||||||
void addPhysicalRule(const string& name, double value, const string& reference);
|
void addPhysicalRule(const Name& name, double value, const string& reference);
|
||||||
|
void addPhysicalRule(const Name& name, const Name& layerName, double value, const string& reference);
|
||||||
|
void addPhysicalRule(const Name& name, const Name& layer1Name,
|
||||||
|
const Name& layer2Name, double value, const string& reference);
|
||||||
|
Layer* getLayer(const Name& layerName);
|
||||||
void print();
|
void print();
|
||||||
|
|
||||||
virtual Name getName() const;
|
virtual Name getName() const;
|
||||||
|
@ -42,10 +50,14 @@ class ATechnology : public PrivateProperty {
|
||||||
|
|
||||||
ATechnology():
|
ATechnology():
|
||||||
Inherit(),
|
Inherit(),
|
||||||
_physicalRules() {}
|
_noLayerPhysicalRules(),
|
||||||
|
_oneLayerPhysicalRules(),
|
||||||
|
_twoLayersPhysicalRules() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PhysicalRules _physicalRules;
|
PhysicalRules _noLayerPhysicalRules;
|
||||||
|
OneLayerPhysicalRules _oneLayerPhysicalRules;
|
||||||
|
TwoLayersPhysicalRules _twoLayersPhysicalRules;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* ATECHNOLOGY_H_*/
|
#endif /* ATECHNOLOGY_H_*/
|
||||||
|
|
|
@ -11,6 +11,10 @@ using namespace Hurricane;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
void syntaxError(const string& reason) {
|
||||||
|
throw Error(reason);
|
||||||
|
}
|
||||||
|
|
||||||
void readPhysicalRules(xmlNode* node, ATechnology* aTechnology) {
|
void readPhysicalRules(xmlNode* node, ATechnology* aTechnology) {
|
||||||
if (node->type == XML_ELEMENT_NODE && node->children) {
|
if (node->type == XML_ELEMENT_NODE && node->children) {
|
||||||
for (xmlNode* ruleNode = node->children;
|
for (xmlNode* ruleNode = node->children;
|
||||||
|
@ -21,12 +25,26 @@ void readPhysicalRules(xmlNode* node, ATechnology* aTechnology) {
|
||||||
xmlChar* ruleNameC = xmlGetProp(ruleNode, (xmlChar*)"name");
|
xmlChar* ruleNameC = xmlGetProp(ruleNode, (xmlChar*)"name");
|
||||||
xmlChar* valueC = xmlGetProp(ruleNode, (xmlChar*)"value");
|
xmlChar* valueC = xmlGetProp(ruleNode, (xmlChar*)"value");
|
||||||
xmlChar* refC = xmlGetProp(ruleNode, (xmlChar*)"ref");
|
xmlChar* refC = xmlGetProp(ruleNode, (xmlChar*)"ref");
|
||||||
|
xmlChar* layerC = xmlGetProp(ruleNode, (xmlChar*)"layer");
|
||||||
|
xmlChar* layer1C = xmlGetProp(ruleNode, (xmlChar*)"layer1");
|
||||||
|
xmlChar* layer2C = xmlGetProp(ruleNode, (xmlChar*)"layer2");
|
||||||
if (ruleNameC && valueC && refC) {
|
if (ruleNameC && valueC && refC) {
|
||||||
string ruleName((const char*)ruleNameC);
|
string ruleName((const char*)ruleNameC);
|
||||||
double value = atof((const char*)valueC);
|
double value = atof((const char*)valueC);
|
||||||
string reference((const char*)refC);
|
string reference((const char*)refC);
|
||||||
|
if (layerC) {
|
||||||
|
Name layerName((const char*)layerC);
|
||||||
|
aTechnology->addPhysicalRule(ruleName, layerName, value, reference);
|
||||||
|
} else if (layer1C && layer2C) {
|
||||||
|
Name layer1Name((const char*)layer1C);
|
||||||
|
Name layer2Name((const char*)layer2C);
|
||||||
|
aTechnology->addPhysicalRule(ruleName, layer1Name, layer2Name, value, reference);
|
||||||
|
} else {
|
||||||
aTechnology->addPhysicalRule(ruleName, value, reference);
|
aTechnology->addPhysicalRule(ruleName, value, reference);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
syntaxError("");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${HURRICANE_INCLUDE_DIR})
|
INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR} ${HURRICANE_INCLUDE_DIR} ${CORIOLIS_INCLUDE_DIR})
|
||||||
|
|
||||||
ADD_LIBRARY(atechnology SHARED
|
ADD_LIBRARY(atechnology SHARED
|
||||||
AEnv.cpp ATechnology.cpp ATechnologyXmlParser.cpp)
|
AEnv.cpp ATechnology.cpp ATechnologyXmlParser.cpp)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(atechnology ${HURRICANE_LIBRARIES} ${LIBXML2_LIBRARIES})
|
TARGET_LINK_LIBRARIES(atechnology ${HURRICANE_LIBRARIES} ${CORIOLIS_LIBRARIES} ${LIBXML2_LIBRARIES})
|
||||||
|
|
||||||
INSTALL(TARGETS atechnology DESTINATION /lib)
|
INSTALL(TARGETS atechnology DESTINATION /lib)
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
|
||||||
#include "Warning.h"
|
#include "Warning.h"
|
||||||
#include "Error.h"
|
#include "Error.h"
|
||||||
#include "DataBase.h"
|
#include "DataBase.h"
|
||||||
|
@ -13,12 +15,15 @@ using namespace Hurricane;
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
QApplication* qa = new QApplication(argc, argv);
|
||||||
|
|
||||||
cout << "simple analogic test" << endl;
|
cout << "simple analogic test" << endl;
|
||||||
if (argc != 2) {
|
if (argc != 4) {
|
||||||
cerr << "atest techno.xml";
|
cerr << "atest techno.xml graphic.xml anatechno.xml";
|
||||||
exit(56);
|
exit(56);
|
||||||
}
|
}
|
||||||
AEnv::create(argv[1]);
|
AEnv::create(argv[1], argv[2], argv[3]);
|
||||||
DataBase* db = getDataBase();
|
DataBase* db = getDataBase();
|
||||||
Library* rootLibrary = db->getRootLibrary();
|
Library* rootLibrary = db->getRootLibrary();
|
||||||
Library* userLibrary = Library::create(rootLibrary, Name("USER"));
|
Library* userLibrary = Library::create(rootLibrary, Name("USER"));
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
INCLUDE_DIRECTORIES(${HURRICANE_INCLUDE_DIR} ${CORIOLIS_INCLUDE_DIR}
|
include(${QT_USE_FILE})
|
||||||
|
|
||||||
|
include_directories(${HURRICANE_INCLUDE_DIR} ${CORIOLIS_INCLUDE_DIR}
|
||||||
${CHAMSIN_SOURCE_DIR}/src/technology
|
${CHAMSIN_SOURCE_DIR}/src/technology
|
||||||
${CHAMSIN_SOURCE_DIR}/src/analogic ${CHAMSIN_SOURCE_DIR}/src/device)
|
${CHAMSIN_SOURCE_DIR}/src/analogic ${CHAMSIN_SOURCE_DIR}/src/device)
|
||||||
|
|
||||||
ADD_EXECUTABLE(atest AnalogicTest.cpp)
|
add_executable(atest AnalogicTest.cpp)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(atest atechnology analogic ${HURRICANE_LIBRARIES})
|
target_link_libraries(atest atechnology analogic ${HURRICANE_LIBRARIES} ${QT_LIBRARIES})
|
||||||
|
|
||||||
INSTALL(TARGETS atest DESTINATION /bin)
|
install(TARGETS atest DESTINATION /bin)
|
||||||
|
|
Loading…
Reference in New Issue