diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-04-05 22:51:01 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-04-05 22:51:01 -0700 |
commit | 9c502b70f392e2a797f5105c916d558f6108748b (patch) | |
tree | a42e5d0b038fe5121999c54d11b00c06fddff975 /src/bool | |
parent | 5608d947eda6635ac6d82f4f144adbfc5170f302 (diff) | |
download | abc-9c502b70f392e2a797f5105c916d558f6108748b.tar.gz abc-9c502b70f392e2a797f5105c916d558f6108748b.tar.bz2 abc-9c502b70f392e2a797f5105c916d558f6108748b.zip |
Preparing new implementation of SOP/DSD balancing in 'if' mapper.
Diffstat (limited to 'src/bool')
-rw-r--r-- | src/bool/kit/kit.h | 1 | ||||
-rw-r--r-- | src/bool/kit/kitIsop.c | 25 |
2 files changed, 26 insertions, 0 deletions
diff --git a/src/bool/kit/kit.h b/src/bool/kit/kit.h index cb1c1eb0..614f2fd5 100644 --- a/src/bool/kit/kit.h +++ b/src/bool/kit/kit.h @@ -568,6 +568,7 @@ extern int Kit_GraphLeafDepth_rec( Kit_Graph_t * pGraph, Kit_Node_t //extern Hop_Obj_t * Kit_CoverToHop( Hop_Man_t * pMan, Vec_Int_t * vCover, int nVars, Vec_Int_t * vMemory ); /*=== kitIsop.c ==========================================================*/ extern int Kit_TruthIsop( unsigned * puTruth, int nVars, Vec_Int_t * vMemory, int fTryBoth ); +extern void Kit_TruthIsopPrint( unsigned * puTruth, int nVars, Vec_Int_t * vMemory, int fTryBoth ); /*=== kitPla.c ==========================================================*/ extern int Kit_PlaIsConst0( char * pSop ); extern int Kit_PlaIsConst1( char * pSop ); diff --git a/src/bool/kit/kitIsop.c b/src/bool/kit/kitIsop.c index fc017c0e..68d526ed 100644 --- a/src/bool/kit/kitIsop.c +++ b/src/bool/kit/kitIsop.c @@ -101,6 +101,31 @@ int Kit_TruthIsop( unsigned * puTruth, int nVars, Vec_Int_t * vMemory, int fTryB Vec_IntShrink( vMemory, pcRes->nCubes ); return RetValue; } +void Kit_TruthIsopPrint( unsigned * puTruth, int nVars, Vec_Int_t * vCover, int fTryBoth ) +{ + int i, k, Entry, Literal; + int RetValue = Kit_TruthIsop( puTruth, nVars, vCover, fTryBoth ); + if ( Vec_IntSize(vCover) == 0 || (Vec_IntSize(vCover) == 1 && Vec_IntEntry(vCover, 0) == 0) ) + { + printf( "Constant %d\n", Vec_IntSize(vCover) ); + return; + } + Vec_IntForEachEntry( vCover, Entry, i ) + { + for ( k = 0; k < nVars; k++ ) + { + Literal = 3 & (Entry >> (k << 1)); + if ( Literal == 1 ) // neg literal + printf( "0" ); + else if ( Literal == 2 ) // pos literal + printf( "1" ); + else if ( Literal == 0 ) + printf( "-" ); + else assert( 0 ); + } + printf( " %d\n", !RetValue ); + } +} /**Function************************************************************* |