Hurricane VLSI Database


Layer.h
1 
2 // -*- C++ -*-
3 //
4 // Copyright (c) BULL S.A. 2000-2022, 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 #pragma once
34 #include "hurricane/Mask.h"
35 #include "hurricane/DBo.h"
36 #include "hurricane/Layers.h"
37 #include "hurricane/DbU.h"
38 #include "hurricane/BasicLayers.h"
39 
40 
41 namespace Hurricane {
42 
43 
44  class Technology;
45 
46 
47 // -------------------------------------------------------------------
48 // Class : "Hurricane::Layer".
49 
50  class Layer : public DBo {
51  public:
52  typedef DBo Super;
53  typedef Hurricane::Mask<boost::multiprecision::uint128_t> Mask;
54  public:
55  static const uint32_t NoFlags = 0;
56  static const uint32_t EnclosureH = (1 << 0);
57  static const uint32_t EnclosureV = (1 << 1);
58  static const uint32_t EnclosureMax = (1 << 2);
59  static const uint32_t ExtensionCap = (1 << 3);
60  static const uint32_t ExtensionWidth = (1 << 4);
61 
62  public:
63  // Accessors.
64  inline Technology* getTechnology () const;
65  inline const Name& getName () const;
66  inline const Mask& getMask () const;
67  inline const Mask& getExtractMask () const;
68  inline const DbU::Unit& getMinimalSize () const;
69  inline const DbU::Unit& getMinimalSpacing () const;
70  virtual BasicLayers getBasicLayers () const = 0;
71  virtual const Layer* getBlockageLayer () const;
72  virtual const Layer* getRoutingLayer () const;
73  virtual const Layer* getCut () const;
74  virtual const Layer* getTop () const;
75  virtual const Layer* getBottom () const;
76  virtual const Layer* getOpposite ( const Layer* ) const;
77  Layer* getMetalAbove ( bool useSymbolic=true ) const;
78  Layer* getMetalBelow ( bool useSymbolic=true ) const;
79  Layer* getCutAbove ( bool useSymbolic=true ) const;
80  Layer* getCutBelow ( bool useSymbolic=true ) const;
81  virtual DbU::Unit getEnclosure ( uint32_t flags ) const;
82  virtual DbU::Unit getExtentionCap () const;
83  virtual DbU::Unit getExtentionWidth () const;
84  virtual DbU::Unit getEnclosure ( const BasicLayer* layer, uint32_t flags ) const;
85  virtual DbU::Unit getExtentionCap ( const BasicLayer* layer ) const;
86  virtual DbU::Unit getExtentionWidth ( const BasicLayer* layer ) const;
87  virtual DbU::Unit getTopEnclosure ( uint32_t flags ) const;
88  virtual DbU::Unit getBottomEnclosure ( uint32_t flags ) const;
89  virtual double getMinimalArea () const;
90  // Predicates
91  inline bool above ( const Layer* layer ) const;
92  inline bool below ( const Layer* layer ) const;
93  bool contains ( const Layer* layer ) const;
94  bool intersect ( const Layer* layer ) const;
95  inline bool isSymbolic () const;
96  inline bool isBlockage () const;
97  // Updators
98  void setName ( const Name& name );
99  inline void setSymbolic ( bool );
100  inline void setBlockage ( bool );
101  void setMinimalSize ( const DbU::Unit& minimalSize );
102  void setMinimalSpacing ( const DbU::Unit& minimalSpacing );
103  virtual void setEnclosure ( const BasicLayer* layer, DbU::Unit, uint32_t flags );
104  virtual void setExtentionCap ( const BasicLayer* layer, DbU::Unit );
105  virtual void setExtentionWidth ( const BasicLayer* layer, DbU::Unit );
106  virtual void setMinimalArea ( double );
107  // Hurricane Managment.
108  virtual void _toJson ( JsonWriter* ) const;
109  virtual string _getString () const;
110  virtual Record* _getRecord () const;
111  inline Layer* _getNextOfTechnologyLayerMap () const;
112  inline void _setMask ( const Mask& mask );
113  inline void _setExtractMask ( const Mask& extractMask );
114  inline void _setNextOfTechnologyLayerMap ( Layer* layer );
115  virtual void _onDbuChange ( float scale );
116  static const Name& _sgetName ( const Layer* );
117 
118  private:
119  // Internal: Attributes
120  Technology* _technology;
121  Name _name;
122  Mask _mask;
123  Mask _extractMask;
124  DbU::Unit _minimalSize;
125  DbU::Unit _minimalSpacing;
126  Layer* _nextOfTechnologyLayerMap;
127  bool _symbolic;
128  bool _blockage;
129  double _minimalArea;
130 
131  protected:
132  // Internal: Constructors & Destructors.
133  Layer ( Technology* technology
134  , const Name& name
135  , const DbU::Unit& minimalSize = 0
136  , const DbU::Unit& minimalSpacing = 0
137  , const DbU::Unit& pitch = 0
138  );
139  virtual void _postCreate ();
140  virtual void _preDestroy ();
141 
142  public:
143  struct CompareByMask {
144  inline bool operator() ( const Layer* lhs, const Layer* rhs ) const;
145  };
146  };
147 
148 
149 // Inline Functions.
150  inline bool Layer::isSymbolic () const { return _symbolic; }
151  inline bool Layer::isBlockage () const { return _blockage; }
152  inline bool Layer::above ( const Layer* layer ) const { return _mask > layer->getMask(); }
153  inline bool Layer::below ( const Layer* layer ) const { return _mask < layer->getMask(); }
154  inline Technology* Layer::getTechnology () const { return _technology; }
155  inline const Name& Layer::getName () const { return _name; }
156  inline const Layer::Mask& Layer::getMask () const { return _mask; }
157  inline const Layer::Mask& Layer::getExtractMask () const { return _extractMask; }
158  inline const DbU::Unit& Layer::getMinimalSize () const { return _minimalSize; }
159  inline const DbU::Unit& Layer::getMinimalSpacing () const { return _minimalSpacing; }
160  inline void Layer::setSymbolic ( bool state ) { _symbolic = state; }
161  inline void Layer::setBlockage ( bool state ) { _blockage = state; }
162  inline Layer* Layer::_getNextOfTechnologyLayerMap () const { return _nextOfTechnologyLayerMap; }
163  inline void Layer::_setMask ( const Mask& mask ) { _mask = mask; }
164  inline void Layer::_setExtractMask ( const Mask& extractMask ) { _extractMask = extractMask; }
165  inline void Layer::_setNextOfTechnologyLayerMap ( Layer* layer ) { _nextOfTechnologyLayerMap = layer; }
166 
167  inline bool Layer::CompareByMask::operator() ( const Layer* lhs, const Layer* rhs ) const
168  { return (lhs?lhs->getMask():Layer::Mask()) < (rhs?rhs->getMask():Layer::Mask()); }
169 
170 
171 // -------------------------------------------------------------------
172 // Class : "Hurricane::JsonLayer".
173 
174  class JsonLayer : public JsonDBo {
175  public:
176  JsonLayer ( unsigned long flags );
177  Technology* lookupTechnology ( JsonStack&, const string& fname ) const;
178  };
179 
180 
181 } // Hurricane namespace.
182 
183 
184 INSPECTOR_P_SUPPORT(Hurricane::Layer);
185 INSPECTOR_PR_SUPPORT(Hurricane::Layer::Mask);
BasicLayer description (API)
Definition: BasicLayer.h:42
DataBase object root class (API).
Definition: DBo.h:45
std::int64_t Unit
Definition: DbU.h:67
Layer description (API)
Definition: Layer.h:50
virtual void setEnclosure(const BasicLayer *layer, DbU::Unit, uint32_t flags)
bool below(const Layer *layer) const
Definition: Layer.h:153
const Mask & getMask() const
Definition: Layer.h:156
const Name & getName() const
Definition: Layer.h:155
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:159
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:152
Layer * getMetalAbove(bool useSymbolic=true) const
Layer * getCutAbove(bool useSymbolic=true) const
bool intersect(const Layer *layer) const
Technology * getTechnology() const
Definition: Layer.h:154
const Mask & getExtractMask() const
Definition: Layer.h:157
Hurricane::Mask< boost::multiprecision::uint128_t > Mask
Definition: Layer.h:53
bool contains(const Layer *layer) const
const DbU::Unit & getMinimalSize() const
Definition: Layer.h:158
Name description (API)
Definition: Name.h:35
Technological rules description (API).
Definition: Technology.h:62
Contains Almost Everything.
Definition: BasicLayer.h:39


Generated by doxygen 1.9.1 on Wed Nov 20 2024 Return to top of page
Hurricane VLSI Database Copyright © 2000-2020 Bull S.A. All rights reserved