diff options
-rw-r--r-- | src/base/abci/abc.c | 1 | ||||
-rw-r--r-- | src/map/if/ifDsd.c | 66 | ||||
-rw-r--r-- | src/opt/dau/dau.h | 2 | ||||
-rw-r--r-- | src/opt/dau/dauNonDsd.c | 2 |
4 files changed, 69 insertions, 2 deletions
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index a0772184..7ebab2d1 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -15470,6 +15470,7 @@ int Abc_CommandDsdLoad( Abc_Frame_t * pAbc, int argc, char ** argv ) return 1; } fclose( pFile ); + Abc_FrameSetManDsd( NULL ); pDsdMan = If_DsdManLoad(FileName); if ( pDsdMan == NULL ) return 1; diff --git a/src/map/if/ifDsd.c b/src/map/if/ifDsd.c index 7f507ee9..7668ee54 100644 --- a/src/map/if/ifDsd.c +++ b/src/map/if/ifDsd.c @@ -374,6 +374,71 @@ void If_DsdManPrintOne( FILE * pFile, If_DsdMan_t * p, int iObjId, unsigned char fprintf( pFile, "\n" ); assert( nSupp == If_DsdVecObjSuppSize(p->vObjs, iObjId) ); } +#define DSD_ARRAY_LIMIT 16 +void If_DsdManPrintDecs( FILE * pFile, If_DsdMan_t * p ) +{ + Vec_Int_t * vDecs; + int i, k, nSuppSize, nDecMax = 0; + int pDecMax[IF_MAX_FUNC_LUTSIZE] = {0}; + int pCountsAll[IF_MAX_FUNC_LUTSIZE] = {0}; + int pCountsSSizes[IF_MAX_FUNC_LUTSIZE] = {0}; + int pCounts[IF_MAX_FUNC_LUTSIZE][DSD_ARRAY_LIMIT+2] = {{0}}; + word * pTruth; + assert( Vec_MemEntryNum(p->vTtMem) == Vec_PtrSize(p->vTtDecs) ); + // find max number of decompositions + Vec_PtrForEachEntry( Vec_Int_t *, p->vTtDecs, vDecs, i ) + { + pTruth = Vec_MemReadEntry( p->vTtMem, i ); + nSuppSize = Abc_TtSupportSize( pTruth, p->nVars ); + pDecMax[nSuppSize] = Abc_MaxInt( pDecMax[nSuppSize], Vec_IntSize(vDecs) ); + nDecMax = Abc_MaxInt( nDecMax, Vec_IntSize(vDecs) ); + } + // fill up + Vec_PtrForEachEntry( Vec_Int_t *, p->vTtDecs, vDecs, i ) + { + pTruth = Vec_MemReadEntry( p->vTtMem, i ); + nSuppSize = Abc_TtSupportSize( pTruth, p->nVars ); + pCountsAll[nSuppSize]++; + pCountsSSizes[nSuppSize] += Vec_IntSize(vDecs); + pCounts[nSuppSize][Abc_MinInt(DSD_ARRAY_LIMIT+1,Vec_IntSize(vDecs))]++; +// pCounts[nSuppSize][Abc_MinInt(DSD_ARRAY_LIMIT+1,Vec_IntSize(vDecs)?1+(Vec_IntSize(vDecs)/10):0)]++; +/* + if ( nSuppSize == 6 && Vec_IntSize(vDecs) == pDecMax[6] ) + { + fprintf( pFile, "0x" ); + Abc_TtPrintHex( pTruth, nSuppSize ); + Dau_DecPrintSets( vDecs, nSuppSize ); + } +*/ + } + // print header + fprintf( pFile, " N : " ); + fprintf( pFile, " Total " ); + for ( k = 0; k <= DSD_ARRAY_LIMIT; k++ ) + fprintf( pFile, "%6d", k ); + fprintf( pFile, " " ); + fprintf( pFile, " More" ); + fprintf( pFile, " Ave" ); + fprintf( pFile, " Max" ); + fprintf( pFile, "\n" ); + // print rows + for ( i = 0; i <= p->nVars; i++ ) + { + fprintf( pFile, "%2d : ", i ); + fprintf( pFile, "%6d ", pCountsAll[i] ); + for ( k = 0; k <= DSD_ARRAY_LIMIT; k++ ) +// fprintf( pFile, "%6d", pCounts[i][k] ); + fprintf( pFile, "%6.1f", 100.0*pCounts[i][k]/Abc_MaxInt(1,pCountsAll[i]) ); + fprintf( pFile, " " ); +// fprintf( pFile, "%6d", pCounts[i][k] ); + fprintf( pFile, "%6.1f", 100.0*pCounts[i][k]/Abc_MaxInt(1,pCountsAll[i]) ); + fprintf( pFile, " " ); + fprintf( pFile, "%6.1f", 1.0*pCountsSSizes[i]/Abc_MaxInt(1,pCountsAll[i]) ); + fprintf( pFile, " " ); + fprintf( pFile, "%6d", pDecMax[i] ); + fprintf( pFile, "\n" ); + } +} void If_DsdManPrintOccurs( FILE * pFile, If_DsdMan_t * p ) { char Buffer[100]; @@ -507,6 +572,7 @@ void If_DsdManPrint( If_DsdMan_t * p, char * pFileName, int Number, int Support, If_DsdManDumpDsd( p, Support ); if ( fTtDump ) If_DsdManDumpAll( p, Support ); +// If_DsdManPrintDecs( stdout, p ); if ( !fVerbose ) return; If_DsdVecForEachObj( p->vObjs, pObj, i ) diff --git a/src/opt/dau/dau.h b/src/opt/dau/dau.h index 5699962e..0ccee987 100644 --- a/src/opt/dau/dau.h +++ b/src/opt/dau/dau.h @@ -40,7 +40,7 @@ ABC_NAMESPACE_HEADER_START #define DAU_MAX_VAR 12 // should be 6 or more -#define DAU_MAX_STR 1000 +#define DAU_MAX_STR 2000 #define DAU_MAX_WORD (1<<(DAU_MAX_VAR-6)) //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/dau/dauNonDsd.c b/src/opt/dau/dauNonDsd.c index ec16c9ab..f34f1809 100644 --- a/src/opt/dau/dauNonDsd.c +++ b/src/opt/dau/dauNonDsd.c @@ -434,7 +434,7 @@ unsigned Dau_DecReadSet( char * pStr ) void Dau_DecPrintSets( Vec_Int_t * vSets, int nVars ) { int i, Entry; - printf( "The set contains %d entries:\n", Vec_IntSize(vSets) ); + printf( "The %d-variable set family contains %d sets:\n", nVars, Vec_IntSize(vSets) ); Vec_IntForEachEntry( vSets, Entry, i ) Dau_DecPrintSet( (unsigned)Entry, nVars, 1 ); printf( "\n" ); |