📄 oaleftest.cpp
字号:
// *****************************************************************************// *****************************************************************************// LefTest.cpp//// This file contains the member functions specific to the LefTest 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.65 $// $Date: 2005/08/05 01:46:36 $// $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaTest.h"#include "oaLefTest.h"#include "defzlib.hpp"#include "oaLefTest.inl"// *****************************************************************************// LefTest::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.// *****************************************************************************voidLefTest::preTest(){ msgs.setLogFile(getName() + ".out"); msgs.setOutFile(NULL); msgs.setErrFile(NULL); resetLibList(); if (copyRefFiles) { oaString refFiles[3]; oaString tmp; refFiles[0] = getName() + ".lef"; refFiles[1] = getName() + ".ref"; refFiles[2] = getName() + ".lef.ref"; for (oaUInt4 i = 0; i < 3; i++) { getRelPath(refFiles[i], tmp); if (!tmp.isEmpty() && tmp != refFiles[i]) { copyFile(tmp, refFiles[i]); } } }}// *****************************************************************************// LefTest::testClass()//// This is tester for the LEF import-export test case.// *****************************************************************************oaBooleanLefTest::testClass(){ return testLefIn() && testLefOut() && testReread();}// *****************************************************************************// LefTest::testLefIn()//// This function imports a LEF file in order to create technology data for// exercising the LEF export translator.// *****************************************************************************oaBooleanLefTest::testLefIn(){ LefInOptions options; options.addFileName(getName() + ".lef"); options.setLibName(libName); options.setViewName("abstract"); lefIn.run(&options); return result;}// *****************************************************************************// LefTest::testLefOut()//// This function exports LEF from the test library.// *****************************************************************************oaBooleanLefTest::testLefOut(){ LefOutOptions options; options.setFileName(getName() + ".lef.out"); options.setLibName(libName); lefOut.run(&options); return result;}// *****************************************************************************// LefTest::testReRead()//// This function imports a LEF file in order to create technology data for// exercising the LEF export translator.// *****************************************************************************oaBooleanLefTest::testReread(){ LefInOptions options; options.addFileName(getName() + ".lef.out"); options.setLibName(libName + "_2"); lefIn.run(&options); return result;}// *****************************************************************************// LefDefTest::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.// *****************************************************************************oaBooleanLefTest::postTest(){ oaBoolean res = true; msgs.setLogFile(NULL); res &= compareOutputByName(getName() + ".lef"); res &= LefDefTest::postTest(); return res;}// *****************************************************************************// LefTestUpdate::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.// *****************************************************************************voidLefTestUpdate::preTest(){ LefTest::preTest(); if (copyRefFiles) { oaString refFile = getName() + ".update.lef"; oaString tmp; getRelPath(refFile, tmp); if (!tmp.isEmpty() && tmp != refFile) { copyFile(tmp, refFile); } }}// *****************************************************************************// LefTestUpdate::testClass()//// This is tester for the LEF import-import-export test case.// The import is done twice to check "default update mode"// *****************************************************************************oaBooleanLefTestUpdate::testClass(){ return testLefIn() && testLefInUpdate() && testLefOut();}// *****************************************************************************// LefTestUpdate::testLefInUpdate()//// This function imports a LEF file in order to create technology data for// exercising the LEF export translator.// *****************************************************************************oaBooleanLefTestUpdate::testLefInUpdate(){ LefInOptions options; options.addFileName(getName() + ".update.lef"); options.setLibName(libName); options.setOverwrite(false); lefIn.run(&options); return result;}// *****************************************************************************// LefTestOverwrite::testClass()//// This is tester for the LEF import-import-export test case.// *****************************************************************************oaBooleanLefTestOverwrite::testClass(){ return testLefIn() && testLefIn() && testLefOut();}// *****************************************************************************// LefTestOverwrite::testLefIn()//// This function imports a LEF file in order to create technology data for// exercising the LEF export translator.// *****************************************************************************oaBooleanLefTestOverwrite::testLefIn(){ LefInOptions options; options.addFileName(getName() + ".lef"); options.setLibName(libName); options.setOverwrite(); lefIn.run(&options); return result;}// *****************************************************************************// LefTestTechAttach::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.// *****************************************************************************voidLefTestTechAttach::preTest(){ oaString techLibName(getName() + "_tech_lib"); oaScalarName scalarTechLibName(nameSpace, techLibName); if (oaDir(techLibName).exists()) { oaDir(techLibName).destroy(); } if (copyRefFiles) { oaString refFiles[1]; oaString tmp; refFiles[0] = getName() + ".tech.lef"; for (oaUInt4 i = 0; i < 1; i++) { getRelPath(refFiles[i], tmp); if (!tmp.isEmpty() && tmp != refFiles[i]) { copyFile(tmp, refFiles[i]); } } } LefTest::preTest();}// *****************************************************************************// LefTestTechAttach::testClass()//// This is tester for the LEF import-export test case.// *****************************************************************************oaBooleanLefTestTechAttach::testClass(){ return testTechLefIn() && testLefIn() && testLefOut() && testReread();}// *****************************************************************************// LefTestTechAttach::testTechLefIn()//// This function imports a LEF file in order to create technology data for// exercising the LEF export translator.// *****************************************************************************oaBooleanLefTestTechAttach::testTechLefIn(){ LefInOptions options; oaString techLibName = getName() + "_tech_lib"; options.addFileName(getName() + ".tech.lef"); options.setLibName(techLibName); lefIn.run(&options);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -