Commit 3c0b4b6f by Alan Mishchenko

Experiments with Boolean functions.

parent c750544d
...@@ -247,7 +247,7 @@ int Dtt_ManCheckHash( Dtt_Man_t * p, unsigned Truth ) ...@@ -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 ) 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; word tCur = ((word)Truth << 32) | (word)Truth;
Vec_IntClear( vFuns ); Vec_IntClear( vFuns );
for ( i = 0; i < p->nPerms; i++ ) for ( i = 0; i < p->nPerms; i++ )
...@@ -356,7 +356,7 @@ void Dtt_PrintMulti2( Dtt_Man_t * p ) ...@@ -356,7 +356,7 @@ void Dtt_PrintMulti2( Dtt_Man_t * p )
printf( "\n" ); printf( "\n" );
} }
} }
void Dtt_PrintMulti( Dtt_Man_t * p ) void Dtt_PrintMulti1( Dtt_Man_t * p )
{ {
int i, n, Entry, Count, Prev; int i, n, Entry, Count, Prev;
for ( n = 0; n < 16; n++ ) for ( n = 0; n < 16; n++ )
...@@ -395,6 +395,37 @@ void Dtt_PrintMulti( Dtt_Man_t * p ) ...@@ -395,6 +395,37 @@ void Dtt_PrintMulti( Dtt_Man_t * p )
Vec_IntFree( vUsed ); 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 ) void Dtt_EnumerateLf( int nVars, int nNodeMax, int fDelay, int fMulti, int fVerbose )
{ {
abctime clk = Abc_Clock(); word nSteps = 0, nMultis = 0; abctime clk = Abc_Clock(); word nSteps = 0, nMultis = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment