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

📄 oa2lef.cpp

📁 openaccess读def,lef文件所用的源代码
💻 CPP
字号:
// *****************************************************************************// *****************************************************************************// oa2lef.cpp//// This is the main for the 'oa2lef' 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.41 $//  $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 = "oa2lef";// *****************************************************************************// oa2lefBuild// *****************************************************************************class oa2lefBuild : public oaBuildInfo {			    oa2lefBuild() : oaBuildInfo("oa2lef",							OA_BUILD_NAME,							OA_BUILD_TIME,							OA_BUILD_NUMBER) {}  private:    static oa2lefBuild	    buildInfo;};// *****************************************************************************// oaLefOutApp// *****************************************************************************class oaLefOutApp : public oaUtil::TranslatorApp<TranslatorOptions> {  public:			    oaLefOutApp();    oaBoolean		    validateArgs();    void		    run();  private:    LefOut		    writer;    LefOutOptions	    options;    Arg<oaString>	    lefOption;    Arg<ArgList>	    cellsOption;    Arg<ArgList>	    viewsOption;    Arg<oaString>	    versionOption;    Switch		    noTechOption;};// *****************************************************************************// Initialize Static Members// *****************************************************************************oa2lefBuild		    oa2lefBuild::buildInfo;// *****************************************************************************// oaLefOutApp::oaLefOutApp()//// This	is the constructor for the oaLefOutApp.  It takes no arguments,// but it does set defaults which may be changed via the other methods of the// option class.// *****************************************************************************oaLefOutApp::oaLefOutApp():   oaUtil::TranslatorApp<TranslatorOptions>("Translates OpenAccess to LEF"),    writer(_msgs),    cellsOption(_args, "cells", "[-cells cells]", "Input cell names",		ArgList(0)),    viewsOption(_args, "views", "[-views views]", "Input view names",		ArgList(0)),    lefOption(_args, "lef", "-lef file", "LEF file name"),    versionOption(_args, "ver", "[-ver version]", "DEF version to write out",		  ""),    noTechOption(_args, "noTech", "[-noTech]",		 "Do not output technology information"){}// *****************************************************************************// oaLefOutApp::validateArgs()//// This function populates the DefInOptions object using the options defined// for def2oa// *****************************************************************************oaBooleanoaLefOutApp::validateArgs(){    oaString	value;        // Common options    if (_args.getLibOption()->getValue(value)) {	options.setLibName(value);    }    // oa2lef specific options    if (lefOption.getValue(value)) {	options.setFileName(value);	if (TranslatorOptions::useStdio(value)) {	    _msgs.setOutFile(NULL);	}    }    ArgList listValue;    if (cellsOption.getValue(listValue)) {	for (oaUInt4 i = 0; i < listValue.getNumElements(); i++) {	    options.addCellName(listValue[i]);	}	if (options.getNumCellNames() == 0) {	    options.setWriteCells(false);	}    }    if (viewsOption.getValue(listValue)) {	for (oaUInt4 i = 0; i < listValue.getNumElements(); i++) {	    options.addViewName(listValue[i]);	}    }    if (versionOption.getValue(value)) {	options.setVersion(LefDefVersion(value));    }    options.setWriteTech(!noTechOption.isSpecified());    return true;}// *****************************************************************************// oaLefOutApp::run()//// This function runs the translator and reports statistics.// *****************************************************************************voidoaLefOutApp::run(){    if ((TranslatorOptions::useStdio(lefOption.getValue()))) {	writer.run(stdout, &options);    } else {	writer.run(&options);    }}// *****************************************************************************// main()//// This is the main function for the 'lef2oa' translator.// *****************************************************************************intmain(int argc, char **argv){    oaDesignInit();    oaLefOutApp  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 + -