From 3b6b588a7452ab8416495dbe6fa753eb9e6694b4 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 18 Apr 2021 20:37:19 +0200 Subject: [PATCH] Manage pads for external components in CRL::GdsParser. * New: In CRM::GdsSteam::makeExternals(), now take into accounts Pad for Net external components. Also delete the original components after creating the copy in the right Net. So now the PLL terminals are correctly seen. --- crlcore/src/ccore/gds/GdsParser.cpp | 30 ++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/crlcore/src/ccore/gds/GdsParser.cpp b/crlcore/src/ccore/gds/GdsParser.cpp index 2dd7d6ab..55762539 100644 --- a/crlcore/src/ccore/gds/GdsParser.cpp +++ b/crlcore/src/ccore/gds/GdsParser.cpp @@ -932,7 +932,7 @@ namespace { _stream >> _record; } else { _validSyntax = false; return _validSyntax; } - readTextbody( layer ); + readTextbody( layer ); //cdebug(101,0) << "GdsStream::readText() - return:" << _validSyntax << endl; return _validSyntax; @@ -985,6 +985,11 @@ namespace { if (_record.isSTRING()) { _text = _record.getName(); _stream >> _record; + if (not layer) { + cerr << Error( "GdsStream::readTextbody(): Discarted text is \"%s\"." + , _text.c_str() + ) << endl; + } } else { _validSyntax = false; @@ -1483,8 +1488,13 @@ namespace { void GdsStream::addNetReference ( Net* net, const Layer* layer, DbU::Unit x, DbU::Unit y ) { + cdebug_log(101,0) << "addNetReference(): " << net << " " << layer << " " + << DbU::getValueString(x) << " " << DbU::getValueString(y) << endl; + if (not layer) return; + string layerName = getString( layer->getName() ); + auto inet = _netReferences.find( net ); if (inet == _netReferences.end()) { _netReferences[ net ] = vector(); @@ -1510,6 +1520,8 @@ namespace { << " @" << ref._position << endl; if (not layer) continue; + + vector toDestroy; for ( Component* component : net->getCell() ->getComponentsUnder( Box(ref._position).inflate(1),layer->getMask() ) ) { cdebug_log(101,0) << "| " << component << endl; @@ -1523,6 +1535,7 @@ namespace { , href->getTargetX() ); NetExternalComponents::setExternal( h ); + toDestroy.push_back( component ); } else { Vertical* vref = dynamic_cast( component ); if (vref) { @@ -1534,9 +1547,24 @@ namespace { , vref->getTargetY() ); NetExternalComponents::setExternal( v ); + toDestroy.push_back( component ); + } else { + Pad* pref = dynamic_cast( component ); + if (pref) { + Pad* p = Pad::create( net + , pref->getLayer() + , pref->getBoundingBox() + ); + NetExternalComponents::setExternal( p ); + toDestroy.push_back( component ); + } } } } + + for ( Component* component : toDestroy ) { + component->destroy(); + } } } }