📄 oaverilogintestcb.cpp
字号:
// *****************************************************************************// *****************************************************************************// oaVerilogInTestCB.cpp//// This file contains the implementation of OA callbacks that are active // during the Verilog reader test. These callbacks are used to trace the// activity of the reader and the output that they produce is compared against// a standard to determine whether or not the test passes.//// *****************************************************************************// 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 istributed in any way, in any medium,// in whole or in part, without prior written permission from Cadence.//// Copyright 2003-2005 Cadence Design Systems, Inc.// All Rights Reserved.//// $Author: shaun $// $Revision: 1.31 $// $Date: 2005/05/19 00:48:52 $// $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaVerilogInTest.h"// *****************************************************************************// DumpObserver::DumpObserver()//// This is the constructor for the DumpObserver class.// *****************************************************************************DumpObserver::DumpObserver(const oaString &testName, oaTestOutput &toutIn): oaObserver<oaDesign>(1, false), name(testName), tout(toutIn), shift(4){}// *****************************************************************************// DumpObserver::onPostSave()//// This is the action to take when cell views are saved.// *****************************************************************************voidDumpObserver::onPostSave(oaDesign *cv, oaBoolean succeeded){ oaScalarName libName; oaScalarName cellName; oaScalarName viewName; cv->getLibName(libName); cv->getCellName(cellName); cv->getViewName(viewName); dump(cv, libName, cellName, viewName);}// *****************************************************************************// DumpObserver::onPostSaveAs()//// This is the action to take when cell views are saved.// *****************************************************************************voidDumpObserver::onPostSaveAs(oaDesign *design, const oaScalarName &libName, const oaScalarName &cellName, const oaScalarName &viewName, oaBoolean succeeded){ dump(design, libName, cellName, viewName);}// *****************************************************************************// DumpObserver::dump()//// This method dumps the given design contents to the output stream.// *****************************************************************************voidDumpObserver::dump(oaDesign *design, const oaScalarName &libName, const oaScalarName &cellName, const oaScalarName &viewName){ oaNativeNS ns; oaString libNameStr; oaString cellNameStr; oaString viewNameStr; libName.get(ns, libNameStr); cellName.get(ns, cellNameStr); viewName.get(ns, viewNameStr); tout.printLine("Contents of %s.%s.%s\n", (const char*) libNameStr, (const char*) cellNameStr, (const char*) viewNameStr); tout.incIndent(shift); oaScalarName moduleName; oaIter<oaModule> modIter(design->getModules()); while (oaModule *module = modIter.getNext()) { module->getName(moduleName); moduleName.get(ns, cellNameStr); tout.printLine("Contents of %smodule %s\n", module == design->getTopModule() ? "TOP " : "", (const char*) cellNameStr); tout.incIndent(shift); oaIter<oaModTerm> termIter(module->getTerms()); while (oaModTerm *term = termIter.getNext()) { tout.print(term, 1); } oaIter<oaModNet> netIter(module->getNets()); while (oaModNet *net = netIter.getNext()) { tout.print(net, 1); if (net->getSigType() != oacSignalSigType) { tout.incIndent(shift); tout.printLine("SigType:\t%s\n", (const char*) net->getSigType().getName()); tout.decIndent(shift); } if (net->isGlobal()) { tout.incIndent(shift); tout.printLine("Global:\ttrue\n"); tout.decIndent(shift); } if (net->isModBitNet() && !((oaModBitNet*) net)->getEquivalentNets().isEmpty()) { oaModBitNet *bitnet = (oaModBitNet*) net; tout.incIndent(shift * 2); oaString netName; oaIter<oaModBitNet> equivIter(bitnet->getEquivalentNets()); oaModBitNet *equiv = equivIter.getNext(); equiv->getName(ns, netName); tout.printLine("Equiv:\t%s", (const char*) netName); while (equiv = equivIter.getNext()) { equiv->getName(ns, netName); tout.print(", %s", (const char*) netName); } tout.print("\n"); tout.decIndent(shift * 2); } } oaIter<oaModInst> instIter(module->getInsts()); while (oaModInst *inst = instIter.getNext()) { tout.print(inst, 1); } netIter.reset(); while (oaModNet *net = netIter.getNext()) { oaIter<oaModInstTerm> itermIter(net->getInstTerms()); while (oaModInstTerm *iterm = itermIter.getNext()) { tout.print(iterm, 1); } } tout.decIndent(shift); } tout.decIndent(shift); tout.print("\n\n\n");}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -