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;
82 typedef std::map<const Name , Hurricane::Layer*> LayerAliases;
86 class LayerMap :
public IntrusiveMap<Name,Layer> {
88 typedef IntrusiveMap<Name,Layer>
Super;
92 virtual unsigned _getHashValue (
Name )
const;
93 virtual Layer* _getNextElement (
Layer* )
const;
94 virtual void _setNextElement (
Layer* ,
Layer* nextLayer)
const;
120 Layer* getNthCut (
int )
const;
121 DeviceDescriptor* getDeviceDescriptor (
const Name& );
122 ModelDescriptor* getModelDescriptor (
const Name& );
123 inline ModelDescriptors& getModelDescriptors ();
125 PhysicalRule* getPhysicalRule ( std::string ruleName )
const;
127 , std::string layerName )
const;
129 , std::string layer1Name
130 , std::string layer2Name )
const;
131 inline const UnitRules& getUnitRules ()
const;
132 inline const PhysicalRules& getNoLayerRules ()
const;
133 inline const OneLayerRules& getOneLayerRules ()
const;
134 inline const TwoLayersRules& getTwoLayersRules ()
const;
135 void toDtr ( std::ostream& );
136 inline void setName (
const std::string& name );
139 bool setSymbolicLayer (
const Name& );
141 bool addLayerAlias (
const Name& reference,
const Name& alias );
142 DeviceDescriptor* addDeviceDescriptor (
const Name& );
143 ModelDescriptor* addModelDescriptor (
const Name& name
146 , std::string netlist
151 , std::string reference );
153 , std::string reference );
154 void _addPhysicalRule ( std::string layerName
157 , std::string layerName
158 , std::string reference);
160 , std::string layer1Name
161 , std::string layer2Name
162 , std::string reference );
164 inline LayerMap& _getLayerMap ();
165 inline LayerMaskMap& _getLayerMaskMap ();
166 void _insertInLayerMaskMap (
Layer* );
167 void _removeFromLayerMaskMap (
Layer* );
170 void _onDbuChange (
float scale );
172 virtual void _toJson ( JsonWriter* )
const;
173 virtual void _toJsonCollections ( JsonWriter* )
const;
174 virtual string _getTypeName ()
const;
175 virtual string _getString ()
const;
176 virtual Record* _getRecord ()
const;
183 LayerMaskMap _layerMaskMap;
186 LayerAliases _layerAliases;
187 DeviceDescriptors _deviceDescriptors;
188 ModelDescriptors _modelDescriptors;
189 UnitRules _unitRules;
190 PhysicalRules _noLayerRules;
191 OneLayerRules _oneLayerRules;
192 TwoLayersRules _twoLayersRules;
197 virtual void _postCreate ();
198 virtual void _preDestroy ();
207 inline Technology::ModelDescriptors& Technology::getModelDescriptors () {
return _modelDescriptors; }
208 inline Technology::LayerMap& Technology::_getLayerMap () {
return _layerMap; }
209 inline Technology::LayerMaskMap& Technology::_getLayerMaskMap () {
return _layerMaskMap; }
210 inline Layer::Mask& Technology::_getCutMask () {
return _cutMask; }
211 inline Layer::Mask& Technology::_getMetalMask () {
return _metalMask; }
217 class JsonTechnology :
public JsonDBo {
219 static void initialize ();
220 JsonTechnology (
unsigned long flags );
221 virtual ~JsonTechnology ();
222 virtual string getTypeName ()
const;
223 virtual JsonTechnology* clone (
unsigned long )
const;
224 virtual void toData ( JsonStack& );
225 void addBlockageRef (
const std::string&, BasicLayer* );
227 std::map< string, vector<BasicLayer*> > _blockagesMap;
238 inline std::string getString<Hurricane::Technology::LayerPair>( Hurricane::Technology::LayerPair lp )
239 {
return "<LayerPair layer1=" + getString(lp.first) +
", layer2=" + getString(lp.second) +
">"; }
BasicLayer description (API)
Definition: BasicLayer.h:42
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:50
const Mask & getMask() const
Definition: Layer.h:156
Hurricane::Mask< boost::multiprecision::uint128_t > Mask
Definition: Layer.h:53
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:206
Layer * getLayer(const Name &) const
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:204
Layer * getMetalBelow(const Layer *, bool useSymbolic=true) const
const Name & getName() const
Definition: Technology.h:205
bool isMetal(const Layer *) const
Definition: Technology.h:203
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
Contains Almost Everything.
Definition: BasicLayer.h:39