lefexport: Make it useful for real processes

Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
gatecat 2021-11-08 22:15:43 +00:00
parent e1c5366fef
commit 2f1caca812
1 changed files with 12 additions and 6 deletions

View File

@ -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<rg.size() ; ++ilayer ) {
if ( 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 ; ilayer<rg.size() ; ++ilayer ) {
const Layer* topLayer = rg[ilayer]->getLayer();
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);