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

This commit is contained in:
Alan Mishchenko 2019-04-18 12:20:04 -07:00
parent dbaa6a58f8
commit a3620fe677
2 changed files with 14 additions and 10 deletions

View File

@ -51,8 +51,6 @@ void Dau_TruthEnum(int nVars)
abctime clk = Abc_Clock();
int nSizeLog = (1<<nVars) -2;
int nSizeW = 1 << nSizeLog;
char pFileName[20];
sprintf( pFileName, "tableW%d.data", nSizeLog );
int nPerms = Extra_Factorial( nVars );
int nMints = 1 << nVars;
int * pPerm = Extra_PermSchedule( nVars );
@ -115,8 +113,12 @@ void Dau_TruthEnum(int nVars)
// write into file
if ( pTable )
{
FILE * pFile = fopen( pFileName, "wb" );
int RetValue = fwrite( pTable, 8, nSizeW, pFile );
FILE * pFile;
int RetValue;
char pFileName[20];
sprintf( pFileName, "tableW%d.data", nSizeLog );
pFile = fopen( pFileName, "wb" );
RetValue = fwrite( pTable, 8, nSizeW, pFile );
RetValue = 0;
fclose( pFile );
ABC_FREE( pTable );
@ -179,12 +181,13 @@ void Dau_NetworkEnum(int nVars)
int nSizeLog = (1<<nVars) -2;
int nSizeW = 1 << nSizeLog;
char pFileName[20];
sprintf( pFileName, "tableW%d.data", nSizeLog );
unsigned * pTable = Dau_ReadFile( pFileName, nSizeW );
unsigned * pTable;
Vec_Wec_t * vNpns = Vec_WecStart( 32 );
Vec_Wec_t * vNpns_ = Vec_WecStart( 32 );
int i, v, u, g, k, m, n, Res, Entry;
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
pTable[0] |= (1 << 31);
pTable[Inv] |= (1 << 31);

View File

@ -311,10 +311,12 @@ Gia_Man_t * Dau_ConstructAigFromFile( char * pFileName )
unsigned * Dau_ReadFile2( char * pFileName, int nSizeW )
{
abctime clk = Abc_Clock();
unsigned * p;
int RetValue;
FILE * pFile = fopen( pFileName, "rb" );
if (pFile == NULL) return NULL;
unsigned * p = (unsigned *)ABC_CALLOC(word, nSizeW);
int RetValue = pFile ? fread( p, sizeof(word), nSizeW, pFile ) : 0;
p = (unsigned *)ABC_CALLOC(word, nSizeW);
RetValue = pFile ? fread( p, sizeof(word), nSizeW, pFile ) : 0;
RetValue = 0;
if ( pFile )
{
@ -342,8 +344,7 @@ void Dtt_ManRenum( int nVars, unsigned * pTable, int * pnClasses )
}
unsigned * Dtt_ManLoadClasses( int nVars, int * pnClasses )
{
extern Dau_TruthEnum(int);
extern void Dau_TruthEnum(int nVars);
unsigned * pTable = NULL;
int nSizeLog = (1<<nVars) -2;
int nSizeW = 1 << nSizeLog;