diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2016-03-24 17:45:51 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2016-03-24 17:45:51 -0700 |
commit | 72ffddb0add61ede9866e41382f2b6e126069e8d (patch) | |
tree | 5edf55c47fea6422771d1ae35c829a1c60333e27 /src | |
parent | ecb2780a72c05a97183fdeb9fec092e9accdb399 (diff) | |
download | abc-72ffddb0add61ede9866e41382f2b6e126069e8d.tar.gz abc-72ffddb0add61ede9866e41382f2b6e126069e8d.tar.bz2 abc-72ffddb0add61ede9866e41382f2b6e126069e8d.zip |
Sorting multiplier inputs based on the number of constant bits.
Diffstat (limited to 'src')
-rw-r--r-- | src/base/wlc/wlcBlast.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/base/wlc/wlcBlast.c b/src/base/wlc/wlcBlast.c index a3181bd4..7cd0f369 100644 --- a/src/base/wlc/wlcBlast.c +++ b/src/base/wlc/wlcBlast.c @@ -34,6 +34,25 @@ ABC_NAMESPACE_IMPL_START /**Function************************************************************* + Synopsis [Counts constant bits.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Wlc_NtkCountConstBits( int * pArray, int nSize ) +{ + int i, Counter = 0; + for ( i = 0; i < nSize; i++ ) + Counter += (pArray[i] == 0 || pArray[i] == 1); + return Counter; +} + +/**Function************************************************************* + Synopsis [Helper functions.] Description [] @@ -1067,6 +1086,8 @@ Gia_Man_t * Wlc_NtkBitBlast( Wlc_Ntk_t * p, Vec_Int_t * vBoxIds ) int nRangeMax = Abc_MaxInt(nRange0, nRange1); int * pArg0 = Wlc_VecLoadFanins( vTemp0, pFans0, nRange0, nRangeMax, fSigned ); int * pArg1 = Wlc_VecLoadFanins( vTemp1, pFans1, nRange1, nRangeMax, fSigned ); + if ( Wlc_NtkCountConstBits(pArg0, nRangeMax) < Wlc_NtkCountConstBits(pArg1, nRangeMax) ) + ABC_SWAP( int *, pArg0, pArg1 ); Wlc_BlastMultiplier( pNew, pArg0, pArg1, nRangeMax, nRangeMax, vTemp2, vRes, fSigned ); //Wlc_BlastMultiplier3( pNew, pArg0, pArg1, nRange0, nRange1, vRes ); if ( nRange > nRangeMax + nRangeMax ) |