📄 oalefoutlayer.cpp
字号:
step = lefOut.dbuToUU(table.getHeader(0)); } value = lefOut.getConstraint(lefOut.getFoundryRules(), oacMaxDensity, layer->getNumber()); if (value && value->getType() == oacIntFltTblValueType) { oa1DLookupTbl<oaInt4, oaFloat> table; ((oaIntFltTblValue*)value)->get(table); lefOut.output("MAXIMUMDENSITY %g ;\n", table.getValue(0)); if (step == 0.) { step = lefOut.dbuToUU(table.getHeader(0)); } } if (step > 0.) { lefOut.output("DENSITYCHECKWINDOW %.11g %.11g ;\n", step*2, step*2); lefOut.output("DENSITYCHECKSTEP %.11g ;\n", step); }}// *****************************************************************************// LefOutLayer::writeFill()// // This function outputs the filling value for this layer, syntax:// [FILLACTIVESPACING spacing ;]// *****************************************************************************voidLefOutLayer::writeFill(){ oaValue *value = lefOut.getConstraint(lefOut.getFoundryRules(), oacMinFillPatternSpacing, layer->getNumber()); if (value && value->getType() == oacIntValueType) { lefOut.output("FILLACTIVESPACING %.11g ;\n", lefOut.dbuToUU(((oaIntValue *) value)->get())); }}// *****************************************************************************// LefOutLayer::writeAntenna()// // This function outputs the antenna values for this layer// *****************************************************************************voidLefOutLayer::writeAntenna(){ oaSimpleConstraintType type = layer->getMaterial() == oacMetalMaterial ? oacCumMetalAntenna : oacCumViaAntenna; oaValue *cumArrayValue = lefOut.getConstraint(lefOut.getFoundryRules(), type); oaValue *arrayValue = lefOut.getConstraint(lefOut.getFoundryRules(), oacAntenna, layer->getNumber()); oaValue *cumValue = NULL; oaValue *value = NULL; if (cumArrayValue && cumArrayValue->getType() == oacAntennaRatioArrayValueType) { cumValue = ((oaAntennaRatioArrayValue*) cumArrayValue)->get(oacDefaultAntennaModel); } if (arrayValue && arrayValue->getType() == oacAntennaRatioArrayValueType) { value = ((oaAntennaRatioArrayValue*) arrayValue)->get(oacDefaultAntennaModel); } if (value || cumValue) { if (lefOut.getOptions()->getVersion() >= cLefDefVersion55) { lefOut.output("ANTENNAMODEL OXIDE1 ;\n"); lefOut.incIndent(); } if (value && value->getType() == oacAntennaRatioValueType) { writeAntennaModel((oaAntennaRatioValue*) value); } if (cumValue && cumValue->getType() == oacAntennaRatioValueType) { writeAntennaCumulative((oaAntennaRatioValue*) cumValue); } if (lefOut.getOptions()->getVersion() >= cLefDefVersion55) { lefOut.decIndent(); } } if (lefOut.getOptions()->getVersion() < cLefDefVersion55) { return; } if (cumArrayValue && cumArrayValue->getType() == oacAntennaRatioArrayValueType) { cumValue = ((oaAntennaRatioArrayValue*) cumArrayValue)->get(oacSecondAntennaModel); } if (arrayValue && arrayValue->getType() == oacAntennaRatioArrayValueType) { value = ((oaAntennaRatioArrayValue*) arrayValue)->get(oacSecondAntennaModel); } if (value || cumValue) { lefOut.output("ANTENNAMODEL OXIDE2 ;\n"); lefOut.incIndent(); if (value && value->getType() == oacAntennaRatioValueType) { writeAntennaModel((oaAntennaRatioValue*) value); } if (cumValue && cumValue->getType() == oacAntennaRatioValueType) { writeAntennaCumulative((oaAntennaRatioValue*) cumValue); } lefOut.decIndent(); } if (cumArrayValue && cumArrayValue->getType() == oacAntennaRatioArrayValueType) { cumValue = ((oaAntennaRatioArrayValue*) cumArrayValue)->get(oacThirdAntennaModel); } if (arrayValue && arrayValue->getType() == oacAntennaRatioArrayValueType) { value = ((oaAntennaRatioArrayValue*) arrayValue)->get(oacThirdAntennaModel); } if (value || cumValue) { lefOut.output("ANTENNAMODEL OXIDE3 ;\n"); lefOut.incIndent(); if (value && value->getType() == oacAntennaRatioValueType) { writeAntennaModel((oaAntennaRatioValue*) value); } if (cumValue && cumValue->getType() == oacAntennaRatioValueType) { writeAntennaCumulative((oaAntennaRatioValue*) cumValue); } lefOut.decIndent(); } if (cumArrayValue && cumArrayValue->getType() == oacAntennaRatioArrayValueType) { cumValue = ((oaAntennaRatioArrayValue*) cumArrayValue)->get(oacFourthAntennaModel); } if (arrayValue && arrayValue->getType() == oacAntennaRatioArrayValueType) { value = ((oaAntennaRatioArrayValue*) arrayValue)->get(oacFourthAntennaModel); } if (value || cumValue) { lefOut.output("ANTENNAMODEL OXIDE4 ;\n"); lefOut.incIndent(); if (value && value->getType() == oacAntennaRatioValueType) { writeAntennaModel((oaAntennaRatioValue*) value); } if (cumValue && cumValue->getType() == oacAntennaRatioValueType) { writeAntennaCumulative((oaAntennaRatioValue*) cumValue); } lefOut.decIndent(); }}// *****************************************************************************// LefOutLayer::writeAntennaModel()// // This function outputs the antenna values for this layer, syntax:// [ANTENNAAREARATIO value ;]// [ANTENNADIFFAREARATIO {value | PWL ( ( d1 r1 ) ( d2 r2 ) ...) } ;]//// If the layer-type is ROUTING, also write:// [ANTENNASIDEAREARATIO value ;]// [ANTENNADIFFSIDEAREARATIO {value | PWL ( ( d1 r1 ) ( d2 r2 ) ...) } ;]// *****************************************************************************voidLefOutLayer::writeAntennaModel(oaAntennaRatioValue *value){ if (value->getGate() > 0.) { if (value->isSide()) { lefOut.output("ANTENNASIDEAREARATIO %g ;\n", value->getGate()); } else { lefOut.output("ANTENNAAREARATIO %g ;\n", value->getGate()); } } oa1DLookupTbl<oaInt8, oaFloat> table; value->getDiode(table); if (table.getNumItems() > 1) { if (value->isSide()) { lefOut.output("ANTENNADIFFSIDEAREARATIO PWL ("); } else { lefOut.output("ANTENNADIFFAREARATIO PWL ("); } for (oaUInt4 i = 0; i < table.getNumItems(); i++) { lefOut.outNoIndent(" ( %.11g %g )", lefOut.dbuToUUArea(table.getHeader(i)), table.getValue(i)); } lefOut.outNoIndent(" ) ;\n"); } else if (table.getNumItems() == 1) { if (value->isSide()) { lefOut.output("ANTENNADIFFSIDEAREARATIO %g ;\n", table.getValue(0)); } else { lefOut.output("ANTENNADIFFAREARATIO %g ;\n", table.getValue(0)); } }}// *****************************************************************************// LefOutLayer::writeAntennaCumulative()// // This function outputs the cumulative antenna values for this layer, syntax:// [ANTENNACUMAREARATIO value ;]// [ANTENNACUMDIFFAREARATIO {value | PWL ( ( d1 r1 ) ( d2 r2 ) ...) } ;]//// If the layer-type is ROUTING, also write:// [ANTENNACUMSIDEAREARATIO value ;]// [ANTENNACUMDIFFSIDEAREARATIO {value | PWL ( ( d1 r1 ) ( d2 r2 ) ...)};]// *****************************************************************************voidLefOutLayer::writeAntennaCumulative(oaAntennaRatioValue *ratios){ if (ratios->getGate() > 0.) { if (ratios->isSide()) { lefOut.output("ANTENNACUMSIDEAREARATIO %g ;\n", ratios->getGate()); } else { lefOut.output("ANTENNACUMAREARATIO %g ;\n", ratios->getGate()); } } oa1DLookupTbl<oaInt8, oaFloat> table; ratios->getDiode(table); if (table.getNumItems() > 1) { // table if (ratios->isSide()) { lefOut.output("ANTENNACUMDIFFSIDEAREARATIO PWL ("); } else { lefOut.output("ANTENNACUMDIFFAREARATIO PWL ("); } for (oaUInt4 i = 0; i < table.getNumItems(); i++) { lefOut.outNoIndent(" ( %.11g %g )", lefOut.dbuToUUArea(table.getHeader(i)), table.getValue(i)); } lefOut.outNoIndent(" ) ;\n"); } else if (table.getNumItems() == 1) { if (ratios->isSide()) { lefOut.output("ANTENNACUMDIFFSIDEAREARATIO %g ;\n", table.getValue(0)); } else { lefOut.output("ANTENNACUMDIFFAREARATIO %g ;\n", table.getValue(0)); } }} // *****************************************************************************// LefOutLayer::writeACCurDen()// LefOutLayer::writeDCCurDen()// LefOutLayer::writeCurDen()// // These functions output the current density values for this layer, syntax:// [ACCURRENTDENSITY {PEAK | AVERAGE | RMS}// {value | FREQUENCY freq_1 freq_2 ... ;// [WIDTH width_1 width_2 ... ; ]// TABLEENTRIES// v_freq_1_width_1 v_freq_1_width_2 ... // v_freq_2_width_1 v_freq_2_width_2 ... // ...} ;]// [DCCURRENTDENSITY AVERAGE// {value | WIDTH width_1 width_2 ... ;// TABLEENTRIES value_1 value_2 ...} ;] // *****************************************************************************voidLefOutLayer::writeACCurDen(){ oaValue *value; if (value = layer->getPeakACCurrentDensity()) { lefOut.output("ACCURRENTDENSITY PEAK"); lefOut.incIndent(); writeCurDen(value); lefOut.decIndent(); } if (value = layer->getAvgACCurrentDensity()) { lefOut.output("ACCURRENTDENSITY AVERAGE"); lefOut.incIndent(); writeCurDen(value); lefOut.decIndent(); } if (value = layer->getRmsACCurrentDensity()) { lefOut.output("ACCURRENTDENSITY RMS"); lefOut.incIndent(); writeCurDen(value); lefOut.decIndent(); }}voidLefOutLayer::writeDCCurDen(){ oaValue *value; if (value = layer->getAvgDCCurrentDensity()) { lefOut.output("DCCURRENTDENSITY AVERAGE"); lefOut.incIndent(); writeCurDen(value, false); lefOut.decIndent(); }}voidLefOutLayer::writeCurDen(oaValue *value, oaBoolean ac){ oaString header("WIDTH"); if (layer->getMaterial() == oacCutMaterial) { header = "CUTAREA"; } switch (value->getType()) { case oacFltValueType: lefOut.outNoIndent(" %g ;\n", ((oaFltValue *)value)->get()); break; case oacFltIntFltTblValueType: if (ac) { oa2DLookupTbl<oaFloat, oaInt4, oaFloat> table; oaUInt4 f; ((oaFltIntFltTblValue *) value)->get(table); lefOut.outNoIndent("\n"); lefOut.output("FREQUENCY"); for (f = 0; f < table.getNumRows(); f++) { lefOut.outNoIndent(" %g", table.getRowHeader(f)); } lefOut.outNoIndent(" ;\n"); lefOut.output("%s", (const char *) header); for (oaUInt4 w = 0; w <table.getNumCols(); w++) { lefOut.outNoIndent(" %g", lefOut.dbuToUU(table.getColHeader(w))); } lefOut.outNoIndent(" ;\n"); lefOut.output("TABLEENTRIES\n"); lefOut.incIndent(); for (f = 0; f < table.getNumRows(); f++) { lefOut.output(""); for (oaUInt4 w = 0; w <table.getNumCols(); w++) { lefOut.outNoIndent(" %g", table.getValue(f, w)); } if (f < table.getNumRows() - 1) { lefOut.outNoIndent("\n"); } } lefOut.outNoIndent(" ;\n"); lefOut.decIndent(); } break; case oacFlt1DTblValueType: { oa1DLookupTbl<oaFloat, oaFloat> table; oaUInt4 f; ((oaFlt1DTblValue *) value)->get(table); lefOut.outNoIndent("\n"); lefOut.output("FREQUENCY"); for (f = 0; f < table.getNumItems(); f++) { lefOut.outNoIndent(" %g", table.getHeader(f)); } lefOut.outNoIndent(" ;\n"); lefOut.output("TABLEENTRIES"); for (f = 0; f < table.getNumItems(); f++) { lefOut.outNoIndent(" %g", table.getValue(f)); } lefOut.outNoIndent(" ;\n"); } break; case oacIntFltTblValueType: { oa1DLookupTbl<oaInt4, oaFloat> table; ((oaIntFltTblValue *) value)->get(table); lefOut.outNoIndent("\n"); lefOut.output("%s", (const char *) header); oaUInt4 f; for (f = 0; f < table.getNumItems(); f++) { lefOut.outNoIndent(" %g", lefOut.dbuToUU(table.getHeader(f))); } lefOut.outNoIndent(" ;\n"); lefOut.output("TABLEENTRIES"); for (f = 0; f < table.getNumItems(); f++) { lefOut.outNoIndent(" %g", table.getValue(f)); } lefOut.outNoIndent(" ;\n"); } break; }}END_LEFDEF_NAMESPACE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -