diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-09-27 15:20:33 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-09-27 15:20:33 -0700 |
commit | a695d708108facb4a52571d418905b95bbd9ec9b (patch) | |
tree | 3d4c35a34976ae7aa71e601ae5252ba6ad9b931d /src/aig | |
parent | 4a74b7ced954bbe963daa92c960f3ace99037546 (diff) | |
download | abc-a695d708108facb4a52571d418905b95bbd9ec9b.tar.gz abc-a695d708108facb4a52571d418905b95bbd9ec9b.tar.bz2 abc-a695d708108facb4a52571d418905b95bbd9ec9b.zip |
Performance improvements in GIA package.
Diffstat (limited to 'src/aig')
-rw-r--r-- | src/aig/gia/gia.h | 15 | ||||
-rw-r--r-- | src/aig/gia/giaHash.c | 11 | ||||
-rw-r--r-- | src/aig/gia/giaJf.c | 1 |
3 files changed, 17 insertions, 10 deletions
diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index eef8675f..d312f437 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -496,19 +496,20 @@ static inline Gia_Obj_t * Gia_ManAppendObj( Gia_Man_t * p ) { if ( p->nObjs == p->nObjsAlloc ) { - if ( 2 * p->nObjsAlloc > (1 << 29) ) + int nObjNew = Abc_MinInt( 2 * p->nObjsAlloc, (1 << 29) ); + if ( p->nObjs == (1 << 29) ) printf( "Hard limit on the number of nodes (2^29) is reached. Quitting...\n" ), exit(1); if ( p->fVerbose ) - printf("Extending GIA object storage: %d -> %d.\n", p->nObjsAlloc, 2 * p->nObjsAlloc ); + printf("Extending GIA object storage: %d -> %d.\n", p->nObjsAlloc, nObjNew ); 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 ); + p->pObjs = ABC_REALLOC( Gia_Obj_t, p->pObjs, nObjNew ); + memset( p->pObjs + p->nObjsAlloc, 0, sizeof(Gia_Obj_t) * (nObjNew - p->nObjsAlloc) ); if ( p->pMuxes ) { - p->pMuxes = ABC_REALLOC( unsigned, p->pMuxes, 2 * p->nObjsAlloc ); - memset( p->pMuxes + p->nObjsAlloc, 0, sizeof(unsigned) * p->nObjsAlloc ); + p->pMuxes = ABC_REALLOC( unsigned, p->pMuxes, nObjNew ); + memset( p->pMuxes + p->nObjsAlloc, 0, sizeof(unsigned) * (nObjNew - p->nObjsAlloc) ); } - p->nObjsAlloc *= 2; + p->nObjsAlloc = nObjNew; } return Gia_ManObj( p, p->nObjs++ ); } diff --git a/src/aig/gia/giaHash.c b/src/aig/gia/giaHash.c index b256b165..ae17c176 100644 --- a/src/aig/gia/giaHash.c +++ b/src/aig/gia/giaHash.c @@ -666,9 +666,14 @@ int Gia_ManHashXor( Gia_Man_t * p, int iLit0, int iLit1 ) ***********************************************************************/ int Gia_ManHashMux( Gia_Man_t * p, int iCtrl, int iData1, int iData0 ) { - int iTemp0 = Gia_ManHashAnd( p, Abc_LitNot(iCtrl), iData0 ); - int iTemp1 = Gia_ManHashAnd( p, iCtrl, iData1 ); - return Abc_LitNotCond( Gia_ManHashAnd( p, Abc_LitNot(iTemp0), Abc_LitNot(iTemp1) ), 1 ); + int iTemp0, iTemp1, fCompl = 0; + if ( iData0 > iData1 ) + iData0 ^= iData1, iData1 ^= iData0, iData0 ^= iData1, iCtrl = Abc_LitNot(iCtrl); + if ( Abc_LitIsCompl(iData1) ) + iData0 = Abc_LitNot(iData0), iData1 = Abc_LitNot(iData1), fCompl = 1; + iTemp0 = Gia_ManHashAnd( p, Abc_LitNot(iCtrl), iData0 ); + iTemp1 = Gia_ManHashAnd( p, iCtrl, iData1 ); + return Abc_LitNotCond( Gia_ManHashAnd( p, Abc_LitNot(iTemp0), Abc_LitNot(iTemp1) ), !fCompl ); } /**Function************************************************************* diff --git a/src/aig/gia/giaJf.c b/src/aig/gia/giaJf.c index 8ca16f29..f243dd8f 100644 --- a/src/aig/gia/giaJf.c +++ b/src/aig/gia/giaJf.c @@ -1500,6 +1500,7 @@ Gia_Man_t * Jf_ManDeriveGia( Jf_Man_t * p ) Vec_IntFree( vCover ); Gia_ManHashStop( pNew ); Gia_ManSetRegNum( pNew, Gia_ManRegNum(p->pGia) ); +// Dsm_ManReportStats(); return pNew; } |