From 8604f4a26dec796a3dc29940bba9acff11c32c0c Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 9 Sep 2023 12:46:42 +0200 Subject: [PATCH] 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. --- crlcore/src/ccore/gds/GdsParser.cpp | 16 +++++++++++----- hurricane/src/hurricane/Contact.cpp | 4 ++++ 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/crlcore/src/ccore/gds/GdsParser.cpp b/crlcore/src/ccore/gds/GdsParser.cpp index b7c8a95d..6ce5c66c 100644 --- a/crlcore/src/ccore/gds/GdsParser.cpp +++ b/crlcore/src/ccore/gds/GdsParser.cpp @@ -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; diff --git a/hurricane/src/hurricane/Contact.cpp b/hurricane/src/hurricane/Contact.cpp index 1d9c82af..62450550 100644 --- a/hurricane/src/hurricane/Contact.cpp +++ b/hurricane/src/hurricane/Contact.cpp @@ -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( 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( 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(); }