summaryrefslogtreecommitdiffstats
path: root/src/aig/gia
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-04-19 11:20:38 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-04-19 11:20:38 -0700
commitf8a990dea92df9c97b8881378042264dd97fd64a (patch)
tree9851a1af78310242e0e8121a1da72e13ded26795 /src/aig/gia
parent1efdd3726daf36fbe5533347b710afbc958ac466 (diff)
downloadabc-f8a990dea92df9c97b8881378042264dd97fd64a.tar.gz
abc-f8a990dea92df9c97b8881378042264dd97fd64a.tar.bz2
abc-f8a990dea92df9c97b8881378042264dd97fd64a.zip
Adding print-out of average level.
Diffstat (limited to 'src/aig/gia')
-rw-r--r--src/aig/gia/giaIf.c8
-rw-r--r--src/aig/gia/giaMan.c5
-rw-r--r--src/aig/gia/giaUtil.c9
3 files changed, 19 insertions, 3 deletions
diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c
index 1295be60..5b4d1cfa 100644
--- a/src/aig/gia/giaIf.c
+++ b/src/aig/gia/giaIf.c
@@ -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, "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" );
diff --git a/src/aig/gia/giaMan.c b/src/aig/gia/giaMan.c
index 36be9e49..82d74e50 100644
--- a/src/aig/gia/giaMan.c
+++ b/src/aig/gia/giaMan.c
@@ -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) );
diff --git a/src/aig/gia/giaUtil.c b/src/aig/gia/giaUtil.c
index 872f4086..e16ee44f 100644
--- a/src/aig/gia/giaUtil.c
+++ b/src/aig/gia/giaUtil.c
@@ -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*************************************************************