diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2018-10-02 18:09:51 -0400 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2018-10-02 18:09:51 -0400 |
commit | 3c0b4b6f6628ad7854642ea5041c2cff51062d29 (patch) | |
tree | 65dd0fd835d45240ef400b93b087b07152e9b229 /src/opt/dau | |
parent | c750544df6a24ecaab34683b2dbde5e53b8a710c (diff) | |
download | abc-3c0b4b6f6628ad7854642ea5041c2cff51062d29.tar.gz abc-3c0b4b6f6628ad7854642ea5041c2cff51062d29.tar.bz2 abc-3c0b4b6f6628ad7854642ea5041c2cff51062d29.zip |
Experiments with Boolean functions.
Diffstat (limited to 'src/opt/dau')
-rw-r--r-- | src/opt/dau/dauNpn2.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/src/opt/dau/dauNpn2.c b/src/opt/dau/dauNpn2.c index 68fdc457..a1ccce69 100644 --- a/src/opt/dau/dauNpn2.c +++ b/src/opt/dau/dauNpn2.c @@ -247,7 +247,7 @@ int Dtt_ManCheckHash( Dtt_Man_t * p, unsigned Truth ) } Vec_Int_t * Dtt_ManCollect( Dtt_Man_t * p, unsigned Truth, Vec_Int_t * vFuns ) { - int i, k, Entry, Shift = (1 << p->nVars) - 1; + int i, k, Entry; word tCur = ((word)Truth << 32) | (word)Truth; Vec_IntClear( vFuns ); for ( i = 0; i < p->nPerms; i++ ) @@ -356,7 +356,7 @@ void Dtt_PrintMulti2( Dtt_Man_t * p ) printf( "\n" ); } } -void Dtt_PrintMulti( Dtt_Man_t * p ) +void Dtt_PrintMulti1( Dtt_Man_t * p ) { int i, n, Entry, Count, Prev; for ( n = 0; n < 16; n++ ) @@ -395,6 +395,37 @@ void Dtt_PrintMulti( Dtt_Man_t * p ) Vec_IntFree( vUsed ); } } +void Dtt_PrintMulti( Dtt_Man_t * p ) +{ + int n, Counts[13][11] = {{0}}; + for ( n = 0; n < 13; n++ ) + { + int i, Total = 0, Count = 0; + for ( i = 0; i < p->nClasses; i++ ) + if ( p->pNodes[i] == n ) + { + int Log = Abc_Base2Log(p->pTimes[i]); + assert( Log < 10 ); + if ( p->pTimes[i] < 2 ) + Counts[n][0]++; + else + Counts[n][Log]++; + Total += p->pTimes[i]; + Count++; + } + if ( Count == 0 ) + break; + printf( "n=%2d : ", n ); + printf( "All = %6d ", Count ); + printf( "Ave = %6d ", Total/Count ); + for ( i = 0; i < 11; i++ ) + if ( Counts[n][i] ) + printf( "%6d ", Counts[n][i] ); + else + printf( "%6s ", "" ); + printf( "\n" ); + } +} void Dtt_EnumerateLf( int nVars, int nNodeMax, int fDelay, int fMulti, int fVerbose ) { abctime clk = Abc_Clock(); word nSteps = 0, nMultis = 0; |