Fix, again, the extensions of PATHTYPE 4 in GdsParser.

Even when we were creating Contacts of null width or height, they where
bumped to the minimal size by the constructor, hence bits sticking out
at the end with Gds PATHTYPE 4. Now, allow null size for non-composite
(which contains a cut) and non-cut Contacts.

* Fix: In GdsParser::readStructure(), always use the bounding box as
    abutment box if the later is empty (case of small sub-components).
    This was making the sub-component seemingly diseapear in the
    viewer...
* Fix: In GdsParser::xyToPath(), slight change in xadjust & yadjust.
* Change: In Contact::create(), force the contact width and height to
    the minimal size *only* if it's a composite layer *or* a basic layer
    of "cut" material.
This commit is contained in:
Jean-Paul Chaput 2023-09-09 12:46:42 +02:00
parent 10c550593e
commit 8604f4a26d
2 changed files with 15 additions and 5 deletions

View File

@ -963,7 +963,7 @@ namespace {
if (_validSyntax) _stream >> _record;
if (not useLayer0AsBoundary()) {
if (not useLayer0AsBoundary() or _cell->getAbutmentBox().isEmpty()) {
UpdateSession::close();
_cell->setAbutmentBox( _cell->getBoundingBox() );
UpdateSession::open();
@ -1652,17 +1652,23 @@ namespace {
if (points[0].getX() == points[1].getX()) {
hWidthCap = width;
vWidthCap = bgnextn + twoGrid;
//yadjust = -vWidthCap/2 + twoGrid;
yadjust = (-vWidthCap + twoGrid) / 2;
if (points[0].getY() > points[1].getY())
yadjust = -yadjust;
} else {
hWidthCap = bgnextn + twoGrid;
vWidthCap = width;
//xadjust = -hWidthCap/2 + twoGrid;
xadjust = (-hWidthCap + twoGrid) / 2;
if (points[0].getX() > points[1].getX())
xadjust = -xadjust;
}
}
cdebug_log(101,0) << " twoGrid=" << DbU::getValueString(twoGrid)
<< " hWidthCap=" << DbU::getValueString(hWidthCap)
<< " vWidthCap=" << DbU::getValueString(vWidthCap)
<< " xadjust=" << DbU::getValueString(xadjust)
<< " yadjust=" << DbU::getValueString(yadjust)
<< endl;
Contact* source = Contact::create( net
, layer
, points[0].getX() + xadjust
@ -1692,7 +1698,7 @@ namespace {
if (points[i-1].getX() == points[i].getX()) {
hWidthCap = width;
vWidthCap = endextn + twoGrid;
//yadjust = vWidthCap/2 + twoGrid;
yadjust = (vWidthCap + twoGrid) /2;
if (points[i-1].getY() > points[i].getY())
yadjust = -yadjust;
} else {
@ -1700,7 +1706,7 @@ namespace {
<< " twoGrid=" << DbU::getValueString(twoGrid) << endl;
hWidthCap = endextn + twoGrid;
vWidthCap = width;
//xadjust = hWidthCap/2 - twoGrid;
xadjust = (hWidthCap - twoGrid) / 2;
if (points[i-1].getX() > points[i].getX())
xadjust = -xadjust;
cdebug_log(101,0) << "xadjust=" << DbU::getValueString(xadjust) << endl;

View File

@ -119,6 +119,8 @@ Contact::Contact(Net* net, const Layer* layer, DbU::Unit x, DbU::Unit y, DbU::Un
if (not _layer)
throw Error("Contact::Contact(): Can't create " + _TName("Contact") + ", NULL layer.");
const BasicLayer* basicLayer = dynamic_cast<const BasicLayer*>( layer );
if (not basicLayer or basicLayer->getMaterial() != BasicLayer::Material::cut) return;
if ( _width < _layer->getMinimalSize() ) _width = _layer->getMinimalSize();
if ( _height < _layer->getMinimalSize() ) _height = _layer->getMinimalSize();
}
@ -147,6 +149,8 @@ Contact::Contact(Net* net, Component* anchor, const Layer* layer, DbU::Unit dx,
_anchorHook.attach(anchor->getBodyHook());
const BasicLayer* basicLayer = dynamic_cast<const BasicLayer*>( layer );
if (not basicLayer or basicLayer->getMaterial() != BasicLayer::Material::cut) return;
if ( _width < _layer->getMinimalSize() ) _width = _layer->getMinimalSize();
if ( _height < _layer->getMinimalSize() ) _height = _layer->getMinimalSize();
}