From d0c4c0cd7b955c49a1d300977555ee14289726e4 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 19 Apr 2014 16:55:44 -0700 Subject: Improvements to DSD balancing. --- src/map/if/ifCount.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'src/map/if/ifCount.h') 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************************************************************* -- cgit v1.2.3