summaryrefslogtreecommitdiffstats
path: root/src/misc/util/utilTruth.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-09-12 17:53:41 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-09-12 17:53:41 -0700
commit14606c473e728faa7617f7207ac7620fba050f76 (patch)
tree6ffd0c271169732102e690199a68b5ff2d768218 /src/misc/util/utilTruth.h
parent0a346a36a290d558e177de62a5bb1ec649d0f74d (diff)
downloadabc-14606c473e728faa7617f7207ac7620fba050f76.tar.gz
abc-14606c473e728faa7617f7207ac7620fba050f76.tar.bz2
abc-14606c473e728faa7617f7207ac7620fba050f76.zip
Improvements to the new technology mapper.
Diffstat (limited to 'src/misc/util/utilTruth.h')
-rw-r--r--src/misc/util/utilTruth.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/misc/util/utilTruth.h b/src/misc/util/utilTruth.h
index 245a78fc..07f36382 100644
--- a/src/misc/util/utilTruth.h
+++ b/src/misc/util/utilTruth.h
@@ -1111,6 +1111,52 @@ static inline int Abc_TtMinimumBase( word * t, int * pSupp, int nVarsAll, int *
/**Function*************************************************************
+ Synopsis [Cut minimization.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline int Abc_TtMinBase( word * pTruth, int * pVars, int nVars )
+{
+ int i, k;
+ for ( i = k = 0; i < nVars; i++ )
+ {
+ if ( !Abc_TtHasVar( pTruth, nVars, i ) )
+ continue;
+ if ( k < i )
+ {
+ pVars[k] = pVars[i];
+ Abc_TtSwapVars( pTruth, nVars, k, i );
+ }
+ k++;
+ }
+ if ( k == nVars )
+ return k;
+ assert( k < nVars );
+// assert( k == Abc_TtSupportSize(pTruth, nVars) );
+ return k;
+}
+static inline void Abc_TtStretch( word * pTruth0, int nVars, int * pCut0, int nCutSize0, int * pCut, int nCutSize )
+{
+ int i, k;
+ for ( i = nCutSize - 1, k = nCutSize0 - 1; i >= 0 && k >= 0; i-- )
+ {
+ if ( pCut[i] > pCut0[k] )
+ continue;
+ assert( pCut[i] == pCut0[k] );
+ if ( k < i )
+ Abc_TtSwapVars( pTruth0, nVars, k, i );
+ k--;
+ }
+ assert( k == -1 );
+}
+
+/**Function*************************************************************
+
Synopsis [Implemeting given NPN config.]
Description []