From 10de86a8dc5b915a69f11968728289b7c5b1a8ac Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Thu, 13 May 2010 09:45:53 +0000 Subject: [PATCH] * ./knik: - New: KnikEngine::computeSymbolicWireLength(), which adds to the measurments 1. - The sum of global wire length (in lambdas). 2. - The abutment box area of the design (in square lambdas). 3. - The saturation ratio of the design: wire length divided by area and normalized by a "fully routed GCell". --- knik/src/Graph.cpp | 4 +++- knik/src/KnikEngine.cpp | 32 ++++++++++++++++++++++++++++++++ knik/src/LoadSolution.cpp | 2 ++ knik/src/knik/KnikEngine.h | 31 ++++++++++++++++--------------- 4 files changed, 53 insertions(+), 16 deletions(-) diff --git a/knik/src/Graph.cpp b/knik/src/Graph.cpp index 9f24c8d2..5f95d7bf 100644 --- a/knik/src/Graph.cpp +++ b/knik/src/Graph.cpp @@ -1971,7 +1971,9 @@ unsigned Graph::analyseRouting ( set& segmentsToUnroute ) // This function construct the list of segments that participate to congestion // empty Priority queue : easier than update each semgent when removing a semgent ... clearSTuplePQ(); - // 30/01/09 on remplace le parcours des nets/segments par un parcours des edges avec un map trié sur pointeur de segments et définissant un record : nbDep nBTot + sumOv pour chaque segment. + // 30/01/09 on remplace le parcours des nets/segments par un parcours des + // edges avec un map trié sur pointeur de segments et définissant un record: + // nbDep nBTot + sumOv pour chaque segment. unsigned nbEdgesTot = 0; unsigned nbEdgesOv = 0; unsigned overflow = 0; diff --git a/knik/src/KnikEngine.cpp b/knik/src/KnikEngine.cpp index 6d0f2cb0..9dfdfc37 100644 --- a/knik/src/KnikEngine.cpp +++ b/knik/src/KnikEngine.cpp @@ -1030,6 +1030,8 @@ void KnikEngine::run() addMeasure ( getCell(), "knikT", _timer.getCombTime () ); addMeasure ( getCell(), "knikS", (_timer.getMemorySize() >> 20) ); + + computeSymbolicWireLength (); } void KnikEngine::Route() @@ -1218,6 +1220,36 @@ void KnikEngine::reroute() } +void KnikEngine::computeSymbolicWireLength () +{ +// Ugly: hardcoded SxLib gauge characteristics. + const double normalize = (50.0 * 10 * 4) / (50 * 50) ; + Name obstacleNetName ("obstaclenet"); + unsigned long long symbolicWireLength = 0; + + forEach ( Net*, net, getCell()->getNets() ) { + if ( net->isGlobal() + or net->isSupply() + or net->isClock() + or (net->getName() == obstacleNetName) ) { + continue; + } + + forEach ( Segment*, isegment, net->getSegments() ) { + symbolicWireLength += (unsigned long long)DbU::getLambda ( isegment->getLength() ); + } + } + + addMeasure ( getCell(), "GWL(l)", symbolicWireLength, 14 ); + + Box ab ( getCell()->getAbutmentBox() ); + double area = (DbU::getLambda(ab.getWidth()) * DbU::getLambda(ab.getHeight()) ); + + addMeasure ( getCell(), "Area(l2)", area, 14 ); + addMeasure ( getCell(), "Sat." , (symbolicWireLength/area)/normalize ); +} + + Record* KnikEngine::_getRecord() const // ***************************** { diff --git a/knik/src/LoadSolution.cpp b/knik/src/LoadSolution.cpp index c5b59011..4bdb30f4 100644 --- a/knik/src/LoadSolution.cpp +++ b/knik/src/LoadSolution.cpp @@ -427,6 +427,8 @@ namespace Knik { addMeasure ( getCell(), "knikT", 0.0 ); addMeasure ( getCell(), "knikS", 0 ); + + computeSymbolicWireLength (); } diff --git a/knik/src/knik/KnikEngine.h b/knik/src/knik/KnikEngine.h index 29dd4a27..cf97d1af 100644 --- a/knik/src/knik/KnikEngine.h +++ b/knik/src/knik/KnikEngine.h @@ -192,21 +192,22 @@ typedef vector NetVector; // Others // ****** public: - static KnikEngine* get ( const Cell* ); - static const Name& staticGetName () { return _toolName; }; - static float getEdgeCapacityPercent () { return _edgeCapacityPercent; }; - const Name& getName () const { return _toolName; }; - void printTime (); - void computeOverflow (); - // void showOccupancy (); - // void showEstimateOccupancy (); - void getHorizontalCutLines ( vector& horizontalCutLines ); - void getVerticalCutLines ( vector& verticalCutLines ); - void saveSolution ( const string& fileName="" ); - void loadSolution ( const string& fileName="" ); - string _getSolutionName () const; - virtual Record* _getRecord () const; - virtual string _getTypeName () const { return _TName ( "KnikEngine" ); }; + static KnikEngine* get ( const Cell* ); + static const Name& staticGetName () { return _toolName; }; + static float getEdgeCapacityPercent () { return _edgeCapacityPercent; }; + const Name& getName () const { return _toolName; }; + void printTime (); + void computeOverflow (); + void computeSymbolicWireLength (); + // void showOccupancy (); + // void showEstimateOccupancy (); + void getHorizontalCutLines ( vector& horizontalCutLines ); + void getVerticalCutLines ( vector& verticalCutLines ); + void saveSolution ( const string& fileName="" ); + void loadSolution ( const string& fileName="" ); + string _getSolutionName () const; + virtual Record* _getRecord () const; + virtual string _getTypeName () const { return _TName ( "KnikEngine" ); }; };