Commit 06ae1644 by Alan Mishchenko

Fixing the problem with writing/reading bug-free depth in status files.

parent 5b4ef503
...@@ -84,13 +84,16 @@ void Abc_NtkWriteLogFile( char * pFileName, Abc_Cex_t * pCex, int Status, int nF ...@@ -84,13 +84,16 @@ void Abc_NtkWriteLogFile( char * pFileName, Abc_Cex_t * pCex, int Status, int nF
else else
printf( "Abc_NtkWriteLogFile(): Cannot recognize solving status.\n" ); printf( "Abc_NtkWriteLogFile(): Cannot recognize solving status.\n" );
fprintf( pFile, " " ); fprintf( pFile, " " );
// write <cyc> // write <bug_free_depth>
fprintf( pFile, "%d", pCex ? pCex->iFrame : nFrames ); fprintf( pFile, "%d", nFrames );
fprintf( pFile, " " ); fprintf( pFile, " " );
// write <engine_name> // write <engine_name>
fprintf( pFile, "%s", pCommand ? pCommand : "unknown" ); fprintf( pFile, "%s", pCommand ? pCommand : "unknown" );
if ( Status == 0 ) if ( Status == 0 )
fprintf( pFile, " %d", pCex->iPo ); fprintf( pFile, " %d", pCex->iPo );
// write <cyc>
if ( pCex && pCex->iFrame != nFrames )
fprintf( pFile, " %d", pCex->iFrame );
fprintf( pFile, "\n" ); fprintf( pFile, "\n" );
// write <INIT_STATE> // write <INIT_STATE>
if ( pCex == NULL ) if ( pCex == NULL )
...@@ -131,7 +134,7 @@ int Abc_NtkReadLogFile( char * pFileName, Abc_Cex_t ** ppCex, int * pnFrames ) ...@@ -131,7 +134,7 @@ int Abc_NtkReadLogFile( char * pFileName, Abc_Cex_t ** ppCex, int * pnFrames )
Abc_Cex_t * pCex; Abc_Cex_t * pCex;
Vec_Int_t * vNums; Vec_Int_t * vNums;
char Buffer[1000], * pToken; char Buffer[1000], * pToken;
int c, nRegs = -1, nFrames = -1, iPo = -1, Status = -1; int c, nRegs = -1, nFrames = -1, iPo = -1, Status = -1, nFrames2 = -1;
pFile = fopen( pFileName, "r" ); pFile = fopen( pFileName, "r" );
if ( pFile == NULL ) if ( pFile == NULL )
{ {
...@@ -153,6 +156,9 @@ int Abc_NtkReadLogFile( char * pFileName, Abc_Cex_t ** ppCex, int * pnFrames ) ...@@ -153,6 +156,9 @@ int Abc_NtkReadLogFile( char * pFileName, Abc_Cex_t ** ppCex, int * pnFrames )
pToken = strtok( NULL, " \t\n" ); pToken = strtok( NULL, " \t\n" );
pToken = strtok( NULL, " \t\n" ); pToken = strtok( NULL, " \t\n" );
iPo = atoi( pToken ); iPo = atoi( pToken );
pToken = strtok( NULL, " \t\n" );
if ( pToken )
nFrames2 = atoi( pToken );
} }
else if ( !strncmp( Buffer, "snl_UNK", strlen("snl_UNK") ) ) else if ( !strncmp( Buffer, "snl_UNK", strlen("snl_UNK") ) )
{ {
...@@ -182,6 +188,7 @@ int Abc_NtkReadLogFile( char * pFileName, Abc_Cex_t ** ppCex, int * pnFrames ) ...@@ -182,6 +188,7 @@ int Abc_NtkReadLogFile( char * pFileName, Abc_Cex_t ** ppCex, int * pnFrames )
fclose( pFile ); fclose( pFile );
if ( Vec_IntSize(vNums) ) if ( Vec_IntSize(vNums) )
{ {
int iFrameCex = (nFrames2 == -1) ? nFrames : nFrames2;
if ( nRegs == 0 ) if ( nRegs == 0 )
{ {
printf( "Cannot read register number.\n" ); printf( "Cannot read register number.\n" );
...@@ -192,14 +199,14 @@ int Abc_NtkReadLogFile( char * pFileName, Abc_Cex_t ** ppCex, int * pnFrames ) ...@@ -192,14 +199,14 @@ int Abc_NtkReadLogFile( char * pFileName, Abc_Cex_t ** ppCex, int * pnFrames )
printf( "Cannot read counter example.\n" ); printf( "Cannot read counter example.\n" );
return -1; return -1;
} }
if ( (Vec_IntSize(vNums)-nRegs) % nFrames != 0 ) if ( (Vec_IntSize(vNums)-nRegs) % (iFrameCex + 1) != 0 )
{ {
printf( "Incorrect number of bits.\n" ); printf( "Incorrect number of bits.\n" );
return -1; return -1;
} }
pCex = Abc_CexAlloc( nRegs, (Vec_IntSize(vNums)-nRegs)/nFrames, nFrames ); pCex = Abc_CexAlloc( nRegs, (Vec_IntSize(vNums)-nRegs)/(iFrameCex + 1), iFrameCex + 1 );
pCex->iPo = iPo; pCex->iPo = iPo;
pCex->iFrame = nFrames - 1; pCex->iFrame = iFrameCex;
assert( Vec_IntSize(vNums) == pCex->nBits ); assert( Vec_IntSize(vNums) == pCex->nBits );
for ( c = 0; c < pCex->nBits; c++ ) for ( c = 0; c < pCex->nBits; c++ )
if ( Vec_IntEntry(vNums, c) ) if ( Vec_IntEntry(vNums, c) )
......
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