diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-09-23 16:04:35 -0400 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-09-23 16:04:35 -0400 |
commit | 93e5631cff8e0384fc8ddf090be90de3485bc877 (patch) | |
tree | 1ac9a206a9beccea023c04bdd218975775413c6e | |
parent | 3f6c08dfc62e4dee007b97c84560432f475b594a (diff) | |
download | abc-93e5631cff8e0384fc8ddf090be90de3485bc877.tar.gz abc-93e5631cff8e0384fc8ddf090be90de3485bc877.tar.bz2 abc-93e5631cff8e0384fc8ddf090be90de3485bc877.zip |
Debugging the bit-blaster.
-rw-r--r-- | src/base/wlc/wlcBlast.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/base/wlc/wlcBlast.c b/src/base/wlc/wlcBlast.c index b4460d62..3b4f5a17 100644 --- a/src/base/wlc/wlcBlast.c +++ b/src/base/wlc/wlcBlast.c @@ -70,6 +70,16 @@ int * Wlc_VecLoadFanins( Vec_Int_t * vOut, int * pFanins, int nFanins, int nTota Vec_IntPush( vOut, i < nFanins ? pFanins[i] : Fill ); return Vec_IntArray( vOut ); } +int Wlc_BlastGetConst( int * pNum, int nNum ) +{ + int i, Res = 0; + for ( i = 0; i < nNum; i++ ) + if ( pNum[i] == 1 ) + Res |= (1 << i); + else if ( pNum[i] != 0 ) + return -1; + return Res; +} /**Function************************************************************* @@ -137,7 +147,11 @@ void Wlc_BlastRotateLeft( Gia_Man_t * pNew, int * pNum, int nNum, int * pShift, assert( nShift <= 32 ); for( i = 0; i < nShift; i++, pRes = Wlc_VecCopy(vRes, pTemp, nNum) ) for( j = 0; j < nNum; j++ ) - pTemp[j] = Gia_ManHashMux( pNew, pShift[i], pRes[((unsigned)(nNum-(1<<i)+j))%nNum], pRes[j] ); + { + int move = (j >= (1<<i)) ? (j-(1<<i))%nNum : (nNum - (((1<<i)-j)%nNum)) % nNum; + pTemp[j] = Gia_ManHashMux( pNew, pShift[i], pRes[move], pRes[j] ); +// pTemp[j] = Gia_ManHashMux( pNew, pShift[i], pRes[((unsigned)(nNum-(1<<i)+j))%nNum], pRes[j] ); + } ABC_FREE( pTemp ); } int Wlc_BlastReduction( Gia_Man_t * pNew, int * pFans, int nFans, int Type ) |