Commit 26c92f16 by Baruch Sterin

add an option to write_cex to write the CEX in AIGER 1.9 format.

parent b902b684
...@@ -2010,11 +2010,12 @@ int IoCommandWriteCex( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -2010,11 +2010,12 @@ int IoCommandWriteCex( Abc_Frame_t * pAbc, int argc, char **argv )
int fUseOldMin = 0; int fUseOldMin = 0;
int fCheckCex = 0; int fCheckCex = 0;
int forceSeq = 0; int forceSeq = 0;
int fAiger = 0;
int fPrintFull = 0; int fPrintFull = 0;
int fVerbose = 0; int fVerbose = 0;
Extra_UtilGetoptReset(); Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "snmocfvh" ) ) != EOF ) while ( ( c = Extra_UtilGetopt( argc, argv, "snmocafvh" ) ) != EOF )
{ {
switch ( c ) switch ( c )
{ {
...@@ -2033,6 +2034,9 @@ int IoCommandWriteCex( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -2033,6 +2034,9 @@ int IoCommandWriteCex( Abc_Frame_t * pAbc, int argc, char **argv )
case 'c': case 'c':
fCheckCex ^= 1; fCheckCex ^= 1;
break; break;
case 'a':
fAiger ^= 1;
break;
case 'f': case 'f':
fPrintFull ^= 1; fPrintFull ^= 1;
break; break;
...@@ -2129,9 +2133,14 @@ int IoCommandWriteCex( Abc_Frame_t * pAbc, int argc, char **argv ) ...@@ -2129,9 +2133,14 @@ int IoCommandWriteCex( Abc_Frame_t * pAbc, int argc, char **argv )
{ {
Abc_NtkForEachLatch( pNtk, pObj, i ) Abc_NtkForEachLatch( pNtk, pObj, i )
fprintf( pFile, "%c", '0'+!Abc_LatchIsInit0(pObj) ); fprintf( pFile, "%c", '0'+!Abc_LatchIsInit0(pObj) );
for ( i = pCex->nRegs; i < pCex->nBits; i++ ) for ( i = pCex->nRegs; i < pCex->nBits; i++ )
{
if ( fAiger && (i-pCex->nRegs)%pCex->nPis == 0)
fprintf( pFile, "\n");
fprintf( pFile, "%c", '0'+Abc_InfoHasBit(pCex->pData, i) ); fprintf( pFile, "%c", '0'+Abc_InfoHasBit(pCex->pData, i) );
} }
}
fprintf( pFile, "\n" ); fprintf( pFile, "\n" );
fclose( pFile ); fclose( pFile );
} }
...@@ -2172,6 +2181,7 @@ usage: ...@@ -2172,6 +2181,7 @@ usage:
fprintf( pAbc->Err, "\t-m : minimize counter-example by dropping don't-care values [default = %s]\n", fMinimize? "yes": "no" ); fprintf( pAbc->Err, "\t-m : minimize counter-example by dropping don't-care values [default = %s]\n", fMinimize? "yes": "no" );
fprintf( pAbc->Err, "\t-o : use old counter-example minimization algorithm [default = %s]\n", fUseOldMin? "yes": "no" ); fprintf( pAbc->Err, "\t-o : use old counter-example minimization algorithm [default = %s]\n", fUseOldMin? "yes": "no" );
fprintf( pAbc->Err, "\t-c : check generated counter-example using ternary simulation [default = %s]\n", fCheckCex? "yes": "no" ); fprintf( pAbc->Err, "\t-c : check generated counter-example using ternary simulation [default = %s]\n", fCheckCex? "yes": "no" );
fprintf( pAbc->Err, "\t-a : print cex in AIGER 1.9 format [default = %s].\n", fAiger? "yes": "no" );
fprintf( pAbc->Err, "\t-f : enable printing flop values in each timeframe [default = %s].\n", fPrintFull? "yes": "no" ); fprintf( pAbc->Err, "\t-f : enable printing flop values in each timeframe [default = %s].\n", fPrintFull? "yes": "no" );
fprintf( pAbc->Err, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" ); fprintf( pAbc->Err, "\t-v : enable verbose output [default = %s].\n", fVerbose? "yes": "no" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" ); fprintf( pAbc->Err, "\t-h : print the help massage\n" );
......
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