diff options
Diffstat (limited to 'src/aig')
-rw-r--r-- | src/aig/gia/gia.h | 2 | ||||
-rw-r--r-- | src/aig/gia/giaIf.c | 37 | ||||
-rw-r--r-- | src/aig/gia/giaJf.c | 4 | ||||
-rw-r--r-- | src/aig/gia/giaMan.c | 2 |
4 files changed, 44 insertions, 1 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index a2f6aeb1..919c1031 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -189,6 +189,7 @@ struct Gps_Par_t_ int fSwitch; int fCut; int fNpn; + int fLutProf; }; typedef struct Emb_Par_t_ Emb_Par_t; @@ -1041,6 +1042,7 @@ extern int Gia_ManHashAndMulti( Gia_Man_t * p, Vec_Int_t * vLits /*=== giaIf.c ===========================================================*/ extern void Gia_ManPrintMappingStats( Gia_Man_t * p ); extern void Gia_ManPrintPackingStats( Gia_Man_t * p ); +extern void Gia_ManPrintLutStats( Gia_Man_t * p ); extern int Gia_ManLutFaninCount( Gia_Man_t * p ); extern int Gia_ManLutSizeMax( Gia_Man_t * p ); extern int Gia_ManLutNum( Gia_Man_t * p ); diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c index c4c5fcda..cf4eef5a 100644 --- a/src/aig/gia/giaIf.c +++ b/src/aig/gia/giaIf.c @@ -312,6 +312,43 @@ void Gia_ManPrintPackingStats( Gia_Man_t * p ) Abc_Print( 1, "\n" ); } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Gia_ManPrintNodeProfile( int * pCounts, int nSizeMax ) +{ + int i, SizeAll = 0, NodeAll = 0; + for ( i = 0; i <= nSizeMax; i++ ) + { + SizeAll += i * pCounts[i]; + NodeAll += pCounts[i]; + } + Abc_Print( 1, "LUT = %d : ", NodeAll ); + for ( i = 2; i <= nSizeMax; i++ ) + Abc_Print( 1, "%d=%d %.1f %% ", i, pCounts[i], 100.0*pCounts[i]/NodeAll ); + Abc_Print( 1, "Ave = %.2f\n", 1.0*SizeAll/(NodeAll ? NodeAll : 1) ); +} +void Gia_ManPrintLutStats( Gia_Man_t * p ) +{ + int i, nSizeMax, pCounts[33] = {0}; + nSizeMax = Gia_ManLutSizeMax( p ); + if ( nSizeMax > 32 ) + { + Abc_Print( 1, "The max LUT size (%d) is too large.\n", nSizeMax ); + return; + } + Gia_ManForEachLut( p, i ) + pCounts[ Gia_ObjLutSize(p, i) ]++; + Gia_ManPrintNodeProfile( pCounts, nSizeMax ); +} /**Function************************************************************* diff --git a/src/aig/gia/giaJf.c b/src/aig/gia/giaJf.c index 4ee846ab..f66e07f3 100644 --- a/src/aig/gia/giaJf.c +++ b/src/aig/gia/giaJf.c @@ -781,7 +781,8 @@ void Jf_ManDeriveMapping( Jf_Man_t * p ) Vec_Int_t * vMapping; Gia_Obj_t * pObj; int i, k, * pCut; - vMapping = Vec_IntStart( Gia_ManObjNum(p->pGia) ); + vMapping = Vec_IntAlloc( Gia_ManObjNum(p->pGia) + p->pPars->Edge + p->pPars->Area * 2 ); + Vec_IntFill( vMapping, Gia_ManObjNum(p->pGia), 0 ); Gia_ManForEachAnd( p->pGia, pObj, i ) { if ( Gia_ObjIsBuf(pObj) || Gia_ObjRefNum(p->pGia, pObj) == 0 ) @@ -792,6 +793,7 @@ void Jf_ManDeriveMapping( Jf_Man_t * p ) Vec_IntPush( vMapping, pCut[k] ); Vec_IntPush( vMapping, i ); } + assert( Vec_IntSize(vMapping) == Vec_IntCap(vMapping) ); p->pGia->vMapping = vMapping; // Gia_ManMappingVerify( p->pGia ); } diff --git a/src/aig/gia/giaMan.c b/src/aig/gia/giaMan.c index ff48b405..8c5b3d99 100644 --- a/src/aig/gia/giaMan.c +++ b/src/aig/gia/giaMan.c @@ -363,6 +363,8 @@ void Gia_ManPrintStats( Gia_Man_t * p, Gps_Par_t * pPars ) Gia_ManPrintNpnClasses( p ); if ( p->vPacking ) Gia_ManPrintPackingStats( p ); + if ( pPars && pPars->fLutProf && Gia_ManHasMapping(p) ) + Gia_ManPrintLutStats( p ); if ( p->pPlacement ) Gia_ManPrintPlacement( p ); if ( p->pManTime ) |