# Katabatic Documentation

# Katabatic - Routing Toolbox

List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions
AutoSegment Class Referenceabstract

Abstract base class for AutoSegment. More...

Inheritance diagram for AutoSegment:
[legend]

## Public Member Functions

virtual Segment * | base () const =0
virtual Segment * | base ()=0
virtual Horizontal * | getHorizontal ()
virtual Vertical * | getVertical ()
Cell * | getCell () const
Net * | getNet () const
const Layer * | getLayer () const
Box | getBoundingBox () const
Hook * | getSourceHook ()
Hook * | getTargetHook ()
Contact * | getSource () const
Contact * | getTarget () const
Component * | getOppositeAnchor (Component *) const
Components | getAnchors () const
virtual DbU::Unit | getX () const
virtual DbU::Unit | getY () const
DbU::Unit | getWidth () const
DbU::Unit | getLength () const
DbU::Unit | getSourcePosition () const
DbU::Unit | getTargetPosition () const
DbU::Unit | getSourceX () const
DbU::Unit | getSourceY () const
DbU::Unit | getTargetX () const
DbU::Unit | getTargetY () const
void | invert ()
void | setLayer (const Layer *)
bool | isHorizontal () const
bool | isVertical () const
bool | isGlobal () const
bool | isLocal () const
bool | isFixed () const
bool | isBipoint () const
bool | isWeakTerminal () const
bool | isStrongTerminal (unsigned int flags=0) const
bool | isLayerChange () const
bool | isSpinTop () const
bool | isSpinBottom () const
bool | isSpinTopOrBottom () const
bool | isReduced () const
bool | isStrap () const
bool | isDogleg () const
bool | isInvalidated () const
bool | isInvalidatedLayer () const
bool | isCreated () const
bool | isCanonical () const
bool | isUnsetAxis () const
bool | isSlackened () const
virtual bool | _canSlacken () const =0
bool | canReduce () const
bool | mustRaise () const
unsigned int | canDogleg (Interval)
virtual bool | canMoveULeft (float reserve=0.0) const =0
virtual bool | canMoveURight (float reserve=0.0) const =0
bool | canMoveUp (float reserve=0.0, unsigned int flags=0) const
bool | canPivotUp (float reserve=0.0, unsigned int flags=0) const
bool | canPivotDown (float reserve=0.0, unsigned int flags=0) const
bool | canSlacken (unsigned int flags=0) const
virtual bool | checkPositions () const =0
virtual bool | checkConstraints () const =0
unsigned long | getId () const
virtual unsigned int | getDirection () const =0
GCell * | getGCell () const
virtual size_t | getGCells (vector< GCell *> &) const =0
AutoContact * | getAutoSource () const
AutoContact * | getAutoTarget () const
AutoContact * | getOppositeAnchor (AutoContact *) const
size_t | getPerpandicularsBound (set< AutoSegment *> &)
AutoSegment * | getParent () const
DbU::Unit | getAxis () const
virtual DbU::Unit | getSourceU () const =0
virtual DbU::Unit | getTargetU () const =0
virtual DbU::Unit | getDuSource () const =0
virtual DbU::Unit | getDuTarget () const =0
DbU::Unit | getOrigin () const
DbU::Unit | getExtremity () const
virtual Interval | getSpanU () const =0
Interval | getMinSpanU () const
virtual Interval | getSourceConstraints (unsigned int flags=0) const =0
virtual Interval | getTargetConstraints (unsigned int flags=0) const =0
virtual bool | getConstraints (DbU::Unit &min, DbU::Unit &max) const =0
bool | getConstraints (Interval &i) const
const Interval & | getUserConstraints () const
virtual DbU::Unit | getSlack () const
DbU::Unit | getOptimalMin () const
DbU::Unit | getOptimalMax () const
Interval & | getOptimal (Interval &i) const
virtual DbU::Unit | getCost (DbU::Unit axis) const
virtual AutoSegment * | getCanonical (DbU::Unit &min, DbU::Unit &max)
AutoSegment * | getCanonical (Interval &i)
void | unsetFlags (unsigned int)
void | setFlags (unsigned int)
virtual void | setDuSource (DbU::Unit du)=0
virtual void | setDuTarget (DbU::Unit du)=0
void | computeTerminal ()
virtual void | updateOrient ()=0
virtual void | updatePositions ()=0
void | mergeUserConstraints (const Interval &)
void | resetUserConstraints ()
void | setOptimalMin (DbU::Unit min)
void | setOptimalMax (DbU::Unit max)
void | revalidate ()
AutoSegment * | makeDogleg (AutoContact *)
unsigned int | makeDogleg (Interval, unsigned int flags=KbNoFlags)
unsigned int | makeDogleg (GCell *, unsigned int flags=KbNoFlags)
virtual unsigned int | _makeDogleg (GCell *, unsigned int flags)=0
virtual bool | moveULeft ()=0
virtual bool | moveURight ()=0
bool | slacken (unsigned int flags)
bool | reduceDoglegLayer ()
bool | reduce ()
bool | raise ()
AutoSegment * | canonize (unsigned int flags=KbNoFlags)
virtual void | invalidate (unsigned int flags=KbPropagate)
void | computeOptimal (set< AutoSegment *> &processeds)
void | setAxis (DbU::Unit, unsigned int flags=KbNoFlags)
bool | toConstraintAxis (unsigned int flags=KbRealignate)
bool | toOptimalAxis (unsigned int flags=KbRealignate)
AutoSegments | getOnSourceContact (unsigned int direction)
AutoSegments | getOnTargetContact (unsigned int direction)
AutoSegments | getAligneds (unsigned int flags=KbNoFlags)
AutoSegments | getPerpandiculars ()

## Static Public Member Functions

static AutoSegment * | create (AutoContact *source, AutoContact *target, Segment *hurricaneSegment)
static AutoSegment * | create (AutoContact *source, AutoContact *target, unsigned int dir, size_t depth=RoutingGauge::nlayerdepth)

## Protected Member Functions

| AutoSegment (Segment *segment)
virtual | ~AutoSegment ()
virtual void | _postCreate ()
virtual void | _preDestroy ()
void | _invalidate ()
unsigned int | _getFlags () const

## Static Protected Member Functions

static void | _preCreate (AutoContact *source, AutoContact *target)

## Detailed Description

Abstract base class for AutoSegment.

# Creating AutoHorizontal & AutoVertical

AutoSegment is the abstract base class for AutoHorizontal and AutoVertical. They are must be created only through the factory method: AutoSegment::create().

# Characteristics of AutoSegments

- Unique ID: to ease the enforcing of a deterministic behavior and to gain some independance from the pointers, each AutoSegment is associated with an unique identifier. IDs are now directly taken from the Hurricane::Segment.
- Source contact is always lesser than Target contact `(Xs,Ys) < (Xt,Yt)`.
- When assembled through AutoContactVTee or AutoContactHTee, 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 canonical AutoSegment and is the one with the lowest `id`).

- When an aligned set contains at least one global, all the segments of the set are tagged Katabatic::SegWeakGlobal. This is especially useful on local ones to know if they are part of a much longer wire.

  Conversely, a set of aligned may contains only local segments and thus will not have the flag set.

- To allow some optimization, the Katabatic::SegNotAligned 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.

The Ever Fragmenting Data Structure

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).

# Operations on AutoSegments

- Slackening. Constraints transmited through either source or target AutoContact are too tight (tighter than the GCell), by adding straps in the perpandicular direction, the full slack of the segment is restored.
- Layer Change. One or two layers above or below the current layer. One up/down may means into the perpandicular routing direction.
- Dogleg Creation. 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.
- Reduction/Raising. When a segment is a short dogleg, no greater than one picth, it can use the layer of the perpandiculars.

# Invalidate on AutoSegments

The simple invalidation of an AutoSegment do not invalidate it's source & target contact.

An axis position change or a layer change both invalidate the AutoSegment and it's source & target contacts.

For the complete invalidation/revalidation mechanism see Session Algorithm.

# Main Attributes of AutoSegments

AutoSegment retains all attributes from Segment. The Segment itself beeing accessible through the base() methods.

- An unique `Id` (for determinism).
- The GCell from wich it starts from. It is the GCell of the source AutoContact.
- A state, combination of flags from Katabatic::AutoSegmentFlag.
- An interval for the optimal range of the AutoSegment axis.
- An interval for user's defined constraint on the axis.
- The interval giving the complete length of the AutoSegment, that is, with all extentions cap taken into account. This interval is refered as the span.
- A small counter, of the number of reduced neighbors (never exceed two).

# Implementation Details

AutoSegment / AutoHorizontal & AutoVertical are kind of decorators of Hurricane::Segment (they do not scrictly respect the pattern).

Canonical AutoSegment can should be considered as a kind of Composite.

Thoses objects are created using a Factory method.

# Methods Classification

- Wrapper methods on the underlying Hurricane::Segment.

- Atomic methods on AutoSegment, that is, which applies exactly on the current AutoSegment.

- Canonical methods 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 AutoSegment list parameters.
  - AutoSegment::invalidate()
  - AutoSegment::computeOptimal()
  - AutoSegment::setAxis()
  - AutoSegment::toConstraintAxis()
  - AutoSegment::toOptimalAxis()

- Uniform access, to simplify the managment of AutoHorizontal and AutoVertical through AutoSegment, a set of uniformized methods is introduced. For instance, to avoid to check the dynamic type to choose to call getSourceX() or getSourceY(), we may call getSourceU(). Uniform methods are named by replacing `X/Y` with `U`.
  - AutoSegment::getSourceU()
  - AutoSegment::getTargetU()
  - AutoSegment::getDuSource()
  - AutoSegment::getDuTarget()
  - AutoSegment::getSpanU()
  - AutoSegment::setDuSource()
  - AutoSegment::setDuTarget()

## Constructor & Destructor Documentation

## ◆ AutoSegment()

AutoSegment | ( | Segment * | segment | ) |

protected

AutoSegment constructor. It is not directly accessible, instead use one flavor of the AutoSegment::create().

References GCell::getBoundingBox(), AutoContact::getGCell(), Segment::getSource(), Segment::getTarget(), Box::getXMax(), Box::getYMax(), AutoContact::invalidate(), AutoSegment::isGlobal(), AutoSegment::isHorizontal(), Session::lookup(), Katabatic::SegCreated, Katabatic::SegHorizontal, AutoSegment::setFlags(), and AutoSegment::setOptimalMax().

## ◆ ~AutoSegment()

~AutoSegment | ( |  | ) |

protectedvirtual

AutoSegment destructor. It is not directly accessible, instead use one flavor of the AutoSegment::create().

References AutoSegment::isGlobal().

## Member Function Documentation

## ◆ create() [1/2]

AutoSegment * create | ( | AutoContact * | source,
|  | AutoContact * | target,
|  | Segment * | hurricaneSegment
| ) |  |

static

Parameters

  source | The source AutoContact.
  target | The target AutoContact.
  hurricaneSegment | The Hurricane::Segment to decorate.

Returns
  The AutoHorizontal/AutoVertical decorator segment.

Factory method to create AutoHorizontal or AutoVertical. It is important to note that this function may modify the underlying Hurricane::Segment.

- Layer is set to the default (bottom) routing Layers.
- Source & target anchor of `hurricaneSegment` are set on `source` and `target`. If the `hurricaneSegment` is already anchored and `source` or `target` are not the one decorating the anchors, an exception is thrown.

References AutoSegment::_postCreate(), Hook::attach(), Hook::detach(), AutoContact::getBodyHook(), Session::getKatabatic(), Component::getLayer(), Session::getRoutingLayer(), Segment::getSource(), Segment::getSourceHook(), Segment::getTarget(), Segment::getTargetHook(), DbU::getValueString(), Segment::getWidth(), AutoContact::getX(), AutoContact::getY(), AutoContact::isFixed(), KatabaticEngine::isGMetal(), Session::lookup(), Segment::setLayer(), Segment::setWidth(), Vertical::setX(), and Horizontal::setY().

Referenced by GCellTopology::_do_1G_1M3(), GCellTopology::_do_1G_xM1(), GCellTopology::_do_xG(), GCellTopology::_do_xG_1M1_1M2(), GCellTopology::_do_xG_1Pad(), GCellTopology::_do_xG_xM1_xM3(), GCellTopology::_do_xG_xM2(), GCellTopology::_do_xG_xM3(), AutoHorizontal::_makeDogleg(), AutoVertical::_makeDogleg(), AutoSegment::create(), GCellTopology::doRp_Access(), GCellTopology::doRp_AutoContacts(), GCellTopology::doRp_StairCaseH(), GCellTopology::doRp_StairCaseV(), and anonymous_namespace{LoadGrByNet.cpp}::singleGCell().

## ◆ create() [2/2]

AutoSegment * create | ( | AutoContact * | source,
|  | AutoContact * | target,
|  | unsigned int | dir,
|  | size_t | depth = `RoutingGauge::nlayerdepth`
| ) |  |

static

Parameters

  source | The source AutoContact.
  target | The target AutoContact.
  dir | Specify the segment direction.
  depth | The layer, given by it's depth in the RoutingGauge.

Returns
  The AutoHorizontal/AutoVertical.

Factory method to create AutoHorizontal or AutoVertical. `flags` indicate the direction (KbHorizontal or KbVertical). The underlying Hurricane segment is also created.

References AutoContact::base(), Horizontal::create(), Vertical::create(), AutoSegment::create(), Session::getRoutingLayer(), AutoContact::getX(), AutoContact::getY(), AutoContact::isFixed(), Katabatic::KbHorizontal, and Katabatic::KbVertical.

## ◆ base() [1/2]

Segment * base | ( |  | ) | const

pure virtual

Returns: the decorated Hurricane::Segment (const flavor).

Implemented in AutoVertical, and AutoHorizontal.

Referenced by AutoSegment::getAxis(), AutoSegment::getBoundingBox(), AutoSegment::getCanonical(), AutoSegment::getCell(), AutoSegment::getLayer(), AutoSegment::getLength(), AutoSegment::getNet(), AutoSegment::getOppositeAnchor(), AutoSegment::getSource(), AutoSegment::getSourceHook(), AutoSegment::getSourceX(), AutoSegment::getSourceY(), AutoSegment::getTarget(), AutoSegment::getTargetHook(), AutoSegment::getTargetX(), AutoSegment::getTargetY(), AutoSegment::getWidth(), AutoSegment::getX(), AutoSegment::getY(), AutoSegment::invert(), and AutoSegment::setLayer().

## ◆ base() [2/2]

Segment * base | ( |  | ) |

pure virtual

Returns: the decorated Hurricane::Segment.

Implemented in AutoVertical, and AutoHorizontal.

## ◆ getHorizontal()

Horizontal * getHorizontal | ( |  | ) |

inlinevirtual

Returns: If the decorated segment is a Hurricane::Horizontal, return it. `NULL` otherwise.

Reimplemented in AutoHorizontal.

## ◆ getVertical()

Vertical * getVertical | ( |  | ) |

inlinevirtual

Returns: If the decorated segment is a Hurricane::Vertical, return it. `NULL` otherwise.

Reimplemented in AutoVertical.

## ◆ getCell()

Cell * getCell | ( |  | ) | const

inline

See also
  Segment::getCell().

References AutoSegment::base(), and Entity::getCell().

## ◆ getNet()

Net * getNet | ( |  | ) | const

inline

See also
  Segment::getNet().

References AutoSegment::base(), and Component::getNet().

Referenced by AutoHorizontal::_makeDogleg(), and AutoSegment::_postCreate().

## ◆ getLayer()

const Layer * getLayer | ( |  | ) | const

inline

See also
  Segment::getLayer().

References AutoSegment::base(), and Component::getLayer().

Referenced by AutoHorizontal::_makeDogleg(), AutoVertical::_makeDogleg(), AutoHorizontal::canMoveULeft(), AutoVertical::canMoveULeft(), AutoContact::canMoveUp(), AutoSegment::canMoveUp(), AutoHorizontal::canMoveURight(), AutoVertical::canMoveURight(), AutoSegment::canPivotDown(), AutoSegment::canPivotUp(), AutoHorizontal::checkPositions(), AutoVertical::checkPositions(), AutoSegment::makeDogleg(), AutoSegment::revalidate(), AutoHorizontal::updatePositions(), AutoVertical::updatePositions(), AutoContactTurn::updateTopology(), and AutoContactTerminal::updateTopology().

## ◆ getBoundingBox()

BoundingBox * getBoundingBox | ( |  | ) | const

inline

See also
  Segment::getBoundingBox().

References AutoSegment::base(), and Component::getBoundingBox().

## ◆ getSourceHook()

Hook * getSourceHook | ( |  | ) |

inline

See also
  Segment::getSourceHook().

References AutoSegment::base(), and Segment::getSourceHook().

## ◆ getTargetHook()

Hook * getTargetHook | ( |  | ) |

inline

See also
  Segment::getTargetHook().

References AutoSegment::base(), and Segment::getTargetHook().

## ◆ getSource()

Contact * getSource | ( |  | ) | const

inline

See also
  Segment::getSource().

References AutoSegment::base(), and Segment::getSource().

Referenced by AutoSegment::getAutoSource(), and AutoSegment::getOnSourceContact().

## ◆ getTarget()

Contact * getTarget | ( |  | ) | const

inline

See also
  Segment::getTarget().

References AutoSegment::base(), and Segment::getTarget().

Referenced by AutoSegment::getAutoTarget(), and AutoSegment::getOnTargetContact().

## ◆ getOppositeAnchor() [1/2]

Component * getOppositeAnchor | ( | Component * | anchor | ) | const

inline

See also
  Segment::getNet().

References AutoSegment::base(), and Segment::getOppositeAnchor().

Referenced by AutoSegment::getOppositeAnchor().

## ◆ getAnchors()

Components getAnchors | ( |  | ) | const

inline

See also
  Segment::getAnchors().

## ◆ getX()

DbU::Unit getX | ( |  | ) | const

virtual

See also
  Segment::getX().

References AutoSegment::base(), and Component::getX().

Referenced by AutoVertical::_makeDogleg(), and AutoContactTerminal::updateGeometry().

## ◆ getY()

DbU::Unit getY | ( |  | ) | const

virtual

See also
  Segment::getY().

References AutoSegment::base(), and Component::getY().

Referenced by AutoHorizontal::_makeDogleg(), and AutoContactTerminal::updateGeometry().

## ◆ getWidth()

DbU::Unit getWidth | ( |  | ) | const

inline

See also
  Segment::getWidth().

References AutoSegment::base(), and Segment::getWidth().

## ◆ getLength()

DbU::Unit getLength | ( |  | ) | const

inline

See also
  Segment::getLength().

References AutoSegment::base(), and Segment::getLength().

Referenced by AutoSegment::canReduce(), and AutoSegment::mustRaise().

## ◆ getSourcePosition()

DbU::Unit getSourcePosition | ( |  | ) | const

inline

See also
  Segment::getSourcePosition().

Referenced by AutoSegment::getCanonical().

## ◆ getTargetPosition()

DbU::Unit getTargetPosition | ( |  | ) | const

inline

See also
  Segment::getTargetPosition().

Referenced by AutoSegment::getCanonical().

## ◆ getSourceX()

DbU::Unit getSourceX | ( |  | ) | const

inline

See also
  Segment::getSourceX().

References AutoSegment::base(), and Segment::getSourceX().

Referenced by AutoHorizontal::_makeDogleg().

## ◆ getSourceY()

DbU::Unit getSourceY | ( |  | ) | const

inline

See also
  Segment::getSourceY().

References AutoSegment::base(), and Segment::getSourceY().

Referenced by AutoVertical::_makeDogleg().

## ◆ getTargetX()

DbU::Unit getTargetX | ( |  | ) | const

inline

See also
  Segment::getTargetX().

References AutoSegment::base(), and Segment::getTargetX().

Referenced by AutoHorizontal::_makeDogleg().

## ◆ getTargetY()

DbU::Unit getTargetY | ( |  | ) | const

inline

See also
  Segment::getTargetY().

References AutoSegment::base(), and Segment::getTargetY().

Referenced by AutoVertical::_makeDogleg().

## ◆ invert()

DbU::Unit invert | ( |  | ) |

inline

See also
  Segment::invert().

References AutoSegment::base(), and Segment::invert().

## ◆ setLayer()

void setLayer | ( | const Layer * | layer | ) |

inline

See also
  Segment::setLayer().

References AutoSegment::base(), and Segment::setLayer().

Referenced by AutoHorizontal::_makeDogleg(), AutoVertical::_makeDogleg(), and AutoSegment::reduceDoglegLayer().

## ◆ isHorizontal()

bool isHorizontal | ( |  | ) | const

inline

Returns: true if the Hurricane::Segment is Horizontal.

References Katabatic::SegHorizontal.

Referenced by AutoSegment::AutoSegment(), AutoSegment::computeOptimal(), AutoSegment::getAxis(), AutoSegment::getExtremity(), AutoSegment::getOrigin(), AutoContactTerminal::getSegment(), AutoSegment::makeDogleg(), AutoSegment::setAxis(), AutoSegment::toConstraintAxis(), and AutoContactTerminal::updateGeometry().

## ◆ isVertical()

bool isVertical | ( |  | ) | const

inline

Returns: true if the Hurricane::Segment is Vertical.

References Katabatic::SegHorizontal.

Referenced by AutoSegment::computeOptimal(), and AutoContactTerminal::getSegment().

## ◆ isGlobal()

bool isGlobal | ( |  | ) | const

inline

Returns: true if the segment is global (span over more than one GCell).

References Katabatic::SegGlobal.

Referenced by AutoSegment::AutoSegment(), AutoHorizontal::canMoveULeft(), AutoVertical::canMoveULeft(), AutoHorizontal::canMoveURight(), AutoVertical::canMoveURight(), AutoSegment::canonize(), AutoSegment::canReduce(), AutoSegment::canSlacken(), AutoContact::showTopologyError(), and AutoSegment::~AutoSegment().

## ◆ isLocal()

bool isLocal | ( |  | ) | const

inline

Returns: true if the segment is local (fully enclosed in one GCell).

References Katabatic::SegGlobal.

Referenced by AutoHorizontal::_makeDogleg(), AutoVertical::_makeDogleg(), AutoSegment::canMoveUp(), AutoSegment::canPivotDown(), AutoSegment::canPivotUp(), GCell::checkEdgeSaturation(), AutoHorizontal::moveULeft(), AutoVertical::moveULeft(), AutoHorizontal::moveURight(), and AutoVertical::moveURight().

## ◆ isFixed()

bool isFixed | ( |  | ) | const

inline

Returns: true if segment must not be moved by the router.

References Katabatic::SegFixed.

Referenced by AutoSegment::canMoveUp(), AutoSegment::canPivotDown(), AutoSegment::canPivotUp(), and AutoSegment::makeDogleg().

## ◆ isBipoint()

bool isBipoint | ( |  | ) | const

inline

Returns: true if the segment straigh join two terminals.

References Katabatic::SegBipoint.

## ◆ isWeakTerminal()

bool isWeakTerminal | ( |  | ) | const

inline

Returns: true if segment is indirectly connected to a terminal.

References Katabatic::SegWeakTerminal.

Referenced by AutoHorizontal::_makeDogleg(), and AutoVertical::_makeDogleg().

## ◆ isStrongTerminal()

bool isStrongTerminal | ( | unsigned int | flags = `0` | ) | const

Returns: true if segment is directly connected to a terminal.

References AutoSegment::getAligneds(), Katabatic::KbPropagate, and Katabatic::SegStrongTerminal.

Referenced by AutoSegment::canMoveUp(), AutoSegment::canPivotDown(), and AutoSegment::canPivotUp().

## ◆ isLayerChange()

bool isLayerChange | ( |  | ) | const

inline

Returns: true if segment is a strap used only to connect between two different metal layers on the way up or down.

References Katabatic::SegLayerChange.

Referenced by AutoSegment::canMoveUp(), AutoSegment::canPivotDown(), and AutoSegment::canPivotUp().

## ◆ isSpinTop()

bool isSpinTop | ( |  | ) | const

inline

Returns: true if segment is connected to turns and both perpandiculars segments are in the top layer (candidate for reduction).

Referenced by AutoSegment::canReduce(), AutoSegment::isSpinTopOrBottom(), AutoSegment::mustRaise(), and AutoSegment::reduceDoglegLayer().

## ◆ isSpinBottom()

bool isSpinBottom | ( |  | ) | const

inline

Returns: true if segment is connected to turns and both perpandiculars segments are in the bottom layer (candidate for reduction).

Referenced by AutoSegment::canReduce(), AutoSegment::isSpinTopOrBottom(), AutoSegment::mustRaise(), and AutoSegment::reduceDoglegLayer().

## ◆ isSpinTopOrBottom()

bool isSpinTopOrBottom | ( |  | ) | const

inline

Returns: true if segment is either spin top or spin bottom (candidate for reduction).

References AutoSegment::isSpinBottom(), and AutoSegment::isSpinTop().

Referenced by AutoSegment::canReduce().

## ◆ isReduced()

bool isReduced | ( |  | ) | const

inline

Returns: true if segment is actually in a reduced state: it's effective layer will be the one of it's perpandiculars.

References Katabatic::SegIsReduced.

Referenced by AutoSegment::reduceDoglegLayer(), and AutoSegment::revalidate().

## ◆ isStrap()

bool isStrap | ( |  | ) | const

inline

Returns: true if segment has been created from a slackening operation to restore the slack of another segment.

References Katabatic::SegStrap.

## ◆ isDogleg()

bool isDogleg | ( |  | ) | const

inline

Returns: true if segment has been created as the perpandicular part of a dogleg.

References Katabatic::SegDogleg.

Referenced by AutoSegment::toConstraintAxis().

## ◆ isInvalidated()

bool isInvalidated | ( |  | ) | const

inline

Returns: true if segment has been moved or topologicaly altered.

References Katabatic::SegInvalidated.

Referenced by AutoSegment::_invalidate(), AutoSegment::invalidate(), and AutoSegment::revalidate().

## ◆ isInvalidatedLayer()

bool isInvalidatedLayer | ( |  | ) | const

inline

Returns: true if segment has been changed of layer. Source and Target AutoContact may need to be altered.

References Katabatic::SegInvalidatedLayer.

Referenced by AutoContactTurn::updateTopology().

## ◆ isCreated()

bool isCreated | ( |  | ) | const

inline

Returns: true if segment has just been created and is not revalidated for the first time

References Katabatic::SegCreated.

Referenced by AutoContactTerminal::updateGeometry().

## ◆ isCanonical()

bool isCanonical | ( |  | ) | const

inline

Returns: true if segment is the representant of an aligned set.

References Katabatic::SegCanonical.

Referenced by AutoHorizontal::_makeDogleg(), AutoVertical::_makeDogleg(), AutoSegment::canonize(), AutoSegment::getCanonical(), AutoSegment::setAxis(), AutoSegment::toConstraintAxis(), and AutoSegment::toOptimalAxis().

## ◆ isUnsetAxis()

bool isUnsetAxis | ( |  | ) | const

inline

Returns: true if the segment axis has never been set.

References Katabatic::SegAxisSet.

## ◆ isSlackened()

bool isSlackened | ( |  | ) | const

inline

Returns: true if the segment has already been slackened.

References Katabatic::SegSlackened.

Referenced by AutoHorizontal::_makeDogleg(), and AutoVertical::_makeDogleg().

## ◆ _canSlacken()

bool _canSlacken | ( |  | ) | const

pure virtual

Returns: true if the segment can be slackened. That is, source or target constraints are less than three pitches.

Implemented in AutoVertical, and AutoHorizontal.

Referenced by AutoSegment::canSlacken().

## ◆ canReduce()

bool canReduce | ( |  | ) | const

Returns: true if the segment can be reduced. That is:

- Source & target are AutoContactTurn.
- It is either spin top or spin bottom, that is connecting perpandiculars both in the same layer.
- Has a length less or equal one pitch in the perpandicular direction.
- Neither of the perpandicular are also reduceds.

References AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoSegment::getLength(), AutoSegment::isGlobal(), AutoSegment::isSpinBottom(), AutoSegment::isSpinTop(), AutoSegment::isSpinTopOrBottom(), and AutoContact::isTurn().

Referenced by AutoSegment::reduce().

## ◆ mustRaise()

bool mustRaise | ( |  | ) | const

Returns: true if the segment must be reduced. That is:

- It is in reduced state...
- It is no longer spin top or spin bottom.
- It's length exceed one pitch in the perpandicular direction.

References AutoSegment::getLength(), AutoSegment::isSpinBottom(), AutoSegment::isSpinTop(), and Katabatic::SegIsReduced.

## ◆ canDogleg()

unsigned int canDogleg | ( | Interval | interval | ) |

Returns: non-zero if the aligned set of segment can be broken outside `interval`. The returned value could be zero (failure) or Katabatic::KbDoglegOnLeft or Katabatic::KbDoglegOnRight menaing that the aligned set could be broken on the left of the `interval` (resp. right of it).

References Interval::contains(), AutoSegment::getAligneds(), AutoSegment::getSpanU(), Interval::getVMax(), Interval::getVMin(), Katabatic::KbDoglegOnLeft, and Katabatic::KbDoglegOnRight.

## ◆ canMoveULeft()

bool canMoveULeft | ( | float | reserve = `0.0` | ) | const

pure virtual

Returns
  true if the global segment can be moved on the left GCell (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:
  - The segment mustn't be on the leftmost GCell (obvious...).
  - The segment must be global.
  - The source and target contacts must be AutoContactTurn(s).
  - At least one of the perpandicular must be global and connected through the target. That is, it's a global which extends toward left.
  - The GCell of maximum density on the left must remains below the current GCell of maximum density, with a margin of `reserve` (expressed in total saturation percentage).

Implemented in AutoVertical, and AutoHorizontal.

## ◆ canMoveURight()

bool canMoveURight | ( | float | reserve = `0.0` | ) | const

pure virtual

Returns
  true if the global segment can be moved on the right GCell (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:
  - The segment mustn't be on the leftmost GCell (obvious...).
  - The segment must be global.
  - The source and target contacts must be AutoContactTurn(s).
  - At least one of the perpandicular must be global and connected through the source. That is, it's a global which extends toward right.
  - The GCell of maximum density on the left must remains below the current GCell of maximum density, with a margin of `reserve` (expressed in total saturation percentage).

Implemented in AutoVertical, and AutoHorizontal.

## ◆ canMoveUp()

bool canMoveUp | ( | float | reserve = `0.0`,
|  | unsigned int | flags = `0`
| ) |  | const

Parameters

  reserve | Number of track that must remains free after the move.
  flags | Modificate the method behavior, see below.

Returns
  true 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 GCell of the segment, at least `reserve` tracks are still avalaible after the segment has been moved up (`reserve` can be less than `1.0`).

Possible (bitwise) value for `flags` :

- `KbAllowTerminal` : allow strong terminal to be moved up.
- `KbAllowLocal` : allow local segments to be moved up.
- `KbPropagate` : perform the check on the whole aligned set.
- `KbWithPerpands` : also check the density on the perpandiculars begin & end GCell, there must be at least a `0.5` density reserve on them.

References AutoSegment::getAligneds(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), Session::getConfiguration(), GCell::getFragmentation(), AutoSegment::getGCells(), GCell::getIndex(), AutoSegment::getLayer(), RoutingGauge::getLayerDepth(), Session::getRoutingGauge(), AutoSegment::isFixed(), AutoSegment::isLayerChange(), AutoSegment::isLocal(), AutoSegment::isStrongTerminal(), Katabatic::KbPropagate, and Katabatic::KbWithPerpands.

## ◆ canPivotUp()

bool canPivotUp | ( | float | reserve = `0.0`,
|  | unsigned int | flags = `0`
| ) |  | const

Parameters

  reserve | Number of track that must remains free after the move.
  flags | Modificate the method behavior, see below.

Checks of the segment can be pivoted up. The difference between `canMoveUp()` and `canPivotUp()` lies in the fact that no perpandicular segment needs to be altered if the current segment is moved up. For example an M3 segment connected to only M4 can be pivoted up (in M5), but if connected to M2, it cannot.

Possible (bitwise) value for `flags` :

- `KbPropagate` : perform the check on the whole aligned set.
- `KbIgnoreContacts` : do not check the source & target layers to know if the segment can be pivoted up.

References AutoSegment::getAligneds(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoSegment::getGCells(), AutoSegment::getLayer(), RoutingGauge::getLayerDepth(), AutoContact::getMinDepth(), Session::getRoutingGauge(), AutoSegment::isFixed(), AutoSegment::isLayerChange(), AutoSegment::isLocal(), AutoSegment::isStrongTerminal(), and Katabatic::KbPropagate.

## ◆ canPivotDown()

bool canPivotDown | ( | float | reserve = `0.0`,
|  | unsigned int | flags = `0`
| ) |  | const

Parameters

  reserve | Number of track that must remains free after the move.
  flags | Modificate the method behavior, see below.

Checks of the segment can be pivoted down. The difference between `canMoveDown()` and `canPivotDown()` lies in the fact that no perpandicular segment needs to be altered if the current segment is moved down.

Possible (bitwise) value for `flags` :

- `KbPropagate` : perform the check on the whole aligned set.

References AutoSegment::getAligneds(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoSegment::getGCells(), AutoSegment::getLayer(), RoutingGauge::getLayerDepth(), AutoContact::getMaxDepth(), Session::getRoutingGauge(), AutoSegment::isFixed(), AutoSegment::isLayerChange(), AutoSegment::isLocal(), AutoSegment::isStrongTerminal(), and Katabatic::KbPropagate.

## ◆ canSlacken()

bool canSlacken | ( | unsigned int | flags = `0` | ) | const

Returns: true if the segment can be slackened. That is, source or target constraints are less than three pitches.

If `flags` contains KbPropagate, look on the whole aligned set.

References AutoSegment::_canSlacken(), AutoSegment::getAligneds(), AutoSegment::isGlobal(), and Katabatic::KbPropagate.

## ◆ checkPositions()

bool checkPositions | ( |  | ) | const

pure virtual

Returns: true if the relative positions of source & target are coherent. (source <= target).

Implemented in AutoVertical, and AutoHorizontal.

## ◆ checkConstraints()

bool checkConstraints | ( |  | ) | const

pure virtual

Returns: true if the constraint intervel is coherent (non-empty or punctual in the worst case).

Implemented in AutoVertical, and AutoHorizontal.

## ◆ getId()

unsigned long getId | ( |  | ) | const

inline

Returns: The AutoSegment unique identifier.

Referenced by AutoHorizontal::_preDestroy(), and AutoVertical::_preDestroy().

## ◆ getDirection()

unsigned int getDirection | ( |  | ) | const

pure virtual

Returns: Katabatic::KbHorizontal or Katabatic::KbVertical according to the decorated segment.

Implemented in AutoVertical, and AutoHorizontal.

Referenced by AutoSegment::getMinSpanU(), AutoSegment::getPerpandicularsBound(), and AutoSegment::makeDogleg().

## ◆ getGCell()

GCell * getGCell | ( |  | ) | const

inline

Returns: The GCell into which the AutoSegment starts (the one of the source).

Referenced by AutoHorizontal::canMoveULeft(), AutoVertical::canMoveULeft(), AutoHorizontal::canMoveURight(), AutoVertical::canMoveURight(), AutoHorizontal::getGCells(), AutoVertical::getGCells(), AutoHorizontal::moveULeft(), AutoVertical::moveULeft(), AutoHorizontal::moveURight(), and AutoVertical::moveURight().

## ◆ getGCells()

size_t getGCells | ( | vector< GCell *> & | gcells | ) | const

pure virtual

Parameters

  gcells | A vector that will be filled by all the GCells that the segment overlap. In increasing order, from source to target.

Returns
  The vector's size.

Implemented in AutoVertical, and AutoHorizontal.

Referenced by AutoSegment::canMoveUp(), AutoSegment::canPivotDown(), and AutoSegment::canPivotUp().

## ◆ getAutoSource()

AutoContact * getAutoSource | ( |  | ) | const

inline

Returns: The source AutoContact.

References AutoSegment::getSource(), and Session::lookup().

Referenced by AutoHorizontal::_canSlacken(), AutoVertical::_canSlacken(), AutoHorizontal::_makeDogleg(), AutoVertical::_makeDogleg(), AutoHorizontal::_postCreate(), AutoVertical::_postCreate(), AutoHorizontal::_preDestroy(), AutoVertical::_preDestroy(), AutoHorizontal::canMoveULeft(), AutoVertical::canMoveULeft(), AutoSegment::canMoveUp(), AutoHorizontal::canMoveURight(), AutoVertical::canMoveURight(), AutoSegment::canPivotDown(), AutoSegment::canPivotUp(), AutoSegment::canReduce(), AutoHorizontal::checkConstraints(), AutoVertical::checkConstraints(), AutoSegment::computeOptimal(), AutoSegment::computeTerminal(), AutoHorizontal::getConstraints(), AutoVertical::getConstraints(), AutoHorizontal::getGCells(), AutoVertical::getGCells(), AutoHorizontal::getSourceConstraints(), AutoVertical::getSourceConstraints(), AutoSegment::makeDogleg(), AutoHorizontal::moveULeft(), AutoVertical::moveULeft(), AutoHorizontal::moveURight(), AutoVertical::moveURight(), AutoSegment::raise(), AutoSegment::reduce(), AutoSegment::reduceDoglegLayer(), AutoSegment::revalidate(), and AutoSegment::toConstraintAxis().

## ◆ getAutoTarget()

AutoContact * getAutoTarget | ( |  | ) | const

inline

Returns: The target AutoContact.

References AutoSegment::getTarget(), and Session::lookup().

Referenced by AutoHorizontal::_canSlacken(), AutoVertical::_canSlacken(), AutoHorizontal::_makeDogleg(), AutoVertical::_makeDogleg(), AutoHorizontal::_postCreate(), AutoVertical::_postCreate(), AutoHorizontal::_preDestroy(), AutoVertical::_preDestroy(), AutoHorizontal::canMoveULeft(), AutoVertical::canMoveULeft(), AutoSegment::canMoveUp(), AutoHorizontal::canMoveURight(), AutoVertical::canMoveURight(), AutoSegment::canPivotDown(), AutoSegment::canPivotUp(), AutoSegment::canReduce(), AutoHorizontal::checkConstraints(), AutoVertical::checkConstraints(), AutoSegment::computeOptimal(), AutoSegment::computeTerminal(), AutoHorizontal::getConstraints(), AutoVertical::getConstraints(), AutoHorizontal::getGCells(), AutoVertical::getGCells(), AutoHorizontal::getTargetConstraints(), AutoVertical::getTargetConstraints(), AutoSegment::makeDogleg(), AutoHorizontal::moveULeft(), AutoVertical::moveULeft(), AutoHorizontal::moveURight(), AutoVertical::moveURight(), AutoSegment::raise(), AutoSegment::reduce(), AutoSegment::reduceDoglegLayer(), and AutoSegment::revalidate().

## ◆ getOppositeAnchor() [2/2]

AutoContact * getOppositeAnchor | ( | AutoContact * | contact | ) | const

Returns: The source or target AutoContact opposite to `contact`.

References AutoContact::base(), AutoSegment::getOppositeAnchor(), and Session::lookup().

## ◆ getPerpandicularsBound()

size_t getPerpandicularsBound | ( | set< AutoSegment *> & | bounds | ) |

Parameters

  bounds | A vector that will be filled by all the AutoSegments perpandicular to this one that induce a constraint.

Returns
  The vector's size.

References AutoSegment::getDirection(), Component::getSlaveComponents(), Collection< Type >::getSubSet(), and Session::lookup().

## ◆ getParent()

AutoSegment * getParent | ( |  | ) | const

inline

Returns: If this segment has been created by a dogleg operation, the parent is the one from which we fragmented.

## ◆ getAxis()

DbU::Unit getAxis | ( |  | ) | const

inline

Returns: The AutoSegment axis position.

References AutoSegment::base(), Component::getX(), Component::getY(), and AutoSegment::isHorizontal().

Referenced by AutoSegment::computeOptimal(), AutoSegment::setAxis(), AutoSegment::toConstraintAxis(), and AutoSegment::toOptimalAxis().

## ◆ getSourceU()

DbU::Unit getSourceU | ( |  | ) | const

pure virtual

Returns: The AutoSegment uniform source position. (X for an horizontal and Y for a Vertical).

Implemented in AutoVertical, and AutoHorizontal.

## ◆ getTargetU()

DbU::Unit getTargetU | ( |  | ) | const

pure virtual

Returns: The AutoSegment uniform target position. (X for an horizontal and Y for a Vertical).

Implemented in AutoVertical, and AutoHorizontal.

## ◆ getDuSource()

DbU::Unit getDuSource | ( |  | ) | const

pure virtual

Returns: The AutoSegment uniform delta from source. (dX for an horizontal and dY for a Vertical).

Implemented in AutoVertical, and AutoHorizontal.

## ◆ getDuTarget()

DbU::Unit getDuTarget | ( |  | ) | const

pure virtual

Returns: The AutoSegment uniform delta from source. (dX for an horizontal and dY for a Vertical).

Implemented in AutoVertical, and AutoHorizontal.

## ◆ getOrigin()

DbU::Unit getOrigin | ( |  | ) | const

inline

Returns: The AutoSegment uniform source (lowest) GCell coordinate. (dX for an horizontal and dY for a Vertical).

References GCell::getX(), GCell::getY(), and AutoSegment::isHorizontal().

Referenced by AutoSegment::computeOptimal(), AutoSegment::getOptimalMax(), AutoSegment::getOptimalMin(), AutoSegment::setOptimalMax(), and AutoSegment::setOptimalMin().

## ◆ getExtremity()

DbU::Unit getExtremity | ( |  | ) | const

inline

Returns: The AutoSegment uniform target (greatest) GCell coordinate. (dX for an horizontal and dY for a Vertical).

References GCell::getXMax(), GCell::getYMax(), and AutoSegment::isHorizontal().

Referenced by AutoSegment::computeOptimal().

## ◆ getSpanU()

Interval getSpanU | ( |  | ) | const

pure virtual

Returns: The AutoSegment uniform occupying interval (on X for horizontal and on Y for vertical).

Implemented in AutoVertical, and AutoHorizontal.

Referenced by AutoSegment::canDogleg(), and AutoSegment::makeDogleg().

## ◆ getMinSpanU()

Interval getMinSpanU | ( |  | ) | const

Returns
  The AutoSegment uniform minimum occupying interval, computed from the constraints of all the supporting aligned AutoContacts. (on X for horizontal and on Y for vertical).

References AutoSegment::getDirection(), Interval::getVMax(), and Interval::getVMin().

## ◆ getSourceConstraints()

Interval getSourceConstraints | ( | unsigned int | flags = `0` | ) | const

pure virtual

Returns
  The Interval into witch the source AutoContact can vary. By default all deduced constraints and user constraints are took into account. If `flags` contains `KbNativeConstraints` the constraint returned is only the enclosing GCell.

Implemented in AutoVertical, and AutoHorizontal.

Referenced by AutoSegment::makeDogleg().

## ◆ getTargetConstraints()

Interval getTargetConstraints | ( | unsigned int | flags = `0` | ) | const

pure virtual

Returns
  The Interval into witch the target AutoContact can vary. By default all deduced constraints and user constraints are took into account. If `flags` contains `KbNativeConstraints` the constraint returned is only the enclosing GCell.

Implemented in AutoVertical, and AutoHorizontal.

Referenced by AutoSegment::makeDogleg().

## ◆ getConstraints() [1/2]

bool getConstraints | ( | DbU::Unit & | min,
|  | DbU::Unit & | max
| ) |  | const

pure virtual

Returns: in `min` & `max` the allowed range for the segment axis.

Implemented in AutoVertical, and AutoHorizontal.

Referenced by AutoSegment::computeOptimal(), AutoSegment::getConstraints(), AutoSegment::getSlack(), AutoSegment::toConstraintAxis(), and AutoSegment::toOptimalAxis().

## ◆ getConstraints() [2/2]

bool getConstraints | ( | Interval & | i | ) | const

inline

Returns: in `i` the allowed range for the segment axis.

References AutoSegment::getConstraints(), Interval::getVMax(), and Interval::getVMin().

## ◆ getUserConstraints()

const Interval & getUserConstraints | ( |  | ) | const

inline

Returns: A reference to the additional constraints added to the axis of the segment.

Referenced by AutoHorizontal::getConstraints(), and AutoVertical::getConstraints().

## ◆ getSlack()

DbU::Unit getSlack | ( |  | ) | const

virtual

Returns: The length of the axis constraint interval.

References AutoSegment::getConstraints().

## ◆ getOptimalMin()

DbU::Unit getOptimalMin | ( |  | ) | const

inline

Returns: The AutoSegment minimum axis optimal range.

References AutoSegment::getOrigin(), and DbU::lambda().

Referenced by AutoSegment::getCost(), AutoSegment::getOptimal(), and AutoSegment::toOptimalAxis().

## ◆ getOptimalMax()

DbU::Unit getOptimalMax | ( |  | ) | const

inline

Returns: The AutoSegment maximum axis optimal range.

References AutoSegment::getOrigin(), and DbU::lambda().

Referenced by AutoSegment::getCost(), AutoSegment::getOptimal(), and AutoSegment::toOptimalAxis().

## ◆ getOptimal()

Interval & getOptimal | ( | Interval & | i | ) | const

Inialize `i` with the AutoSegment axis optimal range.

References AutoSegment::getOptimalMax(), AutoSegment::getOptimalMin(), Interval::getVMax(), and Interval::getVMin().

## ◆ getCost()

DbU::Unit getCost | ( | DbU::Unit | axis | ) | const

virtual

Returns
  The cost if this segment is placed at `axis`. The cost is null if `axis` is inside the optimal interval and is the distance toward the nearest bound outside.

References AutoSegment::getOptimalMax(), and AutoSegment::getOptimalMin().

## ◆ getCanonical() [1/2]

AutoSegment * getCanonical | ( | DbU::Unit & | min,
|  | DbU::Unit & | max
| ) |  |

virtual

Returns
  The canonical segment associated to this one. Additionnaly compute the source & target position of the whole set of aligned segments.

References AutoSegment::base(), AutoSegment::getAligneds(), AutoSegment::getSourcePosition(), AutoSegment::getTargetPosition(), and AutoSegment::isCanonical().

Referenced by AutoSegment::getCanonical().

## ◆ getCanonical() [2/2]

AutoSegment * getCanonical | ( | Interval & | i | ) |

inline

Returns
  The canonical segment associated to this one. Additionnaly compute the source & target position of the whole set of aligned segments.

References AutoSegment::getCanonical(), Interval::getVMax(), and Interval::getVMin().

## ◆ unsetFlags()

void unsetFlags | ( | unsigned int | flags | ) |

inline

Unsets `flags` given as arguments.

Referenced by AutoHorizontal::_makeDogleg(), AutoVertical::_makeDogleg(), AutoSegment::canonize(), AutoSegment::computeTerminal(), AutoHorizontal::moveULeft(), AutoVertical::moveULeft(), AutoHorizontal::moveURight(), AutoVertical::moveURight(), AutoSegment::revalidate(), AutoHorizontal::updateOrient(), and AutoVertical::updateOrient().

## ◆ setFlags()

void setFlags | ( | unsigned int | flags | ) |

inline

Sets `flags` given as arguments.

Referenced by AutoSegment::_invalidate(), AutoHorizontal::_makeDogleg(), AutoVertical::_makeDogleg(), AutoHorizontal::_postCreate(), AutoVertical::_postCreate(), AutoSegment::AutoSegment(), AutoSegment::canonize(), AutoSegment::computeTerminal(), GCellTopology::doRp_AutoContacts(), AutoSegment::invalidate(), AutoHorizontal::moveULeft(), AutoVertical::moveULeft(), AutoHorizontal::moveURight(), AutoVertical::moveURight(), AutoSegment::revalidate(), AutoHorizontal::updateOrient(), and AutoVertical::updateOrient().

## ◆ setDuSource()

void setDuSource | ( | DbU::Unit | du | ) |

pure virtual

Set the uniform `dU` from source anchor (dX for Horizontal, dY for Vertical).

Implemented in AutoVertical, and AutoHorizontal.

## ◆ setDuTarget()

void setDuTarget | ( | DbU::Unit | du | ) |

pure virtual

Set the uniform `dU` from target anchor (dX for Horizontal, dY for Vertical).

Implemented in AutoVertical, and AutoHorizontal.

## ◆ computeTerminal()

void computeTerminal | ( |  | ) |

Recompute the terminal status of an AutoSegment. 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.

Status from stronger to weaker:

- Katabatic::SegStrongTerminal.
- Katabatic::SegWeakTerminal1
- Katabatic::SegWeakTerminal2

Remark: The weakening is poorly done. After making a dogleg we do not
  know which of the segment must be weakened if not directly attached on a terminal. We must examinate source & target.

References AutoSegment::_getFlags(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), Katabatic::SegWeakTerminal, Katabatic::SegWeakTerminal1, Katabatic::SegWeakTerminal2, AutoSegment::setFlags(), and AutoSegment::unsetFlags().

## ◆ updateOrient()

void updateOrient | ( |  | ) |

pure virtual

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 GCell, which are already ordered.

Implemented in AutoVertical, and AutoHorizontal.

Referenced by AutoSegment::_postCreate(), and AutoSegment::revalidate().

## ◆ updatePositions()

void updatePositions | ( |  | ) |

pure virtual

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.

Implemented in AutoVertical, and AutoHorizontal.

Referenced by AutoSegment::_postCreate(), and AutoSegment::revalidate().

## ◆ mergeUserConstraints()

void mergeUserConstraints | ( | const Interval & | constraints | ) |

Constraints applies on the valid axis interval. Merge in `constraints` with the user's constraints. The resulting constraints is the intersection of the former user's contraints and the one given as argument.

References Interval::intersection().

## ◆ resetUserConstraints()

void resetUserConstraints | ( |  | ) |

inline

Constraints applies on the valid axis interval. Suppress all user's constraints.

## ◆ setOptimalMin()

void setOptimalMin | ( | DbU::Unit | min | ) |

inline

Sets the lower bound of the optimal axis interval.

References DbU::getLambda(), and AutoSegment::getOrigin().

Referenced by AutoSegment::computeOptimal().

## ◆ setOptimalMax()

void setOptimalMax | ( | DbU::Unit | max | ) |

inline

Sets the lower bound of the optimal axis interval.

References DbU::getLambda(), and AutoSegment::getOrigin().

Referenced by AutoSegment::AutoSegment(), and AutoSegment::computeOptimal().

## ◆ revalidate()

Interval revalidate | ( |  | ) |

Mark this segment as valid (unset the Invalidated flag) and update positions. Unlike AutoSegment::invalidate(), it's an atomic method.

References AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoContact::getLayer(), AutoSegment::getLayer(), AutoContact::getPerpandicular(), Layer::getTop(), AutoSegment::isInvalidated(), AutoSegment::isReduced(), AutoContact::isTurn(), Observable::notify(), Katabatic::SegCreated, Katabatic::SegInvalidated, Katabatic::SegInvalidatedLayer, Katabatic::SegSourceBottom, Katabatic::SegSourceTop, Katabatic::SegTargetBottom, Katabatic::SegTargetTop, AutoSegment::setFlags(), AutoSegment::unsetFlags(), AutoSegment::updateOrient(), and AutoSegment::updatePositions().

## ◆ makeDogleg() [1/3]

AutoSegment * makeDogleg | ( | AutoContact * | from | ) |

Parameters

  from | The AutoContact from which we want to make a dogleg.

This method is dedicated for the restauration of topology connexity on AutoContcact after a layer change on one of their connected AutoSegment.

It perform three operations:

1. Create a dogleg on the AutoSegment (using the normal GCell variant).
2. Adjust the layers of the dogleg according whether we are going up or down from the AutoContact `from` to the segment.
3. Returns the new AutoSegment connected to `from` (it may be the same as before, if the AutoContact is the source of the segment).

References Layer::contains(), AutoSegment::getAutoSource(), RoutingGauge::getContactLayer(), Session::getDoglegs(), AutoContact::getGCell(), AutoContact::getLayer(), AutoSegment::getLayer(), RoutingGauge::getLayerDepth(), Session::getRoutingGauge(), RoutingGauge::getRoutingLayer(), AutoContact::getX(), AutoContact::getY(), and AutoSegment::isHorizontal().

Referenced by AutoContactTurn::updateTopology(), and AutoContactTerminal::updateTopology().

## ◆ makeDogleg() [2/3]

unsigned int makeDogleg | ( | Interval | interval,
|  | unsigned int | flags = `KbNoFlags`
| ) |  |

Make a dogleg in a set of aligned segments, thus the dogleg may not be created on `this` segment but in one which span intersect `interval`.

Returns: A set of flags telling if the break has occured on the left candidate (Katabatic::KbDoglegOnLeft) or right (Katabatic::KbDoglegOnRight). 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.

Break the set of aligned segments so the break point is outside `interval`. The break point so can occurs on the left of the interval (Katabatic::KbDoglegOnLeft) or on the right of the interval (Katabatic::KbDoglegOnRight). When the set of aligned segments fully enclose `interval`, a choice has to be made between the left and right candidate. The rules are as follow:

- A left candidate include the min of the interval into it's span.
- A right candidate include the max of the interval into it's span.
- 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.
- If the two candidates are avalaibles, we choose the one with the greated native constraints.
- In case of strict equality, the left candidate is choosen.

Example Case 4

References AutoSegment::_makeDogleg(), Interval::contains(), AutoSegment::getAligneds(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoSegment::getDirection(), Session::getDoglegs(), AutoContact::getGCell(), GCell::getRight(), GCell::getSide(), Interval::getSize(), AutoSegment::getSourceConstraints(), AutoSegment::getSpanU(), AutoSegment::getTargetConstraints(), GCell::getUp(), DbU::getValueString(), Interval::getVMax(), Interval::getVMin(), Katabatic::KbDoglegOnLeft, Katabatic::KbDoglegOnRight, Katabatic::KbHorizontal, and Katabatic::KbNativeConstraints.

## ◆ makeDogleg() [3/3]

unsigned int makeDogleg | ( | GCell * | doglegGCell,
|  | unsigned int | flags = `KbNoFlags`
| ) |  |

Make a dogleg in a set of aligned segments, thus the dogleg may not be created on `this` segment but in the one which is under `doglegGCell`.

Returns: A flag telling if the above or below layer was used for the perpandicular segment (Katabatic::KbUseAboveLayer or Katabatic::KbUseBelowLayer).

References AutoSegment::_makeDogleg(), Katabatic::EngineGlobalLoaded, AutoSegment::getAligneds(), AutoSegment::getDirection(), Session::getKatabatic(), GCell::getSide(), AutoSegment::getSpanU(), Interval::intersect(), and AutoSegment::isFixed().

## ◆ _makeDogleg()

unsigned int _makeDogleg | ( | GCell * | doglegGCell,
|  | unsigned int | flags
| ) |  |

pure virtual

This method is the workhorse for the various dogleg and topology restauration methods. It is the atomic method that actually make the dogleg on this segment.

Returns: Katabatic::KbUseAboveLayer if the dogleg is using the above layer (Katabatic::KbUseBelowLayer for the below layer).

Break the current segment in two (a.k.a. making a dogleg).

- The segment is broken inside `doglegGCell`.
- Two new segments are createds, one perpandicular and one parallel.
- The original segment is always kept attached to the source. (the new parallel fragment is attached to the target).
- The perpandicular segment is in the layer above by default. If we are already on the topmost routing layer, the below layer is used.
- If the segment pass through the breaking GCell, it's axis is set into the center. If the segment is local, the axis is the middle of the segment.
- The Local/Global kind of the original segment is updated. The local/global status is computed by the constructor of the AutoSegment for the perpandicular and the new parallel.
- 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 Katabatic::SegWeakTerminal1.
- The perpandicular is obviously a canonical. If the broken segment is canonical, the original is 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).
- The three segments are added to the session dogleg stack.

After this method call the net topology is guarantee to be valid.

Example Case 1
Example Case 2

Implemented in AutoVertical, and AutoHorizontal.

Referenced by AutoSegment::makeDogleg().

## ◆ moveULeft()

bool moveULeft | ( |  | ) |

pure virtual

This function do not manage an aligned set. It applies on `this` segment only.

Displace an Horizontal or Vertical segment to the GCell below (a.k.a. lower or inferior). Rules for displacement:

- 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).
- And, of course, the segment must not already by on the bottomost GCell...

The displacement take care of:

- Managing the status of the various perpandiculars. The stretched one are made global if needed. The shrinked one made local, if needed.
- The supporting AutoContact (source & target) are changed of GCell.
- If the segment is global, the go-through GCells are updateds.

Returns: true if the move has succeeded.

moveULeft() for an Horizontal

Implemented in AutoVertical, and AutoHorizontal.

## ◆ moveURight()

bool moveURight | ( |  | ) |

pure virtual

This function do not manage an aligned set. It applies on `this` segment only.

Displace an Horizontal or Vertical segment to the GCell above (a.k.a. upper or superior). Rules for displacement:

See also
  AutoSegment::moveULeft() for a complete description.

Implemented in AutoVertical, and AutoHorizontal.

## ◆ slacken()

void slacken | ( | unsigned int | flags | ) |

If the the AutoSegment is attached trough source and/or target to a terminal with too tight constraints, create a dogleg on overconstrained extremities.

If `flags` contains Katabatic::KbPropagate, 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).

If `flags` contains Katabatic::KbHalfSlacken, the number of tracks under which the constraints are considered too tight is 3. Otherwise it is 10, that is a whole GCell 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).

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.

slacken() for an Horizontal

The `slacken()` method reject the slackening of short locals as shown in figure 2.a. One way or another, we must connect to the terminal through this 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 GCell and make subsequent routing more difficult.

The figures 2.b and 2.c shows the special case of slackening an horizontal from an horizontal terminal. In the original configuration, the slack on segment `id:10` 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 `id:10` we impose that the source contact is fixed on the terminal itself. That is, the segment `id:10` will be reduced to a zero-length and we made an immediate turn (see 2.c ).

slacken() for an Horizontal (special cases)

References AutoSegment::getAligneds(), and Katabatic::KbPropagate.

## ◆ reduceDoglegLayer()

bool reduceDoglegLayer | ( |  | ) |

Perform the actual layer change on a reduced segment. This method is to be called juste before destroying the Katabatic database.

Returns: true if a change occurs.

References AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), Session::getRoutingLayer(), AutoSegment::isReduced(), AutoSegment::isSpinBottom(), AutoSegment::isSpinTop(), AutoContact::setLayer(), and AutoSegment::setLayer().

## ◆ reduce()

bool reduce | ( |  | ) |

Sets the segment into reduced state.

Returns: true if the operation did succeed. The layer will not be actually changed until the Katabatic database is saved/destroyed.

A segment can be reduced if:

- Source & target are AutoContactTurn.
- It is either spin top or spin bottom, that is connecting perpandiculars both in the same layer.
- Has a length less or equal one pitch in the perpandicular direction.
- Neither of the perpandicular are also reduceds.

Reduce Example

If segment `id:12` is reduced, it prevents `id:10` & `id:14` to be also reduced, by increasing the `_reduced` counter. In this example `id:14` is spin top and `id:12` is spin bottom.

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 same layer dogleg. Besides, the turn contact between them will be changed into a pure metal one, generating a disconnexion...

See also
  AutoSegment::raise()

References AutoSegment::canReduce(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoContact::getPerpandicular(), and Katabatic::SegIsReduced.

## ◆ raise()

bool raise | ( |  | ) |

Get a segment out of reduced state.

Returns: true if a state change did really take place.

See also
  AutoSegment::reduce()

References AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoContact::getPerpandicular(), and Katabatic::SegIsReduced.

## ◆ canonize()

AutoSegment * canonize | ( | unsigned int | flags = `KbNoFlags` | ) |

Find and set the canonical AutoSegment 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.

The canonical AutoSegment is the one with the lowest `Id`. This a way of ensuring reproductible results. Note that the canonical one may not be the geometrically lowest one.

Remark: Canonical aware method.

References AutoSegment::getAligneds(), AutoSegment::isCanonical(), AutoSegment::isGlobal(), Katabatic::SegCanonical, Katabatic::SegNotAligned, Katabatic::SegWeakGlobal, AutoSegment::setFlags(), and AutoSegment::unsetFlags().

Referenced by AutoHorizontal::_makeDogleg(), and AutoVertical::_makeDogleg().

## ◆ invalidate()

void invalidate | ( | unsigned int | flags = `KbPropagate` | ) |

virtual

Invalidate this AutoSegment, or if the Katabatic::KbPropagate flags is set, the whole set of aligned segments.

Remark: If Katabatic is in the destruction stage, this function does nothing.

Remark: Canonical aware method.

References AutoSegment::_invalidate(), AutoSegment::getAligneds(), AutoSegment::isInvalidated(), Katabatic::KbPropagate, Katabatic::KbSource, Katabatic::KbTarget, and AutoSegment::setFlags().

Referenced by AutoHorizontal::_makeDogleg(), AutoVertical::_makeDogleg(), AutoSegment::_postCreate(), AutoContactVTee::updateTopology(), AutoContactTurn::updateTopology(), and AutoContactTerminal::updateTopology().

## ◆ computeOptimal()

Interval computeOptimal | ( | set< AutoSegment *> & | processeds | ) |

Parameters

  processeds | A set of already processeds AutoSegment. Used by the caller function to avoid doing again the computation on an AutoSegment from an already proccessed aligned set. Compute the optimal axis interval for the aligned set.

Remark: Canonical aware method.

References AutoSegment::getAligneds(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoSegment::getAxis(), GCell::getBoundingBox(), GCell::getColumn(), AutoContact::getConstraintBox(), AutoSegment::getConstraints(), AutoSegment::getExtremity(), AutoSegment::getOrigin(), AutoSegment::getPerpandiculars(), GCell::getRow(), Box::getXMax(), Box::getXMin(), Box::getYMax(), Box::getYMin(), AutoSegment::isHorizontal(), AutoSegment::isVertical(), AutoSegment::setOptimalMax(), AutoSegment::setOptimalMin(), and DbU::toLambda().

## ◆ setAxis()

void setAxis | ( | DbU::Unit | axis,
|  | unsigned int | flags = `KbNoFlags`
| ) |  |

Parameters

  axis | The new position of the axis.
  flags | See KbRealignate.

Set the axis of an aligned set. This method does nothing if not called on the canonical AutoSegment of the set. If the new value of the axis is equal to the previous one, nothing is done (non-canonical AutoSegment are not looked after). To force an actual axis set, with invalidation of the whole AutoSegment set, set the KbRealignate flag.

Remark: Canonical aware method.

References AutoSegment::getAligneds(), AutoSegment::getAxis(), AutoSegment::isCanonical(), AutoSegment::isHorizontal(), Katabatic::KbRealignate, and DbU::toLambda().

Referenced by AutoHorizontal::moveULeft(), AutoVertical::moveULeft(), AutoHorizontal::moveURight(), AutoVertical::moveURight(), AutoSegment::toConstraintAxis(), and AutoSegment::toOptimalAxis().

## ◆ toConstraintAxis()

bool toConstraintAxis | ( | unsigned int | flags = `KbRealignate` | ) |

If the AutoSegment axis is outside the constraint interval, put it on nearest bound. This method is active only on canonical AutoSegments.

Returns
  true if an actual axis change is made.

Remark: Canonical aware method.

References AutoSegment::getAutoSource(), AutoSegment::getAxis(), AutoSegment::getConstraints(), AutoContact::getGCell(), Interval::getHalfSize(), GCell::getSide(), AutoSegment::isCanonical(), AutoSegment::isDogleg(), AutoSegment::isHorizontal(), Katabatic::KbHorizontal, Katabatic::KbVertical, and AutoSegment::setAxis().

## ◆ toOptimalAxis()

bool toOptimalAxis | ( | unsigned int | flags = `KbRealignate` | ) |

If the AutoSegment axis is outside the optimal interval, put it on nearest bound. This method is active only on canonical AutoSegments.

Returns
  true if an actual axis change is made.

Remark: Canonical aware method.

References AutoSegment::getAxis(), AutoSegment::getConstraints(), AutoSegment::getOptimalMax(), AutoSegment::getOptimalMin(), AutoSegment::isCanonical(), Katabatic::KbRealignate, and AutoSegment::setAxis().

## ◆ getOnSourceContact()

AutoSegments getOnSourceContact | ( | unsigned int | direction | ) |

Returns: The Collection of AutoSegment in `direction` that are on this segment source contact.

References AutoSegment::getSource(), and Collection< Type >::getSubSet().

## ◆ getOnTargetContact()

AutoSegments getOnTargetContact | ( | unsigned int | direction | ) |

Returns: The Collection of AutoSegment in `direction` that are on this segment target contact.

References Collection< Type >::getSubSet(), and AutoSegment::getTarget().

## ◆ getAligneds()

AutoSegments getAligneds | ( | unsigned int | flags = `KbNoFlags` | ) |

The Collection of AutoSegments that are aligned on this one through AutoContactHTee or AutoContactVTee. If the `flags` contains Katabatic::KbWithPerpands, the Collection will also includes the AutoSegments directly perpandiculars to the whole aligned set.

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().

## ◆ getPerpandiculars()

AutoSegments getPerpandiculars | ( |  | ) |

The Collection of all AutoSegments directly perpandiculars to the whole aligned set.

Referenced by AutoSegment::computeOptimal().

## ◆ _preCreate()

void _preCreate | ( | AutoContact * | source,
|  | AutoContact * | target
| ) |  |

staticprotected

Perform sanity checks before allowing the actual creation of an AutoSegment. If an error occurs throw an exception.

Check for:

- `source` and `target` must not be `NULL`.
- `source` and `target` must be different.

## ◆ _postCreate()

void _postCreate | ( |  | ) |

protectedvirtual

Perform operations that, given the data structure cannot be done in the constructor. Also allows for sharing code with the derived classes. Currently:

- Invalidate the whole net (topology change).
- Insert the AutoSegment in the lookup/Session machanism.
- Call AutoSegment::invalidate().
- Call AutoSegment::updateOrient().
- Call AutoSegment::updatePositions().

Reimplemented in AutoVertical, and AutoHorizontal.

References AutoSegment::getNet(), Session::invalidate(), AutoSegment::invalidate(), Session::link(), Observable::notify(), AutoSegment::updateOrient(), and AutoSegment::updatePositions().

Referenced by AutoHorizontal::_postCreate(), AutoVertical::_postCreate(), and AutoSegment::create().

## ◆ _preDestroy()

void _preDestroy | ( |  | ) |

protectedvirtual

Perform operations that must be done before the actual destructor is called. Merely whidrawn the AutoSegment from the lookup/Session mechanism.

Reimplemented in AutoVertical, and AutoHorizontal.

References Observable::notify(), and Session::unlink().

Referenced by AutoHorizontal::_preDestroy(), and AutoVertical::_preDestroy().

## ◆ _invalidate()

Interval _invalidate | ( |  | ) |

protected

Invalidate this segment. The segment is scheduled into the Session revalidation mechanism.

References Session::invalidate(), AutoSegment::isInvalidated(), Observable::notify(), Katabatic::SegInvalidated, and AutoSegment::setFlags().

Referenced by AutoSegment::invalidate().

## ◆ _getFlags()

unsigned int _getFlags | ( |  | ) | const

inlineprotected

Sets `flags` given as arguments.

Referenced by AutoSegment::computeTerminal().

The documentation for this class was generated from the following files:

- AutoSegment.h
- AutoSegment.cpp
- AutoSegment.dox