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@asim.lip6.fr |
|
|
|
|
// | =============================================================== |
|
|
|
|
// | C++ Module : "./NegociateWindow.cpp" |
|
|
|
|
// +-----------------------------------------------------------------+
|
|
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <algorithm>
|
2017-05-09 11:33:55 -05:00
|
|
|
#include <fstream>
|
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
|
|
|
#include <iomanip>
|
|
|
|
#include "hurricane/Warning.h"
|
|
|
|
#include "hurricane/Bug.h"
|
|
|
|
#include "hurricane/RoutingPad.h"
|
|
|
|
#include "hurricane/Net.h"
|
|
|
|
#include "hurricane/Cell.h"
|
|
|
|
#include "crlcore/Utilities.h"
|
|
|
|
#include "crlcore/AllianceFramework.h"
|
|
|
|
#include "crlcore/Measures.h"
|
|
|
|
#include "crlcore/Histogram.h"
|
|
|
|
#include "anabatic/AutoContact.h"
|
|
|
|
#include "katana/DataNegociate.h"
|
|
|
|
#include "katana/TrackElement.h"
|
|
|
|
#include "katana/TrackMarker.h"
|
|
|
|
#include "katana/TrackCost.h"
|
|
|
|
#include "katana/Track.h"
|
|
|
|
#include "katana/TrackSegment.h"
|
|
|
|
#include "katana/RoutingPlane.h"
|
|
|
|
#include "katana/RoutingEventQueue.h"
|
|
|
|
#include "katana/RoutingEventHistory.h"
|
|
|
|
#include "katana/RoutingEventLoop.h"
|
|
|
|
#include "katana/NegociateWindow.h"
|
|
|
|
#include "katana/KatanaEngine.h"
|
|
|
|
|
|
|
|
|
|
|
|
namespace {
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace Hurricane;
|
|
|
|
using namespace CRL;
|
|
|
|
using namespace Katana;
|
|
|
|
|
|
|
|
|
|
|
|
void NegociateOverlapCost ( const TrackElement* segment, TrackCost& cost )
|
|
|
|
{
|
|
|
|
cdebug_log(9000,0) << "Deter| NegociateOverlapCost() " << segment << endl;
|
|
|
|
Interval intersect = segment->getCanonicalInterval();
|
|
|
|
|
|
|
|
if (not intersect.intersect(cost.getInterval())) return;
|
|
|
|
|
|
|
|
if (segment->isBlockage() or segment->isFixed()) {
|
|
|
|
cdebug_log(159,0) << "Infinite cost from: " << segment << endl;
|
|
|
|
cost.setInfinite ();
|
|
|
|
cost.setOverlap ();
|
|
|
|
cost.setHardOverlap();
|
|
|
|
cost.setBlockage ();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (cost.getInterval().getVMax() > intersect.getVMax()) cost.setLeftOverlap();
|
|
|
|
if (cost.getInterval().getVMin() < intersect.getVMin()) cost.setRightOverlap();
|
|
|
|
|
|
|
|
if (not intersect.contains(cost.getInterval()))
|
|
|
|
intersect.intersection( cost.getInterval() );
|
|
|
|
else {
|
|
|
|
cost.setLonguestOverlap( intersect.getSize() );
|
|
|
|
cost.setGlobalEnclosed();
|
|
|
|
}
|
|
|
|
|
|
|
|
DataNegociate* data = segment->getDataNegociate();
|
|
|
|
if (not data) return;
|
|
|
|
|
|
|
|
cost.mergeRipupCount( data->getRipupCount() );
|
|
|
|
if ( segment->isLocal() ) {
|
|
|
|
cost.mergeDataState( data->getState() );
|
|
|
|
if (data->getState() >= DataNegociate::LocalVsGlobal) {
|
|
|
|
cdebug_log(159,0) << "MaximumSlack/LocalVsGlobal for " << segment << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (segment->isGlobal()) {
|
|
|
|
cost.setOverlapGlobal();
|
|
|
|
if ( (cost.getFlags() & TrackCost::LocalAndTopDepth)
|
|
|
|
and (data->getState() >= DataNegociate::MoveUp) ) {
|
|
|
|
cost.setInfinite ();
|
|
|
|
cost.setOverlap ();
|
|
|
|
cost.setHardOverlap();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cost.setOverlap();
|
|
|
|
if ( segment->isLocal()
|
|
|
|
or (cost.isForGlobal() and (Session::getRoutingGauge()->getLayerDepth(segment->getLayer()) < 3)) ) {
|
|
|
|
cdebug_log(9000,0) << "Deter| incTerminals() " << boolalpha << cost.isForGlobal() << " " << (data->getTerminals()*100) << endl;
|
|
|
|
cost.incTerminals( data->getTerminals()*100 );
|
|
|
|
} else {
|
|
|
|
cdebug_log(9000,0) << "Deter| isForGlobal() " << boolalpha << cost.isForGlobal() << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
cdebug_log(159,0) << "| Increment Delta: " << DbU::getValueString(intersect.getSize()) << endl;
|
|
|
|
cost.incDelta( intersect.getSize() );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void loadRoutingPads ( NegociateWindow* nw )
|
|
|
|
{
|
|
|
|
AllianceFramework* af = AllianceFramework::get ();
|
|
|
|
RoutingGauge* rg = nw->getKatanaEngine()->getConfiguration()->getRoutingGauge();
|
|
|
|
|
|
|
|
for( Net* net : nw->getCell()->getNets() ) {
|
|
|
|
if (net->getType() == Net::Type::POWER ) continue;
|
|
|
|
if (net->getType() == Net::Type::GROUND) continue;
|
|
|
|
if (net->getType() == Net::Type::CLOCK ) continue;
|
|
|
|
if (af->isBLOCKAGE(net->getName())) continue;
|
|
|
|
|
|
|
|
for( RoutingPad* rp : net->getRoutingPads() ) {
|
|
|
|
size_t depth = rg->getLayerDepth(rp->getLayer());
|
|
|
|
if (depth > 0) continue;
|
|
|
|
if (depth == 0)
|
|
|
|
TrackMarker::create( rp, 1 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // Anonymous namespace.
|
|
|
|
|
|
|
|
|
|
|
|
namespace Katana {
|
|
|
|
|
2017-05-09 11:33:55 -05:00
|
|
|
using std::ofstream;
|
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
|
|
|
using std::cerr;
|
|
|
|
using std::endl;
|
|
|
|
using std::setw;
|
|
|
|
using std::left;
|
|
|
|
using std::right;
|
|
|
|
using std::setprecision;
|
|
|
|
using Hurricane::Warning;
|
|
|
|
using Hurricane::Bug;
|
|
|
|
using Hurricane::tab;
|
|
|
|
using Hurricane::ForEachIterator;
|
|
|
|
using CRL::Histogram;
|
|
|
|
using CRL::addMeasure;
|
|
|
|
using Anabatic::AutoContact;
|
|
|
|
using Anabatic::AutoSegmentLut;
|
|
|
|
using Anabatic::perpandicularTo;
|
|
|
|
|
|
|
|
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// Class : "NegociateWindow".
|
|
|
|
|
|
|
|
|
|
|
|
NegociateWindow::NegociateWindow ( KatanaEngine* katana )
|
|
|
|
: _flags (Flags::NoFlags)
|
|
|
|
, _interrupt (false)
|
|
|
|
, _katana (katana)
|
|
|
|
, _gcells ()
|
|
|
|
, _segments ()
|
|
|
|
, _eventQueue ()
|
|
|
|
, _eventHistory()
|
|
|
|
, _eventLoop (10,50)
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
NegociateWindow* NegociateWindow::create ( KatanaEngine* katana )
|
|
|
|
{
|
|
|
|
NegociateWindow* negociateWindow = new NegociateWindow ( katana );
|
|
|
|
return negociateWindow;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
NegociateWindow::~NegociateWindow ()
|
|
|
|
{ }
|
|
|
|
|
|
|
|
|
|
|
|
void NegociateWindow::destroy ()
|
|
|
|
{ delete this; }
|
|
|
|
|
|
|
|
|
|
|
|
Cell* NegociateWindow::getCell () const
|
|
|
|
{ return _katana->getCell(); }
|
|
|
|
|
|
|
|
|
|
|
|
void NegociateWindow::setGCells ( const vector<GCell*>& gcells )
|
|
|
|
{
|
|
|
|
_gcells = gcells;
|
|
|
|
|
|
|
|
loadRoutingPads( this );
|
|
|
|
Session::revalidate();
|
|
|
|
|
|
|
|
for ( auto element : Session::getKatanaEngine()->_getAutoSegmentLut() ) {
|
|
|
|
TrackElement* segment = Session::lookup( element.second );
|
|
|
|
if (segment) segment->getDataNegociate()->update();
|
|
|
|
}
|
|
|
|
|
|
|
|
_statistics.setGCellsCount( _gcells.size() );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
void NegociateWindow::addRoutingEvent ( TrackElement* segment, uint32_t level )
|
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
|
|
|
{
|
|
|
|
DataNegociate* data = segment->getDataNegociate();
|
|
|
|
if (not data or not data->hasRoutingEvent())
|
|
|
|
_eventQueue.add( segment, level );
|
|
|
|
else
|
|
|
|
cerr << Bug( "NegociateWidow::addRoutingEvent(): Try to adds twice the same TrackElement event."
|
|
|
|
"\n %p:%s."
|
|
|
|
, (void*)segment->base()->base()
|
|
|
|
, getString(segment).c_str()
|
|
|
|
) << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
TrackElement* NegociateWindow::createTrackSegment ( AutoSegment* autoSegment, Flags flags )
|
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
|
|
|
{
|
|
|
|
cdebug_log(159,1) << "NegociateWindow::createTrackSegment() - " << autoSegment << endl;
|
|
|
|
|
|
|
|
// Special case: fixed AutoSegments must not interfere with blockages.
|
|
|
|
// Ugly: uses of getExtensionCap().
|
|
|
|
if (autoSegment->isFixed()) {
|
|
|
|
RoutingPlane* plane = Session::getKatanaEngine()->getRoutingPlaneByLayer(autoSegment->getLayer());
|
|
|
|
Track* track = plane->getTrackByPosition( autoSegment->getAxis() );
|
|
|
|
size_t begin;
|
|
|
|
size_t end;
|
|
|
|
Interval fixedSpan;
|
|
|
|
Interval blockageSpan;
|
|
|
|
|
|
|
|
autoSegment->getCanonical( fixedSpan );
|
|
|
|
fixedSpan.inflate( Session::getExtensionCap(autoSegment->getLayer())-1 );
|
|
|
|
|
|
|
|
track->getOverlapBounds( fixedSpan, begin, end );
|
|
|
|
for ( ; (begin < end) ; begin++ ) {
|
|
|
|
|
|
|
|
TrackElement* other = track->getSegment(begin);
|
|
|
|
cdebug_log(159,0) << "| overlap: " << other << endl;
|
|
|
|
|
|
|
|
if (not other->isBlockage()) continue;
|
|
|
|
|
|
|
|
other->getCanonical( blockageSpan );
|
|
|
|
blockageSpan.inflate( Session::getExtensionCap(autoSegment->getLayer()) );
|
|
|
|
|
|
|
|
cdebug_log(159,0) << " fixed:" << fixedSpan << " vs. blockage:" << blockageSpan << endl;
|
|
|
|
|
|
|
|
if (not fixedSpan.intersect(blockageSpan)) continue;
|
|
|
|
|
|
|
|
// Overlap between fixed & blockage.
|
|
|
|
cdebug_log(159,0) << "* Blockage overlap: " << autoSegment << endl;
|
|
|
|
Session::destroyRequest( autoSegment );
|
|
|
|
|
|
|
|
cerr << Warning( "Overlap between fixed %s and blockage at %s."
|
|
|
|
, getString(autoSegment).c_str()
|
|
|
|
, getString(blockageSpan).c_str() ) << endl;
|
|
|
|
cdebug_tabw(159,-1);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Interval span;
|
|
|
|
autoSegment = autoSegment->getCanonical( span );
|
|
|
|
|
|
|
|
bool created;
|
|
|
|
TrackElement* trackSegment = TrackSegment::create( autoSegment, NULL, created );
|
|
|
|
|
|
|
|
if (not (flags & Flags::LoadingStage))
|
|
|
|
cdebug_log(159,0) << "* lookup: " << autoSegment << endl;
|
|
|
|
|
|
|
|
if (created) {
|
|
|
|
cdebug_log(159,0) << "* " << trackSegment << endl;
|
|
|
|
|
|
|
|
RoutingPlane* plane = Session::getKatanaEngine()->getRoutingPlaneByLayer(autoSegment->getLayer());
|
|
|
|
Track* track = plane->getTrackByPosition ( autoSegment->getAxis() );
|
|
|
|
Interval uside = autoSegment->getAutoSource()->getGCell()->getSide( perpandicularTo(autoSegment->getDirection()) );
|
|
|
|
|
|
|
|
if (track->getAxis() > uside.getVMax()) track = track->getPreviousTrack();
|
|
|
|
if (track->getAxis() < uside.getVMin()) track = track->getNextTrack();
|
|
|
|
|
|
|
|
cdebug_log(159,0) << "* GCell U-side " << uside << endl;
|
|
|
|
cdebug_log(159,0) << "* " << plane << endl;
|
|
|
|
cdebug_log(159,0) << "* " << track << endl;
|
|
|
|
|
|
|
|
trackSegment->setAxis( track->getAxis(), Anabatic::SegAxisSet );
|
|
|
|
trackSegment->invalidate();
|
|
|
|
|
|
|
|
if (trackSegment->isFixed()) {
|
|
|
|
Session::addInsertEvent( trackSegment, track );
|
|
|
|
} else {
|
|
|
|
_segments.push_back( trackSegment );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (not created and not (flags & Flags::LoadingStage)) {
|
|
|
|
cdebug_log(159,0) << "TrackSegment already exists (and not in loading stage)." << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
cdebug_tabw(159,-1);
|
|
|
|
|
|
|
|
return trackSegment;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
double NegociateWindow::computeWirelength ()
|
|
|
|
{
|
|
|
|
set<TrackElement*> accounteds;
|
|
|
|
double totalWL = 0.0;
|
|
|
|
|
|
|
|
for ( size_t igcell=0 ; igcell<_gcells.size() ; ++igcell ) {
|
|
|
|
double gcellWL = 0.0;
|
|
|
|
Segment* segment;
|
|
|
|
TrackElement* trackSegment;
|
|
|
|
|
|
|
|
const vector<AutoContact*>& contacts = _gcells[igcell]->getContacts();
|
|
|
|
for ( size_t i=0 ; i<contacts.size() ; i++ ) {
|
|
|
|
for( Hook* hook : contacts[i]->getBodyHook()->getSlaveHooks() ) {
|
|
|
|
Hook* sourceHook = dynamic_cast<Segment::SourceHook*>(hook);
|
|
|
|
if (not sourceHook) continue;
|
|
|
|
|
|
|
|
segment = dynamic_cast<Segment*>(sourceHook->getComponent());
|
|
|
|
trackSegment = Session::lookup( segment );
|
|
|
|
if (trackSegment) {
|
|
|
|
if (accounteds.find(trackSegment) != accounteds.end()) continue;
|
|
|
|
|
|
|
|
accounteds.insert( trackSegment );
|
|
|
|
gcellWL += DbU::getLambda( trackSegment->getLength() );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Partial sum to limit rounding errors.
|
|
|
|
totalWL += gcellWL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return totalWL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void NegociateWindow::_createRouting ( Anabatic::GCell* gcell )
|
|
|
|
{
|
|
|
|
cdebug_log(159,1) << "NegociateWindow::_createRouting() - " << gcell << endl;
|
|
|
|
|
|
|
|
Segment* segment;
|
|
|
|
AutoSegment* autoSegment;
|
|
|
|
|
|
|
|
cdebug_log(159,0) << "AutoSegments from AutoContacts" << endl;
|
|
|
|
const vector<AutoContact*>& contacts = gcell->getContacts();
|
|
|
|
for ( size_t i=0 ; i<contacts.size() ; i++ ) {
|
|
|
|
for( Component* component : contacts[i]->getSlaveComponents() ) {
|
|
|
|
segment = dynamic_cast<Segment*>(component);
|
|
|
|
autoSegment = Session::base()->lookup( segment );
|
|
|
|
cdebug_log(159,0) << autoSegment << endl;
|
|
|
|
if (autoSegment and autoSegment->isCanonical()) {
|
|
|
|
createTrackSegment( autoSegment, Flags::LoadingStage );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
cdebug_log(159,0) << "_segments.size():" << _segments.size() << endl;
|
|
|
|
cdebug_tabw(159,-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void NegociateWindow::_pack ( size_t& count, bool last )
|
|
|
|
{
|
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
|
|
|
uint64_t limit = _katana->getEventsLimit();
|
|
|
|
uint32_t pushStage = RoutingEvent::getStage();
|
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
|
|
|
RoutingEvent::setStage( RoutingEvent::Pack );
|
|
|
|
|
|
|
|
RoutingEventQueue packQueue;
|
|
|
|
//for ( size_t i = (count > 600) ? count-600 : 0
|
|
|
|
// ; (i<_eventHistory.size()-(last ? 0 : 100)) and not isInterrupted() ; i++ ) {
|
|
|
|
for ( size_t i=0 ; i<_eventHistory.size() ; ++i ) {
|
|
|
|
RoutingEvent* event = _eventHistory.getNth(i);
|
|
|
|
|
|
|
|
if ( event and not event->isCloned() ) {
|
|
|
|
cerr << "Cloned:" << event->isCloned()
|
|
|
|
<< " UTurn:" << event->getSegment()->isUTurn() << " " << event->getSegment() << endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( event and not event->isCloned() and event->getSegment()->isUTurn() ) {
|
|
|
|
event->reschedule( packQueue, 0 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
packQueue.commit();
|
|
|
|
|
|
|
|
while ( not packQueue.empty() and not isInterrupted() ) {
|
|
|
|
RoutingEvent* event = packQueue.pop();
|
|
|
|
|
|
|
|
if (tty::enabled()) {
|
|
|
|
cmess2 << " <pack.event:" << tty::bold << setw(8) << setfill('0')
|
|
|
|
<< RoutingEvent::getProcesseds() << tty::reset
|
|
|
|
<< " remains:" << right << setw(8) << setfill('0')
|
|
|
|
<< packQueue.size() << ">"
|
|
|
|
<< setfill(' ') << tty::reset << tty::cr;
|
|
|
|
cmess2.flush();
|
|
|
|
} else {
|
|
|
|
cmess2 << " <pack.event:" << setw(8) << setfill('0')
|
|
|
|
<< RoutingEvent::getProcesseds() << setfill(' ') << " "
|
|
|
|
<< event->getEventLevel() << ":" << event->getPriority() << "> "
|
|
|
|
<< event->getSegment()
|
|
|
|
<< endl;
|
|
|
|
cmess2.flush();
|
|
|
|
}
|
|
|
|
|
|
|
|
event->process( packQueue, _eventHistory, _eventLoop );
|
|
|
|
|
|
|
|
if (RoutingEvent::getProcesseds() >= limit) setInterrupt( true );
|
|
|
|
}
|
|
|
|
// Count will be wrong!
|
|
|
|
|
|
|
|
RoutingEvent::setStage( pushStage );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
size_t NegociateWindow::_negociate ()
|
|
|
|
{
|
|
|
|
cdebug_log(9000,0) << "Deter| NegociateWindow::_negociate()" << endl;
|
|
|
|
cdebug_log(159,1) << "NegociateWindow::_negociate() - " << _segments.size() << endl;
|
|
|
|
|
|
|
|
cmess1 << " o Negociation Stage." << endl;
|
|
|
|
|
2017-05-09 11:33:55 -05:00
|
|
|
unsigned long limit = _katana->getEventsLimit();
|
|
|
|
bool profiling = _katana->profileEventCosts();
|
|
|
|
ofstream ofprofile;
|
|
|
|
|
|
|
|
if (profiling) ofprofile.open( "katana.profile.txt" );
|
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
|
|
|
|
|
|
|
_eventHistory.clear();
|
|
|
|
_eventQueue.load( _segments );
|
|
|
|
cmess2 << " <queue:" << right << setw(8) << setfill('0') << _eventQueue.size() << ">" << endl;
|
|
|
|
if (cdebug.enabled(9000)) _eventQueue.dump();
|
|
|
|
|
|
|
|
size_t count = 0;
|
|
|
|
RoutingEvent::setStage( RoutingEvent::Negociate );
|
|
|
|
while ( not _eventQueue.empty() and not isInterrupted() ) {
|
|
|
|
RoutingEvent* event = _eventQueue.pop();
|
|
|
|
|
2017-05-09 11:33:55 -05:00
|
|
|
if (ofprofile.is_open()) {
|
|
|
|
size_t depth = _katana->getConfiguration()->getLayerDepth( event->getSegment()->getLayer() );
|
|
|
|
if (depth < 6) {
|
|
|
|
ofprofile << setw(10) << right << count << " ";
|
|
|
|
for ( size_t i=0 ; i<6 ; ++i ) {
|
|
|
|
if (i == depth)
|
|
|
|
ofprofile << setw(10) << right << setprecision(2) << event->getPriority () << " ";
|
|
|
|
else
|
|
|
|
ofprofile << setw(10) << right << setprecision(2) << 0.0 << " ";
|
|
|
|
}
|
|
|
|
|
|
|
|
ofprofile << setw( 2) << right << event->getEventLevel() << endl;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
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
|
|
|
event->process( _eventQueue, _eventHistory, _eventLoop );
|
|
|
|
count++;
|
|
|
|
|
2017-05-26 06:32:30 -05:00
|
|
|
if (tty::enabled()) {
|
|
|
|
cmess2 << " <event:" << tty::bold << right << setw(8) << setfill('0')
|
|
|
|
<< RoutingEvent::getProcesseds() << tty::reset
|
|
|
|
<< " remains:" << right << setw(8) << setfill('0')
|
|
|
|
<< _eventQueue.size()+1
|
|
|
|
<< setfill(' ') << tty::reset << ">" << tty::cr;
|
|
|
|
cmess2.flush ();
|
|
|
|
} else {
|
|
|
|
cmess2 << " <event:" << right << setw(8) << setfill('0')
|
|
|
|
<< RoutingEvent::getProcesseds()-1 << setfill(' ') << " "
|
|
|
|
<< event->getEventLevel() << ":" << event->getPriority() << "> "
|
|
|
|
<< event->getSegment()
|
|
|
|
<< endl;
|
|
|
|
cmess2.flush();
|
|
|
|
}
|
|
|
|
|
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
|
|
|
//if (count and not (count % 500)) {
|
|
|
|
// _pack( count, false );
|
|
|
|
//}
|
|
|
|
|
|
|
|
if (RoutingEvent::getProcesseds() >= limit) setInterrupt( true );
|
|
|
|
}
|
|
|
|
//_pack( count, true );
|
|
|
|
if (count and cmess2.enabled() and tty::enabled()) cmess1 << endl;
|
|
|
|
|
|
|
|
cdebug_log(9000,0) << "Deter| Repair Stage" << endl;
|
|
|
|
cmess1 << " o Repair Stage." << endl;
|
|
|
|
|
|
|
|
cdebug_log(159,0) << "Loadind Repair queue." << endl;
|
|
|
|
RoutingEvent::setStage( RoutingEvent::Repair );
|
|
|
|
for ( size_t i=0 ; (i<_eventHistory.size()) and not isInterrupted() ; i++ ) {
|
|
|
|
RoutingEvent* event = _eventHistory.getNth(i);
|
|
|
|
|
|
|
|
if (not event->isCloned() and event->isUnimplemented()) {
|
|
|
|
event->reschedule( _eventQueue, 0 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
_eventQueue.commit();
|
|
|
|
cmess2 << " <repair.queue:" << right << setw(8) << setfill('0')
|
|
|
|
<< _eventQueue.size() << ">" << endl;
|
|
|
|
|
|
|
|
count = 0;
|
|
|
|
//_eventQueue.prepareRepair();
|
|
|
|
while ( not _eventQueue.empty() and not isInterrupted() ) {
|
|
|
|
RoutingEvent* event = _eventQueue.pop();
|
|
|
|
|
|
|
|
if (tty::enabled()) {
|
|
|
|
cmess2 << " <repair.event:" << tty::bold << setw(8) << setfill('0')
|
|
|
|
<< RoutingEvent::getProcesseds() << tty::reset
|
|
|
|
<< " remains:" << right << setw(8) << setfill('0')
|
|
|
|
<< _eventQueue.size() << ">"
|
|
|
|
<< setfill(' ') << tty::reset << tty::cr;
|
|
|
|
cmess2.flush();
|
|
|
|
} else {
|
|
|
|
cmess2 << " <repair.event:" << setw(8) << setfill('0')
|
|
|
|
<< RoutingEvent::getProcesseds() << setfill(' ') << " "
|
|
|
|
<< event->getEventLevel() << ":" << event->getPriority() << "> "
|
|
|
|
<< event->getSegment()
|
|
|
|
<< endl;
|
|
|
|
cmess2.flush();
|
|
|
|
}
|
|
|
|
|
|
|
|
event->process( _eventQueue, _eventHistory, _eventLoop );
|
|
|
|
|
|
|
|
count++;
|
|
|
|
if (RoutingEvent::getProcesseds() >= limit ) setInterrupt( true );
|
|
|
|
}
|
|
|
|
|
|
|
|
if (count and cmess2.enabled() and tty::enabled()) cmess1 << endl;
|
|
|
|
|
|
|
|
size_t eventsCount = _eventHistory.size();
|
|
|
|
|
|
|
|
_eventHistory.clear();
|
|
|
|
_eventQueue.clear();
|
|
|
|
|
|
|
|
if (RoutingEvent::getAllocateds() > 0) {
|
|
|
|
cerr << Bug( "%d events remains after clear.", RoutingEvent::getAllocateds() ) << endl;
|
|
|
|
}
|
|
|
|
|
2017-05-09 11:33:55 -05:00
|
|
|
if (ofprofile.is_open()) ofprofile.close();
|
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
|
|
|
_statistics.setEventsCount( eventsCount );
|
|
|
|
cdebug_tabw(159,-1);
|
|
|
|
|
|
|
|
return eventsCount;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
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
|
|
|
void NegociateWindow::run ( Flags flags )
|
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
|
|
|
{
|
|
|
|
cdebug_log(159,1) << "NegociateWindow::run()" << endl;
|
|
|
|
|
|
|
|
cmess1 << " o Running Negociate Algorithm" << endl;
|
|
|
|
|
|
|
|
TrackElement::setOverlapCostCB( NegociateOverlapCost );
|
|
|
|
RoutingEvent::resetProcesseds();
|
|
|
|
|
|
|
|
for ( size_t igcell=0 ; igcell<_gcells.size() ; ++igcell ) {
|
|
|
|
_createRouting( _gcells[igcell] );
|
|
|
|
}
|
|
|
|
Session::revalidate();
|
|
|
|
|
|
|
|
if (not (flags & Flags::PreRoutedStage)) {
|
|
|
|
_katana->preProcess();
|
|
|
|
Session::revalidate();
|
|
|
|
}
|
|
|
|
|
|
|
|
_katana->setMinimumWL( computeWirelength() );
|
|
|
|
|
|
|
|
#if defined(CHECK_DATABASE)
|
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 overlaps = 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
|
|
|
Session::getKatanaEngine()->_check( overlaps, "after _createRouting(GCell*)" );
|
|
|
|
#endif
|
|
|
|
|
2017-05-26 06:32:30 -05:00
|
|
|
if (flags & Flags::PairSymmetrics) {
|
|
|
|
_katana->pairSymmetrics();
|
Apaired segments building for symmetric routing (step 1).
* Change: In Hurricane::BaseFlags, store flags in uint64_t instead of
unsigned int because we start to need more than 32 different flags
in some tools.
* New: In ::getString() & ::getRecord() templates, add support for
std::array<>.
* Change: In CRL::ToolEngine, add support for timer (time & memory
measurements) displaced from Katabatic. This way all ToolEngine
can use this feature. The _postCreate() method display the
memory just after ToolEngine allocation.
* Change: In Etesian::EtesianEngine, make use of the ToolEngine
builtin timer (remove the local one). Forgot to call the base
class _postCreate() and _preDestroy().
* Change: In Anabatic::AnabaticEngine, make use of the ToolEngine
builtin timer (remove the local one).
* New: In Anabatic, new AutoSegments_Connecteds() collection. This
Collection allows a deterministic walkthough *all* the AutoSegments
connected either to source or target of one AutoSegment.
* New: In Anabatic::AutoContactTerminal::isEndPoint() to check if an
AutoContactTerminal is the *only one* anchored on a RoutingPad,
thus being a true "end point" and not a kind of feed-through.
* New: In Katana::KatanaEngine, added support for symmetric nets.
Created new class DataSymmetric to store symmetric information
of a net (mainly the paired AutoSegments).
Added KatanaEngine::runSymmetricRouter(), for now only build
the DataSymmetric informations. More to come...
* Change: In Katana::GraphicKatanaEngine::_runTest(), now perform
symmetric information building the non-symmetric routing.
2017-03-12 13:34:12 -05:00
|
|
|
Session::revalidate();
|
|
|
|
}
|
|
|
|
|
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
|
|
|
_flags |= flags;
|
|
|
|
_negociate();
|
|
|
|
printStatistics();
|
|
|
|
|
|
|
|
if (flags & Flags::PreRoutedStage) {
|
|
|
|
_katana->setFixedPreRouted();
|
|
|
|
}
|
|
|
|
|
|
|
|
Session::revalidate();
|
|
|
|
Session::get()->isEmpty();
|
|
|
|
|
|
|
|
# if defined(CHECK_DATABASE)
|
|
|
|
_katana->_check( overlaps, "after negociation" );
|
|
|
|
# endif
|
|
|
|
|
|
|
|
cdebug_tabw(159,-1);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void NegociateWindow::printStatistics () const
|
|
|
|
{
|
|
|
|
cmess1 << " o Computing statistics." << endl;
|
|
|
|
cmess1 << Dots::asSizet(" - Processeds Events Total",RoutingEvent::getProcesseds()) << endl;
|
|
|
|
cmess1 << Dots::asSizet(" - Unique Events Total"
|
|
|
|
,(RoutingEvent::getProcesseds() - RoutingEvent::getCloneds())) << endl;
|
|
|
|
cmess1 << Dots::asSizet(" - # of GCells",_statistics.getGCellsCount()) << endl;
|
|
|
|
_katana->printCompletion();
|
|
|
|
|
|
|
|
addMeasure<size_t>( getCell(), "Events" , RoutingEvent::getProcesseds(), 12 );
|
|
|
|
addMeasure<size_t>( getCell(), "UEvents", RoutingEvent::getProcesseds()-RoutingEvent::getCloneds(), 12 );
|
|
|
|
|
|
|
|
Histogram* densityHistogram = new Histogram ( 1.0, 0.1, 2 );
|
|
|
|
addMeasure<Histogram>( getCell(), "GCells Density Histogram", densityHistogram );
|
|
|
|
|
|
|
|
densityHistogram->setFileExtension( ".density.histogram" );
|
|
|
|
densityHistogram->setMainTitle ( "GCell Densities" );
|
|
|
|
densityHistogram->setTitle ( "Avg. Density", 0 );
|
|
|
|
densityHistogram->setTitle ( "Peak Density", 1 );
|
|
|
|
densityHistogram->setColor ( "green", 0 );
|
|
|
|
densityHistogram->setColor ( "red" , 1 );
|
|
|
|
|
|
|
|
const vector<GCell*>& gcells = getKatanaEngine()->getGCells();
|
|
|
|
|
|
|
|
getKatanaEngine()->setDensityMode( Anabatic::AnabaticEngine::MaxHVDensity );
|
|
|
|
for ( size_t igcell=0 ; igcell<gcells.size() ; ++igcell ) {
|
|
|
|
densityHistogram->addSample( gcells[igcell]->getDensity(), 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
getKatanaEngine()->setDensityMode( Anabatic::AnabaticEngine::MaxDensity );
|
|
|
|
for ( size_t igcell=0 ; igcell<gcells.size() ; ++igcell ) {
|
|
|
|
densityHistogram->addSample( gcells[igcell]->getDensity(), 1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
densityHistogram->normalize( 0 );
|
|
|
|
densityHistogram->normalize( 1 );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
string NegociateWindow::_getString () const
|
|
|
|
{
|
|
|
|
ostringstream os;
|
|
|
|
|
|
|
|
os << "<" << _getTypeName() << ">";
|
|
|
|
return os.str();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Record* NegociateWindow::_getRecord () const
|
|
|
|
{
|
|
|
|
Record* record = new Record ( _getString() );
|
|
|
|
|
|
|
|
record->add( getSlot( "_gcells", _gcells ) );
|
|
|
|
return record;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
} // Katana namespace.
|