diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2015-10-16 10:36:53 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2015-10-16 10:36:53 -0700 |
commit | 8268553369175ea767e05fc02ecc75f7065d7b87 (patch) | |
tree | 9532c691940aa763c5a15061faebcbc694a6283b /src/opt/sfm/sfmLib.c | |
parent | 40bb7089da02fcde4c83a283d14e6c9aedbc8a24 (diff) | |
download | abc-8268553369175ea767e05fc02ecc75f7065d7b87.tar.gz abc-8268553369175ea767e05fc02ecc75f7065d7b87.tar.bz2 abc-8268553369175ea767e05fc02ecc75f7065d7b87.zip |
Experiments with precomputation and matching.
Diffstat (limited to 'src/opt/sfm/sfmLib.c')
-rw-r--r-- | src/opt/sfm/sfmLib.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/opt/sfm/sfmLib.c b/src/opt/sfm/sfmLib.c index c68099ff..a8d0954e 100644 --- a/src/opt/sfm/sfmLib.c +++ b/src/opt/sfm/sfmLib.c @@ -138,28 +138,28 @@ void Sfm_LibPreprocess( Mio_Library_t * pLib, Vec_Int_t * vGateSizes, Vec_Wrd_t ***********************************************************************/ int Sfm_LibFindComplInputGate( Vec_Wrd_t * vFuncs, int iGate, int nFanins, int iFanin, int * piFaninNew ) { - word uTruthGate = Vec_WrdEntry(vFuncs, iGate); - word uTruth, uTruthNew = Abc_Tt6Flip( uTruthGate, iFanin ); - int i; + word uTruthGate = Vec_WrdEntry( vFuncs, iGate ); + word uTruthFlip = Abc_Tt6Flip( uTruthGate, iFanin ); + word uTruth, uTruthSwap; int i; assert( iFanin >= 0 && iFanin < nFanins ); if ( piFaninNew ) *piFaninNew = iFanin; Vec_WrdForEachEntry( vFuncs, uTruth, i ) - if ( uTruth == uTruthNew ) + if ( uTruth == uTruthFlip ) return i; - if ( iFanin-1 >= 0 && Abc_Tt6SwapAdjacent(uTruthGate, iFanin-1) == uTruthGate ) // symmetric with prev + if ( iFanin-1 >= 0 ) { if ( piFaninNew ) *piFaninNew = iFanin-1; - uTruthNew = Abc_Tt6Flip( uTruthGate, iFanin-1 ); + uTruthSwap = Abc_Tt6SwapAdjacent( uTruthFlip, iFanin-1 ); Vec_WrdForEachEntry( vFuncs, uTruth, i ) - if ( uTruth == uTruthNew ) + if ( uTruth == uTruthSwap ) return i; } - if ( iFanin+1 < nFanins && Abc_Tt6SwapAdjacent(uTruthGate, iFanin) == uTruthGate ) // symmetric with next + if ( iFanin+1 < nFanins ) { if ( piFaninNew ) *piFaninNew = iFanin+1; - uTruthNew = Abc_Tt6Flip( uTruthGate, iFanin+1 ); + uTruthSwap = Abc_Tt6SwapAdjacent( uTruthFlip, iFanin ); Vec_WrdForEachEntry( vFuncs, uTruth, i ) - if ( uTruth == uTruthNew ) + if ( uTruth == uTruthSwap ) return i; } if ( piFaninNew ) *piFaninNew = -1; |