oaAssignment.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaAssignment.h
00004 //
00005 // This file contains the definition of the oaAssignment class, its derived
00006 // classes, and its public supporting classes.
00007 //
00008 // The oaAssignment class is the base class for all types of assignments. The
00009 // oaAssignment object specifies an assignment of the connectivity for a
00010 // oaConnectDef object. The derived classes include:
00011 //
00012 //  oaAssignValue
00013 //      This class implements an assignment that specifies the name of a
00014 //      single-bit net to use as the replacement for the nets associated with
00015 //      corresponding oaNetConnectDef or oaTermConnectDef connection definitions
00016 //      found in the design hierarchy.
00017 //
00018 //  oaAssignAssignment
00019 //      This class implements an assignment that specifies values that override
00020 //      the assignment definition associated with a corresponding
00021 //      oaNetConnectDef or oaTermConnectDef.
00022 //
00023 // Applications knowing how to traverse the connectivity hierarchy search for
00024 // an oaAssignment on an instance and use it to resolve the connectivity
00025 // associated with corresponding oaConnectDef objects. If an oaAssignValue is
00026 // found, it specifies the net name to use for the nets and terminals with the
00027 // corresponding connection definition. If an oaAssignAssignment is found, the
00028 // application continues searching using the information in the found
00029 // assignment. If no oaAssignment is found, the application uses the default
00030 // net name specified in the oaConnectDef object.
00031 //
00032 // *****************************************************************************
00033 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00034 // Integration Initiative, this material may not be copied, modified,
00035 // re-published, uploaded, executed, or distributed in any way, in any medium,
00036 // in whole or in part, without prior written permission from Cadence.
00037 //
00038 //                Copyright 2003-2005 Cadence Design Systems, Inc.
00039 //                           All Rights Reserved.
00040 //
00041 //  $Author: icftcm $
00042 //  $Revision: #1 $
00043 //  $Date: 2010/08/09 $
00044 //  $State: Exp $
00045 // *****************************************************************************
00046 // *****************************************************************************
00047 
00048 
00049 
00050 #if !defined(oaAssignment_P)
00051 #define oaAssignment_P
00052 
00053 
00054 
00055 // *****************************************************************************
00056 // Nested includes
00057 // *****************************************************************************
00058 #include "oaInst.h"
00059 #include "oaAssignmentDef.h"
00060 
00061 
00062 
00063 // *****************************************************************************
00064 // Declare and define types in the OpenAccess namespace.
00065 // *****************************************************************************
00066 BEGIN_OA_NAMESPACE
00067 
00068 
00069 
00070 // *****************************************************************************
00071 // oaAssignmentAttrTypeEnum
00072 // *****************************************************************************
00073 #define oavNumAssignmentAttrTypes       1
00074 
00075 
00076 enum oaAssignmentAttrTypeEnum {    oacNameAssignmentAttrType   = 0};
00077 
00078 
00079 
00080 // *****************************************************************************
00081 // oaAssignmentAttrType
00082 // *****************************************************************************
00083 class OA_DESIGN_DLL_API oaAssignmentAttrType : public oaAttrType {
00084 public:
00085                                 oaAssignmentAttrType(oaAssignmentAttrTypeEnum vIn);
00086                                 oaAssignmentAttrType(const oaString &name);
00087                                 oaAssignmentAttrType(oaAttrType attr);
00088 
00089     virtual const oaString      &getName() const;
00090 
00091     oaAssignmentAttrTypeEnum    getValue() const;
00092 
00093 private:
00094     static const oaString       names[];
00095 };
00096 
00097 
00098 
00099 // *****************************************************************************
00100 // oaAssignment
00101 // *****************************************************************************
00102 class OA_DESIGN_DLL_API oaAssignment : public oaBlockObject {
00103 public:
00104     void                    destroy();
00105 
00106     static oaAssignment     *find(const oaInst      *inst,
00107                                   const oaString    &name);
00108 
00109     void                    getName(oaString &name) const;
00110     oaInst                  *getInst() const;
00111 
00112     void                    setName(const oaString &name);
00113     void                    setInst(oaInst *inst);
00114 
00115     enum {dtIndex = oacAssignmentDataType};
00116 };
00117 
00118 
00119 
00120 // *****************************************************************************
00121 // oaAssignValue
00122 // *****************************************************************************
00123 class OA_DESIGN_DLL_API oaAssignValue : public oaAssignment {
00124 public:
00125     static oaAssignValue    *create(const oaInst        *inst,
00126                                     const oaString      &name,
00127                                     const oaScalarName  &netName);
00128     static oaAssignValue    *create(const oaInst            *inst,
00129                                     const oaString          &name,
00130                                     const oaVectorBitName   &netName);
00131 
00132     void                    getValue(oaSimpleName &netName) const;
00133 
00134     void                    setValue(const oaScalarName &netName);
00135     void                    setValue(const oaVectorBitName &netName);
00136 };
00137 
00138 
00139 
00140 // *****************************************************************************
00141 // oaAssignAssignment
00142 // *****************************************************************************
00143 class OA_DESIGN_DLL_API oaAssignAssignment : public oaAssignment {
00144 public:
00145     static oaAssignAssignment   *create(const oaInst            *inst,
00146                                         const oaString          &name,
00147                                         const oaAssignmentDef   &aDef);
00148 
00149     void                        getAssignmentDef(oaAssignmentDef &aDef) const;
00150 
00151     void                        setAssignmentDef(const oaAssignmentDef &aDef);
00152 };
00153 
00154 
00155 
00156 // *****************************************************************************
00157 // Design Traits.
00158 // *****************************************************************************
00159 template<>
00160 class oaTraits<oaAssignment> {
00161 public:
00162     typedef oaBlockObject           parentType;
00163     typedef oaAssignmentModTypeEnum modTypeType;
00164     enum {domain = oacBlockDomain};
00165     enum {dbType = oacDesignDBType};
00166     enum {isConcrete = false};
00167     enum {isMultiDomain = true};
00168     enum {dtIndex = oacAssignmentDataType};
00169     enum {dataTypeEnumVal = oacAssignmentDataType};
00170     enum {abstractTypeEnumVal = oacAssignmentType};
00171 };
00172 
00173 template<>
00174 class oaTraits<oaAssignValue> {
00175 public:
00176     typedef oaAssignmentModTypeEnum modTypeType;
00177     typedef oaAssignment            parentType;
00178     enum {isMultiDomain = true};
00179     enum {dtIndex = oacAssignmentDataType};
00180     enum {dataTypeEnumVal = oacAssignmentDataType};
00181     enum {domain = oacBlockDomain};
00182     enum {dbType = oacDesignDBType};
00183     enum {isConcrete = true};
00184     enum {objectTypeEnumVal = oacAssignValueType};
00185 };
00186 
00187 template<>
00188 class oaTraits<oaAssignAssignment> {
00189 public:
00190     typedef oaAssignmentModTypeEnum modTypeType;
00191     typedef oaAssignment            parentType;
00192     enum {isMultiDomain = true};
00193     enum {dtIndex = oacAssignmentDataType};
00194     enum {dataTypeEnumVal = oacAssignmentDataType};
00195     enum {domain = oacBlockDomain};
00196     enum {dbType = oacDesignDBType};
00197     enum {isConcrete = true};
00198     enum {objectTypeEnumVal = oacAssignAssignmentType};
00199 };
00200 
00201 
00202 
00203 END_OA_NAMESPACE
00204 
00205 #endif

Return to top of page