# Hurricane VLSI Database

Technology.h
1 // -*- C++ -*-
2 //
3 // Copyright (c) BULL S.A. 2000-2018, All Rights Reserved
4 //
5 // This file is part of Hurricane.
6 //
7 // Hurricane is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU Lesser General Public License as
9 // published by the Free Software Foundation, either version 3 of the
10 // License, or (at your option) any later version.
11 //
12 // Hurricane is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-
14 // TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the Lesser GNU General Public
18 // License along with Hurricane. If not, see
19 // <http://www.gnu.org/licenses/>.
20 //
21 // +-----------------------------------------------------------------+
22 // | H U R R I C A N E |
23 // | V L S I B a c k e n d D a t a - B a s e |
24 // | |
25 // | Author : Remy Escassut |
26 // | E-mail : Jean-Paul.Chaput@lip6.fr |
27 // | =============================================================== |
28 // | C++ Header : "./hurricane/Technology.h" |
29 // +-----------------------------------------------------------------+
30
31
32 #ifndef HURRICANE_TECHNOLOGY_H
33 #define HURRICANE_TECHNOLOGY_H
34
35 #include <set>
36 #include <map>
37 #include "hurricane/Mask.h"
38 #include "hurricane/DBo.h"
39 #include "hurricane/Layer.h"
40 #include "hurricane/BasicLayers.h"
41 #include "hurricane/RegularLayers.h"
42 #include "hurricane/ViaLayers.h"
43 #include "hurricane/IntrusiveMap.h"
44 #include "hurricane/DeviceDescriptor.h"
45 #include "hurricane/ModelDescriptor.h"
46 #include "hurricane/Rule.h"
47 #include "hurricane/UnitRule.h"
48 #include "hurricane/PhysicalRule.h"
49 #include "hurricane/TwoLayersPhysicalRule.h"
50
51
52 namespace Hurricane {
53
54 using std::set;
55 using std::multimap;
56
57 class DataBase;
58 class BasicLayer;
59 class RegularLayer;
60 class ViaLayer;
61
62
63 // -------------------------------------------------------------------
64 // Class : "Hurricane::Technology".
65
66 class Technology : public DBo {
67
68 public:
69 typedef DBo Super;
70 typedef multimap<Layer::Mask,Layer*> LayerMaskMap;
71 typedef set<DeviceDescriptor*, DeviceDescriptor::DeviceDescriptorComp> DeviceDescriptors;
72 typedef set<ModelDescriptor* , ModelDescriptor::ModelDescriptorComp> ModelDescriptors;
73 public:
74 struct RuleNameCompare {
75 inline bool operator() ( const PhysicalRule* rule1 , const PhysicalRule* rule2 ) const
76 { return rule1->getName() < rule2->getName(); }
77 inline bool operator() ( const UnitRule* rule1 , const UnitRule* rule2 ) const
78 { return rule1->getName() < rule2->getName(); }
79 inline bool operator() ( const Rule* rule1 , const Rule* rule2 ) const
80 { return rule1->getName() < rule2->getName(); }
81 };
82 public:
83 typedef std::pair<const Hurricane::Layer*, const Hurricane::Layer*> LayerPair;
84 typedef std::set<UnitRule* , RuleNameCompare> UnitRules;
85 typedef std::set<PhysicalRule* , RuleNameCompare> PhysicalRules;
86 typedef std::set<TwoLayersPhysicalRule* , RuleNameCompare> TwoLayersRulesSet;
87 typedef std::map<const Hurricane::Layer* , PhysicalRules> OneLayerRules;
88 typedef std::map<LayerPair , TwoLayersRulesSet> TwoLayersRules;
89
90 public:
91 // Sub-class : LayerMap.
92 class LayerMap : public IntrusiveMap<Name,Layer> {
93 public:
94 typedef IntrusiveMap<Name,Layer> Super;
95 public:
96 LayerMap ();
97 virtual Name _getKey ( Layer* ) const;
98 virtual unsigned _getHashValue ( Name ) const;
99 virtual Layer* _getNextElement ( Layer* ) const;
100 virtual void _setNextElement ( Layer* , Layer* nextLayer) const;
101 };
102
103 public:
104 // Constructor.
105 static Technology* create ( DataBase* , const Name& );
106 // Accessors.
107 inline bool isMetal ( const Layer* ) const;
108 inline DataBase* getDataBase () const;
109 inline const Name& getName () const;
110 inline Layer* getLayer ( const Name& ) const;
111 BasicLayer* getBasicLayer ( const Name& ) const;
112 RegularLayer* getRegularLayer ( const Name& ) const;
113 ViaLayer* getViaLayer ( const Name& ) const;
114 inline Layers getLayers () const;
115 BasicLayers getBasicLayers () const;
116 BasicLayers getBasicLayers ( const Layer::Mask& ) const;
117 RegularLayers getRegularLayers () const;
118 ViaLayers getViaLayers () const;
119 Layer* getLayer ( const Layer::Mask&, bool useSymbolic=true ) const;
120 Layer* getMetalAbove ( const Layer*, bool useSymbolic=true ) const;
121 Layer* getMetalBelow ( const Layer*, bool useSymbolic=true ) const;
122 Layer* getCutAbove ( const Layer*, bool useSymbolic=true ) const;
123 Layer* getCutBelow ( const Layer*, bool useSymbolic=true ) const;
124 Layer* getViaBetween ( const Layer*, const Layer*, bool useSymbolic=true ) const;
125 Layer* getNthMetal ( int ) const;
126 Layer* getNthCut ( int ) const;
127 DeviceDescriptor* getDeviceDescriptor ( const Name& );
128 ModelDescriptor* getModelDescriptor (const Name& );
129 inline ModelDescriptors& getModelDescriptors ();
130 UnitRule getUnitRule ( const std::string& ruleName ) const;
131 PhysicalRule getPhysicalRule ( const std::string& ruleName ) const;
132 PhysicalRule getPhysicalRule ( const std::string& ruleName
133 , const std::string& layerName ) const;
134 PhysicalRule getPhysicalRule ( const std::string& ruleName
135 , const std::string& layer1Name
136 , const std::string& layer2Name ) const;
137 inline const UnitRules& getUnitRules () const;
138 inline const PhysicalRules& getNoLayerRules () const;
139 inline const OneLayerRules& getOneLayerRules () const;
140 inline const TwoLayersRules& getTwoLayersRules () const;
141 void toDtr ( std::ostream& );
142 inline void setName ( const std::string& name );
143 // Updators.
144 void setName ( const Name& );
145 bool setSymbolicLayer ( const Name& );
146 bool setSymbolicLayer ( const Layer* );
147 DeviceDescriptor* addDeviceDescriptor ( const Name& );
148 ModelDescriptor* addModelDescriptor ( const Name& name
149 , const Name& simul
150 , const Name& model
151 , std::string netlist
152 , const Name& name_n
153 , const Name& name_p
154 , bool precise );
155 void addUnitRule ( const std::string& ruleName
156 , double value
157 , const std::string& reference );
158 void addPhysicalRule ( const std::string& ruleName
159 , DbU::Unit value
160 , const std::string& reference );
161 void addPhysicalRule ( const std::string& ruleName
162 , const std::string& layerName
163 , DbU::Unit value
164 , const std::string& reference);
165 void addPhysicalRule ( const std::string& ruleName
166 , const std::string& layer1Name
167 , const std::string& layer2Name
168 , bool symetric
169 , DbU::Unit value
170 , const std::string& reference );
171 // Others.
172 inline LayerMap& _getLayerMap ();
173 inline LayerMaskMap& _getLayerMaskMap ();
174 void _insertInLayerMaskMap ( Layer* );
175 void _removeFromLayerMaskMap ( Layer* );
176 inline Layer::Mask& _getCutMask ();
177 inline Layer::Mask& _getMetalMask ();
178 void _onDbuChange ( float scale );
179 // Hurricane Managment.
180 virtual void _toJson ( JsonWriter* ) const;
181 virtual void _toJsonCollections ( JsonWriter* ) const;
182 virtual string _getTypeName () const;
183 virtual string _getString () const;
184 virtual Record* _getRecord () const;
185
186 private:
187 // Internal: Attributes.
188 DataBase* _dataBase;
189 Name _name;
190 LayerMap _layerMap;
191 LayerMaskMap _layerMaskMap;
192 Layer::Mask _cutMask;
193 Layer::Mask _metalMask;
194 DeviceDescriptors _deviceDescriptors;
195 ModelDescriptors _modelDescriptors;
196 UnitRules _unitRules;
197 PhysicalRules _noLayerRules;
198 OneLayerRules _oneLayerRules;
199 TwoLayersRules _twoLayersRules;
200
201 protected:
202 // Constructors & Destructors.
203 Technology ( DataBase* , const Name& );
204 virtual void _postCreate ();
205 virtual void _preDestroy ();
206 };
207
208
209 // Inline Functions.
210 inline bool Technology::isMetal ( const Layer* layer ) const { return _metalMask.contains(layer->getMask()); }
211 inline DataBase* Technology::getDataBase () const { return _dataBase; }
212 inline const Name& Technology::getName () const { return _name; }
213 inline Layer* Technology::getLayer ( const Name& name ) const { return _layerMap.getElement(name); }
214 inline Layers Technology::getLayers () const { return getCollection(&_layerMaskMap); }
215 inline Technology::ModelDescriptors& Technology::getModelDescriptors () { return _modelDescriptors; }
216 inline Technology::LayerMap& Technology::_getLayerMap () { return _layerMap; }
217 inline Technology::LayerMaskMap& Technology::_getLayerMaskMap () { return _layerMaskMap; }
218 inline Layer::Mask& Technology::_getCutMask () { return _cutMask; }
219 inline Layer::Mask& Technology::_getMetalMask () { return _metalMask; }
220
221
222 // -------------------------------------------------------------------
223 // Class : "Hurricane::JsonTechnology".
224
225 class JsonTechnology : public JsonDBo {
226 public:
227 static void initialize ();
228 JsonTechnology ( unsigned long flags );
229 virtual ~JsonTechnology ();
230 virtual string getTypeName () const;
231 virtual JsonTechnology* clone ( unsigned long ) const;
232 virtual void toData ( JsonStack& );
233 void addBlockageRef ( const std::string&, BasicLayer* );
234 private:
235 std::map< string, vector<BasicLayer*> > _blockagesMap;
236 };
237
238
239 } // Hurricane namespace.
240
241
242 // -------------------------------------------------------------------
243 // Inspector Support for : Hurricane::Technology::LayerPair".
244
245 template<>
246 inline std::string getString<Hurricane::Technology::LayerPair>( Hurricane::Technology::LayerPair lp )
247 { return "<LayerPair layer1=" + getString(lp.first) + ", layer2=" + getString(lp.second) + ">"; }
248
249
250 INSPECTOR_P_SUPPORT(Hurricane::Technology);
251
252
253 #endif // HURRICANE_TECHNOLOGY_H
Hurricane::Technology::getName
const Name & getName() const
Definition: Technology.h:212
Hurricane::Technology::getBasicLayer
BasicLayer * getBasicLayer(const Name &) const
Hurricane::RegularLayer
RegularLayer description (API)
Definition: RegularLayer.h:45
Hurricane::Technology::getViaLayer
ViaLayer * getViaLayer(const Name &) const
Hurricane::BasicLayer
BasicLayer description (API)
Definition: BasicLayer.h:44
Hurricane::Technology::getRegularLayers
RegularLayers getRegularLayers() const
Hurricane::Technology::getBasicLayers
BasicLayers getBasicLayers() const
Hurricane::Name
Name description (API)
Definition: Name.h:36
Hurricane::DbU::Unit
std::int64_t Unit
Definition: DbU.h:70
Hurricane::Technology::getViaLayers
ViaLayers getViaLayers() const
Hurricane::DBo
DataBase object root class (API).
Definition: DBo.h:47
Hurricane::Technology::isMetal
bool isMetal(const Layer *) const
Definition: Technology.h:210
Hurricane::Layer::Mask
Hurricane::Mask< unsigned long long > Mask
Definition: Layer.h:65
Hurricane::Technology::getLayers
Layers getLayers() const
Definition: Technology.h:214
Hurricane::GenericCollection
Generic Collection auto-pointer.
Definition: Collection.h:28
Hurricane::Technology::getLayer
Layer * getLayer(const Name &) const
Definition: Technology.h:213
Hurricane::Technology::create
static Technology * create(DataBase *, const Name &)
Hurricane::DataBase
The whole DataBase (API).
Definition: DataBase.h:40
Hurricane::Technology::getCutBelow
Layer * getCutBelow(const Layer *, bool useSymbolic=true) const
Hurricane::Layer
Layer description (API)
Definition: Layer.h:52
Hurricane::Layer::getMask
const Mask & getMask() const
Definition: Layer.h:155
Hurricane::Technology::getDataBase
DataBase * getDataBase() const
Definition: Technology.h:211
Hurricane::Technology::getNthMetal
Layer * getNthMetal(int) const
Hurricane
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5
Hurricane::Technology::getRegularLayer
RegularLayer * getRegularLayer(const Name &) const
Hurricane::Technology::getCutAbove
Layer * getCutAbove(const Layer *, bool useSymbolic=true) const
Hurricane::Technology::getMetalBelow
Layer * getMetalBelow(const Layer *, bool useSymbolic=true) const
Hurricane::Technology
Technological rules description (API).
Definition: Technology.h:66
Hurricane::ViaLayer
ViaLayer description (API)
Definition: ViaLayer.h:46
Hurricane::Technology::getViaBetween
Layer * getViaBetween(const Layer *, const Layer *, bool useSymbolic=true) const
Hurricane::Technology::getMetalAbove
Layer * getMetalAbove(const Layer *, bool useSymbolic=true) const

Generated by doxygen 1.8.14 on Sun Mar 8 2020 | Return to top of page

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