diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2019-04-18 12:20:04 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2019-04-18 12:20:04 -0700 |
commit | a3620fe67700ed538f944c9cd1e0184bed71e80e (patch) | |
tree | e1c421b525045ace3845e4b1821dc7b520e0f90b | |
parent | dbaa6a58f880f4c19d00a4dd5992322a0e2c4a72 (diff) | |
download | abc-a3620fe67700ed538f944c9cd1e0184bed71e80e.tar.gz abc-a3620fe67700ed538f944c9cd1e0184bed71e80e.tar.bz2 abc-a3620fe67700ed538f944c9cd1e0184bed71e80e.zip |
Enabling dumping of the library of minimum circuits (compiler warnings).
-rw-r--r-- | src/opt/dau/dauNpn.c | 15 | ||||
-rw-r--r-- | src/opt/dau/dauNpn2.c | 9 |
2 files changed, 14 insertions, 10 deletions
diff --git a/src/opt/dau/dauNpn.c b/src/opt/dau/dauNpn.c index 3740eeaf..fc261edc 100644 --- a/src/opt/dau/dauNpn.c +++ b/src/opt/dau/dauNpn.c @@ -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); diff --git a/src/opt/dau/dauNpn2.c b/src/opt/dau/dauNpn2.c index db6958b0..58b23a8c 100644 --- a/src/opt/dau/dauNpn2.c +++ b/src/opt/dau/dauNpn2.c @@ -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; |