better Via management ...
This commit is contained in:
parent
3d09907286
commit
73e73aa86f
|
@ -1,5 +1,6 @@
|
||||||
|
|
||||||
// -*-compile-command:"cd ../../../../.. && make"-*-
|
// -*-compile-command:"cd ../../../../.. && make"-*-
|
||||||
// Time-stamp: "2010-08-17 13:07:48" - OpenAccessDriver.cpp
|
// Time-stamp: "2010-08-18 10:32:07" - OpenAccessDriver.cpp
|
||||||
// x-----------------------------------------------------------------x
|
// x-----------------------------------------------------------------x
|
||||||
// | This file is part of the hurricaneAMS Software. |
|
// | This file is part of the hurricaneAMS Software. |
|
||||||
// | Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved |
|
// | Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved |
|
||||||
|
@ -48,7 +49,7 @@ namespace {
|
||||||
using namespace CRL_OA;
|
using namespace CRL_OA;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Class to drive OA to Hurricane
|
Class to drive Hurricane to OA
|
||||||
*/
|
*/
|
||||||
class OADriver {
|
class OADriver {
|
||||||
private:
|
private:
|
||||||
|
@ -57,7 +58,6 @@ namespace {
|
||||||
typedef map<const Cell*, oaCell*> Cell2OACellMap;
|
typedef map<const Cell*, oaCell*> Cell2OACellMap;
|
||||||
typedef map<const Instance*, oaInst*> Instance2OAInstsMap;
|
typedef map<const Instance*, oaInst*> Instance2OAInstsMap;
|
||||||
typedef map<const Layer*, oaLayer*> Layer2OALayerMap;
|
typedef map<const Layer*, oaLayer*> Layer2OALayerMap;
|
||||||
typedef map<const ViaLayer*, oaStdViaDef*> ViaLayer2OAViaDefMap;
|
|
||||||
typedef map<const Component*, oaRect*> Component2OARectMap;
|
typedef map<const Component*, oaRect*> Component2OARectMap;
|
||||||
typedef map<const Segment*, oaPathSeg*> Segment2OAPathSegMap;
|
typedef map<const Segment*, oaPathSeg*> Segment2OAPathSegMap;
|
||||||
|
|
||||||
|
@ -71,7 +71,6 @@ namespace {
|
||||||
Cell2OACellMap _cell2OAcell;
|
Cell2OACellMap _cell2OAcell;
|
||||||
Instance2OAInstsMap _instance2OAInst;
|
Instance2OAInstsMap _instance2OAInst;
|
||||||
Layer2OALayerMap _layer2OALayer;
|
Layer2OALayerMap _layer2OALayer;
|
||||||
ViaLayer2OAViaDefMap _viaLayer2OAViaDef;
|
|
||||||
Component2OARectMap _component2OARect;
|
Component2OARectMap _component2OARect;
|
||||||
Segment2OAPathSegMap _segment2OAPathSeg;
|
Segment2OAPathSegMap _segment2OAPathSeg;
|
||||||
set<int> _layerIDS;
|
set<int> _layerIDS;
|
||||||
|
@ -94,7 +93,6 @@ namespace {
|
||||||
_cell2OAcell(),
|
_cell2OAcell(),
|
||||||
_instance2OAInst(),
|
_instance2OAInst(),
|
||||||
_layer2OALayer(),
|
_layer2OALayer(),
|
||||||
_viaLayer2OAViaDef(),
|
|
||||||
_component2OARect(),
|
_component2OARect(),
|
||||||
_segment2OAPathSeg(),
|
_segment2OAPathSeg(),
|
||||||
_layerIDS(),
|
_layerIDS(),
|
||||||
|
@ -251,24 +249,25 @@ namespace {
|
||||||
// 1) get or create layer
|
// 1) get or create layer
|
||||||
oaString layerName = getString(layer->getName()).c_str();
|
oaString layerName = getString(layer->getName()).c_str();
|
||||||
oaLayer* aOALayer = NULL;
|
oaLayer* aOALayer = NULL;
|
||||||
aOALayer = oaPhysicalLayer::find(theOATech, layerName, true);
|
|
||||||
if(aOALayer){
|
|
||||||
_layer2OALayer[layer] = aOALayer;
|
|
||||||
_layerIDS.insert(aOALayer->getNumber());
|
|
||||||
return aOALayer;
|
|
||||||
}
|
|
||||||
const BasicLayer* bLayer = dynamic_cast<const BasicLayer*>(layer);
|
const BasicLayer* bLayer = dynamic_cast<const BasicLayer*>(layer);
|
||||||
if(!bLayer){
|
if(!bLayer){
|
||||||
cerr << "NOT A BASICLAYER " << layerName;
|
cerr << "NOT A BASICLAYER " << layerName;
|
||||||
const ViaLayer* vLayer = dynamic_cast<const ViaLayer*>(layer);
|
const ViaLayer* vLayer = dynamic_cast<const ViaLayer*>(layer);
|
||||||
if(vLayer){
|
if(vLayer){
|
||||||
|
try{
|
||||||
cerr << " but is a ViaLayer" << endl;
|
cerr << " but is a ViaLayer" << endl;
|
||||||
|
oaString viaDefName = getString(vLayer->getName()).c_str();
|
||||||
|
cerr << "test0" << endl;
|
||||||
|
oaViaDef* tmp = oaViaDef::find(theOATech, viaDefName);
|
||||||
|
cerr << "test0bis" << endl;
|
||||||
|
oaStdViaDef* vDef = static_cast<oaStdViaDef*>( tmp);
|
||||||
|
cerr << "test1" << endl;
|
||||||
|
if(!vDef){
|
||||||
const Layer* hBottom=vLayer->getBottom();
|
const Layer* hBottom=vLayer->getBottom();
|
||||||
const Layer* hTop=vLayer->getTop();
|
const Layer* hTop=vLayer->getTop();
|
||||||
assert(hBottom);
|
assert(hBottom);
|
||||||
assert(hTop);
|
assert(hTop);
|
||||||
|
|
||||||
oaPhysicalLayer* bottom = static_cast<oaPhysicalLayer*>(toOALayer(hBottom,theOATech));
|
oaPhysicalLayer* bottom = static_cast<oaPhysicalLayer*>(toOALayer(hBottom,theOATech));
|
||||||
oaPhysicalLayer* top = static_cast<oaPhysicalLayer*>(toOALayer(hTop,theOATech));
|
oaPhysicalLayer* top = static_cast<oaPhysicalLayer*>(toOALayer(hTop,theOATech));
|
||||||
oaLayer* cut = NULL;
|
oaLayer* cut = NULL;
|
||||||
|
@ -282,13 +281,22 @@ namespace {
|
||||||
assert(cut);
|
assert(cut);
|
||||||
oaViaParam stdViaDefParam;
|
oaViaParam stdViaDefParam;
|
||||||
stdViaDefParam.setCutLayer(cut->getNumber());
|
stdViaDefParam.setCutLayer(cut->getNumber());
|
||||||
stdViaDefParam.setCutWidth(Hurricane::DbU::getDb(vLayer->getEnclosure()));
|
long param = Hurricane::DbU::getDb(vLayer->getEnclosure());
|
||||||
stdViaDefParam.setCutHeight(Hurricane::DbU::getDb(vLayer->getEnclosure()));
|
//TODO: change and use something not beeing zero !!!
|
||||||
oaStdViaDef* vDef = oaStdViaDef::create(theOATech, layerName,
|
if(param == 0)
|
||||||
|
param = 1;
|
||||||
|
stdViaDefParam.setCutWidth(param);
|
||||||
|
stdViaDefParam.setCutHeight(param);
|
||||||
|
cerr << "test2" << endl;
|
||||||
|
vDef = oaStdViaDef::create(theOATech, layerName,
|
||||||
bottom,
|
bottom,
|
||||||
top,
|
top,
|
||||||
stdViaDefParam);
|
stdViaDefParam);
|
||||||
_viaLayer2OAViaDef[vLayer] = vDef;
|
}
|
||||||
|
}catch(oaException& e){
|
||||||
|
cerr << "ERROR(test): " << e.getMsg() << endl;
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
const ContactLayer* cLayer = dynamic_cast<const ContactLayer*>(layer);
|
const ContactLayer* cLayer = dynamic_cast<const ContactLayer*>(layer);
|
||||||
if(cLayer)
|
if(cLayer)
|
||||||
|
@ -303,11 +311,16 @@ namespace {
|
||||||
if(rLayer)
|
if(rLayer)
|
||||||
cerr << " but is a RegularLayer" << endl;
|
cerr << " but is a RegularLayer" << endl;
|
||||||
}
|
}
|
||||||
|
aOALayer = oaPhysicalLayer::find(theOATech, layerName, true);
|
||||||
|
if(aOALayer){
|
||||||
|
_layer2OALayer[layer] = aOALayer;
|
||||||
|
_layerIDS.insert(aOALayer->getNumber());
|
||||||
|
return aOALayer;
|
||||||
|
}
|
||||||
aOALayer = oaPhysicalLayer::create(theOATech, layerName, generateLayerID(bLayer),
|
aOALayer = oaPhysicalLayer::create(theOATech, layerName, generateLayerID(bLayer),
|
||||||
bLayer ? toOAMaterial(bLayer->getMaterial())
|
bLayer ? toOAMaterial(bLayer->getMaterial())
|
||||||
: oaMaterial(oacOtherMaterial));
|
: oaMaterial(oacOtherMaterial));
|
||||||
assert(aOALayer);
|
assert(aOALayer);
|
||||||
|
|
||||||
_layer2OALayer[layer] = aOALayer;
|
_layer2OALayer[layer] = aOALayer;
|
||||||
|
|
||||||
//create and add layer constraint for Layer specific manufacturing rules
|
//create and add layer constraint for Layer specific manufacturing rules
|
||||||
|
@ -550,21 +563,19 @@ namespace {
|
||||||
return box;
|
return box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Used to convert Pad
|
Used to convert Pad
|
||||||
*/
|
*/
|
||||||
oaRect* toOARect(Component* component,oaNet* blockNet){
|
oaRect* toOARect(Component* component,oaBlock* block){
|
||||||
cerr << "toOARect" << endl;
|
cerr << "toOARect" << endl;
|
||||||
assert(component);
|
assert(component);
|
||||||
assert(blockNet);
|
assert(block);
|
||||||
|
|
||||||
Component2OARectMap::iterator it = _component2OARect.find(component);
|
Component2OARectMap::iterator it = _component2OARect.find(component);
|
||||||
if (it != _component2OARect.end())
|
if (it != _component2OARect.end())
|
||||||
return it->second;
|
return it->second;
|
||||||
|
|
||||||
oaRect* rect = oaRect::create(blockNet->getBlock(),
|
oaRect* rect = oaRect::create(block,
|
||||||
toOALayerNum( component->getLayer() ),
|
toOALayerNum( component->getLayer() ),
|
||||||
oacDrawingPurposeType,
|
oacDrawingPurposeType,
|
||||||
toOABox(component->getBoundingBox()) );
|
toOABox(component->getBoundingBox()) );
|
||||||
|
@ -583,6 +594,8 @@ namespace {
|
||||||
if (it != _segment2OAPathSeg.end())
|
if (it != _segment2OAPathSeg.end())
|
||||||
return it->second;
|
return it->second;
|
||||||
oaPathSeg* res = NULL;
|
oaPathSeg* res = NULL;
|
||||||
|
oaPoint p1 = toOAPoint(segment->getSourcePosition());
|
||||||
|
oaPoint p2 = toOAPoint(segment->getTargetPosition());
|
||||||
try{
|
try{
|
||||||
Horizontal* hSeg = dynamic_cast<Horizontal*>(segment);
|
Horizontal* hSeg = dynamic_cast<Horizontal*>(segment);
|
||||||
if(hSeg)
|
if(hSeg)
|
||||||
|
@ -592,15 +605,18 @@ namespace {
|
||||||
cerr << "Vertical" << endl;
|
cerr << "Vertical" << endl;
|
||||||
|
|
||||||
oaSegStyle style(segment->getWidth(), oacTruncateEndStyle, oacTruncateEndStyle);
|
oaSegStyle style(segment->getWidth(), oacTruncateEndStyle, oacTruncateEndStyle);
|
||||||
oaPathSeg* res = oaPathSeg::create(blockNet->getBlock(),
|
res = oaPathSeg::create(blockNet->getBlock(),
|
||||||
toOALayerNum( segment->getLayer() ),
|
toOALayerNum( segment->getLayer() ),
|
||||||
oacDrawingPurposeType,
|
oacDrawingPurposeType,
|
||||||
toOAPoint(segment->getSourcePosition()),
|
p1,
|
||||||
toOAPoint(segment->getTargetPosition()),
|
p2,
|
||||||
style);
|
style);
|
||||||
}catch (oaException &e) {
|
}catch (oaException &e) {
|
||||||
cerr << "OA::ERROR => " << e.getMsg() << endl;
|
cerr << "OA::ERROR(1) => " << e.getMsg()
|
||||||
exit(1);
|
<< "[(" << p1.x() << "," << p1.y()
|
||||||
|
<< " (" << p2.x() << "," << p2.y() << ")]"
|
||||||
|
<< segment->getCell() << endl;
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
assert(res);
|
assert(res);
|
||||||
return res;
|
return res;
|
||||||
|
@ -636,14 +652,18 @@ namespace {
|
||||||
|
|
||||||
// Create the oaStdVia
|
// Create the oaStdVia
|
||||||
const Layer* layer = contact->getLayer();
|
const Layer* layer = contact->getLayer();
|
||||||
const ViaLayer* vLayer = dynamic_cast<const ViaLayer*>(layer);
|
if(dynamic_cast<const ViaLayer*>(layer)){
|
||||||
assert(vLayer);
|
cerr << "contact: " << contact << " is a Via" << endl;
|
||||||
|
}else{
|
||||||
oaStdViaDef* myStdViaDef = NULL;
|
cerr << "contact: " << contact << " is NOT a Via" << endl;
|
||||||
ViaLayer2OAViaDefMap::iterator it = _viaLayer2OAViaDef.find(vLayer);
|
}
|
||||||
if (it != _viaLayer2OAViaDef.end())
|
oaString viaDefName = getString(layer->getName()).c_str();
|
||||||
myStdViaDef = it->second;
|
oaStdViaDef* myStdViaDef = static_cast<oaStdViaDef*>(
|
||||||
assert(myStdViaDef);
|
oaViaDef::find(_oaTech, viaDefName) );
|
||||||
|
if(!myStdViaDef)
|
||||||
|
return NULL;
|
||||||
|
else
|
||||||
|
cerr << "creating oaStdVia ..." << endl;
|
||||||
|
|
||||||
oaTransform zeroTrans(oaPoint(0, 0), oacR0);
|
oaTransform zeroTrans(oaPoint(0, 0), oacR0);
|
||||||
oaStdVia* via = oaStdVia::create(blockNet->getBlock(), myStdViaDef, zeroTrans);
|
oaStdVia* via = oaStdVia::create(blockNet->getBlock(), myStdViaDef, zeroTrans);
|
||||||
|
@ -696,14 +716,16 @@ namespace {
|
||||||
oaPinFig* toOAPinFig(Component* component,oaNet* blockNet){
|
oaPinFig* toOAPinFig(Component* component,oaNet* blockNet){
|
||||||
Contact* hContact = dynamic_cast<Contact*>(component);
|
Contact* hContact = dynamic_cast<Contact*>(component);
|
||||||
Segment* hSegment = dynamic_cast<Segment*>(component);
|
Segment* hSegment = dynamic_cast<Segment*>(component);
|
||||||
if(hContact)
|
if(hContact){
|
||||||
return toOAVia(hContact,blockNet);
|
oaPinFig* res = toOAVia(hContact,blockNet);
|
||||||
|
if(res)
|
||||||
|
return res;
|
||||||
|
}
|
||||||
if(hSegment)
|
if(hSegment)
|
||||||
return toOAPathSeg(hSegment,blockNet);
|
return toOAPathSeg(hSegment,blockNet);
|
||||||
return toOARect(component,blockNet);
|
return toOARect(component,blockNet->getBlock());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
convert Hurricane::Net to oaNet
|
convert Hurricane::Net to oaNet
|
||||||
always return a non NULL value
|
always return a non NULL value
|
||||||
|
@ -736,6 +758,8 @@ namespace {
|
||||||
Components externalComponents = NetExternalComponents::get(net);
|
Components externalComponents = NetExternalComponents::get(net);
|
||||||
for_each_component(component, externalComponents) {
|
for_each_component(component, externalComponents) {
|
||||||
oaPinFig* pinFig = toOAPinFig(component,blockNet);
|
oaPinFig* pinFig = toOAPinFig(component,blockNet);
|
||||||
|
if(!pinFig)//for bug : when segment are point
|
||||||
|
continue;
|
||||||
pinFig->addToPin(pin);
|
pinFig->addToPin(pin);
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
|
@ -746,20 +770,22 @@ namespace {
|
||||||
if(via){
|
if(via){
|
||||||
via->addToNet(blockNet);
|
via->addToNet(blockNet);
|
||||||
}else{
|
}else{
|
||||||
oaRect* rect = toOARect(contact,blockNet);
|
oaRect* rect = toOARect(contact,blockNet->getBlock());
|
||||||
rect->addToNet(blockNet);
|
rect->addToNet(blockNet);
|
||||||
}
|
}
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
cerr << " o transformation of pads" << endl;
|
cerr << " o transformation of pads" << endl;
|
||||||
for_each_pad(pad, net->getPads()){
|
for_each_pad(pad, net->getPads()){
|
||||||
oaRect* rect = toOARect(pad, blockNet);
|
oaRect* rect = toOARect(pad, blockNet->getBlock());
|
||||||
rect->addToNet(blockNet);
|
rect->addToNet(blockNet);
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
cerr << " o transformation of segments" << endl;
|
cerr << " o transformation of segments" << endl;
|
||||||
for_each_segment(component, net->getSegments()) {
|
for_each_segment(component, net->getSegments()) {
|
||||||
oaPathSeg* shape = toOAPathSeg(component,blockNet);
|
oaPathSeg* shape = toOAPathSeg(component,blockNet);
|
||||||
|
if(!shape)//avoid error when the segment is a point
|
||||||
|
continue;
|
||||||
shape->addToNet(blockNet);
|
shape->addToNet(blockNet);
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
|
@ -917,13 +943,21 @@ namespace {
|
||||||
|
|
||||||
// 4) convert each instance, net to OA
|
// 4) convert each instance, net to OA
|
||||||
cerr << "transformation of instances" << endl;
|
cerr << "transformation of instances" << endl;
|
||||||
|
oaCluster* cellCluster = oaCluster::find(topBlock,
|
||||||
|
getString(cell->getName()).c_str());
|
||||||
|
if(!cellCluster)
|
||||||
|
cellCluster = oaCluster::create(topBlock,
|
||||||
|
getString(cell->getName()).c_str(),
|
||||||
|
oacClusterTypeSuggested);
|
||||||
|
assert(cellCluster);
|
||||||
for_each_instance(instance, cell->getInstances()){
|
for_each_instance(instance, cell->getInstances()){
|
||||||
toOAInst(instance,topBlock);
|
oaInst* inst = toOAInst(instance,topBlock);
|
||||||
|
inst->addToCluster(cellCluster);
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
cerr << "transformation of nets" << endl;
|
cerr << "transformation of nets" << endl;
|
||||||
for_each_net(net, cell->getNets()){
|
for_each_net(net, cell->getNets()){
|
||||||
toOANet(net,topBlock);
|
oaNet* n =toOANet(net,topBlock);
|
||||||
end_for;
|
end_for;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ int main(int argc,char** argv) {
|
||||||
if(argc != 3)
|
if(argc != 3)
|
||||||
exit(-5);
|
exit(-5);
|
||||||
|
|
||||||
|
testAnalog(argv[1],argv[2]);
|
||||||
|
|
||||||
testNum(argv[1],argv[2],"a2_x2");
|
testNum(argv[1],argv[2],"a2_x2");
|
||||||
testNum(argv[1],argv[2],"a2_x4");
|
testNum(argv[1],argv[2],"a2_x4");
|
||||||
|
@ -200,8 +200,6 @@ int main(int argc,char** argv) {
|
||||||
testNum(argv[1],argv[2],"xr2_x4");
|
testNum(argv[1],argv[2],"xr2_x4");
|
||||||
testNum(argv[1],argv[2],"zero_x0");
|
testNum(argv[1],argv[2],"zero_x0");
|
||||||
|
|
||||||
testAnalog(argv[1],argv[2]);
|
|
||||||
|
|
||||||
DataBase::getDB()->destroy();
|
DataBase::getDB()->destroy();
|
||||||
cerr << "ending normally" << endl;
|
cerr << "ending normally" << endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue