diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-09-12 22:37:26 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-09-12 22:37:26 -0700 |
commit | 75fee10708c40b206592d040d4392e715bdbc1e3 (patch) | |
tree | 9a4e295452a1623b52ba6d0a6461d4836132b678 /src/misc | |
parent | 14606c473e728faa7617f7207ac7620fba050f76 (diff) | |
download | abc-75fee10708c40b206592d040d4392e715bdbc1e3.tar.gz abc-75fee10708c40b206592d040d4392e715bdbc1e3.tar.bz2 abc-75fee10708c40b206592d040d4392e715bdbc1e3.zip |
Improvements to the new technology mapper.
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/extra/extra.h | 1 | ||||
-rw-r--r-- | src/misc/extra/extraUtilDsd.c | 48 |
2 files changed, 49 insertions, 0 deletions
diff --git a/src/misc/extra/extra.h b/src/misc/extra/extra.h index f4dcd154..982a6f5e 100644 --- a/src/misc/extra/extra.h +++ b/src/misc/extra/extra.h @@ -226,6 +226,7 @@ extern int Sdm_ManReadDsdAndNum( Sdm_Man_t * p, int iDsd ); extern int Sdm_ManReadDsdClauseNum( Sdm_Man_t * p, int iDsd ); extern word Sdm_ManReadDsdTruth( Sdm_Man_t * p, int iDsd ); extern char * Sdm_ManReadDsdStr( Sdm_Man_t * p, int iDsd ); +extern void Sdm_ManReadCnfCosts( Sdm_Man_t * p, int * pCosts, int nCosts ); /*=== extraUtilProgress.c ================================================================*/ diff --git a/src/misc/extra/extraUtilDsd.c b/src/misc/extra/extraUtilDsd.c index 1af58940..a349ff9f 100644 --- a/src/misc/extra/extraUtilDsd.c +++ b/src/misc/extra/extraUtilDsd.c @@ -1014,6 +1014,14 @@ char * Sdm_ManReadDsdStr( Sdm_Man_t * p, int iDsd ) { return p->pDsd6[iDsd].pStr; } +void Sdm_ManReadCnfCosts( Sdm_Man_t * p, int * pCosts, int nCosts ) +{ + int i; + assert( nCosts == DSD_CLASS_NUM ); + pCosts[0] = pCosts[1] = 0; + for ( i = 2; i < DSD_CLASS_NUM; i++ ) + pCosts[i] = Sdm_ManReadDsdClauseNum( p, i ); +} /**Function************************************************************* @@ -1104,6 +1112,46 @@ void Sdm_ManTest() Sdm_ManFree( p ); } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +/* +void Sdm_ManCompareCnfSizes() +{ + Vec_Int_t * vMemory; + word uTruth; + int i, nSop0, nSop1, nVars, nCla, RetValue; + vMemory = Vec_IntAlloc( 1 << 16 ); + for ( i = 1; i < DSD_CLASS_NUM; i++ ) + { + uTruth = Sdm_ManReadDsdTruth( s_SdmMan, i ); + nVars = Sdm_ManReadDsdVarNum( s_SdmMan, i ); + nCla = Sdm_ManReadDsdClauseNum( s_SdmMan, i ); + + RetValue = Kit_TruthIsop( &uTruth, nVars, vMemory, 0 ); + nSop0 = Vec_IntSize(vMemory); + + uTruth = ~uTruth; + RetValue = Kit_TruthIsop( &uTruth, nVars, vMemory, 0 ); + nSop1 = Vec_IntSize(vMemory); + + if ( nSop0 + nSop1 != nCla ) + printf( "Class %4d : %d + %d != %d\n", i, nSop0, nSop1, nCla ); + else + printf( "Class %4d : %d + %d == %d\n", i, nSop0, nSop1, nCla ); + } + Vec_IntFree( vMemory ); +} +*/ + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// |