Hurricane VLSI Database


Layer.h
1 
2 // -*- C++ -*-
3 //
4 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
5 //
6 // This file is part of Hurricane.
7 //
8 // Hurricane is free software: you can redistribute it and/or modify
9 // it under the terms of the GNU Lesser General Public License as
10 // published by the Free Software Foundation, either version 3 of the
11 // License, or (at your option) any later version.
12 //
13 // Hurricane is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
15 // TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
16 // General Public License for more details.
17 //
18 // You should have received a copy of the Lesser GNU General Public
19 // License along with Hurricane. If not, see
20 // <http://www.gnu.org/licenses/>.
21 //
22 // +-----------------------------------------------------------------+
23 // | H U R R I C A N E |
24 // | V L S I B a c k e n d D a t a - B a s e |
25 // | |
26 // | Author : Remy Escassut |
27 // | E-mail : Jean-Paul.Chaput@lip6.fr |
28 // | =============================================================== |
29 // | C++ Header : "./hurricane/Layer.h" |
30 // +-----------------------------------------------------------------+
31 
32 
33 #ifndef HURRICANE_LAYER_H
34 #define HURRICANE_LAYER_H
35 
36 #include "hurricane/Mask.h"
37 #include "hurricane/DBo.h"
38 #include "hurricane/Layers.h"
39 #include "hurricane/DbU.h"
40 #include "hurricane/BasicLayers.h"
41 
42 
43 namespace Hurricane {
44 
45 
46  class Technology;
47 
48 
49 // -------------------------------------------------------------------
50 // Class : "Hurricane::Layer".
51 
52  class Layer : public DBo {
53  public:
54  typedef DBo Super;
55  public:
56  static const uint32_t NoFlags = 0;
57  static const uint32_t EnclosureH = (1 << 0);
58  static const uint32_t EnclosureV = (1 << 1);
59  static const uint32_t EnclosureMax = (1 << 2);
60  static const uint32_t ExtensionCap = (1 << 3);
61  static const uint32_t ExtensionWidth = (1 << 4);
62 
63  public:
64  // Types.
65  typedef Hurricane::Mask<unsigned long long> Mask;
66  // Accessors.
67  inline Technology* getTechnology () const;
68  inline const Name& getName () const;
69  inline const Mask& getMask () const;
70  inline const Mask& getExtractMask () const;
71  inline const DbU::Unit& getMinimalSize () const;
72  inline const DbU::Unit& getMinimalSpacing () const;
73  virtual BasicLayers getBasicLayers () const = 0;
74  virtual const Layer* getBlockageLayer () const;
75  virtual const Layer* getCut () const;
76  virtual const Layer* getTop () const;
77  virtual const Layer* getBottom () const;
78  virtual const Layer* getOpposite ( const Layer* ) const;
79  Layer* getMetalAbove ( bool useSymbolic=true ) const;
80  Layer* getMetalBelow ( bool useSymbolic=true ) const;
81  Layer* getCutAbove ( bool useSymbolic=true ) const;
82  Layer* getCutBelow ( bool useSymbolic=true ) const;
83  virtual DbU::Unit getEnclosure ( uint32_t flags ) const;
84  virtual DbU::Unit getExtentionCap () const;
85  virtual DbU::Unit getExtentionWidth () const;
86  virtual DbU::Unit getEnclosure ( const BasicLayer* layer, uint32_t flags ) const;
87  virtual DbU::Unit getExtentionCap ( const BasicLayer* layer ) const;
88  virtual DbU::Unit getExtentionWidth ( const BasicLayer* layer ) const;
89  virtual DbU::Unit getTopEnclosure ( uint32_t flags ) const;
90  virtual DbU::Unit getBottomEnclosure ( uint32_t flags ) const;
91  virtual double getMinimalArea () const;
92  // Predicates
93  inline bool above ( const Layer* layer ) const;
94  inline bool below ( const Layer* layer ) const;
95  bool contains ( const Layer* layer ) const;
96  bool intersect ( const Layer* layer ) const;
97  inline bool isSymbolic () const;
98  inline bool isBlockage () const;
99  // Updators
100  void setName ( const Name& name );
101  inline void setSymbolic ( bool );
102  inline void setBlockage ( bool );
103  void setMinimalSize ( const DbU::Unit& minimalSize );
104  void setMinimalSpacing ( const DbU::Unit& minimalSpacing );
105  virtual void setEnclosure ( const BasicLayer* layer, DbU::Unit, uint32_t flags );
106  virtual void setExtentionCap ( const BasicLayer* layer, DbU::Unit );
107  virtual void setExtentionWidth ( const BasicLayer* layer, DbU::Unit );
108  virtual void setMinimalArea ( double );
109  // Hurricane Managment.
110  virtual void _toJson ( JsonWriter* ) const;
111  virtual string _getString () const;
112  virtual Record* _getRecord () const;
113  inline Layer* _getNextOfTechnologyLayerMap () const;
114  inline void _setMask ( const Mask& mask );
115  inline void _setExtractMask ( const Mask& extractMask );
116  inline void _setNextOfTechnologyLayerMap ( Layer* layer );
117  virtual void _onDbuChange ( float scale );
118  static const Name& _sgetName ( const Layer* );
119 
120  private:
121  // Internal: Attributes
122  Technology* _technology;
123  Name _name;
124  Mask _mask;
125  Mask _extractMask;
126  DbU::Unit _minimalSize;
127  DbU::Unit _minimalSpacing;
128  Layer* _nextOfTechnologyLayerMap;
129  bool _symbolic;
130  bool _blockage;
131  double _minimalArea;
132 
133  protected:
134  // Internal: Constructors & Destructors.
135  Layer ( Technology* technology
136  , const Name& name
137  , const DbU::Unit& minimalSize = 0
138  , const DbU::Unit& minimalSpacing = 0
139  , const DbU::Unit& pitch = 0
140  );
141  virtual void _postCreate ();
142  virtual void _preDestroy ();
143 
144  public:
145  struct CompareByMask : public binary_function<const Layer*,const Layer*,bool> {
146  inline bool operator() ( const Layer* lhs, const Layer* rhs ) const;
147  };
148  };
149 
150 
151 // Inline Functions.
152  inline bool Layer::isSymbolic () const { return _symbolic; }
153  inline bool Layer::isBlockage () const { return _blockage; }
154  inline bool Layer::above ( const Layer* layer ) const { return _mask > layer->getMask(); }
155  inline bool Layer::below ( const Layer* layer ) const { return _mask < layer->getMask(); }
156  inline Technology* Layer::getTechnology () const { return _technology; }
157  inline const Name& Layer::getName () const { return _name; }
158  inline const Layer::Mask& Layer::getMask () const { return _mask; }
159  inline const Layer::Mask& Layer::getExtractMask () const { return _extractMask; }
160  inline const DbU::Unit& Layer::getMinimalSize () const { return _minimalSize; }
161  inline const DbU::Unit& Layer::getMinimalSpacing () const { return _minimalSpacing; }
162  inline void Layer::setSymbolic ( bool state ) { _symbolic = state; }
163  inline void Layer::setBlockage ( bool state ) { _blockage = state; }
164  inline Layer* Layer::_getNextOfTechnologyLayerMap () const { return _nextOfTechnologyLayerMap; }
165  inline void Layer::_setMask ( const Mask& mask ) { _mask = mask; }
166  inline void Layer::_setExtractMask ( const Mask& extractMask ) { _extractMask = extractMask; }
167  inline void Layer::_setNextOfTechnologyLayerMap ( Layer* layer ) { _nextOfTechnologyLayerMap = layer; }
168 
169  inline bool Layer::CompareByMask::operator() ( const Layer* lhs, const Layer* rhs ) const
170  { return (lhs?lhs->getMask():Layer::Mask()) < (rhs?rhs->getMask():Layer::Mask()); }
171 
172 
173 // -------------------------------------------------------------------
174 // Class : "Hurricane::JsonLayer".
175 
176  class JsonLayer : public JsonDBo {
177  public:
178  JsonLayer ( unsigned long flags );
179  Technology* lookupTechnology ( JsonStack&, const string& fname ) const;
180  };
181 
182 
183 } // Hurricane namespace.
184 
185 
186 INSPECTOR_P_SUPPORT(Hurricane::Layer);
187 INSPECTOR_PR_SUPPORT(Hurricane::Layer::Mask);
188 
189 
190 #endif // HURRICANE_LAYER_H
BasicLayer description (API)
Definition: BasicLayer.h:44
DataBase object root class (API).
Definition: DBo.h:45
std::int64_t Unit
Definition: DbU.h:67
Layer description (API)
Definition: Layer.h:52
virtual void setEnclosure(const BasicLayer *layer, DbU::Unit, uint32_t flags)
bool below(const Layer *layer) const
Definition: Layer.h:155
const Mask & getMask() const
Definition: Layer.h:158
const Name & getName() const
Definition: Layer.h:157
void setMinimalSize(const DbU::Unit &minimalSize)
Layer * getMetalBelow(bool useSymbolic=true) const
virtual const Layer * getBottom() const
virtual void setExtentionCap(const BasicLayer *layer, DbU::Unit)
virtual const Layer * getTop() const
virtual const Layer * getOpposite(const Layer *) const
const DbU::Unit & getMinimalSpacing() const
Definition: Layer.h:161
virtual void setExtentionWidth(const BasicLayer *layer, DbU::Unit)
virtual BasicLayers getBasicLayers() const =0
void setMinimalSpacing(const DbU::Unit &minimalSpacing)
Layer * getCutBelow(bool useSymbolic=true) const
void setName(const Name &name)
bool above(const Layer *layer) const
Definition: Layer.h:154
Layer * getMetalAbove(bool useSymbolic=true) const
Layer * getCutAbove(bool useSymbolic=true) const
bool intersect(const Layer *layer) const
Technology * getTechnology() const
Definition: Layer.h:156
const Mask & getExtractMask() const
Definition: Layer.h:159
Hurricane::Mask< unsigned long long > Mask
Definition: Layer.h:65
bool contains(const Layer *layer) const
const DbU::Unit & getMinimalSize() const
Definition: Layer.h:160
Name description (API)
Definition: Name.h:35
Technological rules description (API).
Definition: Technology.h:62
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5


Generated by doxygen 1.9.1 on Thu Aug 11 2022 Return to top of page
Hurricane VLSI Database Copyright © 2000-2020 Bull S.A. All rights reserved