Commit 37703eaa by Alan Mishchenko

Exploration of functions.

parent 857688b9
...@@ -10321,7 +10321,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -10321,7 +10321,7 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
int nCutMax = 1; int nCutMax = 1;
int nLeafMax = 10; int nLeafMax = 10;
int nDivMax = 50; int nDivMax = 50;
int nDecMax = 3; int nDecMax = 20;
int fNewAlgo = 0; int fNewAlgo = 0;
int fNewOrder = 0; int fNewOrder = 0;
int fVerbose = 0; int fVerbose = 0;
...@@ -10461,8 +10461,8 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv ) ...@@ -10461,8 +10461,8 @@ int Abc_CommandTest( Abc_Frame_t * pAbc, int argc, char ** argv )
} }
*/ */
{ {
extern void Abc_EnumerateFunctions(); extern void Abc_EnumerateFunctions( int nVars );
Abc_EnumerateFunctions(); Abc_EnumerateFunctions( nDecMax );
} }
if ( pNtk ) if ( pNtk )
{ {
...@@ -249,7 +249,7 @@ static inline void Abc_DataXorBit( word * p, word i ) { p[(i)>>6] ^= (1<<((i) & ...@@ -249,7 +249,7 @@ static inline void Abc_DataXorBit( word * p, word i ) { p[(i)>>6] ^= (1<<((i) &
SeeAlso [] SeeAlso []
***********************************************************************/ ***********************************************************************/
void Abc_EnumerateFunctions() void Abc_EnumerateFunctions( int nDecMax )
{ {
int nVars; int nVars;
int nMints; int nMints;
...@@ -258,7 +258,7 @@ void Abc_EnumerateFunctions() ...@@ -258,7 +258,7 @@ void Abc_EnumerateFunctions()
unsigned pMints[100] = {0}; unsigned pMints[100] = {0};
unsigned pFuncs[100] = {0}; unsigned pFuncs[100] = {0};
unsigned Truth; unsigned Truth;
int FuncDone[100] = {0}; int FuncDone[100] = {0}, nFuncDone = 0;
int GateCount[100] = {0}; int GateCount[100] = {0};
int i, k, n, a, b, v; int i, k, n, a, b, v;
abctime clk = Abc_Clock(); abctime clk = Abc_Clock();
...@@ -289,7 +289,7 @@ void Abc_EnumerateFunctions() ...@@ -289,7 +289,7 @@ void Abc_EnumerateFunctions()
GateCount[0] = 0; GateCount[0] = 0;
GateCount[1] = nVars; GateCount[1] = nVars;
assert( Vec_IntSize(vTruths) == nVars ); assert( Vec_IntSize(vTruths) == nVars );
for ( n = 0; n < 10; n++ ) for ( n = 0; n < nDecMax && nFuncDone < nFuncs; n++ )
{ {
for ( a = 0; a <= n; a++ ) for ( a = 0; a <= n; a++ )
for ( b = a; b <= n; b++ ) for ( b = a; b <= n; b++ )
...@@ -316,6 +316,7 @@ void Abc_EnumerateFunctions() ...@@ -316,6 +316,7 @@ void Abc_EnumerateFunctions()
printf( "Found function %d with %d gates: ", v, n+1 ); printf( "Found function %d with %d gates: ", v, n+1 );
Abc_EnumPrint( vGates, Vec_IntSize(vTruths)-1, nVars ); Abc_EnumPrint( vGates, Vec_IntSize(vTruths)-1, nVars );
FuncDone[v] = 1; FuncDone[v] = 1;
nFuncDone++;
} }
} }
Truth = Vec_IntEntry(vTruths, i) | Vec_IntEntry(vTruths, k); Truth = Vec_IntEntry(vTruths, i) | Vec_IntEntry(vTruths, k);
...@@ -334,6 +335,7 @@ void Abc_EnumerateFunctions() ...@@ -334,6 +335,7 @@ void Abc_EnumerateFunctions()
printf( "Found function %d with %d gates: ", v, n+1 ); printf( "Found function %d with %d gates: ", v, n+1 );
Abc_EnumPrint( vGates, Vec_IntSize(vTruths)-1, nVars ); Abc_EnumPrint( vGates, Vec_IntSize(vTruths)-1, nVars );
FuncDone[v] = 1; FuncDone[v] = 1;
nFuncDone++;
} }
} }
} }
......
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