17 #ifndef KITE_ROUTING_EVENT_H
18 #define KITE_ROUTING_EVENT_H
25 #include "hurricane/Interval.h"
30 #include "kite/TrackCost.h"
31 #include "kite/TrackElement.h"
32 #include "kite/DataNegociate.h"
33 #include "kite/Session.h"
40 using std::binary_function;
47 class RoutingEventHistory;
48 class RoutingEventQueue;
49 class RoutingEventLoop;
60 class Compare :
public binary_function<const Key&,const Key&,bool> {
62 bool operator() (
const Key& lhs,
const Key& rhs )
const;
69 unsigned int _tracksNb:6;
71 unsigned int _eventLevel;
72 unsigned int _segFlags;
73 unsigned int _layerDepth;
84 class Compare :
public binary_function<const RoutingEvent*,const RoutingEvent*,bool> {
89 class CompareById :
public binary_function<const RoutingEvent*,const RoutingEvent*,bool> {
102 static size_t getCloneds ();
104 static void setStage (
unsigned int );
115 inline bool isSheared ()
const;
117 inline bool isOverConstrained ()
const;
118 inline unsigned int getId ()
const;
119 inline unsigned int getTimeStamp ()
const;
123 inline const Key&
getKey ()
const;
131 inline const Interval& getPerpandicularFree ()
const;
134 inline unsigned int getTracksFree ()
const;
147 inline void setTimeStamp (
unsigned int );
148 inline void setProcessed (
bool state=
true );
149 inline void setDisabled (
bool state=
true );
150 inline void setMinimized (
bool state=
true );
151 inline void setRipedByLocal (
bool state=
true );
152 inline void setTracksFree (
unsigned int );
153 inline void setForcedToHint (
bool state =
true );
162 Record* _getRecord ()
const;
163 string _getString ()
const;
164 string _getTypeName ()
const;
171 static unsigned int _idCounter;
172 static unsigned int _stage;
173 static size_t _allocateds;
174 static size_t _processeds;
175 static size_t _cloneds;
176 mutable bool _cloned;
179 bool _overConstrained;
184 unsigned int _timeStamp;
192 unsigned int _tracksNb : 6;
193 unsigned int _tracksFree : 4;
194 unsigned int _insertState : 6;
195 unsigned int _mode : 4;
196 unsigned int _rippleState : 4;
197 unsigned int _eventLevel;
210 inline bool RoutingEvent::isOverConstrained ()
const {
return _overConstrained; }
211 inline unsigned int RoutingEvent::getId ()
const {
return _id; }
212 inline unsigned int RoutingEvent::getTimeStamp ()
const {
return _timeStamp; }
229 inline unsigned int RoutingEvent::getTracksFree ()
const {
return _tracksFree; }
231 inline void RoutingEvent::setTimeStamp (
unsigned int stamp ) { _timeStamp = stamp; }
232 inline void RoutingEvent::setProcessed (
bool state ) { _processed = state; }
233 inline void RoutingEvent::setDisabled (
bool state ) { _disabled = state; }
234 inline void RoutingEvent::setMinimized (
bool state ) { _minimized = state; }
235 inline void RoutingEvent::setRipedByLocal (
bool state ) { _ripedByLocal = state; }
236 inline void RoutingEvent::setTracksFree (
unsigned int nb ) { _tracksFree = nb; }
237 inline void RoutingEvent::setForcedToHint (
bool state ) { _forceToHint = state; }
244 {
return lhs->getId() < rhs->getId(); }
247 typedef set<RoutingEvent*,RoutingEvent::CompareById> RoutingEventSet;
254 # if !defined(NDEBUG)
255 # define _preCheck(segment) \
256 DbU::Unit beforeMin = segment->base()->getSourcePosition(); \
257 DbU::Unit beforeMax = segment->base()->getTargetPosition(); \
258 segment->base()->checkPositions (); \
259 if ( Session::getSegmentStackSize() ) \
260 cerr << "[ERROR] Session Segment Stack is not empty (" \
261 << Session::getSegmentStackSize() << ")." << endl;
263 # define _postCheck(segment) \
264 cdebug_log(159,0) << "Bounds := [" \
265 << DbU::getValueString(segment->base()->getSourcePosition()) << ":" \
266 << DbU::getValueString(segment->base()->getTargetPosition()) << "] " \
267 << DbU::getValueString(segment->getAxis()) << " " \
268 << segment->getTrack() << endl; \
269 if ( beforeMin != segment->base()->getSourcePosition() ) \
270 cerr << "[ERROR] " << segment \
271 << " origin was " << DbU::getValueString(beforeMin) << endl; \
272 if ( beforeMax != segment->base()->getTargetPosition() ) \
273 cerr << "[ERROR] " << segment \
274 << " extremity was " << DbU::getValueString(beforeMax) << endl;
276 # define _preCheck(segment) ;
277 # define _postCheck(segment) ;
287 #endif // KITE_ROUTING_EVENT_H
Atomic Placement Request for a TrackSegment.
Definition: RoutingEvent.h:55
Definition: RoutingEvent.h:96
const Key & getKey() const
Definition: RoutingEvent.h:215
RoutingEvent * clone() const
Definition: RoutingEvent.cpp:215
bool canMinimize() const
Definition: RoutingEvent.h:214
unsigned int getTracksNb() const
Definition: RoutingEvent.h:228
const Interval & getConstraints() const
Definition: RoutingEvent.h:222
void setSegment(TrackElement *)
Definition: RoutingEvent.cpp:351
bool getMode() const
Definition: RoutingEvent.h:213
bool isProcessed() const
Definition: RoutingEvent.h:206
static RoutingEvent * create(TrackElement *, unsigned int mode=Negociate)
Definition: RoutingEvent.cpp:200
static size_t getAllocateds()
Definition: RoutingEvent.cpp:150
bool isUnimplemented() const
Definition: RoutingEvent.cpp:253
bool isCloned() const
Definition: RoutingEvent.h:205
static size_t getProcesseds()
Definition: RoutingEvent.cpp:151
TrackElement * getSegment() const
Definition: RoutingEvent.h:216
bool isDisabled() const
Definition: RoutingEvent.h:207
static void resetProcesseds()
Definition: RoutingEvent.cpp:154
unsigned int getInsertState() const
Definition: RoutingEvent.h:230
unsigned int getState() const
Definition: RoutingEvent.cpp:261
Simple loop dectector for RoutingEvent.
Definition: RoutingEventLoop.h:32
static void setStage(unsigned int)
Definition: RoutingEvent.cpp:153
void process(RoutingEventQueue &, RoutingEventHistory &, RoutingEventLoop &)
Definition: RoutingEvent.cpp:359
bool isForcedToHint() const
Definition: RoutingEvent.h:208
void setAxisHintFromParent()
Definition: RoutingEvent.cpp:282
void setMode(unsigned int)
Definition: RoutingEvent.cpp:257
unsigned int getEventLevel() const
Definition: RoutingEvent.h:227
void destroy()
Definition: RoutingEvent.cpp:244
void incInsertState()
Definition: RoutingEvent.h:238
History of RoutingEvent.
Definition: RoutingEventHistory.h:35
const vector< TrackElement * > & getPerpandiculars() const
Definition: RoutingEvent.h:217
bool isRipedByLocal() const
Definition: RoutingEvent.h:209
void updateKey()
Definition: RoutingEvent.h:241
void revalidate()
Definition: RoutingEvent.cpp:600
Abstract Class for all Elements inserted inside a Track.
Definition: TrackElement.h:100
void update(const RoutingEvent *)
Definition: RoutingEvent.cpp:122
const Interval & getOptimal() const
Definition: RoutingEvent.h:223
Mode
Definition: RoutingEvent.h:96
RoutingEvent * reschedule(RoutingEventQueue &, unsigned int eventLevel)
Definition: RoutingEvent.cpp:307
void resetInsertState()
Definition: RoutingEvent.h:239
RoutingEvent cached key for maps.
Definition: RoutingEvent.h:58
The priority Queue of RoutingEvent.
Definition: RoutingEventQueue.h:35
const Interval & getPerpandicularFree() const
Definition: DataNegociate.h:131
DbU::Unit getAxisHint() const
Definition: RoutingEvent.h:220
void setEventLevel(unsigned int)
Definition: RoutingEvent.h:240
void setState(unsigned int)
Definition: RoutingEvent.cpp:268
DbU::Unit getAxisHistory() const
Definition: RoutingEvent.h:219
Algorimthmic datas associated the TrackSegment.
Definition: DataNegociate.h:50
Definition: RoutingEvent.h:96
Definition: RoutingEvent.h:96
static unsigned int getStage()
Definition: RoutingEvent.cpp:149
float getPriority() const
Definition: RoutingEvent.h:226
long getAxisWeight(DbU::Unit) const
Definition: RoutingEvent.h:221