Katabatic - Routing Toolbox


List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions
GCell Class Reference

Routing Global Cell. More...

Inherits ExtensionGo.

Classes

class  CompareByDensity
 GCell Density Comparison Functor. More...
 
class  CompareByIndex
 GCell Index Comparison Functor. More...
 
class  Key
 GCell Key - Density Cache. More...
 

Public Types

typedef set< GCell *, CompareByIndexSetIndex
 

Public Member Functions

virtual const NamegetName () const
 
bool isSaturated () const
 
bool isSaturated (unsigned int depth) const
 
bool isValid () const
 
bool isAboveDensity (float threshold) const
 
bool hasFreeTrack (size_t depth, float reserve) const
 
GCellGridgetGCellGrid () const
 
unsigned int getDepth () const
 
unsigned int getIndex () const
 
unsigned int getRow () const
 
unsigned int getColumn () const
 
GCellgetLeft () const
 
GCellgetRight () const
 
GCellgetUp () const
 
GCellgetDown () const
 
virtual void translate (const DbU::Unit &, const DbU::Unit &)
 
virtual Box getBoundingBox () const
 
DbU::Unit getX () const
 
DbU::Unit getY () const
 
DbU::Unit getXMax () const
 
DbU::Unit getYMax () const
 
Interval getSide (unsigned int) const
 
float getHCapacity () const
 
float getVCapacity () const
 
float getDensity (unsigned int flags=0) const
 
float getCDensity (unsigned int flags=0) const
 
float getWDensity (unsigned int depth, unsigned int flags=0) const
 
DbU::Unit getBlockage (unsigned int depth) const
 
float getFragmentation (unsigned int depth) const
 
float getFeedthroughs (unsigned int depth) const
 
float getGlobalsCount (unsigned int depth) const
 
const vector< AutoSegment * > & getHSegments () const
 
const vector< AutoSegment * > & getVSegments () const
 
const vector< AutoContact * > & getContacts () const
 
AutoSegments getHStartSegments ()
 
AutoSegments getVStartSegments ()
 
AutoSegments getHStopSegments ()
 
AutoSegments getVStopSegments ()
 
AutoSegments getStartSegments (unsigned int direction)
 
AutoSegments getStopSegments (unsigned int direction)
 
size_t getRoutingPads (set< RoutingPad *> &)
 
const KeygetKey () const
 
size_t checkDensity () const
 
bool checkEdgeSaturation (size_t hreserved, size_t vreserved) const
 
void addBlockage (unsigned int depth, DbU::Unit)
 
void addHSegment (AutoSegment *)
 
void addVSegment (AutoSegment *)
 
void addContact (AutoContact *)
 
void removeVSegment (AutoSegment *)
 
void removeHSegment (AutoSegment *)
 
void removeContact (AutoContact *)
 
void updateContacts ()
 
size_t updateDensity ()
 
void updateKey (unsigned int depth)
 
void rpDesaturate (set< Net *> &)
 
bool stepDesaturate (unsigned int depth, set< Net *> &, AutoSegment *&moved, unsigned int flags=0)
 
bool stepNetDesaturate (unsigned int depth, set< Net *> &globalNets, SetIndex &invalidateds)
 

Static Public Member Functions

static size_t getAllocateds ()
 
static DbU::Unit getTopRightShrink ()
 
static const NamegetStaticName ()
 

Detailed Description

Routing Global Cell.

GCell Description

Please note that there are two kind of Global Cells (or GCell for short):

The area of the design to be routed is divided in a regular grid of rectangular area, the GCellGrid. Each rectangular area is a GCell.

The GCell contains the following informations:

AutoContacts are affected to GCells, the area of the GCell is the one into which the AutoContact is allowed to be placed. It is this that way that the respect of the global routing choosen by Knik is enforced. See the AutoContact constraint box.

When tracks are aligned with the GCell boundaries they one exactly on the boundary can belong to the GCell on either side of the boundary. But we want a clear and mutually exclusive ownership of each GCell area. So, we choose that one GCell do not own the topmost and rightmost track. And to implement it, we shrink top and right coordinates by the amount of GCell::getTopRightShrink(), which must be less than the track spacing.

Saturation & Density Computation

At any depth (i.e. layer), in the preferred routing direction, a GCell can pass a finite length of wire. For example on an horizontal preferred layer:

\[ WL_{max} = width(GCell) \times Htracks(GCell) \]

Then the density, is the ratio between $WL_{max}$ and the actually used wirelength:

\[ Wdensity(depth) = \frac{WL_{used}(depth)}{WL_{max}(depth)} \]

Normally, the ratio musn't exceed 1.0, but the occupied wire length computation, for now, doesn't merge overlapping wires belonging to the same net, so the ratio may be slightly inaccurate. Thus in some pathological cases may be greater than 1.0 whithout truly been overloaded.

A Cell is considered as saturated if the overall density is above the saturation ratio given by Session::getSaturateRatio().

Contact density is calculated as follow:

\[ Cont_{density} = \frac{|Contacts|}{Htracks \times Vtracks \times 4} \]

It is a ratio over the number of actual contacts in the GCell and the maximal number. The maximal number being the product of the number of tracks in both direction and 4 stands for the hardwired number of layers (the depth).

Should not be hardwired... To be corrected in future versions.

Feedthrough Computation

The feedtrough value is an estimate is of how many complete tracks have been used on a given layer of the GCell. It varies between zero and the number of track on the GCell (complete saturation). As an estimate, it doesn't tell you the actual number of free track, but how many you may expect assuming the routing is reasonably well done.

Computation is done as follow:

Wire typeEstimated Cost
Straight wire (feedthrough) 1.0
Beginning or ending global wire 0.5
Local wire. 1/3
Blockage wire The exact percentage of the track

Track Computation

The number of track that can go through a GCell in the horizontal direction is computed as follow:

\[ Htracks = \frac{heigth(GCell)}{Vpitch} + 1 \]

The pitch is assumed to be the same for every layer and is hardwired to 5.0 lambda.

This is a bad architectural choice. The informations pertaining to routing should be held at Kite level, not be hardwired and the pitch should be made variable with the layer... To be corrected in future versions.

GCell Lazy Evaluation

To save processing time, the densities are not recomputed every time a segment is modified (added, removed or moved). Instead a lazy evaluation mechanism is used. Densities are recomputed each time a density is queried and the lazy evaluation not explicitly disabled (flag NoUpdate).

GCell Sorting Key

In order to perform a lexicographical sort on the tuple $(density(depth),id)$ of a GCell, a specific slave object GCell::Key is introduced. It is the density on one specific depth, not the average density.

GCell Desaturation / Layer Assignment

In addition to it's geometrical and density functionality, the GCell provides desaturation capabilities. Desaturation is the operation of moving up feedthough AutoSegment from the bottom layers towards the upper ones in order to balance the densities in the different densities. Thoses operations provides building blocks for the layer assignment stage which is provided by the Kabatic tool.

Two strategies are avalaibles, moving one global AutoSegment at a time with GCell::stepDesaturate() or, when one AutoSegment is moved up, move up the whole net trunk with GCell::stepNetDesaturate().

GCell Implantation

GCell derives from Hurricane::ExtensionGo to allow a graphical rendering of the routing density.

Member Typedef Documentation

◆ SetIndex

typedef set< GCell *, CompareByIndex > SetIndex

Shorthand for a set of GCell sorted on their index.

Member Function Documentation

◆ getAllocateds()

size_t getAllocateds ( )
static

Returns: The number of allocated GCells.

◆ getTopRightShrink()

DbU::Unit getTopRightShrink ( )
static

Returns: The amount of shrink on the top and right boundaries.

◆ getStaticName()

const Name & getStaticName ( )
static

Returns: The name of the Go slice: "Katabatic::GCell".

See also
Hurricane::ExtensionGo

◆ getName()

const Name & getName ( ) const
virtual

Returns: The name of the Go slice: "Katabatic::GCell".

See also
Hurricane::ExtensionGo

Referenced by GCell::checkDensity().

◆ isSaturated() [1/2]

bool isSaturated ( ) const
inline

Returns: true if at least one layer exceed a saturation of 1.0 (more wirelength that it can hold).

Referenced by GCell::checkDensity(), GCell::stepDesaturate(), and GCell::updateDensity().

◆ isSaturated() [2/2]

bool isSaturated ( unsigned int  depth) const

Returns: true if the saturation ratio of layer depth is over the threshold defined for the GCells.

References GCell::getDensity(), and Session::getSaturateRatio().

◆ isValid()

bool isValid ( ) const
inline

◆ isAboveDensity()

bool isAboveDensity ( float  threshold) const

Returns: true if the overall saturation ratio greater than threshold.

References GCell::getDensity(), GCell::isValid(), and GCell::updateDensity().

◆ hasFreeTrack()

bool hasFreeTrack ( size_t  depth,
float  reserve 
) const

◆ getGCellGrid()

GCellGrid * getGCellGrid ( ) const
inline

◆ getDepth()

unsigned int getDepth ( ) const
inline

Returns: The depth (i.e. number of routing layers) of the GCell.

◆ getIndex()

unsigned int getIndex ( ) const
inline

Returns: The linear index of the GCell in the GCellGrid vector.

See also
GCellGrid for the meaning of the index.

Referenced by AutoSegment::canMoveUp(), GCell::hasFreeTrack(), and GCell::stepDesaturate().

◆ getRow()

unsigned int getRow ( ) const

Returns: The row of the GCell in the GCellGrid.

References BaseGrid::getRow().

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

◆ getColumn()

unsigned int getColumn ( ) const

Returns: The Column of the GCell in the GCellGrid.

References BaseGrid::getColumn().

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

◆ getLeft()

GCell * getLeft ( ) const

Returns: The left neighbor of the GCell (NULL if it is the leftmost GCell).

References GCell::getGCellGrid(), and Grid< GCellT >::getGCellLeft().

Referenced by AutoVertical::canMoveULeft(), and AutoVertical::moveULeft().

◆ getRight()

GCell * getRight ( ) const

◆ getUp()

GCell * getUp ( ) const

◆ getDown()

GCell * getDown ( ) const

Returns: The bottom neighbor of the GCell (NULL if it is the bottommost GCell).

References Grid< GCellT >::getGCellDown(), and GCell::getGCellGrid().

Referenced by AutoHorizontal::canMoveULeft(), and AutoHorizontal::moveULeft().

◆ translate()

void translate ( const DbU::Unit ,
const DbU::Unit  
)
virtual

Required to exists as a Hurricane::Go derived class. But must never be used...

◆ getBoundingBox()

Box getBoundingBox ( ) const
virtual

Returns: The bounding box of the GCell, with the top right shrink applied.

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

◆ getX()

DbU::Unit getX ( ) const
inline

◆ getY()

DbU::Unit getY ( ) const
inline

◆ getXMax()

DbU::Unit getXMax ( ) const
inline

Returns: The upper right X coordinate of the GCell box (top right shrink applied).

References Box::getXMax().

Referenced by AutoHorizontal::_makeDogleg(), AutoSegment::getExtremity(), and AutoContact::setCBXMax().

◆ getYMax()

DbU::Unit getYMax ( ) const
inline

Returns: The upper right Y coordinate of the GCell box (top right shrink applied).

References Box::getYMax().

Referenced by AutoVertical::_makeDogleg(), AutoSegment::getExtremity(), and AutoContact::setCBYMax().

◆ getSide()

Interval getSide ( unsigned int  direction) const

◆ getHCapacity()

float getHCapacity ( ) const
Returns
The number of track that can go through the GCell in the horizontal direction. For a detailed explanation of the computation see Track Computation.

References Box::getHeight().

Referenced by GCell::hasFreeTrack(), and GCell::updateDensity().

◆ getVCapacity()

float getVCapacity ( ) const
Returns
The number of track that can go through the GCell in the vertical direction. For a detailed explanation of the computation see Track Computation.

References Box::getWidth().

Referenced by GCell::hasFreeTrack(), and GCell::updateDensity().

◆ getDensity()

float getDensity ( unsigned int  flags = 0) const

◆ getCDensity()

float getCDensity ( unsigned int  flags = 0) const
inline

◆ getWDensity()

float getWDensity ( unsigned int  depth,
unsigned int  flags = 0 
) const
inline

◆ getBlockage()

DbU::Unit getBlockage ( unsigned int  depth) const
inline

Returns: The total length of blockage wire on layer at depth.

◆ getFragmentation()

float getFragmentation ( unsigned int  depth) const
inline

Returns: The longest free fragment size on layer depth (in percent).

References GCell::isValid(), and GCell::updateDensity().

Referenced by AutoSegment::canMoveUp().

◆ getFeedthroughs()

float getFeedthroughs ( unsigned int  depth) const
inline

Returns: The estimate number of occupied tracks on layer depth.

See also
Feedthrough Computation

References GCell::isValid(), and GCell::updateDensity().

◆ getGlobalsCount()

float getGlobalsCount ( unsigned int  depth) const
inline

Returns: The number of global wires that go completly through the GCell at layer depth. This do not includes the global wires that begins or ends in the GCell.

References GCell::isValid(), and GCell::updateDensity().

◆ getHSegments()

const vector< AutoSegment * > & getHSegments ( ) const
inline
Returns
The vector of all horizontal AutoSegments that completly goes through the GCell.

◆ getVSegments()

const vector< AutoSegment * > & getVSegments ( ) const
inline
Returns
The vector of all vertical AutoSegments that completly goes through the GCell.

◆ getContacts()

const vector< AutoContact * > & getContacts ( ) const
inline
Returns
The vector of all AutoContacts owned by the GCell.

◆ getHStartSegments()

AutoSegments getHStartSegments ( )
Returns
A Collection of the horizontal AutoSegments that starts from this GCell.

References Katabatic::KbHorizontal, and Katabatic::KbSource.

Referenced by GCell::getStartSegments().

◆ getVStartSegments()

AutoSegments getVStartSegments ( )
Returns
A Collection of the vertical AutoSegments that starts from this GCell.

References Katabatic::KbSource, and Katabatic::KbVertical.

Referenced by GCell::getStartSegments().

◆ getHStopSegments()

AutoSegments getHStopSegments ( )
Returns
A Collection of the horizontal AutoSegments that stops in this GCell.

References Katabatic::KbHorizontal, and Katabatic::KbTarget.

Referenced by GCell::getStopSegments().

◆ getVStopSegments()

AutoSegments getVStopSegments ( )
Returns
A Collection of the vertical AutoSegments that stops in this GCell.

References Katabatic::KbTarget, and Katabatic::KbVertical.

Referenced by GCell::getStopSegments().

◆ getStartSegments()

AutoSegments getStartSegments ( unsigned int  direction)
inline
Returns
A Collection of the horizontal or vertical AutoSegments that starts from this GCell according to direction.

References GCell::getHStartSegments(), GCell::getVStartSegments(), and Katabatic::KbHorizontal.

◆ getStopSegments()

AutoSegments getStopSegments ( unsigned int  direction)
inline
Returns
A Collection of the horizontal or vertical AutoSegments that stops in this GCell according to direction.

References GCell::getHStopSegments(), GCell::getVStopSegments(), and Katabatic::KbHorizontal.

◆ getRoutingPads()

size_t getRoutingPads ( set< RoutingPad *> &  rps)
Returns
The size of the RoutingPad set.

Fills the rps set with all the RoutingPads that appears in this GCell. (looks at all the anchors of the owned AutoContact)

Referenced by GCell::rpDesaturate().

◆ getKey()

const Key & getKey ( ) const
inline
Returns
The sorting key of the GCell.
See also
GCell Sorting Key

◆ checkDensity()

size_t checkDensity ( ) const
Returns
1 if the GCell is saturated, 0 otherwise.

Check, if the GCell is saturated, layer by layer. Issue a warning if that is the case.

References Session::doWarnGCellOverload(), GCell::getColumn(), GCell::getName(), Session::getRoutingGauge(), GCell::getRow(), Session::isInDemoMode(), GCell::isSaturated(), GCell::isValid(), and GCell::updateDensity().

Referenced by GCell::updateDensity().

◆ checkEdgeSaturation()

bool checkEdgeSaturation ( size_t  hreserved,
size_t  vreserved 
) const
Returns
true if the Up/Right edge is over the threshold.

Check if the number of AutoSegments crossing the Up & Right edges of the GCell exceed threshold. The thresold must be expressed as a percentage of the full capacity of the edges. The overload is computed as a whole and not depth by depth.

References GCell::getGCellGrid(), GCellGrid::getHEdgeCapacity(), GCell::getRight(), GCell::getUp(), GCellGrid::getVEdgeCapacity(), AutoSegment::isLocal(), and Session::lookup().

◆ addBlockage()

void addBlockage ( unsigned int  depth,
DbU::Unit  length 
)

Adds length of wire blockage to layer depth.

References DbU::getValueString().

◆ addHSegment()

void addHSegment ( AutoSegment segment)
inline

Adds segment to the list of horizontal feedthroughs.

Referenced by AutoHorizontal::_postCreate(), AutoVertical::moveULeft(), and AutoVertical::moveURight().

◆ addVSegment()

void addVSegment ( AutoSegment segment)
inline

Adds segment to the list of vertical feedthroughs.

Referenced by AutoVertical::_postCreate(), AutoHorizontal::moveULeft(), and AutoHorizontal::moveURight().

◆ addContact()

void addContact ( AutoContact contact)
inline

Adds contact to the list of contacts owned by this GCell.

Referenced by AutoContact::setGCell().

◆ removeVSegment()

void removeVSegment ( AutoSegment segment)

Removes segment to the list of vertical feedthroughs.

Referenced by AutoVertical::_makeDogleg(), AutoVertical::_preDestroy(), AutoHorizontal::moveULeft(), and AutoHorizontal::moveURight().

◆ removeHSegment()

void removeHSegment ( AutoSegment segment)

Removes segment to the list of horizontal feedthroughs.

Referenced by AutoHorizontal::_makeDogleg(), AutoHorizontal::_preDestroy(), AutoVertical::moveULeft(), and AutoVertical::moveURight().

◆ removeContact()

void removeContact ( AutoContact contact)

Removes contact to the list of contacts owned by this GCell.

References AutoContact::base().

◆ updateContacts()

void updateContacts ( )

Force a geometry update on all the AutoContact of the GCell.

◆ updateDensity()

size_t updateDensity ( )

◆ updateKey()

void updateKey ( unsigned int  depth)
inline

Update the GCell key with the new density at layer depth.

See also
GCell Sorting Key.

References GCell::Key::update().

◆ rpDesaturate()

bool rpDesaturate ( set< Net *> &  nets)

If the number of RoutingPad in the first routing layer exceed the Session::getSaturateRp() threshold, force a desaturation of layer depth 1 until it is below 0.5.

See also
GCell Desaturation / Layer Assignment

References Session::getRoutingLayer(), GCell::getRoutingPads(), Session::getSaturateRp(), Katabatic::KbForceMove, and GCell::stepDesaturate().

◆ stepDesaturate()

bool stepDesaturate ( unsigned int  depth,
set< Net *> &  globalNets,
AutoSegment *&  moved,
unsigned int  flags = 0 
)
Parameters
depthThe depth to desaturate.
globalNetsThe set of Nets of which at least one segment has been moved up.
movedThe moved up AutoSegment.
flagsIf KbForceMove is set, force one AutoSegment to move up, event if the GCell is not saturated in the relevant depth.

Returns: true if an AutoSegment has actually been moved up.

Perform the atomic desaturation, that is move up one AutoSegment from layer depth to layer depth+2, longuests AutoSegments are moved first. Only global feedthrough AutoSegments are candidates to be moved up. The Net owning the moved up segment is added to the globalNets set. If the GCell is not saturated on layer depth, nothing is done. If the forced flag is set, one global AutoSegment is moved up regardless of the saturation status.

See also
GCell Desaturation / Layer Assignment

References GCell::getIndex(), RoutingGauge::getLayerDepth(), Session::getRoutingGauge(), GCell::isSaturated(), Katabatic::KbForceMove, Katabatic::KbHorizontal, Katabatic::KbVertical, and GCell::updateDensity().

Referenced by GCell::rpDesaturate().

◆ stepNetDesaturate()

bool stepNetDesaturate ( unsigned int  depth,
set< Net *> &  globalNets,
GCell::SetIndex invalidateds 
)
Parameters
depthThe depth to desaturate.
globalNetsThe set of Nets of which at least one segment has been moved up.
invalidatedsThe set of GCell ids that have been invalidateds.

Returns: true if a Net has been moved up.

Perform a desaturation by whole Net trunk. Select the longest feedthrough AutoSegment in layer depth, then attempt to move up the whole Net (all it's global AutoSegments are moved up).

See also
GCell Desaturation / Layer Assignment

References GCell::getGCellGrid(), RoutingGauge::getLayerDepth(), Session::getRoutingGauge(), Katabatic::KbHorizontal, Katabatic::KbVertical, and GCell::updateDensity().


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


Generated by doxygen 1.8.14 on Sun Nov 21 2021 Return to top of page
Katabatic - Routing Toolbox Copyright © 2008-2020 Sorbonne Universite. All rights reserved