summaryrefslogtreecommitdiffstats
path: root/src/map/if/ifCount.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-04-19 16:55:44 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-04-19 16:55:44 -0700
commitd0c4c0cd7b955c49a1d300977555ee14289726e4 (patch)
treef084311e1b25f25beec3cf790becea6b0c5eb6d1 /src/map/if/ifCount.h
parent17f989ccbaaa9f51d17349c55f0745396d3e7007 (diff)
downloadabc-d0c4c0cd7b955c49a1d300977555ee14289726e4.tar.gz
abc-d0c4c0cd7b955c49a1d300977555ee14289726e4.tar.bz2
abc-d0c4c0cd7b955c49a1d300977555ee14289726e4.zip
Improvements to DSD balancing.
Diffstat (limited to 'src/map/if/ifCount.h')
-rw-r--r--src/map/if/ifCount.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/map/if/ifCount.h b/src/map/if/ifCount.h
index 478f1e9a..dcd3b63a 100644
--- a/src/map/if/ifCount.h
+++ b/src/map/if/ifCount.h
@@ -57,6 +57,7 @@ ABC_NAMESPACE_HEADER_START
static inline int If_LogCreateAnd( Vec_Int_t * vAig, int iLit0, int iLit1, int nSuppAll )
{
int iObjId = Vec_IntSize(vAig)/2 + nSuppAll;
+ assert( Abc_Lit2Var(iLit0) != Abc_Lit2Var(iLit1) );
Vec_IntPush( vAig, iLit0 );
Vec_IntPush( vAig, iLit1 );
return Abc_Var2Lit( iObjId, 0 );
@@ -285,6 +286,36 @@ static inline word If_AigVerifyArray( Vec_Int_t * vAig, int nLeaves )
}
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline void If_AigPrintArray( Vec_Int_t * vAig, int nLeaves )
+{
+ assert( Vec_IntSize(vAig) > 0 );
+ assert( Vec_IntEntryLast(vAig) < 2 );
+ if ( Vec_IntSize(vAig) == 1 ) // const
+ printf( "Const %d\n", Vec_IntEntry(vAig, 0) );
+ else if ( Vec_IntSize(vAig) == 2 ) // variable
+ printf( "Variable %s\n", Vec_IntEntry(vAig, 1) ? "Compl" : "" );
+ else
+ {
+ int i, iLit0, iLit1;
+ assert( Vec_IntSize(vAig) & 1 );
+ Vec_IntForEachEntryDouble( vAig, iLit0, iLit1, i )
+ printf( "%d %d\n", iLit0, iLit1 );
+ assert( i == Vec_IntSize(vAig) - 1 );
+ printf( "%s\n", Vec_IntEntry(vAig, i) ? "Compl" : "" );
+ }
+}
+
/**Function*************************************************************