📄 oadefoutscanchain.cpp
字号:
// *****************************************************************************// *****************************************************************************// DefOutScanChains.cpp//// Functions to handle DEF SCANCHAINS constructs for the 'DefOut' 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: mhahn $// $Revision: 1.14 $// $Date: 2005/01/04 03:26:16 $// $State: Exp $// *****************************************************************************// *****************************************************************************#include "oaLefDef.h"BEGIN_LEFDEF_NAMESPACE// *****************************************************************************// DefOutScanChain::DefOutScanChain()// DefOutScanChain::~DefOutScanChain()//// This is the constructor for the DefOutScanChain class. // *****************************************************************************DefOutScanChain::DefOutScanChain(DefOut &translator): defOut(translator){ translator.defOutScanChain = this;}DefOutScanChain::~DefOutScanChain(){}// *****************************************************************************// DefOutScanChain::write()// // This function writes a DEF SCANCHAINS statement.// *****************************************************************************voidDefOutScanChain::write(oaScanChain *scanChainIn){ scanChain = scanChainIn; oaString scanChainName; scanChain->getName(scanChainName); defOut.output("- %s", (const char*)scanChainName); defOut.incIndent(); writePartition(); writeStart(); writeFloating(); writeOrdered(); writeStop(); defOut.outNoIndent(" ;\n"); defOut.decIndent();}// *****************************************************************************// DefOutScanChain::writeStart()//// This function writes out the START object of the current scanChain.//// Syntax:// [+ START {fixedInComp | PIN} [outPin] ]// *****************************************************************************voidDefOutScanChain::writeStart(){ oaDesignObject *startObj = scanChain->getStartObject(); if (!startObj) { return; } if (startObj->getType() == oacScalarTermType) { oaString termName; ((oaTerm*)startObj)->getName(defOut.getNS(), termName); defOut.outNoIndent("\n"); defOut.output("+ START PIN %s", (const char*)termName); } else if (startObj->getType() == oacInstTermType) { oaString instName; (((oaInstTerm*)startObj)->getInst())->getName(defOut.getNS(), instName); oaString termName; (((oaInstTerm*)startObj)->getTerm())->getName(defOut.getNS(), termName); defOut.outNoIndent("\n"); defOut.output("+ START %s %s", (const char*)instName, (const char*)termName); }}// *****************************************************************************// DefOutScanChain::writeFloating()//// This function writes out the FLOATING scanChainSets for the current chain.//// Syntax:// {+ FLOATING {floatingComp [( IN pin )] [( OUT pin )] [( BITS numBits )]}...}// *****************************************************************************voidDefOutScanChain::writeFloating(){ oaIter<oaScanChainSet> scIter(scanChain->getScanChainSets(oacUnorderedScanChainSetType)); oaScanChainSet *scs; while (scs = scIter.getNext()) { defOut.outNoIndent("\n"); defOut.output("+ FLOATING"); defOut.incIndent(); oaIter<oaScanChainInst> scsIter(scs->getInstances()); oaScanChainInst* sci; while (sci = scsIter.getNext()) { oaInst *inst = sci->getInstance(); oaString instName; inst->getName(defOut.getNS(), instName); oaInstTerm *inInstTerm = sci->getInInstTerm(); oaString inTermName; (inInstTerm->getTerm())->getName(defOut.getNS(), inTermName); oaInstTerm *outInstTerm = sci->getOutInstTerm(); oaString outTermName; (outInstTerm->getTerm())->getName(defOut.getNS(), outTermName); defOut.outNoIndent("\n"); defOut.output(" %s ( IN %s ) ( OUT %s )", (const char*)instName, (const char*)inTermName, (const char*)outTermName); if (defOut.getOptions()->getVersion() > cLefDefVersion54) { if (sci->getSeqBitLength() > 1) { defOut.outNoIndent(" ( BITS %d )", sci->getSeqBitLength()); } } } defOut.decIndent(); }}// *****************************************************************************// DefOutScanChain::writeOrdered()//// This function writes out the ORDERED scanChainSets for the current scanChain.//// Syntax:// [+ ORDERED // {fixedComp [( IN pin )] [( OUT pin )] [( BITS numBits )]// fixedComp [( IN pin )] [( OUT pin )] [( BITS numBits )]}// [fixedComp [( IN pin )] [( OUT pin )] [( BITS numBits )]]...] // *****************************************************************************voidDefOutScanChain::writeOrdered(){ oaIter<oaScanChainSet> scIter(scanChain->getScanChainSets(oacOrderedScanChainSetType)); oaScanChainSet *scs; while (scs = scIter.getNext()) { defOut.outNoIndent("\n"); defOut.output("+ ORDERED"); defOut.incIndent(); oaIter<oaScanChainInst> scsIter(scs->getInstances()); oaScanChainInst* sci; while (sci = scsIter.getNext()) { oaInst *inst = sci->getInstance(); oaString instName; inst->getName(defOut.getNS(), instName); oaInstTerm *inInstTerm = sci->getInInstTerm(); oaString inTermName; (inInstTerm->getTerm())->getName(defOut.getNS(), inTermName); oaInstTerm *outInstTerm = sci->getOutInstTerm(); oaString outTermName; (outInstTerm->getTerm())->getName(defOut.getNS(), outTermName); defOut.outNoIndent("\n"); defOut.output(" %s ( IN %s ) ( OUT %s )", (const char*)instName, (const char*)inTermName, (const char*)outTermName); if (defOut.getOptions()->getVersion() > cLefDefVersion54) { if (sci->getSeqBitLength() > 1) { defOut.outNoIndent(" ( BITS %d )", sci->getSeqBitLength()); } } } defOut.decIndent(); }}// *****************************************************************************// DefOutScanChain::writeStop()//// This function writes out the stop object for the current scanChain.//// Syntax:// [+ STOP {fixedOutComp | PIN} [inPin] ] ;]... // *****************************************************************************voidDefOutScanChain::writeStop(){ oaDesignObject *stopObj = scanChain->getStopObject(); if (!stopObj) { return; } if (stopObj->getType() == oacScalarTermType) { oaString termName; ((oaTerm*)stopObj)->getName(defOut.getNS(), termName); defOut.outNoIndent("\n"); defOut.output("+ STOP PIN %s", (const char*)termName); } else if (stopObj->getType() == oacInstTermType) { oaString instName; (((oaInstTerm*)stopObj)->getInst())->getName(defOut.getNS(), instName); oaString termName; (((oaInstTerm*)stopObj)->getTerm())->getName(defOut.getNS(), termName); defOut.outNoIndent("\n"); defOut.output("+ STOP %s %s", (const char*)instName, (const char*)termName); }}// *****************************************************************************// DefOutScanChain::writePartition()//// This function writes out the partition attribute for the current scanChain.//// Syntax: (5.5 Only)// [+ PARTITION name [MAXBITS maxbits]]// *****************************************************************************voidDefOutScanChain::writePartition(){ if (defOut.getOptions()->getVersion() < cLefDefVersion55) { return; } oaString name; scanChain->getPartitionName(name); if (name != "") { defOut.outNoIndent("\n"); defOut.output("+ PARTITION %s", (const char *) name); if (scanChain->getMaxBits()) { defOut.outNoIndent(" MAXBITS %d", scanChain->getMaxBits()); } }}END_LEFDEF_NAMESPACE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -