Issue a warning when the blockage net (for OBS) do not exists.

This commit is contained in:
Jean-Paul Chaput 2022-10-31 16:29:07 +01:00
parent 1253eeeef4
commit a0880da706
1 changed files with 16 additions and 7 deletions

View File

@ -450,9 +450,10 @@ namespace {
{
LefParser* parser = (LefParser*)ud;
const Layer* layer = NULL;
Cell* cell = parser->getCell();
Net* blockageNet = cell->getNet( "blockage" );
const Layer* layer = NULL;
const Layer* blockageLayer = NULL;
Cell* cell = parser->getCell();
Net* blockageNet = cell->getNet( "blockage" );
if (not blockageNet) {
blockageNet = Net::create( cell, "blockage" );
@ -464,9 +465,17 @@ namespace {
lefiGeometries* geoms = obstruction->geometries();
for ( int igeom=0 ; igeom < geoms->numItems() ; ++ igeom ) {
if (geoms->itemType(igeom) == lefiGeomLayerE) {
layer = parser->getLayer( geoms->getLayer(igeom) )->getBlockageLayer();
layer = parser->getLayer( geoms->getLayer(igeom) );
blockageLayer = layer->getBlockageLayer();
}
if (not blockageLayer) {
cerr << Error( "DefImport::_obstructionCbk(): No blockage layer associated to \"%s\".\n"
" (while parsing \"%s\")"
, getString( layer->getName() ).c_str()
, getString( cell ).c_str()
) << endl;
continue;
}
if (not layer) continue;
if (geoms->itemType(igeom) == lefiGeomRectE) {
lefiGeomRect* r = geoms->getRect(igeom);
@ -474,14 +483,14 @@ namespace {
double h = r->yh - r->yl;
Segment* segment = NULL;
if (w >= h) {
segment = Horizontal::create( blockageNet, layer
segment = Horizontal::create( blockageNet, blockageLayer
, parser->fromUnitsMicrons( (r->yl + r->yh)/2 )
, parser->fromUnitsMicrons( h )
, parser->fromUnitsMicrons( r->xl )
, parser->fromUnitsMicrons( r->xh )
);
} else {
segment = Vertical::create( blockageNet, layer
segment = Vertical::create( blockageNet, blockageLayer
, parser->fromUnitsMicrons( (r->xl + r->xh)/2 )
, parser->fromUnitsMicrons( w )
, parser->fromUnitsMicrons( r->yl )