Kite - Detailed Router

AUTHOR
Version 1.0
Mon Apr 27 2020 

Table of Contents

Table of contents

Detailed Router Documentation
This documentation adresses two level of explanations :

The API  description which explains how to use Kite, thoses parts as flagged as API . 
The internal description which details how Kite do things. It's mostly intended for myself to help me not to forget how I've done things when debug time will come... It may also be valuable to people who may want to use or patch Kite for their own purpose (my secret hope). 
Additionnal documents:
Synthetic Hierarchy (API) 

Notes

Summary

Various Things to Remeber
Pending Modifications
Modifications History
Changes in the general architecture
Changes in KiteEngine class design
Changes in DataNegociate class design
Changes in TrackElement class design
Changes in TrackSegment class design
Changes in AutoSegment class design
Changes in AutoContact class design
Bug Solving Memento
Evaluation with Cadence NanoRoute

Various Things to Remember

Determinism checking.  The trace level to get only determinism related log is 500 . Each line for the determinism is prepended with 'Deter|', possible with some leading spaces.
The router only sees/manages the aligned segment sets (through a pseudo- decorator on their canonical segment). So the non-canonical segments and the contacts should not be handled at all at this level.
Do do confuse the Session::Event, events that modificate the state of the Kite database (insert, move or remove TrackSegment in Track) and the RoutingEvent class which request that a segment must be processed.
In the various processing method of RoutingEvent, when a TrackSegment can be inserted inside a Track a Session::Event is generated but no further RoutingEvent, this end the placement processus of segment (until it is ripped-up).
AutoSegment do not invalidate their S/T anchor contacts.
AutoContact invalidate their anchored upon AutoSegment.
Now that the Hurricane database is deterministic, the router seems to be likewise.
Reduce/raise mechanism . To manage same layer  dogleg this mechanism has been implemented. When a candidate dogleg perpandicular segment length shrink below one pitch it is removed from any track to become invisible . Conversely, when a reduced segment length expand over one pitch generate a new RoutingEvent to insert it. All this is managed in the Session::revalidate() method.

Pending Modifications

In SegmentAction::doAction(), completly disable the movement of TrackSegment on it's target Track axis. This should not be needed as, if the algorithm as worked correctly, the next time it's RoutingEvent is processed, the target Track will have a free space to insert into. Then the Track insertion will set the TrackSegment axis.
Has to complete the lazy evaluation of the TrackSegment / DataNegociate / RoutingEvent. There is still some redundancy when the key of the RoutingEvent is updated.
In AutoContact::updateTopology() & AutoContact::updateGeometry() we could avoid to systematically run through the Hooks to cache the connected segments. This can be done once at the first call of either method (whichever comes first) on the first revalidate. Afterwards the cache can be updated only by AutoContact::updateTopology().
The canonization is done in two places, directly on a set of aligneds AutoSegments through AutoSegment::canonize() and for the whole net Session::_canonize(), which is called after the initial creation and each time the topology is modificated. The later may be suppressed if we uses more intelligently the former, and gain some more speedup.

Modifications History
Changes in the general architecture

Lazy Update.  Update of DataNegociate and RoutingEvent are now delayed until the event is processed, and systematically done at this point. Thus, the explicit invalidation of those objects is no longer needed. The revalidation is no longer triggered by the revalidation of TrackSegment.

Changes in KiteEngine class design

Suppress the lookup table of Hurricane::Segment toward TrackSegment. Instead uses the Observer mecanism between Katabatic::AutoSegment and TrackSegment.

Changes in DataNegociate class design

Merge in the separate class Cost .
Suppress the SlackState::Desalignate , due to the simplificated structure of the AutoSegment/AutoContacts (no more collapseds, or forced alignements).
Displace the computation and caching of the perpandiculars and perpandicular free interval from RoutingEvent into DataNegociate. Allows code factorization with the attractors computation, and data size reduction as there is exaclty one DataNegociate but there may be more than one RoutingEvent for the same TrackSegment.

Changes in TrackElement class design

Due to the simplificated structure of the Katabatic contacts (terminal, turn, vtee & htee), there's no longer collapsed AutoSegment or expandable  contacts. The desalignate  feature, relaxing constraints due to collapsed segments or contacts with more than three segments, is no longer implemented. Have to redevelop a method to break long segments linked  by HTee or VTee. 

Changes in TrackSegment class design

The method TrackSegment::_postModify()  is merged with TrackSegment::_postDoglegs() as, in the context of TrackSegment the only used topological modifications goes through the creation of one or more dogleg.

Changes in AutoSegment class design

In AutoSegment::_makeDogleg(), update the local/global status of the involved AutoSegment and re-canonize only what is necessary. Thus, guarantee that the net's topology is still valid after this method call and no topological update is needed at Session level (should be much  faster). In this method, the code sharing between AutoHorizontal and AutoVertical can still be increased (update mechanisms are identicals).
The id  support is now also implemented at Hurricane level. We may choose to use as a replacement of the one already present in AutoSegment. But in that case, we at least must cache the id in the AutoSegment. So we will not gain in memory footprint, the only benefit would be to have coherent id number throughout all the tools, but the sequentiality will be lost (this may not be a big issue).

Changes in AutoContact class design

In AutoSegment::invalidate(), no longer uses collection to walk through attached AutoSegment, directly uses the cache. Much simple and efficient as we exactly know what is attached on every kind of contact.

Bug Solving Memento
LUT lookup change:  When breaking a TrackSegment, the break may not occurs in the associated canonical AutoSegment. In that case the dogleg[O]  will not match the one that is looked up for the broken (canonical) segment. Thus it was not a bug but a misunderstanding...
Overlap of perpandiculars after a dogleg creation:  The axis of the new parallel was not set to the axis of it's parent. This was due to the uses of AutoSegment::setAxis() in AutoHorizontal::_makeDogleg() which silently do nothing on non-canonical AutoSegment, and at this point, the re-canonisation did not yet take place. Now Uses AutoSegment::_setAxis() the atomic variant wich works inconditionnaly.
Evaluation with Cadence NanoRoute
To perform a comparison with NanoRoute the procedure is as follow:

Export the design in Alliance DEF  format. It will generate both DEF  file and the supporting LEF  file containing the technology and the abstract of all the standard cell of the design. As Alliance uses symbolic units (lambda), they are translated with the simple rule: 1 lambda == 1 micron .
Run the commands in NanoRoute:
loadLefFile design.lef 
loadDefFile design.def 
generateTracks 
generateVias 
setNanoRouteMode -quiet -drouteFixAntenna 0 
setNanoRouteMode -quiet -drouteStartIteration default 
setNanoRouteMode -quiet -routeTopRoutingLayer default 
setNanoRouteMode -quiet -routeBottomRoutingLayer 2 
setNanoRouteMode -quiet -drouteEndIteration default 
setNanoRouteMode -quiet -routeWithTimingDriven false 
setNanoRouteMode -quiet -routeWithSiDriven false 
routeDesign -globalDetail 
To perform as fair a comparison as possible, those commands disable antenna effect protection and disable the use of the M1  as a routing layer (-routeBottomRoutingLayer 2 ). Those commands are issued through the graphical interface of NanoRoute.
To see the resulting layout, do not forget to switch the view mode.  

Module Index
Modules
Here is a list of all modules:
Synthetic Hierarchy (API)	pagenum
Algorithm Overview	pagenum
Generalities [external]

JSON Support [external]

DbU/Unit description [external]

Graphics [external]

Global Routing Loading [external]

Namespace Index
Namespace List
Here is a list of all documented namespaces with brief descriptions:
anonymous_namespace{AutoSegment.cpp}  	pagenum
anonymous_namespace{ChipTools.cpp}  	pagenum
anonymous_namespace{GCell.cpp}  	pagenum
anonymous_namespace{KatabaticEngine.cpp}  	pagenum
anonymous_namespace{LoadGrByNet.cpp}  	pagenum
anonymous_namespace{Manipulator.cpp}  	pagenum
anonymous_namespace{NegociateWindow.cpp}  	pagenum
anonymous_namespace{RoutingPlane.cpp}  	pagenum
anonymous_namespace{SegmentFsm.cpp}  	pagenum
anonymous_namespace{Session.cpp}  	pagenum
anonymous_namespace{Track.cpp}  	pagenum
anonymous_namespace{TrackElement.cpp}  	pagenum
Kite (The namespace dedicated to Kite ) 	pagenum

Hierarchical Index
Class Hierarchy
This inheritance list is sorted roughly, but not completely, alphabetically:
BaseObserver [external]
Observer< class > [external]
SegmentObserver	pagenum

DataNegociate	pagenum
DBo [external]
ToolEngine [external]
KatabaticEngine [external]
KiteEngine	pagenum

RoutingEvent::Key	pagenum
Manipulator	pagenum
NegociateWindow	pagenum
RoutingEvent	pagenum
RoutingEventHistory	pagenum
RoutingEventLoop	pagenum
RoutingEventQueue	pagenum
RoutingPlane	pagenum
SegmentAction	pagenum
SegmentFsm	pagenum
Session [external]
Session	pagenum

Track	pagenum
HorizontalTrack	pagenum
VerticalTrack	pagenum

TrackElement	pagenum
TrackFixedSegment	pagenum
TrackSegment	pagenum

TrackMarker	pagenum

Class Index
Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
DataNegociate (Algorimthmic datas associated the TrackSegment ) 	pagenum
HorizontalTrack (Horizontal track managment ) 	pagenum
RoutingEvent::Key (RoutingEvent cached key for maps ) 	pagenum
KiteEngine (The Kite Tool ) 	pagenum
Manipulator (Handle TrackElement ripup & topological modifications ) 	pagenum
NegociateWindow (Perform the routing, main RoutingEvent manager ) 	pagenum
RoutingEvent (Atomic Placement Request for a TrackSegment ) 	pagenum
RoutingEventHistory (History of RoutingEvent ) 	pagenum
RoutingEventLoop (Simple loop dectector for RoutingEvent ) 	pagenum
RoutingEventQueue (The priority Queue of RoutingEvent ) 	pagenum
RoutingPlane (Array of Tracks in one Layer ) 	pagenum
SegmentAction (Store request for an event to be generated on a TrackElement ) 	pagenum
SegmentFsm (Pseudo-decorator to process a RoutingEvent ) 	pagenum
SegmentObserver (Observer on the base AutoSegment ) 	pagenum
Session (Kite update Session ) 	pagenum
Track (Structure managing one routing track ) 	pagenum
TrackElement (Abstract Class for all Elements inserted inside a Track ) 	pagenum
TrackFixedSegment (Track elements for fixed wires ) 	pagenum
TrackMarker (Tag part of Track with a weight ) 	pagenum
TrackSegment (Derived Katabatic::AutoSegment for the router ) 	pagenum
VerticalTrack (Vertical track managment ) 	pagenum

Module Documentation
Synthetic Hierarchy (API)

Simplificated class hierarchy. 
Simplificated class hierarchy. 

Algorithm Overview

Description of the algorithm. 
Description of the algorithm. 
The algorithm top-level is implemented in the NegociateWindow .
First step :  NegociateWindow::_loadRouting() 
1.	Load routing wires (AutoSegment ) from KatabaticEngine  inside the Kite GCell's . Then update the GCell's  density. 
2.	Sort the GCell's  according to decreasing density (denser GCell's  are to be routed first). 
3.	Agglomerate clusters of contiguous GCell's whose density is superior to 0.7 to the seed GCell. See GCellRoutingSet  for the mechanism.
GCellRoutingSet receive an increasing order number. The higher the order the lower the density. This order is transmitted to the TrackSegment  of the GCellRoutingSet  to be taken into account by the track cost function. 
Second step :  NegociateWindow::_runOnGCellRoutingSet()  
For each GCellRoutingSet  in decreasing density, negociate the set of associated TrackSegment . 
1.	Build a RoutingEventQueue  from the list of TrackSegment . The queue is responsible for allocating the RoutingEvent  associated to each TrackSegment . 
2.	The queue is sorted according to the "event level" then to the priority, which is for now the slack of the TrackSegment . That is, constrained TrackSegment  are routed first. 
3.	The queue is processed till it's empty (no unprocessed RoutingEvent  remains).
Processing a RoutingEvent  is trying to insert a TrackSegment  in a suitable Track. We proceed as follow : 
The maximum ripup count for the to be inserted segment has been reached. Issue a severe warning and left unrouted this TrackSegment  (for now). 
Compute the Tracks in which the TrackSegment  can be inserted, then compute the insertion cost in each one. The candidates are ordered by the insertion cost. 
Now consider the lower cost Track . If there is a free interval for the TrackSegment . Issue a Session::addInsertEvent()  then finish.
If there is a "soft overlap" , that is the overlaping TrackSegment  already in the Track  could be shrunk either to the left or the right so the new TrackSegment  can be inserted. This is managed by RoutingEvent::_setAside() , for each soft overlaping TrackSegment , gets its perpandiculars and issue a displacement request for all of them. That is, re-post a RoutingEvent  with updated constraints and remove the perpandicular from it's Track if it has already been routed. Note that no request is issued for the overlaping TrackSegment  itself has it do not change of Track.
If there is a "hard overlap" , that is the two TrackSegment  cannot share the same Track , remove the previous one from the Track  and re-post a RoutingEvent . Note that, the cost object should have selected a TrackSegment  which could be ripped-up. Otherwise the Track  would'nt even be a candidate. 
When a TrackSegment is riped up, it is re-routed immediately afterward. This is done by increasing his event level. 

Namespace Documentation
anonymous_namespace{AutoSegment.cpp} Namespace Reference

anonymous_namespace{ChipTools.cpp} Namespace Reference

anonymous_namespace{GCell.cpp} Namespace Reference

anonymous_namespace{KatabaticEngine.cpp} Namespace Reference

anonymous_namespace{LoadGrByNet.cpp} Namespace Reference
Classes
class GCellTopology

anonymous_namespace{Manipulator.cpp} Namespace Reference

anonymous_namespace{NegociateWindow.cpp} Namespace Reference

anonymous_namespace{RoutingPlane.cpp} Namespace Reference

anonymous_namespace{SegmentFsm.cpp} Namespace Reference

anonymous_namespace{Session.cpp} Namespace Reference

anonymous_namespace{Track.cpp} Namespace Reference

anonymous_namespace{TrackElement.cpp} Namespace Reference

Kite Namespace Reference

The namespace dedicated to Kite. 
Classes
class DataNegociate
Algorimthmic datas associated the TrackSegment. 
class HorizontalTrack
Horizontal track managment. 
class KiteEngine
The Kite Tool. 
class Manipulator
Handle TrackElement ripup & topological modifications. 
class NegociateWindow
Perform the routing, main RoutingEvent manager. 
class RoutingEvent
Atomic Placement Request for a TrackSegment. 
class RoutingEventHistory
History of RoutingEvent. 
class RoutingEventLoop
Simple loop dectector for RoutingEvent. 
class RoutingEventQueue
The priority Queue of RoutingEvent. 
class RoutingPlane
Array of Tracks in one Layer. 
class SegmentAction
Store request for an event to be generated on a TrackElement. 
class SegmentFsm
Pseudo-decorator to process a RoutingEvent. 
class SegmentObserver
Observer on the base AutoSegment. 
class Session
Kite update Session. 
class Track
Structure managing one routing track. 
class TrackElement
Abstract Class for all Elements inserted inside a Track. 
class TrackFixedSegment
Track elements for fixed wires. 
class TrackMarker
Tag part of Track with a weight. 
class TrackSegment
Derived Katabatic::AutoSegment for the router. 
class VerticalTrack
Vertical track managment. 
Typedefs
typedef void() SegmentOverlapCostCB(const TrackElement *, TrackCost &)
Enumerations
enum FunctionFlags { , KtLoadGlobalRouting = 0x00000001, KtBuildGlobalRouting = 0x00000002, KtAllowDoglegReuse = 0x00000004, KtDataSelf = 0x00000008, KtNearest = 0x00000010, KtForce = 0x00000020, KtResetCount = 0x00000040, KtWithPerpands = 0x00000080, KtWithConstraints = 0x00000100 }

Detailed Description
The namespace dedicated to Kite. 

Typedef Documentation
SegmentOverlapCostCB
Prototype of overlap cost callback functions.
See also:   TrackSegment::setOverlapCostCB(), TrackSegment::getOverlapCost(). 

Enumeration Type Documentation
enum FunctionFlags

Enumerator:
KtLoadGlobalRouting	Reload the global routing from a preciously saved run ( .kgr file). 
	
KtBuildGlobalRouting	Run the global router Knik. 
	
KtAllowDoglegReuse	Allow sharing of dogleg. 
	
KtDataSelf	To be documented. 
	
KtNearest	Round the position to the nearest track axis. 
	
KtForce	Force to perform an action ignoring the "up to date" state. 
	
KtResetCount	Tells to reset a counter. 
	
KtWithPerpands	Ripup perpandiculars alongside the current segment. 
	
KtWithConstraints	Force constraints recomputation. 

Class Documentation
DataNegociate Class Reference

Algorimthmic datas associated the TrackSegment. 
Public Types
enum SlackState { RipupPerpandiculars = 1, Minimize = 2, Dogleg = 3, Slacken = 4, ConflictSolveByHistory = 5, ConflictSolveByPlaceds = 6, LocalVsGlobal = 7, MoveUp = 8, MaximumSlack = 9, Unimplemented =10, Repair =11 }
Public Member Functions
bool hasRoutingEvent () const
RoutingEvent * getRoutingEvent () const
TrackElement * getTrackSegment () const
Track * getTrack () const
DbU::Unit getLeftMinExtend () const
DbU::Unit getRightMinExtend () const
unsigned int getTerminals () const
Net * getNet () const
unsigned int getState () const
unsigned int getStateCount () const
unsigned int getRipupCount () const
unsigned int getStateAndRipupCount () const
DbU::Unit getWiringDelta (DbU::Unit axis) const
const Interval & getPerpandicularFree () const
void setState (unsigned int, unsigned int flags=0)
void setRoutingEvent (RoutingEvent *)
void setRipupCount (unsigned int)
void incRipupCount ()
void decRipupCount ()
void resetRipupCount ()
void resetStateCount ()
void update ()

Detailed Description
Algorimthmic datas associated the TrackSegment. 
The DataNegociate object contains all the informations the negociation algorithm needs to know about a TrackSegment. Those informations mostly describe the slackening and ripup state of that segment.
State related datas: 
The ripup count in the current state. The count is reset to zero at each state transition.
The slackening state (see DataNegociate::SlackState). The state indicate the next  topological modification to be applied on the segment should the ripup count reach it's maximal value.
The associated RoutingEvent. If no RoutingEvent is present, it means the segment has been either successufully placed or the algorithm has given up trying to. If present, it is a pending  request for placement.
Topological related datas: 
leftMinExtend , the potential minimal position of the segment left extension. May not be reachable due to other topological constraints.
rightMinExtend , the potential minimal position of the segment right extension.
terminals , the number of terminals attached to this segment.
attractors , a table of coordinates of the end points of the perpandiculars to this segment. Used to compute the wiring delta if we move the axis of the segment.
perpandiculars , a vector  of the perpandicular TrackElement. This is a fast-access cache. It must be updated each time the topology of the net is modificated.
perpandicularFree , the free interval defined by the perpandiculars, that is for the sgement axis.
Perpandiculars, Free, Attractors & Wiring Delta
All those informations are computed and updated by the DataNegociate::update() method, which relies on:
AutoSegment::getTopologicalInfos()
AutoSegment::getTerminalCount()
They must be reviewed as they do not take advantage of the new AutoSegment structuration.
For every perpandicular set of AutoSegment to the TrackSegment we want to place, get the coordinates of the extremity not connected to the segment and put that coordinate into a table associated with it's spin . The spin  tells if the extremity is attracting the segment up  or down  (for an horizontal segment). The spin  is incremented for up and decremented for down. After all the extremities have been processeds, we took into account only the coordinates with a non-zero spin, which means they truly attract the segment (whatever the direction).
 The wiring delta  is the total wire length needed to connect from the attractors to the segment, should it be placed on axis .

Modifications History
Main changes in DataNegociate class design:
Merge in the separate class Cost .
Suppress the SlackState::Desalignate , due to the simplificated structure of the AutoSegment/AutoContacts (no more collapseds, or forced alignements). 

Member Enumeration Documentation
enum SlackState
Describe the various stages of a TrackSegment slackening. The numerical values are choosen so we can increment them as a counter. 

Enumerator:
RipupPerpandiculars	Force perpandiculars to be riped up as well as the TrackSegment, then schedule the placement of the TrackSegment before  it's perpandiculars. 
	
Minimize	If the TrackSegment is made of multiple TrackSegments with a forced alignement, suppress the alignement constraint.
This should be deprecated now. Try to displace the perpandiculars so the TrackSegment is reduced to it's minimal length. 
	
Dogleg	Break the segment into two smaller ones. 
	
Slacken	Create additional wiring so threre is no more contraints transmitted by the perpandiculars or the terminal contacts. 
	
ConflictSolveByHistory	Try to solve a conflict between a set of global segments by analysing the event/ripup history. See SegmentFsm::conflictSolveByHistory(). 
	
ConflictSolveByPlaceds	Try to solve a conflict between a set of global segments by analysing the current track context. See SegmentFsm::conflictSolveByPlaceds(). 
	
LocalVsGlobal	To be reviewed. 
	
MoveUp	The segment is to be moved up (if possible). 
	
MaximumSlack	The final state, topological modifications are exhausteds, if it cannot place at this point, it never will. 
	
Unimplemented	Used only during the development stage, telling that the state is not available yet. 
	
Repair	The router is in repair mode. 

Member Function Documentation
bool hasRoutingEvent () const[inline]
Returns:  true  if there is a pending RoutingEvent for this TrackSegment. 
Referenced by NegociateWindow::addRoutingEvent(), and TrackSegment::reschedule().
RoutingEvent * getRoutingEvent () const[inline]
Returns:  The pending RoutingEvent. NULL  will be returned if there is no pending event, meaning that the segment has been placed. 
Referenced by SegmentAction::doAction(), Manipulator::makeDogleg(), Manipulator::relax(), TrackSegment::reschedule(), RoutingEvent::reschedule(), and TrackSegment::swapTrack().
TrackSegment * getTrackSegment () const[inline]
Returns:  The associated TrackSegment. 
Track * getTrack () const[inline]
Returns:  A proxy accessor for the segment's track. 
DbU::Unit getLeftMinExtend () const[inline]
Returns:  The minimum extend possible of the segment's source (left) ending. Computed by DataNegociate::update(). 
Referenced by Manipulator::insertInTrack().
DbU::Unit getRightMinExtend () const[inline]
Returns:  The minimum extend possible of the segment's target (right) ending. Computed by DataNegociate::update(). 
Referenced by Manipulator::insertInTrack().
unsigned int getTerminals () const[inline]
Returns:  The number of terminal to which this segment is connected Computed by DataNegociate::update().
Must be refined: direct or indirect?. 
Net * getNet () const[inline]
Returns:  A cached accessor to the segment's net (for faster access). 
unsigned int getState () const[inline]
Returns:  The current state (see DataNegociate::SlackState). 
Referenced by RoutingEvent::getState(), Manipulator::insertInTrack(), and Manipulator::ripupPerpandiculars().
unsigned int getStateCount () const[inline]
Returns:  The number of times we have reached the ripup limit while in this stage. 
Referenced by SegmentFsm::conflictSolveByPlaceds().
unsigned int getRipupCount () const[inline]
Returns:  The number of times the segment has been riped up in this stage. 
Referenced by Manipulator::canRipup(), SegmentAction::doAction(), and RoutingEvent::process().
unsigned int getStateAndRipupCount () const[inline]

Returns:
A composite number combining the state and the ripup count: (state<<4)+ripup . 
DbU::Unit getWiringDelta (DbU::Unit  axis) const
Returns:  The wiring length needed to connect to the attractors if the segment is put on axis . The lower, the better... 
const Interval & getPerpandicularFree () const[inline]
Returns:  The range of legal positions generated only by the perpandiculars. 
void setState (unsigned int  state, unsigned int  flags = 0)[inline]
Set or reset the slacking state (see SlackState). If the state  is the same as the current one, the state count is incremented. If the new state changes or flags  contain KtReset, the state count is reset to one. 
Referenced by SegmentAction::doAction(), Manipulator::relax(), Manipulator::repackPerpandiculars(), RoutingEvent::reschedule(), Manipulator::ripupPerpandiculars(), and RoutingEvent::setState().
void setRoutingEvent (RoutingEvent *  event)[inline]
Associate event  to this TrackSegment. 
Referenced by RoutingEvent::reschedule(), and RoutingEvent::setSegment().
void setRipupCount (unsigned int  count)[inline]
Directly sets the ripup count to count . 
Referenced by SegmentAction::doAction().
void incRipupCount ()[inline]
Increment the ripup count. No check is performed for bound limit. 
void decRipupCount ()[inline]
Decrement the ripup count (will never go below zero). 
void resetRipupCount ()[inline]
Reset the ripup count to zero. 
Referenced by SegmentAction::doAction().
void resetStateCount ()[inline]
Reset the state count to zero. 
void update ()
Recompute leftMinExtend , righMinExtend , number of terminals and attractors positions.
Remark: The constructor do not calls it. It is to the algorithm responsability
to call it before using the computed datas. 
Referenced by NegociateWindow::setGCells().

The documentation for this class was generated from the following files:
DataNegociate.h
DataNegociate.cpp
DataNegociate.dox

HorizontalTrack Class Reference

Horizontal track managment. 
Inheritance diagram for HorizontalTrack:
IMAGE

Public Member Functions
virtual bool isHorizontal () const
virtual bool isVertical () const
virtual unsigned int getDirection () const
virtual Point getPosition (DbU::Unit coordinate) const
Additional Inherited Members

Detailed Description
Horizontal track managment. 

Member Function Documentation
bool isHorizontal () const[virtual]
Returns:  true . 
Implements Track (p.pagenum).
bool isVertical () const[virtual]
Returns:  false . 
Implements Track (p.pagenum).
unsigned int getDirection () const[virtual]
Returns:  Katabatic::KbHorizontal. 
Implements Track (p.pagenum).
Point getPosition (DbU::Unit  position) const[virtual]
Returns:  the point at  (position,getAxis()). 
Implements Track (p.pagenum).

The documentation for this class was generated from the following files:
HorizontalTrack.h
HorizontalTrack.cpp
HorizontalTrack.dox

RoutingEvent::Key Class Reference

RoutingEvent cached key for maps. 
Public Member Functions
void update (const RoutingEvent *)

Detailed Description
RoutingEvent cached key for maps. 
The key is used as a cache in RoutingEvent, that is, the RoutingEvent attributes could be modificated without the key changing. It is important for the key to remain stable as it used in the various event queue as the sorting attribute. The key should be updated only when the RoutingEvent is temporarily whidrawn from the queue.
Cached attributes: (used in that lexicographical order for sorting)
1  – eventLevel .
2  – canRipple .
3  – priority .
4  – length .
5  – isHorizontal .
6  – axis .
7  – sourceU .
8  – net  (name).
9  – id .
X  – slackenStrap  unused .
X  – tracksNb  unused .
It is internally managed by RoutingEvent and the queue. 

Member Function Documentation
update (const RoutingEvent *  event)
Cache the value of the key from event . 
Referenced by RoutingEvent::updateKey().

The documentation for this class was generated from the following files:
RoutingEvent.h
RoutingEvent.cpp
RoutingEvent.dox

KiteEngine Class Reference

The Kite Tool. 
Inheritance diagram for KiteEngine:
IMAGE

Public Member Functions
KatabaticEngine * base ()
Configuration * getKiteConfiguration ()
virtual Configuration * getConfiguration ()
Net * getBlockageNet ()
bool getToolSuccess () const
unsigned long getEventsLimit () const
unsigned int getRipupLimit (unsigned int type) const
unsigned int getRipupCost () const
Static Public Member Functions
static const Name & staticGetName ()
static KiteEngine * create (Cell *)
static KiteEngine * get (const Cell *)

Detailed Description
The Kite Tool. 
Lookup Mechanism 
Please look at Kite::Session for an explanation of the lookup mechanism from Hurricane::Segment or Katabatic::AutoSegment to TrackSegment. 

Member Function Documentation
const Name & staticGetName ()[static]
Returns:  The unique string identifier for the KiteEngine class of ToolEngine. 
KiteEngine * create (Cell *  cell)[static]
Create a KiteEngine on cell . 
KiteEngine * get (const Cell *  cell)[static]
Returns:  The KiteEngine associated to cell . NULL  if there isn't. 
KatabaticEngine * base ()[inline]
Returns:  The KiteEngine, casted as it's base class (KatabaticEngine). 
Configuration * getKiteConfiguration ()[inline]
Returns:  The KiteEngine configuration. The Kite Configuration is a derived class of KatabaticConfiguration. 
Configuration * getConfiguration ()[virtual]
Returns:  The KiteEngine configuration. 
Reimplemented from KatabaticEngine.
Net * getBlockageNet ()[inline]
Returns:  The Net which is used to mark the blockage segments. It's not part of the Configuration per se  but an isolated attribute. 
bool getToolSuccess () const[inline]
Returns:  true  if the tool was successful, that is, all the Net were routeds. 
unsigned long getEventsLimit () const[inline]
Returns:  The maximal number of allowed routing events. This limit is a security against infinite looping, be sure that it is great enough not to prevent normal routing completion. 
unsigned long getRipupLimit (unsigned int  type) const[inline]
Returns:  the maximum ripup allowed of a segment of type . 
Referenced by Manipulator::canRipup(), and SegmentAction::doAction().
unsigned long getRipupCost () const[inline]
Returns:  the differential used while comparing two ripup costs. 

The documentation for this class was generated from the following files:
KiteEngine.h
KiteEngine.dox

Manipulator Class Reference

Handle TrackElement ripup & topological modifications. 
Public Types
enum FunctionFlag { ToRipupLimit = 0x0001, AllowExpand = 0x0002, NoExpand = 0x0004, PerpandicularsFirst = 0x0008, ToMoveUp = 0x0010, AllowLocalMoveUp = 0x0020, AllowTerminalMoveUp = 0x0040, AllowShortPivotUp = 0x0080, NoDoglegReuse = 0x0100, LeftAxisHint = 0x0200, RightAxisHint = 0x0400, NotOnLastRipup = 0x0800 }
Public Member Functions
Manipulator (TrackElement *, SegmentFsm &)
TrackElement * getSegment () const
DataNegociate * getData () const
RoutingEvent * getEvent () const
bool canRipup (unsigned int flags=0) const
bool isCaged (DbU::Unit) const
bool ripup (unsigned int type, DbU::Unit axisHint=0)
bool ripupPerpandiculars (unsigned int flags=0)
void repackPerpandiculars ()
bool ripple ()
bool minimize ()
bool slacken (unsigned int flags=KbNoFlags)
bool pivotUp ()
bool pivotDown ()
bool moveUp (unsigned int flags=0)
bool makeDogleg ()
bool makeDogleg (DbU::Unit)
bool makeDogleg (Interval)
bool relax (Interval, unsigned int flags=AllowExpand)
bool insertInTrack (size_t)
bool shrinkToTrack (size_t, unsigned int flags=0, DbU::Unit leftAxisHint=0, DbU::Unit rightAxisHint=0)
bool forceToTrack (size_t)
bool forceOverLocals ()

Detailed Description
Handle TrackElement ripup & topological modifications. 

Manipulator Structure
A Manipulator basically binds together a TrackElement, it's DataNegociate and RoutingEvent (cached for fast access), and a  SegmentFsm.
The TrackElement may differs from the one of the SegmentFsm.  This can occurs when manipulating perpandiculars or segments from other nets in conflict. For example: Manipulator::isCaged().
In the following documentation, the segment which is associated to the SegmentFsm  will be called the reference segment .
Delayed Modifications
It is important to note that when a Manipulator is called to modificate a TrackElement, nothing is actually done by the Manipulator itself. Instead, the Manipulator create the relevant SegmentAction (s) that are stored in the SegmentFsm. The action themselves are done at the end of the SegmentFsm lifecycle (wrapped inside a Session).
This is not true! When dogleg are created, the topology is immediatly modificated. That way of doing must be clarified. 

Member Enumeration Documentation
enum FunctionFlag
The various flags that can be passed to the Manipulator methods. 

Enumerator:
ToRipupLimit	The ripup limit must be immediatly to it's limit for the current state. 
	
AllowExpand	Allow break points for dogleg not to be exactly on the requested position. Meaning that they are moved to the least congested GCell. 
	
NoExpand	Breakpoints for dogleg are kept right where they are requested. 
	
PerpandicularsFirst	Reorder the events so that perpandiculars segments are re-processed before their reference segment. By default this is the other way around. 
	
ToMoveUp	Try to move up ripped up segments. 
	
AllowLocalMoveUp	Allow local segments to be moved up (forbidden by default). 
	
AllowTerminalMoveUp	Allow terminal segments to be moved up (forbidden by default). 
	
AllowShortPivotUp	Allow short segment yo be pivoted up. 
	
NoDoglegReuse	When creating a dogleg, the default behavior is not  to create a new one if there's already one in the same GCell. If this flag is set, a second dogleg will be created. 
	
LeftAxisHint	An explicit left axis hint has been supplied as argument. 
	
RightAxisHint	An explicit right axis hint has been supplied as argument. 
	
NotOnLastRipup	The reference segment has still more than one ripup to go for the given state. 

Constructor & Destructor Documentation
Manipulator (TrackElement *  segment, SegmentFsm &  fsm)

Parameters:
segment 	The TrackElement to manipulate. 	
fsm 	The associated SegmentFsm.	
Construct a new Manipulator on segment . 
Referenced by Manipulator::forceOverLocals(), Manipulator::forceToTrack(), Manipulator::insertInTrack(), Manipulator::ripupPerpandiculars(), and Manipulator::shrinkToTrack().

Member Function Documentation
TrackElement * getSegment () const[inline]
Returns:  The working TrackElement. 
DataNegociate * getData () const[inline]
Returns:  The DataNegociate of the TrackElement (act as a cache). 
RoutingEvent * getEvent () const[inline]
Returns:  The RoutingEvent associated to the TrackElement (act as a cache). 
bool canRipup (unsigned int  flags = 0) const
Returns:  true  if the maximum ripup, for the given SegmentFsm::State has not been reached. If flags  contains Manipulator::HasNextRipup, return true  only  if it still have at least one ripup to go. 
Referenced by Manipulator::forceToTrack(), and Manipulator::ripup().
bool isCaged (DbU::Unit  axis) const
Returns:  true  if the segment is enclosed (in it's Track) by two fixed or blockage segments which at least one is closer than 10 lambdas from axis . Mostly used to know if a perpandicular is actually restricting the axis span of a reference segment. 
Referenced by Manipulator::ripupPerpandiculars().
bool ripup (unsigned int  type, DbU::Unit  axisHint = 0)

Parameters:
type 	The type of ripup action. 	
axisHint 	An indication as where to move the riped up segment. 	
Returns:
true  if the operation has succedeed.
If the TrackElement can be ripped up, schedule a ripup action, possibly with a hint for the preferred axis position. 
Referenced by Manipulator::forceOverLocals(), Manipulator::forceToTrack(), Manipulator::insertInTrack(), and Manipulator::ripupPerpandiculars().
bool ripupPerpandiculars (unsigned int  flags = 0)
Schedule a ripup of all the perpandiculars of the reference segment. flags  that modificate the behavior:
Manipulator::PerpandicularsFirst : the queue will be reordered so that all the perpandiculars are re-processed (placed) before the reference segment.
Manipulator::ToRipupLimit : the ripup count of the reference segment is set to the limit (i.e. only one more attempt before a slackening occurs).
The method will fails (return false ) if at least one perpandicular can't be changed of track (i.e. ripped up) and  none of it's neighbors could be ripped up either. Meaning that the free span on that track cannot be changed. 
Referenced by SegmentFsm::conflictSolveByPlaceds().
bool repackPerpandiculars ()
Ripup all the perpandiculars of the reference segment, except fixed or globals. The reference segment is rescheduled first (before it's perpandicular).
This function may be used to find a better placement, maximizing the overlap of the various perpandiculars.
Ripup all perpandiculars and the reference segment itself for a complete re-placement. The reference segment will be reprocessed before  it's perpandiculars. 
bool ripple ()
Returns:  true if the reference segment is local.
Applies only on reference segments that are of local type. Tries to make room for the reference segment by ripping up it's neigbors on the parallels tracks. On a vertical plane, left neigbors are shifted one track left (trough axis hint) and right ones, one track right. Note that they are ripped up and the shift is just a hint, there's no guarantee that the router can honor it. 
Referenced by Manipulator::ripupPerpandiculars().
bool minimize ()
Returns:  true if the reference segment can be mimized in a suitable track hole.
Compute the miminal span of the reference segment, summing up contraints from source anchor and target anchors (if any) and perpandiculars. Then find holes in the avalaible tracks, and check if one is suitable for the miminized segment (try first the biggest hole).
This operation can only be called once on a segment (a flag is set in the event). 
bool slacken (unsigned int  flags = KbNoFlags)
Simple proxy towards TrackElement::slacken().
To be reviewed. 
bool pivotUp ()
Tries to move up the reference segment. The segment will be moved up only if a half track is free (for a local) or a full track is free (for a global).
This function do not modifies/create perpandiculars. 
Referenced by SegmentFsm::solveFullBlockages().
bool pivotDown ()
Tries to move down the reference segment. The segment will be moved up only if two  track are free (whether global or local). Is is more restrictive than Manipulator::pivotUp().
This function do not modifies/create perpandiculars. 
bool moveUp (unsigned int  flags = 0)
Tries to move up a segment, if there is enough space in the RoutingPlane above and in the same direction.
This function may modificate perpandiculars in order to maintain connexity.
To be reviewed. 
Referenced by SegmentFsm::solveFullBlockages().
bool makeDogleg ()
Returns:  false  if the segment is not  local or the dogleg cannot be done.
For local  reference segment only, look in the first track candidate for other segment overlapping and break the reference accordingly. 
bool makeDogleg (DbU::Unit  position)
Create a dogleg in the GCell under position . 
bool makeDogleg (Interval  overlap)
Create a dogleg to avoid the obstructed interval overlap . 
bool relax (Interval  overlap, unsigned int  flags = AllowExpand)
Break the reference segment so it can detour around the interval overlap . If overlap  is completly enclosed inside the span of the reference segment two dogleg will be created. If the overlap occurs only on one side of the reference segment, only one dogleg will be created.
If flags  contains Manipulator::AllowExpand, the dogleg are not created exactly at the edges of the overlap but on the lowest density GCell (outside the overlap interval).
The axis of the created dogleg are sets so that the broken part of the segment completly enclose overlap . That is, the orignal segment no longer intersect with overlap . So the min dogleg is pushed to the left and the max to the right if they are in the same GCell as the min/max of overlap . Otherwise (they have been expanded), they are put in the center of the GCell.
We do not allow to dogleg twice in the same GCell, so if min or max is in respectively the first or last GCell, it is not done. Moreover if there is only one dogleg and  it is in the first or last GCell, the relax method is cancelled (and returns false ). It means that this is the segment which is likely to be enclosed inside overlap .
Important:  The doglegs are created immediatly and not in a delayed fashion like the SegmentAction.
    
bool insertInTrack (size_t  i)
Try to insert the reference segment in the track at index i  (in the cost table from SegmentFsm). The insertion is done by ripping up overlapping segment or shrinking them to left/right if possible.
This operation ripup the processed segment neighbors (and their perpandiculars). 
bool shrinkToTrack (size_t  i, unsigned int  flags = 0, DbU::Unit  leftAxisHint = 0, DbU::Unit  rightAxisHint = 0)
Attempt to minimize the reference segment to fit into the track. For this operation to succeed, the minimal span of the segment must not overlap any other segment already in the track. To reach the minimal span the perpandiculars are ripped up with an axis hint which is the center of the minimal span or the explicit value given as arguments leftAxisHint  and rightAxisHint  if flags  contains respectively Manipulator::LeftAxisHint or Manipulator::RightAxisHint.
This operation ripup the processed segment itself and its perpandiculars. 
bool forceToTrack (size_t  i)
Try to insert the reference segment in the track at index i  (in the cost table from SegmentFsm). The insertion is done by forcibly  ripping up the overlapping segments and  their perpandiculars.
This operation ripup the processed segment neighbors (and their perpandiculars). 
bool forceOverLocals ()
Loop over all the candidate tracks and, insert in the first which all conflicting segments are locals (rip them up). 

The documentation for this class was generated from the following files:
Manipulator.h
Manipulator.cpp
Manipulator.dox

NegociateWindow Class Reference

Perform the routing, main RoutingEvent manager. 
Public Types
enum Stage { Negociation = 1, Packing = 2 }
Public Member Functions
void destroy ()
bool isInterrupted () const
KiteEngine * getKiteEngine () const
Hurricane::Cell * getCell () const
const Katabatic::GCellVector & getGCells () const
RoutingEventQueue & getEventQueue ()
RoutingEventHistory & getEventHistory ()
RoutingEventLoop & getEventLoop ()
Stage getStage () const
void setGCells (const Katabatic::GCellVector &)
void setInterrupt (bool)
void setStage (Stage)
double computeWirelength ()
TrackElement * createTrackSegment (AutoSegment *, unsigned int flags)
void addRoutingEvent (TrackElement *, unsigned int level)
void rescheduleEvent (RoutingEvent *, unsigned int level)
void run (unsigned int flags)
void printStatistics () const
Static Public Member Functions
static NegociateWindow * create (KiteEngine *)

Detailed Description
Perform the routing, main RoutingEvent manager. 
This object perform the routing. That is creates all the initial RoutingEvent, load them into the queue and then process the queue until it is empty, that is, the routing is finished.
This object is the owner of the RoutingEventQueue, RoutingEventHistory and RoutingEventLoop used all troughout RoutingEvent and SegmentFsm. 

Member Enumeration Documentation
enum Stage
The state under which the router is operating. 

Enumerator:
Negociation	The normal mode, priority negociation with ripup. 
	
Packing	Try to find a better placement for segment but just by looking for other fully free spaces. No ripup is performed. 

Member Function Documentation
create (KiteEngine *  kite)[static]
The publicly avalaible contructor. Route the whole are defined by the Kite associated Cell abutment box. 
void destroy ()
The publicly avalaible destructor. 
bool isInterrupted () const[inline]
Returns:  true  if the NegociateWindow has received an interrupt request. 
KiteEngine * getKiteEngine () const[inline]
Returns:  The associated KiteEngine. 
Referenced by NegociateWindow::printStatistics().
Hurricane::Cell * getCell () const
Returns:  The associated Cell. 
const Katabatic::GCellVector & getGCells () const[inline]
Returns:  A Copy of the vector of GCell from KatabaticEngine. The vector is copied but not the GCell themselves (shallow copy). 
RoutingEventQueue & getEventQueue ()[inline]
Returns:  The RoutingEventQueue. 
RoutingEventHistory & getEventHistory ()[inline]
Returns:  The RoutingEventHistory. 
RoutingEventLoop & getEventLoop ()[inline]
Returns:  The RoutingEventLoop. 
Stage getStage () const[inline]
Returns:  The stage (NegicateWindow::Stage) into which the NegociateWindow is running. 
void setGCells (const Katabatic::GCellVector &  v)
Sets the GCell vector from KatabaticEngine (perform a shallow copy). 
void setInterrupt (bool  state)[inline]
Sets or unset the interruption flag. 
void setStage (Stage  stage)[inline]
Set the stage (NegociateWindow::Stage) under which we are running. 
double computeWirelength ()
Compute the total wirelength of the circuit. It is not completly accurate because overlaps are not took into accounts. 
Referenced by NegociateWindow::run().
TrackElement * createTrackSegment (AutoSegment *  autoSegment, unsigned int  flags)
Build a TrackSegment from the Katabatic::AutoSegment. If flags  contains Kite::KtLoadingStage then assume that we are in the initial loading stage (constructor). 
void addRoutingEvent (TrackElement *  segment, unsigned int  level)
Create a new RoutingEvent from TrackElement (if it doesn't already exists) and insert it into the queue with priority level . 
Referenced by TrackSegment::reschedule().
void rescheduleEvent (RoutingEvent *  event, unsigned int  level)[inline]
Reschedule an event into the queue, with priority level . 
Referenced by TrackSegment::reschedule().
void run (unsigned int  flags)
Perform the routing.
slowMotion  is not implemented yet. 
void printStatistics () const
Display some statistics about the routing, compute the internal complete statistics. 
Referenced by NegociateWindow::run().

The documentation for this class was generated from the following files:
NegociateWindow.h
NegociateWindow.cpp
NegociateWindow.dox

RoutingEvent Class Reference

Atomic Placement Request for a TrackSegment. 
Classes
class Key
RoutingEvent cached key for maps. 
Public Types
enum Mode { Negociate =1, Pack =2, Repair =3 }
Public Member Functions
RoutingEvent * clone () const
void destroy ()
bool isCloned () const
bool isValid () const
bool isUnimplemented () const
bool isProcessed () const
bool isDisabled () const
bool isForcedToHint () const
bool isRipedByLocal () const
bool getMode () const
bool canMinimize () const
unsigned int getState () const
const Key & getKey () const
TrackElement * getSegment () const
const vector< TrackElement * > & getPerpandiculars () const
DbU::Unit getAxisHint () const
DbU::Unit getAxisHistory () const
long getAxisWeight (DbU::Unit) const
const Interval & getConstraints () const
const Interval & getOptimal () const
float getPriority () const
unsigned int getTracksNb () const
unsigned int getInsertState () const
unsigned int getEventLevel () const
void revalidate ()
void updateKey ()
void process (RoutingEventQueue &, RoutingEventHistory &, RoutingEventLoop &)
void setSegment (TrackElement *)
RoutingEvent * reschedule (RoutingEventQueue &, unsigned int eventLevel)
void setMode (unsigned int)
void setState (unsigned int)
void setAxisHintFromParent ()
void incInsertState ()
void resetInsertState ()
void setEventLevel (unsigned int)
Static Public Member Functions
static unsigned int getStage ()
static size_t getAllocateds ()
static size_t getProcesseds ()
static void resetProcesseds ()
static void setStage (unsigned int)
static RoutingEvent * create (TrackElement *, unsigned int mode=Negociate)

Detailed Description
Atomic Placement Request for a TrackSegment. 
The trackFrees attribute has to be reviewed not sure it's still useful.
Cached key for stable sorting, see RoutingEvent::Key. 

Member Enumeration Documentation
enum Mode
The working mode of the router, affect how events are to be handled. 

Enumerator:
Negociate	This is the normal mode of operation, topological modifications and ripup are enableds. 
	
Pack	First post-processing step. For each segment, tries to find a more compact position for a segment, but without riping any others. 
	
Repair	Second post-processing step, try to find a suitable location for a segment more aggressively. 

Member Function Documentation
unsigned int getStage ()[static]
Returns:  The stage the router is in (see RoutingEvent::Mode). 
Referenced by SegmentAction::doAction(), Manipulator::repackPerpandiculars(), RoutingEvent::reschedule(), RoutingEvent::revalidate(), SegmentFsm::SegmentFsm(), and RoutingEvent::setAxisHintFromParent().
size_t getAllocateds ()[static]
Returns:  The number of RoutingEvent currently allocateds. 
size_t getProcesseds ()[static]
Returns:  The number of RoutingEvent that have been processeds since the last call to RoutingEvent::resetProcesseds(). 
Referenced by NegociateWindow::printStatistics(), RoutingEvent::process(), and RoutingEventLoop::update().
void resetProcesseds ()[static]
Returns:  Reset the number of processeds events. 
Referenced by NegociateWindow::run().
unsigned int setStage (unsigned int  mode)[static]
Sets the router's stage (see RoutingEvent::Mode). 
RoutingEvent * create (TrackElement *  element, unsigned int  mode = Negociate)[static]

Parameters:
element 	The element for which to create the event. 	
mode 	The mode into which this event will be valid.	
RoutingEvent constructor. 
Referenced by RoutingEventQueue::add(), and RoutingEventQueue::load().
RoutingEvent * clone () const

Returns:
A clone of the event.
Cloning an event is slightly different from copying it (which is forbidden). There can be multiple events for one element  but only one must be active at a time. This is a cheap way of implementing the rescheduling mechanism. The original event remains the active one, but it's cloned flag is raised. The cloned event is created inactive and with a null eventLevel . 
Referenced by RoutingEvent::reschedule().
void destroy ()
The destructor. 
bool isCloned () const[inline]
Returns:  true  if this event has been cloned at least once. 
bool isValid () const[inline]
Returns:  true  if the cached informations from the element  are valid (i.e. the element has not been changed). 
bool isUnimplemented () const
Returns:  true  if the event has tried to use an unimplemented feature. 
Referenced by Manipulator::canRipup(), and RoutingEvent::reschedule().
bool isProcessed () const[inline]
Returns:  true  if the event has been processed. 
Referenced by RoutingEvent::process(), and RoutingEvent::reschedule().
bool isDisabled () const[inline]
Returns:  true  if the event is not  the active one. It should be discarted by the algorithm. 
Referenced by RoutingEvent::process().
bool isForcedToHint () const[inline]
Returns:  true  the element  must be placed exacltly on the given axis hint. 
bool isRipedByLocal () const[inline]
Returns:  true  the element  (global) has been riped up to place a local one. 
unsigned int getMode () const[inline]
Returns:  the mode the event must be taken into account to. 
bool canMinimize () const[inline]
Returns:  true  the element  could still be minimized. 
Referenced by Manipulator::minimize().
unsigned int getState () const
Returns:  the mode the router is currently in. 
Referenced by RoutingEvent::isUnimplemented().
const Key & getKey () const[inline]
Returns:  The key  to use in map & queue for this event. 
TrackElement * getSegment () const[inline]
Returns:  The associated segment. 
Referenced by SegmentFsm::conflictSolveByHistory(), SegmentFsm::conflictSolveByPlaceds(), SegmentFsm::desaturate(), SegmentFsm::doActions(), SegmentFsm::insertInTrack(), Manipulator::ripupPerpandiculars(), SegmentFsm::SegmentFsm(), SegmentFsm::slackenTopology(), and SegmentFsm::solveFullBlockages().
const vector< TrackElement * > & getPerpandiculars () const[inline]
Returns:  A vector of cached perpandiculars to the associated segment. 
Referenced by Manipulator::minimize(), Manipulator::repackPerpandiculars(), and Manipulator::ripupPerpandiculars().
DbU::Unit getAxisHint () const[inline]
Returns:  The preferred position for the segment axis. 
Referenced by RoutingEvent::getAxisWeight(), RoutingEvent::revalidate(), Manipulator::ripple(), and SegmentFsm::SegmentFsm().
DbU::Unit getAxisHistory () const[inline]
Returns:  The previous position of the segment axis (before it's current position). 
DbU::Unit getAxisWeight (DbU::Unit  axis) const[inline]
Returns:  The distance between axis  and the preferred position. 
Referenced by SegmentFsm::SegmentFsm().
const Interval & getConstraints () const[inline]
Returns:  The range of legal positions for the axis. 
Referenced by Manipulator::minimize(), Manipulator::ripupPerpandiculars(), and SegmentFsm::SegmentFsm().
const Interval & getOptimal () const[inline]
Returns:  The range of positions for the optimal axis (cached). 
Referenced by SegmentFsm::SegmentFsm().
unsigned int getPriority () const[inline]
Returns:  The priority of the event, it quantify the degree of freedom of the segment. Currently it's computed from the length of the segment and it's slack:  priority = (slack(segment)+1.0) (length(segment)+1.0)  A high priority means that the segment will be harder to place thus it will be scheduled first. With this function, longer segments will be placed first. 
Referenced by RoutingEvent::process().
unsigned int getTracksNb () const[inline]
Returns:  The number of tracks avalaibles for the segment to be placed. 
Referenced by SegmentFsm::SegmentFsm().
unsigned int getInsertState () const[inline]

Returns:
The kind of track insertion that will be intended. It's a counter whose values have the following meaning:
1  : normal insert.
2  : shrink the segment to it's minimum before inserting.
3  : attempt to ripup conflicting others before inserting. 
Referenced by SegmentFsm::insertInTrack().
unsigned int getEventLevel () const[inline]
Returns:  The event level of the event, used to tweak the order inside the event queue. It differs from the priority in the sense that it isn't a topologicaly based value, but manipulated by the algorithm. 
Referenced by RoutingEvent::process().
void revalidate ()
Perform an event revalidation. 
Referenced by SegmentFsm::SegmentFsm(), and RoutingEvent::updateKey().
void updateKey ()[inline]
Update the key with the new values from the event, the key must  not be inserted in the queue when this method is called. 
void process (RoutingEventQueue &  queue, RoutingEventHistory &  history, RoutingEventLoop &  loop)

Parameters:
queue 	The main event queue. 	
history 	The event's history list. 	
loop 	The loop detector.	
Process the event, that is:
First, check if there is no looping, if any, do not process the event but dicard it (marked as unimplemented).
Second, attempt to place the associated segment. Pass it to the relevant function, according to the router's mode (_processNegociate() , processPack()  or _processRepair()  ). Once processed, the event is added to both history  (for the record) and loop  to check if we are not looping. 
void setSegment (TrackElement *  element)
Change the associated segment . Used only by TrackSegment::swapTrack(). 
Referenced by TrackSegment::swapTrack().
RoutingEvent * reschedule (RoutingEventQueue &  queue, unsigned int  eventLevel)

Returns:
The newly reinserted event. Depending on the cases it could be itself.
Insert or reinsert an event in the scheduler. The eventLevel  parameter only allows to increase the level (if it is less than the current level of the event, it will be ignored).
Cloning Management.  As an event could be cloned, if we try to re-insert a disabled original, we must first lookup the currently cloned active event. This is done through the associated segment  which must always be associated with the active event (if any).
Unimplemented Protection.  If the unimplemented flag is set the reschedule is cancelled (NULL  is returned).
Unprocessed Event.  The event is still in queue, waiting to be processed, then just repush it in the queue with it's new level.
Processed Event.  Clone the already processed one, activate it and push it on the queue.
Router's Mode.  The mode is also updated. 
Referenced by SegmentAction::doAction(), and RoutingEvent::reschedule().
void setMode (unsigned int  mode)
Set the mode in which the event must be processed (see RoutingEvent::Mode). 
Referenced by SegmentAction::doAction(), and RoutingEvent::reschedule().
void setState (unsigned int  state)
Proxy mutator for DataNegociate::setState(). 
Referenced by RoutingEvent::process().
void setAxisHintFromParent ()
Sets the axis hint from it's parent segment. The parentage is found through the TrackSegment parentage. 
Referenced by RoutingEvent::revalidate().
void incInsertState ()[inline]
Increment the insertion state.
See also:   RoutingEvent::getInsertState(). 
Referenced by SegmentFsm::insertInTrack().
void resetInsertState ()[inline]
Reset the insertion state.
See also:   RoutingEvent::getInsertState(). 
Referenced by SegmentFsm::slackenTopology().
void setEventLevel (unsigned int  level)[inline]
Set the event level (user-controlled re-ordering). 

The documentation for this class was generated from the following files:
RoutingEvent.h
RoutingEvent.cpp
RoutingEvent.dox

RoutingEventHistory Class Reference

History of RoutingEvent. 
Public Member Functions
RoutingEventHistory ()
~RoutingEventHistory ()
bool empty () const
size_t size () const
RoutingEvent * getNth (size_t) const
RoutingEvent * getRNth (size_t) const
void push (RoutingEvent *)
void clear ()

Detailed Description
History of RoutingEvent. 
An history of all the routing events. We can afford to keep an history because while one event is a relatively big object, there is not that much of them (their number is roughly proportional to the number of TrackSegments).
One event is likely to appear more than one time in the history, in fact it will apprears each time it is ripped up.
Lastly, it is a way to keep track of all the allocated RoutingEvents. When history is deleted it will deleted all the events that it knows of. 

Constructor & Destructor Documentation
RoutingEventHistory ()
Construct an empty RoutingEventHistory. 
~RoutingEventHistory ()
Delete a RoutingEventHistory.
Remark: The deletion of this object triggers the deletion of
all the RoutingEvent that are referenced in it. 

Member Function Documentation
bool empty () const[inline]
Returns:  true  if the history is empty. 
size_t size () const[inline]
Returns:  the number of events in the history. 
Referenced by RoutingEventHistory::getNth(), and RoutingEventHistory::getRNth().
RoutingEvent * getNth (size_t  pos) const
Returns:  The event at index pos  from the beginning of the history (NULL  if pos  exeed the size). 
RoutingEvent * getRNth (size_t  pos) const
Returns:  The event at index pos  from the end of the history (NULL  if pos  exeed the size). 
Referenced by SegmentFsm::conflictSolveByHistory().
void push (RoutingEvent *  event)
Push a new RoutingEvent in the history. 
Referenced by RoutingEvent::process().
void clear ()
Clear the history, also remove the RoutingEvent that are pointed to. 
Referenced by RoutingEventHistory::~RoutingEventHistory().

The documentation for this class was generated from the following files:
RoutingEventHistory.h
RoutingEventHistory.cpp
RoutingEventHistory.dox

RoutingEventLoop Class Reference

Simple loop dectector for RoutingEvent. 
Public Member Functions
RoutingEventLoop (size_t depth=10, int limit=20)
bool isLooping () const
int getMaxCount () const
const std::vector< Element > & getElements () const
void update (size_t id)
void erase (size_t id)

Detailed Description
Simple loop dectector for RoutingEvent. 
The RoutingEventLoop can be roughly understood as a truncated histogram of the depth  last (in the time meaning) greatest riped up elements.
The loop detector keep track of the depth  TrackElement with the greatest processing count. TrackElement are just identified through the id  of their associated AutoSegment. Each entry in the loop table contains:
The id  of the associated TrackSegment (Katabatic::AutoSegment).
The count  of times it has been processed
The timestamp  of the latest time it has been updated.
The table (implemented as vector<> ) it kept sorted on the timestamp (decreasing). Whenever there is more than depth  elements in the table, the oldest one are discarted (regardless of their count). Obviously, there are pathological cases into which a loop cannot be detected, but so far it has not happened so a more robust approach seems not necessary at this time.
Whenever the count of an element reaches countLimit , the looping flag is set. It will remains set unless the faulty element is manually removed. 

Constructor & Destructor Documentation
RoutingEventLoop (size_t  depth = 10, int  countLimit = 20)
Construct a loop detector that handle depth  differents segments and has a looping threshold of countLimit . 

Member Function Documentation
bool isLooping () const[inline]
Returns:  true  if the loop threshold has been reached for at least one element. 
Referenced by RoutingEvent::process().
int getMaxCount () const[inline]
The maximal count an element as reached so far. 
Referenced by RoutingEvent::process().
const std::vector< Element > & getElements () const[inline]
The complete table elements. 
Referenced by RoutingEvent::process().
void update (size_t  id)
Update the loop, telling that element id  has appreared one more time. 
Referenced by RoutingEvent::process().
void erase (size_t  id)
Remove the entry related to element id  in the table. The state of the table is fully recomputed after the removal (looping flag & maximum count).
This method is used when a loop has been encountered, presumably on element id , and we want to continue. To avoid the loop detector yelling at each check, the associated TrackElement should be invalidated and it's reference removed from the table. 
Referenced by RoutingEvent::process().

The documentation for this class was generated from the following files:
RoutingEventLoop.h
RoutingEventLoop.cpp
RoutingEventLoop.dox

RoutingEventQueue Class Reference

The priority Queue of RoutingEvent. 
Public Member Functions
RoutingEventQueue ()
~RoutingEventQueue ()
bool empty () const
size_t size () const
unsigned int getTopEventLevel () const
RoutingEvent * pop ()
void load (const vector< TrackElement *> &)
void add (TrackElement *, unsigned int level)
void push (RoutingEvent *)
void repush (RoutingEvent *)
void repushInvalidateds ()
void commit ()
void clear ()

Detailed Description
The priority Queue of RoutingEvent. 

Implementation Details
The RoutingEventQueue is build upon a STL multiset<> and is sorted according to the RoutingEvent::Key attribute of the event. The key attribute has been designed specifically to be used with this queue. It provides the features:
Sort the RoutingEvent according to their priority. Higher priority mainly means more constrained segment, which must be routed first.
The attributes of RoutingEvent may change while inserted in the queue. The key provide a cached value of those attributes ensuring a stable sorting order.
For more details about the sorting order, refer to RoutingEvent::Key.
Insertion, Reinsertion & Commit 
When pushing a new event into the queue, the actual insertion into the multimap is delayed until the next call to RoutingEvent::commit() . The to be inserted events are stored into a request set which is processed when commit is called. At commit time, the RoutingEvent::Key cache is updated just before inserting the element.
When repushing an event, the event is immediatly withdrawn from the queue and put into the request set.
Mutiple Event for one Segment 
As RoutingEvent can be cloned, there may be more than one event pointing to a segment. But there must be only one active event , the one which is pointed to by the segment. As a result, there maybe multiple events for an unique segment in the queue, but only one active event , the one that will be processed. 

Constructor & Destructor Documentation
RoutingEventQueue ()
Contructor, create an empty queue. 
~RoutingEventQueue ()
Destructor.
Remark: The destruction of the queue do not delete the
RoutingEvent that may still be in it (they shouldn't an a warning is issued). 

Member Function Documentation
bool empty () const[inline]
Returns:  true  if there is the queue is empty. 
size_t size () const[inline]
Returns:  The number of events in the queue. 
unsigned int getTopEventLevel () const[inline]
Returns:  The greatest event level the queue has ever reached (always increasing, starting from zero). 
RoutingEvent * pop ()
Remove the top element of the queue (i.e. the one with the highest priority) and return it. If the queue is empty, NULL  is returned. 
void load (const vector< TrackElement *> &  segments)
Load a whole vector of TrackElement into the queue, for each element:
Create a RoutingEvent linked to the element. To be reviewed: replace any previous event.
Insert the new RoutingEvent into the queue.
No commit is needed after this operation.  
void add (TrackElement *  element, unsigned int  level)
Create a new RoutingEvent in the queue with level , associated to element . A commit is needed afterwards.
To be reviewed: replace any previous event on element. 
Referenced by NegociateWindow::addRoutingEvent().
void push (RoutingEvent *  event)[inline]
Push a RoutingEvent in the queue. Effective only after the next commit. 
Referenced by RoutingEventQueue::add(), and RoutingEventQueue::repush().
void repush (RoutingEvent *  event)
Force a complete queue re-insertion for event . The event is immediatly withdrawn from the queue and put into the insertion request set.
If the event  is not already in the queue, works like RoutingEventQueue::push(). 
Referenced by RoutingEventQueue::repushInvalidateds(), and RoutingEvent::reschedule().
void repushInvalidateds ()
Using the list of invalidated segments from the Session, repush them if:
They have an associated event.
The event is not unimplemented , disabled  or processed . 
Referenced by RoutingEvent::process().
void commit ()
Process the insertion request set and actually insert it's elements into the queue. Perform a RoutingEvent::key update prior to insertion. 
Referenced by RoutingEvent::process().
void clear ()
Empty the queue. Issue a warning if the queue is not empty (i.e. some events remains to be processeds). 
Referenced by RoutingEventQueue::~RoutingEventQueue().

The documentation for this class was generated from the following files:
RoutingEventQueue.h
RoutingEventQueue.cpp
RoutingEventQueue.dox

RoutingPlane Class Reference

Array of Tracks in one Layer. 
Public Member Functions
bool isHorizontal () const
bool isVertical () const
KiteEngine * getKiteEngine () const
RoutingLayerGauge * getLayerGauge () const
unsigned int getDirection () const
size_t getDepth () const
DbU::Unit getAxisMin () const
DbU::Unit getAxisMax () const
DbU::Unit getTrackMin () const
DbU::Unit getTrackMax () const
RoutingPlane * getTop () const
RoutingPlane * getBottom () const
const Layer * getLayer () const
const Layer * getBlockageLayer () const
size_t getTracksSize () const
size_t computeTracksSize () const
DbU::Unit getTrackPosition (size_t index) const
Track * getTrackByIndex (size_t index) const
Track * getTrackByPosition (DbU::Unit axis, unsigned int mode=KtNearest) const
bool _check (unsigned int &overlaps) const
Static Public Member Functions
static RoutingPlane * create (KiteEngine *, size_t depth)

Detailed Description
Array of Tracks in one Layer. 
A RoutingPlane is an array of Track covering a rectangular area. For now the area is the abutment box of the to be routed Cell. Tracks are spaced evenly and according to the configuration of the relevant RoutingLayerGauge.

Member Function Documentation
RoutingPlane * create (KiteEngine *  engine, size_t  depth)[static]

Parameters:
engine 	The associated engine. 	
depth 	The Layer depth of the plane. 	
Returns:
The newly created RoutingPlane.
The RoutingPlane public constructor. The depth  is in the sense of the RoutingGauge. 
bool isHorizontal () const[inline]
Returns:  true  if the preferred routing direction is horizontal (the actual direction of the tracks). 
bool isVertical () const[inline]
Returns:  true  if the preferred routing direction is vertical (the actual direction of the tracks). 
KiteEngine * getKiteEngine () const[inline]
Returns:  The associated KiteEngine. 
Referenced by Track::getKiteEngine().
RoutingLayerGauge * getLayerGauge () const[inline]
Returns:  The RoutingLayerGauge of the plane. 
Referenced by RoutingPlane::getBlockageLayer(), and RoutingPlane::getLayer().
unsigned int getDirection () const[inline]
Returns:  The preferred routing direction (Katabatic::KbHorizontal or Katabatic::KbVertical). 
Referenced by RoutingPlane::create(), RoutingPlane::isHorizontal(), and RoutingPlane::isVertical().
size_t getDepth () const[inline]
Returns:  The depth of the associated layer (as defined by the RoutingLayerGauge). 
Referenced by Track::getDepth().
size_t getAxisMin () const[inline]
Returns:  The axis coordinate of the first/lowest track. 
size_t getAxisMax () const[inline]
Returns:  The axis coordinate of the last/highest track. 
size_t getTrackMin () const[inline]
Returns:  The minimum bound of all track. 
size_t getTrackMax () const[inline]
Returns:  The maximum bound of all track. 
RoutingPlane * getTop () const
Returns:  The RoutingPlane immediatly above this one. 
RoutingPlane * getBottom () const
Returns:  The RoutingPlane immediatly below this one. 
const Layer * getLayer () const[inline]
Returns:  The associated routing layer. 
Referenced by Track::getLayer().
const Layer * getBlockageLayer () const[inline]
Returns:  The blockage layer associated to the routing layer. 
Referenced by Track::getBlockageLayer().
size_t getTracksSize () const[inline]
Returns:  The number of tracks in the array. 
size_t computeTracksSize () const[inline]
Returns:  The number of tracks to create  in the array.
Helper method that compute the number of tracks in the array from the area of the Cell to be routed and the RoutingLayerGauge characteristics (the Cell is accessible through the KiteEngine). 
Referenced by RoutingPlane::create().
DbU::Unit getTrackPosition (size_t  index) const[inline]
Returns:  The axis of the track at index  in the array. 
Track * getTrackByIndex (size_t  index) const
Returns:  The track at index  in the array. 
Referenced by Track::getNextTrack(), and Track::getPreviousTrack().
Track * getTrackByPosition (DbU::Unit  axis, unsigned int  mode = KtNearest) const
Returns:  The track which position is nearest from axis . The meaning of nearest  is defined by mode  (classic rouding options). 
Referenced by SegmentFsm::conflictSolveByPlaceds(), NegociateWindow::createTrackSegment(), RoutingEvent::revalidate(), Manipulator::ripupPerpandiculars(), and SegmentFsm::SegmentFsm().
bool _check (unsigned int &  overlaps) const
Returns:  true  if no errors have been found (i.e. the database is coherent).
Perform a coherency check on all tracks part of the array. 

The documentation for this class was generated from the following files:
RoutingPlane.h
RoutingPlane.cpp
RoutingPlane.dox

SegmentAction Class Reference

Store request for an event to be generated on a TrackElement. 
Public Types
enum Type { Self = (1<< 0), Other = (1<< 1), Perpandicular = (1<< 2), Insert = (1<< 3), Ripup = (1<< 4), RipedByLocal = (1<< 5), ResetRipup = (1<< 6), ToRipupLimit = (1<< 7), AxisHint = (1<< 9), PackingMode = (1<<10), ToState = (1<<11), EventLevel1 = (1<<12), EventLevel2 = (1<<13), EventLevel3 = (1<<14), EventLevel4 = (1<<15), EventLevel5 = (1<<16), SelfInsert = Self |Insert, SelfRipup = Self |Ripup, SelfRipupPerpand = Self |Ripup|Perpandicular, SelfRipupPerpandWithAxisHint = Self |Ripup|Perpandicular|EventLevel4|AxisHint, OtherRipup = Other|Ripup, OtherRipupPerpandAndPushAside = Other|Ripup|Perpandicular|EventLevel3|AxisHint, OtherRipupPerpandAndPacking = Other|Ripup|Perpandicular|EventLevel4|PackingMode }
Public Member Functions
SegmentAction (TrackElement *, unsigned int type, DbU::Unit axisHint=0, unsigned int toState=0)
TrackElement * getSegment () const
unsigned int getType () const
void setAxisHint (DbU::Unit)
unsigned int setFlag (unsigned int)
bool doAction (RoutingEventQueue &)

Detailed Description
Store request for an event to be generated on a TrackElement. 
When an event on a Kite::TrackElement is being processed (with the SegmentFsm helper), it may generate events on TrackElement already placed and belonging either to the same net or other ones. Those events are not generated and queued immediatly but instead SegmentAction, requesting the event generation are created and stored into a simple vector in SegmentFsm. The last operation of the SegmentFsm object is to call the SegmentAction::doAction() method on all the action to actually generate and queue the events. 

Member Enumeration Documentation
enum Type
Indicates the kind of action to be performed on the segment. In the following flags  and masks  descriptions, we uses the term reference segment  for the TrackElement which is associated with the currently processed RoutingEvent (also referenced in SegmentFsm).
Here is the list of the availables actions that can be performed when (re)scheduling a RoutingEvent. It is here that we uses the RoutingEvent level feature to perform a local reordering of the top of the queue. Reordering is used to allows perpandiculars to be routed before  the reference segment (instead of after) or other  segments in conflict.

SegmentAction::SelfInsert
 Action:  The reference segment is to be inserted in a Track (placed).
 Event Level:  Unchanged.
SegmentAction::SelfRipup
 Action:  The reference segment is to be ripped up.
 Event Level:  Unchanged.
SegmentAction::SelfRipupPerpand
 Action:  Ripup a segment which is a perpandicular to the reference segment. Ordering considerations: this perpandicular will be put back into the RoutingEvent queue with a lower level (priority) than the reference segment, so it will be processed again after  the reference segment.
 Event Level:  Unchanged.
SegmentAction::SelfRipupPerpandWithAxisHint
 Action:  Ripup a segment which is a perpandicular to the reference segment, supplies an axis hint and put it back into the RoutingEvent queue so that it will be processed before  the reference segment.
 Event Level:  Increased to SegmentAction::EventLevel4.
SegmentAction::OtherRipup
 Action:  Ripping up a segment from another net and in the same direction as the reference segment.
 Event Level:  Unchanged.
SegmentAction::OtherRipupPerpandAndPushAside
 Action:  Ripping up a segment from another net and in perpandicular direction. The level is elevated so it's priority is greater than the reference segment this it will be reprocessed first. An axis hint is also supplied in order to make room for the reference segment.
 Event Level:  Increased to SegmentAction::EventLevel3.
SegmentAction::OtherRipupPerpandAndPacking
 Action:  Ripping up a segment from another net and in perpandicular direction. The level is elevated so it's priority is greater than the reference segment this it will be reprocessed first. The generated event is in packing mode only.
 Event Level:  Increased to SegmentAction::EventLevel4. 

Enumerator:
Self	[Flag]  The segment associated to the action is the reference segment or segments from the same net . 
	
Other	[Flag]  The segment associated to the action is not  from the same net as the reference segment. 
	
Perpandicular	[Flag]  The action concern a perpandicular to the reference segment. 
	
Insert	[Flag]  Request that the segment is to be inserted in the given track. It is the task of SegmentFsm to determine that there is sufficent space to do so. 
	
Ripup	[Flag]  Request that the segment is to be ripped up. 
	
RipedByLocal	[Flag]  Indicate that the segment has been ripped up by a local one. 
	
ResetRipup	[Flag]  The ripup count is to be reset. 
	
ToRipupLimit	[Flag]  The ripup count is directly increased to the ripup limit, triggering a state change the next time the segment will be processed. 
	
AxisHint	[Flag]  An axis hint has been supplied, and is to be passed to the generated RoutingEvent. 
	
PackingMode	[Flag]  Whether the RoutingEvent should be processed in packing  mode or negociated  mode (transmitted to the RoutingEvent). 
	
ToState	[Flag]  Force the change of state of the RoutingEvent (i.e. DataNegociate). Normally the state change is done through the increase of the ripup count in DataNegociate. 
	
EventLevel1	[Flag]  Increase the level to at least  1 . 
	
EventLevel2	[Flag]  Increase the level to at least  2 . 
	
EventLevel3	[Flag]  Increase the level to at least  3 . 
	
EventLevel4	[Flag]  Increase the level to at least  4 . 
	
EventLevel5	[Flag]  Increase the level to at least  5 . 
	
SelfInsert	[Mask] , see SegmentAction::Type. 
	
SelfRipup	[Mask] , see SegmentAction::Type. 
	
SelfRipupPerpand	[Mask] , see SegmentAction::Type. 
	
SelfRipupPerpandWithAxisHint	[Mask] , see SegmentAction::Type. 
	
OtherRipup	[Mask] , see SegmentAction::Type. 
	
OtherRipupPerpandAndPushAside	[Mask] , see SegmentAction::Type. 
	
OtherRipupPerpandAndPacking	[Mask] , see SegmentAction::Type. 

Constructor & Destructor Documentation
SegmentAction (TrackElement *  segment, unsigned int  type, DbU::Unit  axisHint = 0, unsigned int  toState = 0)

Parameters:
segment 	On what the action is to be performed. 	
type 	Defines the type of action, see SegmentAction::Type. 	
axisHint 	Specifies a preferred axis. 	
toState 	The DataNegociate::SlackState into which the segment is to be set.	
Create segment action. 

Member Function Documentation
TrackElement * getSegment () const[inline]
Returns:  The associated segment . 
SegmentAction::Type getType () const[inline]
Returns:  The action to be performed. 
void setAxisHint (DbU::Unit  axis)[inline]
The axis preferred position to be transmitted to the generated event. The transmition will be effective only  if the SegmentAction::Type::AxisHint flag is set. 
unsigned int setFlag (unsigned int  flags)[inline]
Allow to change the action type by indivually setting up the flags. 
void doAction (RoutingEventQueue &  queue)
Actually perform the action. That is, build and queue the appropriate event for the segment. 

The documentation for this class was generated from the following files:
SegmentFsm.h
SegmentFsm.cpp
SegmentFsm.dox

SegmentFsm Class Reference

Pseudo-decorator to process a RoutingEvent. 
Public Types
enum State { MissingData = (1<<0), EmptyTrackList = (1<<1), Inserted = (1<<2), Self = (1<<3), Other = (1<<4), Ripup = (1<<5), MaximumSlack = (1<<6), SelfInserted = Self | Inserted, OtherRipup = Other | Ripup, SelfMaximumSlack = Self | MaximumSlack }
Public Member Functions
SegmentFsm (RoutingEvent *, RoutingEventQueue &, RoutingEventHistory &)
bool isFullBlocked () const
RoutingEvent * getEvent () const
RoutingEventQueue & getQueue () const
RoutingEventHistory & getHistory () const
unsigned int getState () const
DataNegociate * getData ()
Interval & getConstraint ()
Interval & getOptimal ()
vector< TrackCost > & getCosts ()
TrackCost & getCost (size_t)
Track * getTrack (size_t)
size_t getBegin (size_t)
size_t getEnd (size_t)
vector< SegmentAction > & getActions ()
void setState (unsigned int)
void addAction (TrackElement *, unsigned int type, DbU::Unit axisHint=0, unsigned int toState=0)
void doActions ()
void clearActions ()
bool insertInTrack (size_t)
bool conflictSolveByHistory ()
bool conflictSolveByPlaceds ()
bool desaturate ()
bool slackenTopology (unsigned int flags=0)
bool solveFullBlockages ()

Detailed Description
Pseudo-decorator to process a RoutingEvent. 
The SegmentFsm class actually perform the placement of the Kite::TrackElement of the Kite::RoutingEvent. It structured around three goals:
Implement the finite state machine for the Kite::DataNegociate state.
Provide a kind of decoration on the RoutingEvent/TrackElement (it do not abide by the definition from Design Patterns).
Cache a lot of on-the-fly computed datas needed during the SegmentFsm lifetime and the Manipulator(s) it may uses.
Update Mechanism
The constructor of SegmentFsm triggers the update of the RoutingEvent and through it DataNegociate.
Slackening / FSM Transitions
A transition occurs in the FSM whenener all the availables ripup methods for a segment have failed. Failure means that the topology of the net itself must be altered to allow a greater level of flexibility. Modifying the net topology means to give the current segment some more slack.
Availables slackening operations:
1.	DataNegociate::RipupPerpandiculars (Manipulator) place the segments before any of it's perpandiculars are placed to allow a maximum track choice.
2.	DataNegociate::Minimize (Manipulator) try to fit the segment in a hole in a track, perform a hole detection.
3.	DataNegociate::Dogleg (Manipulator) create a dogleg matching the first track candidate  with a non-nul overlap.
4.	DataNegociate::Slacken (Manipulator) to be reviewed.
5.	DataNegociate::ConflictSolveByHistory (SegmentFsm) try to find a break point on the segment, based on the ripup history.
6.	DataNegociate::ConflictSolveByPlaceds (SegmentFsm) try to find a break point on the segment, based on the current position of segments on the candidate tracks.
7.	DataNegociate::MoveUp (Manipulator) try to move up the segment.
Simple slackening operations are defined in Manipulator and complex ones directly in SegmentFsm.
Non-Slackening Operations
In addition, some operation that do not modifies the topology are availables:
1.	Manipulator::forceOverLocals() mostly for global segments to ripup a track from all it's locals.
2.	SegmentFsm::insertInTrack() automates the three subsequent ripup trials. 

Member Enumeration Documentation
enum State
Indicates what the SegmentFsm has done the processed TrackElement, possible values are:
SegmentFsm::MissingData, this is an error condition, the TrackElement do not have associated DataNegociate structure. Nothing is done.
SegmentFsm::EmptyTrackList, no Track is available for placement (free or used).
SegmentFsm::SelfInserted, the TrackElement can be successfully inserted in a Track (i.e. without overlap).
SegmentFsm::SelfMaximumSlack, nothing can be done to further slacken the TrackElement, it is at maximum ripup of the last possible state (no more topological modifications are possibles).
SegmentFsm::OtherRipup, the TrackElement can be inserted but it needs the ripup of some others. 

Enumerator:
MissingData	[Flag] , see SegmentFsm::SegmentFsmValue. 
	
EmptyTrackList	[Flag] , see SegmentFsm::SegmentFsmValue. 
	
Inserted	[Flag] , the TrackElement can be inserted in a Track. 
	
Self	[Flag] , the action is related to the processed TrackSegment. 
	
Other	[Flag] , the action is not  related to the processed TrackSegment, that is, others are being topologically modificated or riped up. 
	
Ripup	[Flag] , segement, that are not the processed one are being ripped up. 
	
MaximumSlack	[Flag] , the processed segment as reached it's maximum ripup count on the last possible slackening state. 
	
SelfInserted	[Mask] , see SegmentFsm::SegmentFsmValue. 
	
OtherRipup	[Mask] , see SegmentFsm::SegmentFsmValue. 
	
SelfMaximumSlack	[Mask] , see SegmentFsm::SegmentFsmValue. 

Constructor & Destructor Documentation
SegmentFsm (RoutingEvent *  event, RoutingEventQueue &  queue, RoutingEventHistory &  history)

Parameters:
event 	The RoutingEvent to be processed. 	
queue 	The RoutingEvent queue. 	
history 	The complete history of RoutingEvent.	
Construct a SegmentFsm from a RoutingEvent. The constructor is in charge of computing all the cached values. 

Member Function Documentation
bool isFullBlocked () const[inline]
Returns:  true  if there are Tracks avalaibles but the constraints are such that none is actually usable. 
RoutingEvent * getEvent () const[inline]
Returns:  The currently processed RoutingEvent (cached ). 
Referenced by SegmentFsm::doActions(), SegmentFsm::slackenTopology(), and SegmentFsm::solveFullBlockages().
RoutingEventQueue & getQueue () const[inline]
Returns:  The RoutingEvent queue (cached ). 
RoutingEventHistory & getHistory () const[inline]
Returns:  The RoutingEvent history (cached ). 
Referenced by SegmentFsm::conflictSolveByHistory().
unsigned int getState () const[inline]
Returns:  The state (SegmentFsm::SegmentFsmValues) which the SegmentFsm has computed for the RoutingEvent. This is not  the state of the DataNegociate 
DataNegociate * getData ()[inline]
Returns:  The DataNegociate of the TrackElement (cached ). 
Interval & getConstraint ()[inline]
Returns:  The interval into which the segment axis can be set (computed from the topological constraints and the placement constraints on the already placed perpandiculars). 
Interval & getOptimal ()[inline]
Returns:  The interval for an optimal placement of the segment axis. 
vector< TrackCost > & getCosts ()[inline]
Returns:  The table of cost for all the candidates Tracks of the segment. The table is sorted in increasing cost order (see TrackCost). 
Referenced by SegmentFsm::desaturate(), Manipulator::forceOverLocals(), Manipulator::makeDogleg(), and Manipulator::minimize().
TrackCost & getCost (size_t  i)[inline]
Returns:  The cost at index i  in the table. 
Referenced by SegmentFsm::desaturate(), Manipulator::forceOverLocals(), Manipulator::forceToTrack(), Manipulator::insertInTrack(), Manipulator::minimize(), and SegmentFsm::solveFullBlockages().
Track * getTrack (size_t  i)[inline]
Returns:  The Track for cost at index i  in the table. 
Referenced by SegmentFsm::desaturate(), Manipulator::forceOverLocals(), Manipulator::forceToTrack(), Manipulator::insertInTrack(), Manipulator::makeDogleg(), Manipulator::minimize(), and Manipulator::shrinkToTrack().
size_t getBegin (size_t  i)[inline]
Returns:  The overlapping begin  index in Track for cost at index i  in the table. 
Referenced by SegmentFsm::desaturate(), Manipulator::forceOverLocals(), Manipulator::forceToTrack(), Manipulator::insertInTrack(), Manipulator::makeDogleg(), Manipulator::minimize(), and Manipulator::shrinkToTrack().
size_t getEnd (size_t  i)[inline]
Returns:  The overlapping end  index in Track for cost at index i  in the table. 
Referenced by SegmentFsm::desaturate(), Manipulator::forceOverLocals(), Manipulator::forceToTrack(), Manipulator::insertInTrack(), Manipulator::makeDogleg(), Manipulator::minimize(), and Manipulator::shrinkToTrack().
vector< SegmentAction * > & getActions ()[inline]
Returns:  The table of SegmentAction, that is the delayed requests for RoutingEvent creation. 
Referenced by Manipulator::shrinkToTrack().
unsigned int setState (unsigned int  state)[inline]
Returns:  Sets the state of the state... 
Referenced by SegmentFsm::desaturate(), Manipulator::forceOverLocals(), Manipulator::forceToTrack(), Manipulator::insertInTrack(), and Manipulator::shrinkToTrack().
void addAction (TrackElement *  segment, unsigned int  type, DbU::Unit  axisHint = 0, unsigned int  toState = 0)
Request the creation of a new delayed RoutingEvent, for the meaning of the parameters, see SegmentAction::SegmentAction. 
Referenced by SegmentFsm::desaturate(), Manipulator::forceOverLocals(), Manipulator::forceToTrack(), Manipulator::insertInTrack(), Manipulator::minimize(), Manipulator::relax(), Manipulator::repackPerpandiculars(), Manipulator::ripple(), Manipulator::ripup(), Manipulator::ripupPerpandiculars(), Manipulator::shrinkToTrack(), and SegmentFsm::slackenTopology().
bool doActions ()
Actually generate RoutingEvent(s) from the SegmentAction(s). 
void clearActions ()[inline]
Clear the the table of requested actions, whithout generating them. 
Referenced by Manipulator::insertInTrack(), and SegmentFsm::slackenTopology().
bool insertInTrack (size_t  i)
Try to insert the TrackElement in the Track at index i  (in the cost table). Return true  if the insertion is possible.
The insertion is not done at this stage, but a set of ripup actions is emitted to allow insertion the next time the segment will be processed.
Three subsequent trials are done before giving up on inserting the segment:
1.	Manipulator::insertInTrack(), try to push asides the neighbors.
2.	Manipulator::shrinkToTrack(), try squeeze the segment in an existing free space.
3.	Manipulator::forceToTrack(), perform a complete ripup of all the neighbors and their perpandiculars.
The event keeps track of the insertion attempt step (see RoutingEvent::getInsertState()). 
bool conflictSolveByHistory ()
Returns:  true  if a suitable dogleg has been created in the segment.
Initially, global segments may be very long, and a placement solution in which each one is placed on a track of it's own may not be realisable. In that case, at least one of the global segment must be broken. The figure below illustrate the case: (a) , (b) , (c)  form a first cluster and (d) , (e) , (f)  form a second one. Due to the constraints of the segments the remaining free track cannot be the same in both clusters. The only solution to place (g)  is to break it into two sub-globals. The whole point of the conflict solve is to correctly detect the cluster and choose the breaking point.
 This variant of the conflict solve method try to guess the track span for which there is a conflict by looking at the event history.
 Dislodger Definition: 
A segment is said to be a dislodger if it matches the two following criterions:
It's span intersect the to be inserted segment span.
It has been placed on a track inside the perpandicular span of the to be placed segment.
For the time beeing we limit the search to the last three dislodgers, to not waste too much time looking back the event history. We merge overlapping intervals into one (see the undocumented class UnionIntervals  and RipupHistory  in SegmentFsm.cpp ).
For the time beeing we only look on the track into which the to be inserted segment wants to be placed.
Then we try to break the to be placed segment, first under the lower bound (source) of the conflicting interval then, in case of failure under the upper bound (target).
 
bool conflictSolveByPlaceds ()
Returns:  true  if a suitable dogleg has been created in the segment or  a dislodger has been moved up.
This methods achieve the same goal as SegmentFsm::conflictSolveByHistory() but uses a different strategy.
Instead of looking through the history to find dislodgers it analyses the placed segments in all the candidates tracks for the to be placed segment. Unlike it's sibling method, which creates only one dogleg, as it uses the Manipulator::relax() method, it may creates up to two doglegs.
Synthetic Description 

1.	For each track, find the dislodgers, merge the overlaps into one interval and store the length of the longuest overlap (aka conflict).
2.	Sort the tracks according to decreasing longuest overlap/confict.
3.	For each track in the sorted list, look for a dislodger under the middle of the to be placed segment. If no dislodger is present at this place go to the next track. Otherwise:
The dislodger is local , then try to relax the to placed segment around the dislodger.
The dislodger is global , try to move it up, if it is not possible, fallback to the relax approach.
4.	Quit on the first successful move up or relax.
5.	If there is no candidate tracks, this means the vertical constraints are too tight, in that case, ripup the perpandiculars (fallback plan).
Interval Accounting 
Only global conflicting segments are took into account. Local segments may be took into account if they overlap global ones (all part of the same net). All overlapping segments are merged into one big conflict interval. The whole length of a conflict interval is took into account event if it's overlap with the to be placed segment is only partial.
Track Ordering (lexicographic) 

1.	The longuest (in one interval) conflict length.
2.	The longuest cumulative conflict length (all interval summed up).
Interval accounting and Track ordering is managed through the undocumented Cs1Candidate  class implemented in SegmentFsm.cpp .
 
bool desaturate ()
Try to create a suitable empty space in a cost Track by moving up TrackElement in conflict. 
bool slackenTopology (unsigned int  flags = 0)
Modificate the topology of the TrackElement to slacken it. It is the implementation of the slakening finite state machine. 
bool solveFullBlockages ()
Try to solve a fully blocked configuration. 

The documentation for this class was generated from the following files:
SegmentFsm.h
SegmentFsm.cpp
SegmentFsm.dox

SegmentObserver Class Reference

Observer on the base AutoSegment. 
Inheritance diagram for SegmentObserver:
IMAGE

Public Member Functions
virtual void notify (unsigned int flags)

Detailed Description
Observer on the base AutoSegment. 
The observer that will be hooked into the observable in the associated canonical AutoSegment. Used to propagate the invalidation/revalidation events from AutoSegment toward TrackSegment.
As a secondary function, it is used by the Session::lookup() method to quicly retrieve TrackSegment from Katabatic::AutoSegment. 

Member Function Documentation
void notify (unsigned int  flags)[virtual]
Implement the asymmetric invalidate/revalidate policy described in Kite::Session. The invalidate is immediatly passed on while the revalidate is ignored. 
Reimplemented from BaseObserver.

The documentation for this class was generated from the following files:
TrackElement.h
TrackElement.cpp
TrackElement.dox

Session Class Reference

Kite update Session. 
Inheritance diagram for Session:
IMAGE

Static Public Member Functions
static Session * open (KiteEngine *)
static Session * get (const char *message=NULL)
static Katabatic::Session * base ()
static bool isEmpty ()
static KiteEngine * getKiteEngine ()
static Configuration * getConfiguration ()
static Net * getBlockageNet ()
static NegociateWindow * getNegociateWindow ()
static Katabatic::GCell * getGCellUnder (DbU::Unit, DbU::Unit)
static void addInsertEvent (TrackElement *, Track *)
static void addRemoveEvent (TrackElement *)
static void addMoveEvent (TrackElement *, Track *)
static void addSortEvent (Track *, bool forced=false)
static size_t revalidate ()
static TrackElement * lookup (Segment *)
static TrackElement * lookup (AutoSegment *)

Detailed Description
Kite update Session. 
Session extend the Katabatic update session to the Kite router level. Mainly by managing Track update.
Difference between Kite & Katabatic sessions: 
In Katabatic, segments are actually moved before  the revalidation, then during  the revalidation, contacts and topologies are adjusteds
In Kite, nothing is moved until the revalidation. Requests for segment displacement are queued for the session.
Asymmetry between invalidation & revalidation: 
When a TrackSegment (or directly an AutoSegment) is invalidated both associated AutoSegment and TrackSegment are invalidated (through the Observer mechanism).
When an AutoSegment is revalidated, the TrackSegment is not  immediatly revalidated. See the revalidate algorithm for more details.
Indirect TrackSegment invalidation: 
TrackSegment invalidation do not result only from direct insertion in Track. For example, any or all of it's perpandicular can be invalidated trough the Katabatic::Session update (the perpandicular Katabatic::AutoSegment is revalidated, generating invalidation on their associated TrackSegment).
For details on how Katabatic Sessions works, have a look to Katabatic::Session.
The Session Mechanism.
Delayed modification procedure :
Modifications events are recorded (queued) into the Session. At this step, no modification are actually done, the data-base retains it's previous state and coherency.
The revalidate()  procedure is called (or the Session is closed), then all the modification events are applied. The data-base is in now in it's new state.

The Revalidate Algorithm.
Revalidation steps :
Process all remove events. detach TrackSegment from their Track, but do not remove the pointer from the internal vector .
Pack all Track in which removal have took place.
Process all insert events. This is the time TrackSegment are moved into their new Track (physical displacement) . It is at this point that the invalidation of both AutoSegment and TrackSegment is done.
Call the Katabatic::Session::revalidate() method which will recompute the correct contact extensions and topologies. After  this step the Katabatic data-base is up to date, but not  the Kite one. AutoSegment are revalidated.
Recompute the canonical position of source and target of all invalidateds TrackSegment (take account of extention modifications). The set of invalidated TrackSegment is computed from the revalidated AutoSegment, that is AutoSegment that are canonical.
Perform a sort() on all Track that have been modifieds.
Now that the size of the segments have been accurately computed, look for revalidateds TrackSegment that:
1.	Can be reduced, generate a track remove event.
2.	Must be raised, generate a routing event (put into the queue).
Process the additional track remove events.
Note:  We cannot use the Observer mechanism to automatically update TrackSegment from an AutoSegment, because we must wait for all AutoSegments (canonical or not) involved into the TrackSegment to be up to date before we can update it.
Note:  Have to talk about the special case when new canonical AutoSegment appears after dogleg creation.
The Lookup Mechanism
There are two lookup mechanisms:
From a Hurricane::Segment, we uses the Katabatic segment lookup table (slow, stored in a map<> ).
From a Katabatic::AutoSegment, we uses the Observer, it's owner is the TrackSegment (fast). 

Member Function Documentation
Session * open (KiteEngine *  kite)[static]

Parameters:
kite 	A Kite ToolEngine on which to work. 	
Returns:
A new Kite update Session.
Open a new Kite update Session on the kite  ToolEngine . At this point only one session can be opened at a time. Attempt to open a second one will result in an exception. 
Session * get (const char *  message = NULL)[static]
Returns:  The currently opened session, NULL  if no session has been opened. 
Referenced by NegociateWindow::run().
Katabatic::Session * base ()[inline], [static]
Returns:  The Session, casted as it's base object. 
bool isEmpty ()[inline], [static]
Ensure that the Session is empty and can be closed (deleted) safely. 
Referenced by NegociateWindow::run().
KiteEngine * getKiteEngine ()[inline], [static]
Returns:  The Kite ToolEngine associated to the current update session (proxy helper). 
Referenced by Manipulator::canRipup(), SegmentFsm::conflictSolveByHistory(), SegmentFsm::conflictSolveByPlaceds(), NegociateWindow::createTrackSegment(), SegmentAction::doAction(), RoutingEvent::process(), RoutingEvent::revalidate(), Manipulator::ripple(), Manipulator::ripupPerpandiculars(), NegociateWindow::run(), SegmentFsm::SegmentFsm(), and NegociateWindow::setGCells().
Configuration * getConfiguration ()[static]
Returns:  The Kite Configuration of the Router (proxy helper). 
Net * getBlockageNet ()[inline], [static]
Returns:  The net used to create blockage components (proxy helper). 
Referenced by TrackFixedSegment::create().
NegociateWindow * getNegociateWindow ()[inline], [static]
Returns:  The current NegociateWindow (proxy helper). 
Referenced by TrackSegment::_postDoglegs(), and TrackSegment::reschedule().
Katabatic::GCell * getGCellUnder (DbU::Unit  x, DbU::Unit  y)[inline], [static]
Returns:  The GCell under  (x,y) (proxy helper, see Katabatic::GCellGrid::getGCell()). 
Referenced by SegmentFsm::conflictSolveByHistory().
void addInsertEvent (TrackElement *  segment, Track *  track)[inline], [static]

Parameters:
segment 	An AutoSegment to insert in a Track. 	
track 	The Track into which the segment  will be inserted.	
Schedule the insertion of segment  into Track track . The segment  must not already be part of a Track. 
void addRemoveEvent (TrackElement *  segment)[inline], [static]

Parameters:
segment 	A TrackSegment to remove from a Track.	
Schedule the removal of segment  from Track track . 
Referenced by SegmentAction::doAction(), and TrackSegment::reschedule().
void addMoveEvent (TrackElement *  segment, Track *  track)[inline], [static]

Parameters:
segment 	An AutoSegment to move into a new Track. 	
track 	The Track into which the segment  will be moved.	
Schedule the displacement of segment  into Track track . 
void addSortEvent (Track *  track, bool  forced = false)[inline], [static]

Parameters:
track 	The Track to update. 	
forced 	Force the invalidation of the Track .	
Schedule the update of Track track . If the Track  has not been invalidated, no actual sort will takes place. To force a sort (manually invalidating the Track ), sets forced  to true .
See also:   Track::pack() & Track::sort(). 
Referenced by TrackSegment::revalidate().
void revalidate ()[inline], [static]
Applies all the requested modifications, but keeping the session opened. 
Referenced by RoutingEvent::process(), NegociateWindow::run(), and NegociateWindow::setGCells().
TrackElement * lookup (Segment *  segment)[static]
Returns:  the TrackElement associated to segment . 
Referenced by NegociateWindow::computeWirelength(), TrackSegment::create(), TrackSegment::getCanonical(), TrackSegment::getParent(), TrackSegment::getSourceDogleg(), TrackSegment::getTargetDogleg(), Manipulator::relax(), RoutingEventQueue::repushInvalidateds(), and NegociateWindow::setGCells().
TrackElement * lookup (AutoSegment *  segment)[static]
Returns:  the TrackElement associated to segment . 

The documentation for this class was generated from the following files:
Session.h
Session.dox

Track Class Reference

Structure managing one routing track. 
Inheritance diagram for Track:
IMAGE

Public Types
enum IndexState { BeginIsTrackMin = 0x00000001, BeginIsSegmentMin = 0x00000002, BeginIsSegmentMax = 0x00000004, EndIsTrackMax = 0x00000008, EndIsSegmentMin = 0x00000010, EndIsNextSegmentMin = 0x00000020, EndIsSegmentMax = 0x00000040, BeforeFirstElement = BeginIsTrackMin |EndIsSegmentMin, InsideElement = BeginIsSegmentMin|EndIsSegmentMax, OutsideElement = BeginIsSegmentMax|EndIsNextSegmentMin, AfterLastElement = BeginIsSegmentMax|EndIsTrackMax, EmptyTrack = BeginIsTrackMin |EndIsTrackMax, BeginMask = BeginIsTrackMin |BeginIsSegmentMin|BeginIsSegmentMax, EndMask = EndIsTrackMax |EndIsSegmentMin |EndIsNextSegmentMin|EndIsSegmentMax }
Public Member Functions
virtual bool isHorizontal () const =0
virtual bool isVertical () const =0
bool isLocalAssigned () const
RoutingPlane * getRoutingPlane () const
KiteEngine * getKiteEngine () const
virtual unsigned int getDirection () const =0
size_t getIndex () const
unsigned int getDepth () const
const Layer * getLayer () const
const Layer * getBlockageLayer () const
DbU::Unit getAxis () const
DbU::Unit getMin () const
DbU::Unit getMax () const
Track * getNextTrack () const
Track * getPreviousTrack () const
size_t getSize () const
virtual Point getPosition (DbU::Unit coordinate) const =0
TrackElement * getSegment (size_t index) const
TrackElement * getSegment (DbU::Unit position) const
TrackElement * getNext (size_t &index, Net *) const
TrackElement * getPrevious (size_t &index, Net *) const
TrackElement * getNextFixed (size_t &index) const
size_t find (const TrackElement *) const
DbU::Unit getSourcePosition (vector< TrackElement *>::iterator) const
DbU::Unit getMinimalPosition (size_t index, unsigned int state) const
DbU::Unit getMaximalPosition (size_t index, unsigned int state) const
Interval getFreeInterval (DbU::Unit position, Net *net=NULL) const
Interval getOccupiedInterval (size_t &begin) const
Interval expandFreeInterval (size_t &begin, size_t &end, unsigned int state, Net *) const
void getBeginIndex (DbU::Unit position, size_t &begin, unsigned int &state) const
void getOverlapBounds (Interval, size_t &begin, size_t &end) const
TrackCost getOverlapCost (Interval, Net *, size_t begin, size_t end, unsigned int flags) const
TrackCost getOverlapCost (Interval, Net *, unsigned int flags) const
TrackCost getOverlapCost (TrackElement *, unsigned int flags) const
void getTerminalWeight (Interval, Net *, size_t &count, unsigned int &weight) const
DbU::Unit getSourcePosition (size_t index) const
bool check (unsigned int &overlaps, const char *message=NULL) const
void invalidate ()
void insert (TrackElement *)
void insert (TrackMarker *)
void setSegment (TrackElement *, size_t)
size_t doRemoval ()
void doReorder ()
Static Public Attributes
static const size_t npos = (size_t)-1

Detailed Description
Structure managing one routing track. 

Track Purpose
We use an array of regularly spaced  Track as a geometrical fast access structure. It allows to know whether an area is used or not. The whole area may be seen as a set of adjoining tiles of fixed width  but variable length .
The figure (1.b)  show, for an horizontal, track the relation between y,min,max  and the occupied area of the plane. min  and max  must take into account segment extensions (e ) and the minimal distance between two rectangles (MD ) of the same layer. We assume that the width of the segment, augmented of all it's contraints is no greater than TS  (in fact it's how TS  must be calculated).
For the whole track array, see RoutingPlane.

Track Implementation
A Track is implemented with a sorted vector of TrackElement. TrackElements from differents nets must not overlap. The sorting order is defined as follow:
TrackElements are sorted by increasing source (min ) positions.
In case of overlap (i.e. belongs to the same net), if they share the same source position, then they are sorted by decreasing  length. This way, the longest one will be the first encountered when walking through the Track in increasing index order.
Figure 2.b  shows the details of the Track [1]  of figure 1.a . Net <d>  show an exemple of overlapping.
 
In addition to the TrackSegments, the Track also manage additionnal informations through a second vector of TrackMarkers. TrackMarker are currently used only to hints at how strongly a terminal is dependant on that portion of Track to be accessed.
Indexes vs. Iterators
Numerical indexes have been prefered over iterators because they can be used more easily by objects other the Track itself for referencing. So internal managment follow the same rule, handling indexes or reference to indexes.
Update Mechanism
When a TrackElement is normaly inserted in a Track, a two way link is established. The Track has an entry in it's vector refering to TrackElement, and conversely, the TrackElement has it's track  field pointing to it's owning Track.
TrackElement Removal 
To remove a TrackElement from a Track, we break one of those two links: the TrackElement cease to refer to the owning Track, marking him for removal which will occurs at the next track revalidation (Track::doRemoval()). In figure 3 , the TrackElement belonging to net <b>  is marked for removal.
 TrackElement Insertion 
When a TrackElement is inserted into a Track, the two way link is immediatly created (but the TrackElement is not yet at it's final place in the Track's vector). Before inserting a TrackElement we check that it's been already detached (track  field to NULL ).
It is at that step that the TrackElement axis is actually updated through a call to TrackElement::setAxis().
Revalidation Sequence 
After a Track has been modificated either the Track element vector or the MarkerElement vector (or both) has been invalidateds. Revalidation take place in three steps:
Track::doRemoval(), remove all TrackElement marked for removal.
Track::insert(), insert the TrackElement into their new Track.
Track::doReorder(), sort the TrackElement of the vector, that is, put the newly inserted elements at their right place.
Each step must be done for all Tracks  before proceeding to the next. This way a TrackElement track  field doesn't get set before  it has been actually removed from it's previous Track.
Main Operations on Tracks
Helper Function:  Track::getBeginIndex()
Return in begin  the index of the TrackElement whose minimum is immediately below the requested position  on the Track axis. The second returned parameter state  is a set of flags to tell how the begin  index has to be interpreted.
Helper Function:  Track::getOccupiedInterval()
Returns the complete interval of a set of overlapping TrackElement from the same net. 

Member Enumeration Documentation
enum IndexState
Indicates how to compute the bounds of the interval enclosing a given position  on track axis.
Note:
According to position , the interval can be a free interval or a used interval. 

Enumerator:
BeginIsTrackMin	(implies begin=0 ) there is no TrackElement before  position  
	
BeginIsSegmentMin	The begin  segment starts before  position  and ends after . 
	
BeginIsSegmentMax	The begin  segment starts and ends before  position . 
	
EndIsTrackMax	There is no TrackElement after  position . 
	
EndIsSegmentMin	The begin  segment starts before  position . 
	
EndIsNextSegmentMin	The begin  segment starts and ends before  position . So the maximum is given by the minimum  of the next  TrackElement. 
	
EndIsSegmentMax	The begin  segment starts before  position  and ends after . 
	
BeforeFirstElement	the position  is before the first TrackElement. 
	
InsideElement	the position  is inside a TrackElement. 
	
OutsideElement	the position  is in free zone between two TrackElements. 
	
AfterLastElement	the position is after the end of the last element. 
	
EmptyTrack	the track is still empty. 
	
BeginMask	To extract the begin  part from a combination of flags. 
	
EndMask	To extract the end  part from a combination of flags. 

Member Function Documentation
bool isHorizontal () const[pure virtual]
Returns:  true  if the Track in horizontal direction. 
Implemented in HorizontalTrack (p.pagenum), and VerticalTrack (p.pagenum).
Referenced by TrackFixedSegment::isHorizontal().
bool isVertical () const[pure virtual]
Returns:  true  if the Track in vertical direction. 
Implemented in HorizontalTrack (p.pagenum), and VerticalTrack (p.pagenum).
Referenced by TrackFixedSegment::isVertical().
bool isLocalAssigned () const[inline]
Returns:  true  is the Track should be preferentially used for local routing. 
RoutingPlane * getRoutingPlane () const[inline]
Returns:  The RoutingPlane owning this Track. 
Referenced by Track::getNextTrack(), and Track::getPreviousTrack().
KiteEngine * getKiteEngine () const
Returns:  The KiteEngine owning this Track. 
unsigned int getDirection () const[pure virtual]
Returns:  The direction of the Track, either Katabatic::KbHorizontal or Katabatic::KbVertical. 
Implemented in HorizontalTrack (p.pagenum), and VerticalTrack (p.pagenum).
Referenced by TrackFixedSegment::getDirection().
RoutingPlane * getIndex () const[inline]
Returns:  The index of this Track in the RoutingPlane Track vector. 
Referenced by Track::check(), Track::getNextTrack(), and Track::getPreviousTrack().
unsigned int getDepth () const
Returns:  The depth (as given by the RoutingGauge) of the Track's layer. 
Layer * getLayer () const
Returns:  The Layer  of the Track. 
Referenced by Track::insert().
Layer * getBlockageLayer () const
Returns:  The associated blockage Layer  to the Track's layer. 
Referenced by Track::insert().
DbU::Unit getAxis () const[inline]
Returns:  The Axis of the Track. 
Referenced by Track::check(), NegociateWindow::createTrackSegment(), TrackFixedSegment::getAxis(), VerticalTrack::getPosition(), HorizontalTrack::getPosition(), Track::insert(), RoutingEvent::revalidate(), Manipulator::ripupPerpandiculars(), and SegmentFsm::SegmentFsm().
DbU::Unit getMin () const[inline]
Returns:  The minimal allowed coordinate of the Track. 
Referenced by Manipulator::minimize().
DbU::Unit getMax () const[inline]
Returns:  The maximal allowed coordinate of the Track. 
Track * getNextTrack () const
Returns:  The next Track in the RoutingPlane  vector. That is the one with the axis immediatly superior. 
Referenced by NegociateWindow::createTrackSegment(), RoutingEvent::revalidate(), and Manipulator::ripupPerpandiculars().
Track * getPreviousTrack () const
Returns:  The previous Track in the RoutingPlane  vector. That is the one with the axis immediatly inferior. 
Referenced by NegociateWindow::createTrackSegment().
size_t getSize () const[inline]
Returns:  The total number of TrackSegment in the Track. 
Referenced by Track::getMaximalPosition(), and Track::getSegment().
Point getPosition (DbU::Unit  position) const[pure virtual]
Returns:  the point at  (position,getAxis()) for horizontal Track at or  (getAxis(),position) for vertical Track. 
Implemented in HorizontalTrack (p.pagenum), and VerticalTrack (p.pagenum).
TrackSegment * getSegment (size_t  index) const

Parameters:
index 	The index of the TrackSegment. 	
Returns:
The TrackSegment at index . The result will be NULL  in the follwing cases :
index  is outside the sorted zone.
index  points to a hole in the Track.
index  is equal to Track::npos. 
Referenced by SegmentFsm::conflictSolveByPlaceds(), NegociateWindow::createTrackSegment(), SegmentFsm::desaturate(), Manipulator::forceOverLocals(), Manipulator::forceToTrack(), Track::getSegment(), Manipulator::insertInTrack(), Manipulator::makeDogleg(), Manipulator::minimize(), and Manipulator::shrinkToTrack().
TrackSegment * getSegment (DbU::Unit  position) const

Parameters:
position 	The position where to search. 	
Returns:
The TrackSegment whose starting point is immediatly inferior to position . 
TrackSegment * getNext (size_t &  index, Net *  net) const

Parameters:
index 	Index of the starting TrackSegment. 	
net 	A Net  to ignore. 	
Returns:
The next TrackSegment (NULL  if not found).
Find, starting from TrackSegment at index  the next TrackSegment ignoring TrackSegment from net . index  is modified to point on the returned TrackSegment. If there's no next TrackSegment (NULL ) then index is set to Track::npos. 
Referenced by Track::expandFreeInterval(), TrackFixedSegment::getNext(), TrackSegment::getNext(), TrackElement::getNext(), and Track::getNextFixed().
TrackSegment * getPrevious (size_t &  index, Net *  net) const

Parameters:
index 	Index of the starting TrackSegment. 	
net 	A Net  to ignore. 	
Returns:
The previous TrackSegment (NULL  if not found).
find, starting from TrackSegment at index  the previous TrackSegment ignoring TrackSegment from net . index  is modified to point on the returned TrackSegment. If there's no previous TrackSegment (NULL ) then index is set to Track::npos. 
Referenced by Track::expandFreeInterval(), TrackFixedSegment::getPrevious(), TrackSegment::getPrevious(), and TrackElement::getPrevious().
TrackSegment * getNextFixed (size_t &  index) const

Parameters:
index 	Index of the starting TrackSegment. 	
Returns:
The first previous Fixed  TrackSegment.
find, starting from TrackSegment at index  the first previous with a Fixed  attribute set. index  is modified to point on the returned TrackSegment. If there's no previous TrackSegment (NULL ) then index is set to Track::npos. 
size_t find (const TrackElement *  element) const
Returns:  the index  of element  inside the Track. If the element  do not belongs to the Track, return Track::npos. 
DbU::Unit getSourcePosition (vector< TrackElement *>::iterator  it) const
Returns:  The source position of TrackSegment pointed by iterator it . If it  is equal to end()  , returns zero. 
DbU::Unit getMinimalPosition (size_t  index, unsigned int  state) const
Returns:  Extract the minimal position from the interval at index  in accordance to state  hinting.
See also:   Track::IndexState. 
DbU::Unit getMaximalPosition (size_t  index, unsigned int  state) const
Returns:  Extract the maximal position from the interval at index  in accordance to state  hinting.
See also:   Track::IndexState. 
Referenced by Track::expandFreeInterval().
Interval getFreeInterval (DbU::Unit  position, Net *  net = NULL) const

Parameters:
position 	where fo find a free interval. 	
net 	for which net to find the free interval. Returns:  The longuest free interval enclosing position  (may be empty). 	
Interval getOccupiedInterval (size_t &  begin) const

Parameters:
begin 	index of one of the TrackElement set. May be modificated. Returns:  the whole interval used by a set of overlaping TrackSegment.	
As TrackElement from a same net can overlap, the interval of one of them do not give the full extend of the Track occupation at this point. This function looks for all overlaping segments and returns the merged interval. Additionnaly it sets begin  to the index of the lowest TrackElement of the set.
 
Referenced by Track::expandFreeInterval(), Track::getBeginIndex(), and Track::getOverlapBounds().
Interval expandFreeInterval (size_t &  begin, size_t &  end, unsigned int  state, Net *  net) const

Parameters:
begin 	the lowest used TrackSegment. 	
end 	the highest used TrackSegment. 	
state 	tells how to interpret the begin  & end  indexes. 	
net 	the for wich we seek place. Returns:  The longuest free interval between  ]begin,end[ .	
Starting from the initial [begin,end]  interval, expand the interval to encompass all free space or segments belonging to net . state  may be used to compute the interval bounds from begin  and end  instead of directly using the returned interval .
Note:
 ]begin,end[ must define a free interval between two TrackSegment. 
Referenced by Track::getFreeInterval().
void getBeginIndex (DbU::Unit  position, size_t &  begin, unsigned int &  state) const

Parameters:
position 	The position where to search. 	
begin 	Index of the immediatly inferior TrackElement. 	
state 	how to interpret the returned begin .	
Return in begin  the index of the TrackElement whose minimum is immediately below the requested position  on the Track axis. The second returned parameter state  is a set of flags to tell how the begin  index has to be interpreted.
Flags for the state  are:
Track::BeginIsTrackMin : (implies begin=0 ) there is no TrackElement before  position .
Track::EndIsSegmentMin : The begin  segment starts before  position .
Track::BeginIsSegmentMin : The begin  segment starts before  position  and ends after .
Track::EndIsSegmentMax : The begin  segment starts before  position  and ends after .
Track::BeginIsSegmentMax : The begin  segment starts and ends before  position .
Track::EndIsNextSegmentMin : The begin  segment starts and ends before  position . So the maximum is given by the minimum  of the next  TrackElement.
Track::EndIsTrackMax : There is no TrackElement after  position .
Based on the previous flags, we build the state  parameter:
Track::BeforeFirstElement : the position  is before the first TrackElement.
Track::InsideElement : the position  is inside a TrackElement.
Track::OutsideElement : the position  is in free zone between two TrackElements.
Track::AfterLastElement : the position is after the end of the last element.
Track::EmptyTrack : the track is still empty.
To separate flags relevant to begin  and end  informations, two masks are provideds:
Track::BeginMask
Track::EndMask
 Reminder for myself:  The Track::getBeginIndex() function relies on the STL lower_bound()  function. lower_bound()  finds the TrackElement immediately superior  to position  (shown on Figure 3  by the LB  label in white on black).
The relation between the returned begin  index and the position is given through the state  parameter. 
Referenced by Track::getFreeInterval(), Track::getOverlapBounds(), and Track::getSegment().
void getOverlapBounds (Interval  interval, size_t &  begin, size_t &  end) const

Parameters:
interval 	the overlaping interval. 	
begin 	where to store the starting bound. 	
end 	where to store the ending bound.	
find the range of TrackSegment intersecting interval . Note that when the interval  lower bound crosses a set of overlaping intervals from the same Net , the interval at begin  will crosses the lower bound but some following of the same Net  may not. 
Referenced by NegociateWindow::createTrackSegment(), and Track::getOverlapCost().
TrackCost getOverlapCost (Interval  interval, Net *  net, size_t  begin, size_t  end, unsigned int  flags) const

Parameters:
interval 	the overlaping interval. 	
net 	a Net to ignore (null cost). 	
begin 	the starting bound. 	
end 	the ending bound. 	
flags 	passed to the overlap cost function. 	
Returns:
The cost of the overlap.
Compute the cost of the overlap of interval  with the range  [begin,end] of TrackSegment. Any TrackSegment belonging to net  will be ignored. 
Referenced by Track::getOverlapCost().
TrackCost getOverlapCost (Interval  interval, Net *  net, unsigned int  flags) const

Parameters:
interval 	the overlaping interval. 	
net 	a Net to ignore (null cost). 	
flags 	passed to the overlap cost function.	
Compute the overlap cost of interval  with TrackSegment from the current Track, ignoring thoses belonging to net . 
TrackCost getOverlapCost (TrackElement *  segment, unsigned int  flags) const

Parameters:
segment 	under which to compute overlap cost. 	
flags 	passed to the overlap cost function.	
Compute the overlap cost of segment  with TrackSegment from the current Track (interval and net are deduced from segment ). 
void getTerminalWeight (Interval  interval, Net *  net, size_t &  count, unsigned int &  weight) const

Parameters:
interval 	under which to compute terminal weight. 	
net 	a net to be ignored. 	
count 	incremented of the number of track markers under the interval . 	
weight 	incremented of the sum of the weight of the track markers under the interval .	
Compute and return the sum of the weight of the track markers (see TrackMarker) under interval  ignoring net  (that is, for  net ).
Remark: The referenced variables count  and weight  are not reset to
zero by this function. It is of the caller's responsability. 
DbU::Unit getSourcePosition (size_t  index) const
Returns:  The source position of TrackSegment at index index . If index  is equal to Track::npos, returns zero. 
bool check (unsigned int &  overlaps, const char *  message = NULL) const

Parameters:
overlaps 	The number of overlaping segments. 	
message 	An iformative message, only printed if an error occurs. 	
Returns:
true  if the Track contains no incoherencies.
Perform a complete Track check. Looks for the following incoherencies :
TrackSegment do not refers this Track.
TrackSegment is detached (TrackSegment::getTrack() is NULL ).
TrackSegment is hollow, this one is very unlikely as hollow TrackSegment are only created for the lower_bound() .
NULL  pointers (should never occurs, nevertheless...)
Two consecutive TrackSegment from different Net  must not overlap.
For TrackSegment starting from the same position, the longuest must be first. 
void invalidate ()
Inconditionnaly invalidate the Track, regardless if it has been modificated. The Track will be forced to be revalidated on closure of the current session. 
void insert (TrackElement *  segment)
Adds segment  to the Track. Must only be used inside a Session. They must appears after  Track::doRemoval() and before  Track::doReorder().
See also:   Kite::Session. 
void insert (TrackMarker *  marker)
Adds marker  to the Track. Must only be used inside a Session.
See also:   Kite::Session. 
void setSegment (TrackElement *  element, size_t  index)
Directly affect the Track entry at position index  to element  (use with great care).
See also:   Kite::Session. 
Referenced by TrackSegment::swapTrack().
size_t doRemoval ()
Returns:  The number of removeds TrackSegment.
Suppress all the TrackSegment that have been withdraw from the Track. TrackSegment must be withdraw trough the TrackSegment::detach() method which sets their owning Track to NULL  (the removal criterion). It uses the STL remove_if  algorithm that put all the to be removed elements at the end of the vector.
See also:   Kite::Session. 
void doReorder ()
(Re)sort the TrackElement of the vector. Must be called after:  
Track::doRemoval() so no detached TrackSegment are presents.
All calls to Track::insert(), as the newly inserted elements are put at the back of the vector.
See also:   Kite::Session. 

Member Data Documentation
npos = (size_t)-1[static]
A special index value (greatest integer) meaning that an index is invalid. 
Referenced by Track::expandFreeInterval(), Track::find(), Track::getNext(), Track::getOccupiedInterval(), Track::getOverlapBounds(), Track::getOverlapCost(), Track::getPrevious(), Track::getSegment(), and Track::getSourcePosition().

The documentation for this class was generated from the following files:
Track.h
Track.cpp
Track.dox

TrackElement Class Reference

Abstract Class for all Elements inserted inside a Track. 
Inheritance diagram for TrackElement:
IMAGE

Public Member Functions
virtual bool isFixed () const
virtual bool isHorizontal () const =0
virtual bool isVertical () const =0
virtual bool isLocal () const
virtual bool isGlobal () const
virtual bool isBipoint () const
virtual bool isTerminal () const
virtual bool isStrap () const
virtual bool isSlackened () const
virtual bool isDogleg () const
bool isCreated () const
bool isInvalidated () const
bool isBlockage () const
bool isLocked () const
bool isRouted () const
bool hasSourceDogleg () const
bool hasTargetDogleg () const
bool canRipple () const
virtual bool canDogleg ()
virtual bool canDogleg (Interval)
virtual bool canDogleg (Katabatic::GCell *, unsigned int flags=0)
virtual unsigned long getId () const
virtual unsigned int getDirection () const =0
virtual Net * getNet () const =0
virtual const Layer * getLayer () const =0
Track * getTrack () const
size_t getIndex () const
virtual unsigned long getFreedomDegree () const
virtual float getMaxUnderDensity (unsigned int flags=0) const
Box getBoundingBox () const
virtual TrackElement * getNext () const
virtual TrackElement * getPrevious () const
virtual DbU::Unit getAxis () const =0
DbU::Unit getSourceU () const
DbU::Unit getTargetU () const
DbU::Unit getLength () const
Interval getCanonicalInterval () const
virtual Interval getFreeInterval () const
virtual Interval getSourceConstraints () const
virtual Interval getTargetConstraints () const
virtual DataNegociate * getDataNegociate (unsigned int flags=KtDataSelf) const
virtual TrackElement * getCanonical (Interval &)
virtual size_t getGCells (Katabatic::GCellVector &) const
virtual TrackElement * getParent () const
virtual unsigned int getDoglegLevel () const
virtual TrackElement * getSourceDogleg ()
virtual TrackElement * getTargetDogleg ()
virtual TrackElements getPerpandiculars ()
void setFlags (unsigned int)
void unsetFlags (unsigned int)
virtual void setTrack (Track *)
void setIndex (size_t)
virtual void updateFreedomDegree ()
virtual void setDoglegLevel (unsigned int)
virtual void swapTrack (TrackElement *)
virtual void reschedule (unsigned int level)
virtual void detach ()
virtual void invalidate ()
virtual void revalidate ()
virtual void incOverlapCost (Net *, TrackCost &) const
virtual void setAxis (DbU::Unit, unsigned int flags=Katabatic::SegAxisSet)
virtual TrackElement * makeDogleg ()
bool makeDogleg (Katabatic::GCell *)
virtual TrackElement * makeDogleg (Interval, unsigned int &flags)
virtual bool _check () const
Static Public Member Functions
static SegmentOverlapCostCB * setOverlapCostCB (SegmentOverlapCostCB *)

Detailed Description
Abstract Class for all Elements inserted inside a Track. 

TrackElement Abstract
The TrackElement class is abstract and is used as base class for any element that can be inserted in a Track. It represent the footprint of that element inside the Track (an interval). Additionnaly it keep a pointer to the Track and it's index inside it (Track is implemented with a vector<> ).
To avoid some explicit dynamic cast later, it provides a default implementation for almost all the methods that will be present in all the derived classes. All default methods return false , NULL  or 0  (zero ) or whatever is appropriated to tell it is not meaningful.
Design Note 
TrackElement has been designed to serve as a base class for TrackSegment and TrackMarker. But, in the end, those two classes have been put in separated vectors inside the Track, thus rendering this design choice less pertinent. We keep it for now because we may introduce other object than TrackSegment inside a Track. If the need do not arise, we may merge back TrackElement and TrackSegment. 

Member Function Documentation
SegmentOverlapCostCB * setOverlapCostCB (SegmentOverlapCostCB *  cb)[static]

Parameters:
cb 	the new overlap cost callback. 	
Returns:
the previous overlap cost callback.
sets the overlap callback. 
Referenced by NegociateWindow::run().
bool isFixed () const[virtual]
See also:   Katabatic::AutoSegment::isFixed(). 
Reimplemented in TrackSegment (p.pagenum), and TrackFixedSegment (p.pagenum).
Referenced by SegmentFsm::addAction(), SegmentFsm::conflictSolveByPlaceds(), NegociateWindow::createTrackSegment(), SegmentFsm::desaturate(), SegmentAction::doAction(), Manipulator::forceOverLocals(), Manipulator::forceToTrack(), Manipulator::insertInTrack(), Manipulator::isCaged(), Manipulator::makeDogleg(), Manipulator::minimize(), Manipulator::moveUp(), Manipulator::pivotDown(), Manipulator::pivotUp(), Manipulator::relax(), Manipulator::repackPerpandiculars(), Manipulator::ripup(), Manipulator::shrinkToTrack(), and Manipulator::slacken().
bool isHorizontal () const[pure virtual]
See also:   Katabatic::AutoSegment::isHorizontal(). 
Implemented in TrackSegment (p.pagenum), and TrackFixedSegment (p.pagenum).
Referenced by SegmentFsm::conflictSolveByHistory(), and Manipulator::makeDogleg().
bool isVertical () const[pure virtual]
See also:   Katabatic::AutoSegment::isVertical(). 
Implemented in TrackSegment (p.pagenum), and TrackFixedSegment (p.pagenum).
bool isLocal () const[virtual]
See also:   Katabatic::isLocal(). 
Reimplemented in TrackSegment (p.pagenum).
Referenced by SegmentFsm::conflictSolveByPlaceds(), SegmentFsm::doActions(), Manipulator::insertInTrack(), Manipulator::makeDogleg(), Manipulator::moveUp(), Manipulator::pivotUp(), Manipulator::relax(), Manipulator::ripple(), Manipulator::ripupPerpandiculars(), SegmentFsm::SegmentFsm(), Manipulator::shrinkToTrack(), SegmentFsm::slackenTopology(), and SegmentFsm::solveFullBlockages().
bool isGlobal () const[virtual]
See also:   Katabatic::AutoSegment::isGlobal(). 
Reimplemented in TrackSegment (p.pagenum).
Referenced by SegmentFsm::conflictSolveByPlaceds(), Manipulator::insertInTrack(), Manipulator::relax(), Manipulator::repackPerpandiculars(), and SegmentFsm::SegmentFsm().
bool isBipoint () const[virtual]
See also:   Katabatic::AutoSegment::isBipoint(). 
Reimplemented in TrackSegment (p.pagenum).
Referenced by SegmentFsm::desaturate().
bool isTerminal () const[virtual]
See also:   Katabatic::AutoSegment::isTerminal(). 
Reimplemented in TrackSegment (p.pagenum).
Referenced by Manipulator::makeDogleg(), and Manipulator::relax().
bool isStrap () const[virtual]
See also:   Katabatic::AutoSegment::isStrap(). 
Reimplemented in TrackSegment (p.pagenum).
Referenced by Manipulator::insertInTrack(), Manipulator::pivotDown(), Manipulator::pivotUp(), SegmentFsm::SegmentFsm(), and SegmentFsm::slackenTopology().
bool isSlackened () const[virtual]
See also:   Katabatic::AutoSegment::isSlackened(). 
Reimplemented in TrackSegment (p.pagenum).
bool isDogleg () const[virtual]
See also:   Katabatic::isDogleg(). 
Reimplemented in TrackSegment (p.pagenum).
bool isCreated () const[inline]
See also:   Katabatic::AutoSegment::isCreated(). 
bool isInvalidated () const[inline]
Returns:  true  if the segment is invalidated (may be different from the supporting AutoSegment status). 
Referenced by SegmentObserver::notify().
bool isBlockage () const[inline]
true  if the element is a blockage (obstacle). 
Referenced by SegmentFsm::conflictSolveByPlaceds(), NegociateWindow::createTrackSegment(), Manipulator::insertInTrack(), and Manipulator::isCaged().
bool isLocked () const[inline]
true  if the element is part of a net, but must not be moved by the router, whatever the reason. 
bool isRouted () const[inline]
true  if the router has placed it. 
Referenced by TrackSegment::canDogleg().
bool hasSourceDogleg () const[inline]
This method purpose has not been reviewed yet. 
Referenced by TrackSegment::canDogleg(), TrackSegment::getSourceDogleg(), and TrackSegment::getTargetDogleg().
bool hasTargetDogleg () const[inline]
This method purpose has not been reviewed yet. 
Referenced by TrackSegment::canDogleg().
bool canRipple () const[inline]
This method purpose has not been reviewed yet. 
Referenced by Manipulator::ripple().
bool canDogleg ()[virtual]
See also:   AutoSegment::canDogleg(). At Kite level, this variant of the method will apply only on local segments and the segment must not already have a source or target dogleg. 
Reimplemented in TrackSegment (p.pagenum).
Referenced by SegmentFsm::conflictSolveByHistory(), Manipulator::makeDogleg(), and Manipulator::relax().
bool canDogleg (Interval )[virtual]
See also:   AutoSegment::canDogleg(). At Kite level, this variant of the method will apply only on local segments and the segment must not already have a source or target dogleg. 
Reimplemented in TrackSegment (p.pagenum).
bool canDogleg (Katabatic::GCell *  doglegGCell, unsigned int  flags = 0)[virtual]
See also:   AutoSegment::canDogleg(). At kite level, this variant of the method is mainly targeted to global segment. For local segment it behave like TrackElement::canDogleg(Interval). For global segment, make the break in the requested GCell doglegGCell . If it's in the first or last GCell and there is already a dogleg, allow to reuse it if flags  contains Kite::KtAllowDoglegReuse. 
Reimplemented in TrackSegment (p.pagenum).
unsigned long getId () const[virtual]

Returns:
The Id  of the supporting AutoSegment, if there is any. Zero  otherwise. 
Reimplemented in TrackSegment (p.pagenum), and TrackFixedSegment (p.pagenum).
Referenced by RoutingEvent::process().
unsigned int getDirection () const[pure virtual]

Returns:
The direction of the supporting element (should match the preferred direction of the Track). 
Implemented in TrackSegment (p.pagenum), and TrackFixedSegment (p.pagenum).
Referenced by TrackElement::getBoundingBox(), TrackSegment::getSourceDogleg(), TrackSegment::getTargetDogleg(), Manipulator::makeDogleg(), Manipulator::minimize(), Manipulator::relax(), and Manipulator::ripple().
Net * getNet () const[pure virtual]
Returns:  The Net associated to the element (may be NULL ). 
Implemented in TrackSegment (p.pagenum), and TrackFixedSegment (p.pagenum).
Referenced by SegmentFsm::conflictSolveByHistory(), SegmentFsm::conflictSolveByPlaceds(), SegmentFsm::desaturate(), SegmentAction::doAction(), Manipulator::forceOverLocals(), Manipulator::forceToTrack(), TrackElement::getFreeInterval(), TrackElement::getNext(), Track::getOverlapCost(), TrackElement::getPrevious(), TrackElement::incOverlapCost(), Manipulator::insertInTrack(), Manipulator::makeDogleg(), Manipulator::minimize(), RoutingEvent::process(), RoutingEvent::revalidate(), Manipulator::ripple(), Manipulator::ripupPerpandiculars(), SegmentFsm::SegmentFsm(), Manipulator::shrinkToTrack(), SegmentFsm::slackenTopology(), and SegmentFsm::solveFullBlockages().
const Layer * getLayer () const[pure virtual]
Returns:  The Layer of the element (should match the one of the Track). 
Implemented in TrackSegment (p.pagenum), and TrackFixedSegment (p.pagenum).
Referenced by SegmentFsm::conflictSolveByHistory(), SegmentFsm::conflictSolveByPlaceds(), Track::insert(), Manipulator::relax(), RoutingEvent::revalidate(), Manipulator::ripple(), Manipulator::ripupPerpandiculars(), and SegmentFsm::SegmentFsm().
Track * getTrack () const[inline]
Returns:  The Track into which the element is inserted (may be NULL ). 
Referenced by RoutingEventQueue::add(), SegmentAction::doAction(), TrackFixedSegment::getAxis(), TrackFixedSegment::getDirection(), DataNegociate::getTrack(), Manipulator::isCaged(), TrackFixedSegment::isHorizontal(), TrackFixedSegment::isVertical(), Manipulator::relax(), and TrackSegment::swapTrack().
size_t getIndex () const[inline]
Returns:  The index of the element inside the Track's vector.
Remark: If the element is not inserted in a Track, it is set to
Track::npos, and obviously must not be used. 
Referenced by TrackSegment::swapTrack().
unsigned long getFreedomDegree () const[virtual]
Returns:  The degree of freedom of the element. It is used as a priority value when sorting TrackElement (in RoutingEvent).
Returns:  The degree of freedom of the element. It is used as a priority value when sorting TrackElement (in RoutingEvent).
Currently, it is the slack  of the Katabatic::AutoSegment. 
Reimplemented in TrackSegment (p.pagenum).
Referenced by RoutingEvent::process().
float getMaxUnderDensity (unsigned int  flags = 0) const[virtual]
Returns:  The maximum density of all the GCells under this element. 
Reimplemented in TrackSegment (p.pagenum).
Box getBoundingBox () const[inline]
Returns:  The box that this element uses in the Track. 
TrackElement * getNext () const[virtual]
Returns:  The next TrackElement, on the same track and of a different  net. See also:   Track::getNext(). 
Reimplemented in TrackSegment (p.pagenum), and TrackFixedSegment (p.pagenum).
Referenced by Manipulator::isCaged().
TrackElement * getPrevious () const[virtual]
Returns:  The previous TrackElement, on the same track and of a different  net. See also:   Track::getPrevious(). 
Reimplemented in TrackSegment (p.pagenum), and TrackFixedSegment (p.pagenum).
Referenced by Manipulator::isCaged().
DbU::Unit getAxis () const[pure virtual]
Returns:  The axis position of the element (must be the same as the Track). 
Implemented in TrackSegment (p.pagenum), and TrackFixedSegment (p.pagenum).
Referenced by SegmentFsm::conflictSolveByHistory(), TrackElement::getBoundingBox(), Manipulator::ripple(), and Manipulator::ripupPerpandiculars().
DbU::Unit getSourceU () const[inline]
Returns:  The minimun of the interval used by the element (cached in an attribute). 
Referenced by TrackSegment::_check(), SegmentFsm::conflictSolveByHistory(), Track::find(), TrackElement::getBoundingBox(), TrackElement::getCanonicalInterval(), TrackElement::getLength(), Manipulator::insertInTrack(), Manipulator::isCaged(), Manipulator::minimize(), and Manipulator::shrinkToTrack().
DbU::Unit getTargetU () const[inline]
Returns:  The maximum of the interval used by the element (cached in an attribute). 
Referenced by TrackSegment::_check(), TrackElement::getBoundingBox(), TrackElement::getCanonicalInterval(), TrackElement::getLength(), Manipulator::insertInTrack(), and Manipulator::isCaged().
DbU::Unit getLength () const[inline]
Returns:  The length of the interval used by the element. 
Referenced by NegociateWindow::computeWirelength(), Manipulator::makeDogleg(), Manipulator::moveUp(), and RoutingEvent::revalidate().
Interval getCanonicalInterval () const[inline]
Returns:  The interval span used by the element inside the Track. 
Referenced by SegmentFsm::conflictSolveByHistory(), SegmentFsm::conflictSolveByPlaceds(), SegmentFsm::desaturate(), Manipulator::forceOverLocals(), Manipulator::forceToTrack(), Track::getOverlapCost(), Manipulator::insertInTrack(), Manipulator::makeDogleg(), Manipulator::minimize(), Manipulator::relax(), Manipulator::ripple(), Manipulator::ripupPerpandiculars(), Manipulator::shrinkToTrack(), and SegmentFsm::solveFullBlockages().
Interval getFreeInterval () const[virtual]
Returns:  The greatest free interval enclosing this element. 
Reimplemented in TrackSegment (p.pagenum), and TrackFixedSegment (p.pagenum).
Interval getSourceConstraints () const[virtual]
See also:   Katabatic::AutoSegment::getSourceConstraints(). 
Reimplemented in TrackSegment (p.pagenum).
Interval getTargetConstraints () const[virtual]
See also:   Katabatic::AutoSegment::getTargetConstraints(). 
Reimplemented in TrackSegment (p.pagenum).
DataNegociate * getDataNegociate (unsigned int  flags = KtDataSelf) const[virtual]
Returns:  The additional data-structure supplied by the routing algorithm. 
Reimplemented in TrackSegment (p.pagenum).
Referenced by NegociateWindow::addRoutingEvent(), SegmentFsm::desaturate(), SegmentAction::doAction(), Manipulator::forceOverLocals(), Manipulator::forceToTrack(), TrackSegment::getDataNegociate(), RoutingEvent::getState(), Manipulator::insertInTrack(), Manipulator::makeDogleg(), RoutingEvent::process(), Manipulator::relax(), Manipulator::repackPerpandiculars(), RoutingEvent::reschedule(), Manipulator::ripple(), SegmentFsm::SegmentFsm(), NegociateWindow::setGCells(), RoutingEvent::setSegment(), RoutingEvent::setState(), and SegmentFsm::slackenTopology().
TrackElement * getCanonical (Interval &  i)[virtual]
Inner working still unclear to myself. 
Reimplemented in TrackSegment (p.pagenum).
Referenced by NegociateWindow::createTrackSegment(), and DataNegociate::update().
size_t getGCells (Katabatic::GCellVector &  gcells) const[virtual]
Returns:  The table of Katabatic::GCell underneath the element whole span. 
Reimplemented in TrackSegment (p.pagenum).
Referenced by Manipulator::makeDogleg(), and Manipulator::relax().
TrackElement * getParent () const[virtual]
Returns:  The TrackElement from which the dogleg has been created, if any. 
Reimplemented in TrackSegment (p.pagenum).
Referenced by RoutingEvent::setAxisHintFromParent().
unsigned int getDoglegLevel () const[virtual]
Returns:  The deepness of the dogleg. 
Reimplemented in TrackSegment (p.pagenum).
TrackElement * getSourceDogleg ()[virtual]
Returns:  The source part of the segment from which the dogleg has been created. 
Reimplemented in TrackSegment (p.pagenum).
Referenced by Manipulator::relax().
TrackElement * getTargetDogleg ()[virtual]
Returns:  The target part of the segment from which the dogleg has been created. 
Reimplemented in TrackSegment (p.pagenum).
Referenced by Manipulator::relax().
TrackElements getPerpandiculars ()[virtual]
Returns:  The collection of all element perpandiculars to this one. 
Reimplemented in TrackSegment (p.pagenum).
Referenced by Manipulator::forceToTrack(), and Manipulator::insertInTrack().
void setFlags (unsigned int  flags)[inline]
Set to true  flags  in the element state array. 
Referenced by TrackSegment::detach(), TrackSegment::invalidate(), and Manipulator::relax().
void unsetFlags (unsigned int  flags)[inline]
Reset to false  flags  in the element state array. 
Referenced by TrackSegment::revalidate().
void setTrack (Track *  track)[virtual]
Insert the element into track , also used as an insertion marker. 
Reimplemented in TrackSegment (p.pagenum).
Referenced by Track::insert(), and TrackSegment::setTrack().
void setIndex (size_t  index)[inline]
Cache the element's index in the Track internal vector. 
Referenced by TrackSegment::detach(), and TrackSegment::swapTrack().
void updateFreedomDegree ()[virtual]
Update, from the element characteristics, it's degree of freedom. 
Reimplemented in TrackSegment (p.pagenum).
void setDoglegLevel (unsigned int  level)[virtual]
Sets the level of dogleg of the element. 
Reimplemented in TrackSegment (p.pagenum).
void swapTrack (TrackElement *  other)[virtual]
Swap the tracks of this  and other . 
Reimplemented in TrackSegment (p.pagenum).
void reschedule (unsigned int  level)[virtual]
If the TrackElement has already an event scheduled, change the level of this event, otherwise create a new event.
See also:   NegotiateWindow::rescheduleEvent(). 
Reimplemented in TrackSegment (p.pagenum).
Referenced by TrackSegment::_postDoglegs().
void detach ()[virtual]
Remove the link from the TrackElement to it's owning Track, marking it for removal. The removal from the Track's vector is managed by the Track itself during the Session revalidation stage. 
Reimplemented in TrackSegment (p.pagenum).
void invalidate ()[virtual]
See also:   AutoSegment::invalidate(). 
Reimplemented in TrackSegment (p.pagenum).
Referenced by NegociateWindow::createTrackSegment(), and SegmentObserver::notify().
void revalidate ()[virtual]
Actualize the TrackElement characteristics from the supporting elements (set of AutoSegment).
Must be completed with the event management 
Reimplemented in TrackSegment (p.pagenum).
void incOverlapCost (Net *  net, TrackCost &  cost) const[virtual]
See also:   Compute the cost of overlap between this segment and the interval specified in cost . Mainly calls the relevant callback. 
void setAxis (DbU::Unit , unsigned int  flags = Katabatic::SegAxisSet)[virtual]
Sets the axis of the TrackElement. 
Reimplemented in TrackSegment (p.pagenum).
Referenced by NegociateWindow::createTrackSegment(), SegmentAction::doAction(), Track::insert(), TrackSegment::makeDogleg(), and Manipulator::relax().
TrackElement * makeDogleg ()[virtual]
Create a dogleg on the source end of the TrackSegment. Put the dogleg axis on the source To be further reviewed .
See also:   Dogleg management.
Post-processing done by TrackSegment::_postDoglegs(). 
Reimplemented in TrackSegment (p.pagenum).
Referenced by SegmentFsm::conflictSolveByHistory(), Manipulator::makeDogleg(), TrackElement::makeDogleg(), and Manipulator::relax().
TrackElement * makeDogleg (Katabatic::GCell *  gcell)[inline]
See also:   AutoSegment::makeDogleg(), Dogleg management.
Post-processing done by TrackSegment::_postDoglegs(). 
TrackElement * makeDogleg (Interval  interval, unsigned int &  flags)[virtual]
See also:   AutoSegment::makeDogleg(), Dogleg management, the return flags from this method are returned through the flags  variable.
Post-processing done by TrackSegment::_postDoglegs(). 
Reimplemented in TrackSegment (p.pagenum).
bool _check () const[virtual]
Check the coherency of the element. For a TrackSegment:
The supporting AutoSegment the canonical one of the set.
The cached min  & max  values are identical to the computed ones.
Returns:  true  on success. 
Reimplemented in TrackSegment (p.pagenum).

The documentation for this class was generated from the following files:
TrackElement.h
TrackElement.cpp
TrackElement.dox
TrackSegment.dox

TrackFixedSegment Class Reference

Track elements for fixed wires. 
Inheritance diagram for TrackFixedSegment:
IMAGE

Public Member Functions
virtual bool isHorizontal () const
virtual bool isVertical () const
virtual bool isFixed () const
virtual unsigned long getId () const
virtual unsigned int getDirection () const
virtual Net * getNet () const
virtual const Layer * getLayer () const
virtual TrackElement * getNext () const
virtual TrackElement * getPrevious () const
virtual DbU::Unit getAxis () const
virtual Interval getFreeInterval () const
Static Public Member Functions
static TrackElement * create (Kite::Track *track, Segment *segment)

Detailed Description
Track elements for fixed wires. 
A TrackFixedSegment is a segment that cannot be moved from the track. It can be associated to a true blockage Segment (recognised by the fact that their owner net is the blockage  net), or to a segment from an ordinary net but which is locked into position. In the latter case, the owned net may reuse this portion of the track if it needs it.
In all cases, the blockage ratio of the GCells underneath the segment are updated. 

Member Function Documentation
TrackSegment * create (Kite::Track *  track, Segment *  segment)[static]

Parameters:
segment 	The Hurricane Segment (blockage) to take into account. 	
track 	A Track into which insert the TrackFixedSegment. 	
Returns:
A TrackFixedSegment wrapped around a blockage Segment.
Public constructor to insert blockage inside a Track. 
bool isHorizontal () const[virtual]
See also:   Katabatic::AutoSegment::isHorizontal(). 
Implements TrackElement (p.pagenum).
bool isVertical () const[virtual]
See also:   Katabatic::AutoSegment::isVertical(). 
Implements TrackElement (p.pagenum).
bool isFixed () const[virtual]
See also:   Katabatic::AutoSegment::isFixed(). 
Reimplemented from TrackElement (p.pagenum).
unsigned long getId () const[virtual]

Returns:
The Id  of the supporting AutoSegment, if there is any. Zero  otherwise. 
Reimplemented from TrackElement (p.pagenum).
unsigned int getDirection () const[virtual]

Returns:
The direction of the supporting element (should match the preferred direction of the Track). 
Implements TrackElement (p.pagenum).
Net * getNet () const[virtual]
Returns:  The Net associated to the element (may be NULL ). 
Implements TrackElement (p.pagenum).
Referenced by TrackFixedSegment::getNext(), and TrackFixedSegment::getPrevious().
const Layer * getLayer () const[virtual]
Returns:  The Layer of the element (should match the one of the Track). 
Implements TrackElement (p.pagenum).
TrackElement * getNext () const[virtual]
Returns:  The next TrackElement, on the same track and of a different  net. See also:   Track::getNext(). 
Reimplemented from TrackElement (p.pagenum).
TrackElement * getPrevious () const[virtual]
Returns:  The previous TrackElement, on the same track and of a different  net. See also:   Track::getPrevious(). 
Reimplemented from TrackElement (p.pagenum).
DbU::Unit getAxis () const[virtual]
Returns:  The axis position of the element (must be the same as the Track). 
Implements TrackElement (p.pagenum).
Interval getFreeInterval () const[virtual]
Returns:  The greatest free interval enclosing this element. 
Reimplemented from TrackElement (p.pagenum).

The documentation for this class was generated from the following files:
TrackFixedSegment.h
TrackFixedSegment.cpp
TrackFixedSegment.dox

TrackMarker Class Reference

Tag part of Track with a weight. 
Public Member Functions
Net * getNet () const
DbU::Unit getSourceU () const
DbU::Unit getTargetU () const
Track * getTrack () const
unsigned int getWeight (const Track *) const
void setTrack (Track *)
Static Public Member Functions
static TrackMarker * create (RoutingPad *, size_t depth)

Detailed Description
Tag part of Track with a weight. 
TrackMarkers are used to assign a cost on a span of Track telling how strongly a terminal is dependant on that Track to be accessed. The more Track a terminal crosses, the less the weight is.
The weight is expressed in hundreth (can also be understood as percentage) of dependency over the Track. As example, if a terminal can only be accessed trough one Track is weight on it will be 100 . 

Member Function Documentation
create (RoutingPad *  rp, size_t  depth)[static]

Parameters:
rp 	The RoutingPad to be accessed. 	
depth 	Select the layer depth by which we want to access the RoutingPad. 	
Returns:
The newly created TrackMarker.
This constructor automatically take care of inserting the TrackMarker in the relevant Tracks, so it must be called during a Session. 
Net * getNet () const
Returns:  The net of the RoutingPad. 
DbU::Unit getSourceU () const[inline]
Returns:  The span minimum bound. 
DbU::Unit getTargetU () const[inline]
Returns:  The span maximum bound. 
Track * getTrack () const[inline]
Returns:  The Track into which the marker is inserted. 
unsigned int getWeight (const Track *  track) const[inline]
Returns:  The associated weight, for now the Track argument is ignored. 
void setTrack (Track *  track)[inline]
Sets the owning Track. 

The documentation for this class was generated from the following files:
TrackMarker.h
TrackMarker.cpp
TrackMarker.dox

TrackSegment Class Reference

Derived Katabatic::AutoSegment for the router. 
Inheritance diagram for TrackSegment:
IMAGE

Public Member Functions
virtual bool isFixed () const
virtual bool isHorizontal () const
virtual bool isVertical () const
virtual bool isLocal () const
virtual bool isGlobal () const
virtual bool isBipoint () const
virtual bool isTerminal () const
virtual bool isStrap () const
virtual bool isSlackened () const
virtual bool isDogleg () const
virtual bool canDogleg ()
virtual bool canDogleg (Interval)
virtual bool canDogleg (Katabatic::GCell *, unsigned int flags=0)
virtual float getMaxUnderDensity (unsigned int flags) const
virtual unsigned long getId () const
virtual unsigned int getDirection () const
virtual Net * getNet () const
virtual const Layer * getLayer () const
virtual unsigned long getFreedomDegree () const
virtual unsigned int getDoglegLevel () const
virtual TrackElement * getNext () const
virtual TrackElement * getPrevious () const
virtual TrackElement * getParent () const
virtual DbU::Unit getAxis () const
virtual Interval getFreeInterval () const
virtual Interval getSourceConstraints () const
virtual Interval getTargetConstraints () const
virtual DataNegociate * getDataNegociate (unsigned int flags=KtDataSelf) const
virtual TrackElement * getCanonical (Interval &)
virtual size_t getGCells (Katabatic::GCellVector &) const
virtual TrackElement * getSourceDogleg ()
virtual TrackElement * getTargetDogleg ()
virtual TrackElements getPerpandiculars ()
virtual void setTrack (Track *)
virtual void updateFreedomDegree ()
virtual void setDoglegLevel (unsigned int)
virtual void swapTrack (TrackElement *)
virtual void reschedule (unsigned int level)
virtual void detach ()
virtual void invalidate ()
virtual void revalidate ()
virtual void setAxis (DbU::Unit, unsigned int flags)
virtual TrackElement * makeDogleg ()
virtual TrackElement * makeDogleg (Interval, unsigned int &flags)
virtual void _postDoglegs (TrackElement *&perpandicular, TrackElement *&parallel)
virtual bool _check () const
Static Public Member Functions
static TrackElement * create (AutoSegment *, Track *, bool &created)

Detailed Description
Derived Katabatic::AutoSegment for the router. 
 We create one TrackSegment per aligned Katabatic::AutoSegment set, the TrackSegment is associated to the canonical one of the set.
To provide some speedup, the full extention of the aligned segment set is computed once and stored in the TrackSegment itself. The drawback beeing that whenever one segment from the aligned set has it's extention modified, the full extention must be recomputed.
Lazy Revalidate
When the TrackSegment::revalidate() method is called, it only update the cached size of the segment (from the AutoSegment set of aligneds) and the track into which it may be inserted.
The associated DataNegociate and RoutingEvent are not  updated.
The RoutingEvent will be updated when it's key is updated, typically during a requeueing operation and  in the SegmentFsm constructor. This should be optimized in the future.
The DataNegociate is updated only  in the SegmentFsm constructor. This is the most costly of the two updates as it perform a perpandicular & parallel connexity exploration.

Dogleg Management
The basic AutoSegment::canDogleg() method is declined in three more dedicated methods in this class:
TrackSegment::canDogleg(), for locals only, check if a break is possible, never break a segment more than once (to avoid fragmentation).
TrackSegment::canDogleg(Katabatic::GCell*,unsigned int flags) for globals, check that the segment is breakable in the desired GCell. Never break twice in the first/last GCell (fragmentation limitation), but may reuse  an already existing dogleg.
TrackSegment::canDogleg(Interval), for locals only, direct proxy for the AutoSegment method. Never allow more than one break.
Relationship between AutoSegment and TrackSegment 
Figure 2 below, shows an example of dogleg creation:
At the Katabatic level, AutoSegment id:12  is broken. Thus the creation of AutoSegments id:20  and id:21 . The orignal TrackSegment (canonical AutoSegment id:10 ) remains on the right side (target) of the break.
But, because the canonical of the former aligned AutoSegment set  (10,11,12,13,14) was on the right  side of the break, the new parallel TrackSegment will be created on the left  side, associated to the newly promoted canonical AutoSegment id:12 .
 The TrackSegment::_postDoglegs() method called by all flavors of TrackSegment::makeDogleg() methods is responsible for creating new TrackSegments for the new doglegs (there may be more than one), it also update the dogleg level and source/target dogleg flags.
This section is not finished.  I need to review the parent and doglevel numbering management. There seems to be a risk of infinite fragmentation as the numbering of the original segment is not increased, we should create a break  counter separate from deepness.
Global, Weak Global and Local Segments
There's a slight semantic change between Katabatic and Kite about what is local and what is local. This is due to how we consider the intermediate status of WeakGlobal .
A WeakGlobal  segment is a local segment which is aligned with a global (though a VTee or an HTee contact).
In Katabatic a local segment is one that is not Global , a local segment can be both Local  and WeakGlobal .
In Kite a local segment is one that is neither Global  or WeakGlobal . The WeakGlobal  sides with Global  unlike in Katabatic. 

Member Function Documentation
static TrackSegment * create (AutoSegment *  segment, Track *  track, bool &  created)[static]

Parameters:
segment 	The Katabatic AutoSegment to decorate. 	
track 	A Track into which insert the TrackSegment (may be NULL ). 	
created 	This flag is sets is a new TrackSegment has be created. 	
Returns:
A TrackSegment wrapped around an AutoSegment.
Constructor mainly used at loading time to decorate the Katabatic data-base with the router attributes. 
Referenced by NegociateWindow::createTrackSegment().
bool isFixed () const[virtual]
See also:   Katabatic::AutoSegment::isFixed(). 
Reimplemented from TrackElement (p.pagenum).
Referenced by TrackSegment::canDogleg().
bool isHorizontal () const[virtual]
See also:   Katabatic::AutoSegment::isHorizontal(). 
Implements TrackElement (p.pagenum).
Referenced by TrackSegment::getGCells().
bool isVertical () const[virtual]
See also:   Katabatic::AutoSegment::isVertical(). 
Implements TrackElement (p.pagenum).
bool isLocal () const[virtual]
See also:   Katabatic::isLocal(). 
Reimplemented from TrackElement (p.pagenum).
Referenced by TrackSegment::_postDoglegs(), and TrackSegment::canDogleg().
bool isGlobal () const[virtual]
See also:   Katabatic::AutoSegment::isGlobal(). 
Reimplemented from TrackElement (p.pagenum).
bool isBipoint () const[virtual]
See also:   Katabatic::AutoSegment::isBipoint(). 
Reimplemented from TrackElement (p.pagenum).
bool isTerminal () const[virtual]
See also:   Katabatic::AutoSegment::isTerminal(). 
Reimplemented from TrackElement (p.pagenum).
bool isStrap () const[virtual]
See also:   Katabatic::AutoSegment::isStrap(). 
Reimplemented from TrackElement (p.pagenum).
bool isSlackened () const[virtual]
See also:   Katabatic::AutoSegment::isSlackened(). 
Reimplemented from TrackElement (p.pagenum).
Referenced by TrackSegment::canDogleg().
bool isDogleg () const[virtual]
See also:   Katabatic::isDogleg(). 
Reimplemented from TrackElement (p.pagenum).
bool canDogleg ()[virtual]
See also:   AutoSegment::canDogleg(). At Kite level, this variant of the method will apply only on local segments and the segment must not already have a source or target dogleg. 
Reimplemented from TrackElement (p.pagenum).
bool canDogleg (Interval )[virtual]
See also:   AutoSegment::canDogleg(). At Kite level, this variant of the method will apply only on local segments and the segment must not already have a source or target dogleg. 
Reimplemented from TrackElement (p.pagenum).
bool canDogleg (Katabatic::GCell *  doglegGCell, unsigned int  flags = 0)[virtual]
See also:   AutoSegment::canDogleg(). At kite level, this variant of the method is mainly targeted to global segment. For local segment it behave like TrackElement::canDogleg(Interval). For global segment, make the break in the requested GCell doglegGCell . If it's in the first or last GCell and there is already a dogleg, allow to reuse it if flags  contains Kite::KtAllowDoglegReuse. 
Reimplemented from TrackElement (p.pagenum).
float getMaxUnderDensity (unsigned int  flags) const[virtual]
Returns:  The maximum density of all the GCells under this element. 
Reimplemented from TrackElement (p.pagenum).
unsigned long getId () const[virtual]

Returns:
The Id  of the supporting AutoSegment, if there is any. Zero  otherwise. 
Reimplemented from TrackElement (p.pagenum).
Referenced by TrackSegment::detach().
unsigned int getDirection () const[virtual]

Returns:
The direction of the supporting element (should match the preferred direction of the Track). 
Implements TrackElement (p.pagenum).
Referenced by TrackSegment::getSourceDogleg(), and TrackSegment::getTargetDogleg().
Net * getNet () const[virtual]
Returns:  The Net associated to the element (may be NULL ). 
Implements TrackElement (p.pagenum).
Referenced by TrackSegment::getFreeInterval(), TrackSegment::getNext(), and TrackSegment::getPrevious().
const Layer * getLayer () const[virtual]
Returns:  The Layer of the element (should match the one of the Track). 
Implements TrackElement (p.pagenum).
unsigned long getFreedomDegree () const[virtual]
Returns:  The degree of freedom of the element. It is used as a priority value when sorting TrackElement (in RoutingEvent).
Returns:  The degree of freedom of the element. It is used as a priority value when sorting TrackElement (in RoutingEvent).
Currently, it is the slack  of the Katabatic::AutoSegment. 
Reimplemented from TrackElement (p.pagenum).
unsigned int getDoglegLevel () const[virtual]
Returns:  The deepness of the dogleg. 
Reimplemented from TrackElement (p.pagenum).
Referenced by TrackSegment::canDogleg().
TrackElement * getNext () const[virtual]
Returns:  The next TrackElement, on the same track and of a different  net. See also:   Track::getNext(). 
Reimplemented from TrackElement (p.pagenum).
TrackElement * getPrevious () const[virtual]
Returns:  The previous TrackElement, on the same track and of a different  net. See also:   Track::getPrevious(). 
Reimplemented from TrackElement (p.pagenum).
TrackElement * getParent () const[virtual]
Returns:  The TrackElement from which the dogleg has been created, if any. 
Reimplemented from TrackElement (p.pagenum).
Referenced by TrackSegment::getDataNegociate().
DbU::Unit getAxis () const[virtual]
Returns:  The axis position of the element (must be the same as the Track). 
Implements TrackElement (p.pagenum).
Interval getFreeInterval () const[virtual]
Returns:  The greatest free interval enclosing this element. 
Reimplemented from TrackElement (p.pagenum).
Interval getSourceConstraints () const[virtual]
See also:   Katabatic::AutoSegment::getSourceConstraints(). 
Reimplemented from TrackElement (p.pagenum).
Interval getTargetConstraints () const[virtual]
See also:   Katabatic::AutoSegment::getTargetConstraints(). 
Reimplemented from TrackElement (p.pagenum).
DataNegociate * getDataNegociate (unsigned int  flags = KtDataSelf) const[virtual]
Returns:  The additional data-structure supplied by the routing algorithm. 
Reimplemented from TrackElement (p.pagenum).
Referenced by TrackSegment::_postDoglegs(), and TrackSegment::swapTrack().
TrackElement * getCanonical (Interval &  i)[virtual]
Inner working still unclear to myself. 
Reimplemented from TrackElement (p.pagenum).
size_t getGCells (Katabatic::GCellVector &  gcells) const[virtual]
Returns:  The table of Katabatic::GCell underneath the element whole span. 
Reimplemented from TrackElement (p.pagenum).
Referenced by TrackSegment::canDogleg().
TrackElement * getSourceDogleg ()[virtual]
Returns:  The source part of the segment from which the dogleg has been created. 
Reimplemented from TrackElement (p.pagenum).
TrackElement * getTargetDogleg ()[virtual]
Returns:  The target part of the segment from which the dogleg has been created. 
Reimplemented from TrackElement (p.pagenum).
TrackElements getPerpandiculars ()[virtual]
Returns:  The collection of all element perpandiculars to this one. 
Reimplemented from TrackElement (p.pagenum).
void setTrack (Track *  track)[virtual]
Insert the element into track , also used as an insertion marker. 
Reimplemented from TrackElement (p.pagenum).
Referenced by TrackSegment::detach(), and TrackSegment::swapTrack().
void updateFreedomDegree ()[virtual]
Update, from the element characteristics, it's degree of freedom. 
Reimplemented from TrackElement (p.pagenum).
void setDoglegLevel (unsigned int  level)[virtual]
Sets the level of dogleg of the element. 
Reimplemented from TrackElement (p.pagenum).
void swapTrack (TrackElement *  other)[virtual]
Swap the tracks of this  and other . 
Reimplemented from TrackElement (p.pagenum).
void reschedule (unsigned int  level)[virtual]
If the TrackElement has already an event scheduled, change the level of this event, otherwise create a new event.
See also:   NegotiateWindow::rescheduleEvent(). 
Reimplemented from TrackElement (p.pagenum).
Referenced by TrackSegment::_postDoglegs().
void detach ()[virtual]
Remove the link from the TrackElement to it's owning Track, marking it for removal. The removal from the Track's vector is managed by the Track itself during the Session revalidation stage. 
Reimplemented from TrackElement (p.pagenum).
void invalidate ()[virtual]
See also:   AutoSegment::invalidate(). 
Reimplemented from TrackElement (p.pagenum).
Referenced by TrackSegment::create(), and TrackSegment::setAxis().
void revalidate ()[virtual]
Actualize the TrackSegment characteristics from the supporting elements (set of AutoSegment).
This method do not update the DataNegociate or the RoutingEvent. This is a lazy update delayed until the constructor of SegmentFsm is called. (see Lazy Revalidate). 
Reimplemented from TrackElement (p.pagenum).
void setAxis (DbU::Unit , unsigned int  flags)[virtual]
Sets the axis of the TrackElement. 
Reimplemented from TrackElement (p.pagenum).
TrackElement * makeDogleg ()[virtual]
Create a dogleg on the source end of the TrackSegment. Put the dogleg axis on the source To be further reviewed .
See also:   Dogleg management.
Post-processing done by TrackSegment::_postDoglegs(). 
Reimplemented from TrackElement (p.pagenum).
TrackElement * makeDogleg (Interval  interval, unsigned int &  flags)[virtual]
See also:   AutoSegment::makeDogleg(), Dogleg management, the return flags from this method are returned through the flags  variable.
Post-processing done by TrackSegment::_postDoglegs(). 
Reimplemented from TrackElement (p.pagenum).
TrackSegment * _postDoglegs (TrackElement *&  perpandicular, TrackElement *&  parallel)[virtual]
Post-process to be called inside the various dogleg creation or slacken methods. Iterate through the newly created AutoSegments to create, for the perpandicular  and the new parallel  associateds TrackSegments. Also sets the dogleg levels and flags of the newly created elements.
The session dogleg reset is called at the end of this method. The perpandicular  and parallel  references to pointers contains the newly created segments for the last  dogleg. If more than one was created, you cannot access them (the need has not arised yet). 
Reimplemented from TrackElement (p.pagenum).
Referenced by TrackSegment::makeDogleg().
bool _check () const[virtual]
Check the coherency of the element. For a TrackSegment:
The supporting AutoSegment the canonical one of the set.
The cached min  & max  values are identical to the computed ones.
Returns:  true  on success. 
Reimplemented from TrackElement (p.pagenum).

The documentation for this class was generated from the following files:
TrackSegment.h
TrackSegment.cpp
TrackSegment.dox

VerticalTrack Class Reference

Vertical track managment. 
Inheritance diagram for VerticalTrack:
IMAGE

Public Member Functions
virtual bool isHorizontal () const
virtual bool isVertical () const
virtual unsigned int getDirection () const
virtual Point getPosition (DbU::Unit coordinate) const
Additional Inherited Members

Detailed Description
Vertical track managment. 

Member Function Documentation
bool isHorizontal () const[virtual]
Returns:  true  if the Track in horizontal direction. 
Implements Track (p.pagenum).
bool isVertical () const[virtual]
Returns:  false .
Returns:  true . 
Implements Track (p.pagenum).
unsigned int getDirection () const[virtual]
Returns:  Katabatic::KbVertical. 
Implements Track (p.pagenum).
Point getPosition (DbU::Unit  position) const[virtual]
Returns:  the point at  (getAxis(),position). 
Implements Track (p.pagenum).

The documentation for this class was generated from the following files:
VerticalTrack.h
VerticalTrack.cpp
VerticalTrack.dox

Index
INDEX