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

📄 oaverilogin.cpp

📁 openaccess与verilog互相转化时所用的源代码
💻 CPP
字号:
// *****************************************************************************// *****************************************************************************// oaVerilogIn.cpp//// This file contains the implementation of the VerilogIn 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: sailajad $//  $Revision: 1.34 $//  $Date: 2005/07/17 21:07:32 $//  $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaVerilogInPvt.h"BEGIN_VERILOG_NAMESPACE// *****************************************************************************// VerilogIn::VerilogIn()//// This function is the constructor for the VerilogIn class.// *****************************************************************************VerilogIn::VerilogIn(MsgAdapter	    &msgsIn):   scanner(NULL),    parser(NULL),    appCallbacks(NULL),    options(msgsIn),    defaultCallbacks(false){    scanner = new Scanner;    appCallbacks = new ModuleCallbacksIn(*scanner, options);    defaultCallbacks = true;    ParserParam	params(*scanner, appCallbacks);    parser = new Parser(false, params);}// *****************************************************************************// VerilogIn::~VerilogIn()//// This function is the destructor for the VerilogIn class.// *****************************************************************************VerilogIn::~VerilogIn(){    if (defaultCallbacks) {	delete appCallbacks;    }    delete scanner;    delete parser;}// *****************************************************************************// VerilogIn::enableDesignPerMod()//// This function sets the "Design Per Module" option of the parser.  If the // default callbacks are being used, then the callbacks to the parser are// also set accordingly.// *****************************************************************************voidVerilogIn::enableDesignPerMod(oaBoolean	value){    if (defaultCallbacks) {	delete appCallbacks;	if (value) {	    appCallbacks = new CallbacksIn(*scanner, options);	} else {	    appCallbacks = new ModuleCallbacksIn(*scanner, options);	}    }    options.enableDesignPerMod(value);}// *****************************************************************************// VerilogIn::makeTempDesignName()//// This function creates a name for a temporary design.// *****************************************************************************voidVerilogIn::makeTempDesignName(oaScalarName  &cellName){    oaString    buf(128);    oaUInt4 i = 0;    oaLib   *lib = oaLib::find(options.getLibName());    do {	buf.format("%s%d", (const char*) options.getTempDesignPrefix(), i++);	cellName.init(vns, buf);    } while (oaCell::find(lib, cellName));}// *****************************************************************************// VerilogIn::setCallbacks()//// This function sets the callbacks to be used by the parser when certain rules // are accepted.// *****************************************************************************voidVerilogIn::setCallbacks(CallbacksIn &newCallbacks){    if (defaultCallbacks) {	delete appCallbacks;    }    defaultCallbacks = false;    appCallbacks = &newCallbacks;    parser->setCallbacks(newCallbacks);}// *****************************************************************************// VerilogIn::parse()//// This function is the main entry point for the parser.// *****************************************************************************voidVerilogIn::parse(){    try {	oaScalarName    tmpName;	makeTempDesignName(tmpName);	options.setTempDesignName(tmpName);	options.enableWarnings(true);	appCallbacks->init();	parser->setCallbacks(*appCallbacks);	parser->init(options.getVerilogFiles());	parser->parse();	options.clearFiles();    }    catch (Error &verilogExcp) {	options.clearFiles();	throw verilogExcp;    }    catch (oaException	&excp) {	Error	err(DBException, options.testFileAndLine() ? scanner : NULL, 		    (const char*) excp.getMsg());	options.clearFiles();	throw err;    }}END_VERILOG_NAMESPACE

⌨️ 快捷键说明

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