diff options
author | Niklas Een <niklas@een.se> | 2012-10-30 19:09:40 -0700 |
---|---|---|
committer | Niklas Een <niklas@een.se> | 2012-10-30 19:09:40 -0700 |
commit | 77fde55b1b87e7e8f92edde61d25f951a9b40c33 (patch) | |
tree | 4455415a25e7ad1309efce2f7580d879c6843514 /src/misc/util | |
parent | 7da6ef1c027730dc8a506ab039ffbba062693170 (diff) | |
download | abc-77fde55b1b87e7e8f92edde61d25f951a9b40c33.tar.gz abc-77fde55b1b87e7e8f92edde61d25f951a9b40c33.tar.bz2 abc-77fde55b1b87e7e8f92edde61d25f951a9b40c33.zip |
Added switch for netlist type to 'send_aig'. Changed defautl to &-space. Fixed printf -> Abc_Print in some places.
Diffstat (limited to 'src/misc/util')
-rw-r--r-- | src/misc/util/abc_global.h | 17 | ||||
-rw-r--r-- | src/misc/util/utilBridge.c | 13 |
2 files changed, 20 insertions, 10 deletions
diff --git a/src/misc/util/abc_global.h b/src/misc/util/abc_global.h index 3259fa0d..fe3eda63 100644 --- a/src/misc/util/abc_global.h +++ b/src/misc/util/abc_global.h @@ -276,10 +276,19 @@ static inline void Abc_Print( int level, const char * format, ... ) { extern ABC_DLL int Abc_FrameIsBridgeMode(); va_list args; - if ( level == ABC_ERROR ) - printf( "Error: " ); - else if ( level == ABC_WARNING ) - printf( "Warning: " ); + + if ( ! Abc_FrameIsBridgeMode() ){ + if ( level == ABC_ERROR ) + printf( "Error: " ); + else if ( level == ABC_WARNING ) + printf( "Warning: " ); + }else{ + if ( level == ABC_ERROR ) + Gia_ManToBridgeText( stdout, strlen("Error: "), (unsigned char*)"Error: " ); + else if ( level == ABC_WARNING ) + Gia_ManToBridgeText( stdout, strlen("Warning: "), (unsigned char*)"Warning: " ); + } + va_start( args, format ); if ( Abc_FrameIsBridgeMode() ) { diff --git a/src/misc/util/utilBridge.c b/src/misc/util/utilBridge.c index 6180948e..8fee359c 100644 --- a/src/misc/util/utilBridge.c +++ b/src/misc/util/utilBridge.c @@ -33,6 +33,7 @@ ABC_NAMESPACE_IMPL_START #define BRIDGE_TEXT_MESSAGE 999996 #define BRIDGE_RESULTS 101 +#define BRIDGE_NETLIST 106 #define BRIDGE_ABS_NETLIST 107 #define BRIDGE_BAD_ABS 105 @@ -150,11 +151,11 @@ int Gia_ManToBridgeText( FILE * pFile, int Size, unsigned char * pBuffer ) Gia_CreateHeader( pFile, BRIDGE_TEXT_MESSAGE, Size, pBuffer ); return 1; } -int Gia_ManToBridgeAbsNetlist( FILE * pFile, Gia_Man_t * p ) +int Gia_ManToBridgeAbsNetlist( FILE * pFile, Gia_Man_t * p, int pkg_type ) { Vec_Str_t * vBuffer; vBuffer = Gia_ManToBridgeVec( p ); - Gia_CreateHeader( pFile, BRIDGE_ABS_NETLIST, Vec_StrSize(vBuffer), (unsigned char *)Vec_StrArray(vBuffer) ); + Gia_CreateHeader( pFile, pkg_type, Vec_StrSize(vBuffer), (unsigned char *)Vec_StrArray(vBuffer) ); Vec_StrFree( vBuffer ); return 1; } @@ -359,7 +360,7 @@ Gia_Man_t * Gia_ManFromBridgeReadBody( int Size, unsigned char * pBuffer, Vec_I Synopsis [] Description [] - + SideEffects [] SeeAlso [] @@ -449,7 +450,7 @@ Gia_Man_t * Gia_ManFromBridge( FILE * pFile, Vec_Int_t ** pvInit ) SeeAlso [] ***********************************************************************/ -void Gia_ManToBridgeAbsNetlistTest( char * pFileName, Gia_Man_t * p ) +void Gia_ManToBridgeAbsNetlistTest( char * pFileName, Gia_Man_t * p, int msg_type ) { FILE * pFile = fopen( pFileName, "wb" ); if ( pFile == NULL ) @@ -457,7 +458,7 @@ void Gia_ManToBridgeAbsNetlistTest( char * pFileName, Gia_Man_t * p ) printf( "Cannot open output file \"%s\".\n", pFileName ); return; } - Gia_ManToBridgeAbsNetlist( pFile, p ); + Gia_ManToBridgeAbsNetlist( pFile, p, msg_type ); fclose ( pFile ); } @@ -488,7 +489,7 @@ void Gia_ManFromBridgeTest( char * pFileName ) Gia_ManPrintStats( p, 0, 0 ); Gia_WriteAiger( p, "temp.aig", 0, 0 ); - Gia_ManToBridgeAbsNetlistTest( "par_.dump", p ); + Gia_ManToBridgeAbsNetlistTest( "par_.dump", p, BRIDGE_ABS_NETLIST ); Gia_ManStop( p ); } |