\fBAutoSegment\fP is the abstract base class for \fBAutoHorizontal\fP and \fBAutoVertical\fP\&. They are must be created only through the factory method: \fBAutoSegment::create()\fP\&.
.SH"Characteristics of AutoSegments"
.PP
.PD0
.IP"\(bu"2
Unique ID: to ease the enforcing of a deterministic behavior and to gain some independance from the pointers, each \fBAutoSegment\fP is associated with an unique identifier\&. \fBIDs\fP are now directly taken from the \fBHurricane::Segment\fP\&.
.IP"\(bu"2
Source contact is always lesser than Target contact \fC(Xs,Ys) < (Xt,Yt)\fP\&.
.IP"\(bu"2
When assembled through \fBAutoContactVTee\fP or \fBAutoContactHTee\fP, AutoSegments became (i\&.e\&. must be kept) aligneds\&. Among a set of aligned AutoSegments, we distinguish a representative trough which we can manipulate the whole set\&. This representative is called the \fIcanonical\fP\fBAutoSegment\fP and is the one with the lowest \fCid\fP)\&.
.IP"\(bu"2
When an aligned set contains at least one global, all the segments of the set are tagged \fBKatabatic::SegWeakGlobal\fP\&. This is especially useful on local ones to know if they are part of a much longer wire\&.
.PP
Conversely, a set of aligned may contains only local segments and thus will not have the flag set\&.
.IP"\(bu"2
To allow some optimization, the \fBKatabatic::SegNotAligned\fP tells if a segment is part of an aligned set\&. It is deduced from the type of both source and target contact: not on the parallel branch of a tee\&.
.PP
.PP
\fBThe Ever Fragmenting Data Structure\fP
.PP
All the transformations applied to the database, after it's initial building, can be reduced to making new doglegs (and layer changes)\&. Another way to put it, is that no Tee is ever created after the initial stage\&. The consequence is that the segments are only fragmenting more and more (up to a certain limit)\&. The aligneds sets are progessively broken apart as needed, and until there remains only one tee per set (the two segments on the aligned branch)\&.
.SH"Operations on AutoSegments"
.PP
.PD0
.IP"\(bu"2
\fBSlackening\&.\fP Constraints transmited through either source or target \fBAutoContact\fP are too tight (tighter than the \fBGCell\fP), by adding straps in the perpandicular direction, the full slack of the segment is restored\&.
.IP"\(bu"2
\fBLayer Change\&.\fP One or two layers above or below the current layer\&. One up/down may means into the perpandicular routing direction\&.
.IP"\(bu"2
\fBDogleg Creation\&.\fP Mean breaking the segment in two\&. This operation is used to slacken the constraints on a segment or restore connexity on source/target contact after a layer change\&. The new segment is always created on the source\&.
.IP"\(bu"2
\fBReduction/Raising\&.\fP When a segment is a short dogleg, no greater than one picth, it can use the layer of the perpandiculars\&.
.PP
.SH"Invalidate on AutoSegments"
.PP
The simple invalidation of an \fBAutoSegment\fP\fBdo not\fP invalidate it's source & target contact\&.
.PP
An axis position change or a layer change both invalidate the \fBAutoSegment\fP\fBand\fP it's source & target contacts\&.
.PP
For the complete invalidation/revalidation mechanism see \fBSession Algorithm\fP\&.
.SH"Main Attributes of AutoSegments"
.PP
\fBAutoSegment\fP retains all attributes from Segment\&. The Segment itself beeing accessible through the \fBbase()\fP methods\&.
.PD0
.IP"\(bu"2
An unique \fCId\fP (for determinism)\&.
.IP"\(bu"2
The \fBGCell\fP from wich it starts from\&. It is the \fBGCell\fP of the source \fBAutoContact\fP\&.
.IP"\(bu"2
A state, combination of flags from \fBKatabatic::AutoSegmentFlag\fP\&.
.IP"\(bu"2
An interval for the optimal range of the \fBAutoSegment\fP axis\&.
.IP"\(bu"2
An interval for user's defined constraint on the axis\&.
.IP"\(bu"2
The interval giving the complete length of the \fBAutoSegment\fP, that is, with all extentions cap taken into account\&. This interval is refered as the \fIspan\fP\&.
.IP"\(bu"2
A small counter, of the number of reduced neighbors (never exceed two)\&.
.PP
.SH"Implementation Details"
.PP
\fBAutoSegment\fP / \fBAutoHorizontal\fP & \fBAutoVertical\fP are kind of decorators of \fBHurricane::Segment\fP (they do not scrictly respect the pattern)\&.
.PP
Canonical \fBAutoSegment\fP can should be considered as a kind of Composite\&.
.PP
Thoses objects are created using a Factory method\&.
.SH"Methods Classification"
.PP
.PD0
.IP"\(bu"2
\fIWrapper methods\fP on the underlying \fBHurricane::Segment\fP\&.
.PP
.PD0
.IP"\(bu"2
\fIAtomic methods\fP on \fBAutoSegment\fP, that is, which applies exactly on the current \fBAutoSegment\fP\&.
.PP
.PD0
.IP"\(bu"2
\fICanonical methods\fP that applies on the set of aligned AutoSegments\&. There are two kind of those, the methods part of the API, and the ones that make the link with the atomic methods\&. Those intermediate methods hide some cumbersome \fBAutoSegment\fP list parameters\&.
.PD0
.IP" \(bu"4
\fBAutoSegment::invalidate()\fP
.IP" \(bu"4
\fBAutoSegment::computeOptimal()\fP
.IP" \(bu"4
\fBAutoSegment::setAxis()\fP
.IP" \(bu"4
\fBAutoSegment::toConstraintAxis()\fP
.IP" \(bu"4
\fBAutoSegment::toOptimalAxis()\fP
.PP
.PP
.PD0
.IP"\(bu"2
\fIUniform access\fP, to simplify the managment of \fBAutoHorizontal\fP and \fBAutoVertical\fP through \fBAutoSegment\fP, a set of uniformized methods is introduced\&. For instance, to avoid to check the dynamic type to choose to call \fBgetSourceX()\fP or \fBgetSourceY()\fP, we may call \fBgetSourceU()\fP\&. Uniform methods are named by replacing \fCX/Y\fP with \fCU\fP\&.
\fIhurricaneSegment\fP The \fBHurricane::Segment\fP to decorate\&.
.RE
.PP
\fBReturns:\fP
.RS4
The AutoHorizontal/AutoVertical decorator segment\&.
.RE
.PP
Factory method to create \fBAutoHorizontal\fP or \fBAutoVertical\fP\&. It is important to note that this function may modify the underlying \fBHurricane::Segment\fP\&.
.IP"\(bu"2
Layer is set to the default (bottom) routing Layers\&.
.IP"\(bu"2
Source & target anchor of \fChurricaneSegment\fP are set on \fCsource\fP and \fCtarget\fP\&. If the \fChurricaneSegment\fP is already anchored and \fCsource\fP or \fCtarget\fP are not the one decorating the anchors, an exception is thrown\&.
\fIdepth\fP The layer, given by it's depth in the RoutingGauge\&.
.RE
.PP
\fBReturns:\fP
.RS4
The AutoHorizontal/AutoVertical\&.
.RE
.PP
Factory method to create \fBAutoHorizontal\fP or \fBAutoVertical\fP\&. \fCflags\fP indicate the direction (KbHorizontal or KbVertical)\&. The underlying Hurricane segment is also created\&.
\fBReturns:\fP\fBtrue\fP if segment has been changed of layer\&. Source and Target \fBAutoContact\fP may need to be altered\&.
.PP
References Katabatic::SegInvalidatedLayer\&.
.PP
Referenced by AutoContactTurn::updateTopology()\&.
.SS"bool isCreated () const\fC [inline]\fP"
\fBReturns:\fP\fBtrue\fP if segment has just been created and is not revalidated for the first time
.PP
References Katabatic::SegCreated\&.
.PP
Referenced by AutoContactTerminal::updateGeometry()\&.
.SS"bool isCanonical () const\fC [inline]\fP"
\fBReturns:\fP\fBtrue\fP if segment is the representant of an aligned set\&.
.PP
References Katabatic::SegCanonical\&.
.PP
Referenced by AutoHorizontal::_makeDogleg(), AutoVertical::_makeDogleg(), AutoSegment::canonize(), AutoSegment::getCanonical(), AutoSegment::setAxis(), AutoSegment::toConstraintAxis(), and AutoSegment::toOptimalAxis()\&.
.SS"bool isUnsetAxis () const\fC [inline]\fP"
\fBReturns:\fP\fBtrue\fP if the segment axis has never been set\&.
.PP
References Katabatic::SegAxisSet\&.
.SS"bool isSlackened () const\fC [inline]\fP"
\fBReturns:\fP\fBtrue\fP if the segment has already been slackened\&.
.PP
References Katabatic::SegSlackened\&.
.PP
Referenced by AutoHorizontal::_makeDogleg(), and AutoVertical::_makeDogleg()\&.
\fBReturns:\fP\fBtrue\fP if the segment can be slackened\&. That is, source or target constraints are less than three pitches\&.
.PP
Implemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
.PP
Referenced by AutoSegment::canSlacken()\&.
.SS"bool canReduce () const"
\fBReturns:\fP\fBtrue\fP if the segment can be reduced\&. That is:
.IP"\(bu"2
Source & target are \fBAutoContactTurn\fP\&.
.IP"\(bu"2
It is either \fIspin top\fP or \fIspin bottom\fP, that is connecting perpandiculars both in the same layer\&.
.IP"\(bu"2
Has a length less or equal one pitch in the perpandicular direction\&.
.IP"\(bu"2
Neither of the perpandicular are also reduceds\&.
.PP
.PP
References AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoSegment::getLength(), AutoSegment::isGlobal(), AutoSegment::isSpinBottom(), AutoSegment::isSpinTop(), AutoSegment::isSpinTopOrBottom(), and AutoContact::isTurn()\&.
.PP
Referenced by AutoSegment::reduce()\&.
.SS"bool mustRaise () const"
\fBReturns:\fP\fBtrue\fP if the segment must \fIbe\fP reduced\&. That is:
.IP"\(bu"2
It is in reduced state\&.\&.\&.
.IP"\(bu"2
It is no longer \fIspin top\fP or \fIspin bottom\fP\&.
.IP"\(bu"2
It's length exceed one pitch in the perpandicular direction\&.
.PP
.PP
References AutoSegment::getLength(), AutoSegment::isSpinBottom(), AutoSegment::isSpinTop(), and Katabatic::SegIsReduced\&.
.SS"unsigned int canDogleg (\fBInterval\fP interval)"
\fBReturns:\fP non-zero if the aligned set of segment can be broken \fIoutside\fP\fCinterval\fP\&. The returned value could be zero (failure) or \fBKatabatic::KbDoglegOnLeft\fP or \fBKatabatic::KbDoglegOnRight\fP menaing that the aligned set could be broken on the left of the \fCinterval\fP (resp\&. right of it)\&.
.PP
References Interval::contains(), AutoSegment::getAligneds(), AutoSegment::getSpanU(), Interval::getVMax(), Interval::getVMin(), Katabatic::KbDoglegOnLeft, and Katabatic::KbDoglegOnRight\&.
\fBtrue\fP if the \fIglobal\fP segment can be moved on the left \fBGCell\fP (for a vertical) or down (for an horizontal)\&. The move is accepted only if it do not change the amount of global wiring\&. Thus the following conditions:
.IP"\(bu"2
The segment mustn't be on the leftmost \fBGCell\fP (obvious\&.\&.\&.)\&.
.IP"\(bu"2
The segment must be global\&.
.IP"\(bu"2
The source and target contacts must be AutoContactTurn(s)\&.
.IP"\(bu"2
At least one of the perpandicular must be global \fBand\fP connected through the \fItarget\fP\&. That is, it's a global which extends toward left\&.
.IP"\(bu"2
The \fBGCell\fP of maximum density on the left must remains below the current \fBGCell\fP of maximum density, with a margin of \fCreserve\fP (expressed in total saturation percentage)\&.
.PP
.RE
.PP
.PP
Implemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
\fBtrue\fP if the \fIglobal\fP segment can be moved on the right \fBGCell\fP (for a vertical) or up (for an horizontal)\&. The move is accepted only if it do not change the amount of global wiring\&. Thus the following conditions:
.IP"\(bu"2
The segment mustn't be on the leftmost \fBGCell\fP (obvious\&.\&.\&.)\&.
.IP"\(bu"2
The segment must be global\&.
.IP"\(bu"2
The source and target contacts must be AutoContactTurn(s)\&.
.IP"\(bu"2
At least one of the perpandicular must be global \fBand\fP connected through the \fIsource\fP\&. That is, it's a global which extends toward right\&.
.IP"\(bu"2
The \fBGCell\fP of maximum density on the left must remains below the current \fBGCell\fP of maximum density, with a margin of \fCreserve\fP (expressed in total saturation percentage)\&.
.PP
.RE
.PP
.PP
Implemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
\fIreserve\fP Number of track that must remains free \fIafter\fP the move\&.
.br
\fIflags\fP Modificate the method behavior, see below\&.
.RE
.PP
\fBReturns:\fP
.RS4
\fBtrue\fP if the segment can be moved up, that is to the next layer above in the same preferred routing direction\&. This method will check that in every \fBGCell\fP of the segment, at least \fCreserve\fP tracks are still avalaible \fIafter\fP the segment has been moved up (\fCreserve\fP can be less than \fC1\&.0\fP)\&.
.RE
.PP
Possible (bitwise) value for \fCflags\fP :
.IP"\(bu"2
\fCKbAllowTerminal\fP : allow strong terminal to be moved up\&.
.IP"\(bu"2
\fCKbAllowLocal\fP : allow local segments to be moved up\&.
.IP"\(bu"2
\fCKbPropagate\fP : perform the check on the whole aligned set\&.
.IP"\(bu"2
\fCKbWithPerpands\fP : also check the density on the perpandiculars begin & end \fBGCell\fP, there must be at least a \fC0\&.5\fP density reserve on them\&.
\fIreserve\fP Number of track that must remains free \fIafter\fP the move\&.
.br
\fIflags\fP Modificate the method behavior, see below\&.
.RE
.PP
Checks of the segment can be \fIpivoted\fP up\&. The difference between \fC\fBcanMoveUp()\fP\fP and \fC\fBcanPivotUp()\fP\fP lies in the fact that no perpandicular segment needs to be altered if the current segment is moved up\&. For example an \fBM3\fP segment connected to only \fBM4\fP can be pivoted up (in \fBM5\fP), but if connected to \fBM2\fP, it cannot\&.
.PP
Possible (bitwise) value for \fCflags\fP :
.IP"\(bu"2
\fCKbPropagate\fP : perform the check on the whole aligned set\&.
.IP"\(bu"2
\fCKbIgnoreContacts\fP : do not check the source & target layers to know if the segment can be pivoted up\&.
\fIreserve\fP Number of track that must remains free \fIafter\fP the move\&.
.br
\fIflags\fP Modificate the method behavior, see below\&.
.RE
.PP
Checks of the segment can be \fIpivoted\fP down\&. The difference between \fCcanMoveDown()\fP and \fC\fBcanPivotDown()\fP\fP lies in the fact that no perpandicular segment needs to be altered if the current segment is moved down\&.
.PP
Possible (bitwise) value for \fCflags\fP :
.IP"\(bu"2
\fCKbPropagate\fP : perform the check on the whole aligned set\&.
\fBReturns:\fP The \fBAutoSegment\fP\fIuniform\fP source (lowest) \fBGCell\fP coordinate\&. (dX for an horizontal and dY for a Vertical)\&.
.PP
References GCell::getX(), GCell::getY(), and AutoSegment::isHorizontal()\&.
.PP
Referenced by AutoSegment::computeOptimal(), AutoSegment::getOptimalMax(), AutoSegment::getOptimalMin(), AutoSegment::setOptimalMax(), and AutoSegment::setOptimalMin()\&.
\fBReturns:\fP The \fBAutoSegment\fP\fIuniform\fP occupying interval (on X for horizontal and on Y for vertical)\&.
.PP
Implemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
.PP
Referenced by AutoSegment::canDogleg(), and AutoSegment::makeDogleg()\&.
.SS"\fBInterval\fP getMinSpanU () const"
.PP
\fBReturns:\fP
.RS4
The \fBAutoSegment\fP\fIuniform\fP minimum occupying interval, computed from the constraints of all the supporting aligned AutoContacts\&. (on X for horizontal and on Y for vertical)\&.
.RE
.PP
.PP
References AutoSegment::getDirection(), Interval::getVMax(), and Interval::getVMin()\&.
.SS"\fBInterval\fP getSourceConstraints (unsigned int flags = \fC0\fP) const\fC [pure virtual]\fP"
.PP
\fBReturns:\fP
.RS4
The Interval into witch the source \fBAutoContact\fP can vary\&. By default all deduced constraints and user constraints are took into account\&. If \fCflags\fP contains \fCKbNativeConstraints\fP the constraint returned is only the enclosing \fBGCell\fP\&.
.RE
.PP
.PP
Implemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
.PP
Referenced by AutoSegment::makeDogleg()\&.
.SS"\fBInterval\fP getTargetConstraints (unsigned int flags = \fC0\fP) const\fC [pure virtual]\fP"
.PP
\fBReturns:\fP
.RS4
The Interval into witch the target \fBAutoContact\fP can vary\&. By default all deduced constraints and user constraints are took into account\&. If \fCflags\fP contains \fCKbNativeConstraints\fP the constraint returned is only the enclosing \fBGCell\fP\&.
.RE
.PP
.PP
Implemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
\fBReturns:\fP in \fCmin\fP & \fCmax\fP the allowed range for the segment axis\&.
.PP
Implemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
.PP
Referenced by AutoSegment::computeOptimal(), AutoSegment::getConstraints(), AutoSegment::getSlack(), AutoSegment::toConstraintAxis(), and AutoSegment::toOptimalAxis()\&.
The cost if this segment is placed at \fCaxis\fP\&. The cost is null if \fCaxis\fP is inside the optimal interval and is the distance toward the nearest bound outside\&.
.RE
.PP
.PP
References AutoSegment::getOptimalMax(), and AutoSegment::getOptimalMin()\&.
Set the \fIuniform\fP\fCdU\fP from target anchor (dX for Horizontal, dY for Vertical)\&.
.PP
Implemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
.SS"void computeTerminal ()"
Recompute the terminal status of an \fBAutoSegment\fP\&. Initially, a segment which source or target is a terminal is flagged as SegStrongTerminal\&. After a topological modification, if the segment is no longer directly attached to a terminal, the status is progessively weakened\&. Once it reaches the weakest level, it stays on it so the algorithm can work out which segments is a start to a path toward a terminal\&.
.PP
Status from stronger to weaker:
.IP"\(bu"2
\fBKatabatic::SegStrongTerminal\fP\&.
.IP"\(bu"2
\fBKatabatic::SegWeakTerminal1\fP
.IP"\(bu"2
\fBKatabatic::SegWeakTerminal2\fP
.PP
.PP
\fBRemark: The weakening is poorly done\&. After making a dogleg we do not\fP
.RS4
know which of the segment must be weakened if not directly attached on a terminal\&. We must examinate source & target\&.
.RE
.PP
.PP
References AutoSegment::_getFlags(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), Katabatic::SegWeakTerminal, Katabatic::SegWeakTerminal1, Katabatic::SegWeakTerminal2, AutoSegment::setFlags(), and AutoSegment::unsetFlags()\&.
.SS"void updateOrient ()\fC [pure virtual]\fP"
Ensure that source is lower than target\&. Swap them if needed\&. Swap never occurs on global segment because their source and target anchors are from different \fBGCell\fP, which are already ordered\&.
.PP
Implemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
.PP
Referenced by AutoSegment::_postCreate(), and AutoSegment::revalidate()\&.
.SS"void updatePositions ()\fC [pure virtual]\fP"
Update the segment begenning and ending positions\&. The positions takes into account the extension caps and reflect the real space used by the segment under it's long axis\&.
.PP
Implemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
.PP
Referenced by AutoSegment::_postCreate(), and AutoSegment::revalidate()\&.
Constraints applies on the valid axis interval\&. Merge in \fCconstraints\fP with the user's constraints\&. The resulting constraints is the intersection of the former user's contraints and the one given as argument\&.
.PP
References Interval::intersection()\&.
.SS"void resetUserConstraints ()\fC [inline]\fP"
Constraints applies on the valid axis interval\&. Suppress all user's constraints\&.
\fIfrom\fP The \fBAutoContact\fP\fIfrom\fP which we want to make a dogleg\&.
.RE
.PP
This method is dedicated for the restauration of topology connexity on AutoContcact after a layer change on one of their connected \fBAutoSegment\fP\&.
.PP
It perform three operations:
.IP"1."4
Create a dogleg on the \fBAutoSegment\fP (using the normal \fBGCell\fP variant)\&.
.IP"2."4
Adjust the layers of the dogleg according whether we are going \fIup\fP or \fIdown\fP from the \fBAutoContact\fP\fCfrom\fP to the segment\&.
.IP"3."4
Returns the new \fBAutoSegment\fP connected to \fCfrom\fP (it may be the same as before, \fBif\fP the \fBAutoContact\fP is the source of the segment)\&.
Referenced by AutoContactTurn::updateTopology(), and AutoContactTerminal::updateTopology()\&.
.SS"unsigned int makeDogleg (\fBInterval\fP interval, unsigned int flags = \fCKbNoFlags\fP)"
Make a dogleg \fIin a set of aligned segments\fP, thus the dogleg may not be created on \fCthis\fP segment but in one which span intersect \fCinterval\fP\&.
.PP
\fBReturns:\fP A set of flags telling if the break has occured on the left candidate (\fBKatabatic::KbDoglegOnLeft\fP) or right (\fBKatabatic::KbDoglegOnRight\fP)\&. it is combined with the flag telling if the above or below layer was used for the dogleg\&. In case of failure, zero is returned\&.
.PP
Break the set of aligned segments so the break point is \fIoutside\fP\fCinterval\fP\&. The break point so can occurs on the \fIleft\fP of the interval (\fBKatabatic::KbDoglegOnLeft\fP) or on the \fIright\fP of the interval (\fBKatabatic::KbDoglegOnRight\fP)\&. When the set of aligned segments fully enclose \fCinterval\fP, a choice has to be made between the left and right candidate\&. The rules are as follow:
.IP"\(bu"2
A \fIleft\fP candidate include the \fImin\fP of the interval into it's span\&.
.IP"\(bu"2
A \fIright\fP candidate include the \fImax\fP of the interval into it's span\&.
.IP"\(bu"2
In certain topologies, there can be more than left or right candidates (more than one segment of the set intersect the bounds of the interval)\&. Thoses candidates are ecludeds\&.
.IP"\(bu"2
If the two candidates are avalaibles, we choose the one with the greated \fInative\fP constraints\&.
.IP"\(bu"2
In case of strict equality, the left candidate is choosen\&.
.SS"unsigned int makeDogleg (\fBGCell\fP * doglegGCell, unsigned int flags = \fCKbNoFlags\fP)"
Make a dogleg \fIin a set of aligned segments\fP, thus the dogleg may not be created on \fCthis\fP segment but in the one which is under \fCdoglegGCell\fP\&.
.PP
\fBReturns:\fP A flag telling if the above or below layer was used for the perpandicular segment (\fBKatabatic::KbUseAboveLayer\fP or \fBKatabatic::KbUseBelowLayer\fP)\&.
.SS"unsigned int _makeDogleg (\fBGCell\fP * doglegGCell, unsigned int flags)\fC [pure virtual]\fP"
\fBThis method is the workhorse for the various dogleg and topology restauration methods\&.\fP It is the atomic method that actually make the dogleg on \fBthis\fP segment\&.
.PP
\fBReturns:\fP\fBKatabatic::KbUseAboveLayer\fP if the dogleg is using the \fIabove\fP layer (\fBKatabatic::KbUseBelowLayer\fP for the below layer)\&.
.PP
Break the current segment in two (a\&.k\&.a\&. making a dogleg)\&.
.IP"\(bu"2
The segment is broken inside \fCdoglegGCell\fP\&.
.IP"\(bu"2
Two new segments are createds, one perpandicular and one parallel\&.
.IP"\(bu"2
The original segment is always kept attached to the \fIsource\fP\&. (the new parallel fragment is attached to the \fItarget\fP)\&.
.IP"\(bu"2
The perpandicular segment is in the layer \fIabove\fP by default\&. If we are already on the topmost routing layer, the \fIbelow\fP layer is used\&.
.IP"\(bu"2
If the segment pass through the breaking \fBGCell\fP, it's axis is set into the center\&. If the segment is local, the axis is the middle of the segment\&.
.IP"\(bu"2
The Local/Global kind of the original segment is updated\&. The local/global status is computed by the constructor of the \fBAutoSegment\fP for the perpandicular and the new parallel\&.
.IP"\(bu"2
The terminal state is updated\&. If the segment is a strong terminal the part that is no longer directly connected to the terminal is demoted to \fBKatabatic::SegWeakTerminal1\fP\&.
.IP"\(bu"2
The perpandicular is obviously a canonical\&. If the broken segment is canonical, the original \fBis\fP left canonical and only the new parallel is re-canonized\&. Otherwise, we re-canonise both sets of aligned segments (the one on the source and the one on the target)\&.
.IP"\(bu"2
The three segments are added to the session dogleg stack\&.
.PP
.PP
After this method call the net topology is guarantee to be valid\&.
.PP
Example Case 1 Example Case 2
.PP
Implemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
.PP
Referenced by AutoSegment::makeDogleg()\&.
.SS"bool moveULeft ()\fC [pure virtual]\fP"
\fBThis function do not manage an aligned set\&. It applies on \fCthis\fP segment only\&.\fP
.PP
Displace an Horizontal or Vertical segment to the \fBGCell\fP below (a\&.k\&.a\&. lower or inferior)\&. Rules for displacement:
.IP"\(bu"2
The segment must be connected at both end to a turn contact (we do not want to manage more complex cases for the time beeing)\&.
.IP"\(bu"2
And, of course, the segment must not already by on the bottomost \fBGCell\fP\&.\&.\&.
.PP
.PP
The displacement take care of:
.IP"\(bu"2
Managing the status of the various perpandiculars\&. The stretched one are made global if needed\&. The shrinked one made local, if needed\&.
.IP"\(bu"2
The supporting \fBAutoContact\fP (source & target) are changed of \fBGCell\fP\&.
.IP"\(bu"2
If the segment is global, the go-through GCells are updateds\&.
.PP
.PP
\fBReturns:\fP\fBtrue\fP if the move has succeeded\&.
.PP
moveULeft() for an Horizontal
.PP
Implemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
.SS"bool moveURight ()\fC [pure virtual]\fP"
\fBThis function do not manage an aligned set\&. It applies on \fCthis\fP segment only\&.\fP
.PP
Displace an Horizontal or Vertical segment to the \fBGCell\fP above (a\&.k\&.a\&. upper or superior)\&. Rules for displacement:
.PP
\fBSee also:\fP
.RS4
\fBAutoSegment::moveULeft()\fP for a complete description\&.
.RE
.PP
.PP
Implemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
.SS"void slacken (unsigned int flags)"
If the the \fBAutoSegment\fP is attached trough source and/or target to a terminal with too tight constraints, create a dogleg on overconstrained extremities\&.
.PP
If \fCflags\fP contains \fBKatabatic::KbPropagate\fP, not only the current segment will be looked up, but the whole aligned set\&. Note that due to the structure of the database, there can be no more than two terminal connected segments on the whole set (one on each extremity)\&.
.PP
If \fCflags\fP contains \fBKatabatic::KbHalfSlacken\fP, the number of tracks under which the constraints are considered too tight is 3\&. Otherwise it is 10, that is a whole \fBGCell\fP side span\&. This flag should be used when a long set of global wire is overconstrained by only one of it's terminal, the other one offering sufficient slack (typically: 8)\&.
.PP
The segment will also be slackened from it's terminal if the difference between the current slack (resulting from all the constraints of the aligned set) and the native slack is less than 3 tracks\&. This case means that we are already near the native slack and it not sufficent enough a degree of freedom\&.
.PP
slacken() for an Horizontal The \fC\fBslacken()\fP\fP method reject the slackening of short locals as shown in figure \fB2\&.a\fP\&. One way or another, we must connect to the terminal through \fBthis\fP short local\&. If we cannot place it, breaking it in two other short local wouldn't help\&. In fact, it will only clutter more the \fBGCell\fP and make subsequent routing more difficult\&.
.PP
The figures \fB2\&.b\fP and \fB2\&.c\fP shows the special case of slackening an horizontal from an \fIhorizontal\fP terminal\&. In the original configuration, the slack on segment \fCid:10\fP is null, it's only choice is to be aligned with the terminal\&. If a slackening is requested, it generally implies that the horizontal track is blocked, and close to the terminal\&. Based on thoses hypothesis, when we slacken the segment \fCid:10\fP we impose that the \fIsource\fP contact is \fBfixed\fP on the terminal itself\&. That is, the segment \fCid:10\fP will be reduced to a zero-length and we made an immediate turn (see \fB2\&.c\fP )\&.
.PP
slacken() for an Horizontal (special cases)
.PP
References AutoSegment::getAligneds(), and Katabatic::KbPropagate\&.
.SS"bool reduceDoglegLayer ()"
Perform the actual layer change on a reduced segment\&. This method is to be called juste before destroying the \fBKatabatic\fP database\&.
.PP
\fBReturns:\fP\fBtrue\fP if a change occurs\&.
.PP
References AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), Session::getRoutingLayer(), AutoSegment::isReduced(), AutoSegment::isSpinBottom(), AutoSegment::isSpinTop(), AutoContact::setLayer(), and AutoSegment::setLayer()\&.
.SS"bool reduce ()"
Sets the segment into reduced state\&.
.PP
\fBReturns:\fP\fBtrue\fP if the operation did succeed\&. The layer will not be actually changed until the \fBKatabatic\fP database is saved/destroyed\&.
.PP
A segment can be reduced if:
.IP"\(bu"2
Source & target are \fBAutoContactTurn\fP\&.
.IP"\(bu"2
It is either \fIspin top\fP or \fIspin bottom\fP, that is connecting perpandiculars both in the same layer\&.
.IP"\(bu"2
Has a length less or equal one pitch in the perpandicular direction\&.
.IP"\(bu"2
Neither of the perpandicular are also reduceds\&.
.PP
.PP
Reduce Example If segment \fCid:12\fP is reduced, it prevents \fCid:10\fP & \fCid:14\fP to be also reduced, by increasing the \fC_reduced\fP counter\&. In this example \fCid:14\fP is \fIspin top\fP and \fCid:12\fP is \fIspin bottom\fP\&.
.PP
If we reduce two adjacent segments, one will go up while the other will go down (they will actually exchange their layers), it will thus defeat the purpose of creating a \fIsame layer\fP dogleg\&. Besides, the turn contact between them will be changed into a pure metal one, generating a disconnexion\&.\&.\&.
.PP
\fBSee also:\fP
.RS4
\fBAutoSegment::raise()\fP
.RE
.PP
.PP
References AutoSegment::canReduce(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoContact::getPerpandicular(), and Katabatic::SegIsReduced\&.
.SS"bool raise ()"
Get a segment out of \fIreduced\fP state\&.
.PP
\fBReturns:\fP\fBtrue\fP if a state change did really take place\&.
.PP
\fBSee also:\fP
.RS4
\fBAutoSegment::reduce()\fP
.RE
.PP
.PP
References AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoContact::getPerpandicular(), and Katabatic::SegIsReduced\&.
.SS"\fBAutoSegment\fP * canonize (unsigned int flags = \fCKbNoFlags\fP)"
Find and set the canonical \fBAutoSegment\fP from a set of aligneds\&. For the time beeing we assumes that there is no merging process, so the Segments will only gets more and more fragmented\&. This implies that a segment can become canonical but it will never revert to normal status\&.
.PP
The canonical \fBAutoSegment\fP is the one with the lowest \fCId\fP\&. This a way of ensuring reproductible results\&. Note that the canonical one may not be the \fIgeometrically\fP lowest one\&.
.PP
\fBRemark: Canonical aware method\&. \fP
.RS4
.RE
.PP
.PP
References AutoSegment::getAligneds(), AutoSegment::isCanonical(), AutoSegment::isGlobal(), Katabatic::SegCanonical, Katabatic::SegNotAligned, Katabatic::SegWeakGlobal, AutoSegment::setFlags(), and AutoSegment::unsetFlags()\&.
.PP
Referenced by AutoHorizontal::_makeDogleg(), and AutoVertical::_makeDogleg()\&.
.SS"void invalidate (unsigned int flags = \fC\fBKbPropagate\fP\fP)\fC [virtual]\fP"
Invalidate this \fBAutoSegment\fP, or if the \fBKatabatic::KbPropagate\fP flags is set, the whole set of aligned segments\&.
.PP
\fBRemark: If Katabatic is in the destruction stage, this function does nothing\&.\fP
.RS4
.RE
.PP
\fBRemark: Canonical aware method\&. \fP
.RS4
.RE
.PP
.PP
References AutoSegment::_invalidate(), AutoSegment::getAligneds(), AutoSegment::isInvalidated(), Katabatic::KbPropagate, Katabatic::KbSource, Katabatic::KbTarget, and AutoSegment::setFlags()\&.
.PP
Referenced by AutoHorizontal::_makeDogleg(), AutoVertical::_makeDogleg(), AutoSegment::_postCreate(), AutoContactVTee::updateTopology(), AutoContactTurn::updateTopology(), and AutoContactTerminal::updateTopology()\&.
\fIprocesseds\fP A set of already processeds \fBAutoSegment\fP\&. Used by the caller function to avoid doing again the computation on an \fBAutoSegment\fP from an already proccessed aligned set\&. Compute the optimal axis interval for the aligned set\&.
.SS"void setAxis (\fBDbU::Unit\fP axis, unsigned int flags = \fCKbNoFlags\fP)"
.PP
\fBParameters:\fP
.RS4
\fIaxis\fP The new position of the axis\&.
.br
\fIflags\fP See KbRealignate\&.
.RE
.PP
Set the axis of an aligned set\&. This method does nothing if not called on the canonical \fBAutoSegment\fP of the set\&. If the new value of the axis is equal to the previous one, nothing is done (non-canonical \fBAutoSegment\fP are not looked after)\&. To force an actual axis set, with invalidation of the whole \fBAutoSegment\fP set, set the KbRealignate flag\&.
.PP
\fBRemark: Canonical aware method\&. \fP
.RS4
.RE
.PP
.PP
References AutoSegment::getAligneds(), AutoSegment::getAxis(), AutoSegment::isCanonical(), AutoSegment::isHorizontal(), Katabatic::KbRealignate, and DbU::toLambda()\&.
.PP
Referenced by AutoHorizontal::moveULeft(), AutoVertical::moveULeft(), AutoHorizontal::moveURight(), AutoVertical::moveURight(), AutoSegment::toConstraintAxis(), and AutoSegment::toOptimalAxis()\&.
.SS"bool toConstraintAxis (unsigned int flags = \fC\fBKbRealignate\fP\fP)"
If the \fBAutoSegment\fP axis is outside the constraint interval, put it on nearest bound\&. This method is active only on canonical AutoSegments\&.
.SS"bool toOptimalAxis (unsigned int flags = \fC\fBKbRealignate\fP\fP)"
If the \fBAutoSegment\fP axis is outside the optimal interval, put it on nearest bound\&. This method is active only on canonical AutoSegments\&.
.PP
\fBReturns:\fP
.RS4
\fBtrue\fP if an actual axis change is made\&.
.RE
.PP
\fBRemark: Canonical aware method\&. \fP
.RS4
.RE
.PP
.PP
References AutoSegment::getAxis(), AutoSegment::getConstraints(), AutoSegment::getOptimalMax(), AutoSegment::getOptimalMin(), AutoSegment::isCanonical(), Katabatic::KbRealignate, and AutoSegment::setAxis()\&.
.SS"\fBAutoSegments\fP getOnSourceContact (unsigned int direction)"
\fBReturns:\fP The Collection of \fBAutoSegment\fP in \fCdirection\fP that are on this segment source contact\&.
.PP
References AutoSegment::getSource(), and Collection< Type >::getSubSet()\&.
.SS"\fBAutoSegments\fP getOnTargetContact (unsigned int direction)"
\fBReturns:\fP The Collection of \fBAutoSegment\fP in \fCdirection\fP that are on this segment target contact\&.
.PP
References Collection< Type >::getSubSet(), and AutoSegment::getTarget()\&.
.SS"\fBAutoSegments\fP getAligneds (unsigned int flags = \fCKbNoFlags\fP)"
The Collection of AutoSegments that are aligned on this one through \fBAutoContactHTee\fP or \fBAutoContactVTee\fP\&. If the \fCflags\fP contains \fBKatabatic::KbWithPerpands\fP, the Collection will also includes the AutoSegments directly perpandiculars to the whole aligned set\&.
.PP
Referenced by AutoSegment::canDogleg(), AutoSegment::canMoveUp(), AutoSegment::canonize(), AutoSegment::canPivotDown(), AutoSegment::canPivotUp(), AutoSegment::canSlacken(), AutoSegment::computeOptimal(), AutoSegment::getCanonical(), AutoSegment::invalidate(), AutoSegment::isStrongTerminal(), AutoSegment::makeDogleg(), AutoSegment::setAxis(), and AutoSegment::slacken()\&.
.SS"\fBAutoSegments\fP getPerpandiculars ()"
The Collection of all AutoSegments directly perpandiculars to the whole aligned set\&.
Perform operations that, given the data structure cannot be done in the constructor\&. Also allows for sharing code with the derived classes\&. Currently:
.IP"\(bu"2
Invalidate the whole net (topology change)\&.
.IP"\(bu"2
Insert the \fBAutoSegment\fP in the lookup/Session machanism\&.
.IP"\(bu"2
Call \fBAutoSegment::invalidate()\fP\&.
.IP"\(bu"2
Call \fBAutoSegment::updateOrient()\fP\&.
.IP"\(bu"2
Call \fBAutoSegment::updatePositions()\fP\&.
.PP
.PP
Reimplemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
.PP
References AutoSegment::getNet(), Session::invalidate(), AutoSegment::invalidate(), Session::link(), Observable::notify(), AutoSegment::updateOrient(), and AutoSegment::updatePositions()\&.
.PP
Referenced by AutoHorizontal::_postCreate(), AutoVertical::_postCreate(), and AutoSegment::create()\&.
Perform operations that must be done before the actual destructor is called\&. Merely whidrawn the \fBAutoSegment\fP from the lookup/Session mechanism\&.
.PP
Reimplemented in \fBAutoVertical\fP, and \fBAutoHorizontal\fP\&.
.PP
References Observable::notify(), and Session::unlink()\&.
.PP
Referenced by AutoHorizontal::_preDestroy(), and AutoVertical::_preDestroy()\&.