Hurricane VLSI Database


BasicLayer.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/BasicLayer.h" |
30 // +-----------------------------------------------------------------+
31 
32 
33 # ifndef HURRICANE_BASIC_LAYER_H
34 # define HURRICANE_BASIC_LAYER_H
35 
36 # include "hurricane/Layer.h"
37 # include "hurricane/BasicLayers.h"
38 # include "hurricane/Box.h"
39 
40 
41 namespace Hurricane {
42 
43 
44  class BasicLayer : public Layer {
45  public:
46  typedef Layer Super;
47 
48  public:
49  // Subclass: Material.
50  class Material {
51  // Enum: Code.
52  public:
53  enum Code { nWell =0
58  , poly
59  , cut
62  , info
63  , other
64  };
65  // Constructors.
66  Material ( const Code& code = other );
67  Material ( const Material& material );
68  // Methods.
69  Material& operator= ( const Material& material );
70  inline operator const Code& () const;
71  inline const Code& getCode () const;
72  static Material fromString ( const string& );
73  inline string _getTypeName () const;
74  string _getString () const;
75  Record* _getRecord () const;
76 
77  // Internal: Attributes.
78  private:
79  Code _code;
80  };
81 
82  public:
83  // Constructor.
84  static BasicLayer* create ( Technology* technology
85  , const Name& name
86  , const Material& material
87  , unsigned gds2Layer = 0
88  , unsigned gds2Datatype = 0
89  , const DbU::Unit& minimalSize = 0
90  , const DbU::Unit& minimalSpacing = 0
91  );
92  // Accessors.
93  inline const Material& getMaterial () const;
94  inline unsigned getGds2Layer () const;
95  inline unsigned getGds2Datatype () const;
96  virtual BasicLayers getBasicLayers () const;
97  virtual BasicLayer* getBlockageLayer () const;
98  virtual const Layer* getTop () const;
99  virtual const Layer* getBottom () const;
100  inline const Name& getRealName () const;
101  // Updators
102  inline void setBlockageLayer ( BasicLayer* layer);
103  inline void setGds2Layer ( unsigned int );
104  inline void setGds2Datatype ( unsigned int );
105  inline void setRealName ( const char* realName);
106  // Hurricane Managment.
107  virtual void _toJson ( JsonWriter* writer ) const;
108  virtual BasicLayer* _getSymbolicBasicLayer ();
109  virtual string _getTypeName () const;
110  virtual string _getString () const;
111  virtual Record* _getRecord () const;
112 
113  private:
114  // Internal: Attributes
115  Material _material;
116  unsigned _gds2Layer;
117  unsigned _gds2Datatype;
118  BasicLayer* _blockageLayer;
119  Name _realName;
120 
121  protected:
122  // Internal: Constructors & Destructors.
123  BasicLayer ( Technology* technology
124  , const Name& name
125  , const Material& material
126  , unsigned gds2Layer
127  , unsigned gds2Datatype
128  , const DbU::Unit& minimalSize = 0
129  , const DbU::Unit& minimalSpacing = 0
130  );
131  virtual void _postCreate ();
132  virtual void _preDestroy ();
133  };
134 
135 
136 // Inline Functions.
137  inline BasicLayer::Material::operator const Code& () const { return _code; }
138  inline const BasicLayer::Material::Code&
139  BasicLayer::Material::getCode () const { return _code; }
140  inline string BasicLayer::Material::_getTypeName () const { return _TName("BasicLayer::Material"); }
141  inline const BasicLayer::Material&
142  BasicLayer::getMaterial () const { return _material; }
143  inline unsigned BasicLayer::getGds2Layer () const { return _gds2Layer; }
144  inline unsigned BasicLayer::getGds2Datatype () const { return _gds2Datatype; }
145  inline const Name& BasicLayer::getRealName () const { return _realName; }
146  inline void BasicLayer::setBlockageLayer ( BasicLayer* layer) { _blockageLayer = layer; layer->setBlockage(true); }
147  inline void BasicLayer::setGds2Layer ( unsigned int number ) { _gds2Layer=number; }
148  inline void BasicLayer::setGds2Datatype ( unsigned int number ) { _gds2Datatype=number; }
149  inline void BasicLayer::setRealName ( const char* realName) { _realName = realName; }
150 
151 
152 // -------------------------------------------------------------------
153 // Class : "Hurricane::JsonBasicLayer".
154 
155  class JsonBasicLayer : public JsonLayer {
156  public:
157  static void initialize ();
158  JsonBasicLayer ( unsigned long flags );
159  ~JsonBasicLayer ();
160  virtual string getTypeName () const;
161  virtual JsonBasicLayer* clone ( unsigned long ) const;
162  virtual void toData ( JsonStack& );
163  };
164 
165 
166 } // End of Hurricane namespace.
167 
168 
169 // -------------------------------------------------------------------
170 // Inspector Support for : BasicLayer::Material::Code.
171 
172 
173 template<>
174 inline std::string getString<const Hurricane::BasicLayer::Material::Code*>
175  ( const Hurricane::BasicLayer::Material::Code* object )
176 {
177  switch ( *object ) {
178  case Hurricane::BasicLayer::Material::nWell: return "nWell";
179  case Hurricane::BasicLayer::Material::pWell: return "pWell";
180  case Hurricane::BasicLayer::Material::nImplant: return "nImplant";
181  case Hurricane::BasicLayer::Material::pImplant: return "pImplant";
182  case Hurricane::BasicLayer::Material::active: return "active";
183  case Hurricane::BasicLayer::Material::poly: return "poly";
184  case Hurricane::BasicLayer::Material::cut: return "cut";
185  case Hurricane::BasicLayer::Material::metal: return "metal";
186  case Hurricane::BasicLayer::Material::blockage: return "blockage";
187  case Hurricane::BasicLayer::Material::info: return "info";
188  case Hurricane::BasicLayer::Material::other: return "other";
189  }
190  return "undefined";
191 }
192 
193 
194 template<>
195 inline Hurricane::Record* getRecord<const Hurricane::BasicLayer::Material::Code*>
196  ( const Hurricane::BasicLayer::Material::Code* object )
197 {
198  Hurricane::Record* record = new Hurricane::Record(getString(object));
199  record->add(getSlot("Code", (unsigned int*)object));
200  return record;
201 }
202 
203 
204 INSPECTOR_P_SUPPORT(Hurricane::BasicLayer);
205 INSPECTOR_P_SUPPORT(Hurricane::BasicLayer::Material);
206 IOSTREAM_POINTER_SUPPORT(Hurricane::BasicLayer::Material::Code);
207 
208 
209 # endif
Definition: BasicLayer.h:50
Code
Definition: BasicLayer.h:53
@ blockage
Definition: BasicLayer.h:61
@ other
Definition: BasicLayer.h:63
@ poly
Definition: BasicLayer.h:58
@ pImplant
Definition: BasicLayer.h:56
@ metal
Definition: BasicLayer.h:60
@ active
Definition: BasicLayer.h:57
@ pWell
Definition: BasicLayer.h:54
@ nImplant
Definition: BasicLayer.h:55
@ cut
Definition: BasicLayer.h:59
@ nWell
Definition: BasicLayer.h:53
BasicLayer description (API)
Definition: BasicLayer.h:44
void setBlockageLayer(BasicLayer *layer)
Definition: BasicLayer.h:146
void setRealName(const char *realName)
Definition: BasicLayer.h:149
const Name & getRealName() const
Definition: BasicLayer.h:145
const Material & getMaterial() const
Definition: BasicLayer.h:142
static BasicLayer * create(Technology *technology, const Name &name, const Material &material, unsigned gds2Layer=0, unsigned gds2Datatype=0, const DbU::Unit &minimalSize=0, const DbU::Unit &minimalSpacing=0)
DataBase object root class (API).
Definition: DBo.h:45
std::int64_t Unit
Definition: DbU.h:67
JSON Parser Stack.
Definition: JsonObject.h:249
Layer description (API)
Definition: Layer.h:52
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