From 9d818df5b12f6e3809c400f88a9016a770985f83 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 5 Jun 2022 20:36:41 +0200 Subject: [PATCH] Computation of the relative area used by the registers in Etesian. * Change: In EtesianEngine::toColoquinte(), not only compute the ratio of DFF versus the total number of gates, but also the ratio in term of area. As the DFF are usually very big cells compare to combinatorial one, the direct gate ratio could be misleading as to the "weight" of those cell in the design. --- etesian/src/EtesianEngine.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/etesian/src/EtesianEngine.cpp b/etesian/src/EtesianEngine.cpp index 2c31c702..95d6fb15 100644 --- a/etesian/src/EtesianEngine.cpp +++ b/etesian/src/EtesianEngine.cpp @@ -733,8 +733,9 @@ namespace Etesian { } cmess2 << " - Whole place area: " << getBlockCell()->getAbutmentBox() << "." << endl; cmess2 << " - Sub-place Area: " << _placeArea << "." << endl; - DbU::Unit totalLength = (_placeArea.getHeight()/sliceHeight) * _placeArea.getWidth(); - DbU::Unit usedLength = 0; + DbU::Unit totalLength = (_placeArea.getHeight()/sliceHeight) * _placeArea.getWidth(); + DbU::Unit usedLength = 0; + DbU::Unit registerLength = 0; Dots dots ( cmess2, " ", 80, 1000 ); if (not cmess2.enabled()) dots.disable(); @@ -750,8 +751,11 @@ namespace Etesian { for ( Instance* instance : getCell()->getInstances() ) { if (instance == getBlockInstance()) continue; string masterName = getString( instance->getMasterCell()->getName() ); - if (masterName.substr(0,3) == "sff") ++registerNb; - Box instanceAb = instance->getAbutmentBox(); + Box instanceAb = instance->getAbutmentBox(); + if (masterName.substr(0,3) == "sff") { + ++registerNb; + registerLength += instanceAb.getWidth(); + } if (instance->getPlacementStatus() == Instance::PlacementStatus::FIXED) { if (topAb.intersect(instanceAb)) { ++instancesNb; @@ -759,6 +763,9 @@ namespace Etesian { totalLength -= (instanceAb.getHeight()/sliceHeight) * instanceAb.getWidth(); } } + if (instance->getPlacementStatus() == Instance::PlacementStatus::PLACED) { + cerr << "PLACED " << instance << endl; + } } } @@ -767,10 +774,15 @@ namespace Etesian { Instance* instance = static_cast(occurrence.getEntity()); Box instanceAb = instance->getAbutmentBox(); string masterName = getString( instance->getMasterCell()->getName() ); - if (masterName.substr(0,3) == "sff") ++registerNb; + if (masterName.substr(0,3) == "sff") { + ++registerNb; + registerLength += instanceAb.getWidth(); + } if (instance->getPlacementStatus() == Instance::PlacementStatus::FIXED) { ++fixedNb; totalLength -= (instanceAb.getHeight()/sliceHeight) * instanceAb.getWidth(); + } else if (instance->getPlacementStatus() == Instance::PlacementStatus::PLACED) { + cerr << "PLACED " << instance << endl; } else { usedLength += (instanceAb.getHeight()/sliceHeight) * instanceAb.getWidth(); //cerr << DbU::getValueString(usedLength) << " " << instance << endl; @@ -799,7 +811,9 @@ namespace Etesian { float ratio = ((float)registerNb / (float)instancesNb) * 100.0; ostringstream os1; os1 << registerNb << " (" << fixed << setprecision(2) << ratio << "%)"; - cmess1 << ::Dots::asString( " - Registers (DFF) ", os1.str() ) << endl; + cmess1 << ::Dots::asString ( " - Registers (DFF) ", os1.str() ) << endl; + cmess1 << ::Dots::asPercentage( " - Registers (DFF) area " + , (float)(registerLength)/(float)totalLength ) << endl; ratio = ((float)_bufferCount / (float)instancesNb) * 100.0; ostringstream os2; os2 << _bufferCount << " (" << fixed << setprecision(2) << ratio << "%)";