📄 oadefoutnet.cpp
字号:
voidDefOutNet::writeSpecialPath(oaPath *path){ oaLayer *layer = defOut.getLayer(path->getLayerNum()); oaString layerName; oaUInt4 width = path->getWidth(); oaPointArray points(path->getNumPoints()); oaPathStyle style(path->getStyle()); layer->getName(layerName); path->getPoints(points); defOut.outNoIndent(" %s %i", (const char*) layerName, width); for (oaUInt4 i = 0; i < points.getNumElements(); i++) { defOut.outNoIndent(" ( %i %i", points[i].x(), points[i].y()); if (i == 0) { if (style == oacVariablePathStyle) { if (path->getBeginExt() > 0) { defOut.outNoIndent(" %i", path->getBeginExt()); } } else if (style == oacExtendPathStyle) { defOut.outNoIndent(" %i", width / 2); } } else if (i + 1 == points.getNumElements()) { if (style == oacVariablePathStyle) { if (path->getEndExt() > 0) { defOut.outNoIndent(" %i", path->getEndExt()); } } else if (style == oacExtendPathStyle) { defOut.outNoIndent(" %i", width / 2); } } defOut.outNoIndent(" )"); }}// *****************************************************************************// DefOutNet::writeGeometricRouteShape()// [+ SHAPE {RING | PADRING | BLOCKRING | STRIPE | FOLLOWPIN// | IOWIRE | COREWIRE | BLOCKWIRE | BLOCKAGEWIRE | FILLWIRE}]// *****************************************************************************voidDefOutNet::writeSpecialRouteShape(const oaRouteTopology &topology, oaPurposeNum purposeNum){ oaString shape; if (purposeNum == oavPurposeNumberFill) { shape = "FILLWIRE"; } else if (purposeNum == oavPurposeNumberGapFill) { shape = "DRCFILL"; } else { switch (topology) { case oacRingRouteTopology: shape = "RING"; break; case oacPadRingRouteTopology: shape = "PADRING"; break; case oacBlockRingRouteTopology: shape = "BLOCKRING"; break; case oacStripeRouteTopology: shape = "STRIPE"; break; case oacStandardCellWireRouteTopology: shape = "FOLLOWPIN"; break; case oacIOWireRouteTopology: shape = "IOWIRE"; break; case oacBlockWireRouteTopology: shape = "BLOCKWIRE"; break; case oacCoreWireRouteTopology: shape = "COREWIRE"; break; case oacNoneRouteTopology: default: return; } } defOut.outNoIndent(" + SHAPE %s", (const char *) shape);}// *****************************************************************************// DefOutNet::writeSource()//// This function writes out the source of the current net.// A source value of NETLIST is the default and is not written out.//// Syntax:// [+ SOURCE {DIST | NETLIST | TEST | TIMING | USER}]// *****************************************************************************voidDefOutNet::writeSource(){ oaString source; switch (net->getSource()) { case oacTimingSource: source = "TIMING"; break; case oacDistSource: source = "DIST"; break; case oacTestSource: source = "TEST"; break; case oacUserSource: source = "USER"; break; case oacNetlistSource: default: return; } defOut.outNoIndent("\n"); defOut.output("+ SOURCE %s", (const char*)source); }// *****************************************************************************// DefOutNet::writeOriginal()//// This function writes the ORIGINAL attribute of the current net.// *****************************************************************************voidDefOutNet::writeOriginal(){ oaNet *originalNet = net->getOriginal(); oaString netName; if (originalNet) { originalNet->getName(defOut.getNS(), netName); defOut.outNoIndent("\n"); defOut.output("+ ORIGINAL %s", (const char *) netName); }}// *****************************************************************************// DefOutNet::writeVoltage()//// This function writes the VOLTAGE attribute of the current net.// This attribute is a SPECIALNET attribute only.// *****************************************************************************voidDefOutNet::writeVoltage(){ oaFloat voltage(net->getVoltage()); if (voltage != 0.0) { defOut.outNoIndent("\n"); defOut.output("+ VOLTAGE %d", oaUInt4((voltage * 1000) + 0.5)); }}// *****************************************************************************// DefOutNet::writeUse()//// This function writes the DEF USE (OA: signalType) for the current net.//// Syntax:// [+ USE {ANALOG | CLOCK | GROUND | POWER // | RESET | SCAN | SIGNAL | TIEOFF}]// *****************************************************************************voidDefOutNet::writeUse(){ oaString use; switch (net->getSigType()) { case oacPowerSigType: use = "POWER"; break; case oacGroundSigType: use = "GROUND"; break; case oacClockSigType: use = "CLOCK"; break; case oacAnalogSigType: use = "ANALOG"; break; case oacTieoffSigType: case oacTieHiSigType: case oacTieLoSigType: use = "TIEOFF"; break; case oacScanSigType: use = "SCAN"; break; case oacResetSigType: use = "RESET"; break; case oacSignalSigType: default: return; } defOut.outNoIndent("\n"); defOut.output("+ USE %s", (const char*)use);}// *****************************************************************************// DefOutNet::writePattern()//// This function writes out the routepattern for the current net.// A route pattern value of STEINER is the default, and is not written.// The routepattern WIREDLOGIC is not supported in the DB.//// Syntax:// [+ PATTERN {BALANCED | STEINER | TRUNK | WIREDLOGIC}]// *****************************************************************************voidDefOutNet::writePattern(){ oaString pattern; switch (net->getRoutePattern()) { case oacBalancedRoutePattern: pattern = "BALANCED"; break; case oacTrunkRoutePattern: pattern = "TRUNK"; break; case oacSteinerRoutePattern: default: return; } defOut.outNoIndent("\n"); defOut.output("+ PATTERN %s", (const char*)pattern);}// *****************************************************************************// DefOutNet::writeEstCap()//// This function writes the ESTCAP attribute for the current net.//// Syntax : [+ ESTCAP wireCapacitance]// *****************************************************************************voidDefOutNet::writeEstCap(){ oaIntProp *prop = (oaIntProp *) oaProp::find(net, cDefEstCap); if (prop) { defOut.outNoIndent("\n"); defOut.output("+ ESTCAP %d", prop->getValue()); }}// *****************************************************************************// DefOutNet::writeWeight()//// This function writes the DEF WEIGHT (OA: Priority) for the current net.//// Syntax:// [+ WEIGHT weight] // *****************************************************************************voidDefOutNet::writeWeight(){ oaInt4 weight(net->getPriority()); if (weight) { defOut.outNoIndent("\n"); defOut.output("+ WEIGHT %i", weight + 1); }}// *****************************************************************************// DefOutNet::writeFixedBump()//// This function writes the DEF FIXEDBUMP attribute for the current net.//// Syntax:// [+ FIXEDBUMP] // *****************************************************************************voidDefOutNet::writeFixedBump(){ if (defOut.getOptions()->getVersion() < cLefDefVersion55) { return; } if (net->getConnStatus() == oacLockedConnStatus) { defOut.outNoIndent("\n"); defOut.output("+ FIXEDBUMP"); }}// *****************************************************************************// DefOutNet::writeFrequency()//// This function writes the DEF FREQUENCY for the current special net.//// Syntax:// [+ FREQUENCY frequency] // *****************************************************************************voidDefOutNet::writeFrequency(){ if (defOut.getOptions()->getVersion() < cLefDefVersion55) { return; } oaFloatProp *prop = (oaFloatProp *) oaProp::find(net, cDefFrequency); if (prop) { defOut.outNoIndent("\n"); defOut.output("+ FREQUENCY %g", prop->getValue()); }}// *****************************************************************************// DefOutNet::getFirstViaLayer()//// This function returns the starting layer for the via in the given element.// First find the layer in the next element (if it exists),// and then return the opposite layer found in the via.// (Note: if the next element is a via, the function recursively calls itself)// *****************************************************************************oaLayerNumDefOutNet::getFirstViaLayer(oaRouteObjectArray &objects, oaUInt4 elem){ oaVia *via = (oaVia*) objects[elem]; oaViaDef *viaDef = getViaDef(via); oaUInt4 nextElem(elem + 1); if (objects.getNumElements() == nextElem) { return viaDef->getLayer1()->getNumber(); } oaLayerNum layerNum; if (objects[nextElem]->getType() == oacPathSegType) { layerNum = ((oaPathSeg*) objects[nextElem])->getLayerNum(); } else { layerNum = getFirstViaLayer(objects, nextElem); if (layerNum != viaDef->getLayer1()->getNumber() && layerNum != viaDef->getLayer2()->getNumber()) { layerNum = getOtherViaLayer((oaVia*) objects[nextElem], layerNum); } } return getOtherViaLayer(via, layerNum);} // *****************************************************************************// DefOutNet::getOtherViaLayer()//// This function returns the other routing layer for the via// *****************************************************************************oaLayerNumDefOutNet::getOtherViaLayer(oaVia *via, oaLayerNum layerNum){ oaViaDef *viaDef = getViaDef(via); oaLayerNum layer1 = viaDef->getLayer1()->getNumber(); oaLayerNum layer2 = viaDef->getLayer2()->getNumber(); if (layerNum == layer1) { return layer2; } else if (layerNum == layer2) { return layer1; } // Error if layer is not found, and just return firstLayer. oaString netName; oaString viaName; net->getName(defOut.getNS(), netName); viaDef->getName(viaName); defOut.error(cNetViaLayersDontMatchRoute, (const char*) netName, (const char*) viaName); return layer1;} // *****************************************************************************// DefOutNet::getViaDef()//// This function returns the via def for the via. If the viaDef cannot be// bound, an exception is thrown.// *****************************************************************************oaViaDef*DefOutNet::getViaDef(oaVia *via){ oaViaDef *viaDef = via->getViaDef(); if (!viaDef) { oaString viaDefName; via->getViaDefName(viaDefName); throw LefDefError(cViaNotBound, (const char*) viaDefName); } return viaDef;}END_LEFDEF_NAMESPACE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -