22 #include "hurricane/Entity.h"
23 #include "hurricane/Nets.h"
24 #include "hurricane/Component.h"
25 #include "hurricane/Rubbers.h"
26 #include "hurricane/Rubber.h"
27 #include "hurricane/RoutingPads.h"
28 #include "hurricane/Plugs.h"
29 #include "hurricane/Pins.h"
30 #include "hurricane/Contacts.h"
31 #include "hurricane/Segments.h"
32 #include "hurricane/Verticals.h"
33 #include "hurricane/Horizontals.h"
34 #include "hurricane/Pads.h"
35 #include "hurricane/IntrusiveSet.h"
36 #include "hurricane/Path.h"
37 #include "hurricane/NetAlias.h"
67 public:
Type& operator=(
const Type& type);
69 public:
operator const Code&()
const {
return _code;};
71 public:
const Code& getCode()
const {
return _code;};
73 public:
string _getTypeName()
const {
return _TName(
"Net::type"); };
74 public:
string _getString()
const;
75 public: Record* _getRecord()
const;
107 public:
operator const Code&()
const {
return _code;};
109 public:
const Code& getCode()
const {
return _code;};
111 public:
string _getTypeName()
const {
return _TName(
"Net::Direction"); };
112 public:
string _getString()
const;
113 public: Record* _getRecord()
const;
117 class ComponentSet :
public IntrusiveSet<Component> {
120 public:
typedef IntrusiveSet<Component>
Inherit;
122 public: ComponentSet();
124 public:
virtual unsigned _getHashValue(Component* component)
const;
125 public:
virtual Component* _getNextElement(Component* component)
const;
126 public:
virtual void _setNextElement(Component* component, Component* nextComponent)
const;
130 class RubberSet :
public IntrusiveSet<Rubber> {
133 public:
typedef IntrusiveSet<Rubber>
Inherit;
137 public:
virtual unsigned _getHashValue(Rubber* rubber)
const;
138 public:
virtual Rubber* _getNextElement(Rubber* rubber)
const;
139 public:
virtual void _setNextElement(Rubber* rubber, Rubber* nextRubber)
const;
146 private: Cell* _cell;
148 private:
Arity _arity;
149 private:
bool _isGlobal;
150 private:
bool _isExternal;
151 private:
bool _isAutomatic;
153 private: Direction _direction;
154 private: Point _position;
155 private: ComponentSet _componentSet;
156 private: RubberSet _rubberSet;
157 private: Net* _nextOfCellNetMap;
158 private: NetMainName _mainName;
163 protected: Net(Cell* cell,
const Name& name);
170 public:
virtual Cell* getCell()
const {
return _cell;};
171 public:
virtual Box getBoundingBox()
const;
173 public:
const NetMainName* getMainName()
const {
return &_mainName; }
184 public:
Pins getPins()
const;
193 public: Aliases getAliases()
const {
return new AliasList(
this); };
198 public:
static NetFilter getIsCellNetFilter();
199 public:
static NetFilter getIsDeepNetFilter();
205 public:
static NetFilter getIsPowerFilter();
206 public:
static NetFilter getIsGroundFilter();
211 public:
virtual bool isDeepNet ()
const {
return false;};
212 public:
bool isGlobal ()
const {
return _isGlobal;};
214 public:
bool isAutomatic()
const {
return _isAutomatic;};
215 public:
bool isBlockage ()
const {
return (_type == Type::BLOCKAGE);};
216 public:
bool isFused ()
const {
return (_type == Type::FUSED);};
219 public:
bool isPower ()
const {
return (_type ==
Type::POWER);};
220 public:
bool isGround ()
const {
return (_type ==
Type::GROUND);};
221 public:
bool isSupply ()
const {
return (isPower() || isGround());};
222 public:
bool hasAlias (
const Name& )
const;
223 public: NetAliasHook* getAlias (
const Name& )
const;
232 public:
void setAutomatic(
bool isAutomatic);
236 public:
void setRoutingState(uint32_t state);
240 public:
bool removeAlias(
const Name& name);
247 protected:
virtual void _postCreate();
248 protected:
virtual void _preDestroy();
250 public:
virtual void _toJson(JsonWriter*)
const;
251 public:
virtual void _toJsonSignature(JsonWriter*)
const;
252 public:
virtual void _toJsonCollections(JsonWriter*)
const;
253 public:
virtual string _getTypeName()
const {
return _TName(
"Net");};
254 public:
string _getFlagsAsString()
const;
255 public:
virtual string _getString()
const;
256 public:
virtual Record* _getRecord()
const;
257 public: NetMainName& _getMainName() {
return _mainName; }
258 public: ComponentSet& _getComponentSet() {
return _componentSet;};
259 public: RubberSet& _getRubberSet() {
return _rubberSet;};
260 public: Net* _getNextOfCellNetMap()
const {
return _nextOfCellNetMap;};
262 public:
void _setNextOfCellNetMap(Net* net) {_nextOfCellNetMap = net;};
264 public:
struct CompareByName {
265 inline bool operator() (
const Net* lhs,
const Net* rhs )
const {
return lhs->getName() < rhs->getName(); }
276 inline HookKey (
unsigned int id,
const std::string& tname );
277 inline unsigned int id ()
const;
278 inline std::string tname ()
const;
285 inline HookKey::HookKey (
unsigned int id,
const std::string& tname ) : _id(id), _tname(tname) { }
286 inline unsigned int HookKey::id ()
const {
return _id; }
287 inline std::string HookKey::tname ()
const {
return _tname; }
289 inline bool operator< (
const HookKey& lhs,
const HookKey& rhs )
291 if (lhs.id() != rhs.id())
return lhs.id() < rhs.id();
292 return lhs.tname() < rhs.tname();
301 enum Flags { OpenRingStart = (1<<0)
302 , ClosedRing = (1<<1)
305 inline HookElement ( Hook*,
unsigned long flags=0 );
306 inline Hook* hook ()
const;
307 inline HookElement* next ()
const;
308 inline void setHook ( Hook* );
309 inline void setNext ( HookElement* );
310 inline unsigned long flags ()
const;
311 inline HookElement& setFlags (
unsigned long mask );
312 inline HookElement& resetFlags (
unsigned long mask );
313 inline bool issetFlags (
unsigned long mask )
const;
317 unsigned long _flags;
321 inline HookElement::HookElement ( Hook* hook,
unsigned long flags ) : _hook(hook), _next(NULL), _flags(flags) { }
322 inline Hook* HookElement::hook ()
const {
return _hook; }
323 inline HookElement* HookElement::next ()
const {
return _next; }
324 inline void HookElement::setHook ( Hook* hook ) { _hook = hook; }
325 inline void HookElement::setNext ( HookElement* element ) { _next = element; }
326 inline unsigned long HookElement::flags ()
const {
return _flags; }
327 inline HookElement& HookElement::setFlags (
unsigned long mask ) { _flags |= mask;
return *
this; }
328 inline HookElement& HookElement::resetFlags (
unsigned long mask ) { _flags &= ~mask;
return *
this; }
329 inline bool HookElement::issetFlags (
unsigned long mask )
const {
return _flags & mask; }
332 typedef map<HookKey,HookElement> HookLut;
338 class JsonNet :
public JsonEntity {
340 static bool hookFromString ( std::string s,
unsigned int&
id, std::string& tname );
341 static void initialize ();
342 JsonNet (
unsigned long flags );
344 virtual string getTypeName ()
const;
345 virtual JsonNet* clone (
unsigned long )
const;
346 virtual void toData ( JsonStack& );
347 void addHookLink ( Hook*,
unsigned int jsonId,
const std::string& jsonNext );
348 Hook* getHook (
unsigned int jsonId,
const std::string& tname )
const;
349 bool checkRings ()
const;
350 void buildRings ()
const;
351 inline void clearHookLinks ();
353 bool _autoMaterialize;
359 inline void JsonNet::clearHookLinks () { _hooks.clear(); }
369 inline std::string getString<const Hurricane::Net::Type::Code*>
378 case Hurricane::Net::Type::BLOCKAGE:
return "BLOCKAGE";
379 case Hurricane::Net::Type::FUSED:
return "FUSED";
385 inline Hurricane::Record* getRecord<const Hurricane::Net::Type::Code*>
388 Hurricane::Record* record =
new Hurricane::Record(getString(
object));
389 record->add(getSlot(
"Code", (
unsigned int*)
object));
398 inline std::string getString<const Hurricane::Net::Direction::Code*>
401 std::ostringstream s;
407 switch ( (
int)*
object ) {
421 inline Hurricane::Record* getRecord<const Hurricane::Net::Direction::Code*>
424 Hurricane::Record* record =
new Hurricane::Record(getString(
object));
425 record->add(getSlot(
"Code", (
unsigned int*)
object));
431 INSPECTOR_P_SUPPORT(Hurricane::Net::ComponentSet);
432 INSPECTOR_P_SUPPORT(Hurricane::Net::RubberSet);
445 const SlotTemplate<Net*> dummyNetSlot (
string(
"dummyNetSlot"), NULL );
448 typedef std::set<Net*,DBo::CompareById> NetSet;
Box description (API)
Definition: Box.h:29
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:86
@ DirOut
Definition: Net.h:83
@ WOR_OUT
Definition: Net.h:93
@ OUT
Definition: Net.h:89
@ WOR_INOUT
Definition: Net.h:94
@ DirUndefined
Definition: Net.h:84
@ DirIn
Definition: Net.h:82
@ TRISTATE
Definition: Net.h:91
@ INOUT
Definition: Net.h:90
@ TRANSCV
Definition: Net.h:92
@ UNDEFINED
Definition: Net.h:87
@ ConnTristate
Definition: Net.h:85
@ POWER
Definition: Net.h:59
@ GROUND
Definition: Net.h:59
@ LOGICAL
Definition: Net.h:59
@ CLOCK
Definition: Net.h:59
@ UNDEFINED
Definition: Net.h:59
Net description (API)
Definition: Net.h:46
Plugs getConnectedSlavePlugs() const
void setPosition(const Point &position)
const Type & getType() const
Definition: Net.h:175
RoutingPads getRoutingPads() const
static NetFilter getIsGlobalFilter()
Components getComponents() const
Definition: Net.h:180
const DbU::Unit & getX() const
Definition: Net.h:178
bool isGlobal() const
Definition: Net.h:212
void setGlobal(bool isGlobal)
unsigned Arity
Definition: Net.h:54
static NetFilter getIsExternalFilter()
Entity Inherit
Definition: Net.h:52
Net * getClone(Cell *cloneCell)
void setExternal(bool isExternal)
Rubbers getRubbers() const
Definition: Net.h:181
const Arity & getArity() const
Definition: Net.h:174
static NetFilter getIsInternalFilter()
void setType(const Type &type)
bool isClock() const
Definition: Net.h:218
Verticals getVerticals() const
Contacts getContacts() const
Plugs getSlavePlugs() const
bool isLogical() const
Definition: Net.h:217
const Direction & getDirection() const
Definition: Net.h:176
const DbU::Unit & getY() const
Definition: Net.h:179
Plugs getUnconnectedSlavePlugs() const
Segments getSegments() const
bool isSupply() const
Definition: Net.h:221
const Point & getPosition() const
Definition: Net.h:177
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:172
bool isExternal() const
Definition: Net.h:213
void setArity(const Arity &arity)
static NetFilter getIsClockFilter()
Point description (API)
Definition: Point.h:30
Contains Almost Everything.
Definition: BasicLayer.h:39