Kite is now deterministic, given a global routing.
* Bug: In Kite, in TrackCost, the boolean attribute "_forGlobal" was not initialized in the constructor causing the non-deterministic behavior. Arrrrgggghhhhhh. * Bug: In Kite, in PyKiteEngine, forgot to perform the "balanceGlobalDensity()" in the layer assign Python wrapper, another cause for non-determinism. * Change: In Kite, In KiteEngine, print the configuration at the same point as in the python script (to get identical output).
This commit is contained in:
parent
e29221274e
commit
0cced62851
|
@ -81,6 +81,7 @@ namespace Kite {
|
|||
{
|
||||
DebugSession::open( _trackSegment->getNet(), 148 );
|
||||
|
||||
//ltrace(500) << "Deter| DataNegociate::update() - " << _trackSegment << endl;
|
||||
ltrace(148) << "DataNegociate::update() - " << _trackSegment << endl;
|
||||
ltracein(148);
|
||||
|
||||
|
@ -97,6 +98,7 @@ namespace Kite {
|
|||
);
|
||||
|
||||
_terminals = AutoSegment::getTerminalCount( _trackSegment->base(), collapseds );
|
||||
//ltrace(500) << "Deter| Terminals:" << _terminals << endl;
|
||||
_attractors.clear();
|
||||
_perpandiculars.clear();
|
||||
_perpandicularFree = Interval(false);
|
||||
|
|
|
@ -124,6 +124,7 @@ namespace Kite {
|
|||
kite = KiteEngine::create( cell );
|
||||
kite->setPostEventCb( boost::bind(&GraphicKiteEngine::postEvent,this) );
|
||||
kite->setViewer( _viewer );
|
||||
if (cmess1.enabled()) kite->printConfiguration();
|
||||
} else
|
||||
cerr << Warning( "%s already has a Kite engine.", getString(cell).c_str() ) << endl;
|
||||
|
||||
|
@ -174,7 +175,6 @@ namespace Kite {
|
|||
void GraphicKiteEngine::_loadGlobalRouting ()
|
||||
{
|
||||
KiteEngine* kite = getForFramework( NoFlags );
|
||||
if (cmess1.enabled()) kite->printConfiguration();
|
||||
|
||||
_viewer->clearToolInterrupt();
|
||||
kite->loadGlobalRouting( Katabatic::EngineLoadGrByNet );
|
||||
|
|
|
@ -52,6 +52,7 @@ namespace {
|
|||
|
||||
void NegociateOverlapCost ( const TrackElement* segment, TrackCost& cost )
|
||||
{
|
||||
ltrace(500) << "Deter| NegociateOverlapCost() " << segment << endl;
|
||||
Interval intersect = segment->getCanonicalInterval();
|
||||
|
||||
if (not intersect.intersect(cost.getInterval())) return;
|
||||
|
@ -99,8 +100,12 @@ namespace {
|
|||
|
||||
cost.setOverlap();
|
||||
if ( segment->isLocal()
|
||||
or (cost.isForGlobal() and (Session::getRoutingGauge()->getLayerDepth(segment->getLayer()) < 3)) )
|
||||
or (cost.isForGlobal() and (Session::getRoutingGauge()->getLayerDepth(segment->getLayer()) < 3)) ) {
|
||||
ltrace(500) << "Deter| incTerminals() " << boolalpha << cost.isForGlobal() << " " << (data->getTerminals()*100) << endl;
|
||||
cost.incTerminals( data->getTerminals()*100 );
|
||||
} else {
|
||||
ltrace(500) << "Deter| isForGlobal() " << boolalpha << cost.isForGlobal() << endl;
|
||||
}
|
||||
|
||||
ltrace(200) << "| Increment Delta: " << DbU::getValueString(intersect.getSize()) << endl;
|
||||
cost.incDelta( intersect.getSize() );
|
||||
|
@ -383,6 +388,8 @@ namespace Kite {
|
|||
_eventHistory.clear();
|
||||
_eventQueue.load( _segments );
|
||||
|
||||
if (inltrace(500)) _eventQueue.dump();
|
||||
|
||||
size_t count = 0;
|
||||
RoutingEvent::setStage( RoutingEvent::Negociate );
|
||||
while ( not _eventQueue.empty() and not isInterrupted() ) {
|
||||
|
|
|
@ -201,9 +201,11 @@ extern "C" {
|
|||
if (PyArg_ParseTuple(args,"I:KiteEngine.layerAssign", &flags)) {
|
||||
|
||||
if (kite->getViewer()) {
|
||||
ExceptionWidget::catchAllWrapper( std::bind(&KiteEngine::layerAssign,kite,flags) );
|
||||
ExceptionWidget::catchAllWrapper( std::bind(&KiteEngine::balanceGlobalDensity,kite) );
|
||||
ExceptionWidget::catchAllWrapper( std::bind(&KiteEngine::layerAssign ,kite,flags) );
|
||||
} else {
|
||||
kite->layerAssign(flags);
|
||||
kite->balanceGlobalDensity();
|
||||
kite->layerAssign (flags);
|
||||
}
|
||||
} else {
|
||||
PyErr_SetString(ConstructorError, "KiteEngine.layerAssign(): Invalid number/bad type of parameter.");
|
||||
|
|
|
@ -475,9 +475,7 @@ namespace Kite {
|
|||
|
||||
_axisHistory = _segment->getAxis();
|
||||
_eventLevel = 0;
|
||||
ltrace(500) << "Deter| addInsertEvent()" << endl;
|
||||
ltrace(500) << "Deter| | " << _segment << endl;
|
||||
ltrace(500) << "Deter| | " << fsm.getCost(itrack).getTrack() << endl;
|
||||
ltrace(500) << "Deter| addInsertEvent() @" << fsm.getCost(itrack).getTrack() << endl;
|
||||
Session::addInsertEvent( _segment, fsm.getCost(itrack).getTrack() );
|
||||
fsm.setState( SegmentFsm::SelfInserted );
|
||||
} else {
|
||||
|
@ -486,6 +484,11 @@ namespace Kite {
|
|||
Manipulator(_segment,fsm).ripupPerpandiculars();
|
||||
} else {
|
||||
if (Manipulator(_segment,fsm).canRipup(Manipulator::NotOnLastRipup)) {
|
||||
if (inltrace(500)) {
|
||||
for ( itrack=0 ; itrack<fsm.getCosts().size() ; itrack++ ) {
|
||||
ltrace(500) << "Deter| | Candidate Track: " << fsm.getCost(itrack) << endl;
|
||||
}
|
||||
}
|
||||
for ( itrack=0 ; itrack<fsm.getCosts().size() ; itrack++ ) {
|
||||
ltrace(200) << "Trying Track: " << itrack << endl;
|
||||
if (fsm.getCost(itrack).isInfinite()) break;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Software.
|
||||
// Copyright (c) UPMC 2008-2013, All Rights Reserved
|
||||
// Copyright (c) UPMC 2008-2014, All Rights Reserved
|
||||
//
|
||||
// +-----------------------------------------------------------------+
|
||||
// | C O R I O L I S |
|
||||
|
@ -218,7 +218,7 @@ namespace Kite {
|
|||
{
|
||||
multiset<RoutingEvent*,RoutingEvent::Compare>::const_iterator ievent = _events.begin ();
|
||||
for ( ; ievent != _events.end(); ievent++ ) {
|
||||
cerr << "Order: Queue:"
|
||||
cerr << "Deter| Queue:"
|
||||
<< (*ievent)->getEventLevel()
|
||||
<< "," << setw(6) << (*ievent)->getPriority()
|
||||
<< " " << setw(6) << DbU::getValueString((*ievent)->getSegment()->getLength())
|
||||
|
|
|
@ -511,7 +511,10 @@ namespace Kite {
|
|||
_costs.push_back ( itrack->getOverlapCost(segment,costflags) );
|
||||
_costs.back().setAxisWeight ( _event->getAxisWeight(itrack->getAxis()) );
|
||||
_costs.back().incDeltaPerpand ( _data->getWiringDelta(itrack->getAxis()) );
|
||||
if (segment->isGlobal()) _costs.back().setForGlobal();
|
||||
if (segment->isGlobal()) {
|
||||
ltrace(500) << "Deter| setForGlobal() on " << *itrack << endl;
|
||||
_costs.back().setForGlobal();
|
||||
}
|
||||
|
||||
if ( inLocalDepth and (_costs.back().getDataState() == DataNegociate::MaximumSlack) )
|
||||
_costs.back().setInfinite ();
|
||||
|
|
|
@ -452,6 +452,8 @@ namespace Kite {
|
|||
|
||||
void Track::insert ( TrackElement* segment )
|
||||
{
|
||||
// ltrace(500) << "Deter| Track::insert() " << getLayer()->getName()
|
||||
// << " @" << DbU::getValueString(getAxis()) << " " << segment << endl;
|
||||
ltrace(200) << "Track::insert() " << getLayer()->getName()
|
||||
<< " @" << DbU::getValueString(getAxis()) << " " << segment << endl;
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ namespace Kite {
|
|||
, _begin (begin)
|
||||
, _end (end)
|
||||
, _interval (interval)
|
||||
, _forGlobal (false)
|
||||
, _blockage (false)
|
||||
, _fixed (false)
|
||||
, _infinite (false)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Software.
|
||||
// Copyright (c) UPMC 2008-2013, All Rights Reserved
|
||||
// Copyright (c) UPMC 2008-2014, All Rights Reserved
|
||||
//
|
||||
// +-----------------------------------------------------------------+
|
||||
// | C O R I O L I S |
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// -*- C++ -*-
|
||||
//
|
||||
// This file is part of the Coriolis Software.
|
||||
// Copyright (c) UPMC 2008-2013, All Rights Reserved
|
||||
// Copyright (c) UPMC 2008-2014, All Rights Reserved
|
||||
//
|
||||
// +-----------------------------------------------------------------+
|
||||
// | C O R I O L I S |
|
||||
|
|
Loading…
Reference in New Issue