oaSiteDef.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaSiteDef.h
00004 //
00005 // This file contains the definition for the oaSiteDef class. The oaSiteDef
00006 // class defines a site at which cells may be placed in a row. A site has a
00007 // name, type, width, and height allowing for the specification of placeable
00008 // objects within a row.
00009 //
00010 // *****************************************************************************
00011 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00012 // Integration Initiative, this material may not be copied, modified,
00013 // re-published, uploaded, executed, or distributed in any way, in any medium,
00014 // in whole or in part, without prior written permission from Cadence.
00015 //
00016 //                Copyright 2002-2005 Cadence Design Systems, Inc.
00017 //                           All Rights Reserved.
00018 //
00019 //  $Author: icftcm $
00020 //  $Revision: #1 $
00021 //  $Date: 2010/08/09 $
00022 //  $State: Exp $
00023 // *****************************************************************************
00024 // *****************************************************************************
00025 
00026 
00027 
00028 #if !defined(oaSiteDef_P)
00029 #define oaSiteDef_P
00030 
00031 
00032 
00033 // *****************************************************************************
00034 // Nested includes
00035 // *****************************************************************************
00036 #include "oaTransform.h"
00037 #include "oaTech.h"
00038 
00039 
00040 
00041 // *****************************************************************************
00042 // Declare and define types in the OpenAccess namespace.
00043 // *****************************************************************************
00044 BEGIN_OA_NAMESPACE
00045 
00046 
00047 
00048 // *****************************************************************************
00049 // oaSiteDefType
00050 // *****************************************************************************
00051 #define oavNumSiteDefTypes  2
00052 
00053 enum oaSiteDefTypeEnum {
00054     oacPadSiteDefType   = 0,
00055     oacCoreSiteDefType  = 1
00056 };
00057 
00058 
00059 
00060 // *****************************************************************************
00061 // oaSiteDefType
00062 // *****************************************************************************
00063 class OA_TECH_DLL_API oaSiteDefType {
00064 public:
00065                             oaSiteDefType(oaSiteDefTypeEnum valueIn);
00066                             oaSiteDefType(const oaString &name);
00067                             ~oaSiteDefType();
00068 
00069     const oaString          &getName() const;
00070 
00071                             operator                oaSiteDefTypeEnum() const;
00072 
00073 private:
00074     oaSiteDefTypeEnum       value;
00075 
00076     static const oaString   names[];
00077 };
00078 
00079 
00080 
00081 // *****************************************************************************
00082 // oaSiteRef
00083 // *****************************************************************************
00084 class OA_TECH_DLL_API oaSiteRef {
00085 public:
00086                             oaSiteRef();
00087                             oaSiteRef(const oaString    &siteName,
00088                                       const oaTransform &xform);
00089                             oaSiteRef(const oaSiteRef &siteRefIn);
00090 
00091     const oaString          &siteName() const;
00092     const oaTransform       &transform() const;
00093 
00094     oaString                &siteName();
00095     oaTransform             &transform();
00096 
00097     oaSiteRef               &operator=(const oaSiteRef &dataIn);
00098 
00099     oaBoolean               operator==(const oaSiteRef &other);
00100     oaBoolean               operator!=(const oaSiteRef &other);
00101     oaBoolean               operator==(const oaSiteRef &other) const;
00102     oaBoolean               operator!=(const oaSiteRef &other) const;
00103 
00104 private:
00105     oaString                name;
00106     oaTransform             xform;
00107 };
00108 
00109 
00110 
00111 // *****************************************************************************
00112 // oaSitePattern
00113 // *****************************************************************************
00114 class OA_TECH_DLL_API oaSitePattern : public oaArray<oaSiteRef> {
00115 public:
00116                             oaSitePattern(oaUInt4 size = 0);
00117                             oaSitePattern(const oaSitePattern &pattern);
00118 
00119 protected:
00120     virtual void            copyElements(oaSiteRef          *elementsTo,
00121                                          const oaSiteRef    *elementsFrom,
00122                                          oaUInt4            num);
00123     virtual oaBoolean       cmpElements(const oaSiteRef *elementsOther,
00124                                         oaUInt4         num) const;
00125 };
00126 
00127 
00128 // *****************************************************************************
00129 // oaSiteDef
00130 // *****************************************************************************
00131 class OA_TECH_DLL_API oaSiteDef : public oaTechObject {
00132 public:
00133     static oaSiteDef                        *find(const oaTech      *tech,
00134                                                   const oaString    &name);
00135     static oaSiteDef                        *find(const oaTech      *tech,
00136                                                   const oaString    &name,
00137                                                   oaBoolean         local);
00138 
00139     void                                    destroy();
00140 
00141     void                                    getName(oaString &name) const;
00142     oaSiteDefType                           getSiteDefType() const;
00143     oaUInt4                                 getWidth() const;
00144     oaUInt4                                 getHeight() const;
00145     oaBoolean                               isSymmetricInX() const;
00146     oaBoolean                               isSymmetricInY() const;
00147     oaBoolean                               isSymmetricInRot() const;
00148 
00149     void                                    setType(oaSiteDefType type);
00150     void                                    setSymmetricInX(oaBoolean val);
00151     void                                    setSymmetricInY(oaBoolean val);
00152     void                                    setSymmetricInRot(oaBoolean val);
00153 
00154     oaCollection<oaRowHeader, oaSiteDef>    getUsedIn() const;
00155 
00156     enum {dtIndex = oacSiteDefDataType};
00157 };
00158 
00159 
00160 
00161 // *****************************************************************************
00162 // oaScalarSiteDef
00163 // *****************************************************************************
00164 class OA_TECH_DLL_API oaScalarSiteDef : public oaSiteDef {
00165 public:
00166     static oaScalarSiteDef  *create(oaTech          *tech,
00167                                     const oaString  &name,
00168                                     oaSiteDefType   type,
00169                                     oaUInt4         width,
00170                                     oaUInt4         height,
00171                                     oaBoolean       isSymmetricInX = false,
00172                                     oaBoolean       isSymmetricInY = false,
00173                                     oaBoolean       isSymmetricInRot = false);
00174 
00175 
00176     void                    setWidth(oaUInt4 width);
00177     void                    setHeight(oaUInt4 height);
00178 };
00179 
00180 
00181 
00182 // *****************************************************************************
00183 // oaArraySiteDef
00184 // *****************************************************************************
00185 class OA_TECH_DLL_API oaArraySiteDef : public oaSiteDef {
00186 public:
00187     static oaArraySiteDef   *create(oaTech              *tech,
00188                                     const oaString      &name,
00189                                     oaSiteDefType       type,
00190                                     const oaSitePattern &sitePattern,
00191                                     oaBoolean           isSymmetricInX = false,
00192                                     oaBoolean           isSymmetricInY = false,
00193                                     oaBoolean           isSymmetricInRot = false);
00194 
00195     void                    getSitePattern(oaSitePattern &sitePattern) const;
00196 
00197     void                    setSitePattern(const oaSitePattern &sitePattern);
00198 };
00199 
00200 
00201 
00202 // *****************************************************************************
00203 // oaTech traits
00204 // *****************************************************************************
00205 template<>
00206 class oaTraits<oaSiteDef> {
00207 public:
00208     typedef oaTechObject            parentType;
00209     typedef oaSiteDefModTypeEnum    modTypeType;
00210     enum {dbType = oacTechDBType};
00211     enum {domain = oacNoDomain};
00212     enum {isMultiDomain = false};
00213     enum {isConcrete = false};
00214     enum {dtIndex = oacSiteDefDataType};
00215     enum {dataTypeEnumVal = oacSiteDefDataType};
00216     enum {abstractTypeEnumVal = oacSiteDefType};
00217 };
00218 
00219 template<>
00220 class oaTraits<oaScalarSiteDef> {
00221 public:
00222     typedef oaSiteDefModTypeEnum    modTypeType;
00223     typedef oaSiteDef               parentType;
00224     enum {dtIndex = oacSiteDefDataType};
00225     enum {dataTypeEnumVal = oacSiteDefDataType};
00226     enum {dbType = oacTechDBType};
00227     enum {domain = oacNoDomain};
00228     enum {isMultiDomain = false};
00229     enum {isConcrete = true};
00230     enum {objectTypeEnumVal = oacScalarSiteDefType};
00231 };
00232 
00233 template<>
00234 class oaTraits<oaArraySiteDef> {
00235 public:
00236     typedef oaSiteDefModTypeEnum    modTypeType;
00237     typedef oaSiteDef               parentType;
00238     enum {dtIndex = oacSiteDefDataType};
00239     enum {dataTypeEnumVal = oacSiteDefDataType};
00240     enum {dbType = oacTechDBType};
00241     enum {domain = oacNoDomain};
00242     enum {isMultiDomain = false};
00243     enum {isConcrete = true};
00244     enum {objectTypeEnumVal = oacArraySiteDefType};
00245 };
00246 
00247 
00248 
00249 END_OA_NAMESPACE
00250 
00251 #endif

Return to top of page