diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2016-11-28 15:50:15 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2016-11-28 15:50:15 -0800 |
commit | 5d61e53c7a09d544e4cdbb74e31fc919680f0e4e (patch) | |
tree | 0969f45954dde311221d46d6b8f52ba098ad3c37 /src/opt/dau/dauGia.c | |
parent | 53adc97675511f41fd9c40c31dcb9b3506f75daf (diff) | |
download | abc-5d61e53c7a09d544e4cdbb74e31fc919680f0e4e.tar.gz abc-5d61e53c7a09d544e4cdbb74e31fc919680f0e4e.tar.bz2 abc-5d61e53c7a09d544e4cdbb74e31fc919680f0e4e.zip |
New SAT-based optimization package.
Diffstat (limited to 'src/opt/dau/dauGia.c')
-rw-r--r-- | src/opt/dau/dauGia.c | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/src/opt/dau/dauGia.c b/src/opt/dau/dauGia.c index b75ded61..c7f5c11f 100644 --- a/src/opt/dau/dauGia.c +++ b/src/opt/dau/dauGia.c @@ -238,12 +238,24 @@ int Dau_DsdBalance( Gia_Man_t * pGia, int * pFans, int nFans, int fAnd ) assert( nFans > 1 ); iFan0 = pFans[--nFans]; iFan1 = pFans[--nFans]; - if ( fAnd ) - iFan = Gia_ManHashAnd( pGia, iFan0, iFan1 ); - else if ( pGia->pMuxes ) - iFan = Gia_ManHashXorReal( pGia, iFan0, iFan1 ); - else - iFan = Gia_ManHashXor( pGia, iFan0, iFan1 ); + if ( pGia->pHTable == NULL ) + { + if ( fAnd ) + iFan = Gia_ManAppendAnd( pGia, iFan0, iFan1 ); + else if ( pGia->pMuxes ) + iFan = Gia_ManAppendXorReal( pGia, iFan0, iFan1 ); + else + iFan = Gia_ManAppendXor( pGia, iFan0, iFan1 ); + } + else + { + if ( fAnd ) + iFan = Gia_ManHashAnd( pGia, iFan0, iFan1 ); + else if ( pGia->pMuxes ) + iFan = Gia_ManHashXorReal( pGia, iFan0, iFan1 ); + else + iFan = Gia_ManHashXor( pGia, iFan0, iFan1 ); + } pObj = Gia_ManObj(pGia, Abc_Lit2Var(iFan)); if ( Gia_ObjIsAnd(pObj) ) { @@ -340,10 +352,20 @@ int Dau_DsdToGia_rec( Gia_Man_t * pGia, char * pStr, char ** p, int * pMatches, assert( **p == '{' && *q == '}' ); *p = q; } - if ( pGia->pMuxes ) - Res = Gia_ManHashMuxReal( pGia, Temp[0], Temp[1], Temp[2] ); + if ( pGia->pHTable == NULL ) + { + if ( pGia->pMuxes ) + Res = Gia_ManAppendMux( pGia, Temp[0], Temp[1], Temp[2] ); + else + Res = Gia_ManAppendMux( pGia, Temp[0], Temp[1], Temp[2] ); + } else - Res = Gia_ManHashMux( pGia, Temp[0], Temp[1], Temp[2] ); + { + if ( pGia->pMuxes ) + Res = Gia_ManHashMuxReal( pGia, Temp[0], Temp[1], Temp[2] ); + else + Res = Gia_ManHashMux( pGia, Temp[0], Temp[1], Temp[2] ); + } pObj = Gia_ManObj(pGia, Abc_Lit2Var(Res)); if ( Gia_ObjIsAnd(pObj) ) { @@ -377,7 +399,7 @@ int Dau_DsdToGia_rec( Gia_Man_t * pGia, char * pStr, char ** p, int * pMatches, vLeaves.nSize = nVars; vLeaves.pArray = Fanins; nObjOld = Gia_ManObjNum(pGia); - Res = Kit_TruthToGia( pGia, (unsigned *)pFunc, nVars, vCover, &vLeaves, 1 ); + Res = Kit_TruthToGia( pGia, (unsigned *)pFunc, nVars, vCover, &vLeaves, pGia->pHTable != NULL ); // assert( nVars <= 6 ); // Res = Dau_DsdToGiaCompose_rec( pGia, pFunc[0], Fanins, nVars ); for ( i = nObjOld; i < Gia_ManObjNum(pGia); i++ ) |