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

📄 oaverilogdesigndebug.cpp

📁 openaccess与verilog互相转化时所用的源代码
💻 CPP
📖 第 1 页 / 共 3 页
字号:
// *****************************************************************************// ModuleObserver::onPostCreate// ModuleObserver::onPostModify// ModuleObserver::onPreDestroy//// These functions print a representation of the API calls used to manipulate// modules.// *****************************************************************************voidModuleObserver::onPostCreate(oaModule	*module){    getDesign(module->getDesign(), "design");    oaString	modName;    module->getName(ns, modName);    fprintf(out, "\n\nmodule = oaModule::create(design, oaScalarName(ns, \"%s\"));\n",	    (const char*) modName);    moduleCache = module;}voidModuleObserver::onPostModify(oaModule		    *module, 			     oaModuleModTypeEnum    modType){    getModule(module, "module");    fprintf(out, "// module->setDefaultConstraintGroup();\n");}voidModuleObserver::onPreDestroy(oaModule	*module){    getModule(module, "module");    fprintf(out, "module->destroy();\n");    moduleCache = NULL;}// *****************************************************************************// NetObserver::onPostCreate// NetObserver::onPostModify// NetObserver::onPreDestroy//// These functions print a representation of the API calls used to manipulate// nets.// *****************************************************************************voidNetObserver::onPostCreate(oaModNet  *net){    if (net->isImplicit()) {	return;    }    oaString	netName;    getModule(net->getModule(), "module");    net->getName(ns, netName);    fprintf(out, "net = oaModNet::create(module, oaName(ns, \"%s\"), oaSigType(\"%s\"), %s);\n", 	    (const char*) netName, 	    (const char*) net->getSigType().getName(),	    net->isGlobal() ? "true" : "false");    netCache = net;}voidNetObserver::onPostModify(oaModNet	    *net,			  oaNetModTypeEnum  modType){    getNet(net, "net");    if (!net->isValid()) {	fprintf(out, "// oaNetModTypeEnum = %d\n", modType);	return;    }    oaString	netName;    net->getName(ns, netName);    switch (modType) {	case oacSetImplicitNetModType:	    if (net->isImplicit()) {		fprintf(out, "// net->setImplicit(;\n");	    } else {		fprintf(out, "net = oaModNet::create(module, oaName(ns, \"%s\"), oaSigType(\"%s\"), %s);\n", 			(const char*) netName, 			(const char*) net->getSigType().getName(),			 net->isGlobal() ? "true" : "false");	    }	    break;	case oacAddEquivNetModType: 	    getNet(((oaModBitNet*) net)->getPreferredEquivalent(), "preferred");	    fprintf(out, "((oaModBitNet*) net)->makeEquivalent(preferred);\n");	    break;	case oacBreakEquivNetModType: 	    fprintf(out, "net->breakEquivalence();\n");	    break;	case oacSetGlobalNetModType:   	    fprintf(out, "net->setGlobal(%s);\n",		    net->isGlobal() ? "true" : "false");	    break;	case oacSetSigTypeNetModType:   	    fprintf(out, "net->setSigType(oaSigType(\"%s\"));\n", 		    (const char*) net->getSigType().getName());	    break;	case oacSetPreferredEquivNetModType:	    fprintf(out, "net->setPreferredEquivalent();\n");	    break;   	case oacSetMustJoinNetModType: 	    fprintf(out, "// net->setMustJoin();\n");	    break;   	case oacSetPriorityNetModType: 	    fprintf(out, "// net->setPriority();\n");	    break;   	case oacSetRoutePatternNetModType: 	    fprintf(out, "// net->setRoutePattern();\n");	    break;   	case oacSetSourceNetModType:	    fprintf(out, "// net->setSource();\n");	    break;   	case oacSetVoltageNetModType:  	    fprintf(out, "// net->setVoltage();\n");	    break;   	case oacSetShieldNet1NetModType: 	    fprintf(out, "// net->setShieldNet1();\n");	    break;   	case oacSetShieldNet2NetModType: 	    fprintf(out, "// net->setShieldNet2();\n");	    break;   	case oacSetOriginalNetModType: 	    fprintf(out, "// net->setOriginal();\n");	    break;   	case oacSetConnStatusNetModType: 	    fprintf(out, "// net->setConnStatus(\"\");\n");	    break;   	case oacSetParasiticConfNetModType:	    fprintf(out, "// net->setParsiticConfidence();\n"); 	    break;   	case oacScalarizeNetModType: 	    fprintf(out, "net->scalarize();\n");	    break;   	case oacScalarNetSetNameNetModType: 	    fprintf(out, "((oaModScalarNet*) net)->setName(oaScalarName(ns, \"%s\"));\n",		    (const char*) netName);	    break;    	case oacBusNetSetBaseNameNetModType: 	    {		oaVectorName	vectorName;		((oaModBusNet*) net)->getName(vectorName);		vectorName.getBaseName(ns, netName);		fprintf(out, "net->setBaseName(oaScalarName(ns, \"%s\"));\n",			(const char*) netName);	    }	    break;   	case oacBusNetSetRangeNetModType:	    {		oaUInt4	start = ((oaModBusNet*) net)->getStart();		oaUInt4	stop = ((oaModBusNet*) net)->getStop();		fprintf(out, "((oaModBusNet*) net)->setRange(%d, %d);\n", start, stop);	    }	    break;	case oacResetBusBitToBusNetModType: 	    fprintf(out, "// net->resetBusBitToBusNet();\n");	    break;   	case oacResetBusToBusBitNetModType: 	    fprintf(out, "// net->resetBusToBusBitNet();\n");	    break;   	case oacBusNetBitSetNameNetModType:   	    fprintf(out, "((oaModBusNetBit*) net)->setName(oaVectorBitName(ns, \"%s\"));\n",		    (const char*) netName);	    break;        }   }voidNetObserver::onPreDestroy(oaModNet  *net){    if (net->isImplicit()) {	return;    }    getNet(net, "net");    fprintf(out, "net->destroy();\n");    netCache = NULL;}// *****************************************************************************// BusNetDefObserver::onPostCreate// BusNetDefObserver::onPostModify// BusNetDefObserver::onPreDestroy//// These functions print a representation of the API calls used to manipulate// busNetDefs.// *****************************************************************************voidBusNetDefObserver::onPostCreate(oaModBusNetDef	*def){    if (def->isImplicit()) {	return;    }    getModule(def->getModule(), "module");    oaString	name;    def->getName(ns, name);    fprintf(out, "oaModBusNetDef::create(module, oaScalarName(ns, \"%s\"), oaBitOrder(\"%s\"));\n",	    (const char*) name, (const char*) def->getBitOrder().getName());}voidBusNetDefObserver::onPostModify(oaModBusNetDef		*def, 				oaBusNetDefModTypeEnum	modType){    oaString	name;    def->getName(ns, name);    getModule(def->getModule(), "module");    fprintf(out, "def = oaModBusNetDef::find(module, oaScalarName(ns, \"%s\"));\n",	    (const char*) name);    if (modType == oacSetImplicitBusNetDefModType) {	fprintf(out, "// def->setImplicit();\n");    } else {	fprintf(out, "def->setBitOrder(oaBitOrder(\"%s\"));\n",		(const char*) def->getBitOrder().getName());    }}voidBusNetDefObserver::onPreDestroy(oaModBusNetDef	*def){    if (def->isImplicit()) {	return;    }    oaString	name;    def->getName(ns, name);    getModule(def->getModule(), "module");    fprintf(out, "def = oaModBusNetDef::find(module, oaScalarName(ns, \"%s\"));\n",	    (const char*) name);    fprintf(out, "def->destroy();\n");}// *****************************************************************************// InstTermObserver::onPostCreate// InstTermObserver::onPostModify// InstTermObserver::onPreDestroy//// These functions print a representation of the API calls used to manipulate// instTerms.// *****************************************************************************voidInstTermObserver::onPostCreate(oaModInstTerm	*iterm){    if (iterm->isImplicit()) {	return;    }    getNet(iterm->getNet(), "net");    getInst(iterm->getInst(), "inst");    if (iterm->usesTermPosition()) {	fprintf(out, "iterm = oaModInstTerm::create(net, inst, oaUInt4(%d));\n",		iterm->getTermPosition());    } else {	oaString     name;	iterm->getTermName(ns, name);	fprintf(out, "iterm = oaModInstTerm::create(net, inst, oaName(ns, \"%s\"));\n",		(const char*) name);    }    itermCache = iterm;}voidInstTermObserver::onPostModify(oaModInstTerm		*iterm,			       oaInstTermModTypeEnum	modType){    getInstTerm(iterm, "iterm");    if (!iterm->isValid()) {	fprintf(out, "// oaInstTermModTypeEnum = %d\n", modType);	return;    }    switch (modType) {	case oacAddToNetInstTermModType:	    fprintf(out, "iterm->addToNet(net);\n");	    break;	case oacRemoveFromNetInstTermModType: 	    fprintf(out, "iterm->removeFromNet();\n");	    break;	case oacSetRouteMethodInstTermModType:	    fprintf(out, "// iterm->setRouteMethod(\"\");\n");	    break;	case oacSetImplicitInstTermModType:  	    fprintf(out, "// iterm->setImplicit();\n");	    break;	case oacScalarizeInstTermModType:   	    fprintf(out, "iterm->scalarize();\n");	    break;    }}voidInstTermObserver::onPreDestroy(oaModInstTerm	*iterm){    if (iterm->isImplicit()) {	return;    }    getInstTerm(iterm, "iterm");    fprintf(out, "iterm->destroy();\n");    itermCache = NULL;}// *****************************************************************************// InstObserver::onPostCreate// InstObserver::onPostModify// InstObserver::onPreDestroy//// These functions print a representation of the API calls used to manipulate// instances.// *****************************************************************************voidInstObserver::onPostCreate(oaModInst	*inst){    if (inst->isImplicit()) {	return;    }    getModule(inst->getModule(), "module");    oaString	name;    oaString	masterName;    inst->getName(ns, name);    getMaster(inst, masterName);    switch (inst->getType()) {      case oacModModuleScalarInstType:	fprintf(out, "inst = oaModModuleScalarInst::create(module, %s, oaScalarName(ns, \"%s\"));\n",		(const char*) masterName, (const char*) name);	break;      case oacModModuleVectorInstType:	{	    oaVectorName	vectorName;	    ((oaModModuleVectorInst*) inst)->getName(vectorName);	    vectorName.getBaseName(ns, name);	    fprintf(out, "inst = oaModModuleVectorInst::create(module, %s, oaScalarName(ns, \"%s\"), %d, %d);\n",		    (const char*) masterName, (const char*) name, 		    ((oaModModuleVectorInst*) inst)->getStart(),		    ((oaModModuleVectorInst*) inst)->getStop());	}	break;      case oacModModuleVectorInstBitType:	{	    oaVectorBitName	vectorBitName;	    ((oaModModuleVectorInstBit*) inst)->getName(vectorBitName);	    vectorBitName.getBaseName(ns, name);	    fprintf(out, "inst = oaModModuleVectorInstBit::create(module, %s, oaScalarName(ns, \"%s\"), %d);\n",		    (const char*) masterName, (const char*) name, 		    ((oaModModuleVectorInstBit*) inst)->getBitIndex());	}	break;      case oacModScalarInstType:	fprintf(out, "inst = oaModScalarInst::create(module, %s, oaScalarName(ns, \"%s\"));\n",	        (const char*) masterName, (const char*) name);	break;      case oacModVectorInstType:	{	    oaVectorName	vectorName;	    ((oaModModuleVectorInst*) inst)->getName(vectorName);	    vectorName.getBaseName(ns, name);	    fprintf(out, "inst = oaModVectorInst::create(module, %s, oaScalarName(ns, \"%s\"), %d, %d);\n",		    (const char*) masterName, (const char*) name, 		    ((oaModModuleVectorInst*) inst)->getStart(),

⌨️ 快捷键说明

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