From 3276950ec40e92e4d43758ef88e3e815dd7addf7 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Fri, 9 Apr 2021 13:55:08 +0200 Subject: [PATCH] Prefix all Cell from a GDS file with "gds_" to avoid cell overload. * Bug: In CRL::GdsParser, the PLL was using copies of the standard cell with the same name. And unfortunately, they where found *before* the FlexLib one when using DataBase::getCell(). As their I/O where wrong it was leading to a massive netlist connexion corruption in blif2vst. To avoid that, any Cell created by the GDS parser is now prefixed by "gds_". * Change: In CRL::GdsStream CTOR, report when the file cannot be opened instead of saying that the GDS file is corrupted (misleading). --- crlcore/src/ccore/gds/GdsParser.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crlcore/src/ccore/gds/GdsParser.cpp b/crlcore/src/ccore/gds/GdsParser.cpp index 2c6e4d49..8b510892 100644 --- a/crlcore/src/ccore/gds/GdsParser.cpp +++ b/crlcore/src/ccore/gds/GdsParser.cpp @@ -745,6 +745,13 @@ namespace { if (_gdsLayerTable.empty()) _staticInit(); _stream.open( gdsPath, ios_base::in|ios_base::binary ); + if (not _stream.is_open()) { + cerr << Error( "GdsStream::GdsStream(): Unable to open stream, check path.\n" + " \"%s\"" + , _gdsPath.c_str() ) << endl; + _validSyntax = false; + return; + } _stream >> _record; if (not _record.isHEADER()) { @@ -857,13 +864,14 @@ namespace { if (_record.isSTRNAME()) { if (_library) { - _cell = _library->getCell( _record.getName() ); + string cellName = "gds_" + _record.getName(); + _cell = _library->getCell( cellName ); if (not _cell) { - cerr << Warning( "GdsStream::readStructure(): No Cell named \"%s\" in Library \"%s\" (created)." + cerr << Warning( "GdsStream::readStructure(): No Cell named \"gds_%s\" in Library \"%s\" (created)." , _record.getName().c_str() , getString(_library).c_str() ) << endl; - _cell = Cell::create( _library, _record.getName() ); + _cell = Cell::create( _library, cellName ); } } _stream >> _record; @@ -1192,7 +1200,7 @@ namespace { // << " " << Transformation(xpos,ypos,orient) // << " in " << _cell << endl; _delayedInstances.push_back( DelayedInstance( _cell - , masterName + , "gds_" + masterName , Transformation(xpos,ypos,orient)) ); }