oaBusNetDef.h

Go to the documentation of this file.
00001 // *****************************************************************************
00002 // *****************************************************************************
00003 // oaBusNetDef.h
00004 //
00005 // This file contains the definition for the oaBusNetDef class and its public
00006 // supporting classes. The oaBusNetDef class implements the definition of a
00007 // busNet, including its name and bit-range. Since multiple busNets can refer
00008 // to different members of the same busNet definition, the busNetDef represents
00009 // the super-set of all members of the busNets.
00010 //
00011 // A busNetDef is automatically created if necessary whenever applications
00012 // create busNets. These implicit busNet definitions will have no bitOrder.
00013 // Applications may explicitly create a busNet definition in order to specify
00014 // that it has a specific bitOrder.
00015 //
00016 // Implicitly created busNet definitions are automatically destroyed when the
00017 // last busNet with the same name is destroyed. Explicitly created busNet
00018 // definitions must be explicitly destroyed. An exception will be thrown if an
00019 // attempt is made to destroy an implicitly created busNet definition. An
00020 // exception will also be thrown if an attempt is made to destroy an explicitly
00021 // created busNet definition that still has busNets associated with it.
00022 //
00023 // The public supporting classes include:
00024 //
00025 //  oaBitOrder
00026 //      The oaBitOrder class implements an enumerated type that specifies
00027 //      the bitOrder for a busNet definition. Its possible values are "none",
00028 //      "ascending", and "descending".
00029 //
00030 // *****************************************************************************
00031 // Except as specified in the OpenAccess terms of use of Cadence or Silicon
00032 // Integration Initiative, this material may not be copied, modified,
00033 // re-published, uploaded, executed, or distributed in any way, in any medium,
00034 // in whole or in part, without prior written permission from Cadence.
00035 //
00036 //                Copyright 2002-2005 Cadence Design Systems, Inc.
00037 //                           All Rights Reserved.
00038 //
00039 //  $Author: icftcm $
00040 //  $Revision: #1 $
00041 //  $Date: 2010/08/09 $
00042 //  $State: Exp $
00043 // *****************************************************************************
00044 // *****************************************************************************
00045 
00046 
00047 
00048 #if !defined(oaBusNetDef_P)
00049 #define oaBusNetDef_P
00050 
00051 
00052 
00053 // *****************************************************************************
00054 // Nested includes
00055 // *****************************************************************************
00056 #include "oaBlock.h"
00057 
00058 
00059 
00060 // *****************************************************************************
00061 // Declare and define types in the OpenAccess namespace.
00062 // *****************************************************************************
00063 BEGIN_OA_NAMESPACE
00064 
00065 
00066 
00067 // *****************************************************************************
00068 // oaBitOrderEnum
00069 // *****************************************************************************
00070 #define oavNumBitOrders     3
00071 
00072 enum oaBitOrderEnum {
00073     oacNoneBitOrder         = 0,
00074     oacAscendingBitOrder    = 1,
00075     oacDescendingBitOrder   = 2
00076 };
00077 
00078 
00079 
00080 // *****************************************************************************
00081 // oaBitOrder
00082 // *****************************************************************************
00083 class OA_DESIGN_DLL_API oaBitOrder {
00084 public:
00085                             oaBitOrder(oaBitOrderEnum valueIn);
00086                             oaBitOrder(const oaString &name);
00087 
00088     const oaString          &getName() const;
00089 
00090                             operator                oaBitOrderEnum() const;
00091 
00092 private:
00093     oaBitOrderEnum          value;
00094 
00095     static const oaString   names[];
00096 };
00097 
00098 
00099 
00100 // *****************************************************************************
00101 // oaBusNetDef
00102 // *****************************************************************************
00103 class OA_DESIGN_DLL_API oaBusNetDef : public oaBlockObject {
00104 public:
00105     static oaBusNetDef                          *create(const oaBlock       *block,
00106                                                         const oaScalarName  &name,
00107                                                         oaBitOrder          order);
00108 
00109     static oaBusNetDef                          *find(const oaBlock         *block,
00110                                                       const oaScalarName    &name);
00111 
00112     void                                        destroy();
00113 
00114     oaUInt4                                     getMinIndex() const;
00115     oaUInt4                                     getMaxIndex() const;
00116     oaUInt4                                     getNumBits() const;
00117     void                                        getName(oaScalarName &name) const;
00118     void                                        getName(const oaNameSpace   &ns,
00119                                                         oaString            &name) const;
00120     oaBitOrder                                  getBitOrder() const;
00121 
00122     oaBoolean                                   isImplicit() const;
00123 
00124     void                                        setBitOrder(oaBitOrder order);
00125 
00126     oaCollection<oaBusNet, oaBusNetDef>         getBusNets() const;
00127     oaCollection<oaBusNetBit, oaBusNetDef>      getBusNetBits() const;
00128 
00129     oaCollection<oaOccBusNet, oaBusNetDef>      getOccBusNets() const;
00130     oaCollection<oaOccBusNetBit, oaBusNetDef>   getOccBusNetBits() const;
00131 
00132     enum {dtIndex = oacBusNetDefDataType};
00133 };
00134 
00135 
00136 
00137 // *****************************************************************************
00138 // Design Traits.
00139 // *****************************************************************************
00140 template<>
00141 class oaTraits<oaBusNetDef> {
00142 public:
00143     typedef oaBlockObject           parentType;
00144     typedef oaBusNetDefModTypeEnum  modTypeType;
00145     enum {domain = oacBlockDomain};
00146     enum {dbType = oacDesignDBType};
00147     enum {isMultiDomain = true};
00148     enum {dtIndex = oacBusNetDefDataType};
00149     enum {isConcrete = true};
00150     enum {objectTypeEnumVal = oacBusNetDefType};
00151     enum {dataTypeEnumVal = oacBusNetDefDataType};
00152 };
00153 
00154 
00155 
00156 END_OA_NAMESPACE
00157 
00158 #endif

Return to top of page