From 53ba28772ebd7d4540f0d259422275493044b834 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Fri, 21 Sep 2018 18:20:46 -0700 Subject: [PATCH] New APIs of the truth table package. --- src/base/abci/abc.c | 5 +++-- 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 d2d8bf4af..1484d5cc5 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] \n" ); diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h index bc6ad0d5d..3d3f80b8c 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<> (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;