📄 oalefout.cpp
字号:
{ if (object->hasProp()) { oaIter<oaProp> propIter(object->getProps()); while (oaProp *prop = propIter.getNext()) { oaString propName; oaString propValue; prop->getName(propName); if (findProp(propName, objectType)) { prop->getValue(propValue); if (prop->getType() == oacStringPropType) { // Check the value is valid in the LEF/DEF namespace. if (strchr(propValue, '\n') || strchr(propValue, '#')) { continue; } output("PROPERTY %s \"%s\" ;\n", (const char*) propName, (const char*) propValue); } else { output("PROPERTY %s %s ;\n", (const char*) propName, (const char*) propValue); } } } }}// *****************************************************************************// LefOut::initTechDB()//// This function returns a boolean indicating whether there is a technology// database in the library.// Handles on various tech object (legacy etc) can be initialized here.// *****************************************************************************voidLefOut::initTechDB(){ LefDefOut::initTechDB(); legacy = (oaHierProp *) oaProp::find(tech(), cLefLegacyProp); dbuPerUU = tech()->getDBUPerUU(oaViewType::get(oacMaskLayout)); overlapName = cLefOverlapLayerName; if (legacy) { oaProp *prop = oaProp::find(legacy, cLefOverlapLayer); if (prop && prop->getType() == oacStringPropType) { ((oaStringProp *) prop)->getValue(overlapName); } }}// *****************************************************************************// LefOut::initNameSpace()//// Sets busbit & divider chars in the current lef namespace// note: these chars are currently stored as string properties// *****************************************************************************voidLefOut::initNameSpace(){ if (getLegacyProp()) { oaProp *prop = oaProp::find(getLegacyProp(), cLefBusBitChars); if (prop && prop->getType() == oacStringPropType) { oaString busBitChars; ((oaStringProp*) prop)->getValue(busBitChars); lefNS.setOpenBusChar(busBitChars[(oaUInt4) 0]); lefNS.setCloseBusChar(busBitChars[(oaUInt4) 1]); } prop = (oaProp *) oaProp::find(getLegacyProp(), cLefDividerChar); if (prop && prop->getType() == oacStringPropType) { oaString dividerChar; ((oaStringProp*) prop)->getValue(dividerChar); lefNS.setHierDelimiter(dividerChar[(oaUInt4) 0]); } }}// *****************************************************************************// LefOut::initDesigns()// LefOut::initDesign()//// These functions open all the necessary designs, and store them in an array.// *****************************************************************************voidLefOut::initDesigns(){ designs.setNumElements(0); if (!getOptions()->writeCells()) { return; } // Initialize designs from the cellNames option. if (options->getNumCellNames()) { for (oaUInt4 i = 0 ; i != options->getNumCellNames(); i++) { oaCell *c = oaCell::find(lib(), options->getCellName(i)); if (!c) { oaString libStr; oaString cellStr; options->getLibName().get(libStr); options->getCellName(i).get(cellStr); error(cCellNotFound, (const char*) cellStr, (const char*) libStr); continue; } oaDesign *design = initDesign(c); if (!design) { oaString libStr; oaString cellStr; oaString viewNameList; options->getCellName(i).get(cellStr); options->getLibName().get(libStr); for (oaUInt4 i = 0 ; i != options->getNumViewNames(); i++) { if (i) { viewNameList += ' '; } oaString v; options->getViewName(i).get(v); viewNameList += v; } error(cViewsNotFound, (const char*) viewNameList, (const char*) cellStr, (const char*) libStr); continue; } designs.append(design); } return; } // Initialize all designs in the library. oaIter<oaCell> cellIter(lib()->getCells()); while (oaCell *c = cellIter.getNext()) { oaDesign *design= initDesign(c); if (design) { designs.append(design); } }} oaDesign*LefOut::initDesign(oaCell *cell){ oaScalarName libName(options->getLibName()); oaScalarName cellName; oaScalarName viewName; cell->getName(cellName); for (oaUInt4 i = 0 ; i != options->getNumViewNames(); i++) { viewName = options->getViewName(i); if (oaDesign::exists(libName, cellName, viewName)) { return oaDesign::open(libName, cellName, viewName, 'r'); } } return NULL;}// *****************************************************************************// LefOut::initPropDefs()// LefOut::initPropDefsTech()// LefOut::initPropDefsCells()//// This function collects the list of properties found in the library and// technology database. This includes the properties on all LEF objects that// will be output.// *****************************************************************************voidLefOut::initPropDefs(){ if (getOptions()->writeTech()) { initPropDefsTech(); } if (getOptions()->writeCells()) { initPropDefsCells(); }}voidLefOut::initPropDefsTech(){ // Get the LIBRARY property definitions. oaProp *prop; if (oaDMData::exists(lib())) { oaDMData *dmData = oaDMData::open(lib(), 'r'); if (dmData->hasProp()) { oaIter<oaProp> libPropIter(dmData->getProps()); while (prop = libPropIter.getNext()) { oaString name; prop->getName(name); if (name != cTechLibName) { addProp(prop, cLefDefLibrary); } } } dmData->close(); } // Get the LAYER property definitions oaIter<oaLayer> layerIt(tech()->getLayers()); while (oaLayer *layer = layerIt.getNext()) { if (layer->hasProp()) { oaIter<oaProp> layerPropIter(layer->getProps()); while (prop = layerPropIter.getNext()) { oaString name; prop->getName(name); if (name != cLefLayerRes && name != cLefLayerCap && name != cLefLayerHeight && name != cLefLayerThickness && name != cLefLayerShrinkage && name != cLefLayerCapMul && name != cLefLayerEdgeCap) { addProp(prop, cLefDefLayer); } } } } // Get the VIA property definitions oaIter<oaViaDef> viaDefIter(tech()->getViaDefs()); while (oaViaDef *viaDef = viaDefIter.getNext()) { if (viaDef->hasProp()) { oaIter<oaProp> viaPropIter(viaDef->getProps()); while (prop = viaPropIter.getNext()) { addProp(prop, cLefDefVia); } } } // Get the VIARULE property definitions oaIter<oaViaSpec> viaSpecIter(tech()->getViaSpecs()); while (oaViaSpec *viaSpec = viaSpecIter.getNext()) { if (viaSpec->hasProp()) { oaIter<oaProp> viaPropIter(viaSpec->getProps()); while (prop = viaPropIter.getNext()) { addProp(prop, cLefDefViaRule); } } } // Get the NONDEFAULTRULE property definitions oaIter<oaConstraintGroup> constraintsIter(tech()->getConstraintGroups()); while (oaConstraintGroup *constraints = constraintsIter.getNext()) { if (constraints->hasProp()) { oaIter<oaProp> routePropIter(constraints->getProps()); while (prop = routePropIter.getNext()) { addProp(prop, cLefDefNonDefaultRule); } } }}voidLefOut::initPropDefsCells(){ for (oaUInt4 i = 0; i < designs.getNumElements(); i++) { initPropDefsCell(designs[i]); }}voidLefOut::initPropDefsCell(oaDesign *design){ oaProp *prop; // MACRO property definitions if (design->hasProp()) { oaIter<oaProp> macroPropIter(design->getProps()); while (prop = macroPropIter.getNext()) { oaString name; prop->getName(name); if (name != cLefCorner && name != cLefForeignView) { addProp(prop, cLefDefMacro); } } } // PIN property definitions oaIter<oaTerm> termIt(design->getTopBlock()->getTerms(oacTermIterSingleBit | oacTermIterEquivNets)); while (oaTerm *term = termIt.getNext()) { if (term->hasProp()) { oaIter<oaProp> termPropIter(term->getProps()); while (prop = termPropIter.getNext()) { addProp(prop, cLefDefPin); } } }}// *****************************************************************************// LefOut::close()//// This function closes all open designs and lets the base clase handle closing// of technology database and library.// *****************************************************************************voidLefOut::close(){ for(oaUInt4 i = 0; i < designs.getNumElements(); i++) { designs[i]->close(); } LefDefOut::close();}// *****************************************************************************// LefOut::getLefOutGeom()// LefOut::getLefOutLayer()// LefOut::getLefOutMacro()// LefOut::getLefOutPin()// LefOut::getLefOutSite()// LefOut::getLefOutVia()// LefOut::getLefOutViaRule()//// These functions return the helper classes. If they do not exist, they are// created here.// *****************************************************************************LefOutGeom*LefOut::getLefOutGeom(){ if (!lefOutGeom) { lefOutGeom = new LefOutGeom(*this); } return lefOutGeom;}LefOutLayer*LefOut::getLefOutLayer(){ if (!lefOutLayer) { lefOutLayer = new LefOutLayer(*this); } return lefOutLayer;}LefOutMacro*LefOut::getLefOutMacro(){ if (!lefOutMacro) { lefOutMacro = new LefOutMacro(*this); } return lefOutMacro;}LefOutNDR*LefOut::getLefOutNDR(){ if (!lefOutNDR) { lefOutNDR = new LefOutNDR(*this); } return lefOutNDR;}LefOutPin*LefOut::getLefOutPin(){ if (!lefOutPin) { lefOutPin = new LefOutPin(*this); } return lefOutPin;}LefOutSite*LefOut::getLefOutSite(){ if (!lefOutSite) { lefOutSite = new LefOutSite(*this); } return lefOutSite;}LefOutVia*LefOut::getLefOutVia(){ if (!lefOutVia) { lefOutVia = new LefOutVia(*this); } return lefOutVia;}LefOutViaRule*LefOut::getLefOutViaRule(){ if (!lefOutViaRule) { lefOutViaRule = new LefOutViaRule(*this); } return lefOutViaRule;}END_LEFDEF_NAMESPACE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -