📄 oadefout.cpp
字号:
// [- {compName | PIN} pinName// [+ PROPERTY {propName propVal}...]...;]...// END PINPROPERTIES // Note: Pin properties can be on oaTerms or oaInstTerms.// *****************************************************************************voidDefOut::writePinPropsTerm(oaBitTerm *term){ oaBoolean outputTerm(true); oaIter<oaProp> termPropIter(term->getProps()); while (oaProp *prop = termPropIter.getNext()) { if (outputTerm) { oaString pinName; term->getName(defNS, pinName); output("- PIN %s", (const char*)pinName); outputTerm = false; } incIndent(); writePinProp(prop); decIndent(); } if (!outputTerm) { outNoIndent(" ;\n"); } } // *****************************************************************************// DefOut::writePinPropInstTerm()// // This function writes a DEF PINPROPERTIES section, syntax:// PINPROPERTIES num;// [- {compName | PIN} pinName// [+ PROPERTY {propName propVal}...]...;]...// END PINPROPERTIES // Note: Pin properties can be on oaTerms or oaInstTerms.// *****************************************************************************voidDefOut::writePinPropsInstTerm(oaInstTerm *instTerm){ oaBoolean outputTerm(true); oaIter<oaProp> instTermPropIter(instTerm->getProps()); while (oaProp *prop = instTermPropIter.getNext()) { if (outputTerm) { oaString compName; oaString pinName; instTerm->getInst()->getName(defNS, compName); instTerm->getTermName(defNS, pinName); output("- %s %s", (const char*)compName, (const char*)pinName); outputTerm = false; } incIndent(); writePinProp(prop); decIndent(); } if(!outputTerm) { outNoIndent(" ;\n"); }}// *****************************************************************************// DefOut::writePinProp()// // This function writes a DEF PINPROPERTIES section, syntax:// PINPROPERTIES num;// [- {compName | PIN} pinName// [+ PROPERTY {propName propVal}...]...;]...// END PINPROPERTIES // Note: Pin properties can be on oaTerms or oaInstTerms.// *****************************************************************************voidDefOut::writePinProp(oaProp *prop){ oaString propName; oaString propValue; prop->getName(propName); prop->getValue(propValue); outNoIndent("\n"); output("+ PROPERTY %s", (const char*)propName); if (prop->getType() == oacStringPropType) { outNoIndent(" \"%s\"", (const char*)propValue); } else { outNoIndent(" %s", (const char*)propValue); }}// *****************************************************************************// DefOut::writeBlockages()// // This function writes the DEF BLOCKAGES section.// // Syntax:// BLOCKAGES numBlockages ; // - { LAYER layerName // [ + COMPONENT compName // | + SLOTS // | + FILLS // | + PUSHDOWN ] // | PLACEMENT // [ + COMPONENT compName // | + PUSHDOWN ] // } // RECT pt pt // [RECT pt pt ] ... ; // ... // END BLOCKAGES // *****************************************************************************voidDefOut::writeBlockages(){ oaUInt4 numBlockages = topBlock()->getBlockages().getCount(); if (!numBlockages) { return; } output("BLOCKAGES %i", numBlockages); oaBlockage *blockage; oaBlockageType currentBlockageType(oacRoutingBlockageType); oaLayerNum currentLayerNum(oacNullIndex); oaObject *currentOwner = NULL; oaBoolean currentPushDown(false); oaIter<oaBlockage> blockageIter(topBlock()->getBlockages()); while (blockage = blockageIter.getNext()) { if (blockage->getType() != oacLayerBlockageType) { continue; } if (blockage->getBlockageType() != currentBlockageType || ((oaLayerBlockage*) blockage)->getLayerNum() != currentLayerNum || blockage->getOwner() != currentOwner || blockage->isPushedDown() != currentPushDown) { outNoIndent(" ;\n"); currentBlockageType = blockage->getBlockageType(); currentLayerNum = ((oaLayerBlockage*) blockage)->getLayerNum(); oaLayer *layer = getLayer(currentLayerNum); oaString layerName; layer->getName(layerName); output("- LAYER %s", (const char *) layerName); currentOwner = blockage->getOwner(); if (currentOwner) { oaString ownerName; ((oaInst*)currentOwner)->getName(getNS(), ownerName); outNoIndent(" + COMPONENT %s", (const char*)ownerName); } if (currentBlockageType == oacFillBlockageType) { outNoIndent(" + FILLS"); } if (currentBlockageType == oacSlotBlockageType) { outNoIndent(" + SLOTS"); } currentPushDown = blockage->isPushedDown(); if (currentPushDown) { outNoIndent(" + PUSHDOWN"); } } incIndent(); writeBlockage(blockage); decIndent(); } oaBoolean first = true; currentOwner = NULL; currentPushDown = false; blockageIter.reset(); while (blockage = blockageIter.getNext()) { if (blockage->getType() != oacAreaBlockageType) { continue; } if (first || blockage->getOwner() != currentOwner || blockage->isPushedDown() != currentPushDown) { outNoIndent(" ;\n"); output("- PLACEMENT"); currentOwner = blockage->getOwner(); if (currentOwner) { oaString ownerName; ((oaInst*)currentOwner)->getName(getNS(), ownerName); outNoIndent(" + COMPONENT %s", (const char*)ownerName); } currentPushDown = blockage->isPushedDown(); if (currentPushDown) { outNoIndent(" + PUSHDOWN"); } first = false; } incIndent(); writeBlockage(blockage); decIndent(); } outNoIndent(" ;\n"); output("END BLOCKAGES\n\n");}voidDefOut::writeBlockage(oaBlockage *blockage){ oaPointArray pointArray; blockage->getPoints(pointArray); if (blockage->getType() == oacAreaBlockageType) { return writeRect(pointArray); } writePolygon(pointArray);}// *****************************************************************************// DefOut::writeStyles()// // This function writes a DEF Styles section containing all styles used in the// design.// *****************************************************************************voidDefOut::writeStyles(){ if (!defOutStyle) { new DefOutStyle(*this); } defOutStyle->init(); oaUInt4 numStyles = defOutStyle->getNumStyles(); if (numStyles) { output("STYLES %i ;\n", numStyles); for (oaUInt4 i = 0; i < numStyles; i++) { defOutStyle->write(i); } output("END STYLES\n\n"); }}// *****************************************************************************// DefOut::writeSpecialNets()// // This function writes a DEF Special Nets section// *****************************************************************************voidDefOut::writeSpecialNets(){ if (!defOutNet) { new DefOutNet(*this); } oaUInt4 numNets(0); oaIter<oaNet> netIter(topBlock()->getNets(oacNetIterSingleBit | oacNetIterPreferred)); oaBitNet *net; while (net = (oaBitNet*) netIter.getNext()) { if (defOutNet->hasData(net, true)) { numNets++; } } if (!numNets) { return; } output("SPECIALNETS %i ;\n", numNets); netIter.reset(); while (net = (oaBitNet*) netIter.getNext()) { writeSpecialNet(net); } output("END SPECIALNETS\n\n");}// *****************************************************************************// DefOut::writeSpecialNet()// // This function writes a DEF Special Nets section// *****************************************************************************voidDefOut::writeSpecialNet(oaBitNet *net){ if (defOutNet->hasData(net, true)) { defOutNet->write(net, true); }}// *****************************************************************************// DefOut::writeNets()// // This function writes a DEF NETS section// *****************************************************************************voidDefOut::writeNets(){ oaUInt4 numNets(0); oaIter<oaNet> netIter(topBlock()->getNets(oacNetIterSingleBit | oacNetIterPreferred)); oaBitNet *net; while (net = (oaBitNet*) netIter.getNext()) { if (defOutNet->hasData(net)) { numNets++; } } if (!numNets) { return; } output("NETS %i ;\n", numNets); netIter.reset(); while (net = (oaBitNet*) netIter.getNext()) { writeNet(net); } output("END NETS\n\n");}// *****************************************************************************// DefOut::writeNet()// // This function writes a DEF NET statement for the given net// *****************************************************************************voidDefOut::writeNet(oaBitNet *net){ if (defOutNet->hasData(net)) { defOutNet->write(net); }}// *****************************************************************************// DefOut::writeScanChains()// // This function iterates over all scanchains in the design,// and calls writeScanChain to output them.// *****************************************************************************voidDefOut::writeScanChains(){ oaUInt4 numScanChains(topBlock()->getScanChains().getCount()); if (!numScanChains) { return; } output("SCANCHAINS %i ;\n", numScanChains); oaIter<oaScanChain> scanChainIter(topBlock()->getScanChains()); oaScanChain *scanChain; while (scanChain = scanChainIter.getNext()) { writeScanChain(scanChain); } output("END SCANCHAINS\n\n");}// *****************************************************************************// DefOut::writeScanChain()// // This function writes a DEF SCANCHAINS statement for the given scanChain.// *****************************************************************************voidDefOut::writeScanChain(oaScanChain *scanChain){ if (!defOutScanChain) { new DefOutScanChain(*this); } defOutScanChain->write(scanChain);}// *****************************************************************************// DefOut::writeGroups()// // This function iterates over all clusters in the design,// and calls writeGroup to output the DEF group.// Note: Clusters representing a group do not have any clusterBoundaries// *****************************************************************************voidDefOut::writeGroups(){ oaUInt4 numGroups(0); oaIter<oaCluster> clusterIter(topBlock()->getClusters()); oaCluster *cluster; while (cluster = clusterIter.getNext()) { if (!cluster->getBoundaries().getCount()) { numGroups++; } } if (!numGroups) { return; } output("GROUPS %i ;\n", numGroups); clusterIter.reset(); while (cluster = clusterIter.getNext()) { if (!cluster->getBoundaries().getCount()) { writeGroup(cluster); } } output("END GROUPS\n\n");}// *****************************************************************************// DefOut::writeGroup()// // This function writes a DEF GROUP statement for the given cluster.//// Syntax:// [- groupName compNameRegExpr... // [+ SOFT // [MAXHALFPERIMETER value] // [MAXX value][MAXY value]]// [+ REGION {pt pt | regionName} ]// [+ PROPERTY {propName propVal}...]...;]...//// The SOFT and REGION pt pt (anonymous) constructs are obsolete from DEF 5.5.// *****************************************************************************voidDefOut::writeGroup(oaCluster *cluster){ oaString groupName; cluster->getName(groupName); output("- %s", (const char*)groupName); oaIter<oaInst> instIter(cluster->getInsts()); oaInst *inst;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -