diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-09-13 17:25:31 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-09-13 17:25:31 -0700 |
commit | 27be3d018524da2f5e5089b7fa5419efe19338dc (patch) | |
tree | be20d87f11381a0084703c46b2c2453842729d28 /src/aig/gia | |
parent | dfb43b2f58162573580af8572eb8a223accf5896 (diff) | |
download | abc-27be3d018524da2f5e5089b7fa5419efe19338dc.tar.gz abc-27be3d018524da2f5e5089b7fa5419efe19338dc.tar.bz2 abc-27be3d018524da2f5e5089b7fa5419efe19338dc.zip |
Added command &struct for profiling non-dec structures.
Diffstat (limited to 'src/aig/gia')
-rw-r--r-- | src/aig/gia/giaIf.c | 49 | ||||
-rw-r--r-- | src/aig/gia/giaJf.c | 2 |
2 files changed, 51 insertions, 0 deletions
diff --git a/src/aig/gia/giaIf.c b/src/aig/gia/giaIf.c index cf4eef5a..3f86f829 100644 --- a/src/aig/gia/giaIf.c +++ b/src/aig/gia/giaIf.c @@ -1366,6 +1366,55 @@ Gia_Man_t * Gia_ManPerformMapping( Gia_Man_t * p, void * pp, int fNormalized ) return pNew; } +/**Function************************************************************* + + Synopsis [Tests decomposition structures.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Gia_ManTestStruct( Gia_Man_t * p ) +{ + int nCutMax = 7; + int LutCount[8] = {0}, LutNDecomp[8] = {0}; + int i, k, iFan, nFanins, Status; + Vec_Int_t * vLeaves; + word * pTruth; + + vLeaves = Vec_IntAlloc( 100 ); + Gia_ObjComputeTruthTableStart( p, nCutMax ); + Gia_ManForEachLut( p, i ) + { + nFanins = Gia_ObjLutSize(p, i); + assert( nFanins <= 7 ); + LutCount[Abc_MaxInt(nFanins, 5)]++; + if ( nFanins <= 5 ) + continue; + Vec_IntClear( vLeaves ); + Gia_LutForEachFanin( p, i, iFan, k ) + Vec_IntPush( vLeaves, iFan ); + pTruth = Gia_ObjComputeTruthTableCut( p, Gia_ManObj(p, i), vLeaves ); + // check if it is decomposable + Status = If_CutPerformCheck07( NULL, (unsigned *)pTruth, 7, nFanins, NULL ); + if ( Status == 1 ) + continue; + LutNDecomp[nFanins]++; + if ( LutNDecomp[nFanins] > 10 ) + continue; + Kit_DsdPrintFromTruth( (unsigned *)pTruth, nFanins ); printf( "\n" ); + } + Gia_ObjComputeTruthTableStop( p ); + + printf( "LUT5 = %d ", LutCount[5] ); + printf( "LUT6 = %d NonDec = %d (%.2f %%) ", LutCount[6], LutNDecomp[6], 100.0 * LutNDecomp[6]/Abc_MaxInt(LutCount[6], 1) ); + printf( "LUT7 = %d NonDec = %d (%.2f %%) ", LutCount[7], LutNDecomp[7], 100.0 * LutNDecomp[7]/Abc_MaxInt(LutCount[7], 1) ); + printf( "\n" ); +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// diff --git a/src/aig/gia/giaJf.c b/src/aig/gia/giaJf.c index 3c790fd8..6c45a749 100644 --- a/src/aig/gia/giaJf.c +++ b/src/aig/gia/giaJf.c @@ -1024,6 +1024,8 @@ void Jf_ObjComputeCuts( Jf_Man_t * p, Gia_Obj_t * pObj, int fEdge ) assert( pSto[c]->pCut[0] <= nOldSupp ); if ( pSto[c]->pCut[0] < nOldSupp ) pSto[c]->Sign = Jf_CutGetSign( pSto[c]->pCut ); + if ( pSto[c]->iFunc >= (1 << 22) ) + printf( "Hard limit on the number of different Boolean functions (2^21) is reached. Quitting...\n" ), exit(1); } else { |