📄 oa2def.cpp
字号:
// *****************************************************************************// *****************************************************************************// oa2def.cpp//// This is the main for the 'oa2def' 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.36 $// $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 = "oa2def";// *****************************************************************************// oa2defBuild// *****************************************************************************class oa2defBuild : public oa::oaBuildInfo { oa2defBuild() : oa::oaBuildInfo("oa2def", OA_BUILD_NAME, OA_BUILD_TIME, OA_BUILD_NUMBER) {} private: static oa2defBuild buildInfo;};// *****************************************************************************// oaDefOutApp// *****************************************************************************class oaDefOutApp : public oaUtil::TranslatorApp<WriterOptions> { public: oaDefOutApp(); oaBoolean validateArgs(); void run(); private: DefOut writer; DefOutOptions options; Arg<oaString> defOption; Arg<oaString> versionOption;};// *****************************************************************************// Initialize Static Members// *****************************************************************************oa2defBuild oa2defBuild::buildInfo;// *****************************************************************************// oaDefOutApp::oaDefOutApp()//// 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.// *****************************************************************************oaDefOutApp::oaDefOutApp(): oaUtil::TranslatorApp<WriterOptions>("Translates OpenAccess to DEF"), writer(_msgs), defOption (_args, "def", "-def file", "DEF file name"), versionOption(_args, "ver", "[-ver version]", "DEF version", ""){}// *****************************************************************************// oaDefOutApp::validateArgs()//// This function populates the DefInOptions object using the options defined// for def2oa// *****************************************************************************oaBooleanoaDefOutApp::validateArgs(){ oaString value; // Common options if (_args.getLibOption()->getValue(value)) { options.setLibName(value); } if (_args.getCellOption()->getValue(value)) { options.setCellName(value); } if (_args.getViewOption()->getValue(value)) { options.setViewName(value); } // oa2def specific options if (defOption.getValue(value)) { options.setFileName(value); if (TranslatorOptions::useStdio(value)) { _msgs.setOutFile(NULL); } } if (versionOption.getValue(value)) { options.setVersion(LefDefVersion(value)); } return true;}// *****************************************************************************// oaDefOutApp::run()//// This function runs the translator and reports statistics.// *****************************************************************************voidoaDefOutApp::run(){ if (TranslatorOptions::useStdio(defOption.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(); oaDefOutApp 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 + -