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

📄 oadefoutndr.cpp

📁 openaccess读def,lef文件所用的源代码
💻 CPP
字号:
// *****************************************************************************// *****************************************************************************// DefOutNDR.cpp//// This file contains the member functions for the DefOutNDR 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.13 $//  $Date: 2005/04/27 09:47:08 $//  $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaLefDef.h"BEGIN_LEFDEF_NAMESPACE// *****************************************************************************// DefOutNDR::DefOutNDR()// DefOutNDR::~DefOutNDR()//// This is the default constructor for the DefOutNDR class// *****************************************************************************DefOutNDR::DefOutNDR(DefOut &translator):   defOut(translator){    translator.defOutNDR = this;}DefOutNDR::~DefOutNDR(){}// *****************************************************************************// DefOutNDR::write()//// This function outputs the information about this non-default-rule, syntax:// VIA viaStatement ...// [SPACING spacingStatement] *skipped*// [PROPERTY propName propValue ... ;] ... //// *****************************************************************************voidDefOutNDR::write(oaConstraintGroup	*ndrIn){    ndr = ndrIn;    oaString name;    ndr->getName(name);    defOut.output("- %s", (const char *) name);    defOut.incIndent();    writeLayers();    writeVias();    if (defOut.getOptions()->getVersion() > cLefDefVersion55) {	writeMinCuts();    }    defOut.writeProperties(ndr, cLefDefNonDefaultRule);    defOut.outNoIndent(" ;\n");    defOut.decIndent();}// *****************************************************************************// DefOutNDR::writeLayers()// DefOutNDR::writeLayer()//// LAYER layerName//         WIDTH width ;//         SPACING minSpacing ; //         [WIREEXTENSION value ;]//         [RESISTANCE RPERSQ value ;] *skipped*//         [CAPACITANCE CPERSQDIST value ;] *skipped*//         [EDGECAPACITANCE value ;] *skipped*// END layerName...// *****************************************************************************voidDefOutNDR::writeLayers(){    oaValue	*v = defOut.getConstraint(ndr, oacValidRoutingLayers);    if (v && v->getType() == oacLayerArrayValueType) {	oaLayerArray    layerArray;	((oaLayerArrayValue*) v)->get(layerArray);	for (oaUInt4 i = 0; i < layerArray.getNumElements(); i++) {	    writeLayer(layerArray[i]);	}    }}voidDefOutNDR::writeLayer(oaLayerNum layerNum){    oaPhysicalLayer *layer = defOut.getLayer(layerNum);    oaString layerName;    layer->getName(layerName);    defOut.outNoIndent("\n");    defOut.output("+ LAYER %s", (const char *) layerName);    defOut.incIndent();    writeLayerWidth(layerNum);    writeLayerDiagWidth(layerNum);    writeLayerSpacing(layerNum);    writeLayerExt(layerNum);    defOut.decIndent();}// *****************************************************************************// DefOutNDR::writeLayerWidth()//// WIDTH width ;// *****************************************************************************voidDefOutNDR::writeLayerWidth(oaLayerNum    layerNum){    oaValue	*v = defOut.getConstraint(ndr, oacMinWidth, layerNum);    if (v && v->getType() == oacIntValueType) {	defOut.outNoIndent("\n");	defOut.output("WIDTH %d", ((oaIntValue*) v)->get());    }}// *****************************************************************************// DefOutNDR::writeLayerDiagWidth()//// DIAGWIDTH width ;// *****************************************************************************voidDefOutNDR::writeLayerDiagWidth(oaLayerNum    layerNum){    oaValue	*v = defOut.getConstraint(ndr, oacMinDiagonalWidth, layerNum);    if (v && v->getType() == oacIntValueType) {	defOut.outNoIndent("\n");	defOut.output("DIAGWIDTH %d", ((oaIntValue*) v)->get());    }}// *****************************************************************************// DefOutNDR::writeLayerSpacing()//// This function writes out the layer spacing attribute. Note that this can be// a soft or a hard constraint.//// SPACING spacing ;// *****************************************************************************voidDefOutNDR::writeLayerSpacing(oaLayerNum  layerNum){   oaValue  *v = defOut.getConstraint(ndr, oacMinSpacing, layerNum,				      NULL, false, false);   if (!v) {       v = defOut.getConstraint(ndr, oacMinSpacing, layerNum);   }    if (v && v->getType() == oacIntValueType) {	defOut.outNoIndent("\n");	defOut.output("SPACING %d", ((oaIntValue*) v)->get());    }}// *****************************************************************************// DefOutNDR::writeLayerExt()//// WIREEXTENSION ext ;// *****************************************************************************voidDefOutNDR::writeLayerExt(oaLayerNum	layerNum){    oaUInt4 ext = defOut.getLayerExt(ndr, layerNum);    oaUInt4 width = defOut.getLayerWidth(ndr, layerNum);    if (ext != width / 2) {	defOut.outNoIndent("\n");	defOut.output("WIREEXT %d", ext);    }}// *****************************************************************************// DefOutNDR::writeVias()// DefOutNDR::writeVia()// DefOutNDR::writeUseVia()// DefOutNDR::writeUseViaRule()//// VIA viaName //          [DEFAULT] //          [TOPOFSTACKONLY]//          [FOREIGN foreignCellName [pt [orient]];]//          [RESISTANCE value ;]//          {LAYER layerName ; //                 {RECT pt pt ;} ...} ... //          [PROPERTY propName propVal ;] ... //      END viaName // *****************************************************************************voidDefOutNDR::writeVias(){    oaValue	*v = defOut.getConstraint(ndr, oacValidRoutingVias);    if (v && v->getType() == oacViaDefArrayValueType) {	oaViaDefArray   viaArray;	((oaViaDefArrayValue*) v)->get(viaArray);	for (oaUInt4 i = 0; i < viaArray.getNumElements(); i++) {	    if (viaArray[i]->getType() == oacCustomViaDefType) {		writeUseVia((oaCustomViaDef*) viaArray[i]);	    } else {		writeUseViaRule((oaStdViaDef*) viaArray[i]);	    }   	}    }}voidDefOutNDR::writeUseVia(oaCustomViaDef    *viaDef){    oaString	name;    viaDef->getName(name);    defOut.outNoIndent("\n");    defOut.output("+ VIA %s", (const char*) name);}voidDefOutNDR::writeUseViaRule(oaStdViaDef   *viaDef){    oaString	name;    viaDef->getName(name);    defOut.outNoIndent("\n");    defOut.output("+ VIARULE %s", (const char*) name);}// *****************************************************************************// DefOutNDR::writeMinCuts()// DefOutNDR::writeMinCut()//// MINCUTS <layerName> <numCuts> ;// *****************************************************************************voidDefOutNDR::writeMinCuts(){    oaIter<oaLayer> layerIt(defOut.tech()->getLayers());    while (oaLayer *layer = layerIt.getNext()) {	if (layer->getType() == oacPhysicalLayerType	    && ((oaPhysicalLayer*) layer)->getMaterial() == oacCutMaterial) {	    writeMinCut(layer);	}    }}voidDefOutNDR::writeMinCut(oaLayer   *layer){    oaValue	*v = defOut.getConstraint(ndr, oacMinNumCut,					  layer->getNumber(), NULL, false);    if (v && v->getType() == oacInt1DTblValueType) {	oa1DLookupTbl<oaInt4, oaInt4>	table(1, "minNumCut", 1);		((oaInt1DTblValue*) v)->get(table);	if (table.getNumItems()) {	    oaString	layerName;	    layer->getName(layerName);	    defOut.outNoIndent("\n");	    defOut.output("+ MINCUTS %s %d", (const char*) layerName,			  table.getValue(0));	}    }}END_LEFDEF_NAMESPACE

⌨️ 快捷键说明

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