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

📄 oaverilogoutunbound.cpp

📁 openaccess与verilog互相转化时所用的源代码
💻 CPP
字号:
// *****************************************************************************// *****************************************************************************// oaVerilogOutUnbound.cpp//// This file contains the implementation of the	oaVerilogOutUnbound class.//// *****************************************************************************// Except as specified in the OpenAccess terms of use of Cadence or Silicon// Integration Initiative, this	material may not be copied, modified,// re-published, uploaded, executed, or	istributed in any way, in any medium,// in whole or in part,	without	prior written permission from Cadence.////		  Copyright 2003-2005 Cadence Design	Systems, Inc.//			     All Rights	Reserved.////  $Author: shaun $//  $Revision: 1.6 $//  $Date: 2005/07/09 17:27:54 $//  $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaVerilogOutTest.h"// *****************************************************************************// oaVerilogOutUnbound::oaVerilogOutUnbound()//// This is the constructor for the oaVerilogOutUnbound class.// *****************************************************************************oaVerilogOutUnbound::oaVerilogOutUnbound(const oaString &name):   oaVerilogOutTest(name){}// *****************************************************************************// oaVerilogOutUnbound::buildData()//// This function builds the data for the test.// *****************************************************************************voidoaVerilogOutUnbound::buildData(){    oaLib::create(libN, libStr);    oaDesign	    *topDesign = oaDesign::open(libN, cellN, viewN,						oaViewType::get(oacNetlist),						'w');    oaModule	    *top = oaModule::create(topDesign, cellN);    oaName	    vssName(ns, "VSS");    oaModNet	    *vss = oaModNet::create(top, vssName);    oaModNet	    *bundle = oaModNet::create(top, oaName(ns, "8*VSS"));    oaScalarName    instMaster(ns, "leaf");    oaScalarName    instName(ns, "I0");    oaModInst	    *modInst = oaModScalarInst::create(top, libN, instMaster,						       viewN, instName);    oaScalarName    modInstName(ns, "I1");    oaScalarName    modMaster(ns, "unboundMaster");    oaModModuleInst *modModInst = oaModModuleScalarInst::create(top, modMaster, 								modInstName);    oaVectorName    busTermName(ns, "BUS[7:0]");    oaModInstTerm   *modIterm = oaModInstTerm::create(bundle, modInst, 						      busTermName);    oaScalarName    scalarTermName(ns, "SCALAR");    oaModInstTerm::create(vss, modInst, scalarTermName);    topDesign->setTopModule(top);    topDesign->save();    topDesign->close();}// *****************************************************************************// oaVerilogOutUnbound::test()//// This method is the main entry point for the test.// *****************************************************************************oaBooleanoaVerilogOutUnbound::test(){    preTest();    openOutputFile();    const oaString  outFile("temp.v");    MsgAdapter	    msgs;    try {	buildData();	VerilogOut  writer(msgs);	OptionsOut  &writerOptions = writer.getOptions();	writerOptions.getMsgAdapter()->setOutFile(NULL);	writerOptions.setFileName(outFile);	writerOptions.setLibName(libStr);	writerOptions.setCellName(cellStr);	writerOptions.setViewName(viewStr);	writerOptions.enableProduceLeaf();	writerOptions.enableRecursive();	writer.write();    }    catch(Error    &verr) {	tout.print(verr.getMsg());	throw;    }    catch(oaException	 &oaErr) {	tout.print((const char*) oaErr.getMsg());	throw;    }    catch(...) {	tout.print("Caught an exception that was not handled by the writer.\n");	throw;    }    FILE    *moduleFP = fopen((const char*) outFile, "r");    if (moduleFP) {	char buf[128];	while (fgets(buf, 127, moduleFP)) {	    tout.printLine(buf);	}	fclose(moduleFP);    } else {	tout.printLine("Unable to open the output file, %s\n",		       (const char*) outFile);    }    closeOutputFile();    cleanup(libStr);    return compareOutputByName(getName());}

⌨️ 快捷键说明

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