24 #include "hurricane/Entity.h"
25 #include "hurricane/Nets.h"
26 #include "hurricane/Component.h"
27 #include "hurricane/Rubbers.h"
28 #include "hurricane/Rubber.h"
29 #include "hurricane/RoutingPads.h"
30 #include "hurricane/Plugs.h"
31 #include "hurricane/Pins.h"
32 #include "hurricane/Contacts.h"
33 #include "hurricane/Segments.h"
34 #include "hurricane/Verticals.h"
35 #include "hurricane/Horizontals.h"
36 #include "hurricane/Pads.h"
37 #include "hurricane/IntrusiveSet.h"
38 #include "hurricane/Path.h"
39 #include "hurricane/NetAlias.h"
69 public:
Type& operator=(
const Type& type);
71 public:
operator const Code&()
const {
return _code;};
73 public:
const Code& getCode()
const {
return _code;};
75 public:
string _getTypeName()
const {
return _TName(
"Net::type"); };
76 public:
string _getString()
const;
77 public: Record* _getRecord()
const;
109 public:
operator const Code&()
const {
return _code;};
111 public:
const Code& getCode()
const {
return _code;};
113 public:
string _getTypeName()
const {
return _TName(
"Net::Direction"); };
114 public:
string _getString()
const;
115 public: Record* _getRecord()
const;
119 class ComponentSet :
public IntrusiveSet<Component> {
122 public:
typedef IntrusiveSet<Component>
Inherit;
124 public: ComponentSet();
126 public:
virtual unsigned _getHashValue(Component* component)
const;
127 public:
virtual Component* _getNextElement(Component* component)
const;
128 public:
virtual void _setNextElement(Component* component, Component* nextComponent)
const;
132 class RubberSet :
public IntrusiveSet<Rubber> {
135 public:
typedef IntrusiveSet<Rubber>
Inherit;
139 public:
virtual unsigned _getHashValue(Rubber* rubber)
const;
140 public:
virtual Rubber* _getNextElement(Rubber* rubber)
const;
141 public:
virtual void _setNextElement(Rubber* rubber, Rubber* nextRubber)
const;
148 private: Cell* _cell;
150 private:
Arity _arity;
151 private:
bool _isGlobal;
152 private:
bool _isExternal;
153 private:
bool _isAutomatic;
155 private: Direction _direction;
156 private: Point _position;
157 private: ComponentSet _componentSet;
158 private: RubberSet _rubberSet;
159 private: Net* _nextOfCellNetMap;
160 private: NetMainName _mainName;
165 protected: Net(Cell* cell,
const Name& name);
172 public:
virtual Cell* getCell()
const {
return _cell;};
173 public:
virtual Box getBoundingBox()
const;
175 public:
const NetMainName* getMainName()
const {
return &_mainName; }
186 public:
Pins getPins()
const;
195 public: Aliases getAliases()
const {
return new AliasList(
this); };
200 public:
static NetFilter getIsCellNetFilter();
201 public:
static NetFilter getIsDeepNetFilter();
207 public:
static NetFilter getIsPowerFilter();
208 public:
static NetFilter getIsGroundFilter();
213 public:
virtual bool isDeepNet ()
const {
return false;};
214 public:
bool isGlobal ()
const {
return _isGlobal;};
216 public:
bool isAutomatic()
const {
return _isAutomatic;};
217 public:
bool isBlockage ()
const {
return (_type == Type::BLOCKAGE);};
218 public:
bool isFused ()
const {
return (_type == Type::FUSED);};
221 public:
bool isPower ()
const {
return (_type ==
Type::POWER);};
222 public:
bool isGround ()
const {
return (_type ==
Type::GROUND);};
223 public:
bool isSupply ()
const {
return (isPower() || isGround());};
224 public:
bool hasAlias (
const Name& )
const;
225 public: NetAliasHook* getAlias (
const Name& )
const;
234 public:
void setAutomatic(
bool isAutomatic);
238 public:
void setRoutingState(uint32_t state);
242 public:
bool removeAlias(
const Name& name);
249 protected:
virtual void _postCreate();
250 protected:
virtual void _preDestroy();
252 public:
virtual void _toJson(JsonWriter*)
const;
253 public:
virtual void _toJsonSignature(JsonWriter*)
const;
254 public:
virtual void _toJsonCollections(JsonWriter*)
const;
255 public:
virtual string _getTypeName()
const {
return _TName(
"Net");};
256 public:
virtual string _getString()
const;
257 public:
virtual Record* _getRecord()
const;
258 public: NetMainName& _getMainName() {
return _mainName; }
259 public: ComponentSet& _getComponentSet() {
return _componentSet;};
260 public: RubberSet& _getRubberSet() {
return _rubberSet;};
261 public: Net* _getNextOfCellNetMap()
const {
return _nextOfCellNetMap;};
263 public:
void _setNextOfCellNetMap(Net* net) {_nextOfCellNetMap = net;};
265 public:
struct CompareByName {
266 inline bool operator() (
const Net* lhs,
const Net* rhs )
const {
return lhs->getName() < rhs->getName(); }
277 inline HookKey (
unsigned int id,
const std::string& tname );
278 inline unsigned int id ()
const;
279 inline std::string tname ()
const;
286 inline HookKey::HookKey (
unsigned int id,
const std::string& tname ) : _id(id), _tname(tname) { }
287 inline unsigned int HookKey::id ()
const {
return _id; }
288 inline std::string HookKey::tname ()
const {
return _tname; }
290 inline bool operator< (
const HookKey& lhs,
const HookKey& rhs )
292 if (lhs.id() != rhs.id())
return lhs.id() < rhs.id();
293 return lhs.tname() < rhs.tname();
302 enum Flags { OpenRingStart = (1<<0)
303 , ClosedRing = (1<<1)
306 inline HookElement ( Hook*,
unsigned long flags=0 );
307 inline Hook* hook ()
const;
308 inline HookElement* next ()
const;
309 inline void setHook ( Hook* );
310 inline void setNext ( HookElement* );
311 inline unsigned long flags ()
const;
312 inline HookElement& setFlags (
unsigned long mask );
313 inline HookElement& resetFlags (
unsigned long mask );
314 inline bool issetFlags (
unsigned long mask )
const;
318 unsigned long _flags;
322 inline HookElement::HookElement ( Hook* hook,
unsigned long flags ) : _hook(hook), _next(NULL), _flags(flags) { }
323 inline Hook* HookElement::hook ()
const {
return _hook; }
324 inline HookElement* HookElement::next ()
const {
return _next; }
325 inline void HookElement::setHook ( Hook* hook ) { _hook = hook; }
326 inline void HookElement::setNext ( HookElement* element ) { _next = element; }
327 inline unsigned long HookElement::flags ()
const {
return _flags; }
328 inline HookElement& HookElement::setFlags (
unsigned long mask ) { _flags |= mask;
return *
this; }
329 inline HookElement& HookElement::resetFlags (
unsigned long mask ) { _flags &= ~mask;
return *
this; }
330 inline bool HookElement::issetFlags (
unsigned long mask )
const {
return _flags & mask; }
333 typedef map<HookKey,HookElement> HookLut;
339 class JsonNet :
public JsonEntity {
341 static bool hookFromString ( std::string s,
unsigned int&
id, std::string& tname );
342 static void initialize ();
343 JsonNet (
unsigned long flags );
345 virtual string getTypeName ()
const;
346 virtual JsonNet* clone (
unsigned long )
const;
347 virtual void toData ( JsonStack& );
348 void addHookLink ( Hook*,
unsigned int jsonId,
const std::string& jsonNext );
349 Hook* getHook (
unsigned int jsonId,
const std::string& tname )
const;
350 bool checkRings ()
const;
351 void buildRings ()
const;
352 inline void clearHookLinks ();
354 bool _autoMaterialize;
360 inline void JsonNet::clearHookLinks () { _hooks.clear(); }
370 inline std::string getString<const Hurricane::Net::Type::Code*>
379 case Hurricane::Net::Type::BLOCKAGE:
return "BLOCKAGE";
380 case Hurricane::Net::Type::FUSED:
return "FUSED";
386 inline Hurricane::Record* getRecord<const Hurricane::Net::Type::Code*>
389 Hurricane::Record* record =
new Hurricane::Record(getString(
object));
390 record->add(getSlot(
"Code", (
unsigned int*)
object));
399 inline std::string getString<const Hurricane::Net::Direction::Code*>
402 std::ostringstream s;
408 switch ( (
int)*
object ) {
422 inline Hurricane::Record* getRecord<const Hurricane::Net::Direction::Code*>
425 Hurricane::Record* record =
new Hurricane::Record(getString(
object));
426 record->add(getSlot(
"Code", (
unsigned int*)
object));
432 INSPECTOR_P_SUPPORT(Hurricane::Net::ComponentSet);
433 INSPECTOR_P_SUPPORT(Hurricane::Net::RubberSet);
446 const SlotTemplate<Net*> dummyNetSlot (
string(
"dummyNetSlot"), NULL );
Box description (API)
Definition: Box.h:31
The model (API).
Definition: Cell.h:64
std::int64_t Unit
Definition: DbU.h:67
Occurrenceable objects root class (API).
Definition: Entity.h:37
Generic Collection auto-pointer.
Definition: Collection.h:235
Generic Filter auto-pointer.
Definition: Filter.h:86
Name description (API)
Definition: Name.h:35
@ ConnWiredOr
Definition: Net.h:88
@ DirOut
Definition: Net.h:85
@ WOR_OUT
Definition: Net.h:95
@ OUT
Definition: Net.h:91
@ WOR_INOUT
Definition: Net.h:96
@ DirUndefined
Definition: Net.h:86
@ DirIn
Definition: Net.h:84
@ TRISTATE
Definition: Net.h:93
@ INOUT
Definition: Net.h:92
@ TRANSCV
Definition: Net.h:94
@ UNDEFINED
Definition: Net.h:89
@ ConnTristate
Definition: Net.h:87
@ POWER
Definition: Net.h:61
@ GROUND
Definition: Net.h:61
@ LOGICAL
Definition: Net.h:61
@ CLOCK
Definition: Net.h:61
@ UNDEFINED
Definition: Net.h:61
Net description (API)
Definition: Net.h:48
Plugs getConnectedSlavePlugs() const
void setPosition(const Point &position)
const Type & getType() const
Definition: Net.h:177
RoutingPads getRoutingPads() const
static NetFilter getIsGlobalFilter()
Components getComponents() const
Definition: Net.h:182
const DbU::Unit & getX() const
Definition: Net.h:180
bool isGlobal() const
Definition: Net.h:214
void setGlobal(bool isGlobal)
unsigned Arity
Definition: Net.h:56
static NetFilter getIsExternalFilter()
Entity Inherit
Definition: Net.h:54
Net * getClone(Cell *cloneCell)
void setExternal(bool isExternal)
Rubbers getRubbers() const
Definition: Net.h:183
const Arity & getArity() const
Definition: Net.h:176
static NetFilter getIsInternalFilter()
void setType(const Type &type)
bool isClock() const
Definition: Net.h:220
Verticals getVerticals() const
Contacts getContacts() const
Plugs getSlavePlugs() const
bool isLogical() const
Definition: Net.h:219
const Direction & getDirection() const
Definition: Net.h:178
const DbU::Unit & getY() const
Definition: Net.h:181
Plugs getUnconnectedSlavePlugs() const
Segments getSegments() const
bool isSupply() const
Definition: Net.h:223
const Point & getPosition() const
Definition: Net.h:179
static Net * create(Cell *cell, const Name &name)
static NetFilter getIsSupplyFilter()
void setDirection(const Direction &direction)
Horizontals getHorizontals() const
const Name & getName() const
Definition: Net.h:174
bool isExternal() const
Definition: Net.h:215
void setArity(const Arity &arity)
static NetFilter getIsClockFilter()
Point description (API)
Definition: Point.h:32
The namespace dedicated to Hurricane.
Definition: Generalities.dox:5