From 279ff2a2aabceea3696a7f017876a9762e5cc3cb Mon Sep 17 00:00:00 2001 From: The Coriolis Project Date: Tue, 10 Jun 2008 17:19:46 +0000 Subject: [PATCH] Technology with three types of rules : no layer, one layer, two layers Transistor layout --- chamsin/src/analogic/Transistor.cpp | 2 +- chamsin/src/technology/ATechnology.cpp | 22 +++++++++++++--------- chamsin/src/technology/ATechnology.h | 12 ++++++------ 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/chamsin/src/analogic/Transistor.cpp b/chamsin/src/analogic/Transistor.cpp index 8db0dcde..894088dd 100644 --- a/chamsin/src/analogic/Transistor.cpp +++ b/chamsin/src/analogic/Transistor.cpp @@ -129,7 +129,7 @@ void Transistor::createLayout() { if (toto > _l) { dx30 = rwCont; dy30 = dx30; - y30 = _w + DbU::max(rdActiveCont, rdActivePoly + rePolyCont); + y30 = _w + max(rdActiveCont, rdActivePoly + rePolyCont); } else { dx30 = dx00 - 2*rePolyCont; dy30 = rwCont; diff --git a/chamsin/src/technology/ATechnology.cpp b/chamsin/src/technology/ATechnology.cpp index 93bb32d9..fd6c975e 100644 --- a/chamsin/src/technology/ATechnology.cpp +++ b/chamsin/src/technology/ATechnology.cpp @@ -90,7 +90,7 @@ void ATechnology::print() { for (OneLayerPhysicalRules::iterator olprit = _oneLayerPhysicalRules.begin(); olprit != _oneLayerPhysicalRules.end(); olprit++) { - Layer* layer = olprit->first; + const Layer* layer = olprit->first; cout << " o layer " << layer << endl; printPhysicalRules(olprit->second); cout << endl; @@ -99,8 +99,8 @@ void ATechnology::print() { for (TwoLayersPhysicalRules::iterator tlprit = _twoLayersPhysicalRules.begin(); tlprit != _twoLayersPhysicalRules.end(); tlprit++) { - Layer* layer1 = tlprit->first.first; - Layer* layer2 = tlprit->first.second; + const Layer* layer1 = tlprit->first.first; + const Layer* layer2 = tlprit->first.second; cout << " o layer1 " << layer1 << endl; cout << " o layer2 " << layer2 << endl; printPhysicalRules(tlprit->second); @@ -118,11 +118,11 @@ const ATechnology::PhysicalRule* ATechnology::getPhysicalRule(const Name& name) } const ATechnology::PhysicalRule* ATechnology::getPhysicalRule(const Name& name, const Layer* layer) const { - OneLayerPhysicalRules::iterator olprit = _oneLayerPhysicalRules.find(layer); + OneLayerPhysicalRules::const_iterator olprit = _oneLayerPhysicalRules.find(layer); if (olprit == _oneLayerPhysicalRules.end()) { throw Error("Cannot find Physical Rules for layer " + getString(layer->getName())); } - PhysicalRules& physicalRules = olprit->second; + const PhysicalRules& physicalRules = olprit->second; PhysicalRule searchPR(name, 0, ""); PhysicalRules::iterator prit = physicalRules.find(&searchPR); if (prit == physicalRules.end()) { @@ -135,11 +135,15 @@ const ATechnology::PhysicalRule* ATechnology::getPhysicalRule( const Name& name, const Layer* layer1, const Layer* layer2) const { - TwoLayerPhysicalRules::iterator tlprit = _twoLayerPhysicalRules.find(layer); - if (olprit == _oneLayerPhysicalRules.end()) { - throw Error("Cannot find Physical Rules for layer " + getString(layer->getName())); + LayerPair searchLayerPair(layer1, layer2); + TwoLayersPhysicalRules::const_iterator tlprit = _twoLayersPhysicalRules.find(searchLayerPair); + if (tlprit == _twoLayersPhysicalRules.end()) { + throw Error("Cannot find Physical Rules for layers " + + getString(layer1->getName()) + + " and " + + getString(layer2->getName())); } - PhysicalRules& physicalRules = olprit->second; + const PhysicalRules& physicalRules = tlprit->second; PhysicalRule searchPR(name, 0, ""); PhysicalRules::iterator prit = physicalRules.find(&searchPR); if (prit == physicalRules.end()) { diff --git a/chamsin/src/technology/ATechnology.h b/chamsin/src/technology/ATechnology.h index 8242e7aa..b6b17172 100644 --- a/chamsin/src/technology/ATechnology.h +++ b/chamsin/src/technology/ATechnology.h @@ -38,21 +38,21 @@ class ATechnology : public PrivateProperty { } }; - typedef pair LayerPair; + typedef pair LayerPair; struct LayerPairCompare: public std::binary_function { bool operator()(const LayerPair& lp1, const LayerPair& lp2) const { - if (lp1->first < lp2->first) { + if (lp1.first < lp2.first) { return -1; } - if (lp1->first > lp2->first) { + if (lp1.first > lp2.first) { return 1; } - if (lp1->second < lp2->second) { + if (lp1.second < lp2.second) { return -1; } - if (lp1->second > lp2->second) { + if (lp1.second > lp2.second) { return 1; } return 0; @@ -60,7 +60,7 @@ class ATechnology : public PrivateProperty { }; typedef set PhysicalRules; - typedef map OneLayerPhysicalRules; + typedef map OneLayerPhysicalRules; typedef map TwoLayersPhysicalRules; static ATechnology* create(Hurricane::Technology* technology);