# Katabatic - Routing Toolbox

List of all members | Public Member Functions | Protected Member Functions
AutoHorizontal Class Reference

Concrete Horizontal AutoSegment. More...

Inheritance diagram for AutoHorizontal:
[legend]

## Public Member Functions
virtual bool | _canSlacken () const
virtual bool | canMoveULeft (float reserve=0.0) const
virtual bool | canMoveURight (float reserve=0.0) const
virtual Segment * | base ()
virtual Segment * | base () const
virtual Horizontal * | getHorizontal ()
virtual DbU::Unit | getSourceU () const
virtual DbU::Unit | getTargetU () const
virtual DbU::Unit | getDuSource () const
virtual DbU::Unit | getDuTarget () const
virtual Interval | getSpanU () const
virtual bool | getConstraints (DbU::Unit &min, DbU::Unit &max) const
virtual Interval | getSourceConstraints (unsigned int flags=0) const
virtual Interval | getTargetConstraints (unsigned int flags=0) const
virtual unsigned int | getDirection () const
virtual size_t | getGCells (vector< GCell *> &) const
virtual void | setDuSource (DbU::Unit)
virtual void | setDuTarget (DbU::Unit)
virtual void | updateOrient ()
virtual void | updatePositions ()
virtual bool | checkPositions () const
virtual bool | checkConstraints () const
virtual unsigned int | _makeDogleg (GCell *, unsigned int flags)
virtual bool | moveULeft ()
virtual bool | moveURight ()
Public Member Functions inherited from AutoSegment
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
bool | canReduce () const
bool | mustRaise () const
unsigned int | canDogleg (Interval)
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
unsigned long | getId () const
GCell * | getGCell () const
AutoContact * | getAutoSource () const
AutoContact * | getAutoTarget () const
AutoContact * | getOppositeAnchor (AutoContact *) const
size_t | getPerpandicularsBound (set< AutoSegment *> &)
AutoSegment * | getParent () const
DbU::Unit | getAxis () const
DbU::Unit | getOrigin () const
DbU::Unit | getExtremity () const
Interval | getMinSpanU () const
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)
void | computeTerminal ()
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)
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 ()

## Protected Member Functions
virtual void | _postCreate ()
virtual void | _preDestroy ()
Protected Member Functions inherited from AutoSegment
| AutoSegment (Segment *segment)
virtual | ~AutoSegment ()
void | _invalidate ()
unsigned int | _getFlags () const

## Additional Inherited Members
Static Public Member Functions inherited from AutoSegment
static AutoSegment * | create (AutoContact *source, AutoContact *target, Segment *hurricaneSegment)
static AutoSegment * | create (AutoContact *source, AutoContact *target, unsigned int dir, size_t depth=RoutingGauge::nlayerdepth)
Static Protected Member Functions inherited from AutoSegment
static void | _preCreate (AutoContact *source, AutoContact *target)

## Detailed Description

Concrete Horizontal AutoSegment.

## Member Function Documentation

## ◆ _canSlacken()

bool _canSlacken | ( |  | ) | const
| virtual

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

Implements AutoSegment.

References Interval::contains(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoContact::getGCell(), GCell::getSide(), Interval::getSize(), DbU::getValueString(), Interval::inflate(), and Katabatic::KbVertical.

## ◆ canMoveULeft()

bool canMoveULeft | ( | float | reserve = `0.0` | ) | const
| 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).

Implements AutoSegment.

References AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), GCell::getDown(), AutoContact::getGCell(), AutoSegment::getGCell(), AutoSegment::getLayer(), RoutingGauge::getLayerDepth(), GCell::getRight(), Session::getRoutingGauge(), AutoContact::getSegment(), GCell::getWDensity(), and AutoSegment::isGlobal().

## ◆ canMoveURight()

bool canMoveURight | ( | float | reserve = `0.0` | ) | const
| 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).

Implements AutoSegment.

References AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoContact::getGCell(), AutoSegment::getGCell(), AutoSegment::getLayer(), RoutingGauge::getLayerDepth(), GCell::getRight(), Session::getRoutingGauge(), AutoContact::getSegment(), GCell::getUp(), GCell::getWDensity(), and AutoSegment::isGlobal().

## ◆ base() [1/2]

Segment * base | ( |  | ) |
| virtual

Returns: the decorated Hurricane::Segment.

Implements AutoSegment.

## ◆ base() [2/2]

Segment * base | ( |  | ) | const
| virtual

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

Implements AutoSegment.

## ◆ getHorizontal()

Horizontal * getHorizontal | ( |  | ) |
| virtual

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

Reimplemented from AutoSegment.

## ◆ getSourceU()

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

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

Implements AutoSegment.

References Segment::getSourceX().

## ◆ getTargetU()

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

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

Implements AutoSegment.

References Segment::getTargetX().

## ◆ getDuSource()

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

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

Implements AutoSegment.

References Horizontal::getDxSource().

## ◆ getDuTarget()

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

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

Implements AutoSegment.

References Horizontal::getDxTarget().

## ◆ getSpanU()

Interval getSpanU | ( |  | ) | const
| virtual

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

Implements AutoSegment.

References Segment::getSourceX(), and Segment::getTargetX().

## ◆ getConstraints()

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

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

Implements AutoSegment.

References AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoContact::getCBYMax(), AutoContact::getCBYMin(), AutoSegment::getUserConstraints(), and DbU::getValueString().

## ◆ getSourceConstraints()

Interval getSourceConstraints | ( | unsigned int | flags = `0` | ) | const
| 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.

Implements AutoSegment.

References AutoSegment::getAutoSource(), Box::getYMax(), Box::getYMin(), and Katabatic::KbNativeConstraints.

## ◆ getTargetConstraints()

Interval getTargetConstraints | ( | unsigned int | flags = `0` | ) | const
| 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.

Implements AutoSegment.

References AutoSegment::getAutoTarget(), Box::getYMax(), Box::getYMin(), and Katabatic::KbNativeConstraints.

## ◆ getDirection()

unsigned int getDirection | ( |  | ) | const
| virtual

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

Implements AutoSegment.

References Katabatic::KbHorizontal.

## ◆ getGCells()

size_t getGCells | ( | vector< GCell *> & | gcells | ) | const
| 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.

Implements AutoSegment.

References AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoContact::getGCell(), AutoSegment::getGCell(), and GCell::getRight().

## ◆ setDuSource()

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

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

Implements AutoSegment.

## ◆ setDuTarget()

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

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

Implements AutoSegment.

## ◆ updateOrient()

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

Implements AutoSegment.

References Segment::getSourceX(), Segment::getTargetX(), Segment::invert(), Katabatic::SegSourceBottom, Katabatic::SegSourceTop, Katabatic::SegStrongTerminal, Katabatic::SegTargetBottom, Katabatic::SegTargetTop, AutoSegment::setFlags(), and AutoSegment::unsetFlags().

## ◆ updatePositions()

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

Implements AutoSegment.

References Session::getExtensionCap(), AutoSegment::getLayer(), Segment::getSourceX(), and Segment::getTargetX().

## ◆ checkPositions()

bool checkPositions | ( |  | ) | const
| virtual

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

Implements AutoSegment.

References Session::getExtensionCap(), AutoSegment::getLayer(), Segment::getSourceX(), Segment::getTargetX(), and DbU::getValueString().

## ◆ checkConstraints()

bool checkConstraints | ( |  | ) | const
| virtual

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

Implements AutoSegment.

References AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), and Interval::intersect().

## ◆ _makeDogleg()

unsigned int _makeDogleg | ( | GCell * | doglegGCell,
|  | unsigned int | flags
| ) |  |
| 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

Implements AutoSegment.

References AutoSegment::canonize(), DebugSession::close(), AutoContactTurn::create(), AutoSegment::create(), Session::dogleg(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), Session::getConfiguration(), RoutingGauge::getContactLayer(), AutoContact::getGCell(), Component::getLayer(), AutoSegment::getLayer(), RoutingGauge::getLayerDepth(), Component::getNet(), AutoSegment::getNet(), GCell::getRight(), Session::getRoutingGauge(), RoutingGauge::getRoutingLayer(), AutoSegment::getSourceX(), AutoSegment::getTargetX(), GCell::getX(), GCell::getXMax(), AutoSegment::getY(), AutoContact::invalidate(), AutoSegment::invalidate(), AutoSegment::isCanonical(), AutoSegment::isLocal(), AutoSegment::isSlackened(), AutoSegment::isWeakTerminal(), Katabatic::KbHorizontal, Katabatic::KbUseAboveLayer, Katabatic::KbUseBelowLayer, Katabatic::KbVertical, AutoContact::migrateConstraintBox(), DebugSession::open(), GCell::removeHSegment(), Katabatic::SegCanonical, Katabatic::SegDogleg, Katabatic::SegGlobal, Katabatic::SegNotAligned, Katabatic::SegSlackened, Katabatic::SegWeakTerminal1, AutoSegment::setFlags(), AutoSegment::setLayer(), and AutoSegment::unsetFlags().

## ◆ moveULeft()

bool moveULeft | ( |  | ) |
| 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

Implements AutoSegment.

References GCell::addVSegment(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), GCell::getDown(), AutoContact::getGCell(), AutoSegment::getGCell(), GCell::getRight(), AutoContact::getSegment(), GCell::getSide(), Interval::getVMax(), AutoSegment::isLocal(), Katabatic::KbVertical, GCell::removeVSegment(), Katabatic::SegGlobal, AutoSegment::setAxis(), AutoSegment::setFlags(), AutoContact::setGCell(), and AutoSegment::unsetFlags().

## ◆ moveURight()

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

Implements AutoSegment.

References GCell::addVSegment(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoContact::getGCell(), AutoSegment::getGCell(), GCell::getRight(), AutoContact::getSegment(), GCell::getSide(), GCell::getUp(), Interval::getVMin(), AutoSegment::isLocal(), Katabatic::KbVertical, GCell::removeVSegment(), Katabatic::SegGlobal, AutoSegment::setAxis(), AutoSegment::setFlags(), AutoContact::setGCell(), and AutoSegment::unsetFlags().

## ◆ _postCreate()

void _postCreate | ( |  | ) |
| protected virtual

In addition to AutoSegment::_postCreate(), detect whether the segment is global or local and register it in the relevant GCells (if needed).

If the segment is anchored directly on a terminal, adjust the axis so it's connected.

Reimplemented from AutoSegment.

References AutoSegment::_postCreate(), GCell::addHSegment(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoContact::getGCell(), GCell::getRight(), GCell::getX(), Component::getY(), Katabatic::SegGlobal, AutoSegment::setFlags(), and AutoContact::setY().

## ◆ _preDestroy()

void _preDestroy | ( |  | ) |
| protected virtual

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

Reimplemented from AutoSegment.

References AutoSegment::_preDestroy(), AutoSegment::getAutoSource(), AutoSegment::getAutoTarget(), AutoContact::getGCell(), AutoSegment::getId(), GCell::getRight(), GCell::getX(), and GCell::removeHSegment().

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

- AutoHorizontal.h
- AutoHorizontal.cpp
- AutoHorizontal.dox

Generated by doxygen 1.8.14 on Mon Feb 3 2020 | Return to top of page

Katabatic - Routing Toolbox | Copyright © 2008-2016 UPMC. All rights reserved