35 #include "hurricane/Mask.h"
36 #include "hurricane/DBo.h"
37 #include "hurricane/Layer.h"
38 #include "hurricane/BasicLayers.h"
39 #include "hurricane/RegularLayers.h"
40 #include "hurricane/ViaLayers.h"
41 #include "hurricane/IntrusiveMap.h"
42 #include "hurricane/DeviceDescriptor.h"
43 #include "hurricane/ModelDescriptor.h"
44 #include "hurricane/Rule.h"
45 #include "hurricane/PhysicalRule.h"
66 typedef multimap<Layer::Mask,Layer*> LayerMaskMap;
67 typedef set<DeviceDescriptor*, DeviceDescriptor::DeviceDescriptorComp> DeviceDescriptors;
68 typedef set<ModelDescriptor* , ModelDescriptor::ModelDescriptorComp> ModelDescriptors;
70 struct RuleNameCompare {
72 {
return rule1->getName() < rule2->getName(); }
73 inline bool operator() (
const Rule* rule1 ,
const Rule* rule2 )
const
74 {
return rule1->getName() < rule2->getName(); }
77 typedef std::pair<const Hurricane::Layer*, const Hurricane::Layer*> LayerPair;
78 typedef std::set<PhysicalRule* , RuleNameCompare> UnitRules;
79 typedef std::set<PhysicalRule* , RuleNameCompare> PhysicalRules;
80 typedef std::map<const Hurricane::Layer* , PhysicalRules> OneLayerRules;
81 typedef std::map<LayerPair , PhysicalRules> TwoLayersRules;
85 class LayerMap :
public IntrusiveMap<Name,Layer> {
87 typedef IntrusiveMap<Name,Layer>
Super;
91 virtual unsigned _getHashValue (
Name )
const;
92 virtual Layer* _getNextElement (
Layer* )
const;
93 virtual void _setNextElement (
Layer* ,
Layer* nextLayer)
const;
119 Layer* getNthCut (
int )
const;
120 DeviceDescriptor* getDeviceDescriptor (
const Name& );
121 ModelDescriptor* getModelDescriptor (
const Name& );
122 inline ModelDescriptors& getModelDescriptors ();
124 PhysicalRule* getPhysicalRule ( std::string ruleName )
const;
126 , std::string layerName )
const;
128 , std::string layer1Name
129 , std::string layer2Name )
const;
130 inline const UnitRules& getUnitRules ()
const;
131 inline const PhysicalRules& getNoLayerRules ()
const;
132 inline const OneLayerRules& getOneLayerRules ()
const;
133 inline const TwoLayersRules& getTwoLayersRules ()
const;
134 void toDtr ( std::ostream& );
135 inline void setName (
const std::string& name );
138 bool setSymbolicLayer (
const Name& );
140 DeviceDescriptor* addDeviceDescriptor (
const Name& );
141 ModelDescriptor* addModelDescriptor (
const Name& name
144 , std::string netlist
149 , std::string reference );
151 , std::string reference );
152 void _addPhysicalRule ( std::string layerName
155 , std::string layerName
156 , std::string reference);
158 , std::string layer1Name
159 , std::string layer2Name
160 , std::string reference );
162 inline LayerMap& _getLayerMap ();
163 inline LayerMaskMap& _getLayerMaskMap ();
164 void _insertInLayerMaskMap (
Layer* );
165 void _removeFromLayerMaskMap (
Layer* );
168 void _onDbuChange (
float scale );
170 virtual void _toJson ( JsonWriter* )
const;
171 virtual void _toJsonCollections ( JsonWriter* )
const;
172 virtual string _getTypeName ()
const;
173 virtual string _getString ()
const;
174 virtual Record* _getRecord ()
const;
181 LayerMaskMap _layerMaskMap;
184 DeviceDescriptors _deviceDescriptors;
185 ModelDescriptors _modelDescriptors;
186 UnitRules _unitRules;
187 PhysicalRules _noLayerRules;
188 OneLayerRules _oneLayerRules;
189 TwoLayersRules _twoLayersRules;
194 virtual void _postCreate ();
195 virtual void _preDestroy ();
205 inline Technology::ModelDescriptors& Technology::getModelDescriptors () {
return _modelDescriptors; }
206 inline Technology::LayerMap& Technology::_getLayerMap () {
return _layerMap; }
207 inline Technology::LayerMaskMap& Technology::_getLayerMaskMap () {
return _layerMaskMap; }
208 inline Layer::Mask& Technology::_getCutMask () {
return _cutMask; }
209 inline Layer::Mask& Technology::_getMetalMask () {
return _metalMask; }
215 class JsonTechnology :
public JsonDBo {
217 static void initialize ();
218 JsonTechnology (
unsigned long flags );
219 virtual ~JsonTechnology ();
220 virtual string getTypeName ()
const;
221 virtual JsonTechnology* clone (
unsigned long )
const;
222 virtual void toData ( JsonStack& );
223 void addBlockageRef (
const std::string&, BasicLayer* );
225 std::map< string, vector<BasicLayer*> > _blockagesMap;
236 inline std::string getString<Hurricane::Technology::LayerPair>( Hurricane::Technology::LayerPair lp )
237 {
return "<LayerPair layer1=" + getString(lp.first) +
", layer2=" + getString(lp.second) +
">"; }
BasicLayer description (API)
Definition: BasicLayer.h:44
DataBase object root class (API).
Definition: DBo.h:45
The whole DataBase (API).
Definition: DataBase.h:40
Generic Collection auto-pointer.
Definition: Collection.h:235
Layer description (API)
Definition: Layer.h:52
const Mask & getMask() const
Definition: Layer.h:158
Hurricane::Mask< unsigned long long > Mask
Definition: Layer.h:65
Name description (API)
Definition: Name.h:35
Define a rule for the technology (API).
Definition: PhysicalRule.h:65
RegularLayer description (API)
Definition: RegularLayer.h:45
Technological rules description (API).
Definition: Technology.h:62
RegularLayer * getRegularLayer(const Name &) const
PhysicalRule * getPhysicalRule(std::string ruleName, std::string layerName) const
void setName(const Name &)
PhysicalRule * addPhysicalRule(std::string ruleName, std::string reference)
bool setSymbolicLayer(const Layer *)
Layer * getLayer(const Layer::Mask &, bool useSymbolic=true) const
Layer * getCutBelow(const Layer *, bool useSymbolic=true) const
PhysicalRule * addPhysicalRule(std::string ruleName, std::string layer1Name, std::string layer2Name, std::string reference)
PhysicalRule * addPhysicalRule(std::string ruleName, std::string layerName, std::string reference)
Layers getLayers() const
Definition: Technology.h:204
Layer * getLayer(const Name &) const
Definition: Technology.h:203
static Technology * create(DataBase *, const Name &)
PhysicalRule * getUnitRule(std::string ruleName) const
BasicLayers getBasicLayers() const
Layer * getNthMetal(int) const
Layer * getViaBetween(const Layer *, const Layer *, bool useSymbolic=true) const
PhysicalRule * addUnitRule(std::string ruleName, std::string reference)
BasicLayers getBasicLayers(const Layer::Mask &) const
ViaLayer * getViaLayer(const Name &) const
ViaLayers getViaLayers() const
BasicLayer * getBasicLayer(const Name &) const
RegularLayers getRegularLayers() const
Layer * getCutAbove(const Layer *, bool useSymbolic=true) const
DataBase * getDataBase() const
Definition: Technology.h:201
Layer * getMetalBelow(const Layer *, bool useSymbolic=true) const
const Name & getName() const
Definition: Technology.h:202
bool isMetal(const Layer *) const
Definition: Technology.h:200
PhysicalRule * getPhysicalRule(std::string ruleName, std::string layer1Name, std::string layer2Name) const
Layer * getMetalAbove(const Layer *, bool useSymbolic=true) const
ViaLayer description (API)
Definition: ViaLayer.h:46
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5