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

📄 oalefout.cpp

📁 openaccess读def,lef文件所用的源代码
💻 CPP
📖 第 1 页 / 共 3 页
字号:
// This function outputs the property definitions section, syntax:// [ PROPERTYDEFINITIONS //   objectType propName propType [RANGE min max] [value | "stringValue"] ; ... //   END PROPERTYDEFINITIONS ]//// Note: the property definitions list was constructed during database traversal// in LefOut::initPropDefs()// *****************************************************************************voidLefOut::writePropDef(){    writePropDefs();}// *****************************************************************************// LefOut::writeAntennaSize()//// Waiting for an implementation in the DB, syntax:// [ ANTENNASIZE statement ]// *****************************************************************************voidLefOut::writeAntennaSize(){    if (getLegacyProp()) {	oaDouble area;	oaProp	 *prop = oaProp::find(getLegacyProp(), cLefAntennaInputGateArea);	if (prop && prop->getType() == oacDoublePropType) {	    area = ((oaDoubleProp*) prop)->getValue();	    if (area  > 0.0) {		output("ANTENNAINPUTGATEAREA %.11g ;\n", area);	    }	}	prop = oaProp::find(getLegacyProp(), cLefAntennaOutputDiffArea);	if (prop && prop->getType() == oacDoublePropType) {	    area = ((oaDoubleProp*) prop)->getValue();	    if (area  > 0.0) {		output("ANTENNAOUTPUTDIFFAREA %.11g ;\n", area);	    }	}		prop = oaProp::find(getLegacyProp(), cLefAntennaInOutDiffArea);	if (prop && prop->getType() == oacDoublePropType) {	    area = ((oaDoubleProp*) prop)->getValue();	    if (area  > 0.0) {		output("ANTENNAINOUTDIFFAREA %.11g ;\n", area);	    }	}    }}// *****************************************************************************// LefOut::writeLayers()//// This function outputs all layer definitions found in the tech db// They are written out in the order specified by the maskNumber.// *****************************************************************************voidLefOut::writeLayers(){    oaUInt4	    maxMaskNumber = 0;    oaLayer         *layer;    oaIter<oaLayer> layerIt(tech()->getLayers());    while (layer = layerIt.getNext()) {	if (layer->getType() == oacPhysicalLayerType	    && ((oaPhysicalLayer*) layer)->getMaskNumber() != oacUnsetMaskNumber	    && ((oaPhysicalLayer*) layer)->getMaskNumber() > maxMaskNumber) {	    maxMaskNumber = ((oaPhysicalLayer*) layer)->getMaskNumber();	}    }    layerIt.reset();    while (layer = layerIt.getNext()) {	if (layer->getType() == oacPhysicalLayerType	    && ((oaPhysicalLayer*) layer)->getMaskNumber() == oacUnsetMaskNumber) {	    writeLayer((oaPhysicalLayer*) layer);	}    }        for (oaUInt4 i = 0 ; i <= maxMaskNumber; i++) {	layerIt.reset();	while (layer = layerIt.getNext()) {	    if (layer->getType() == oacPhysicalLayerType		&& ((oaPhysicalLayer*) layer)->getMaskNumber() == i) {		writeLayer((oaPhysicalLayer *) layer);	    }	}    }        writeOverlapLayer();}// *****************************************************************************// LefOut::writeLayer()//// This function outputs the layer definition for the specified layer.// *****************************************************************************voidLefOut::writeLayer(oaPhysicalLayer *layer){    getLefOutLayer()->write(layer);}// *****************************************************************************// LefOut::writeMaxViaStack()//// This function outputs the maximum via stack value for this technology// LEF 5.5 Only.// *****************************************************************************voidLefOut::writeMaxViaStack(){    oaConstraintParamArray  params;    oaValue *v = getConstraint(getFoundryRules(), oacViaStackLimit, &params);        if (v && v->getType() == oacIntValueType) {	output("MAXVIASTACK %d", ((oaIntValue*) v)->get());	oaConstraintParamDef	*defLower = oaConstraintParamDef::get(oacLowerLayerConstraintParamType);	oaConstraintParamDef	*defUpper = oaConstraintParamDef::get(oacUpperLayerConstraintParamType);	oaConstraintParam	*pLower = params.findParam(defLower);	oaConstraintParam	*pUpper = params.findParam(defUpper);	if (pLower && pUpper) {	    oaValue *vLower = pLower->getValue();	    oaValue *vUpper = pUpper->getValue();	    if (vLower && vLower->getType() == oacLayerValueType		&& vUpper && vUpper->getType() == oacLayerValueType) {		oaPhysicalLayer	*lLower = getLayer(((oaLayerValue*) vLower)->get());		oaPhysicalLayer	*lUpper = getLayer(((oaLayerValue*) vUpper)->get());		if (isValidLayer(lLower) && isValidLayer(lUpper)) {		    oaString    nLower;		    oaString    nUpper;		    lLower->getName(nLower);		    lUpper->getName(nUpper);		    outNoIndent(" RANGE %s %s",				(const char*) nLower, (const char*) nUpper);		}	    }	}	outNoIndent(" ;\n");    }}// *****************************************************************************// LefOut::writeOverlapLayer()//// This function outputs the layer definition for the OVERLAP layer.// This is always output.// *****************************************************************************voidLefOut::writeOverlapLayer(){    output("LAYER %s\n", (const char*) overlapName);    incIndent();    output("TYPE OVERLAP ;\n");    decIndent();    output("END %s\n\n", (const char*) overlapName);}// *****************************************************************************// LefOut::writeVias()//// This function outputs all via definitions found in the tech db.// *****************************************************************************voidLefOut::writeVias(){    oaIter<oaViaDef> viaDefIt(tech()->getViaDefs());    while (oaViaDef *viaDef = viaDefIt.getNext()) {	if (viaDef->getType() == oacCustomViaDefType) {	    writeVia((oaCustomViaDef*) viaDef);	}    }}// *****************************************************************************// LefOut::writeVia()//// This function outputs the via definition for the specified viaDef.// *****************************************************************************voidLefOut::writeVia(oaCustomViaDef   *viaDef){    if (getOptions()->getVersion() > cLefDefVersion55	|| !getLefOutVia()->isNonDefaultRuleVia(viaDef)) {	getLefOutVia()->write(viaDef);    }}// *****************************************************************************// LefOut::writeViaRules()//// This function outputs the viaRule constructs.// *****************************************************************************voidLefOut::writeViaRules(){    oaIter<oaViaDef> viaDefIt(tech()->getViaDefs());    while (oaViaDef *viaDef = viaDefIt.getNext()) {	writeViaRule((oaStdViaDef*) viaDef);    }}// *****************************************************************************// LefOut::writeViaRule()//// This function outputs the VIARULE or VIARULE GENERATE construct from the// specified viaSpec.// *****************************************************************************voidLefOut::writeViaRule(oaViaDef *viaDef){    getLefOutViaRule()->write(viaDef);}// *****************************************************************************// LefOut::writeSpacing()//// SPACING section// *****************************************************************************voidLefOut::writeSpacing(){    oaLayerConstraintDef	*def1 = oaLayerConstraintDef::get(oacMinSameNetSpacing);    oaLayerPairConstraintDef	*def2 = oaLayerPairConstraintDef::get(oacMinSameNetClearance);        oaCollection<oaConstraint, oaConstraintGroup>   c1Coll = getFoundryRules()->getConstraints(def1);    oaCollection<oaConstraint, oaConstraintGroup>   c2Coll = getFoundryRules()->getConstraints(def2);    if (!c1Coll.getCount() && !c2Coll.getCount()) {	return;    }    output("SPACING\n");    incIndent();        oaIter<oaConstraint>    c1Iter(c1Coll);    while (oaLayerConstraint *c = (oaLayerConstraint*) c1Iter.getNext()) {	oaValue *value = c->getValue();	if (value && value->getType() == oacIntValueType) {	    oaPhysicalLayer *layer = getLayer(c->getLayer());	    	    if (isValidLayer(layer)) {		oaString layerName;		layer->getName(layerName);		output("SAMENET %s %s %.11g ;\n", (const char *) layerName,		       (const char *) layerName,		       dbuToUU(((oaIntValue *)value)->get()));	    }	}    }        oaIter<oaConstraint>    c2Iter(c2Coll);    while (oaLayerPairConstraint *c = (oaLayerPairConstraint*) c2Iter.getNext()) {	oaValue *value = c->getValue();	if (value && value->getType() == oacIntValueType) {	    oaPhysicalLayer *layer1 = getLayer(c->getLayer1());	    oaPhysicalLayer *layer2 = getLayer(c->getLayer2());	    if (layer1->getMaterial() == oacCutMaterial		&& layer2->getMaterial() == oacCutMaterial) {		oaString layer1Name;		oaString layer2Name;		layer1->getName(layer1Name);		layer2->getName(layer2Name);		output("SAMENET %s %s %.11g ", (const char *) layer1Name,		    (const char *) layer2Name,		    dbuToUU(((oaIntValue *)value)->get()));		value = getConstraint(getFoundryRules(), oacViaStackingAllowed,				      c->getLayer1(), c->getLayer2());		if (value && value->getType() == oacBooleanValueType		    && ((oaBooleanValue*) value)->get()) {		    outNoIndent("STACK ");		}		outNoIndent(";\n");	    }	}    }        decIndent();    output("END SPACING\n\n");}// *****************************************************************************// LefOut::writeNonDefaultRules()//// Waiting for an implementation in the DB// NONDEFAULTRULES section// *****************************************************************************voidLefOut::writeNonDefaultRules(){    oaIter<oaConstraintGroup>	constraintsIt(tech()->getConstraintGroups());    while (oaConstraintGroup *c = constraintsIt.getNext()) {	if (c != getDefaultRules() && c != getFoundryRules()	    && isLefDefRule(c)) {	    writeNonDefaultRule(c);	}    }}// *****************************************************************************// LefOut::writeNonDefaultRule()//// NONDEFAULTRULE// *****************************************************************************voidLefOut::writeNonDefaultRule(oaConstraintGroup *c){    getLefOutNDR()->write(c);}// *****************************************************************************// LefOut::writeSites()//// This function outputs all site definitions found in the tech db.// *****************************************************************************voidLefOut::writeSites(){    oaIter<oaSiteDef> siteDefIt(tech()->getSiteDefs());    while (oaSiteDef *siteDef = siteDefIt.getNext()) {	writeSite(siteDef);    }}// *****************************************************************************// LefOut::writeSite()//// This function outputs the LEF for the specified siteDef.// *****************************************************************************voidLefOut::writeSite(oaSiteDef	*siteDef){    getLefOutSite()->write(siteDef);}// *****************************************************************************// LefOut::writeMacros()// // This function outputs all MACROs in the design list.// Note that we go through the list twice, outputting the cells// without EEQ master attribute before those with the attribute// *****************************************************************************voidLefOut::writeMacros(){    oaUInt4	i;    oaString	EEQMaster;    oaDesign	*design;    for (i = 0; i < designs.getNumElements(); i++) {	design = designs[i];	design->getTopBlock()->getEEQMaster(EEQMaster);	if (EEQMaster.isEmpty()) {	    writeMacro(design);	}    }        for (i = 0; i < designs.getNumElements(); i++) {	design = designs[i];	design->getTopBlock()->getEEQMaster(EEQMaster);	if (!EEQMaster.isEmpty()) {	    writeMacro(design);	}    } }// *****************************************************************************// LefOut::writeMacro()// // This function outputs a LEF MACRO statement for the given cell.// the boolean argument EEQ specifies if cells with the EEQMaster attribute// should be output or cells without this attribute.// *****************************************************************************voidLefOut::writeMacro(oaDesign	*design){    getLefOutMacro()->write(design);}// *****************************************************************************// LefOut::writeEnd()// // Write a LEF END LIBRARY statement// *****************************************************************************voidLefOut::writeEnd(){    output("END LIBRARY\n");}// *****************************************************************************// LefOut::writeProperties()// // This function writes LEF PROPERTIES for the given object.//// Syntax:// [PROPERTY propName propVal ;]...// *****************************************************************************voidLefOut::writeProperties(oaObject	    *object,			LefDefObjectEnum    objectType)

⌨️ 快捷键说明

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