diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2009-03-10 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2009-03-10 08:01:00 -0700 |
commit | 32314347bae6ddcd841a268e797ec4da45726abb (patch) | |
tree | e2e5fd1711f04a06d0da2b8003bc02cb9a5dd446 /src/base/io/ioUtil.c | |
parent | c03f9b516bed2c06ec2bfc78617eba5fc9a11c32 (diff) | |
download | abc-32314347bae6ddcd841a268e797ec4da45726abb.tar.gz abc-32314347bae6ddcd841a268e797ec4da45726abb.tar.bz2 abc-32314347bae6ddcd841a268e797ec4da45726abb.zip |
Version abc90310
Diffstat (limited to 'src/base/io/ioUtil.c')
-rw-r--r-- | src/base/io/ioUtil.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/base/io/ioUtil.c b/src/base/io/ioUtil.c index c67c183d..c00c3008 100644 --- a/src/base/io/ioUtil.c +++ b/src/base/io/ioUtil.c @@ -51,6 +51,8 @@ Io_FileType_t Io_ReadFileType( char * pFileName ) return IO_FILE_AIGER; if ( !strcmp( pExt, "baf" ) ) return IO_FILE_BAF; + if ( !strcmp( pExt, "bblif" ) ) + return IO_FILE_BBLIF; if ( !strcmp( pExt, "blif" ) ) return IO_FILE_BLIF; if ( !strcmp( pExt, "bench" ) ) @@ -108,12 +110,14 @@ Abc_Ntk_t * Io_ReadNetlist( char * pFileName, Io_FileType_t FileType, int fCheck } fclose( pFile ); // read the AIG - if ( FileType == IO_FILE_AIGER || FileType == IO_FILE_BAF ) + if ( FileType == IO_FILE_AIGER || FileType == IO_FILE_BAF || FileType == IO_FILE_BBLIF ) { if ( FileType == IO_FILE_AIGER ) pNtk = Io_ReadAiger( pFileName, fCheck ); - else // if ( FileType == IO_FILE_BAF ) + else if ( FileType == IO_FILE_BAF ) pNtk = Io_ReadBaf( pFileName, fCheck ); + else // if ( FileType == IO_FILE_BBLIF ) + pNtk = Io_ReadBblif( pFileName, fCheck ); if ( pNtk == NULL ) { fprintf( stdout, "Reading AIG from file has failed.\n" ); @@ -258,7 +262,7 @@ void Io_Write( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType ) } if ( FileType == IO_FILE_AIGER ) Io_WriteAiger( pNtk, pFileName, 1, 0 ); - else // if ( FileType == IO_FILE_BAF ) + else //if ( FileType == IO_FILE_BAF ) Io_WriteBaf( pNtk, pFileName ); return; } @@ -278,6 +282,18 @@ void Io_Write( Abc_Ntk_t * pNtk, char * pFileName, Io_FileType_t FileType ) Io_WriteGml( pNtk, pFileName ); return; } + if ( FileType == IO_FILE_BBLIF ) + { + if ( !Abc_NtkIsLogic(pNtk) ) + { + fprintf( stdout, "Writing Binary BLIF is only possible for logic networks.\n" ); + return; + } + if ( !Abc_NtkHasSop(pNtk) ) + Abc_NtkToSop( pNtk, 0 ); + Io_WriteBblif( pNtk, pFileName ); + return; + } /* if ( FileType == IO_FILE_BLIFMV ) { |