00001 #ifndef STIL2WAVEPATTERNEVAL_H 00002 #define STIL2WAVEPATTERNEVAL_H 00003 00004 #include <vector> 00005 #include <map> 00006 00007 #include "stilpatterneval.h" 00008 #include "stilsigrefexpr.h" 00009 00010 //--------------------------------------------------------------------------- 00021 //--------------------------------------------------------------------------- 00022 class STIL2WAVEPatternEval : public STILPatternEval 00023 { 00024 public: 00025 00026 ~STIL2WAVEPatternEval() { } 00027 00028 // These overloaded the default base implementation: 00029 void init(); 00030 void processVector(const STILVector*); 00031 void processVectorEnd(const STILVector*); 00032 void processCondition(const STILCondition*); 00033 void processConditionEnd(const STILCondition*); 00034 void processShift(const STILShift*); 00035 void processShiftEnd(const STILShift*); 00036 00037 void processVectorItem(const STILVectorItem*); 00038 void processWaveformTableRef(const sstring &); 00039 00040 private: 00041 00043 // private member funcs: 00044 00045 // Process "generic" vector block data (conditions, vectors, etc) 00046 void processVectorBlock(const STILVectorBlock*); 00047 void processVectorBlockEnd(const STILVectorBlock*); 00048 00049 // generate VCD signal names/mappings 00050 void genSigs(); 00051 00052 // Map a STIL event to a VCD event 00053 sstring mapEvent2Char(const STILEvent & genEvent); 00054 00055 // A SigRefExpr representing the list of signals that may have WFC data 00056 void genValidSignalSigRef(); 00057 00058 // Convert the buffered WFC data into WFCS (excludes any Signals that may not 00059 // have Pattern data) 00060 void genWFCS(); 00061 00063 // private data: 00064 00065 // maps int STIL sig id to VCD character id 00066 std::vector<sstring> m_stilsig2vcdsig; 00067 00068 // flag: is this the first vector we have processed? 00069 // (for determing the list of signals that may be used in the Pattern block) 00070 bool m_firstVec; 00071 00072 // Buffer of WFC's per pin 00073 sstring m_wfcBuff; 00074 00075 // Similar to m_wfcBuff, but with unused signals removed 00076 sstring m_wfcs; 00077 00078 // A SigRefExpr containing all signals that may be used in this Pattern 00079 // (determined by the first vector block statement) 00080 STILSigRefExpr m_validSignals; 00081 00082 00083 LONG m_numSigs; // total # signals in Signals block 00084 00085 LONG m_cycT0; // time at the beginning of the current cycle 00086 LONG m_period; // period of the cycle (specified in the waveformtable) 00087 const STILTiming * m_pTiming; // Ptr to the timing block 00088 bool m_conditionVec; // true if current vector block is a condition 00089 bool m_shiftVec; // true if in a shift block 00090 00091 // Some stat info for output 00092 LONG m_totalShiftCnt; 00093 LONG m_currShiftCnt; 00094 LONG m_shiftBlockNum; 00095 LONG m_lineCnt; 00096 00097 }; 00098 00099 00100 #endif