Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

stilpatternblock.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright (c) 2006 International Business Machines Corporation
00003  * All rights reserved. This program and the accompanying materials
00004  * are made available under the terms of the Common Public License v1.0
00005  * which accompanies this distribution, and is available at
00006  * http://www.opensource.org/licenses/cpl1.0.php
00007  *
00008  * Contributors:
00009  *    Douglas Sprague, Joel Wheeler - initial API and implementation
00010  *
00011  *****************************************************************************/
00012 
00013 #ifndef STILPatternBlock_H
00014 #define STILPatternBlock_H
00015 
00016 #include "stilcomstr.h"
00017 
00018 #include "stilblock.h"         // STIL Block Interface (base class)
00019 
00020 class STILLoop;                // STILLoop prototype declaration
00021 class STILShift;               // STILShift prototype declaration
00022 class STILVector;              // STIL Vector Interface
00023 class STILCondition;           // STIL Condition Interface
00024 class STILFixed;               // STIL Fixed Interface
00025 class STILCall;                // STIL Call Interface
00026 class STILMacro;               // STIL Macro Interface
00027 
00028 
00029 // Following inline function will prevent errors when compiling the
00030 // template code for the STL lists of the pointers to STILLoop's
00031 // This is needed because the compiler does not know how to ignore
00032 // delete when called on pointers with one level of indirection too much
00033 // (so says the STILBlock class, anyhow...)
00034 inline void destroy(STILLoop**) { }
00035 inline void destroy(STILShift**) { }
00036 
00037 //---------------------------------------------------------------------------
00045 //---------------------------------------------------------------------------
00046 class STILPatternBlock : public STILBlock {
00047 
00048 
00049   // - Global std::ostream << operator as friend to output STILPatternBlock object
00050   friend std::ostream& operator<<( std::ostream &os, const STILPatternBlock &);
00051 
00052   // - Public members
00053   public:
00054 
00055     // - Default Constructor
00056     STILPatternBlock();
00057 
00058     // - Construct given some entity type
00059     STILPatternBlock(Type t);
00060 
00061     // - Copy Constructor
00062     STILPatternBlock(const STILPatternBlock &);
00063 
00064     // - Destructor
00065     virtual ~STILPatternBlock();
00066 
00067     // - Assignment operator
00068     STILPatternBlock & operator=(const STILPatternBlock &);
00069 
00070     // - Initialize this STILPatternBlock object.
00071     void init();
00072 
00073     // - Clear out any currently stored up entities in this pattern block.
00074     void clear();
00075 
00076     // - Add a new vector to this pattern
00077     void addVector(const STILVector & v);
00078 
00079     // - Add a new WaveformTable to this pattern
00080     void addWaveformTable (const sstring & wtRef,
00081                            const sstring & label,
00082                                  LONG linenumber = 0,
00083                            const sstring & filename = "");
00084 
00085     // - Add a Condition to this pattern
00086     void addCondition(const STILCondition & c);
00087 
00088     // - Add a Fixed to this pattern
00089     void addFixed(const STILFixed & f);
00090 
00091     // - Add a new Call to this pattern
00092     void addCall(const STILCall & c);
00093 
00094     // - Add a new Macro to this pattern
00095     void addMacro(const STILMacro & m);
00096 
00097     // - Add a new Loop to this pattern
00098     void addLoop(const STILLoop & l);
00099 
00100     // - Add a new MatchLoop to this pattern
00101     //void addMatchLoop(const STILMatchLoop & ml);
00102 
00103     // - Add a new GoTo to this pattern
00104     void addGoto(const sstring & goto_label,
00105                  const sstring & label,
00106                        LONG linenumber = 0,
00107                  const sstring & filename = "");
00108 
00109     // - Add a new X (diag-Xref) to this pattern
00110     void addX(const sstring & goto_label,
00111                  const sstring & label,
00112                        LONG linenumber = 0,
00113                  const sstring & filename = "");
00114 
00115     // - Add a new BreakPoint to this pattern
00116     void addBreakPoint(const sstring & bp,
00117                                 LONG linenumber = 0,
00118                           const sstring & filename = "");
00119 
00120     // - Add a new IddqTestPoint to this pattern
00121     void addIddqTestPoint(const sstring & label,
00122                                 LONG linenumber = 0,
00123                           const sstring & filename = "");
00124 
00125     // - Add a new Stop to this pattern
00126     void addStop(const sstring & label,
00127                        LONG linenumber = 0,
00128                  const sstring & filename = "");
00129 
00130     // - Add a new ScanChain reference to this pattern
00131     void addScanChain(const sstring & sc_name,
00132                       const sstring & label,
00133                             LONG linenumber = 0,
00134                       const sstring & filename = "");
00135 
00136     // - Add a new Shift block to this pattern
00137     void addShift(const STILShift & l);
00138 
00139     // - Get how many shift blocks in this pattern block
00140     bool getHasShiftBlock();
00141 
00142   // Private section
00143   private:
00144 
00145     std::list<STILVector>    m_vectorList;        // List of vectors blocks
00146     std::list<STILCondition> m_conditionList;     // List of condition blocks
00147     std::list<STILFixed>     m_fixedList;         // List of fixed blocks
00148     std::list<STILCall>      m_callList;          // List of call blocks
00149     std::list<STILMacro>     m_macroList;         // List of macro blocks
00150     std::list<STILLoop*>     m_loopList;          // List of loop blocks
00151     std::list<STILShift*>    m_shiftList;         // List of shift blocks
00152 
00153     bool                     m_hasShiftBlock;     // is a shift block contained within?
00154 
00155     // - Update the pointers to complex entities in the entity list
00156     void updateEntityList();
00157 
00158 }; // end STILPatternBlock class
00159 
00160 // Inline functions:
00161 //--------------------------------------------------------------------------
00169 //--------------------------------------------------------------------------
00170 inline bool STILPatternBlock::getHasShiftBlock() { return m_hasShiftBlock; }
00171 
00172 // Following inline functions will prevent errors when compiling the
00173 // template code for the STL lists of the pointers to these types.
00174 // This is needed because the compiler does not know how to ignore
00175 // delete when called on pointers with one level of indirection too much
00176 // (so says the STILBlock class, anyhow...)
00177 inline void destroy(STILPatternBlock**) { }
00178 
00179 // Following two include placed here such that AIX compiler won't complain
00180 // about these classes (STILShift,STILLoop) not being defined in any
00181 // includes files
00182 #include "stilshift.h"      // STILShift Class interface
00183 #include "stilloop.h"       // STILLoop Class interface
00184 
00185 #endif

This page last updated on 6 Jul 2007

SourceForge.net Logo