Commit a3620fe6 by Alan Mishchenko

Enabling dumping of the library of minimum circuits (compiler warnings).

parent dbaa6a58
...@@ -51,8 +51,6 @@ void Dau_TruthEnum(int nVars) ...@@ -51,8 +51,6 @@ void Dau_TruthEnum(int nVars)
abctime clk = Abc_Clock(); abctime clk = Abc_Clock();
int nSizeLog = (1<<nVars) -2; int nSizeLog = (1<<nVars) -2;
int nSizeW = 1 << nSizeLog; int nSizeW = 1 << nSizeLog;
char pFileName[20];
sprintf( pFileName, "tableW%d.data", nSizeLog );
int nPerms = Extra_Factorial( nVars ); int nPerms = Extra_Factorial( nVars );
int nMints = 1 << nVars; int nMints = 1 << nVars;
int * pPerm = Extra_PermSchedule( nVars ); int * pPerm = Extra_PermSchedule( nVars );
...@@ -115,8 +113,12 @@ void Dau_TruthEnum(int nVars) ...@@ -115,8 +113,12 @@ void Dau_TruthEnum(int nVars)
// write into file // write into file
if ( pTable ) if ( pTable )
{ {
FILE * pFile = fopen( pFileName, "wb" ); FILE * pFile;
int RetValue = fwrite( pTable, 8, nSizeW, pFile ); int RetValue;
char pFileName[20];
sprintf( pFileName, "tableW%d.data", nSizeLog );
pFile = fopen( pFileName, "wb" );
RetValue = fwrite( pTable, 8, nSizeW, pFile );
RetValue = 0; RetValue = 0;
fclose( pFile ); fclose( pFile );
ABC_FREE( pTable ); ABC_FREE( pTable );
...@@ -179,12 +181,13 @@ void Dau_NetworkEnum(int nVars) ...@@ -179,12 +181,13 @@ void Dau_NetworkEnum(int nVars)
int nSizeLog = (1<<nVars) -2; int nSizeLog = (1<<nVars) -2;
int nSizeW = 1 << nSizeLog; int nSizeW = 1 << nSizeLog;
char pFileName[20]; char pFileName[20];
sprintf( pFileName, "tableW%d.data", nSizeLog ); unsigned * pTable;
unsigned * pTable = Dau_ReadFile( pFileName, nSizeW );
Vec_Wec_t * vNpns = Vec_WecStart( 32 ); Vec_Wec_t * vNpns = Vec_WecStart( 32 );
Vec_Wec_t * vNpns_ = Vec_WecStart( 32 ); Vec_Wec_t * vNpns_ = Vec_WecStart( 32 );
int i, v, u, g, k, m, n, Res, Entry; int i, v, u, g, k, m, n, Res, Entry;
unsigned Inv = (unsigned)Abc_Tt6Mask(1 << (nVars-1)); unsigned Inv = (unsigned)Abc_Tt6Mask(1 << (nVars-1));
sprintf( pFileName, "tableW%d.data", nSizeLog );
pTable = Dau_ReadFile( pFileName, nSizeW );
// create constant function and buffer/inverter function // create constant function and buffer/inverter function
pTable[0] |= (1 << 31); pTable[0] |= (1 << 31);
pTable[Inv] |= (1 << 31); pTable[Inv] |= (1 << 31);
......
...@@ -311,10 +311,12 @@ Gia_Man_t * Dau_ConstructAigFromFile( char * pFileName ) ...@@ -311,10 +311,12 @@ Gia_Man_t * Dau_ConstructAigFromFile( char * pFileName )
unsigned * Dau_ReadFile2( char * pFileName, int nSizeW ) unsigned * Dau_ReadFile2( char * pFileName, int nSizeW )
{ {
abctime clk = Abc_Clock(); abctime clk = Abc_Clock();
unsigned * p;
int RetValue;
FILE * pFile = fopen( pFileName, "rb" ); FILE * pFile = fopen( pFileName, "rb" );
if (pFile == NULL) return NULL; if (pFile == NULL) return NULL;
unsigned * p = (unsigned *)ABC_CALLOC(word, nSizeW); p = (unsigned *)ABC_CALLOC(word, nSizeW);
int RetValue = pFile ? fread( p, sizeof(word), nSizeW, pFile ) : 0; RetValue = pFile ? fread( p, sizeof(word), nSizeW, pFile ) : 0;
RetValue = 0; RetValue = 0;
if ( pFile ) if ( pFile )
{ {
...@@ -342,8 +344,7 @@ void Dtt_ManRenum( int nVars, unsigned * pTable, int * pnClasses ) ...@@ -342,8 +344,7 @@ void Dtt_ManRenum( int nVars, unsigned * pTable, int * pnClasses )
} }
unsigned * Dtt_ManLoadClasses( int nVars, int * pnClasses ) unsigned * Dtt_ManLoadClasses( int nVars, int * pnClasses )
{ {
extern Dau_TruthEnum(int); extern void Dau_TruthEnum(int nVars);
unsigned * pTable = NULL; unsigned * pTable = NULL;
int nSizeLog = (1<<nVars) -2; int nSizeLog = (1<<nVars) -2;
int nSizeW = 1 << nSizeLog; int nSizeW = 1 << nSizeLog;
......
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