Technology with three types of rules : no layer, one layer, two layers

Transistor layout
This commit is contained in:
The Coriolis Project 2008-06-10 17:19:46 +00:00
parent 59e8d945d6
commit 279ff2a2aa
3 changed files with 20 additions and 16 deletions

View File

@ -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;

View File

@ -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()) {

View File

@ -38,21 +38,21 @@ class ATechnology : public PrivateProperty {
}
};
typedef pair<Layer*, Layer*> LayerPair;
typedef pair<const Layer*, const Layer*> LayerPair;
struct LayerPairCompare:
public std::binary_function<const LayerPair&, const LayerPair&, bool> {
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<ATechnology::PhysicalRule*, PhysicalRuleNameCompare> PhysicalRules;
typedef map<Layer*, PhysicalRules> OneLayerPhysicalRules;
typedef map<const Layer*, PhysicalRules> OneLayerPhysicalRules;
typedef map<LayerPair, PhysicalRules, LayerPairCompare> TwoLayersPhysicalRules;
static ATechnology* create(Hurricane::Technology* technology);