oaInst.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaInst.h
00004 //
00005 // This file contains the definition for the oaInst class and its public
00006 // supporting classes. The oaInst class is an abstract base for block domain
00007 // instances. An instance represents the inclusion of one design as a part of
00008 // the contents of another. The design containing the instance is the parent
00009 // design and the design that is included is the master of the instance.
00010 //
00011 // The supporting classes include:
00012 //
00013 //  oaPlacementStatus
00014 //      This simple class represents the placement status which can be 
00015 //      assigned to an instance or a pin.
00016 //
00017 // *****************************************************************************
00018 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00019 // Integration Initiative, this material may not be copied, modified,
00020 // re-published, uploaded, executed, or distributed in any way, in any medium,
00021 // in whole or in part, without prior written permission from Cadence.
00022 //
00023 //                Copyright 2002-2005 Cadence Design Systems, Inc.
00024 //                           All Rights Reserved.
00025 //
00026 //  $Author: icftcm $
00027 //  $Revision: #1 $
00028 //  $Date: 2010/08/09 $
00029 //  $State: Exp $
00030 // *****************************************************************************
00031 // *****************************************************************************
00032 
00033 
00034 
00035 #if !defined(oaInst_P)
00036 #define oaInst_P
00037 
00038 
00039 
00040 // *****************************************************************************
00041 // Nested includes
00042 // *****************************************************************************
00043 #include "oaRef.h"
00044 #include "oaInstHeader.h"
00045 
00046 
00047 
00048 // *****************************************************************************
00049 // Declare and define types in the OpenAccess namespace.
00050 // *****************************************************************************
00051 BEGIN_OA_NAMESPACE
00052 
00053 
00054 
00055 // *****************************************************************************
00056 // oaInstAttrTypeEnum
00057 // *****************************************************************************
00058 #define oavNumInstAttrTypes     6
00059 
00060 
00061 enum oaInstAttrTypeEnum {
00062     oacLibNameInstAttrType  = 0,
00063     oacCellNameInstAttrType = 1,
00064     oacViewNameInstAttrType = 2,
00065     oacNameInstAttrType     = 3,
00066     oacNumBitsInstAttrType  = 4,
00067     oacIsBoundInstAttrType  = 5
00068 };
00069 
00070 
00071 
00072 // *****************************************************************************
00073 // oaInstAttrType
00074 // *****************************************************************************
00075 class OA_DESIGN_DLL_API oaInstAttrType : public oaAttrType {
00076 public:
00077                             oaInstAttrType(oaInstAttrTypeEnum valueIn);
00078                             oaInstAttrType(const oaString &name);
00079                             oaInstAttrType(oaAttrType attr);
00080 
00081     virtual const oaString  &getName() const;
00082 
00083     oaInstAttrTypeEnum      getValue() const;
00084 
00085 private:
00086     static const oaString   names[];
00087 };
00088 
00089 
00090 
00091 // *****************************************************************************
00092 // oaPlacementStatusEnum
00093 // *****************************************************************************
00094 #define oavNumPlacementStatusTypes  5
00095 
00096 enum oaPlacementStatusEnum {
00097     oacNonePlacementStatus      = 0,
00098     oacUnplacedPlacementStatus  = 1,
00099     oacPlacedPlacementStatus    = 2,
00100     oacFixedPlacementStatus     = 3,
00101     oacLockedPlacementStatus    = 4
00102 };
00103 
00104 
00105 
00106 // *****************************************************************************
00107 // oaPlacementStatus
00108 // *****************************************************************************
00109 class OA_DESIGN_DLL_API oaPlacementStatus {
00110 public:         
00111                             oaPlacementStatus(oaPlacementStatusEnum valueIn);
00112                             oaPlacementStatus(const oaString &name);
00113                             ~oaPlacementStatus();
00114 
00115     const oaString          &getName() const;
00116 
00117                             operator                oaPlacementStatusEnum() const;
00118 
00119 private:
00120     oaPlacementStatusEnum   value;
00121 
00122     static const oaString   names[];
00123 };
00124 
00125 
00126 
00127 // *****************************************************************************
00128 // oaInstUsage defines
00129 // *****************************************************************************
00130 #define oacInstUsageFeedthru    0x0001u
00131 #define oacInstUsageSpare       0x0002u
00132 #define oacInstUsageJTag        0x0004u
00133 
00134 
00135 
00136 // *****************************************************************************
00137 // oaInst
00138 // *****************************************************************************
00139 class OA_DESIGN_DLL_API oaInst : public oaRef {
00140 public:
00141     static oaInst                       *find(const oaBlock         *block,
00142                                               const oaSimpleName    &name);
00143 
00144     void                                getLibName(oaScalarName &libName) const;
00145     void                                getCellName(oaScalarName &cellName) const;
00146     void                                getViewName(oaScalarName &viewName) const;
00147     void                                getLibName(const oaNameSpace    &ns,
00148                                                    oaString             &libName) const;
00149     void                                getCellName(const oaNameSpace   &ns,
00150                                                     oaString            &cellName) const;
00151     void                                getViewName(const oaNameSpace   &ns,
00152                                                     oaString            &viewName) const;
00153     oaInstHeader                        *getHeader() const;
00154     void                                getName(oaSimpleName &name) const;
00155     void                                getName(const oaNameSpace   &ns,
00156                                                 oaString            &name) const;
00157     void                                getParams(oaParamArray &params) const;
00158     oaUInt4                             getNumBits() const;
00159     oaPlacementStatus                   getPlacementStatus() const;
00160     oaUInt4                             getPriority() const;
00161     oaSource                            getSource() const;
00162     oaUInt4                             getUsage() const;
00163     oaCluster                           *getCluster() const;
00164 
00165     oaBoolean                           isImplicit() const;
00166     oaBoolean                           usesTermPositions() const;
00167 
00168     oaBoolean                           findParam(const oaString    &name,
00169                                                   oaParam           &param);
00170 
00171     void                                setMaster(const oaDesign *master);
00172     void                                setMaster(const oaScalarName    &libName,
00173                                                   const oaScalarName    &cellName,
00174                                                   const oaScalarName    &viewName);
00175     void                                setParams(const oaParamArray &params);
00176     void                                setPlacementStatus(oaPlacementStatus status);
00177     void                                setPriority(oaUInt4 priority);
00178     void                                setSource(oaSource source);
00179     void                                setUsage(oaUInt4 usage);
00180 
00181     void                                addToCluster(oaCluster *cluster);
00182     void                                removeFromCluster();
00183 
00184     void                                scalarize();
00185 
00186     oaOccInst                           *getOccInst() const;
00187 
00188     oaCollection<oaInstTerm, oaInst>    getInstTerms(oaUInt4 filterFlags = oacInstTermIterNotImplicit) const;
00189     oaCollection<oaAssignment, oaInst>  getAssignments() const;
00190     oaCollection<oaBlockage, oaInst>    getBlockagesOwnedBy() const;
00191     oaCollection<oaOccInst, oaInst>     getOccInsts(const oaOccurrence *top) const;
00192 
00193     enum {dtIndex = oacInstDataType};
00194 };
00195 
00196 
00197 
00198 // *****************************************************************************
00199 // oaBitInst
00200 // *****************************************************************************
00201 class OA_DESIGN_DLL_API oaBitInst : public oaInst {
00202 public:
00203 };
00204 
00205 
00206 
00207 // *****************************************************************************
00208 // Design Traits.
00209 // *****************************************************************************
00210 template<>
00211 class oaTraits<oaInst> {
00212 public:
00213     typedef oaRef               parentType;
00214     typedef oaInstModTypeEnum   modTypeType;
00215     enum {domain = oacBlockDomain};
00216     enum {dbType = oacDesignDBType};
00217     enum {isConcrete = false};
00218     enum {isMultiDomain = true};
00219     enum {dtIndex = oacInstDataType};
00220     enum {dataTypeEnumVal = oacInstDataType};
00221     enum {abstractTypeEnumVal = oacInstType};
00222 };
00223 
00224 template<>
00225 class oaTraits<oaBitInst> {
00226 public:
00227     typedef oaInstModTypeEnum   modTypeType;
00228     typedef oaInst              parentType;
00229     enum {isMultiDomain = true};
00230     enum {dtIndex = oacInstDataType};
00231     enum {dataTypeEnumVal = oacInstDataType};
00232     enum {domain = oacBlockDomain};
00233     enum {dbType = oacDesignDBType};
00234     enum {isConcrete = false};
00235     enum {abstractTypeEnumVal = oacBitInstType};
00236 };
00237 
00238 
00239 
00240 END_OA_NAMESPACE
00241 
00242 #endif

Return to top of page