📄 oaverilogdesigndebug.cpp
字号:
((oaModModuleVectorInst*) inst)->getStop()); } break; case oacModVectorInstBitType: { oaVectorBitName vectorBitName; ((oaModModuleVectorInstBit*) inst)->getName(vectorBitName); vectorBitName.getBaseName(ns, name); fprintf(out, "inst = oaModVectorInstBit::create(module, %s, oaScalarName(ns, \"%s\"), %d);\n", (const char*) masterName, (const char*) name, ((oaModModuleVectorInstBit*) inst)->getBitIndex()); } break; } instCache = inst;}voidInstObserver::onPostModify(oaModInst *inst, oaInstModTypeEnum modType){ getInst(inst, "inst"); if (!inst->isValid()) { fprintf(out, "// oaInstModTypeEnum = %d\n", modType); return; } oaString instName; inst->getName(ns, instName); switch (modType) { case oacSetTransformInstModType: fprintf(out, "// inst->setTransform();\n"); break; case oacSetInstHeaderInstModType: fprintf(out, "// inst->setMaster();\n"); break; case oacSetPlacementStatusInstModType: fprintf(out, "// inst->setPlacementStatus();\n"); break; case oacSetPriorityInstModType: fprintf(out, "// inst->setPriority();\n"); break; case oacAddToClusterInstModType: fprintf(out, "// inst->addToCluster(cluster);\n"); break; case oacRemoveFromClusterInstModType: fprintf(out, "// inst->removeFromCluster();\n"); break; case oacSetSourceInstModType: fprintf(out, "// inst->setSource();\n"); break; case oacSetUsageInstModType: fprintf(out, "// inst->setUsage();\n"); break; case oacSetImplicitInstModType: fprintf(out, "// inst->setImplicit();\n"); break; case oacArrayInstSetNumRowsInstModType: fprintf(out, "// ((oaArrayInst*) inst)->setNumRows();\n"); break; case oacArrayInstSetNumColsInstModType: fprintf(out, "// ((oaArrayInst*) inst)->setNumCols();\n"); break; case oacArrayInstSetDXInstModType: fprintf(out, "// ((oaArrayInst*) inst)->setDX();\n"); break; case oacArrayInstSetDYInstModType: fprintf(out, "// ((oaArrayInst*) inst)->setDY();\n"); break; case oacArrayInstSetNameInstModType: fprintf(out, "inst->setName(oaScalarName(ns, \"%s\"));\n", (const char*) instName); break; case oacScalarInstSetNameInstModType: { oaString typeName; if (inst->isModDesignInst()) { typeName = "oaModScalarInst"; } else { typeName = "oaModModuleScalarInst"; } fprintf(out, "((%s*) inst)->setName(oaScalarName(ns, \"%s\"));\n", (const char*) instName); } break; case oacVectorInstSetBaseNameInstModType: { oaSimpleName name; oaString typeName; inst->getName(name); if (name.getType() == oacVectorNameType) { name.getVector()->getBaseName(ns, instName); } else { name.getVectorBit()->getBaseName(ns, instName); } if (inst->isModDesignInst()) { typeName = "oaModVectorInst"; } else { typeName = "oaModModuleVectorInst"; } fprintf(out, "((%s*) inst)->setBaseName(oaScalarName(ns, \"%s\"));\n", (const char*) typeName, (const char*) instName); } break; case oacVectorInstSetRangeInstModType: { oaUInt4 start; oaUInt4 stop; oaString typeName; if (inst->isModDesignInst()) { start = ((oaModVectorInst*) inst)->getStart(); stop = ((oaModVectorInst*) inst)->getStop(); typeName = "oaModVectorInst"; } else { start = ((oaModModuleVectorInst*) inst)->getStart(); stop = ((oaModModuleVectorInst*) inst)->getStop(); typeName = "oaModModuleVectorInst"; } fprintf(out, "((%s*) inst)->setRange(%d, %d);\n", (const char*) typeName, start, stop); } break; case oacVectorInstBitSetNameInstModType: { oaString typeName; if (inst->isModDesignInst()) { typeName = "oaModVectorInst"; } else { typeName = "oaModModuleVectorInst"; } fprintf(out, "((%s*) inst)->setName(oaVectorBitName(ns, \"%s\"));\n", (const char*) typeName, (const char*) instName); } break; case oacAddToPinInstModType: fprintf(out, "// inst->addToPin();\n"); break; case oacRemoveFromPinInstModType: fprintf(out, "// inst->removeFromPin();\n"); break; case oacConvertToModuleInstModType: fprintf(out, "// inst->convertToModuleInst();\n"); break; case oacConvertToDesignInstModType: fprintf(out, "// inst->convertToDesignInst();\n"); break; case oacScalarizeInstModType: fprintf(out, "inst->scalarize();\n"); break; }}voidInstObserver::onPreDestroy(oaModInst *inst){ if (inst->isImplicit()) { return; } getInst(inst, "inst"); fprintf(out, "inst->destroy();\n"); instCache = NULL;}// *****************************************************************************// TermObserver::onPostCreate// TermObserver::onPostModify// TermObserver::onPreDestroy//// These functions print a representation of the API calls used to manipulate// terms.// *****************************************************************************voidTermObserver::onPostCreate(oaModTerm *term){ if (term->isImplicit()) { return; } oaString termName; getNet(term->getNet(), "net"); term->getName(ns, termName); fprintf(out, "term = oaModTerm::create(net, oaName(ns, \"%s\"), oaTermType(\"%s\"));\n", (const char*) termName, (const char*) term->getTermType().getName()); termCache = term;}voidTermObserver::onPostModify(oaModTerm *term, oaTermModTypeEnum modType){ getNet(term->getNet(), "net"); getTerm(term, "term"); if (!term->isValid()) { fprintf(out, "// oaTermModTypeEnum = %d\n", modType); return; } oaString termName; term->getName(ns, termName); switch (modType) { case oacSetImplicitTermModType: fprintf(out, "// term->setImplicit();\n"); break; case oacSetTermTypeTermModType: fprintf(out, "term->setTermType(oaTermType(\"%s\"));\n", (const char*) term->getTermType().getName()); break; case oacMoveToNetTermModType: fprintf(out, "term->moveToNet(net);\n"); break; case oacSetAntennaDataTermModType: fprintf(out, "// term->setAntennaData();\n"); break; case oacUnsetAntennaDataTermModType: fprintf(out, "// term->unsetAntennaData();\n"); break; case oacSetPinConnectMethodTermModType: fprintf(out, "// term->setPinConnectMethod();\n"); break; case oacSetPositionTermModType: fprintf(out, "term->setPosition(%d);\n", term->getPosition()); break; case oacUnsetPositionTermModType: fprintf(out, "term->unsetPosition();\n"); break; case oacSetRouteMethodTermModType: fprintf(out, "// term->setRouteMethod();\n"); break; case oacSetInterfaceTermModType: fprintf(out, "term->setIsInterface(%s);\n", term->isInterface() ? "true" : "false"); break; case oacSetMustJoinTermModType: fprintf(out, "// term->setMustJoin();\n"); break; case oacUnsetMustJoinTermModType: fprintf(out, "// term->unsetMustJoin();\n"); break; case oacSetSupplySensitivityTermModType: fprintf(out, "// term->setSupplySensitivity();\n"); break; case oacSetGroundSensitivityTermModType: fprintf(out, "// term->setGroundSensitivity();\n"); break; case oacScalarizeTermModType: fprintf(out, "term->scalarize();\n"); break; case oacScalarTermSetNameTermModType: fprintf(out, "term->setName(oaScalarName(ns, \"%s\"));\n", (const char*) termName); break; case oacBusTermSetBaseNameTermModType: { oaName name; term->getName(name); name.getVector()->getBaseName(ns, termName); fprintf(out, "((oaModBusTerm*) term)->setBaseName(oaScalarName(ns, \"%s\"));\n", (const char*) termName); } break; case oacBusTermSetRangeTermModType: { oaUInt4 start = ((oaModBusTerm*) term)->getStart(); oaUInt4 stop = ((oaModBusTerm*) term)->getStop(); fprintf(out, "((oaModBusTerm*) term)->setRange(%d, %d);\n", start, stop); } break; case oacResetBusBitToBusTermModType: fprintf(out, "// term->resetBusBitToBus();\n"); break; case oacResetBusToBusBitTermModType: fprintf(out, "// term->resetBusToBusBit();\n"); break; case oacBusTermBitSetNameTermModType: fprintf(out, "((oaModBusTermBit*) term)->setName(oaVectorBitName(ns, \"%s\"));\n", (const char*) termName); break; }}voidTermObserver::onPreDestroy(oaModTerm *term){ if (term->isImplicit() || !term->getNet() || !term->getNet()->isValid()) { return; } getTerm(term, "term"); fprintf(out, "term->destroy();\n"); termCache = NULL;}// *****************************************************************************// BusTermDefObserver::onPostCreate// BusTermDefObserver::onPostModify// BusTermDefObserver::onPreDestroy//// These functions print a representation of the API calls used to manipulate// busTermDefs.// *****************************************************************************voidBusTermDefObserver::onPostCreate(oaModBusTermDef *def){ if (def->isImplicit()) { return; } getModule(def->getModule(), "module"); oaString name; def->getName(ns, name); fprintf(out, "oaModBusTermDef::create(module, oaScalarName(ns, \"%s\"), oaBitOrder(\"%s\"));\n", (const char*) name, (const char*) def->getBitOrder().getName());}voidBusTermDefObserver::onPostModify(oaModBusTermDef *def, oaBusTermDefModTypeEnum modType){ oaString name; def->getName(ns, name); getModule(def->getModule(), "module"); fprintf(out, "def = oaModBusTermDef::find(module, oaScalarName(ns, \"%s\"));\n", (const char*) name); if (modType == oacSetImplicitBusTermDefModType) { fprintf(out, "// def->setImplicit();\n"); } else { fprintf(out, "def->setBitOrder(oaBitOrder(\"%s\"));\n", (const char*) def->getBitOrder().getName()); }}voidBusTermDefObserver::onPreDestroy(oaModBusTermDef *def){ if (def->isImplicit()) { return; } oaString name; def->getName(ns, name); getModule(def->getModule(), "module"); fprintf(out, "def = oaModBusTermDef::find(module, oaScalarName(ns, \"%s\"));\n", (const char*) name); fprintf(out, "def->destroy();\n");}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -