📄 oalefoutlayer.cpp
字号:
// *****************************************************************************// *****************************************************************************// LefOutLayer.cpp//// This file contains the member functions for the LefOutLayer class.//// *****************************************************************************// Except as specified in the OpenAccess terms of use of Cadence or Silicon// Integration Initiative, this material may not be copied, modified,// re-published, uploaded, executed, or distributed in any way, in any medium,// in whole or in part, without prior written permission from Cadence.//// Copyright 2002-2005 Cadence Design Systems, Inc.// All Rights Reserved.//// $Author: nitters $// $Revision: 1.102 $// $Date: 2005/07/19 16:05:34 $// $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaLefDef.h"BEGIN_LEFDEF_NAMESPACE// *****************************************************************************// LefOutLayer::LefOutLayer()// LefOutLayer::~LefOutLayer()//// This is the default constructor for the LefOutLayer class.// *****************************************************************************LefOutLayer::LefOutLayer(LefOut &lefOutIn): lefOut(lefOutIn){ lefOutIn.lefOutLayer = this;}LefOutLayer::~LefOutLayer(){}// *****************************************************************************// LefOutLayer::write()//// This function outputs the LEF layer information for this layer. The// information written out depends on the type of the layer where the allowed// types are: ROUTING, MASTERSLICE, OVERLAP and CUT.// *****************************************************************************voidLefOutLayer::write(oaPhysicalLayer *layerIn){ layer = layerIn; oaString layerName; layer->getName(layerName); switch (layer->getMaterial()) { case oacMetalMaterial: lefOut.output("LAYER %s\n", (const char*)layerName); lefOut.incIndent(); lefOut.output("TYPE ROUTING ;\n"); writeDirection(); writePitch(); writeWidth(); writeOffset(); writeArea(); writeSpacing(); writeSpacingInfluence(); writeSpacingInfluenceTable(); writeWireExt(); writeMinCut(); writeMinProtrusionCut(); if (lefOut.getOptions()->getVersion() > cLefDefVersion54) { writeMinWidth(); writeMaxWidth(); writeMinStep(); writeProtrusionWidth(); writeMinEnclosedArea(); } if (lefOut.getOptions()->getVersion() > cLefDefVersion55) { writeMinSize(); writeDiagPitch(); writeDiagWidth(); writeDiagSpacing(); writeDiagMinEdgeLength(); } writeRes(); writeCap(); writeHeight(); writeThickness(); writeShrinkage(); writeCapMul(); writeEdgeCap(); writeDensity(); writeFill(); writeAntenna(); writeACCurDen(); writeDCCurDen(); lefOut.writeProperties(layer, cLefDefLayer); break; case oacCutMaterial: lefOut.output("LAYER %s\n", (const char*)layerName); lefOut.incIndent(); lefOut.output("TYPE CUT ;\n"); writeCutSpacing(); if (lefOut.getOptions()->getVersion() > cLefDefVersion55) { writeWidth(); writeEnclosure(); writePreferredEnclosure(); writeCutRes(); } writeAntenna(); writeACCurDen(); writeDCCurDen(); lefOut.writeProperties(layer, cLefDefLayer); break; case oacNImplantMaterial: case oacPImplantMaterial: if (lefOut.getOptions()->getVersion() < cLefDefVersion55) { return; } lefOut.output("LAYER %s\n", (const char*)layerName); lefOut.incIndent(); lefOut.output("TYPE IMPLANT ;\n"); writeFoundryWidth(); writeCutSpacing(); lefOut.writeProperties(layer, cLefDefLayer); break; case oacNDiffMaterial: case oacPDiffMaterial: case oacDiffMaterial: case oacPolyMaterial: lefOut.output("LAYER %s\n", (const char*)layerName); lefOut.incIndent(); lefOut.output("TYPE MASTERSLICE ;\n"); lefOut.writeProperties(layer, cLefDefLayer); break; default: return; } lefOut.decIndent(); lefOut.output("END %s\n\n", (const char*) layerName);}// *****************************************************************************// LefOutLayer::writePitch()// // This function outputs the pitch for this layer, syntax:// PITCH distance ;// *****************************************************************************voidLefOutLayer::writePitch(){ oaValue *pXValue = lefOut.getConstraint(lefOut.getDefaultRules(), oacHorizontalRouteGridPitch, layer->getNumber()); oaValue *pYValue = lefOut.getConstraint(lefOut.getDefaultRules(), oacVerticalRouteGridPitch, layer->getNumber()); oaUInt4 pX = 0; oaUInt4 pY = 0; if (pXValue && pXValue->getType() == oacIntValueType) { pX = ((oaIntValue*) pXValue)->get(); } if (pYValue && pYValue->getType() == oacIntValueType) { pY = ((oaIntValue*) pYValue)->get(); } if (lefOut.getOptions()->getVersion() > cLefDefVersion55) { lefOut.output("PITCH %.11g %.11g ;\n", lefOut.dbuToUU(pX), lefOut.dbuToUU(pY)); return; } if (layer->getPrefRoutingDir() == oacVertPrefRoutingDir) { lefOut.output("PITCH %.11g ;\n", lefOut.dbuToUU(pX)); return; } lefOut.output("PITCH %.11g ;\n", lefOut.dbuToUU(pY));}// *****************************************************************************// LefOutLayer::writeDiagPitch()// // This function outputs the pitch for this layer, syntax:// DIAGPITCH distance ;// *****************************************************************************voidLefOutLayer::writeDiagPitch(){ oaValue *pXValue = lefOut.getConstraint(lefOut.getDefaultRules(), oac45RouteGridPitch, layer->getNumber()); oaValue *pYValue = lefOut.getConstraint(lefOut.getDefaultRules(), oac135RouteGridPitch, layer->getNumber()); oaUInt4 pX = 0; oaUInt4 pY = 0; if (pXValue && pXValue->getType() == oacIntValueType) { pX = ((oaIntValue*) pXValue)->get(); } if (pYValue && pYValue->getType() == oacIntValueType) { pY = ((oaIntValue*) pYValue)->get(); } if (pX || pY) { lefOut.output("DIAGPITCH %.11g %.11g ;\n", lefOut.dbuToUU(pX), lefOut.dbuToUU(pY)); }}// *****************************************************************************// LefOutLayer::writeOffset()// // This function outputs the offset for this layer, syntax:// OFFSET distance ;// *****************************************************************************voidLefOutLayer::writeOffset(){ // Find the PITCH oaValue *pXValue = lefOut.getConstraint(lefOut.getDefaultRules(), oacHorizontalRouteGridPitch, layer->getNumber()); oaValue *pYValue = lefOut.getConstraint(lefOut.getDefaultRules(), oacVerticalRouteGridPitch, layer->getNumber()); oaUInt4 pX = 0; oaUInt4 pY = 0; if (pXValue && pXValue->getType() == oacIntValueType) { pX = ((oaIntValue*) pXValue)->get(); } if (pYValue && pYValue->getType() == oacIntValueType) { pY = ((oaIntValue*) pYValue)->get(); } // Find the OFFSET oaValue *oXValue = lefOut.getConstraint(lefOut.getDefaultRules(), oacHorizontalRouteGridOffset, layer->getNumber()); oaValue *oYValue = lefOut.getConstraint(lefOut.getDefaultRules(), oacVerticalRouteGridOffset, layer->getNumber()); oaUInt4 oX = 0; oaUInt4 oY = 0; if (oXValue && oXValue->getType() == oacIntValueType) { oX = ((oaIntValue*) oXValue)->get(); } else { oX = pX / 2; } if (oYValue && oYValue->getType() == oacIntValueType) { oY = ((oaIntValue*) oYValue)->get(); } else { oY = pY / 2; } // Write the OFFSET if it is other than half the PITCH if (lefOut.getOptions()->getVersion() > cLefDefVersion55) { if ((oX != pX / 2) || (oY != pY / 2)) { lefOut.output("OFFSET %.11g %.11g ;\n", lefOut.dbuToUU(oX), lefOut.dbuToUU(oY)); } return; } if (layer->getPrefRoutingDir() == oacVertPrefRoutingDir) { if (oX != pX /2) { lefOut.output("OFFSET %.11g ;\n", lefOut.dbuToUU(oX)); } return; } if (oY != pY / 2) { lefOut.output("OFFSET %.11g ;\n", lefOut.dbuToUU(oY)); }}// *****************************************************************************// LefOutLayer::writeWidth()// // This function outputs the routespec width for this layer, syntax:// WIDTH defWidth ;// *****************************************************************************voidLefOutLayer::writeWidth(){ oaUInt4 width = lefOut.getLayerWidth(lefOut.getDefaultRules(), layer->getNumber()); if (width) { lefOut.output("WIDTH %.11g ;\n", lefOut.dbuToUU(width)); }}// *****************************************************************************// LefOutLayer::writeDiagWidth()// // This function outputs the routespec width for this layer, syntax:// WIDTH defWidth ;// *****************************************************************************voidLefOutLayer::writeDiagWidth(){ oaValue *v = lefOut.getConstraint(lefOut.getDefaultRules(), oacMinDiagonalWidth, layer->getNumber()); if (v && v->getType() == oacIntValueType) { lefOut.output("DIAGWIDTH %.11g ;\n", lefOut.dbuToUU(((oaIntValue*) v)->get())); }}// *****************************************************************************// LefOutLayer::writeFoundryWidth()// // This function outputs the foundry value width for this layer, syntax:// WIDTH defWidth ;// *****************************************************************************voidLefOutLayer::writeFoundryWidth(){ oaUInt4 width = lefOut.getLayerWidth(lefOut.getFoundryRules(), layer->getNumber()); if (width) { lefOut.output("WIDTH %.11g ;\n", lefOut.dbuToUU(width)); }}// *****************************************************************************// LefOutLayer::writeMinWidth()// // This function outputs the minimum width for this layer, syntax:// MINWIDTH width ;// This is only output if the minwidth is different from the WIDTH specified// by the default routespec.// From LEF 5.5 Only.// *****************************************************************************voidLefOutLayer::writeMinWidth(){ oaUInt4 width = lefOut.getLayerWidth(lefOut.getDefaultRules(), layer->getNumber()); oaUInt4 minWidth = lefOut.getLayerWidth(lefOut.getFoundryRules(), layer->getNumber()); if (minWidth && minWidth != width) { lefOut.output("MINWIDTH %.11g ;\n", lefOut.dbuToUU(minWidth)); }}// *****************************************************************************// LefOutLayer::writeMaxWidth()// // This function outputs the minimum width for this layer, syntax:// MINWIDTH width ;// From LEF 5.5 Only.// *****************************************************************************voidLefOutLayer::writeMaxWidth(){ oaValue *value = lefOut.getConstraint(lefOut.getFoundryRules(), oacMaxWidth, layer->getNumber()); if (value && value->getType() == oacIntValueType) { lefOut.output("MAXWIDTH %.11g ;\n", lefOut.dbuToUU(((oaIntValue*) value)->get())); }}// *****************************************************************************// LefOutLayer::writeMinStep()// LefOutLayer::writeMinStepLengthSum()// // This function outputs the minimum width for this layer, syntax:// [MINSTEP minStepLength // [INSIDECORNER | OUTSIDECORNER | STEP ]// [LENGTHSUM maxLength] ; ] ...// *****************************************************************************voidLefOutLayer::writeMinStep(){ oaConstraintParamArray params; oaValue *value = lefOut.getConstraint(lefOut.getFoundryRules(), oacMinConvexEdgeLength, layer->getNumber(), ¶ms);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -