Commit 7926d75e by Alan Mishchenko

Adding features related to the communication bridge.

parent a6f363d4
......@@ -379,6 +379,12 @@ extern int Abc_CommandAbcLivenessToSafetyWithLTL( Abc_Frame_t * pAbc, int argc,
***********************************************************************/
void Abc_FrameReplaceCex( Abc_Frame_t * pAbc, Abc_Cex_t ** ppCex )
{
// update bridge
if ( Abc_FrameIsBridgeMode() )
{
extern int Gia_ManToBridgeResult( FILE * pFile, int Result, Abc_Cex_t * pCex );
Gia_ManToBridgeResult( stdout, pAbc->Status, *ppCex );
}
// update CEX
ABC_FREE( pAbc->pCex );
pAbc->pCex = *ppCex;
......@@ -23473,7 +23479,6 @@ int Abc_CommandAbc9Equiv3( Abc_Frame_t * pAbc, int argc, char ** argv )
// else
// pAbc->Status = Ssw_RarSignalFilterGia2( pAbc->pGia, nFrames, nWords, nBinSize, nRounds, TimeOut, fUseCex? pAbc->pCex: NULL, fLatchOnly, fVerbose );
// pAbc->nFrames = pAbc->pGia->pCexSeq->iFrame;
if ( pAbc->pGia->pCexSeq )
Abc_FrameReplaceCex( pAbc, &pAbc->pGia->pCexSeq );
return 0;
......
......@@ -111,7 +111,7 @@ int Abc_RealMain( int argc, char * argv[] )
sprintf( sWriteCmd, "write" );
Extra_UtilGetoptReset();
while ((c = Extra_UtilGetopt(argc, argv, "c:hf:F:o:st:T:x")) != EOF) {
while ((c = Extra_UtilGetopt(argc, argv, "c:hf:F:o:st:T:xb")) != EOF) {
switch(c) {
case 'c':
strcpy( sCommandUsr, globalUtilOptarg );
......@@ -177,11 +177,21 @@ int Abc_RealMain( int argc, char * argv[] )
fBatch = 1;
break;
case 'b':
Abc_FrameSetBridgeMode();
break;
default:
goto usage;
}
}
if ( Abc_FrameIsBridgeMode() )
{
extern Gia_Man_t * Gia_ManFromBridge( FILE * pFile, Vec_Int_t ** pvInit );
pAbc->pGia = Gia_ManFromBridge( stdin, NULL );
}
if ( fBatch )
{
pAbc->fBatchMode = 1;
......
......@@ -104,6 +104,8 @@ extern ABC_DLL void * Abc_FrameReadManDd();
extern ABC_DLL void * Abc_FrameReadManDec();
extern ABC_DLL char * Abc_FrameReadFlag( char * pFlag );
extern ABC_DLL int Abc_FrameIsFlagEnabled( char * pFlag );
extern ABC_DLL int Abc_FrameIsBridgeMode();
extern ABC_DLL void Abc_FrameSetBridgeMode();
extern ABC_DLL int Abc_FrameReadBmcFrames( Abc_Frame_t * p );
extern ABC_DLL int Abc_FrameReadProbStatus( Abc_Frame_t * p );
......
......@@ -78,6 +78,9 @@ void Abc_FrameSetLibVer( void * pLib ) { s_GlobalFrame->pL
void Abc_FrameSetFlag( char * pFlag, char * pValue ) { Cmd_FlagUpdateValue( s_GlobalFrame, pFlag, pValue ); }
void Abc_FrameSetCex( Abc_Cex_t * pCex ) { ABC_FREE( s_GlobalFrame->pCex ); s_GlobalFrame->pCex = pCex; }
int Abc_FrameIsBridgeMode() { return s_GlobalFrame->fBridgeMode; }
void Abc_FrameSetBridgeMode() { s_GlobalFrame->fBridgeMode = 0; }
/**Function*************************************************************
Synopsis [Returns 1 if the flag is enabled without value or with value 1.]
......
......@@ -70,6 +70,7 @@ struct Abc_Frame_t_
int nSteps; // the counter of different network processed
int fAutoexac; // marks the autoexec mode
int fBatchMode; // are we invoked in batch mode?
int fBridgeMode; // are we invoked in bridge mode?
// output streams
FILE * Out;
FILE * Err;
......
......@@ -120,7 +120,7 @@ void Abc_UtilsPrintUsage( Abc_Frame_t * pAbc, char * ProgName )
{
fprintf( pAbc->Err, "\n" );
fprintf( pAbc->Err,
"usage: %s [-c cmd] [-f script] [-h] [-o file] [-s] [-t type] [-T type] [-x] [file]\n",
"usage: %s [-c cmd] [-f script] [-h] [-o file] [-s] [-t type] [-T type] [-x] [-b] [file]\n",
ProgName);
fprintf( pAbc->Err, " -c cmd\texecute commands `cmd'\n");
fprintf( pAbc->Err, " -F script\texecute commands from a script file and echo commands\n");
......@@ -131,6 +131,7 @@ void Abc_UtilsPrintUsage( Abc_Frame_t * pAbc, char * ProgName )
fprintf( pAbc->Err, " -t type\tspecify input type (blif_mv (default), blif_mvs, blif, or none)\n");
fprintf( pAbc->Err, " -T type\tspecify output type (blif_mv (default), blif_mvs, blif, or none)\n");
fprintf( pAbc->Err, " -x\t\tequivalent to '-t none -T none'\n");
fprintf( pAbc->Err, " -b\t\trunning in bridge mode\n");
fprintf( pAbc->Err, "\n" );
}
......
......@@ -256,23 +256,19 @@ enum Abc_VerbLevel
ABC_VERBOSE = 2
};
extern int Gia_ManToBridgeText( FILE * pFile, int Size, unsigned char * pBuffer );
// string printing
extern char * vnsprintf(const char* format, va_list args);
extern char * nsprintf(const char* format, ...);
static inline void Abc_Print( int level, const char * format, ... )
{
extern int in_bridge_mode;
extern ABC_DLL int Abc_FrameIsBridgeMode();
va_list args;
if ( level == ABC_ERROR )
printf( "Error: " );
else if ( level == ABC_WARNING )
printf( "Warning: " );
va_start( args, format );
if ( in_bridge_mode )
if ( Abc_FrameIsBridgeMode() )
{
extern int Gia_ManToBridgeText( FILE * pFile, int Size, unsigned char * pBuffer );
extern char * vnsprintf(const char* format, va_list args);
unsigned char * tmp = vnsprintf( format, args );
Gia_ManToBridgeText( stdout, strlen(tmp), tmp );
free( tmp );
......@@ -345,6 +341,10 @@ extern void Abc_QuickSort3( word * pData, int nSize, int fDecrease );
extern void Abc_QuickSortCostData( int * pCosts, int nSize, int fDecrease, word * pData, int * pResult );
extern int * Abc_QuickSortCost( int * pCosts, int nSize, int fDecrease );
// string printing
extern char * vnsprintf(const char* format, va_list args);
extern char * nsprintf(const char* format, ...);
ABC_NAMESPACE_HEADER_END
......
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