coriolis/kite/src/DataNegociate.cpp

106 lines
3.4 KiB
C++
Raw Normal View History

// -*- C++ -*-
//
// This file is part of the Coriolis Software.
// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved
//
// ===================================================================
//
// $Id$
//
// x-----------------------------------------------------------------x
// | |
// | 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 : "./DataNegociate.cpp" |
// | *************************************************************** |
// | U p d a t e s |
// | |
// x-----------------------------------------------------------------x
#include <cstdlib>
#include <sstream>
#include "kite/DataNegociate.h"
namespace Kite {
using std::ostringstream;
// -------------------------------------------------------------------
// Class : "DataNegociate".
DataNegociate::DataNegociate ( TrackElement* trackSegment )
: _routingEvent(NULL)
, _trackSegment(trackSegment)
, _cost (trackSegment)
, _state (RipupPerpandiculars)
, _stateCount (1)
//, _z (RoutingGauge::getLayerDepth(trackSegment->getLayer()))
{ }
DataNegociate::~DataNegociate ()
{ }
void DataNegociate::update ()
{ _cost.update ( _trackSegment ); }
string DataNegociate::_getString () const
{
return "<" + _getTypeName() + " "
+ getString(_trackSegment)
+ ">";
}
Record* DataNegociate::_getRecord () const
{
Record* record = new Record ( getString(this) );
record->add ( getSlot ( "_routingEvent", _routingEvent ) );
record->add ( getSlot ( "_trackSegment", _trackSegment ) );
record->add ( getSlot ( "_cost" , &_cost ) );
//record->add ( getSlot ( "_z" , _z ) );
return record;
}
string DataNegociate::getStateString ( DataNegociate* data )
{
ostringstream s;
switch ( data->_state ) {
case RipupPerpandiculars: s << "RipupPerpandiculars"; break;
case Minimize: s << "Minimize"; break;
case DogLeg: s << "DogLeg"; break;
case Desalignate: s << "Desalignate"; break;
case Slacken: s << "Slacken"; break;
case ConflictSolve1: s << "ConflictSolve1"; break;
case ConflictSolve2: s << "ConflictSolve2"; break;
case LocalVsGlobal: s << "LocalVsGlobal"; break;
case MoveUp: s << "MoveUp"; break;
case MaximumSlack: s << "MaximumSlack"; break;
case Unimplemented: s << "Unimplemented"; break;
* ./kite: - New: In NegociateWindow/RoutingEvent, adds a more comprehensive stage "Repair". Perform in three stage: first try to place with a relaxed constraint (one GCell on each side). Second try to minimize the faulty segment. Third perform another "repack perpandicular" but this time the faulty segment is re-inserted *before* any of it's perpandiculars. - New: In RoutingEvent::cacheAxisHint(), when a segment has a parent, that is comes for a "moveUp()", uses the parent axis hint as it's own. - New: In State::slackenTopology(), in the global FSM, adds a special operation when reaching MaximumSlack: forceOverLocals(), try to insert the global on track containing only local segments. Should tend to concentrate locals on a small set of shared tracks. Most useful on the highest layers. - New: In State::slackenTopology(), in the "MoveUp" state, try to find the more appropriate segment to move up (Manipulator::desaturate()). Effectively move up the longest segment fully enclosing the one we are processing. - New: In State::slackenTopology(), add a check for fully blocked segments in the local segment FSM. Calls State::solveFullBlocked(). - New: In KiteEngine::createGlobalGraph(), decrease the vertical capacity of one track inside the core. Helps smooth the vertical density. - Change: In Manipulator::insertInTrack(), when a track is freed for a to be inserted changes the priorities so that the segment is immediatly inserted. Parallels ripeds and theirs perpandiculars are replaced only *after*. This is the opposite of the previous behavior. - Change: In NegociateWindow::NegociateOverlapCost(), account the costs of terminals only for deep depth layers (M1, M2 & M3). - Change: In RoutingEvent::insertInTrack(), expand the excluded interval by a half-pitch (2.5l) instead of one lambda. - Change: In State::State(), do not uses DiscardGlobal if the ripup count exceed 5. Case of the "Strap" segments that can be ripped a lot before changing state. - Change: In State::_processNegociate(), no longer lock into position (fixed) the local terminal segments as a last resort. - Change: In RoutingEvent::_processNegociate(), no longer ripup perpandiculars when a segment is inserted in a free space. Reduce the number of events whithout degrading the routing quality. - Change: In State::conflictSolve1_v1b(), if getLongestConflict() is nul, ignore the track, the conflict must occurs on another track. - Change: In TrackCost, add a flag support. First uses, a flags to prevent a local of the topmost layer to ripup a global which is in moveUp state. - Bug: In State::solveFullBlockage(), after have been freed, reset the segment state to "moveUp". - Bug: In manipulator::minimize(), the axisHint was miscalculated if the punctual span was empty.
2011-01-25 11:16:50 -06:00
case Repair: s << "REPAIR"; break;
default:
s << "Unknown(" << data->_state << ")"; break;
}
s << ":" << data->_stateCount;
return s.str();
}
} // End of Kite namespace.