diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2020-01-27 10:32:07 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2020-01-27 10:32:07 -0800 |
commit | 8c8f39ad7603362c7e16598d1888313f2e6ca0a0 (patch) | |
tree | 7789cf8146b5a6a7e00695d4c4b70e455355bc16 /src/misc/util/utilTruth.h | |
parent | 8eb6aed5d116afc0933b49c6973af08cf2eff471 (diff) | |
download | abc-8c8f39ad7603362c7e16598d1888313f2e6ca0a0.tar.gz abc-8c8f39ad7603362c7e16598d1888313f2e6ca0a0.tar.bz2 abc-8c8f39ad7603362c7e16598d1888313f2e6ca0a0.zip |
Adding several new utilities.
Diffstat (limited to 'src/misc/util/utilTruth.h')
-rw-r--r-- | src/misc/util/utilTruth.h | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h index 6fa5e0a3..10196959 100644 --- a/src/misc/util/utilTruth.h +++ b/src/misc/util/utilTruth.h @@ -443,6 +443,108 @@ static inline void Abc_TtIthVar( word * pOut, int iVar, int nVars ) /**Function************************************************************* + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static inline int Abc_TtIsAndCompl( word * pOut, int fCompl, word * pIn1, int fCompl1, word * pIn2, int fCompl2, word * pCare, int nWords ) +{ + int w; + if ( fCompl ) + { + if ( fCompl1 ) + { + if ( fCompl2 ) + { + for ( w = 0; w < nWords; w++ ) + if ( (~pOut[w] & pCare[w]) != (~pIn1[w] & ~pIn2[w] & pCare[w]) ) + return 0; + } + else + { + for ( w = 0; w < nWords; w++ ) + if ( (~pOut[w] & pCare[w]) != (~pIn1[w] & pIn2[w] & pCare[w]) ) + return 0; + } + } + else + { + if ( fCompl2 ) + { + for ( w = 0; w < nWords; w++ ) + if ( (~pOut[w] & pCare[w]) != (pIn1[w] & ~pIn2[w] & pCare[w]) ) + return 0; + } + else + { + for ( w = 0; w < nWords; w++ ) + if ( (~pOut[w] & pCare[w]) != (pIn1[w] & pIn2[w] & pCare[w]) ) + return 0; + } + } + } + else + { + if ( fCompl1 ) + { + if ( fCompl2 ) + { + for ( w = 0; w < nWords; w++ ) + if ( (pOut[w] & pCare[w]) != (~pIn1[w] & ~pIn2[w] & pCare[w]) ) + return 0; + } + else + { + for ( w = 0; w < nWords; w++ ) + if ( (pOut[w] & pCare[w]) != (~pIn1[w] & pIn2[w] & pCare[w]) ) + return 0; + } + } + else + { + if ( fCompl2 ) + { + for ( w = 0; w < nWords; w++ ) + if ( (pOut[w] & pCare[w]) != (pIn1[w] & ~pIn2[w] & pCare[w]) ) + return 0; + } + else + { + for ( w = 0; w < nWords; w++ ) + if ( (pOut[w] & pCare[w]) != (pIn1[w] & pIn2[w] & pCare[w]) ) + return 0; + } + } + } + return 1; +} + +static inline int Abc_TtIsXorCompl( word * pOut, int fCompl, word * pIn1, word * pIn2, word * pCare, int nWords ) +{ + int w; + if ( fCompl ) + { + for ( w = 0; w < nWords; w++ ) + if ( (~pOut[w] & pCare[w]) != ((pIn1[w] ^ pIn2[w]) & pCare[w]) ) + return 0; + } + else + { + for ( w = 0; w < nWords; w++ ) + if ( ( pOut[w] & pCare[w]) != ((pIn1[w] ^ pIn2[w]) & pCare[w]) ) + return 0; + } + return 1; +} + + +/**Function************************************************************* + Synopsis [Compares Cof0 and Cof1.] Description [] |