17 #ifndef KITE_TRACK_ELEMENT_H 18 #define KITE_TRACK_ELEMENT_H 23 #include "hurricane/Interval.h" 30 #include "katabatic/AutoSegment.h" 31 #include "kite/Constants.h" 32 #include "kite/Session.h" 33 #include "kite/TrackElements.h" 40 using Hurricane::Record;
48 using Katabatic::KbNoFlags;
55 typedef map<Segment*,TrackElement*> TrackElementLut;
56 typedef void (SegmentOverlapCostCB)(
const TrackElement*, TrackCost& );
65 virtual void notify (
unsigned int flags );
71 inline SegmentObserver::SegmentObserver (
TrackElement* owner )
79 enum TrackElementFlags { TElemCreated =0x00000001
80 , TElemBlockage =0x00000002
81 , TElemFixed =0x00000004
82 , TElemLocked =0x00000008
83 , TElemRouted =0x00000010
84 , TElemSourceDogleg=0x00000020
85 , TElemTargetDogleg=0x00000040
86 , TElemRipple =0x00000080
87 , TElemInvalidated =0x00000100
95 struct CompareByPosition {
108 virtual bool isFixed ()
const;
109 virtual bool isHorizontal ()
const = 0;
110 virtual bool isVertical ()
const = 0;
111 virtual bool isLocal ()
const;
112 virtual bool isGlobal ()
const;
113 virtual bool isBipoint ()
const;
114 virtual bool isTerminal ()
const;
115 virtual bool isStrongTerminal (
unsigned int flags=0 )
const;
116 virtual bool isStrap ()
const;
117 virtual bool isSlackened ()
const;
118 virtual bool isDogleg ()
const;
119 virtual bool isReduced ()
const;
120 virtual bool isUTurn ()
const;
121 virtual bool isUserDefined ()
const;
123 inline bool isCreated ()
const;
124 inline bool isInvalidated ()
const;
125 inline bool isBlockage ()
const;
126 inline bool isLocked ()
const;
127 inline bool isRouted ()
const;
128 inline bool hasSourceDogleg ()
const;
129 inline bool hasTargetDogleg ()
const;
130 inline bool canRipple ()
const;
131 virtual bool canSlacken ()
const;
132 virtual bool canPivotUp (
float reserve )
const;
133 virtual bool canPivotDown (
float reserve )
const;
134 virtual bool canMoveUp (
float reserve,
unsigned int flags=KbWithPerpands )
const;
135 virtual bool canDogleg ();
136 virtual bool canDogleg (
Interval );
140 virtual unsigned long getId ()
const;
141 virtual unsigned int getDirection ()
const = 0;
142 virtual Net* getNet ()
const = 0;
143 virtual const Layer* getLayer ()
const = 0;
146 inline Track* getTrack ()
const;
147 inline size_t getIndex ()
const;
148 virtual unsigned long getFreedomDegree ()
const;
149 virtual float getMaxUnderDensity (
unsigned int flags=0 )
const;
150 inline Box getBoundingBox ()
const;
157 inline Interval getCanonicalInterval ()
const;
158 virtual Interval getFreeInterval ()
const;
159 virtual Interval getSourceConstraints ()
const;
160 virtual Interval getTargetConstraints ()
const;
163 virtual size_t getGCells ( Katabatic::GCellVector& )
const;
165 virtual unsigned int getDoglegLevel ()
const;
168 virtual TrackElements getPerpandiculars ();
170 inline void setFlags (
unsigned int );
171 inline void unsetFlags (
unsigned int );
172 inline void setRouted ();
173 virtual void setTrack (
Track* );
174 inline void setIndex (
size_t );
175 virtual void updateFreedomDegree ();
176 virtual void setDoglegLevel (
unsigned int );
178 virtual void reschedule (
unsigned int level );
179 virtual void detach ();
180 virtual void invalidate ();
181 virtual void revalidate ();
182 virtual void updatePPitch ();
183 virtual void incOverlapCost (
Net*, TrackCost& )
const;
184 virtual void setAxis (
DbU::Unit,
unsigned int flags=Katabatic::SegAxisSet );
190 virtual bool moveAside (
unsigned int flags );
191 virtual bool slacken (
unsigned int flags=KbNoFlags );
192 virtual bool moveUp (
unsigned int flags );
193 virtual bool moveDown (
unsigned int flags );
195 virtual void desalignate ();
197 virtual bool _check ()
const;
198 virtual Record* _getRecord ()
const;
199 virtual string _getString ()
const;
200 virtual string _getTypeName ()
const;
217 virtual void _postCreate ();
218 virtual void _preDestroy ();
227 inline SegmentObserver* TrackElement::getObserver () {
return &_observer; }
228 inline void TrackElement::setFlags (
unsigned int flags ) { _flags|= flags; }
229 inline void TrackElement::unsetFlags (
unsigned int flags ) { _flags&=~flags; }
230 inline bool TrackElement::isCreated ()
const {
return _flags & TElemCreated; }
231 inline bool TrackElement::isInvalidated ()
const {
return _flags & TElemInvalidated; }
232 inline bool TrackElement::isBlockage ()
const {
return _flags & TElemBlockage; }
233 inline bool TrackElement::isLocked ()
const {
return _flags & TElemLocked; }
234 inline bool TrackElement::isRouted ()
const {
return _flags & TElemRouted; }
235 inline bool TrackElement::hasSourceDogleg ()
const {
return _flags & TElemSourceDogleg; }
236 inline bool TrackElement::hasTargetDogleg ()
const {
return _flags & TElemTargetDogleg; }
237 inline bool TrackElement::canRipple ()
const {
return _flags & TElemRipple; }
238 inline Track* TrackElement::getTrack ()
const {
return _track; }
239 inline size_t TrackElement::getIndex ()
const {
return _index; }
240 inline DbU::Unit TrackElement::getLength ()
const {
return getTargetU() - getSourceU(); }
241 inline DbU::Unit TrackElement::getSourceU ()
const {
return _sourceU; }
242 inline DbU::Unit TrackElement::getTargetU ()
const {
return _targetU; }
243 inline Interval TrackElement::getCanonicalInterval ()
const {
return Interval(getSourceU(),getTargetU()); }
244 inline void TrackElement::setIndex (
size_t index ) { _index=index; }
246 inline void TrackElement::setRouted()
248 _flags |= TElemRouted;
249 if (base()) base()->setFlags( Katabatic::SegFixed );
252 inline Box TrackElement::getBoundingBox ()
const 254 if (getDirection() == KbHorizontal)
264 makeDogleg( gcell, perpandicular, parallel );
266 return (perpandicular != NULL);
static Unit lambda(double value)
void() SegmentOverlapCostCB(const TrackElement *, TrackCost &)
Definition: TrackElement.h:56
Observer on the base AutoSegment.
Definition: TrackElement.h:62
Structure managing one routing track.
Definition: Track.h:42
Definition: Constants.h:40
Abstract Class for all Elements inserted inside a Track.
Definition: TrackElement.h:100
The namespace dedicated to Kite.
Definition: Constants.h:22
Algorimthmic datas associated the TrackSegment.
Definition: DataNegociate.h:50