From d98b31a85621149f48e592b892777e8bc679c0ff Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 17 Apr 2010 10:14:22 +0000 Subject: [PATCH] * ./katabatic: - Bug: In GCell, bad cast between and , showed only under 64 bits. - New: In KatabaticEngine::printMeasures(), adds a support for measurments, both time and memory size in Mb are stored for each tag. - New: Adds measurements "Gates", "GCells", "load" & "assign". --- katabatic/src/GCell.cpp | 18 +++--------------- katabatic/src/KatabaticEngine.cpp | 19 ++++++++++++++++--- katabatic/src/LayerAssign.cpp | 2 +- katabatic/src/LoadGrByNet.cpp | 2 +- katabatic/src/katabatic/GCell.h | 2 +- katabatic/src/katabatic/KatabaticEngine.h | 2 +- 6 files changed, 23 insertions(+), 22 deletions(-) diff --git a/katabatic/src/GCell.cpp b/katabatic/src/GCell.cpp index 5b5bdc90..8df443a4 100644 --- a/katabatic/src/GCell.cpp +++ b/katabatic/src/GCell.cpp @@ -711,25 +711,13 @@ namespace Katabatic { if ( rpNets.size() < 8 ) return; - cerr << "[WARNING] " << this << " has " << rps.size() << " terminals h:" - << _hsegments.size() << endl; - - irp = rps.begin(); - for ( ; irp != rps.end() ; ++irp ) - cerr << " " << *irp << endl; + cerr << "[WARNING] " << this << " has " << rps.size() << " terminals (h:" + << _hsegments.size() << ")" << endl; AutoSegment* segment; while ( stepDesaturate ( 1, globalNets, segment, true ) ) { - //cerr << "Moved up: " << segment << endl; + ltrace(200) << "Moved up: " << segment << endl; } - -#if 0 - set::iterator ipad = rps.begin(); - for ( ; ipad != rps.end() ; ++ipad ) { - forEach ( Segment*, isegment, (*ipad)->getSlaveComponents().getSubSet() ) { - } - } -#endif } diff --git a/katabatic/src/KatabaticEngine.cpp b/katabatic/src/KatabaticEngine.cpp index 543755f3..ebce2122 100644 --- a/katabatic/src/KatabaticEngine.cpp +++ b/katabatic/src/KatabaticEngine.cpp @@ -38,6 +38,7 @@ #include "hurricane/Cell.h" #include "crlcore/Utilities.h" +#include "crlcore/Measures.h" #include "crlcore/AllianceFramework.h" #include "katabatic/Session.h" @@ -169,6 +170,9 @@ namespace Katabatic { using Hurricane::BasicLayer; using Hurricane::NetExternalComponents; using CRL::AllianceFramework; + using CRL::Measures; + using CRL::addMeasure; + using CRL::getMeasure; // ------------------------------------------------------------------- @@ -225,7 +229,9 @@ namespace Katabatic { , _configuration (gauge) , _gcellGrid (NULL) , _routingNets () - { } + { + addMeasure ( cell, "Gates", cell->getInstances().getSize() ); + } void KatabaticEngine::_postCreate () @@ -238,6 +244,8 @@ namespace Katabatic { { _gcellGrid = GCellGrid::create ( this ); Session::revalidate (); + + addMeasure ( getCell(), "GCells", _gcellGrid->getGCellVector()->size() ); } @@ -407,13 +415,18 @@ namespace Katabatic { } - void KatabaticEngine::printMeasures () const + void KatabaticEngine::printMeasures ( const string& tag ) const { cmess1 << " - Done in " << Timer::getStringTime(_timer.getCombTime()) << " [+" << Timer::getStringMemory(_timer.getIncrease()) << "]." << endl; cmess1 << " (raw measurements : " << _timer.getCombTime() << "s [+" << (_timer.getIncrease()>>10) << "Ko/" << (_timer.getMemorySize()>>10) << "Ko])" << endl; + + if ( not tag.empty() ) { + addMeasure ( getCell(), tag+"T", _timer.getCombTime () ); + addMeasure ( getCell(), tag+"S", (_timer.getMemorySize() >> 20) ); + } } @@ -542,7 +555,7 @@ namespace Katabatic { startMeasures (); _gutKatabatic (); stopMeasures (); - printMeasures (); + printMeasures ( "fin" ); _state = StateGutted; } diff --git a/katabatic/src/LayerAssign.cpp b/katabatic/src/LayerAssign.cpp index 77e783b7..a7d9c1d9 100644 --- a/katabatic/src/LayerAssign.cpp +++ b/katabatic/src/LayerAssign.cpp @@ -314,7 +314,7 @@ namespace Katabatic { Session::close (); stopMeasures (); - printMeasures (); + printMeasures ( "assign" ); cmess2 << " - Total segments : " << total << endl; cmess2 << " - Global segments : " << global << endl; diff --git a/katabatic/src/LoadGrByNet.cpp b/katabatic/src/LoadGrByNet.cpp index e688b8bd..1014e3fb 100644 --- a/katabatic/src/LoadGrByNet.cpp +++ b/katabatic/src/LoadGrByNet.cpp @@ -2315,7 +2315,7 @@ namespace Katabatic { Session::close (); stopMeasures (); - printMeasures (); + printMeasures ( "load" ); } diff --git a/katabatic/src/katabatic/GCell.h b/katabatic/src/katabatic/GCell.h index 0dec185d..03ecb5f6 100644 --- a/katabatic/src/katabatic/GCell.h +++ b/katabatic/src/katabatic/GCell.h @@ -267,7 +267,7 @@ namespace Katabatic { inline float GCell::Key::getDensity () const { return _density; } inline unsigned int GCell::Key::getIndex () const { return _index; } inline void GCell::Key::update ( GCell* gcell, unsigned int depth ) - { _density=gcell->getDensity(depth); _index=gcell->getIndex(); } + { _density=gcell->getDensity((size_t)depth); _index=gcell->getIndex(); } inline bool operator< ( const GCell::Key& lhs, const GCell::Key& rhs ) { diff --git a/katabatic/src/katabatic/KatabaticEngine.h b/katabatic/src/katabatic/KatabaticEngine.h index c3a14ab8..cb3cfacc 100644 --- a/katabatic/src/katabatic/KatabaticEngine.h +++ b/katabatic/src/katabatic/KatabaticEngine.h @@ -138,7 +138,7 @@ namespace Katabatic { inline void setSaturateRatio ( float ); void startMeasures (); void stopMeasures (); - void printMeasures () const; + void printMeasures ( const string& ) const; void refresh ( bool openSession=true ); void makePowerRails (); virtual void createDetailedGrid ();