From f92b48174bdfbd1c6bc07d3e041b29a197849e75 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Thu, 15 Aug 2019 01:59:38 +0200 Subject: [PATCH] Correct management of "fused_net" in Alliance parser/drivers. * Bug: In CRL::ApDriver & CRL::ApParser, when saving a fused net, do not use it's name but put a star (*) character to set it anonymous. Having all component named was creating problems in cougar and subsquently in yagle (bad name for master latch). Conversely, in the parser, if the name of the net is "fused_net", make it a real fused_net and not an ordinary one. --- crlcore/src/ccore/alliance/ap/ApDriver.cpp | 33 +++++++++++++--------- crlcore/src/ccore/alliance/ap/ApParser.cpp | 2 +- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/crlcore/src/ccore/alliance/ap/ApDriver.cpp b/crlcore/src/ccore/alliance/ap/ApDriver.cpp index 64379b6a..000cc717 100644 --- a/crlcore/src/ccore/alliance/ap/ApDriver.cpp +++ b/crlcore/src/ccore/alliance/ap/ApDriver.cpp @@ -190,10 +190,12 @@ void DumpContacts(ofstream& ccell, Cell *cell) { const char* mbkLayer; - forEach ( Net*, inet, cell->getNets() ) - { - forEach ( Component*, icomponent, inet->getComponents()) { - if (Contact* contact = dynamic_cast(*icomponent)) { + for ( Net* net : cell->getNets() ) { + string netName = toMBKName( net->getName() ); + if (net->isFused()) netName = "*"; + + for ( Component* component : net->getComponents()) { + if (Contact* contact = dynamic_cast(component)) { if (dynamic_cast(contact)) continue; else { @@ -204,7 +206,7 @@ void DumpContacts(ofstream& ccell, Cell *cell) << toMBKlambda(contact->getX()) << "," << toMBKlambda(contact->getY()) << "," << mbkLayer << "," - << toMBKName(contact->getNet()->getName()) + << netName << endl; } else { DbU::Unit expand = 0; @@ -218,13 +220,13 @@ void DumpContacts(ofstream& ccell, Cell *cell) << toMBKlambda(contact->getWidth () + expand) << "," << toMBKlambda(contact->getHeight() + expand) << "," << mbkLayer << "," - << toMBKName(contact->getNet()->getName()) + << netName << endl; } } } - } // forEach( Component* ) - } // forEach( Net* ) + } // for(Component*) + } // for(Net*) } @@ -236,9 +238,12 @@ void DumpContacts(ofstream& ccell, Cell *cell) RoutingPad* rp; bool external; - forEach ( Net*, net, cell->getNets() ) { - forEach ( Component*, component, net->getComponents() ) { - if ( (rp = dynamic_cast(*component)) ) { + for ( Net* net : cell->getNets() ) { + string netName = toMBKName( net->getName() ); + if (net->isFused()) netName = "*"; + + for ( Component* component : net->getComponents() ) { + if ( (rp = dynamic_cast(component)) ) { if ( not net->isExternal() ) continue; if ( not cell->isRouted() ) continue; @@ -251,8 +256,8 @@ void DumpContacts(ofstream& ccell, Cell *cell) y1 = rp->getSourceY(); y2 = rp->getTargetY(); width = segment->getWidth(); - } else if ( (segment = dynamic_cast(*component)) ) { - external = NetExternalComponents::isExternal(*component); + } else if ( (segment = dynamic_cast(component)) ) { + external = NetExternalComponents::isExternal(component); x1 = segment->getSourceX(); x2 = segment->getTargetX(); y1 = segment->getSourceY(); @@ -274,7 +279,7 @@ void DumpContacts(ofstream& ccell, Cell *cell) << toMBKlambda(x2) << "," << toMBKlambda(y2) << "," << toMBKlambda(width) << "," - << toMBKName(component->getNet()->getName()) << "," + << netName << "," << direction << "," << mbkLayer << endl; diff --git a/crlcore/src/ccore/alliance/ap/ApParser.cpp b/crlcore/src/ccore/alliance/ap/ApParser.cpp index a3a63157..cf238896 100644 --- a/crlcore/src/ccore/alliance/ap/ApParser.cpp +++ b/crlcore/src/ccore/alliance/ap/ApParser.cpp @@ -377,7 +377,7 @@ namespace { Net* ApParser::_safeGetNet ( const char* apName ) { - if ( ( apName[0] == '\0' ) || !strcmp(apName,"*") ) + if ( ( apName[0] == '\0' ) or not strcmp(apName,"*") or not strcmp(apName,"fused_net") ) return _getFusedNet (); return _getNet ( apName );