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

📄 def2oa.cpp

📁 openaccess读def,lef文件所用的源代码
💻 CPP
字号:
// *****************************************************************************// *****************************************************************************// def2oa.cpp//// This is the main for the 'def2oa' translator.//// *****************************************************************************// 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 distributed in any way, in any medium,// in whole or in part, without prior written permission from Cadence.////                Copyright 2002-2005 Cadence Design Systems, Inc.//                           All Rights Reserved.////  $Author: shaun $//  $Revision: 1.62 $//  $Date: 2005/06/06 17:44:00 $//  $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaUtil.h"#include "oaUtilApp.h"#include "oaLefDef.h"using namespace oaUtil;using namespace oaLefDef;// *****************************************************************************// Declare the name of the application.// *****************************************************************************static const oaString	toolName = "def2oa";// *****************************************************************************// def2oaBuild// *****************************************************************************class def2oaBuild : public oa::oaBuildInfo {			    def2oaBuild() : oa::oaBuildInfo(toolName,							    OA_BUILD_NAME,							    OA_BUILD_TIME,							    OA_BUILD_NUMBER) {}  private:    static def2oaBuild	    buildInfo;};// *****************************************************************************// oaDefInApp// *****************************************************************************class oaDefInApp : public oaUtil::TranslatorApp<ReaderOptions> {  public:			    oaDefInApp();    oaBoolean		    validateArgs();    void		    run();  private:    DefIn		    reader;    DefInOptions	    options;        Arg<ArgList>	    defOption;    Arg<oaString>	    techLibOption;    Arg<oaString>	    cellOption;    Arg<oaString>	    viewOption;    Arg<ArgList>	    masterLibsOption;    Arg<ArgList>	    masterViewsOption;    Switch		    customViasOption;    //Switch		    stdViasOption;    Switch		    modHierOption;    Switch		    routingOption;    Arg<oaString>	    commentCharOption;};// *****************************************************************************// Initialize Static Members// *****************************************************************************def2oaBuild	def2oaBuild::buildInfo;// *****************************************************************************// oaDefInApp::oaDefInApp()//// This	is the constructor for the def2oaOptions.  It takes no arguments,// but it does set defaults which may be changed via the other methods of the// option class.// *****************************************************************************oaDefInApp::oaDefInApp():   oaUtil::TranslatorApp<ReaderOptions>("Translates DEF to OpenAccess"),    reader(_msgs),    defOption(_args, "def", "-def file", "DEF file name(s)"),    cellOption(_args, "cell", "[-cell cellName]",	       "Output cell name (default: DESIGN name)", ""),    viewOption(_args, "view", "[-view viewName]",	       "Output view name (default: layout)", "layout"),    techLibOption(_args, "techLib", "[-techLib libName]", "Tech library name",		  ""),    masterLibsOption(_args, "masterLibs", "[-masterLibs libList]",		     "List of libraries that contain master cells", ArgList(0)),    masterViewsOption(_args, "masterViews", "[-masterViews viewList]",		      "List of master view names", ArgList(0)),    commentCharOption(_args, "commentChar", "[-commentChar char]",		      "Identifies the comment character", "#"),    customViasOption(_args, "useCustomVias", "[-useCustomVias]",		     "Create custom vias for all DEF VIAS"),    //stdViasOption(_args, "useDefaultStdVias", "[-useDefaultStdVias]",		  //"Allow use of default parameters in oaStdViaDefs for DEF VIAS"),    modHierOption(_args, "noModHier", "[-noModHier]",		  "Do not create a module hierarchy"		  " from hierarchical names"),    routingOption(_args, "noRouting", "[-noRouting]",		  "Do not create any routing data"){}// *****************************************************************************// oaDefInApp::validateArgs()//// This function populates the DefInOptions object using the options defined// for def2oa// *****************************************************************************oaBooleanoaDefInApp::validateArgs(){    oaString	value;        // Common options    if (_args.getLibOption()->getValue(value)) {	options.setLibName(value);    }    if (_args.getLibPathOption()->getValue(value)) {	options.setLibPath(value);    }    options.setLibOptions(_libOptions);    options.setOverwrite(_args.getOverwriteOption()->isSpecified());    // def2oa specific options    ArgList defFiles;    defOption.getValue(defFiles);    for (oaUInt4 i = 0; i < defFiles.getNumElements(); i++) {	options.addFileName(defFiles[i]);    }    if (techLibOption.getValue(value)) {	options.setTechLibName(value);    }    if (cellOption.getValue(value)) {	options.setCellName(value);    }    if (viewOption.getValue(value)) {	options.setViewName(value);    }    if (masterLibsOption.isSpecified()) {	ArgList masterLibs;	masterLibsOption.getValue(masterLibs);	for (oaUInt4 i = 0; i < masterLibs.getNumElements(); i++) {	    options.addMasterLibName(masterLibs[i]);	}    }    if (masterViewsOption.isSpecified()) {	ArgList masterViews;	masterViewsOption.getValue(masterViews);	for (oaUInt4 i = 0; i < masterViews.getNumElements(); i++) {	    options.addMasterViewName(masterViews[i]);	}    }    if (commentCharOption.getValue(value) && value.getLength() > 0) {	options.setCommentChar(*value);    }    options.setUseCustomVias(customViasOption.isSpecified());    //options.setUseDefaultStdVias(stdViasOption.isSpecified());    options.setCreateModHier(!modHierOption.isSpecified());    options.setRouting(!routingOption.isSpecified());    return true;}// *****************************************************************************// oaDefInApp::run()//// This function runs the translator and reports statistics.// *****************************************************************************voidoaDefInApp::run(){    reader.run(&options);}// *****************************************************************************// main()//// This is the main function for the 'def2oa' translator.// *****************************************************************************intmain(int argc, char **argv){    oaDesignInit();    oaDefInApp  app;    try {	app.main(argc, argv);    } catch (oaException	&excp) {	app.error(excp.getMsg());    }    return app.getExitStatus();}

⌨️ 快捷键说明

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