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

📄 oadeftest.cpp

📁 openaccess读def,lef文件所用的源代码
💻 CPP
📖 第 1 页 / 共 2 页
字号:
// *****************************************************************************// *****************************************************************************// DefTest.cpp//// This file contains the member functions specific to the DefTest 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 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: sailajad $// $Revision: 1.59 $// $Date: 2005/08/05 01:46:36 $// $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaTest.h"#include "oaDefTest.h"#include "defzlib.hpp"#include "oaDefTest.inl"// *****************************************************************************// DefTest::preTest()//// This function makes preparations before the test is run. This includes// opening the output file (for unitTest output), deleting the technology// library (it is created by the test), and resetting the library list file.// *****************************************************************************voidDefTest::preTest(){    msgs.setLogFile(getName() + ".out");    msgs.setOutFile(NULL);    msgs.setErrFile(NULL);    resetLibList();    if (copyRefFiles) {	oaString    refFiles[4];	oaString    tmp;	refFiles[0] = getName() + ".lef";	refFiles[1] = getName() + ".def";	refFiles[2] = getName() + ".ref";	refFiles[3] = getName() + ".def.ref";	for (oaUInt4 i = 0; i < 4; i++) {	    getRelPath(refFiles[i], tmp);	    if (!tmp.isEmpty() && tmp != refFiles[i]) {		copyFile(tmp, refFiles[i]);	    }	}    }}// *****************************************************************************// DefTest::testClass()//// This is tester for the DEF import-export test case.// *****************************************************************************oaBooleanDefTest::testClass(){    return testLefIn(getName() + ".lef")	       && testDefIn(getName() + ".def")	       && testDefOut(getName() + ".def.out")	       && testReread(getName() + ".def.out");}// *****************************************************************************// DefTest::testLefIn()//// This function imports a LEF file to create technology data for this test.// *****************************************************************************oaBooleanDefTest::testLefIn(const oaString &fileName){    LefInOptions	options;    options.addFileName(fileName);    options.setLibName(libName);    lefIn.run(&options);    return result;}// *****************************************************************************// DefTest::testDefIn()//// This function imports a DEF file to create design data for this test.// *****************************************************************************oaBooleanDefTest::testDefIn(const oaString &fileName){    DefInOptions    options;    options.addFileName(fileName);    options.setLibName(libName);    options.setCellName("cell");    options.setViewName("layout");    options.addMasterViewName("undef");    options.addMasterViewName("abstract");    defIn.run(&options);    return result;}// *****************************************************************************// DefTest::testDefOut()//// This function exports DEF from the test library.// *****************************************************************************oaBooleanDefTest::testDefOut(const oaString	&fileName){    DefOutOptions	options;    options.setFileName(fileName);    options.setLibName(libName);    options.setCellName("cell");    options.setViewName("layout");    defOut.run(&options);    return result;}// *****************************************************************************// DefTest::testReread()//// This function imports a DEF file to create design data for this test.// *****************************************************************************oaBooleanDefTest::testReread(const oaString &fileName){    DefInOptions    options;    FILE	    *file = (FILE*) defGZipOpen(fileName, "rb");    options.setLibName(libName + "_2");    options.setTechLibName(libName);    options.setCellName("cell");    options.setViewName("layout");    defIn.run(file, &options);    defGZipClose(file);    return result;}// *****************************************************************************// DefDefTest::postTest()//// This function returns a boolean indicating indicating if there was a diff// between the reference and output files. This comparison is only made if the// output file was enabled; if no output file was opened, true is returned.// *****************************************************************************oaBooleanDefTest::postTest(){    oaBoolean res = true;    msgs.setLogFile(NULL);    res &= compareOutputByName(getName() + ".def");    res &= LefDefTest::postTest();    return res;}// *****************************************************************************// DefTestUpdate::preTest()//// This function makes preparations before the test is run. This includes// opening the output file (for unitTest output), deleting the technology// library (it is created by the test), and resetting the library list file.// *****************************************************************************voidDefTestUpdate::preTest(){    DefTest::preTest();    if (copyRefFiles) {	oaString    refFile = getName() + ".update.def";	oaString    tmp;	getRelPath(refFile, tmp);	if (!tmp.isEmpty() && tmp != refFile) {	    copyFile(tmp, refFile);	}    }}// *****************************************************************************// DefTestUpdate::testClass()//// This is tester for the DEF import-export test case.// *****************************************************************************oaBooleanDefTestUpdate::testClass(){    return testLefIn(getName() + ".lef")	       && testDefIn(getName() + ".def")	       && testDefInUpdate(getName() + ".update.def")	       && testDefOut(getName() + ".def.out");}// *****************************************************************************// DefTestUpdate::testDefIn()//// This function imports a DEF file to create design data for this test.// *****************************************************************************oaBooleanDefTestUpdate::testDefInUpdate(const oaString	&fileName){    DefInOptions    options;    options.addFileName(fileName);    options.setLibName(libName);    options.setCellName("cell");    options.setViewName("layout");    options.setOverwrite(false);    // Test updating of cellType.    oaDesign	*design = oaDesign::open(options.getLibName(), 					 options.getCellName(),					 options.getViewName(), 'a');    oaBlock	*blk = design->getTopBlock();    design->setCellType(oacNoCellType);    design->save();    design->close();    defIn.run(&options);    design = oaDesign::open(options.getLibName(),			    options.getCellName(),			    options.getViewName(), 'r');    verify(design->getCellType() == oacSoftMacroCellType);    design->close();    return result;}// *****************************************************************************// DefTestNoModHier::testDefIn()//// This function imports a DEF file to create design data for this test.// *****************************************************************************oaBooleanDefTestNoModHier::testDefIn(const oaString	&fileName){    DefInOptions    options;    options.addFileName(fileName);    options.setLibName(libName);    options.setCellName("cell");    options.setViewName("layout");    options.setCreateModHier(false);    defIn.run(&options);    return result;}// *****************************************************************************// DefTestOptimize::testDefIn()//// This function imports a DEF file to create design data for this test.// *****************************************************************************oaBooleanDefTestOptimize::testDefIn(const oaString	&fileName){    DefInOptions    options;    options.addFileName(fileName);    options.setLibName(libName);    options.setCellName("cell");    options.setViewName("layout");    defIn.run(&options);    return result;}// *****************************************************************************// DefTest53::preTest()//// This function makes preparations before the test is run. This includes// opening the output file (for unitTest output), deleting the technology// library (it is created by the test), and resetting the library list file.// *****************************************************************************void

⌨️ 快捷键说明

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