From 60e4882d0cd49a7e30125b6dc0161af0e9916528 Mon Sep 17 00:00:00 2001 From: The Coriolis Project Date: Tue, 6 May 2008 13:34:26 +0000 Subject: [PATCH] commit to merge versions --- chamsin/src/analogic/MetaTransistor.cpp | 5 +-- chamsin/src/device/CMakeLists.txt | 10 ++--- chamsin/src/device/Device.h | 4 ++ chamsin/src/device/TrMos.cpp | 52 ++++++++++++------------- chamsin/src/device/TrMos.h | 4 ++ chamsin/src/dtr/DtrAccess.cpp | 5 +-- chamsin/src/technology/ATechnology.cpp | 15 ++++++- chamsin/src/technology/ATechnology.h | 21 +++++++++- 8 files changed, 75 insertions(+), 41 deletions(-) diff --git a/chamsin/src/analogic/MetaTransistor.cpp b/chamsin/src/analogic/MetaTransistor.cpp index c555a9f2..1255c18f 100644 --- a/chamsin/src/analogic/MetaTransistor.cpp +++ b/chamsin/src/analogic/MetaTransistor.cpp @@ -74,9 +74,7 @@ void MetaTransistor::createConnection() } -void MetaTransistor::createLayout() -// ******************************** -{ +void MetaTransistor::createLayout() { if((_le == 0.0) || (_we == 0.0)) { throw Error("Can't generate layout : " + getString(this) + " hasn't been dimensionned"); @@ -105,6 +103,7 @@ void MetaTransistor::createLayout() if(trans->isInternal()) { if(!internal_ref) { + cerr << "akecoucou" << endl; trans->createLayout(); internal_ref = trans; } else { diff --git a/chamsin/src/device/CMakeLists.txt b/chamsin/src/device/CMakeLists.txt index 9497c1a8..9ae18f6b 100644 --- a/chamsin/src/device/CMakeLists.txt +++ b/chamsin/src/device/CMakeLists.txt @@ -1,8 +1,8 @@ INCLUDE_DIRECTORIES(${CHAMSIN_SOURCE_DIR}/src/dtr ${CHAMSIN_SOURCE_DIR}/src/analogic ${HURRICANE_INCLUDE_DIR}) -ADD_LIBRARY(device SHARED Device.cpp TrMos.cpp TrMos_PlaceRoute.cpp) - -TARGET_LINK_LIBRARIES(device analogic dtr hurricane) - -INSTALL(TARGETS device DESTINATION /lib) +#ADD_LIBRARY(device SHARED Device.cpp TrMos.cpp TrMos_PlaceRoute.cpp) +# +#TARGET_LINK_LIBRARIES(device analogic dtr hurricane) +# +#INSTALL(TARGETS device DESTINATION /lib) diff --git a/chamsin/src/device/Device.h b/chamsin/src/device/Device.h index 2744777f..79a47f96 100644 --- a/chamsin/src/device/Device.h +++ b/chamsin/src/device/Device.h @@ -12,6 +12,8 @@ #include "Cell.h" using namespace Hurricane; +namespace DEVICE { + class Device : public Cell { #if !defined(__DOXYGEN_PROCESSOR__) @@ -64,4 +66,6 @@ class Device : public Cell { }; +} + #endif // DEVICE_H diff --git a/chamsin/src/device/TrMos.cpp b/chamsin/src/device/TrMos.cpp index 3ebc72bf..8eb6496c 100644 --- a/chamsin/src/device/TrMos.cpp +++ b/chamsin/src/device/TrMos.cpp @@ -169,9 +169,9 @@ void TrMos::generate(const unsigned m, const bool sourceisfirst, const bool hasr /* (1) */ - IF_DEBUG_HUR_ANALOG + //IF_DEBUG_HUR_ANALOG cout << "*** Stage 1 : CreateLayout of " + getString(this) + " Begin ***" <getName())), finger); } - IF_DEBUG_HUR_ANALOG + //IF_DEBUG_HUR_ANALOG cout << "*** Stage 1 : CreateLayout of " + getString(this) + " finish ***" <getM()) + ".\n" << getString(_m) + " Transistors are created.\n" <createConnection(); - IF_DEBUG_HUR_ANALOG + //IF_DEBUG_HUR_ANALOG cout << "*** Stage 2 : CreateLayout of " + getString(this) + " finish ***" <setWe(11); /* (3) */ - IF_DEBUG_HUR_ANALOG + //IF_DEBUG_HUR_ANALOG cout << "*** Stage 3 : CreateLayout of " + getString(this) + " Begin ***" <::iterator i = _transistorList.begin() , j = _transistorList.end(); - if(_m == 1){ + if(_m == 1) { masqueinfo->setType(Transistor::Type::SINGLE); (*(_transistorList.begin()))->setMaskInfo(masqueinfo); - } - else if(_m%2==0) { // if m is pair, create two left fingers if is source first. + } else if(_m%2==0) { // if m is pair, create two left fingers if is source first. // and create two right fingers if is drain first. while(i!=j) { if(++count>2) @@ -256,8 +255,7 @@ void TrMos::generate(const unsigned m, const bool sourceisfirst, const bool hasr (*i)->setMaskInfo(masqueinfo); i++; } - } - else if(_m%2==1) { // if m is impair, create one left finger, one right finger. + } else if(_m%2==1) { // if m is impair, create one left finger, one right finger. while(i!=j){ ++ count ; if (count == 1) @@ -274,20 +272,20 @@ void TrMos::generate(const unsigned m, const bool sourceisfirst, const bool hasr delete masqueinfo; - IF_DEBUG_HUR_ANALOG + //IF_DEBUG_HUR_ANALOG cout << "*** Stage 3 : CreateLayout of " + getString(this) + " finish ***" <createLayout(); - IF_DEBUG_HUR_ANALOG + //IF_DEBUG_HUR_ANALOG cout << "*** Stage 4 : CreateLayout of " + getString(this) + " finish ***"<unmaterialize(); instance->materialize(); -IF_DEBUG_HUR_ANALOG +//IF_DEBUG_HUR_ANALOG cout << getString(instance) <<" 's boundingBox is " << getString(instance->getBoundingBox())<getLayer(Name(*m)); if(!layer) { - layer = BasicLayer::create(tech, Name(*m), BasicLayer::Type::UNDEFINED, 100); //throw Error("Error : in function DtrAccess::_postCreate , Can't find Layer " // + getString(*m) + " in technology file when parser DtrFile."); -// cerr << Warning("In function DtrAccess::_postCreate , Can't find Layer " -// + getString(*m) + " in technology file when parser DtrFile"); + cerr << "In function DtrAccess::_postCreate , Can't find Layer " + + getString(*m) + " in technology file when parser DtrFile" << endl; } _label2layerMap[(*it_layermap).first].push_back(layer); diff --git a/chamsin/src/technology/ATechnology.cpp b/chamsin/src/technology/ATechnology.cpp index 1f47193c..fb9f04d5 100644 --- a/chamsin/src/technology/ATechnology.cpp +++ b/chamsin/src/technology/ATechnology.cpp @@ -8,9 +8,11 @@ namespace { static Name ATechnologyPropertyName("ATechnologyProperty"); + class ATechnologyProperty : public PrivateProperty { public: typedef PrivateProperty Inherit; + typedef map PhysicalRules; static ATechnologyProperty* create(Technology* technology); ATechnologyProperty(); virtual Name getName() const { @@ -19,11 +21,22 @@ class ATechnologyProperty : public PrivateProperty { virtual string _getTypeName() const { return _TName("ATechnologyProperty"); } + void addPhysicalRule(ATechnology::PhysicalRule& physicalRule) { + PhysicalRules::iterator prit = physicalRules_.find(physicalRule.name_); + if (prit != physicalRules_.end()) { + throw Error(""); + } + ATechnology::PhysicalRule* newPhysicalRule = new ATechnology::PhysicalRule(physicalRule); + physicalRules_[newPhysicalRule->name_] = newPhysicalRule; + } + private: + PhysicalRules physicalRules_; }; ATechnologyProperty::ATechnologyProperty(): - Inherit() + Inherit(), + physicalRules_() {} ATechnologyProperty* ATechnologyProperty::create(Technology* technology) { diff --git a/chamsin/src/technology/ATechnology.h b/chamsin/src/technology/ATechnology.h index c99a0f37..a085fca7 100644 --- a/chamsin/src/technology/ATechnology.h +++ b/chamsin/src/technology/ATechnology.h @@ -2,7 +2,24 @@ #define ATECHNOLOGY_H_ class ATechnology { - + public: + class PhysicalRule { + public: + PhysicalRule(string& name, + double value, + string& reference): + name_(name), + value_(value), + reference_(reference) {} + PhysicalRule(const PhysicalRule& physicalRule): + name_(physicalRule.name_), + value_(physicalRule.value_), + reference_(physicalRule.reference_) {} + const string name_; + const double value_; + const string reference_; + }; + static const PhysicalRule& getPhysicalRule(string name); }; -#endif /* ATECHNOLOGY_H_*/ \ No newline at end of file +#endif /* ATECHNOLOGY_H_*/