2010-03-09 09:24:55 -06:00
|
|
|
// -*- C++ -*-
|
|
|
|
//
|
|
|
|
// This file is part of the Coriolis Software.
|
2016-03-06 05:37:30 -06:00
|
|
|
// Copyright (c) UPMC 2008-2016, All Rights Reserved
|
2010-03-09 09:24:55 -06:00
|
|
|
//
|
2013-12-03 18:59:29 -06:00
|
|
|
// +-----------------------------------------------------------------+
|
2010-03-09 09:24:55 -06:00
|
|
|
// | C O R I O L I S |
|
|
|
|
// | K i t e - D e t a i l e d R o u t e r |
|
|
|
|
// | |
|
|
|
|
// | Author : Jean-Paul CHAPUT |
|
|
|
|
// | E-mail : Jean-Paul.Chaput@asim.lip6.fr |
|
|
|
|
// | =============================================================== |
|
|
|
|
// | C++ Module : "./TrackElement.cpp" |
|
2013-12-03 18:59:29 -06:00
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
|
|
|
|
|
|
|
|
#include <limits>
|
|
|
|
#include <sstream>
|
|
|
|
#include "hurricane/Bug.h"
|
|
|
|
#include "hurricane/Warning.h"
|
|
|
|
#include "hurricane/Net.h"
|
|
|
|
#include "hurricane/Name.h"
|
|
|
|
#include "katabatic/AutoContact.h"
|
|
|
|
#include "katabatic/GCell.h"
|
|
|
|
#include "crlcore/RoutingGauge.h"
|
|
|
|
#include "kite/DataNegociate.h"
|
|
|
|
#include "kite/TrackElement.h"
|
|
|
|
#include "kite/TrackCost.h"
|
|
|
|
#include "kite/Track.h"
|
|
|
|
#include "kite/Session.h"
|
|
|
|
#include "kite/RoutingEvent.h"
|
|
|
|
#include "kite/NegociateWindow.h"
|
2010-03-09 09:24:55 -06:00
|
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace Hurricane;
|
|
|
|
using namespace CRL;
|
|
|
|
using namespace Kite;
|
|
|
|
|
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
void dummyOverlapCost ( const TrackElement* segment, TrackCost& cost )
|
2010-03-09 09:24:55 -06:00
|
|
|
{
|
|
|
|
cerr << Warning("No overlapCost callback has been set (%s)."
|
|
|
|
,getString(segment).c_str()) << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
} // Anonymous namespace.
|
2010-03-09 09:24:55 -06:00
|
|
|
|
|
|
|
|
|
|
|
namespace Kite {
|
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
using Hurricane::tab;
|
2010-03-09 09:24:55 -06:00
|
|
|
using Hurricane::Bug;
|
|
|
|
using Hurricane::Net;
|
|
|
|
using Hurricane::Name;
|
2010-12-12 15:42:57 -06:00
|
|
|
using Katabatic::GCell;
|
2010-03-09 09:24:55 -06:00
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
2013-12-03 18:59:29 -06:00
|
|
|
// Comparison Classes.
|
|
|
|
//
|
|
|
|
// Return: lhs < rhs.
|
|
|
|
|
2010-03-09 09:24:55 -06:00
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
bool Compare::operator() ( TrackElement* lhs, TrackElement* rhs )
|
|
|
|
{ return lhs->getFreedomDegree() > rhs->getFreedomDegree(); }
|
2010-03-09 09:24:55 -06:00
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
|
|
|
|
bool CompareByPosition::operator() ( const TrackElement* lhs, const TrackElement* rhs ) const
|
2010-03-09 09:24:55 -06:00
|
|
|
{
|
2013-12-03 18:59:29 -06:00
|
|
|
if (lhs == rhs) return false;
|
2010-03-09 09:24:55 -06:00
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
if (lhs->isBlockage() xor rhs->isBlockage()) return lhs->isBlockage();
|
2010-03-09 09:24:55 -06:00
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
if (lhs->getLength() < rhs->getLength()) return true;
|
|
|
|
if (lhs->getLength() > rhs->getLength()) return false;
|
2010-03-09 09:24:55 -06:00
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
if (lhs->isHorizontal() xor rhs->isHorizontal()) return rhs->isHorizontal();
|
2010-03-09 09:24:55 -06:00
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
if (lhs->getAxis() > rhs->getAxis()) return true;
|
|
|
|
if (lhs->getAxis() < rhs->getAxis()) return false;
|
2010-03-09 09:24:55 -06:00
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
if (lhs->getSourceU() > rhs->getSourceU()) return true;
|
|
|
|
if (lhs->getSourceU() < rhs->getSourceU()) return false;
|
2010-03-09 09:24:55 -06:00
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
if (lhs->isBlockage() and rhs->isBlockage()) return false;
|
2010-03-09 09:24:55 -06:00
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
return lhs->getId() < rhs->getId();
|
|
|
|
}
|
2010-03-09 09:24:55 -06:00
|
|
|
|
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "SegmentObserver".
|
2010-03-09 09:24:55 -06:00
|
|
|
|
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
void SegmentObserver::notify ( unsigned int flags )
|
|
|
|
{
|
|
|
|
TrackElement* segment = getOwner();
|
Support of RoutingGauge, part 2.
In Katabatic & Kite, remove all hard-coded values related to track pitches.
* New: In <Session>, add more convenience function to access RoutingGauge
characteristics.
* New: In <AutoSegment>, <AutoContact>, add support for the "depth spin",
that is, if the source/target contacts are going "top" or "down".
Used to compute the perpandicular pitch. Need a small modification
of the revalidation mechanism. The observers of <AutoSegment> are
notified when the spin changes.
* New: In <AutoSegment>, the getPPitch() method allow to compute the
"perpandicular pitch". For now it is simply the greatest from the
source perpandicular pitch and the target perpandicular pitch.
Make uses of the "depth spin".
* New: In <TrackElement>, <TrackSegment>, cache the perpandicular pitch.
Updated through the notification from the observable.
2014-05-19 10:58:38 -05:00
|
|
|
if (flags & AutoSegment::Invalidate) {
|
|
|
|
if (not segment->isInvalidated()) {
|
2016-05-17 16:00:06 -05:00
|
|
|
cdebug.log(159) << "::notify() <Invalidate> on " << segment << endl;
|
Support of RoutingGauge, part 2.
In Katabatic & Kite, remove all hard-coded values related to track pitches.
* New: In <Session>, add more convenience function to access RoutingGauge
characteristics.
* New: In <AutoSegment>, <AutoContact>, add support for the "depth spin",
that is, if the source/target contacts are going "top" or "down".
Used to compute the perpandicular pitch. Need a small modification
of the revalidation mechanism. The observers of <AutoSegment> are
notified when the spin changes.
* New: In <AutoSegment>, the getPPitch() method allow to compute the
"perpandicular pitch". For now it is simply the greatest from the
source perpandicular pitch and the target perpandicular pitch.
Make uses of the "depth spin".
* New: In <TrackElement>, <TrackSegment>, cache the perpandicular pitch.
Updated through the notification from the observable.
2014-05-19 10:58:38 -05:00
|
|
|
segment->invalidate();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flags & AutoSegment::Revalidate) {
|
|
|
|
// Revalidation must be delayed until *all* the AutoSegments have been revalidated.
|
|
|
|
// if (segment->isInvalidated()) {
|
2016-05-17 16:00:06 -05:00
|
|
|
// cdebug.log(159) << "::notify() <Revalidate> on " << segment << endl;
|
Support of RoutingGauge, part 2.
In Katabatic & Kite, remove all hard-coded values related to track pitches.
* New: In <Session>, add more convenience function to access RoutingGauge
characteristics.
* New: In <AutoSegment>, <AutoContact>, add support for the "depth spin",
that is, if the source/target contacts are going "top" or "down".
Used to compute the perpandicular pitch. Need a small modification
of the revalidation mechanism. The observers of <AutoSegment> are
notified when the spin changes.
* New: In <AutoSegment>, the getPPitch() method allow to compute the
"perpandicular pitch". For now it is simply the greatest from the
source perpandicular pitch and the target perpandicular pitch.
Make uses of the "depth spin".
* New: In <TrackElement>, <TrackSegment>, cache the perpandicular pitch.
Updated through the notification from the observable.
2014-05-19 10:58:38 -05:00
|
|
|
// segment->revalidate( true );
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
|
|
|
|
if (flags & AutoSegment::RevalidatePPitch) {
|
|
|
|
segment->updatePPitch();
|
2013-12-03 18:59:29 -06:00
|
|
|
}
|
2010-03-09 09:24:55 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "TrackElement".
|
|
|
|
|
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
SegmentOverlapCostCB* TrackElement::_overlapCostCallback = dummyOverlapCost;
|
2010-03-09 09:24:55 -06:00
|
|
|
|
|
|
|
|
|
|
|
SegmentOverlapCostCB* TrackElement::setOverlapCostCB ( SegmentOverlapCostCB* cb )
|
|
|
|
{
|
|
|
|
SegmentOverlapCostCB* oldCb = _overlapCostCallback;
|
|
|
|
_overlapCostCallback = cb;
|
|
|
|
return oldCb;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
// Wrapped AutoSegment Functions.
|
|
|
|
AutoSegment* TrackElement::base () const { return NULL; }
|
|
|
|
bool TrackElement::isFixed () const { return false; }
|
|
|
|
bool TrackElement::isLocal () const { return true; }
|
|
|
|
bool TrackElement::isGlobal () const { return not isLocal(); }
|
|
|
|
bool TrackElement::isBipoint () const { return false; }
|
|
|
|
bool TrackElement::isTerminal () const { return false; }
|
|
|
|
bool TrackElement::isStrongTerminal ( unsigned int ) const { return false; }
|
|
|
|
bool TrackElement::isStrap () const { return false; }
|
|
|
|
bool TrackElement::isSlackened () const { return false; }
|
|
|
|
bool TrackElement::isDogleg () const { return false; }
|
Added support for "same layer" dogleg. Big fix for pad routing.
* Change: In Knik, in Vertex, add a "blocked" flag to signal disabled
vertexes in the grid (must not be used by the global router).
Modificate the Graph::getVertex() method so that when a vertex
is geometrically queried, if is a blocked one, return a non-blocked
neighbor. This mechanism is introduced to, at last, prevent the
global router to go *under* the pad in case of a commplete chip.
* New: In Katabatic, in AutoSegment, a new state has been added: "reduced".
A reduced segment is in the same layer as it's perpandiculars.
To be reduced, a segments has to be connected on source & target to
AutoContactTurn, both of the perpandiculars must be of the same layer
(below or above) and it's length must not exceed one pitch in the
perpandicular direction.
To reduce an AutoSegment, call ::reduce() and to revert the state,
call ::raise(). Two associated predicates are associated:
::canReduce() and ::mustRaise().
Note: No two adjacent segments can be reduced at the same time.
* Bug: In Katabatic, in GCellTopology, add a new method ::doRp_AccessPad()
to connect to the pads. Create wiring, fixed and non managed by
Katabatic, to connect the pad connector layer to the lowest routing
layers (depth 1 & 2). The former implementation was sometimes leading
to gaps (sheared contact) that *must not* occurs during the building
stage.
Remark: This bug did put under the light the fact that the initial
wiring must be created without gaps. Gaps are closed by making doglegs
on contacts. But this mechanism could only work when the database if
fully initialised (the cache is up to date). Otherwise various problems
arise, in the canonization process for example.
* New: In Katabatic, in AutoContactTerminal::getNativeConstraintBox(),
when anchored on a RoutingPad, now take account the potential rotation
of the Path's transformation. Here again, for the chip's pads.
* New: In Kite, support for reduced AutoSegment. TrackSegment associateds
to reduced AutoSegment are *not* inserted into track to become
effectively invisibles. When a segment becomes reduced, a TrackEvent
is generated to remove it. Conversely when it is raised a RoutingEvent
is created/rescheduled to insert it. All this is mostly managed inside
the Session::revalidate() method.
* New: In Kite, in KiteEngine::createGlobalGraph(), in case of a chip,
mark all global routing vertexes (Knik) that are under a pad, as blockeds.
* Bug: In Cumulus, in PadsCorona.Side.getAxis(), inversion between X and
Y coordinate of the chip size. Did not show until a non-square chip
was routed (i.e. our MIPS R3000).
* Change: In Stratus1, in st_placement.py add the ClockBuffer class for
backward compatibility with the MIPS32 bench. Have to review this
functionnality coming from the deprecated placeAndroute.py.
In st_instance.py, no longer creates the Plug ring of a Net.
In my opinion it just clutter the display until the P&R is called.
Can re-enable later as an option (in Unicorn).
* Change: In Unicorn, in cgt.py, more reliable way of loading then running
user supplied scripts. Borrowed from alliance-checker-toolkit doChip.py .
2015-08-16 16:29:28 -05:00
|
|
|
bool TrackElement::isReduced () const { return false; }
|
2016-03-06 05:37:30 -06:00
|
|
|
bool TrackElement::isUTurn () const { return false; }
|
Implementation of pre-routing support (for clock-tree compliance).
* New: In Katabatic, in <AutoContact>, this class is no longer derived
from ExtentionGo. With the simplificated AutoContacts, there is no
reason to do so, and it will save some QuadTree insertions/deletions.
New factory function AutoContact::createFrom(Contact*) which try to
build an AutoContact on top of a Hurricane::Contact. Of course that
base contact *must fit* into one of the predefined Contact
configurations (Terminal, Turn, HTee or VTee).
NOTE: This implies that the pre-routed segments & contacts *are*
correctly articulated, which is not the case when a Cell is read
from disk in "ap" format. The pre-routing feature must be used for
now without any re-read from disk. We will implement a re-articulating
pre-process in the future.
* Change: In Katabatic, in <AutoContact> derived classes, the ::updateCache()
method now display an accurate error message if a segment is connected
but has no AutoSegment conterpart (i.e. the lookup fails).
* New: In Katabatic, in <AutoSegment>, the ::computeOptimal() method is
short-circuited for pre-routed segments, the optimal axis position is
considered to be the one it is currently on (i.e. we trust the designer).
* New: In Katabatic, in <KatabaticEngine>, the ::loadGlobalRouting()
method now accept a map of excluded nets (same as Knik). This map is
the one of pre-routed nets.
* New: In Katabatic, in layer assignment, do not try to displace fixed
segments...
* New: In Katabatic, in <AutoSegment>, new flag SegUserDefined and related
methods to know if a segment comes from the global router (Knik) or
is pre-routed (supplied by the user).
* New: In Kite, In <BuildPowerRails>, support (exclusion) for pre-routed
nets.
* New: In Kite, In <GraphicKiteEngine> new menu entry for running the
router on pre-routed nets ("Detailed Pre-Route"), also integrated
in the all-on-one route command.
* New: In Kite, In KiteEngine, new method ::_initDataBase() that group
all the initialisation steps. It is a mix of calls between Knik and
Kite initializations which are intertwinneds (may have to devellop
a shared common base at a later point). It creates the Knik grid,
then the Katabatic grid, then load pre-routed wires and power rails
and protect isolated RoutingPads.
Add support for a map of pre-routed nets (to be excluded for
Knik calls).
The method "::run()" now uses function flags, firstly to know if
it is managing pre-routed wires or general purposes ones.
* New: In Kite, in <NegociateWindow>, the "::run()" methods has now two
modes. The normal one and the 'KtPreRoutedStage' that is for routing
pre-routed nets. When in pre-route stage, the wires are fixed at the
end of this step.
* New: In Kite, in <TrackElement> add decorator for AutoSegment
isUsedDefined().
* New: In Kite, in <TrackSegment>, the various ::canDogleg() methods
returns false for a pre-routed (user-defined segment).
* New: In Kite, in PyKiteEngine, added new method runNegociatePreRouted().
2014-06-21 13:16:47 -05:00
|
|
|
bool TrackElement::isUserDefined () const { return false; }
|
2013-12-03 18:59:29 -06:00
|
|
|
// Predicates.
|
|
|
|
bool TrackElement::canSlacken () const { return false; }
|
|
|
|
bool TrackElement::canPivotUp ( float ) const { return false; };
|
|
|
|
bool TrackElement::canPivotDown ( float ) const { return false; };
|
|
|
|
bool TrackElement::canMoveUp ( float, unsigned int ) const { return false; };
|
|
|
|
bool TrackElement::canDogleg () { return false; };
|
|
|
|
bool TrackElement::canDogleg ( Interval ) { return false; };
|
|
|
|
bool TrackElement::canDogleg ( Katabatic::GCell*, unsigned int ) { return false; };
|
|
|
|
// Accessors.
|
|
|
|
unsigned long TrackElement::getId () const { return 0; }
|
|
|
|
unsigned long TrackElement::getFreedomDegree () const { return 0; }
|
Support of RoutingGauge, part 2.
In Katabatic & Kite, remove all hard-coded values related to track pitches.
* New: In <Session>, add more convenience function to access RoutingGauge
characteristics.
* New: In <AutoSegment>, <AutoContact>, add support for the "depth spin",
that is, if the source/target contacts are going "top" or "down".
Used to compute the perpandicular pitch. Need a small modification
of the revalidation mechanism. The observers of <AutoSegment> are
notified when the spin changes.
* New: In <AutoSegment>, the getPPitch() method allow to compute the
"perpandicular pitch". For now it is simply the greatest from the
source perpandicular pitch and the target perpandicular pitch.
Make uses of the "depth spin".
* New: In <TrackElement>, <TrackSegment>, cache the perpandicular pitch.
Updated through the notification from the observable.
2014-05-19 10:58:38 -05:00
|
|
|
DbU::Unit TrackElement::getPitch () const { return 0; }
|
|
|
|
DbU::Unit TrackElement::getPPitch () const { return 0; }
|
2013-12-03 18:59:29 -06:00
|
|
|
float TrackElement::getMaxUnderDensity ( unsigned int ) const { return 0.0; };
|
|
|
|
unsigned int TrackElement::getDoglegLevel () const { return 0; }
|
|
|
|
TrackElement* TrackElement::getParent () const { return NULL; }
|
|
|
|
Interval TrackElement::getSourceConstraints () const { return Interval(); }
|
|
|
|
Interval TrackElement::getTargetConstraints () const { return Interval(); }
|
|
|
|
DataNegociate* TrackElement::getDataNegociate ( unsigned int ) const { return NULL; }
|
|
|
|
TrackElements TrackElement::getPerpandiculars () { return new TrackElements_Perpandiculars(NULL); }
|
|
|
|
void TrackElement::invalidate () { }
|
|
|
|
TrackElement* TrackElement::getCanonical ( Interval& i ) { i=Interval(getSourceU(),getTargetU()); return this; }
|
|
|
|
TrackElement* TrackElement::getSourceDogleg () { return NULL; }
|
|
|
|
TrackElement* TrackElement::getTargetDogleg () { return NULL; }
|
|
|
|
// Mutators.
|
|
|
|
void TrackElement::setTrack ( Track* track ) { _track = track; }
|
|
|
|
void TrackElement::updateFreedomDegree () { }
|
|
|
|
void TrackElement::setDoglegLevel ( unsigned int ) { }
|
|
|
|
void TrackElement::swapTrack ( TrackElement* ) { }
|
|
|
|
void TrackElement::reschedule ( unsigned int ) { }
|
|
|
|
void TrackElement::detach () { }
|
|
|
|
void TrackElement::revalidate () { }
|
Support of RoutingGauge, part 2.
In Katabatic & Kite, remove all hard-coded values related to track pitches.
* New: In <Session>, add more convenience function to access RoutingGauge
characteristics.
* New: In <AutoSegment>, <AutoContact>, add support for the "depth spin",
that is, if the source/target contacts are going "top" or "down".
Used to compute the perpandicular pitch. Need a small modification
of the revalidation mechanism. The observers of <AutoSegment> are
notified when the spin changes.
* New: In <AutoSegment>, the getPPitch() method allow to compute the
"perpandicular pitch". For now it is simply the greatest from the
source perpandicular pitch and the target perpandicular pitch.
Make uses of the "depth spin".
* New: In <TrackElement>, <TrackSegment>, cache the perpandicular pitch.
Updated through the notification from the observable.
2014-05-19 10:58:38 -05:00
|
|
|
void TrackElement::updatePPitch () { }
|
2013-12-03 18:59:29 -06:00
|
|
|
void TrackElement::setAxis ( DbU::Unit, unsigned int flags ) { }
|
|
|
|
TrackElement* TrackElement::makeDogleg () { return NULL; }
|
|
|
|
TrackElement* TrackElement::makeDogleg ( Interval, unsigned int& ) { return NULL; }
|
|
|
|
TrackElement* TrackElement::makeDogleg ( Katabatic::GCell*, TrackElement*&, TrackElement*& ) { return NULL; }
|
|
|
|
void TrackElement::_postDoglegs ( TrackElement*&, TrackElement*& ) { }
|
|
|
|
bool TrackElement::moveAside ( unsigned int ) { return false; }
|
|
|
|
bool TrackElement::slacken ( unsigned int ) { return false; }
|
|
|
|
bool TrackElement::moveUp ( unsigned int ) { return false; }
|
|
|
|
bool TrackElement::moveDown ( unsigned int ) { return false; }
|
|
|
|
#if THIS_IS_DISABLED
|
|
|
|
void TrackElement::desalignate () { }
|
|
|
|
#endif
|
|
|
|
bool TrackElement::_check () const { return true; }
|
2010-03-09 09:24:55 -06:00
|
|
|
|
|
|
|
|
|
|
|
TrackElement::TrackElement ( Track* track )
|
2013-12-03 18:59:29 -06:00
|
|
|
: _flags (0)
|
|
|
|
, _track (track)
|
|
|
|
, _index ((size_t)-1)
|
|
|
|
, _sourceU (0)
|
|
|
|
, _targetU (0)
|
|
|
|
, _observer(this)
|
2010-03-09 09:24:55 -06:00
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
void TrackElement::_postCreate ()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
TrackElement::~TrackElement ()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
void TrackElement::_preDestroy ()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
void TrackElement::destroy ()
|
|
|
|
{
|
|
|
|
_preDestroy ();
|
|
|
|
delete this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TrackElement* TrackElement::getNext () const
|
|
|
|
{
|
|
|
|
size_t dummy = _index;
|
2013-12-03 18:59:29 -06:00
|
|
|
return _track->getNext( dummy, getNet() );
|
2010-03-09 09:24:55 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TrackElement* TrackElement::getPrevious () const
|
|
|
|
{
|
|
|
|
size_t dummy = _index;
|
2013-12-03 18:59:29 -06:00
|
|
|
return _track->getPrevious( dummy, getNet() );
|
2010-03-09 09:24:55 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-12-12 15:42:57 -06:00
|
|
|
Interval TrackElement::getFreeInterval () const
|
2010-03-09 09:24:55 -06:00
|
|
|
{
|
2013-12-03 18:59:29 -06:00
|
|
|
if (not _track) return Interval(false);
|
2010-03-09 09:24:55 -06:00
|
|
|
|
|
|
|
size_t begin = _index;
|
|
|
|
size_t end = _index;
|
2013-12-03 18:59:29 -06:00
|
|
|
return _track->expandFreeInterval( begin, end, Track::InsideElement, getNet() );
|
2010-03-09 09:24:55 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
size_t TrackElement::getGCells ( Katabatic::GCellVector& gcells ) const
|
2010-03-09 09:24:55 -06:00
|
|
|
{
|
2013-12-03 18:59:29 -06:00
|
|
|
vector<GCell*>().swap( gcells );
|
2010-03-09 09:24:55 -06:00
|
|
|
return gcells.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TrackElement::incOverlapCost ( Net* net, TrackCost& cost ) const
|
|
|
|
{
|
2013-12-03 18:59:29 -06:00
|
|
|
if (not _track or (getNet() == net)) return;
|
|
|
|
_overlapCostCallback( this, cost );
|
2010-03-09 09:24:55 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string TrackElement::_getTypeName () const
|
|
|
|
{ return "TrackElement"; }
|
|
|
|
|
|
|
|
|
|
|
|
string TrackElement::_getString () const
|
2013-12-03 18:59:29 -06:00
|
|
|
{ return "<"+_getTypeName()+">"; }
|
2010-03-09 09:24:55 -06:00
|
|
|
|
|
|
|
|
|
|
|
Record* TrackElement::_getRecord () const
|
|
|
|
{
|
2013-12-03 18:59:29 -06:00
|
|
|
Record* record = new Record( _getString() );
|
|
|
|
record->add( getSlot( "_flags", _track ) );
|
|
|
|
record->add( getSlot( "_track", _track ) );
|
|
|
|
record->add( getSlot( "_index", _index ) );
|
|
|
|
record->add( DbU::getValueSlot( "_sourceU", &_sourceU ) );
|
|
|
|
record->add( DbU::getValueSlot( "_targetU", &_targetU ) );
|
2010-03-09 09:24:55 -06:00
|
|
|
|
|
|
|
return record;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-12-03 18:59:29 -06:00
|
|
|
} // Kite namespace.
|