From 3f8e8459fc0c5e5658d9c2e4f219acdee1d45761 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 17 Apr 2010 10:14:46 +0000 Subject: [PATCH] * ./kite: - Bug: In RoutingEvent::Manipulator::forceToTrack(), wrong return code, was always return true, blocking the explorations of least good Track. - Bug: In RoutingEvent::_processNegociate(), must reset the "insert state" while looping on candidate. This bug was having the same effect as (and masking) the previous one! - Bug: In TrackSegment::moveUp(), reset the ripup count after the move up... - Change: At various DebugSession opening points, sets the debug level to 200 to avoid extraneous debugging output. - New: KiteEngine::dumpMeasures() to create a data file for later uses by gnuplot. In interactive mode, this function is called in the "finalize layout" stage. - New: Adds measurments "algo", "fin" & "Segs". --- kite/src/GCell.cpp | 2 +- kite/src/GraphicKiteEngine.cpp | 3 ++- kite/src/KiteEngine.cpp | 43 +++++++++++++++++++++++++++++++++- kite/src/RoutingEvent.cpp | 7 +++--- kite/src/TrackSegment.cpp | 5 +++- kite/src/kite/KiteEngine.h | 6 ++++- 6 files changed, 58 insertions(+), 8 deletions(-) diff --git a/kite/src/GCell.cpp b/kite/src/GCell.cpp index 89a85323..6ea3b84c 100644 --- a/kite/src/GCell.cpp +++ b/kite/src/GCell.cpp @@ -54,7 +54,7 @@ namespace { size_t depth = Session::getConfiguration()->getLayerDepth ( rp->getLayer() ); if ( depth > 2 ) return NULL; - DebugSession::open ( rp->getNet() ); + DebugSession::open ( rp->getNet(), 200 ); //if ( (depth != 0) and (depth != 2) ) return NULL; diff --git a/kite/src/GraphicKiteEngine.cpp b/kite/src/GraphicKiteEngine.cpp index adc8ace7..cacc7f84 100644 --- a/kite/src/GraphicKiteEngine.cpp +++ b/kite/src/GraphicKiteEngine.cpp @@ -2,7 +2,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved // // =================================================================== // @@ -217,6 +217,7 @@ namespace Kite { KiteEngine* kite = KiteEngine::get ( getCell() ); if ( kite ) { kite->finalizeLayout (); + kite->dumpMeasures (); kite->destroy (); } emit cellPostModificated (); diff --git a/kite/src/KiteEngine.cpp b/kite/src/KiteEngine.cpp index 0f785575..ac8fbf67 100644 --- a/kite/src/KiteEngine.cpp +++ b/kite/src/KiteEngine.cpp @@ -24,6 +24,7 @@ #include +#include #include #include "hurricane/Bug.h" @@ -39,6 +40,7 @@ #include "hurricane/Horizontal.h" #include "hurricane/UpdateSession.h" +#include "crlcore/Measures.h" #include "knik/KnikEngine.h" #include "katabatic/AutoContact.h" #include "kite/DataNegociate.h" @@ -58,6 +60,7 @@ namespace Kite { using std::endl; using std::setw; using std::left; + using std::ofstream; using std::ostringstream; using std::setprecision; using Hurricane::tab; @@ -70,6 +73,9 @@ namespace Kite { using Hurricane::Warning; using Hurricane::Layer; using Hurricane::Cell; + using CRL::addMeasure; + using CRL::Measures; + using CRL::MeasuresSet; using Knik::KnikEngine; @@ -405,7 +411,7 @@ namespace Kite { //if ( _editor ) _editor->refresh (); stopMeasures (); - printMeasures (); + printMeasures ( "algo" ); printCompletion (); Session::open ( this ); @@ -474,6 +480,41 @@ namespace Kite { } _toolSuccess = (unrouteds == 0); + + addMeasure ( getCell(), "Segs", routeds+unrouteds ); + } + + + void KiteEngine::dumpMeasures ( ostream& out ) const + { + vector measuresLabels; + measuresLabels.push_back ( "Gates" ); + measuresLabels.push_back ( "GCells" ); + measuresLabels.push_back ( "loadT" ); + measuresLabels.push_back ( "loadS" ); + measuresLabels.push_back ( "assignT" ); + measuresLabels.push_back ( "algoT" ); + measuresLabels.push_back ( "algoS" ); + measuresLabels.push_back ( "finT" ); + measuresLabels.push_back ( "Segs" ); + + const MeasuresSet* measures = Measures::get(getCell()); + + out << "#" << endl; + out << "# " << getCell()->getName() << endl; + out << measures->toStringHeaders(measuresLabels) << endl; + out << measures->toStringDatas (measuresLabels) << endl; + } + + + void KiteEngine::dumpMeasures () const + { + ostringstream path; + path << getCell()->getName() << ".knik-kite.dat"; + + ofstream sfile ( path.str().c_str() ); + dumpMeasures ( sfile ); + sfile.close (); } diff --git a/kite/src/RoutingEvent.cpp b/kite/src/RoutingEvent.cpp index 168f9577..7d036998 100644 --- a/kite/src/RoutingEvent.cpp +++ b/kite/src/RoutingEvent.cpp @@ -1365,7 +1365,7 @@ namespace { bool State::slackenTopology ( TrackElement* segment, unsigned int flags ) { - DebugSession::open ( segment->getNet() ); + DebugSession::open ( segment->getNet(), 200 ); bool success = false; bool blocked = false; @@ -1650,7 +1650,7 @@ namespace { if ( !_segment ) throw Error("Manipulator::Manipulator(): cannot build upon a NULL TrackElement."); - DebugSession::open ( _segment->getNet() ); + DebugSession::open ( _segment->getNet(), 200 ); _data = _segment->getDataNegociate(); if ( _data ) @@ -2464,7 +2464,7 @@ namespace { _segment->setAxis ( _S.getCost(itrack).getTrack()->getAxis() ); } - return true; + return success; } @@ -3458,6 +3458,7 @@ namespace Kite { for ( itrack=0 ; itracksetState ( DataNegociate::ConflictSolve1, true ); + if ( _data ) { + _data->setState ( DataNegociate::ConflictSolve1, true ); + _data->resetRipupCount (); } ltraceout(200); diff --git a/kite/src/kite/KiteEngine.h b/kite/src/kite/KiteEngine.h index 3e1a4b45..27f659d1 100644 --- a/kite/src/kite/KiteEngine.h +++ b/kite/src/kite/KiteEngine.h @@ -2,7 +2,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2008-2009, All Rights Reserved +// Copyright (c) UPMC/LIP6 2008-2010, All Rights Reserved // // =================================================================== // @@ -26,6 +26,8 @@ #ifndef __KITE_KITE_ENGINE__ #define __KITE_KITE_ENGINE__ +#include + #include "hurricane/Name.h" namespace Hurricane { class Layer; @@ -99,6 +101,8 @@ namespace Kite { RoutingPlane* getRoutingPlaneByLayer ( const Layer* ) const; Track* getTrackByPosition ( const Layer*, DbU::Unit axis, unsigned int mode=Constant::Nearest ) const; void printCompletion () const; + void dumpMeasures ( std::ostream& ) const; + void dumpMeasures () const; inline void setPostEventCb ( Configuration::PostEventCb_t ); inline void setMinimumWL ( double ); inline void setRipupLimit ( unsigned int, unsigned int type );