From 2f1caca8122260893897bc11a87f23dacba8db53 Mon Sep 17 00:00:00 2001 From: gatecat Date: Mon, 8 Nov 2021 22:15:43 +0000 Subject: [PATCH] lefexport: Make it useful for real processes Signed-off-by: gatecat --- crlcore/src/ccore/lefdef/LefExport.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/crlcore/src/ccore/lefdef/LefExport.cpp b/crlcore/src/ccore/lefdef/LefExport.cpp index b3573c22..ac8b91dc 100644 --- a/crlcore/src/ccore/lefdef/LefExport.cpp +++ b/crlcore/src/ccore/lefdef/LefExport.cpp @@ -119,7 +119,7 @@ namespace { int LefDriver::getUnits () { return _units; } - double LefDriver::toLefUnits ( DbU::Unit u ) { return DbU::getLambda(u)/**getUnits()*/; } + double LefDriver::toLefUnits ( DbU::Unit u ) { return DbU::toMicrons(u)/**getUnits()*/; } DbU::Unit LefDriver::getSliceHeight () { return _sliceHeight; } DbU::Unit LefDriver::getPitchWidth () { return _pitchWidth; }; inline AllianceFramework* LefDriver::getFramework () { return _framework; } @@ -144,9 +144,13 @@ namespace { _pitchWidth = cg->getPitch (); } + _units = DbU::toGrid(DbU::fromMicrons(1.0)); + _status = lefwInitCbk ( _lefStream ); if ( _status != 0 ) return; + + lefwSetVersionCbk ( _versionCbk ); lefwSetBusBitCharsCbk ( _busBitCharsCbk ); lefwSetDividerCharCbk ( _dividerCharCbk ); @@ -207,7 +211,7 @@ namespace { _status = lefwLayerRoutingPitch ( toLefUnits(lg->getPitch()) ); if ( _status != 0 ) return _status; - _status = lefwLayerRoutingSpacing ( toLefUnits(lg->getPitch()-lg->getWireWidth()-DbU::lambda(1.0)) ); + _status = lefwLayerRoutingSpacing ( toLefUnits(lg->getPitch()-lg->getWireWidth()/*-DbU::lambda(1.0)*/) ); if ( _status != 0 ) return _status; return _status = lefwEndLayerRouting ( layerName.c_str() ); @@ -491,7 +495,7 @@ namespace { int status = 0; for ( size_t ilayer=0 ; ilayer 0 ) { - status = driver->_driveCutLayer ( technology->getCutBelow(rg[ilayer]->getLayer()) ); + status = driver->_driveCutLayer ( technology->getCutBelow(rg[ilayer]->getLayer(), false) ); if ( status != 0 ) return driver->checkStatus(status); } @@ -566,7 +570,7 @@ namespace { // The driver puts it before UNITS, which seems to displease Cadence Encounter. // So, as long as it doesn't prevent Encounter to works, disable it. LefDriver* driver = (LefDriver*)udata; - return driver->checkStatus ( lefwManufacturingGrid ( LefDriver::toLefUnits(DbU::fromLambda(0.5)) ) ); + return driver->checkStatus ( lefwManufacturingGrid ( LefDriver::toLefUnits(DbU::fromGrid(1.0)) ) ); #else return 0; #endif @@ -604,10 +608,12 @@ namespace { int status = 0; for ( size_t ilayer=1 ; ilayergetLayer(); - const Layer* bottomLayer = topLayer->getMetalBelow(); - const Layer* cutLayer = topLayer->getCutBelow(); + const Layer* bottomLayer = topLayer->getMetalBelow(false); + const Layer* cutLayer = topLayer->getCutBelow(false); const Layer* viaLayer = technology->getViaBetween ( topLayer, bottomLayer ); + if ( !viaLayer ) continue; + status = lefwStartVia ( getString(viaLayer->getName()).c_str(), "DEFAULT" ); if ( status != 0 ) return driver->checkStatus(status);