Fairly compute the flat numbers of instances in a design.
* New: In AllianceFramework::getInstancesCount(), add a flag TerminalNetlist to stop recursion on "terminal for netlist" instance level. This is to avoid counting physical only or non-routed instances inside hard macros, like SRAM blocks. This was leading to an overstimation of the "size" in number of gates of the routing problem. * Change: In KatanaEngine CTOR, call for the terminal for netlist number of gates...
This commit is contained in:
parent
966a25181f
commit
7c0f1fcf58
|
@ -858,18 +858,19 @@ namespace CRL {
|
||||||
{
|
{
|
||||||
size_t gates = 0;
|
size_t gates = 0;
|
||||||
|
|
||||||
forEach ( Instance*, iinstance, cell->getInstances() ) {
|
for ( Instance* instance : cell->getInstances() ) {
|
||||||
CatalogProperty *catalogProperty = static_cast<CatalogProperty*>
|
CatalogProperty *catalogProperty = static_cast<CatalogProperty*>
|
||||||
((*iinstance)->getMasterCell()->getProperty ( CatalogProperty::getPropertyName()) );
|
(instance->getMasterCell()->getProperty ( CatalogProperty::getPropertyName()) );
|
||||||
|
|
||||||
if ( catalogProperty != NULL ) {
|
if (catalogProperty) {
|
||||||
Catalog::State* state = catalogProperty->getState();
|
Catalog::State* state = catalogProperty->getState();
|
||||||
if ((flags & IgnoreFeeds) and state->isFeed()) continue;
|
if ((flags & IgnoreFeeds) and state->isFeed()) continue;
|
||||||
}
|
}
|
||||||
|
if (not (flags & TerminalNetlist) or instance->getMasterCell()->isTerminalNetlist())
|
||||||
++gates;
|
++gates;
|
||||||
|
|
||||||
if (flags & Recursive) {
|
if (flags & Recursive) {
|
||||||
gates += getInstancesCount ( iinstance->getMasterCell(), flags );
|
gates += getInstancesCount( instance->getMasterCell(), flags );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,6 +47,7 @@ namespace CRL {
|
||||||
};
|
};
|
||||||
enum InstancesCountFlags { Recursive = (1<<0)
|
enum InstancesCountFlags { Recursive = (1<<0)
|
||||||
, IgnoreFeeds = (1<<1)
|
, IgnoreFeeds = (1<<1)
|
||||||
|
, TerminalNetlist = (1<<1)
|
||||||
};
|
};
|
||||||
enum LibraryFlags { CreateLibrary = (1<<0)
|
enum LibraryFlags { CreateLibrary = (1<<0)
|
||||||
, AppendLibrary = (1<<1)
|
, AppendLibrary = (1<<1)
|
||||||
|
|
|
@ -202,6 +202,7 @@ namespace Katana {
|
||||||
//Entity::setMemoryLimit( 1024 ); // 1Gb.
|
//Entity::setMemoryLimit( 1024 ); // 1Gb.
|
||||||
addMeasure<size_t>( "Gates"
|
addMeasure<size_t>( "Gates"
|
||||||
, AllianceFramework::getInstancesCount(cell,AllianceFramework::IgnoreFeeds
|
, AllianceFramework::getInstancesCount(cell,AllianceFramework::IgnoreFeeds
|
||||||
|
|AllianceFramework::TerminalNetlist
|
||||||
|AllianceFramework::Recursive) );
|
|AllianceFramework::Recursive) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -671,6 +672,8 @@ namespace Katana {
|
||||||
ostringstream result;
|
ostringstream result;
|
||||||
bool isSymbolic =
|
bool isSymbolic =
|
||||||
const_cast<KatanaEngine*>(this)->getConfiguration()->getRoutingGauge()->isSymbolic();
|
const_cast<KatanaEngine*>(this)->getConfiguration()->getRoutingGauge()->isSymbolic();
|
||||||
|
// Max symbolic wire: 100000L, max real wire: 2mm.
|
||||||
|
uint64_t maxWL = (isSymbolic) ? 100000 : 2000000;
|
||||||
|
|
||||||
AutoSegmentLut::const_iterator ilut = _getAutoSegmentLut().begin();
|
AutoSegmentLut::const_iterator ilut = _getAutoSegmentLut().begin();
|
||||||
for ( ; ilut != _getAutoSegmentLut().end() ; ilut++ ) {
|
for ( ; ilut != _getAutoSegmentLut().end() ; ilut++ ) {
|
||||||
|
@ -682,7 +685,7 @@ namespace Katana {
|
||||||
wl = (unsigned long long)DbU::toLambda( segment->getLength() );
|
wl = (unsigned long long)DbU::toLambda( segment->getLength() );
|
||||||
else
|
else
|
||||||
wl = (unsigned long long)DbU::toPhysical( segment->getLength(), DbU::UnitPower::Nano );
|
wl = (unsigned long long)DbU::toPhysical( segment->getLength(), DbU::UnitPower::Nano );
|
||||||
if (wl > 100000) {
|
if (wl > maxWL) {
|
||||||
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;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in New Issue