# 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 // Predicates
92 inline bool above ( const Layer* layer ) const;
93 inline bool below ( const Layer* layer ) const;
94 bool contains ( const Layer* layer ) const;
95 bool intersect ( const Layer* layer ) const;
96 inline bool isSymbolic () const;
97 inline bool isBlockage () const;
98 // Updators
99 void setName ( const Name& name );
100 inline void setSymbolic ( bool );
101 inline void setBlockage ( bool );
102 void setMinimalSize ( const DbU::Unit& minimalSize );
103 void setMinimalSpacing ( const DbU::Unit& minimalSpacing );
104 virtual void setEnclosure ( const BasicLayer* layer, DbU::Unit, uint32_t flags );
105 virtual void setExtentionCap ( const BasicLayer* layer, DbU::Unit );
106 virtual void setExtentionWidth ( const BasicLayer* layer, DbU::Unit );
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
130 protected:
131 // Internal: Constructors & Destructors.
132 Layer ( Technology* technology
133 , const Name& name
134 , const DbU::Unit& minimalSize = 0
135 , const DbU::Unit& minimalSpacing = 0
136 , const DbU::Unit& pitch = 0
137 );
138 virtual void _postCreate ();
139 virtual void _preDestroy ();
140
141 public:
142 struct CompareByMask : public binary_function<const Layer*,const Layer*,bool> {
143 inline bool operator() ( const Layer* lhs, const Layer* rhs ) const;
144 };
145 };
146
147
148 // Inline Functions.
149 inline bool Layer::isSymbolic () const { return _symbolic; }
150 inline bool Layer::isBlockage () const { return _blockage; }
151 inline bool Layer::above ( const Layer* layer ) const { return _mask > layer->getMask(); }
152 inline bool Layer::below ( const Layer* layer ) const { return _mask < layer->getMask(); }
153 inline Technology* Layer::getTechnology () const { return _technology; }
154 inline const Name& Layer::getName () const { return _name; }
155 inline const Layer::Mask& Layer::getMask () const { return _mask; }
156 inline const Layer::Mask& Layer::getExtractMask () const { return _extractMask; }
157 inline const DbU::Unit& Layer::getMinimalSize () const { return _minimalSize; }
158 inline const DbU::Unit& Layer::getMinimalSpacing () const { return _minimalSpacing; }
159 inline void Layer::setSymbolic ( bool state ) { _symbolic = state; }
160 inline void Layer::setBlockage ( bool state ) { _blockage = state; }
161 inline Layer* Layer::_getNextOfTechnologyLayerMap () const { return _nextOfTechnologyLayerMap; }
162 inline void Layer::_setMask ( const Mask& mask ) { _mask = mask; }
163 inline void Layer::_setExtractMask ( const Mask& extractMask ) { _extractMask = extractMask; }
164 inline void Layer::_setNextOfTechnologyLayerMap ( Layer* layer ) { _nextOfTechnologyLayerMap = layer; }
165
166 inline bool Layer::CompareByMask::operator() ( const Layer* lhs, const Layer* rhs ) const
167 { return (lhs?lhs->getMask():Layer::Mask()) < (rhs?rhs->getMask():Layer::Mask()); }
168
169
170 // -------------------------------------------------------------------
171 // Class : "Hurricane::JsonLayer".
172
173 class JsonLayer : public JsonDBo {
174 public:
175 JsonLayer ( unsigned long flags );
176 Technology* lookupTechnology ( JsonStack&, const string& fname ) const;
177 };
178
179
180 } // Hurricane namespace.
181
182
183 INSPECTOR_P_SUPPORT(Hurricane::Layer);
184 INSPECTOR_PR_SUPPORT(Hurricane::Layer::Mask);
185
186
187 #endif // HURRICANE_LAYER_H
Hurricane::Layer::setName
void setName(const Name &name)
Hurricane::Layer::intersect
bool intersect(const Layer *layer) const
Hurricane::BasicLayer
BasicLayer description (API)
Definition: BasicLayer.h:44
Hurricane::Layer::getTechnology
Technology * getTechnology() const
Definition: Layer.h:153
Hurricane::Layer::getMinimalSpacing
const DbU::Unit & getMinimalSpacing() const
Definition: Layer.h:158
Hurricane::Layer::contains
bool contains(const Layer *layer) const
Hurricane::Name
Name description (API)
Definition: Name.h:35
Hurricane::Layer::getCutBelow
Layer * getCutBelow(bool useSymbolic=true) const
Hurricane::Layer::getOpposite
virtual const Layer * getOpposite(const Layer *) const
Hurricane::DbU::Unit
std::int64_t Unit
Definition: DbU.h:70
Hurricane::DBo
DataBase object root class (API).
Definition: DBo.h:47
Hurricane::Layer::Mask
Hurricane::Mask< unsigned long long > Mask
Definition: Layer.h:65
Hurricane::Layer::setEnclosure
virtual void setEnclosure(const BasicLayer *layer, DbU::Unit, uint32_t flags)
Hurricane::Layer::setExtentionWidth
virtual void setExtentionWidth(const BasicLayer *layer, DbU::Unit)
Hurricane::Layer::getBasicLayers
virtual BasicLayers getBasicLayers() const =0
Hurricane::Layer::getMetalAbove
Layer * getMetalAbove(bool useSymbolic=true) const
Hurricane::Layer::setMinimalSize
void setMinimalSize(const DbU::Unit &minimalSize)
Hurricane::Layer::getTop
virtual const Layer * getTop() const
Hurricane::Layer
Layer description (API)
Definition: Layer.h:52
Hurricane::Layer::getMask
const Mask & getMask() const
Definition: Layer.h:155
Hurricane::Layer::above
bool above(const Layer *layer) const
Definition: Layer.h:151
Hurricane::Layer::getExtractMask
const Mask & getExtractMask() const
Definition: Layer.h:156
Hurricane::Layer::getCutAbove
Layer * getCutAbove(bool useSymbolic=true) const
Hurricane::Layer::setMinimalSpacing
void setMinimalSpacing(const DbU::Unit &minimalSpacing)
Hurricane::Layer::getName
const Name & getName() const
Definition: Layer.h:154
Hurricane
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5
Hurricane::Layer::getBottom
virtual const Layer * getBottom() const
Hurricane::Layer::getMinimalSize
const DbU::Unit & getMinimalSize() const
Definition: Layer.h:157
Hurricane::Layer::getMetalBelow
Layer * getMetalBelow(bool useSymbolic=true) const
Hurricane::Layer::setExtentionCap
virtual void setExtentionCap(const BasicLayer *layer, DbU::Unit)
Hurricane::Technology
Technological rules description (API).
Definition: Technology.h:62
Hurricane::Layer::below
bool below(const Layer *layer) const
Definition: Layer.h:152

Generated by doxygen 1.8.14 on Tue Jul 21 2020 | Return to top of page

Hurricane VLSI Database | Copyright © 2000-2016 Bull S.A. All rights reserved