Restore the measurements taking in Anabatic/Katana.

* New: In AnabaticEngine::printMeasures(), re-enable runtime & memory
    footprint in measurements.
* Bug: In Anabatic::AutoSegment CTOR, correct computation of the initial
    number of global segments. We were relying on the "global" flag,
    which is *not* set at this stage. Now compare source and target
    GCells.
* New: In KatanaEngine::runGlobalRouter(), store H-ovE & V-ovE in
    measurements.
* New: In KatanaEngine CTOR, add the number of gates (flattened) to
    the measurments.
* New: In KatanaEngine::runNegociate(), add the number of GCells to
    the measurements.
* Change: In KatanaEngine::printCompletion(), compute the wirelengths
    in either lambdas (symbolic) or *nanometers* (real).
* New: In cumulus/plugins.block.Block, add a setting to request the
    Katana measurements dumping: "cfg.katana.dumpMeasures"
This commit is contained in:
Jean-Paul Chaput 2021-11-24 15:52:56 +01:00
parent 10bd5510da
commit ca499e024c
6 changed files with 33 additions and 12 deletions

View File

@ -1757,10 +1757,10 @@ namespace Anabatic {
{ {
Super::printMeasures(); Super::printMeasures();
// if (not tag.empty()) { if (not tag.empty()) {
// addMeasure<double>( getCell(), tag+"T", getTimer().getCombTime () ); addMeasure<double>( tag+"T", getTimer().getCombTime () );
// addMeasure<size_t>( getCell(), tag+"S", (getTimer().getMemorySize() >> 20) ); addMeasure<size_t>( tag+"S", (getTimer().getMemorySize() >> 20) );
// } }
} }

View File

@ -529,10 +529,10 @@ namespace Anabatic {
if (dynamic_cast<Horizontal*>(segment)) setFlags( SegHorizontal ); if (dynamic_cast<Horizontal*>(segment)) setFlags( SegHorizontal );
_globalsCount += isGlobal() ? 1 : 0;
AutoContact* source = Session::lookup(dynamic_cast<Contact*>(segment->getSource())); AutoContact* source = Session::lookup(dynamic_cast<Contact*>(segment->getSource()));
AutoContact* target = Session::lookup(dynamic_cast<Contact*>(segment->getTarget())); AutoContact* target = Session::lookup(dynamic_cast<Contact*>(segment->getTarget()));
_globalsCount += (source->getGCell() != target->getGCell()) ? 1 : 0;
if (source->isTerminal()) setFlags( SegSourceTerminal ); if (source->isTerminal()) setFlags( SegSourceTerminal );
if (target->isTerminal()) setFlags( SegTargetTerminal ); if (target->isTerminal()) setFlags( SegTargetTerminal );

View File

@ -769,6 +769,8 @@ class Block ( object ):
success = self.katana.isDetailedRoutingSuccess() success = self.katana.isDetailedRoutingSuccess()
Breakpoint.stop( 100, 'Block.route() done, success:{}.'.format(success) ) Breakpoint.stop( 100, 'Block.route() done, success:{}.'.format(success) )
self.katana.finalizeLayout() self.katana.finalizeLayout()
if self.conf.cfg.katana.dumpMeasures is True:
self.katana.dumpMeasures()
self.katana.destroy() self.katana.destroy()
self.katana = None self.katana = None
if self.etesian: if self.etesian:

View File

@ -1217,6 +1217,7 @@ class BlockConf ( GaugeConf ):
self.cfg.etesian.spaceMargin = None self.cfg.etesian.spaceMargin = None
self.cfg.etesian.latchUpDistance = None self.cfg.etesian.latchUpDistance = None
self.cfg.block.spareSide = None self.cfg.block.spareSide = None
self.cfg.katana.dumpMeasures = None
self.etesian = None self.etesian = None
self.katana = None self.katana = None

View File

@ -623,14 +623,14 @@ namespace Katana {
stopMeasures(); stopMeasures();
printMeasures( "Dijkstra" ); printMeasures( "Dijkstra" );
uint32_t hoverflow = 0;
uint32_t voverflow = 0;
if (not ovEdges.empty()) { if (not ovEdges.empty()) {
Histogram ovHistogram ( 0.0, 1.0, 1 ); Histogram ovHistogram ( 0.0, 1.0, 1 );
ovHistogram.setTitle ( "Overflowed", 0 ); ovHistogram.setTitle ( "Overflowed", 0 );
ovHistogram.setColor ( "green" , 0 ); ovHistogram.setColor ( "green" , 0 );
ovHistogram.setIndent( " " , 0 ); ovHistogram.setIndent( " " , 0 );
uint32_t hoverflow = 0;
uint32_t voverflow = 0;
set<const Net*,Net::CompareByName> nets; set<const Net*,Net::CompareByName> nets;
set<Segment* ,DBo::CompareById > segments; set<Segment* ,DBo::CompareById > segments;
@ -694,6 +694,9 @@ namespace Katana {
if (flags & Flags::ShowBloatedInstances) selectBloatedInstances( this ); if (flags & Flags::ShowBloatedInstances) selectBloatedInstances( this );
} }
addMeasure<uint32_t>( "H-ovE", hoverflow, 12 );
addMeasure<uint32_t>( "V-ovE", voverflow, 12 );
if (getBlock(0)) { if (getBlock(0)) {
getBlock(0)->resizeChannels(); getBlock(0)->resizeChannels();
_resizeMatrix(); _resizeMatrix();

View File

@ -200,6 +200,9 @@ namespace Katana {
, _successState (0) , _successState (0)
{ {
//Entity::setMemoryLimit( 1024 ); // 1Gb. //Entity::setMemoryLimit( 1024 ); // 1Gb.
addMeasure<size_t>( "Gates"
, AllianceFramework::getInstancesCount(cell,AllianceFramework::IgnoreFeeds
|AllianceFramework::Recursive) );
} }
@ -599,6 +602,8 @@ namespace Katana {
{ {
if (_negociateWindow) return; if (_negociateWindow) return;
addMeasure<size_t>( "GCells", getGCells().size() );
startMeasures(); startMeasures();
openSession(); openSession();
@ -664,13 +669,19 @@ namespace Katana {
vector<TrackElement*> unrouteds; vector<TrackElement*> unrouteds;
vector<TrackElement*> reduceds; vector<TrackElement*> reduceds;
ostringstream result; ostringstream result;
bool isSymbolic =
const_cast<KatanaEngine*>(this)->getConfiguration()->getRoutingGauge()->isSymbolic();
AutoSegmentLut::const_iterator ilut = _getAutoSegmentLut().begin(); AutoSegmentLut::const_iterator ilut = _getAutoSegmentLut().begin();
for ( ; ilut != _getAutoSegmentLut().end() ; ilut++ ) { for ( ; ilut != _getAutoSegmentLut().end() ; ilut++ ) {
TrackElement* segment = _lookup( ilut->second ); TrackElement* segment = _lookup( ilut->second );
if (segment == NULL) continue; if (segment == NULL) continue;
uint64_t wl = (unsigned long long)DbU::toLambda( segment->getLength() ); uint64_t wl = 0;
if (isSymbolic)
wl = (unsigned long long)DbU::toLambda( segment->getLength() );
else
wl = (unsigned long long)DbU::toPhysical( segment->getLength(), DbU::UnitPower::Nano );
if (wl > 100000) { if (wl > 100000) {
cerr << Error("KatanaEngine::printCompletion(): Suspiciously long wire: %llu for %p:%s" cerr << Error("KatanaEngine::printCompletion(): Suspiciously long wire: %llu for %p:%s"
,wl,ilut->first,getString(segment).c_str()) << endl; ,wl,ilut->first,getString(segment).c_str()) << endl;
@ -711,6 +722,10 @@ namespace Katana {
// } // }
// } // }
if (not isSymbolic) {
totalWireLength /= 1000;
routedWireLength /= 1000;
}
result << setprecision(4) << segmentRatio result << setprecision(4) << segmentRatio
<< "% [" << routeds << "+" << unrouteds.size() << "]"; << "% [" << routeds << "+" << unrouteds.size() << "]";
cmess1 << Dots::asString( " - Track Segment Completion Ratio", result.str() ) << endl; cmess1 << Dots::asString( " - Track Segment Completion Ratio", result.str() ) << endl;
@ -741,8 +756,8 @@ namespace Katana {
cmess1 << Dots::asString( " - Unrouted verticals", result.str() ) << endl; cmess1 << Dots::asString( " - Unrouted verticals", result.str() ) << endl;
addMeasure<size_t> ( "Segs" , routeds+unrouteds.size() ); addMeasure<size_t> ( "Segs" , routeds+unrouteds.size() );
addMeasure<uint64_t>( "DWL(l)" , totalWireLength , 12 ); addMeasure<uint64_t>( "DWL" , totalWireLength , 12 );
addMeasure<uint64_t>( "fWL(l)" , totalWireLength-routedWireLength , 12 ); addMeasure<uint64_t>( "fWL" , totalWireLength-routedWireLength , 12 );
addMeasure<double> ( "WLER(%)", expandRatio ); addMeasure<double> ( "WLER(%)", expandRatio );
} }
@ -768,8 +783,8 @@ namespace Katana {
measuresLabels.push_back( getMeasureLabel("algoS" ) ); measuresLabels.push_back( getMeasureLabel("algoS" ) );
measuresLabels.push_back( getMeasureLabel("finT" ) ); measuresLabels.push_back( getMeasureLabel("finT" ) );
measuresLabels.push_back( getMeasureLabel("Segs" ) ); measuresLabels.push_back( getMeasureLabel("Segs" ) );
measuresLabels.push_back( getMeasureLabel("DWL(l)" ) ); measuresLabels.push_back( getMeasureLabel("DWL" ) );
measuresLabels.push_back( getMeasureLabel("fWL(l)" ) ); measuresLabels.push_back( getMeasureLabel("fWL" ) );
measuresLabels.push_back( getMeasureLabel("WLER(%)" ) ); measuresLabels.push_back( getMeasureLabel("WLER(%)" ) );
measuresLabels.push_back( getMeasureLabel("Events" ) ); measuresLabels.push_back( getMeasureLabel("Events" ) );
measuresLabels.push_back( getMeasureLabel("UEvents" ) ); measuresLabels.push_back( getMeasureLabel("UEvents" ) );