Commit 6d1fc80f by Alan Mishchenko

Expriments with functions.

parent 7b2ef943
...@@ -28,7 +28,7 @@ ABC_NAMESPACE_IMPL_START ...@@ -28,7 +28,7 @@ ABC_NAMESPACE_IMPL_START
/// DECLARATIONS /// /// DECLARATIONS ///
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
#define USE4VARS 1 //#define USE4VARS 1
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS /// /// FUNCTION DEFINITIONS ///
...@@ -144,8 +144,14 @@ unsigned * Dau_ReadFile( char * pFileName, int nSizeW ) ...@@ -144,8 +144,14 @@ unsigned * Dau_ReadFile( char * pFileName, int nSizeW )
abctime clk = Abc_Clock(); abctime clk = Abc_Clock();
FILE * pFile = fopen( pFileName, "rb" ); FILE * pFile = fopen( pFileName, "rb" );
unsigned * p = (unsigned *)ABC_CALLOC(word, nSizeW); unsigned * p = (unsigned *)ABC_CALLOC(word, nSizeW);
int RetValue = fread( p, sizeof(word), nSizeW, pFile ); int RetValue = pFile ? fread( p, sizeof(word), nSizeW, pFile ) : 0;
fclose( pFile ); if ( pFile )
{
printf( "Finished reading file \"%s\".\n", pFileName );
fclose( pFile );
}
else
printf( "Cannot open input file \"%s\".\n", pFileName );
Abc_PrintTime( 1, "File reading", Abc_Clock() - clk ); Abc_PrintTime( 1, "File reading", Abc_Clock() - clk );
return p; return p;
} }
...@@ -192,7 +198,7 @@ void Dau_NetworkEnum() ...@@ -192,7 +198,7 @@ void Dau_NetworkEnum()
pTable[Inv] |= (1 << 31); pTable[Inv] |= (1 << 31);
Vec_IntPushTwo( Vec_WecEntry(vNpns, 0), 0, Inv ); Vec_IntPushTwo( Vec_WecEntry(vNpns, 0), 0, Inv );
Vec_IntPushTwo( Vec_WecEntry(vNpns_, 0), 0, Inv ); Vec_IntPushTwo( Vec_WecEntry(vNpns_, 0), 0, Inv );
printf("Nodes = %2d. New = %4d. Total = %6d. New = %4d. Total = %6d. ", printf("Nodes = %2d. New = %6d. Total = %6d. New = %6d. Total = %6d. ",
0, Vec_IntSize(Vec_WecEntry(vNpns, 0)), Vec_WecSizeSize(vNpns), 0, Vec_IntSize(Vec_WecEntry(vNpns, 0)), Vec_WecSizeSize(vNpns),
Vec_IntSize(Vec_WecEntry(vNpns_, 0)), Vec_WecSizeSize(vNpns_) ); Vec_IntSize(Vec_WecEntry(vNpns_, 0)), Vec_WecSizeSize(vNpns_) );
Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
...@@ -351,17 +357,17 @@ void Dau_NetworkEnum() ...@@ -351,17 +357,17 @@ void Dau_NetworkEnum()
printf( "Found function %d\n", Res ); printf( "Found function %d\n", Res );
} }
} }
printf("Nodes = %2d. New = %4d. Total = %6d. New = %4d. Total = %6d. ", printf("Nodes = %2d. New = %6d. Total = %6d. New = %6d. Total = %6d. ",
n, Vec_IntSize(vFuncsN), Vec_WecSizeSize(vNpns), Vec_IntSize(vFuncsN_), Vec_WecSizeSize(vNpns_) ); n, Vec_IntSize(vFuncsN), Vec_WecSizeSize(vNpns), Vec_IntSize(vFuncsN_), Vec_WecSizeSize(vNpns_) );
Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); Abc_PrintTime( 1, "Time", Abc_Clock() - clk );
fflush(stdout); fflush(stdout);
if ( Vec_IntSize(vFuncsN) == 0 ) if ( Vec_IntSize(vFuncsN) == 0 )
break; break;
} }
printf( "Functions with 7 nodes:\n" ); // printf( "Functions with 7 nodes:\n" );
Vec_IntForEachEntry( Vec_WecEntry(vNpns_,7), Entry, i ) // Vec_IntForEachEntry( Vec_WecEntry(vNpns_,7), Entry, i )
printf( "%04x ", Entry ); // printf( "%04x ", Entry );
printf( "\n" ); // printf( "\n" );
Vec_WecFree( vNpns ); Vec_WecFree( vNpns );
Vec_WecFree( vNpns_ ); Vec_WecFree( vNpns_ );
......
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