Commit f8a990de by Alan Mishchenko

Adding print-out of average level.

parent 1efdd372
......@@ -306,8 +306,9 @@ int Gia_ManComputeOverlap( Gia_Man_t * p )
***********************************************************************/
void Gia_ManPrintMappingStats( Gia_Man_t * p, char * pDumpFile )
{
Gia_Obj_t * pObj;
int * pLevels;
int i, k, iFan, nLutSize = 0, nLuts = 0, nFanins = 0, LevelMax = 0;
int i, k, iFan, nLutSize = 0, nLuts = 0, nFanins = 0, LevelMax = 0, Ave = 0;
if ( !Gia_ManHasMapping(p) )
return;
pLevels = ABC_CALLOC( int, Gia_ManObjNum(p) );
......@@ -321,11 +322,14 @@ void Gia_ManPrintMappingStats( Gia_Man_t * p, char * pDumpFile )
pLevels[i]++;
LevelMax = Abc_MaxInt( LevelMax, pLevels[i] );
}
Gia_ManForEachCo( p, pObj, i )
Ave += pLevels[Gia_ObjFaninId0p(p, pObj)];
ABC_FREE( pLevels );
Abc_Print( 1, "Mapping (K=%d) : ", nLutSize );
Abc_Print( 1, "lut =%7d ", nLuts );
Abc_Print( 1, "edge =%8d ", nFanins );
Abc_Print( 1, "lev =%5d ", LevelMax );
Abc_Print( 1, "(%.2f) ", (float)Ave / Gia_ManCoNum(p) );
Abc_Print( 1, "over =%5.1f %% ", 100.0 * Gia_ManComputeOverlap(p) / Gia_ManAndNum(p) );
Abc_Print( 1, "mem =%5.2f MB", 4.0*(Gia_ManObjNum(p) + 2*nLuts + nFanins)/(1<<20) );
Abc_Print( 1, "\n" );
......
......@@ -379,6 +379,7 @@ void Gia_ManPrintChoiceStats( Gia_Man_t * p )
***********************************************************************/
void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
{
extern float Gia_ManLevelAve( Gia_Man_t * p );
if ( p->pName )
Abc_Print( 1, "%-8s : ", p->pName );
Abc_Print( 1, "i/o =%7d/%7d", Gia_ManPiNum(p), Gia_ManPoNum(p) );
......@@ -387,7 +388,9 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars )
if ( Gia_ManRegNum(p) )
Abc_Print( 1, " ff =%7d", Gia_ManRegNum(p) );
Abc_Print( 1, " %s =%8d", p->pMuxes? "nod" : "and", Gia_ManAndNum(p) );
Abc_Print( 1, " lev =%5d", Gia_ManLevelNum(p) ); Vec_IntFreeP( &p->vLevels );
Abc_Print( 1, " lev =%5d", Gia_ManLevelNum(p) );
Abc_Print( 1, " (%.2f)", Gia_ManLevelAve(p) );
Vec_IntFreeP( &p->vLevels );
if ( pPars && pPars->fCut )
Abc_Print( 1, " cut = %d(%d)", Gia_ManCrossCut(p, 0), Gia_ManCrossCut(p, 1) );
Abc_Print( 1, " mem =%5.2f MB", Gia_ManMemory(p)/(1<<20) );
......
......@@ -510,6 +510,15 @@ int Gia_ManLevelNum( Gia_Man_t * p )
}
return p->nLevels;
}
float Gia_ManLevelAve( Gia_Man_t * p )
{
Gia_Obj_t * pObj;
int i, Ave = 0;
assert( p->vLevels );
Gia_ManForEachCo( p, pObj, i )
Ave += Gia_ObjLevel(p, pObj);
return (float)Ave / Gia_ManCoNum(p);
}
/**Function*************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment