⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 oalefoutlayer.cpp

📁 openaccess读def,lef文件所用的源代码
💻 CPP
📖 第 1 页 / 共 5 页
字号:
// *****************************************************************************// LefOutLayer::writeMinCut()// // This function outputs the minumum cut values for this layer, syntax:// [MINIMUMCUT numCuts WIDTH minWidth [FROMBELOW|FROMABOVE] ;]//// Minimum cut values in OA are stored on the cut layers, so// we have to search the cutLayers below and above.//// For pre-LEF 5.5 versions, only the first value of the mincut for the// cut layer below is output.// *****************************************************************************voidLefOutLayer::writeMinCut(){    oaValue *valueBelow = NULL;    oaLayer *layerBelow = layer->getLayerBelow(oacCutMaterial);    if (layerBelow) {	valueBelow = lefOut.getConstraint(lefOut.getFoundryRules(), oacMinNumCut, 					  layerBelow->getNumber());    }       oaValue *valueAbove = NULL;    oaLayer *layerAbove = layer->getLayerAbove(oacCutMaterial);    if (layerAbove) {        valueAbove = lefOut.getConstraint(lefOut.getFoundryRules(), oacMinNumCut, 					  layerAbove->getNumber());    }    if (valueBelow && valueBelow->getType() == oacInt1DTblValueType) {        oa1DLookupTbl<oaInt4, oaInt4> tableBelow;        ((oaInt1DTblValue *) valueBelow)->get(tableBelow);        for (oaUInt4 i(0); i < tableBelow.getNumItems(); i++) {            lefOut.output("MINIMUMCUT %d WIDTH %.11g",			  tableBelow.getValue(i),			  lefOut.dbuToUU(tableBelow.getHeader(i)));            if (lefOut.getOptions()->getVersion() < cLefDefVersion55) {                lefOut.outNoIndent(" ;\n");                return;            }            oaInt4 valAbove(0);            if (valueAbove && valueAbove->getType() == oacInt1DTblValueType) {                oa1DLookupTbl<oaInt4, oaInt4> tableAbove;                ((oaInt1DTblValue *) valueAbove)->get(tableAbove);		for (oaUInt4 j = 0; j < tableAbove.getNumItems(); j++) {		    if (tableAbove.getHeader(j) == tableBelow.getHeader(i)) {			valAbove = tableAbove.getValue(i);		    }		}            }            if (valAbove != tableBelow.getValue(i)) {                lefOut.outNoIndent(" FROMBELOW");            }                        lefOut.outNoIndent(" ;\n");	}    }    if (lefOut.getOptions()->getVersion() < cLefDefVersion55) {        return;    }        if(valueAbove && valueAbove->getType() == oacInt1DTblValueType) {        oa1DLookupTbl<oaInt4, oaInt4> tableAbove;        ((oaInt1DTblValue *) valueAbove)->get(tableAbove);        for (oaUInt4 i = 0; i < tableAbove.getNumItems(); i++) {            oaInt4 valBelow = 0;            if (valueBelow) {                oa1DLookupTbl<oaInt4, oaInt4> tableBelow;                ((oaInt1DTblValue *) valueBelow)->get(tableBelow);		for (oaUInt4 j = 0; j < tableBelow.getNumItems(); j++) {		    if (tableBelow.getHeader(j) == tableAbove.getHeader(i)) {			valBelow = tableBelow.getValue(i);		    }		}            }                        if (valBelow != tableAbove.getValue(i)) {                lefOut.output("MINIMUMCUT %d WIDTH %.11g FROMABOVE ;\n",                              tableAbove.getValue(i),                              lefOut.dbuToUU(tableAbove.getHeader(i)));            }	}    }}// *****************************************************************************// LefOutLayer::writeMinProtrusionCut()// // This function outputs the minumum cut values for this layer, syntax:// [MINIMUMCUT numCuts WIDTH minWidth LENGTH length WITHIN distance ;]// From LEF 5.5 Only.// *****************************************************************************voidLefOutLayer::writeMinProtrusionCut(){    if (lefOut.getOptions()->getVersion() < cLefDefVersion55) {        return;    }    oaLayerConstraintDef *def	= oaLayerConstraintDef::get(oacMinProtrusionNumCut);    oaConstraintParamDef *distDef	= oaConstraintParamDef::get(oacDistanceConstraintParamType);    oaConstraintParamDef    *lengthDef	= oaConstraintParamDef::get(oacLengthConstraintParamType);    oaConstraintParamDef    *widthDef	= oaConstraintParamDef::get(oacWidthConstraintParamType);	    oaLayer	*layerBelow = layer->getLayerBelow(oacCutMaterial);    oaUInt4	below = 0;    oaUInt4	distBelow = 0;    oaUInt4	lengthBelow = 0;    oaUInt4	widthBelow = 0;    if (layerBelow) {	oaConstraint    *c = oaLayerConstraint::find(lefOut.getFoundryRules(), 						     layerBelow->getNumber(),						     def);	if (c) {	    oaConstraintParamArray params;	    c->getParams(params);	    oaConstraintParam   *distParam = params.findParam(distDef);	    oaConstraintParam   *lengthParam = params.findParam(lengthDef);	    oaConstraintParam   *widthParam = params.findParam(widthDef);	    if (!distParam || !lengthParam || !widthParam) {		return;	    }	    oaValue *valueBelow = c->getValue();	    oaValue *distValueBelow = distParam->getValue();	    oaValue *lengthValueBelow = lengthParam->getValue();	    oaValue *widthValueBelow = widthParam->getValue();	    if ((!valueBelow || valueBelow->getType() != oacIntValueType)		|| (!distValueBelow || distValueBelow->getType() != oacIntValueType)		|| (!lengthValueBelow || lengthValueBelow->getType() != oacIntValueType)		|| (!widthValueBelow || widthValueBelow->getType() != oacIntValueType)) {		return;	    }		    below = ((oaIntValue*) valueBelow)->get();	    distBelow = ((oaIntValue*) distValueBelow)->get();	    lengthBelow = ((oaIntValue*) lengthValueBelow)->get();	    widthBelow = ((oaIntValue*) widthValueBelow)->get();	}    }        oaLayer	*layerAbove = layer->getLayerAbove(oacCutMaterial);    oaUInt4	above = 0;    oaUInt4	distAbove = 0;    oaUInt4	lengthAbove = 0;    oaUInt4	widthAbove = 0;    if (layerAbove) {	oaConstraint    *c = oaLayerConstraint::find(lefOut.getFoundryRules(), 						     layerAbove->getNumber(),						     def);	if (c) {	    oaConstraintParamArray params;	    c->getParams(params);	    oaConstraintParam   *distParam = params.findParam(distDef);	    oaConstraintParam   *lengthParam = params.findParam(lengthDef);	    oaConstraintParam   *widthParam = params.findParam(widthDef);	    if (!distParam || !lengthParam || !widthParam) {		return;	    }	    oaValue *valueAbove = c->getValue();	    oaValue *distValueAbove = distParam->getValue();	    oaValue *lengthValueAbove = lengthParam->getValue();	    oaValue *widthValueAbove = widthParam->getValue();	    if ((!valueAbove || valueAbove->getType() != oacIntValueType)		|| (!distValueAbove || distValueAbove->getType() != oacIntValueType)		|| (!lengthValueAbove || lengthValueAbove->getType() != oacIntValueType)		|| (!widthValueAbove || widthValueAbove->getType() != oacIntValueType)) {		return;	    }		    above = ((oaIntValue*) valueAbove)->get();	    distAbove = ((oaIntValue*) distValueAbove)->get();	    lengthAbove = ((oaIntValue*) lengthValueAbove)->get();	    widthAbove = ((oaIntValue*) widthValueAbove)->get();	}    }           if (below != 0) {        lefOut.output("MINIMUMCUT %d WIDTH %.11g", below, lefOut.dbuToUU(widthBelow));        if (above == 0 || widthBelow != widthAbove	    || lengthBelow != lengthAbove || distBelow != distAbove) {            lefOut.outNoIndent(" FROMBELOW");        }                lefOut.outNoIndent(" LENGTH %.11g WITHIN %.11g ;\n",			   lefOut.dbuToUU(lengthBelow), lefOut.dbuToUU(distBelow));    }        if (above != 0) {        if (below != 0 || (widthBelow == widthAbove	    && lengthBelow == lengthAbove && distBelow == distAbove)) {            return;        }                    lefOut.output("MINIMUMCUT %d WIDTH %.11g FROMABOVE"                      " LENGTH %.11g WITHIN %.11g ;\n",                      above, lefOut.dbuToUU(widthAbove),		      lefOut.dbuToUU(lengthAbove),		      lefOut.dbuToUU(distAbove));    }}// *****************************************************************************// LefOutLayer::writeCutRes()// // This function outputs the resistance per cut value for this layer, syntax:// [RESISTANCE value ;]// *****************************************************************************voidLefOutLayer::writeCutRes(){    oaProp *prop = oaProp::find(layer, cLefLayerRes);    if (prop && prop->getType() == oacFloatPropType) {	oaFloat value = ((oaFloatProp *) prop)->getValue();	if (value != 0.0) {	    lefOut.output("RESISTANCE %g ;\n", value);	}    }}// *****************************************************************************// LefOutLayer::writeRes()// // This function outputs the resistance value for this layer, syntax:// [RESISTANCE RPERSQ value ;]// *****************************************************************************voidLefOutLayer::writeRes(){    oaProp *prop = oaProp::find(layer, cLefLayerRes);    if (prop && prop->getType() == oacFloatPropType) {	oaFloat value = ((oaFloatProp *) prop)->getValue();	if (value != 0.0) {	    lefOut.output("RESISTANCE RPERSQ %g ;\n", value);	}    }}// *****************************************************************************// LefOutLayer::writeCap()// // This function outputs the capacitance value for this layer, syntax:// [CAPACITANCE CPERSQDIST value ;]// *****************************************************************************voidLefOutLayer::writeCap(){    oaProp *prop = oaProp::find(layer, cLefLayerCap);    if (prop && prop->getType() == oacFloatPropType) {	oaFloat	value = ((oaFloatProp *) prop)->getValue();		if (value != 0.0) {	    lefOut.output("CAPACITANCE CPERSQDIST %g ;\n", value);	}    }}// *****************************************************************************// LefOutLayer::writeHeight()// // This function outputs the height for this layer, syntax:// [HEIGHT distance ;]// *****************************************************************************voidLefOutLayer::writeHeight(){    oaProp *prop = oaProp::find(layer, cLefLayerHeight);    if (prop && prop->getType() == oacIntPropType) {	oaInt4	value = ((oaIntProp *) prop)->getValue();	if (value) {	    lefOut.output("HEIGHT %g ;\n", lefOut.dbuToUU(value));	}    }}// *****************************************************************************// LefOutLayer::writeThickness()// // This function outputs the thickness for this layer, syntax:// [THICKNESS distance ;]// *****************************************************************************voidLefOutLayer::writeThickness(){    oaProp *prop = oaProp::find(layer, cLefLayerThickness);    if (prop && prop->getType() == oacIntPropType) {	oaInt4	value = ((oaIntProp *) prop)->getValue();	if (value) {	    lefOut.output("THICKNESS %g ;\n", lefOut.dbuToUU(value));	}    }}// *****************************************************************************// LefOutLayer::writeShrinkage()// // This function outputs the shrinkage for this layer, syntax:// [SHRINKAGE distance ;]// *****************************************************************************voidLefOutLayer::writeShrinkage(){    oaProp *prop = oaProp::find(layer, cLefLayerShrinkage);    if (prop && prop->getType() == oacIntPropType) {	 oaInt4	value = ((oaIntProp *) prop)->getValue();	if (value) {	    lefOut.output("SHRINKAGE %g ;\n", lefOut.dbuToUU(value));	}    }}// *****************************************************************************// LefOutLayer::writeCapMul()// // This function outputs the capacitance multiplier value for this layer,// syntax:// [CAPMULTIPLIER value ;]// *****************************************************************************voidLefOutLayer::writeCapMul(){    oaProp *prop = oaProp::find(layer, cLefLayerCapMul);    if (prop && prop->getType() == oacIntPropType) {	oaInt4	value = ((oaIntProp *) prop)->getValue();	if (value) {	    lefOut.output("CAPMULTIPLIER %d ;\n", value);	}    }}// *****************************************************************************// LefOutLayer::writeEdgeCap()// // This function outputs the edge capacitance value for this layer, syntax:// [EDGECAPACITANCE value ;]// *****************************************************************************voidLefOutLayer::writeEdgeCap(){    oaProp *prop = oaProp::find(layer, cLefLayerEdgeCap);    if (prop && prop->getType() == oacFloatPropType) {	oaFloat	value = ((oaFloatProp *) prop)->getValue();	if (value != 0.0) {	    lefOut.output("EDGECAPACITANCE %g ;\n", value);	}    }}// *****************************************************************************// LefOutLayer::writeDensity()// // This function outputs the density values for this layer, syntax:// [MINIMUMDENSITY minDensity ;] // [MAXIMUMDENSITY maxDensity ;] // [DENSITYCHECKWINDOW windowLength windowWidth ;] // [DENSITYCHECKSTEP stepValue ;] // *****************************************************************************voidLefOutLayer::writeDensity(){    oaDouble step = 0.;    oaValue *value = lefOut.getConstraint(lefOut.getFoundryRules(),					  oacMinDensity,					  layer->getNumber());    if (value && value->getType() == oacIntFltTblValueType) {	oa1DLookupTbl<oaInt4, oaFloat> table;	((oaIntFltTblValue*)value)->get(table);	lefOut.output("MINIMUMDENSITY %g ;\n", table.getValue(0));

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -