📄 oalefinlayer.cpp
字号:
voidLefInLayer::parseWidth(){ if (lefLayer->hasWidth()) { oaValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->width())); lefIn.setConstraint(lefIn.getDefaultRules(), oacMinWidth, layer->getNumber(), v); }}// *****************************************************************************// LefInLayer::parseMinWidth()// // This function handles the MINWIDTH attribute for the current layer.//// Syntax:// [MINWIDTH width ;]//// The MINWIDTH is stored in OA using an oaIntValue for the oacMinWidth// constraint in the FoundryRules constraint group. If no MINWIDTH is specified,// the value of WIDTH is stored in the constraints.// *****************************************************************************voidLefInLayer::parseMinWidth(){ if (lefLayer->hasMinwidth()) { oaValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->minwidth())); lefIn.setConstraint(lefIn.getFoundryRules(), oacMinWidth, layer->getNumber(), v); } else if (lefLayer->hasWidth()) { oaValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->width())); lefIn.setConstraint(lefIn.getFoundryRules(), oacMinWidth, layer->getNumber(), v); }}// *****************************************************************************// LefInLayer::parseMaxWidth()// // This function handles the MAXWIDTH attribute for the current layer.//// Syntax:// [MAXWIDTH width ;]// // The MAXWIDTH is stored in OA using an oaIntValue for the oacMaxWidth// constraint in the FoundryRules constraint group.// *****************************************************************************voidLefInLayer::parseMaxWidth(){ if (lefLayer->hasMaxwidth()) { oaValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->maxwidth())); lefIn.setConstraint(lefIn.getFoundryRules(), oacMaxWidth, layer->getNumber(), v); }}// *****************************************************************************// LefInLayer::parseDiagWidth()// // This function handles the DIAGWIDTH attribute for the current layer.// // Syntax:// [DIAGWIDTH diagWidth ;]//// The DIAGWIDTH is stored in OA using an oaIntValue for the oacMinDiagonalWidth// constraint in the LEFDefaultRouteSpec constraint group.// *****************************************************************************voidLefInLayer::parseDiagWidth(){ if (lefLayer->hasDiagWidth()) { oaValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->diagWidth())); lefIn.setConstraint(lefIn.getDefaultRules(), oacMinDiagonalWidth, layer->getNumber(), v); }}// *****************************************************************************// LefInLayer::parseMinStep()// // This function handles the MINSTEP attribute for the current layer.// // Syntax:// [MINSTEP minStepLength// [INSIDECORNER | OUTSIDECORNER | STEP]// [LENGTHSUM maxLength] ;]// // The LAYER MINSTEP INSIDECORNER attribute is stored using an oaIntValue for// the oacMinConvexEdgeLength constraint in the foundryRules group.//// The LAYER MINSTEP [OUTSIDECORNER] attribute is stored using an oaIntValue// for the oacMinConcaveEdgeLength constraint in the foundryRules group.// Note that OUTSIDECORNER is the default rule type. //// The LAYER MINSTEP STEP attribute is stored using an oaIntValue for the// oacMinEdgeLength constraint in the foundryRules group.//// The optional LENGTHSUM value is stored as an oaIntValue for the// oaConstraintParam of type oacLengthSumConstraintParamType on the above// constraints.// *****************************************************************************voidLefInLayer::parseMinStep(){ for (int i = 0; i < lefLayer->numMinstep(); i++) { oaValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->minstep(i))); // Determine the constraint type as specified by the LEF keywords, // which default to OUTSIDECORNER. oaLayerConstraintType type = oacMinConvexEdgeLength; if (lefLayer->hasMinstepType(i)) { if (!strcmp(lefLayer->minstepType(i), "INSIDECORNER")) { type = oacMinConcaveEdgeLength; } else if (!strcmp(lefLayer->minstepType(i), "STEP")) { type = oacMinEdgeLength; } } // Add a constraint parameter for the optional LENGTHSUM value. oaConstraintParamArray params(1); if (lefLayer->hasMinstepLengthsum(i)) { oaConstraintParamDef *pDef = oaConstraintParamDef::get(oacLengthSumConstraintParamType); oaValue *pValue = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->minstepLengthsum(i))); params.append(oaConstraintParam::create(pDef, pValue)); } lefIn.setConstraint(lefIn.getFoundryRules(), type, layer->getNumber(), v, true, ¶ms); }}// *****************************************************************************// LefInLayer::parseMinSize()// // This function handles the MINSIZE attribute for the current layer.//// Syntax:// [MINSIZE minWidth minLength [minWidth2 minLength2] ... ;]//// The MINSIZE is stored in OA using an oaBoxArrayValue for the oacMinSize// constraint in the FoundryRules constraint group. Each minWidth/minLength pair// is converted to an oaBox with lower left at the origin.// *****************************************************************************voidLefInLayer::parseMinSize(){ if (lefLayer->numMinSize()) { oaBoxArray minSizeArray(lefLayer->numMinSize()); for (int i = 0; i < lefLayer->numMinSize(); i++) { minSizeArray[i].makeZero(); minSizeArray[i].right() = lefIn.uuToDBU(lefLayer->minSizeWidth(i)); minSizeArray[i].top() = lefIn.uuToDBU(lefLayer->minSizeLength(i)); } minSizeArray.setNumElements(lefLayer->numMinSize()); oaValue *v = oaBoxArrayValue::create(lefIn.tech(), minSizeArray); lefIn.setConstraint(lefIn.getFoundryRules(), oacMinSize, layer->getNumber(), v); }}// *****************************************************************************// LefInLayer::parseDiagMinEdgeLength()// // This function handles the DIAGMINEDGELENGTH attribute for the current layer.//// Syntax:// [DIAGMINEDGELENGTH diagLength ;]//// The DIAGMINEDGELENGTH is stored in OA using an oaIntValue for the// oacMinDiagonalEdgeLength constraint in the FoundryRules constraint group.// *****************************************************************************voidLefInLayer::parseDiagMinEdgeLength(){ if (lefLayer->hasDiagMinEdgeLength()) { oaValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->diagMinEdgeLength())); lefIn.setConstraint(lefIn.getFoundryRules(), oacMinDiagonalEdgeLength, layer->getNumber(), v); }}// *****************************************************************************// LefInLayer::parseArea()// // This function handles the AREA attribute for the current layer.//// Syntax:// [AREA minArea ;]// // The AREA is stored in OA using an oaIntValue for the oacMinArea constraint// in the FoundryRules constraint group.// *****************************************************************************voidLefInLayer::parseArea(){ if (lefLayer->hasArea()) { oaValue *v = oaIntValue::create(lefIn.tech(), (oaUInt4) lefIn.uuToDBUArea(lefLayer->area())); lefIn.setConstraint(lefIn.getFoundryRules(), oacMinArea, layer->getNumber(), v); }}// *****************************************************************************// LefInLayer::parseMinEnclosedArea()// // This function handles the MINENCLOSEDAREA attribute for the current layer.//// Syntax:// [MINENCLOSEDAREA area [WIDTH width] ;] ...// // The MINENCLOSEDAREA is stored in OA using the oacMinEnclosedArea constraint// in the FoundryRules constraint group. If there is only 1 MINENCLOSEDAREA// statement, and it is not width dependent, this will be stored using an// oaIntValue. If there is multiple such statements, an oaInt1DTblValue will be// used, which is indexed by the WIDTH.// *****************************************************************************voidLefInLayer::parseMinEnclosedArea(){ if (!lefLayer->numMinenclosedarea()) { return; } if (lefLayer->numMinenclosedarea() == 1 && !lefLayer->hasMinenclosedareaWidth(0)) { oaValue *v = oaIntValue::create(lefIn.tech(), (oaUInt4) lefIn.uuToDBUArea(lefLayer->minenclosedarea(0))); lefIn.setConstraint(lefIn.getFoundryRules(), oacMinEnclosedArea, layer->getNumber(), v); return; } oa1DLookupTbl<oaInt4, oaInt4> table(0, "width", 0); for (oaInt4 i(0); i < lefLayer->numMinenclosedarea(); i++) { oaUInt4 width = 0; if (lefLayer->hasMinenclosedareaWidth(i)) { width = lefIn.uuToDBU(lefLayer->minenclosedareaWidth(i)); } table.setValue(getIndex(table, width), (oaUInt4) lefIn.uuToDBUArea(lefLayer->minenclosedarea(i))); } oaValue *v = oaInt1DTblValue::create(lefIn.tech(), table); lefIn.setConstraint(lefIn.getFoundryRules(), oacMinEnclosedArea, layer->getNumber(), v);}// *****************************************************************************// LefInLayer::parsePotrusionWidth()// // This function handles the PotrusionWidth attributes for the specified layer.//// Syntax:// [PROTRUSIONWIDTH width1 LENGTH length WIDTH width2 ;]//// The PROTRUSIONWIDTH is stored in oa using an oaIntValue for the// oacMinProtrusionWidth constraint in the foundryRules. The LENGTH and WIDTH// values are stored as oaIntValues for the oacLengthConstraintParam and// oacWidthConstraintParam constraint parameters.// *****************************************************************************voidLefInLayer::parseProtrusionWidth(){ if (lefLayer->hasProtrusion()) { oaConstraintParamDef *lengthDef = oaConstraintParamDef::get(oacLengthConstraintParamType); oaConstraintParamDef *widthDef = oaConstraintParamDef::get(oacWidthConstraintParamType); oaIntValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->protrusionWidth1())); oaIntValue *lengthValue = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->protrusionLength())); oaIntValue *widthValue = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->protrusionWidth2())); oaConstraintParamArray params(2); params.append(oaConstraintParam::create(lengthDef, lengthValue)); params.append(oaConstraintParam::create(widthDef, widthValue)); lefIn.setConstraint(lefIn.getFoundryRules(), oacMinProtrusionWidth, layer->getNumber(), v, true, ¶ms); }}// *****************************************************************************// LefInLayer::parseDiagSpacing()// // This function handles the DIAGSPACING attribute for the specified layer.// // Syntax:// [DIAGSPACING diagSpacing ;]//// The DIAGSPACING is stored in OA using an oaIntValue for the// oacMinDiagonalSpacing constraint in the foundryRules.// *****************************************************************************voidLefInLayer::parseDiagSpacing(){ if (lefLayer->hasDiagSpacing()) { oaValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->diagSpacing())); lefIn.setConstraint(lefIn.getFoundryRules(), oacMinDiagonalSpacing, layer->getNumber(), v); }}// *****************************************************************************// LefInLayer::parseCutSpacing()// // This function handles the CutSpacing attributes for the specified layer.//// Syntax:// [SPACING minSpacing// [ LAYER 2ndLayerName// | ADJACENTCUTS {3 | 4} WITHIN distance// | CENTERTOCENTER]// ;] ...//// The SPACING for cut layers is stored in OA using an oaIntValue for the// oacMinSpacing constraint in the foundryRules group.//// The LAYER SPACING for cut layers is stored in OA using an oaIntValue for the// oacMinClearance constraint in the foundryRules.// // The ADJACENTCUTS SPACING for cut layers is stored in OA using an oaIntValue// for the oacMinAdjacentViaSpacing constraint in the foundryRules group. The// number of cuts and WITHIN distance are stored as oaIntValues for the // oacNumCutsConstraintParamType and oacDistanceConstraintParamType constraint// parameters.//// The CENTERTOCENTER SPACING is stored in OA using an oaIntValue for the// oacMinCenterToCenterSpacing constraint in the foundryRules.// *****************************************************************************voidLefInLayer::parseCutSpacing(){ if (lefLayer->hasSpacingNumber()) { for (oaInt4 i = 0; i < lefLayer->numSpacing(); i++) { if (lefLayer->hasSpacingName(i)) { oaLayer *otherLayer = lefIn.getLayer(lefLayer->spacingName(i)); oaValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->spacing(i))); lefIn.setConstraint(lefIn.getFoundryRules(), oacMinClearance, layer->getNumber(), otherLayer->getNumber(), v); } else if (lefLayer->hasSpacingAdjacent(i)) { oaConstraintParamDef *numCutsDef = oaConstraintParamDef::get(oacNumCutsConstraintParamType); oaConstraintParamDef *distDef = oaConstraintParamDef::get(oacDistanceConstraintParamType); oaValue *v = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->spacing(i))); oaIntValue *numCutsVal = oaIntValue::create(lefIn.tech(), lefLayer->spacingAdjacentCuts(i)); oaIntValue *distVal = oaIntValue::create(lefIn.tech(), lefIn.uuToDBU(lefLayer->spacingAdjacentWithin(i))); oaConstraintParamArray params(2); params.append(oaConstraintParam::create(numCutsDef, numCutsVal)); params.append(oaConstraintParam::create(distDef, distVal)); lefIn.setConstraint(lefIn.getFoundryRules(),
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -