diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-01-16 13:07:51 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-01-16 13:07:51 -0800 |
commit | 0695ec54736318a0fb76ee3df06e5d83719e1fc3 (patch) | |
tree | 1434e3511826e7b72c860fa7cd87020c5adbd243 /src | |
parent | ca28f77f3ac995ca5834b7ceef99ac0363f6ce8c (diff) | |
download | abc-0695ec54736318a0fb76ee3df06e5d83719e1fc3.tar.gz abc-0695ec54736318a0fb76ee3df06e5d83719e1fc3.tar.bz2 abc-0695ec54736318a0fb76ee3df06e5d83719e1fc3.zip |
New hierarchy manager plus additional printout in the GIA package.
Diffstat (limited to 'src')
-rw-r--r-- | src/aig/gia/gia.h | 5 | ||||
-rw-r--r-- | src/aig/gia/giaHash.c | 14 | ||||
-rw-r--r-- | src/aig/gia/giaMan.c | 1 | ||||
-rw-r--r-- | src/base/abc/abcHieCec.c | 4 | ||||
-rw-r--r-- | src/base/abc/abcHieNew.c | 21 |
5 files changed, 34 insertions, 11 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index d80c0963..6bf2918d 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -152,6 +152,7 @@ struct Gia_Man_t_ void * pLutLib; // LUT library word nHashHit; // hash table hit word nHashMiss; // hash table miss + int fVerbose; // verbose reports }; @@ -303,6 +304,7 @@ static inline int Gia_ManObjNum( Gia_Man_t * p ) { return p->nObjs static inline int Gia_ManAndNum( Gia_Man_t * p ) { return p->nObjs - Vec_IntSize(p->vCis) - Vec_IntSize(p->vCos) - 1; } static inline int Gia_ManCandNum( Gia_Man_t * p ) { return Gia_ManCiNum(p) + Gia_ManAndNum(p); } static inline int Gia_ManConstrNum( Gia_Man_t * p ) { return p->nConstrs; } +static inline void Gia_ManFlipVerbose( Gia_Man_t * p ) { p->fVerbose ^= 1; } static inline Gia_Obj_t * Gia_ManConst0( Gia_Man_t * p ) { return p->pObjs; } static inline Gia_Obj_t * Gia_ManConst1( Gia_Man_t * p ) { return Gia_Not(Gia_ManConst0(p)); } @@ -428,7 +430,8 @@ static inline Gia_Obj_t * Gia_ManAppendObj( Gia_Man_t * p ) { if ( p->nObjs == p->nObjsAlloc ) { -// printf("Reallocing %d.\n", 2 * p->nObjsAlloc ); + if ( p->fVerbose ) + printf("Extending GIA object storage: %d -> %d.\n", p->nObjsAlloc, 2 * p->nObjsAlloc ); assert( p->nObjsAlloc > 0 ); p->pObjs = ABC_REALLOC( Gia_Obj_t, p->pObjs, 2 * p->nObjsAlloc ); memset( p->pObjs + p->nObjsAlloc, 0, sizeof(Gia_Obj_t) * p->nObjsAlloc ); diff --git a/src/aig/gia/giaHash.c b/src/aig/gia/giaHash.c index c610bc9c..0437dfd9 100644 --- a/src/aig/gia/giaHash.c +++ b/src/aig/gia/giaHash.c @@ -151,6 +151,18 @@ void Gia_ManHashStart( Gia_Man_t * p ) ***********************************************************************/ void Gia_ManHashStop( Gia_Man_t * p ) { + int i, Ent, Counter; + printf( "Hash table hits = %12u. Hash table misses = %12u.\n", (int)p->nHashHit, (int)p->nHashMiss ); + printf( "Hash table size = %12u. Object count = %12u.\n", p->nHTable, p->nObjs ); + for ( i = 0; i < Abc_MinInt(p->nHTable, 1000); i++ ) + { + Counter = 0; + for ( Ent = Gia_Lit2Var(p->pHTable[i]); Ent; Ent = Gia_Lit2Var(Gia_ManObj(p, Ent)->Value) ) + Counter++; + printf( "%d ", Counter ); + } + printf( "\n" ); + ABC_FREE( p->pHTable ); p->nHTable = 0; } @@ -195,6 +207,8 @@ void Gia_ManHashResize( Gia_Man_t * p ) Counter2 = Gia_ManAndNum(p); assert( Counter == Counter2 ); ABC_FREE( pHTableOld ); + if ( p->fVerbose ) + printf( "Resizing GIA hash table: %d -> %d.\n", nHTableOld, p->nHTable ); } /**Function******************************************************************** diff --git a/src/aig/gia/giaMan.c b/src/aig/gia/giaMan.c index 0acd547d..b787f713 100644 --- a/src/aig/gia/giaMan.c +++ b/src/aig/gia/giaMan.c @@ -70,7 +70,6 @@ Gia_Man_t * Gia_ManStart( int nObjsMax ) ***********************************************************************/ void Gia_ManStop( Gia_Man_t * p ) { -// printf( "Hash table hits = %12u. Hash table misses = %12u.\n", (int)p->nHashHit, (int)p->nHashMiss ); Tim_ManStopP( (Tim_Man_t **)&p->pManTime ); assert( p->pManTime == NULL ); Vec_PtrFreeFree( p->vNamesIn ); diff --git a/src/base/abc/abcHieCec.c b/src/base/abc/abcHieCec.c index b338c394..ace7583b 100644 --- a/src/base/abc/abcHieCec.c +++ b/src/base/abc/abcHieCec.c @@ -686,14 +686,14 @@ Gia_Man_t * Abc_NtkHieCecTest( char * pFileName, int fVerbose ) assert( Abc_NtkIsNetlist(pNtk) ); assert( !Abc_NtkLatchNum(pNtk) ); - +/* if ( pNtk->pDesign != NULL ) { clk = clock(); Abc_NtkCountNodes( pNtk ); Abc_PrintTime( 1, "Count nodes", clock() - clk ); } - +*/ // print stats if ( fVerbose ) Abc_NtkPrintBoxInfo( pNtk ); diff --git a/src/base/abc/abcHieNew.c b/src/base/abc/abcHieNew.c index fe176ae4..be41c07a 100644 --- a/src/base/abc/abcHieNew.c +++ b/src/base/abc/abcHieNew.c @@ -568,11 +568,18 @@ extern int Abc_NtkCheckRecursive( Abc_Ntk_t * pNtk ); ***********************************************************************/ void Au_NtkDeriveFlatGia_rec( Gia_Man_t * pGia, Au_Ntk_t * p ) -{ +{ Au_Obj_t * pObj, * pTerm; int i, k; Au_NtkForEachPi( p, pTerm, i ) assert( Au_ObjCopy(pTerm) >= 0 ); + if ( strcmp(Au_NtkName(p), "ref_egcd") == 0 ) + { + printf( "Replacing one instance of recursive model \"%s\" by a black box.\n", "ref_egcd" ); + Au_NtkForEachPo( p, pTerm, i ) + Au_ObjSetCopy( pTerm, Gia_ManAppendCi(pGia) ); + return; + } Au_NtkForEachObj( p, pObj, i ) { if ( Au_ObjIsNode(pObj) ) @@ -635,6 +642,7 @@ Gia_Man_t * Au_NtkDeriveFlatGia( Au_Ntk_t * p ) pGia = Gia_ManStart( (1<<16) ); pGia->pName = Gia_UtilStrsav( Au_NtkName(p) ); Gia_ManHashAlloc( pGia ); + Gia_ManFlipVerbose( pGia ); // create PIs Au_NtkForEachPi( p, pTerm, i ) Au_ObjSetCopy( pTerm, Gia_ManAppendCi(pGia) ); @@ -725,7 +733,6 @@ Gia_Man_t * Au_ManDeriveTest( Abc_Ntk_t * pRoot ) clk2 += clock() - clk1; vModels = Abc_NtkCollectHie( pRoot ); -// Vec_PtrForEachEntry( Abc_Ntk_t *, pLib->vModules, pMod, i ) Vec_PtrForEachEntry( Abc_Ntk_t *, vModels, pMod, i ) { vOrder = Abc_NtkDfsBoxes( pMod ); @@ -742,7 +749,7 @@ Gia_Man_t * Au_ManDeriveTest( Abc_Ntk_t * pRoot ) Au_ManPrintStats( pMan ); - if ( !Abc_NtkCheckRecursive(pRoot) ) +// if ( !Abc_NtkCheckRecursive(pRoot) ) { clk1 = clock(); pGia = Au_NtkDeriveFlatGia( (Au_Ntk_t *)pRoot->pData ); @@ -750,9 +757,9 @@ Gia_Man_t * Au_ManDeriveTest( Abc_Ntk_t * pRoot ) // printf( "GIA objects max = %d.\n", pMan->nGiaObjMax ); } - clk1 = clock(); - Au_NtkSuppSizeTest( (Au_Ntk_t *)pRoot->pData ); - clk4 = clock() - clk1; +// clk1 = clock(); +// Au_NtkSuppSizeTest( (Au_Ntk_t *)pRoot->pData ); +// clk4 = clock() - clk1; clk1 = clock(); Au_ManDelete( pMan ); @@ -761,7 +768,7 @@ Gia_Man_t * Au_ManDeriveTest( Abc_Ntk_t * pRoot ) Abc_PrintTime( 1, "Time all ", clock() - clk ); Abc_PrintTime( 1, "Time new ", clk2 ); Abc_PrintTime( 1, "Time GIA ", clk3 ); - Abc_PrintTime( 1, "Time supp", clk4 ); +// Abc_PrintTime( 1, "Time supp", clk4 ); return pGia; } |