Anabatic transient commit 18. Port of Kite (Katana), Yeah, Baby! Yeah!
* Bug: In Hurricane, in StaticObservable::getObserver(), if the slot
pointer is NULL, do not try to access the owner. Returns NULL, so
the caller can be aware of the situation...
* Change: In Hurricane, in BreakpointWidget & ExceptionWidget some
cosmetic changes (fonts and window sizes).
* Bug: In Anabatic, In AutoHorizontal::getConstraints(), take into account
the constraints from the source AutoContact, as it holds the constraints
transmitted by the RoutingPads and sets up by propageConstraintsFromRp().
It is likely to be a bug affecting the original Katabatic as well.
* Change: In Anabatic, in RawGCellsUnder(), check that the segment is not
completly oustside the cell abutment box and truncate the coordinates
to the part that is inside. Use the "shrink" if we reach the east/north
border.
* Change: In Anabatic, in Configuration, no more decorator because we will
use a true derived relationship. Katana *derives* from *Anabatic* and do
not *decorate* it, so the Configuration can do the same. It also implies
that we directly create a Katana engine, not an Anabatic one.
* Change: In Anabatic, in Session, do not allow the opening of the Session
in a standalone fashion (with a static method). Instead it must be opened
using the relevant method of the Anabatic/Katana engine. This ensure we
are opening the right Session type.
* Change: In Anabatic, in AutoSegment_Aligneds() collection the seed segment
is not part of the collection by default, but will be included if the
Flags::WithSelf is set.
* Change: In Configuration, all the flags value are now defined in two steps.
Declared in the header and initialized in the module. This is to prevent
the fact that on some cases, in relation with the Python "extern C" part
modules, we need a true allocated variable. It was causing weird linking
problems.
A side effect is that they can no longer be used as entry is switches,
have to replace them by if/else.
* New: In Anabatic, new GCell::getNeighborAt() utility function.
* Bug: In Anabatic, in GCell::doGrid(), tag all the GCells of the grid with
the grid type... Back annote all the edges capacity (north & east) with
the reserved local capacity.
* New: Complete portage of Kite over Anabatic. The new engine is christened
"Katana" for Kite-Analogic. When it's capabilities and performances
will be on a part with Kite, it is to completly replace it (and take
back the "Kite" name). Preliminary tests seems to show that, contrary
to intuition (because built on a more complex/slower grid), it is even
slightly faster than Kite 8-).
2016-08-15 09:30:13 -05:00
|
|
|
// -*- C++ -*-
|
|
|
|
//
|
|
|
|
// This file is part of the Coriolis Software.
|
|
|
|
// Copyright (c) UPMC 2008-2016, All Rights Reserved
|
|
|
|
//
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
// | 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@lip6.fr |
|
|
|
|
// | =============================================================== |
|
|
|
|
// | C++ Module : "./TrackFixedSegment.cpp" |
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
|
|
|
|
|
|
|
|
#include <sstream>
|
|
|
|
#include "hurricane/Bug.h"
|
|
|
|
#include "hurricane/Warning.h"
|
|
|
|
#include "hurricane/Net.h"
|
|
|
|
#include "hurricane/Name.h"
|
|
|
|
#include "hurricane/RegularLayer.h"
|
|
|
|
#include "hurricane/Technology.h"
|
|
|
|
#include "hurricane/DataBase.h"
|
|
|
|
#include "hurricane/Horizontal.h"
|
|
|
|
#include "hurricane/Vertical.h"
|
|
|
|
#include "anabatic/AutoContact.h"
|
|
|
|
#include "crlcore/RoutingGauge.h"
|
|
|
|
#include "katana/DataNegociate.h"
|
|
|
|
#include "katana/TrackFixedSegment.h"
|
|
|
|
#include "katana/TrackCost.h"
|
|
|
|
#include "katana/Track.h"
|
|
|
|
#include "katana/Session.h"
|
|
|
|
#include "katana/RoutingEvent.h"
|
|
|
|
#include "katana/NegociateWindow.h"
|
|
|
|
#include "katana/KatanaEngine.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace Katana {
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using Hurricane::Warning;
|
|
|
|
using Hurricane::Bug;
|
|
|
|
using Hurricane::Error;
|
|
|
|
using Hurricane::Net;
|
|
|
|
using Hurricane::Name;
|
|
|
|
using Hurricane::RegularLayer;
|
|
|
|
using Hurricane::Technology;
|
|
|
|
using Hurricane::DataBase;
|
|
|
|
using Hurricane::Horizontal;
|
|
|
|
using Hurricane::Vertical;
|
|
|
|
using Anabatic::GCellsUnder;
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "TrackFixedSegment".
|
|
|
|
|
|
|
|
|
|
|
|
Net* TrackFixedSegment::_blockageNet = NULL;
|
|
|
|
|
|
|
|
|
|
|
|
TrackFixedSegment::TrackFixedSegment ( Track* track, Segment* segment )
|
|
|
|
: TrackElement (NULL)
|
|
|
|
, _segment (segment)
|
|
|
|
{
|
|
|
|
Box boundingBox = segment->getBoundingBox();
|
|
|
|
|
Replace "unsigned int" by "Flags" in all AutoSegments collections.
* Change: In Anabatic::AutoSegments collections, change the type of all
the flags that where in "unsigned int" (32 bits) to Flags (uint64_t)
as there is now more than 32 flags for functions.
* New: In Ababatic::Constants, added new flag Flags::WithPerpands, which
makes the number of flags tip over 32 bits, thus making mandatory
to uses Flags and not unsigned int.
* New: In Anabatic::AutoSegments_Perpandiculars, manage a new flag
Flags::WithDoglegs to allow to propagate through global segments that
are connecteds via doglegs on local segments. Meaning that there is
a good chance that they could be aligned.
Slighly change the way we propagate on aligned segments: no longer
check for VTee or HTee, but only for same direction and layer as
master.
* New: In Anabatic & Katana, replace all the "int", "long" and their
variants by the less implementation ambiguous "int32_t", "int64_t"
(and variant). This should help to better detect bit trucation in
flags.
Use the type to give a hint about the flags kind:
- Type "Flags", for flags shared among Anabatic & Katana
functions/methods (may also appear in some objects states).
- Type "uint32_t" for flags belonging to an object internal
state of from Hurricane functions flags (those should be
grouped in a Flag subclass in a perfect world).
2017-05-16 07:53:33 -05:00
|
|
|
uint32_t flags = TElemFixed | ((segment->getNet() == _blockageNet) ? TElemBlockage : 0);
|
Anabatic transient commit 18. Port of Kite (Katana), Yeah, Baby! Yeah!
* Bug: In Hurricane, in StaticObservable::getObserver(), if the slot
pointer is NULL, do not try to access the owner. Returns NULL, so
the caller can be aware of the situation...
* Change: In Hurricane, in BreakpointWidget & ExceptionWidget some
cosmetic changes (fonts and window sizes).
* Bug: In Anabatic, In AutoHorizontal::getConstraints(), take into account
the constraints from the source AutoContact, as it holds the constraints
transmitted by the RoutingPads and sets up by propageConstraintsFromRp().
It is likely to be a bug affecting the original Katabatic as well.
* Change: In Anabatic, in RawGCellsUnder(), check that the segment is not
completly oustside the cell abutment box and truncate the coordinates
to the part that is inside. Use the "shrink" if we reach the east/north
border.
* Change: In Anabatic, in Configuration, no more decorator because we will
use a true derived relationship. Katana *derives* from *Anabatic* and do
not *decorate* it, so the Configuration can do the same. It also implies
that we directly create a Katana engine, not an Anabatic one.
* Change: In Anabatic, in Session, do not allow the opening of the Session
in a standalone fashion (with a static method). Instead it must be opened
using the relevant method of the Anabatic/Katana engine. This ensure we
are opening the right Session type.
* Change: In Anabatic, in AutoSegment_Aligneds() collection the seed segment
is not part of the collection by default, but will be included if the
Flags::WithSelf is set.
* Change: In Configuration, all the flags value are now defined in two steps.
Declared in the header and initialized in the module. This is to prevent
the fact that on some cases, in relation with the Python "extern C" part
modules, we need a true allocated variable. It was causing weird linking
problems.
A side effect is that they can no longer be used as entry is switches,
have to replace them by if/else.
* New: In Anabatic, new GCell::getNeighborAt() utility function.
* Bug: In Anabatic, in GCell::doGrid(), tag all the GCells of the grid with
the grid type... Back annote all the edges capacity (north & east) with
the reserved local capacity.
* New: Complete portage of Kite over Anabatic. The new engine is christened
"Katana" for Kite-Analogic. When it's capabilities and performances
will be on a part with Kite, it is to completly replace it (and take
back the "Kite" name). Preliminary tests seems to show that, contrary
to intuition (because built on a more complex/slower grid), it is even
slightly faster than Kite 8-).
2016-08-15 09:30:13 -05:00
|
|
|
setFlags( flags );
|
|
|
|
|
|
|
|
if (track) {
|
Replace "unsigned int" by "Flags" in all AutoSegments collections.
* Change: In Anabatic::AutoSegments collections, change the type of all
the flags that where in "unsigned int" (32 bits) to Flags (uint64_t)
as there is now more than 32 flags for functions.
* New: In Ababatic::Constants, added new flag Flags::WithPerpands, which
makes the number of flags tip over 32 bits, thus making mandatory
to uses Flags and not unsigned int.
* New: In Anabatic::AutoSegments_Perpandiculars, manage a new flag
Flags::WithDoglegs to allow to propagate through global segments that
are connecteds via doglegs on local segments. Meaning that there is
a good chance that they could be aligned.
Slighly change the way we propagate on aligned segments: no longer
check for VTee or HTee, but only for same direction and layer as
master.
* New: In Anabatic & Katana, replace all the "int", "long" and their
variants by the less implementation ambiguous "int32_t", "int64_t"
(and variant). This should help to better detect bit trucation in
flags.
Use the type to give a hint about the flags kind:
- Type "Flags", for flags shared among Anabatic & Katana
functions/methods (may also appear in some objects states).
- Type "uint32_t" for flags belonging to an object internal
state of from Hurricane functions flags (those should be
grouped in a Flag subclass in a perfect world).
2017-05-16 07:53:33 -05:00
|
|
|
uint32_t depth = track->getDepth();
|
Anabatic transient commit 18. Port of Kite (Katana), Yeah, Baby! Yeah!
* Bug: In Hurricane, in StaticObservable::getObserver(), if the slot
pointer is NULL, do not try to access the owner. Returns NULL, so
the caller can be aware of the situation...
* Change: In Hurricane, in BreakpointWidget & ExceptionWidget some
cosmetic changes (fonts and window sizes).
* Bug: In Anabatic, In AutoHorizontal::getConstraints(), take into account
the constraints from the source AutoContact, as it holds the constraints
transmitted by the RoutingPads and sets up by propageConstraintsFromRp().
It is likely to be a bug affecting the original Katabatic as well.
* Change: In Anabatic, in RawGCellsUnder(), check that the segment is not
completly oustside the cell abutment box and truncate the coordinates
to the part that is inside. Use the "shrink" if we reach the east/north
border.
* Change: In Anabatic, in Configuration, no more decorator because we will
use a true derived relationship. Katana *derives* from *Anabatic* and do
not *decorate* it, so the Configuration can do the same. It also implies
that we directly create a Katana engine, not an Anabatic one.
* Change: In Anabatic, in Session, do not allow the opening of the Session
in a standalone fashion (with a static method). Instead it must be opened
using the relevant method of the Anabatic/Katana engine. This ensure we
are opening the right Session type.
* Change: In Anabatic, in AutoSegment_Aligneds() collection the seed segment
is not part of the collection by default, but will be included if the
Flags::WithSelf is set.
* Change: In Configuration, all the flags value are now defined in two steps.
Declared in the header and initialized in the module. This is to prevent
the fact that on some cases, in relation with the Python "extern C" part
modules, we need a true allocated variable. It was causing weird linking
problems.
A side effect is that they can no longer be used as entry is switches,
have to replace them by if/else.
* New: In Anabatic, new GCell::getNeighborAt() utility function.
* Bug: In Anabatic, in GCell::doGrid(), tag all the GCells of the grid with
the grid type... Back annote all the edges capacity (north & east) with
the reserved local capacity.
* New: Complete portage of Kite over Anabatic. The new engine is christened
"Katana" for Kite-Analogic. When it's capabilities and performances
will be on a part with Kite, it is to completly replace it (and take
back the "Kite" name). Preliminary tests seems to show that, contrary
to intuition (because built on a more complex/slower grid), it is even
slightly faster than Kite 8-).
2016-08-15 09:30:13 -05:00
|
|
|
Technology* technology = DataBase::getDB()->getTechnology();
|
|
|
|
const Layer* layer1 = track->getLayer()->getBlockageLayer();
|
|
|
|
RegularLayer* layer2 = dynamic_cast<RegularLayer*>(technology->getLayer(layer1->getMask()));
|
|
|
|
if ( layer2 ) {
|
|
|
|
Interval uside = track->getKatanaEngine()->getUSide( track->getDirection() );
|
|
|
|
Interval segside;
|
|
|
|
if (track->getDirection() == Flags::Horizontal) {
|
|
|
|
segside = Interval( boundingBox.getXMin(), boundingBox.getXMax() );
|
|
|
|
_sourceU = max( boundingBox.getXMin(), uside.getVMin());
|
|
|
|
_targetU = min( boundingBox.getXMax(), uside.getVMax());
|
|
|
|
} else {
|
|
|
|
segside = Interval( boundingBox.getYMin(), boundingBox.getYMax() );
|
|
|
|
_sourceU = max( boundingBox.getYMin(), uside.getVMin());
|
|
|
|
_targetU = min( boundingBox.getYMax(), uside.getVMax());
|
|
|
|
}
|
|
|
|
|
|
|
|
GCellsUnder gcells = track->getKatanaEngine()->getGCellsUnder( segment );
|
|
|
|
for ( size_t i=0 ; i<gcells->size() ; ++i ) {
|
|
|
|
GCell* gcell = gcells->gcellAt(i);
|
|
|
|
gcell->addBlockage
|
|
|
|
( depth, gcell->getSide( track->getDirection() ).getIntersection( segside ).getSize() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TrackFixedSegment::_postCreate ()
|
|
|
|
{ TrackElement::_postCreate(); }
|
|
|
|
|
|
|
|
|
|
|
|
TrackFixedSegment::~TrackFixedSegment ()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
void TrackFixedSegment::_preDestroy ()
|
|
|
|
{
|
|
|
|
cdebug_log(155,0) << "TrackFixedSegment::_preDestroy() - " << (void*)this << endl;
|
|
|
|
TrackElement::_preDestroy();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TrackElement* TrackFixedSegment::create ( Track* track, Segment* segment )
|
|
|
|
{
|
|
|
|
if ( not _blockageNet ) _blockageNet = Session::getBlockageNet();
|
|
|
|
|
|
|
|
TrackFixedSegment* trackFixedSegment = NULL;
|
|
|
|
if (track) {
|
|
|
|
trackFixedSegment = new TrackFixedSegment ( track, segment );
|
|
|
|
trackFixedSegment->_postCreate();
|
|
|
|
|
|
|
|
cdebug_log(159,0) << "Adding: " << segment << " on " << track << endl;
|
|
|
|
cdebug_log(159,0) << "TrackFixedSegment::create(): " << trackFixedSegment << endl;
|
|
|
|
|
|
|
|
Session::addInsertEvent( trackFixedSegment, track );
|
|
|
|
}
|
|
|
|
return trackFixedSegment;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
AutoSegment* TrackFixedSegment::base () const { return NULL; }
|
2016-08-27 09:02:22 -05:00
|
|
|
Segment* TrackFixedSegment::getSegment () const { return _segment; }
|
Anabatic transient commit 18. Port of Kite (Katana), Yeah, Baby! Yeah!
* Bug: In Hurricane, in StaticObservable::getObserver(), if the slot
pointer is NULL, do not try to access the owner. Returns NULL, so
the caller can be aware of the situation...
* Change: In Hurricane, in BreakpointWidget & ExceptionWidget some
cosmetic changes (fonts and window sizes).
* Bug: In Anabatic, In AutoHorizontal::getConstraints(), take into account
the constraints from the source AutoContact, as it holds the constraints
transmitted by the RoutingPads and sets up by propageConstraintsFromRp().
It is likely to be a bug affecting the original Katabatic as well.
* Change: In Anabatic, in RawGCellsUnder(), check that the segment is not
completly oustside the cell abutment box and truncate the coordinates
to the part that is inside. Use the "shrink" if we reach the east/north
border.
* Change: In Anabatic, in Configuration, no more decorator because we will
use a true derived relationship. Katana *derives* from *Anabatic* and do
not *decorate* it, so the Configuration can do the same. It also implies
that we directly create a Katana engine, not an Anabatic one.
* Change: In Anabatic, in Session, do not allow the opening of the Session
in a standalone fashion (with a static method). Instead it must be opened
using the relevant method of the Anabatic/Katana engine. This ensure we
are opening the right Session type.
* Change: In Anabatic, in AutoSegment_Aligneds() collection the seed segment
is not part of the collection by default, but will be included if the
Flags::WithSelf is set.
* Change: In Configuration, all the flags value are now defined in two steps.
Declared in the header and initialized in the module. This is to prevent
the fact that on some cases, in relation with the Python "extern C" part
modules, we need a true allocated variable. It was causing weird linking
problems.
A side effect is that they can no longer be used as entry is switches,
have to replace them by if/else.
* New: In Anabatic, new GCell::getNeighborAt() utility function.
* Bug: In Anabatic, in GCell::doGrid(), tag all the GCells of the grid with
the grid type... Back annote all the edges capacity (north & east) with
the reserved local capacity.
* New: Complete portage of Kite over Anabatic. The new engine is christened
"Katana" for Kite-Analogic. When it's capabilities and performances
will be on a part with Kite, it is to completly replace it (and take
back the "Kite" name). Preliminary tests seems to show that, contrary
to intuition (because built on a more complex/slower grid), it is even
slightly faster than Kite 8-).
2016-08-15 09:30:13 -05:00
|
|
|
DbU::Unit TrackFixedSegment::getAxis () const { return getTrack()->getAxis(); }
|
|
|
|
bool TrackFixedSegment::isHorizontal () const { return getTrack()->isHorizontal(); }
|
|
|
|
bool TrackFixedSegment::isVertical () const { return getTrack()->isVertical(); }
|
|
|
|
bool TrackFixedSegment::isFixed () const { return true; }
|
|
|
|
Flags TrackFixedSegment::getDirection () const { return getTrack()->getDirection(); }
|
|
|
|
const Layer* TrackFixedSegment::getLayer () const { return _segment->getLayer(); }
|
|
|
|
Interval TrackFixedSegment::getFreeInterval () const { return Interval(); }
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long TrackFixedSegment::getId () const
|
|
|
|
{
|
|
|
|
cerr << Error("::getId() called on %s.",_getString().c_str()) << endl;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Net* TrackFixedSegment::getNet () const
|
|
|
|
{
|
|
|
|
Net* realNet = _segment->getNet();
|
|
|
|
if (realNet->isSupply() or realNet->isClock())
|
|
|
|
return _blockageNet;
|
|
|
|
return realNet;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TrackElement* TrackFixedSegment::getNext () const
|
|
|
|
{
|
|
|
|
size_t dummy = _index;
|
|
|
|
return _track->getNext( dummy, getNet() );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TrackElement* TrackFixedSegment::getPrevious () const
|
|
|
|
{
|
|
|
|
size_t dummy = _index;
|
|
|
|
return _track->getPrevious( dummy, getNet() );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string TrackFixedSegment::_getTypeName () const
|
|
|
|
{ return "TrackFixedSegment"; }
|
|
|
|
|
|
|
|
|
|
|
|
string TrackFixedSegment::_getString () const
|
|
|
|
{
|
|
|
|
string s1 = _segment->_getString();
|
|
|
|
string s2 = " [" + DbU::getValueString(_sourceU)
|
|
|
|
+ ":" + DbU::getValueString(_targetU) + "]"
|
|
|
|
+ " " + DbU::getValueString(_targetU-_sourceU)
|
|
|
|
+ " [" + ((_track) ? getString(_index) : "npos") + "] "
|
|
|
|
+ "F"
|
|
|
|
+ ((isBlockage()) ? "B" : "-");
|
|
|
|
s1.insert ( s1.size()-1, s2 );
|
|
|
|
|
|
|
|
return s1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Record* TrackFixedSegment::_getRecord () const
|
|
|
|
{
|
|
|
|
Record* record = TrackElement::_getRecord();
|
|
|
|
record->add( getSlot( "_segment", _segment ) );
|
|
|
|
return record;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // Katana namespace.
|