From 2f0bf5456df080277f2a3147aa324775cd77427d Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sat, 11 Dec 2021 19:47:24 +0100 Subject: [PATCH] Added Etesian to the measurment system. * Bug: In CRL::MeasureSet::toStringHeaders(), check and issue a warning if a measure label ends with a "." (dot). * Change: In CRL::ToolEngine::getMeasure(), return the data measure by pointer instead of by reference (easier to manipulate afterwards). * New: In EtesianEngine::place(), add the placement runtime (under label "placeT") to the measure set. * New: In KatanaEngine::dumpMeasures(), add the Etesian runtime to the set of measures. --- crlcore/src/ccore/crlcore/Measures.h | 9 +---- crlcore/src/ccore/crlcore/ToolEngine.h | 19 +++++---- crlcore/src/ccore/properties/Measures.cpp | 19 ++++++++- etesian/src/EtesianEngine.cpp | 1 + katana/src/KatanaEngine.cpp | 47 ++++++++++++----------- 5 files changed, 53 insertions(+), 42 deletions(-) diff --git a/crlcore/src/ccore/crlcore/Measures.h b/crlcore/src/ccore/crlcore/Measures.h index b7cd8f3f..69b2991c 100644 --- a/crlcore/src/ccore/crlcore/Measures.h +++ b/crlcore/src/ccore/crlcore/Measures.h @@ -1,7 +1,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2008-2018, All Rights Reserved +// Copyright (c) Sorbonne Université 2008-2021, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -14,9 +14,7 @@ // +-----------------------------------------------------------------+ -#ifndef CRL_MEASURES_PROPERTY_H -#define CRL_MEASURES_PROPERTY_H - +#pragma once #include #include #include @@ -233,6 +231,3 @@ namespace CRL { INSPECTOR_P_SUPPORT(CRL::BaseMeasure); INSPECTOR_P_SUPPORT(CRL::MeasuresDatas); - - -#endif // CRL_MEASURES_PROPERTY_H diff --git a/crlcore/src/ccore/crlcore/ToolEngine.h b/crlcore/src/ccore/crlcore/ToolEngine.h index 4535879b..9e521788 100644 --- a/crlcore/src/ccore/crlcore/ToolEngine.h +++ b/crlcore/src/ccore/crlcore/ToolEngine.h @@ -1,7 +1,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC 2008-2018, All Rights Reserved +// Copyright (c) Sorbonne Université 2008-2021, All Rights Reserved // // +-----------------------------------------------------------------+ // | C O R I O L I S | @@ -14,10 +14,7 @@ // +-----------------------------------------------------------------+ - -#ifndef CRL_TOOL_ENGINE_H -#define CRL_TOOL_ENGINE_H - +#pragma once #include #include "hurricane/Commons.h" #include "hurricane/Timer.h" @@ -75,7 +72,7 @@ namespace CRL { template inline void addMeasure ( std::string, Data* ) const; template - inline const Data& getMeasure ( std::string ) const; + inline const Data* getMeasure ( std::string ) const; virtual std::string _getTypeName () const; virtual std::string _getString () const; virtual Record* _getRecord () const; @@ -127,10 +124,12 @@ namespace CRL { { ::CRL::addMeasure( getCell(), getMeasureLabel(name), getPassNumber(), data ); } template - inline const Data& ToolEngine::getMeasure ( std::string name ) const - { return ::CRL::getMeasure( getCell(), getMeasureLabel(name) )->getData( getPassNumber() ); } + inline const Data* ToolEngine::getMeasure ( std::string name ) const + { + const Measure* measure = ::CRL::getMeasure( getCell(), getMeasureLabel(name) ); + if (not measure) return NULL; + return &(measure->getData( getPassNumber() )); + } } // CRL namespace. - -#endif // CRL_TOOL_ENGINE_H diff --git a/crlcore/src/ccore/properties/Measures.cpp b/crlcore/src/ccore/properties/Measures.cpp index c0aa336e..b75ff689 100644 --- a/crlcore/src/ccore/properties/Measures.cpp +++ b/crlcore/src/ccore/properties/Measures.cpp @@ -16,6 +16,7 @@ #include #include "hurricane/Error.h" +#include "hurricane/Warning.h" #include "hurricane/DBo.h" #include "crlcore/Measures.h" @@ -30,11 +31,13 @@ namespace CRL { using std::string; using std::vector; using std::ostringstream; + using std::cout; using std::cerr; using std::endl; using std::setw; using std::right; using Hurricane::Error; + using Hurricane::Warning; using Hurricane::ForEachIterator; @@ -68,7 +71,16 @@ namespace CRL { for ( size_t i=0 ; iisSimpleData()) { @@ -89,7 +101,10 @@ namespace CRL { for ( size_t i=0 ; iisSimpleData()) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index a825ed2d..b3375eff 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -1442,6 +1442,7 @@ namespace Etesian { ( " - HPWL", DbU::getValueString( (DbU::Unit)coloquinte::gp::get_HPWL_wirelength(*_circuit,*_placementUB )*getSliceStep() ) ) << endl; cmess1 << ::Dots::asString ( " - RMST", DbU::getValueString( (DbU::Unit)coloquinte::gp::get_RSMT_wirelength(*_circuit,*_placementUB )*getSliceStep() ) ) << endl; + addMeasure( "placeT", getTimer().getCombTime() ); UpdateSession::open(); for ( Net* net : getCell()->getNets() ) { diff --git a/katana/src/KatanaEngine.cpp b/katana/src/KatanaEngine.cpp index c5f3210a..6f21dd8b 100644 --- a/katana/src/KatanaEngine.cpp +++ b/katana/src/KatanaEngine.cpp @@ -768,29 +768,30 @@ namespace Katana { void KatanaEngine::dumpMeasures ( ostream& out ) const { vector measuresLabels; - measuresLabels.push_back( getMeasureLabel("Gates" ) ); - measuresLabels.push_back( getMeasureLabel("GCells" ) ); - //measuresLabels.push_back( getMeasureLabel("knikT" ) ); - //measuresLabels.push_back( getMeasureLabel("knikS" ) ); - //measuresLabels.push_back( getMeasureLabel("GWL(l)" ) ); - measuresLabels.push_back( getMeasureLabel("Area(l2)") ); - measuresLabels.push_back( getMeasureLabel("Sat." ) ); - measuresLabels.push_back( getMeasureLabel("loadT" ) ); - measuresLabels.push_back( getMeasureLabel("loadS" ) ); - measuresLabels.push_back( getMeasureLabel("H-ovE" ) ); - measuresLabels.push_back( getMeasureLabel("V-ovE" ) ); - measuresLabels.push_back( getMeasureLabel("Globals" ) ); - measuresLabels.push_back( getMeasureLabel("Edges" ) ); - measuresLabels.push_back( getMeasureLabel("assignT" ) ); - measuresLabels.push_back( getMeasureLabel("algoT" ) ); - measuresLabels.push_back( getMeasureLabel("algoS" ) ); - measuresLabels.push_back( getMeasureLabel("finT" ) ); - measuresLabels.push_back( getMeasureLabel("Segs" ) ); - measuresLabels.push_back( getMeasureLabel("DWL" ) ); - measuresLabels.push_back( getMeasureLabel("fWL" ) ); - measuresLabels.push_back( getMeasureLabel("WLER(%)" ) ); - measuresLabels.push_back( getMeasureLabel("Events" ) ); - measuresLabels.push_back( getMeasureLabel("UEvents" ) ); + measuresLabels.push_back( getMeasureLabel("Gates" ) ); + measuresLabels.push_back( getMeasureLabel("GCells" ) ); + //measuresLabels.push_back( getMeasureLabel("knikT" ) ); + //measuresLabels.push_back( getMeasureLabel("knikS" ) ); + //measuresLabels.push_back( getMeasureLabel("GWL" ) ); + measuresLabels.push_back( "Etesian::EtesianEngine.placeT" ); + measuresLabels.push_back( getMeasureLabel("Area" ) ); + measuresLabels.push_back( getMeasureLabel("Sat" ) ); + measuresLabels.push_back( getMeasureLabel("loadT" ) ); + measuresLabels.push_back( getMeasureLabel("loadS" ) ); + measuresLabels.push_back( getMeasureLabel("H-ovE" ) ); + measuresLabels.push_back( getMeasureLabel("V-ovE" ) ); + measuresLabels.push_back( getMeasureLabel("Globals") ); + measuresLabels.push_back( getMeasureLabel("Edges" ) ); + measuresLabels.push_back( getMeasureLabel("assignT") ); + measuresLabels.push_back( getMeasureLabel("algoT" ) ); + measuresLabels.push_back( getMeasureLabel("algoS" ) ); + measuresLabels.push_back( getMeasureLabel("finT" ) ); + measuresLabels.push_back( getMeasureLabel("Segs" ) ); + measuresLabels.push_back( getMeasureLabel("DWL" ) ); + measuresLabels.push_back( getMeasureLabel("fWL" ) ); + measuresLabels.push_back( getMeasureLabel("WLER(%)") ); + measuresLabels.push_back( getMeasureLabel("Events" ) ); + measuresLabels.push_back( getMeasureLabel("UEvents") ); const MeasuresSet* measures = Measures::get( getCell() );