summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-06-30 00:34:51 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-06-30 00:34:51 -0700
commitce92ee2b4d87436073bbfe4609eb6d1bfbe606da (patch)
tree0a02f1bf8c60fcba5f22fcf6b10da470c8291864 /src
parent55404ca1af7edd84efe4ff37b70c49c82f352e7a (diff)
downloadabc-ce92ee2b4d87436073bbfe4609eb6d1bfbe606da.tar.gz
abc-ce92ee2b4d87436073bbfe4609eb6d1bfbe606da.tar.bz2
abc-ce92ee2b4d87436073bbfe4609eb6d1bfbe606da.zip
Changes and improvements to different packages.
Diffstat (limited to 'src')
-rw-r--r--src/misc/util/utilTruth.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h
index 124af310..7eec26c9 100644
--- a/src/misc/util/utilTruth.h
+++ b/src/misc/util/utilTruth.h
@@ -993,6 +993,31 @@ static inline void Abc_TtFlip( word * pTruth, int nWords, int iVar )
SeeAlso []
***********************************************************************/
+static inline word Abc_Tt6Permute_rec( word t, int * pPerm, int nVars )
+{
+ word uRes0, uRes1; int Var;
+ if ( t == 0 ) return 0;
+ if ( ~t == 0 ) return ~(word)0;
+ for ( Var = nVars-1; Var >= 0; Var-- )
+ if ( Abc_Tt6HasVar( t, Var ) )
+ break;
+ assert( Var >= 0 );
+ uRes0 = Abc_Tt6Permute_rec( Abc_Tt6Cofactor0(t, Var), pPerm, Var );
+ uRes1 = Abc_Tt6Permute_rec( Abc_Tt6Cofactor1(t, Var), pPerm, Var );
+ return (uRes0 & s_Truths6Neg[pPerm[Var]]) | (uRes1 & s_Truths6[pPerm[Var]]);
+}
+
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
static inline word Abc_Tt6SwapAdjacent( word Truth, int iVar )
{
return (Truth & s_PMasks[iVar][0]) | ((Truth & s_PMasks[iVar][1]) << (1 << iVar)) | ((Truth & s_PMasks[iVar][2]) >> (1 << iVar));