diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2018-09-21 18:20:46 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2018-09-21 18:20:46 -0700 |
commit | 53ba28772ebd7d4540f0d259422275493044b834 (patch) | |
tree | 94f3420937903336fd82c8fb5a9c3255d8e15ec7 /src | |
parent | a9815b75abb553017e3a4671e727dd0b97498fb2 (diff) | |
download | abc-53ba28772ebd7d4540f0d259422275493044b834.tar.gz abc-53ba28772ebd7d4540f0d259422275493044b834.tar.bz2 abc-53ba28772ebd7d4540f0d259422275493044b834.zip |
New APIs of the truth table package.
Diffstat (limited to 'src')
-rw-r--r-- | src/base/abci/abc.c | 5 | ||||
-rw-r--r-- | src/misc/util/utilTruth.h | 28 |
2 files changed, 31 insertions, 2 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index d2d8bf4a..1484d5cc 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -13214,8 +13214,8 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv ) } */ { - extern void Abc_EnumerateFuncs( int nDecMax, int nDivMax, int fVerbose ); - Abc_EnumerateFuncs( 4, 7, 0 ); +// extern void Abc_EnumerateFuncs( int nDecMax, int nDivMax, int fVerbose ); +// Abc_EnumerateFuncs( 4, 7, 0 ); } /* if ( fNewAlgo ) @@ -13267,6 +13267,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv ) } // Abc_NtkComputePaths( Abc_FrameReadNtk(pAbc) ); //Dau_NetworkEnumTest(); + //Ext_TruthDiagnoseTest(); return 0; usage: Abc_Print( -2, "usage: test [-CKDNM] [-aovwh] <file_name>\n" ); diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h index bc6ad0d5..3d3f80b8 100644 --- a/src/misc/util/utilTruth.h +++ b/src/misc/util/utilTruth.h @@ -1154,6 +1154,10 @@ static inline int Abc_Tt6HasVar( word t, int iVar ) { return ((t >> (1<<iVar)) & s_Truths6Neg[iVar]) != (t & s_Truths6Neg[iVar]); } +static inline int Abc_Tt6XorVar( word t, int iVar ) +{ + return ((t >> (1<<iVar)) & s_Truths6Neg[iVar]) == ~(t & s_Truths6Neg[iVar]); +} static inline int Abc_TtHasVar( word * t, int nVars, int iVar ) { assert( iVar < nVars ); @@ -3106,6 +3110,20 @@ static inline int Abc_Tt4Check( int t ) SeeAlso [] ***********************************************************************/ +static inline int Abc_Tt6VarsAreSymmetric( word t, int iVar, int jVar ) +{ + word * s_PMasks = s_PPMasks[iVar][jVar]; + int shift = (1 << jVar) - (1 << iVar); + assert( iVar < jVar ); + return ((t & s_PMasks[1]) << shift) == (t & s_PMasks[2]); +} +static inline int Abc_Tt6VarsAreAntiSymmetric( word t, int iVar, int jVar ) +{ + word * s_PMasks = s_PPMasks[iVar][jVar]; + int shift = (1 << jVar) + (1 << iVar); + assert( iVar < jVar ); + return ((t & (s_PMasks[1] >> (1 << iVar))) << shift) == (t & (s_PMasks[2] << (1 << iVar))); +} static inline int Abc_TtVarsAreSymmetric( word * pTruth, int nVars, int i, int j, word * pCof0, word * pCof1 ) { int nWords = Abc_TtWordNum( nVars ); @@ -3116,6 +3134,16 @@ static inline int Abc_TtVarsAreSymmetric( word * pTruth, int nVars, int i, int j Abc_TtCofactor0( pCof1, nWords, j ); return Abc_TtEqual( pCof0, pCof1, nWords ); } +static inline int Abc_TtVarsAreAntiSymmetric( word * pTruth, int nVars, int i, int j, word * pCof0, word * pCof1 ) +{ + int nWords = Abc_TtWordNum( nVars ); + assert( i < nVars && j < nVars ); + Abc_TtCofactor0p( pCof0, pTruth, nWords, i ); + Abc_TtCofactor1p( pCof1, pTruth, nWords, i ); + Abc_TtCofactor0( pCof0, nWords, j ); + Abc_TtCofactor1( pCof1, nWords, j ); + return Abc_TtEqual( pCof0, pCof1, nWords ); +} static inline int Abc_TtIsFullySymmetric( word * pTruth, int nVars ) { int m, v, Polar = 0, Seen = 0; |