diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2005-07-29 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2005-07-29 08:01:00 -0700 |
commit | 888e5bed5d7f56a5d86d91a6e8e88f3e5a3454dc (patch) | |
tree | 11d48c9e9069f54dc300c3571ae63c744c802c50 /src/base/io/ioRead.c | |
parent | 7f94414388cce67bd3cc1a6d6269f0ed31ed0d06 (diff) | |
download | abc-888e5bed5d7f56a5d86d91a6e8e88f3e5a3454dc.tar.gz abc-888e5bed5d7f56a5d86d91a6e8e88f3e5a3454dc.tar.bz2 abc-888e5bed5d7f56a5d86d91a6e8e88f3e5a3454dc.zip |
Version abc50729
Diffstat (limited to 'src/base/io/ioRead.c')
-rw-r--r-- | src/base/io/ioRead.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/base/io/ioRead.c b/src/base/io/ioRead.c new file mode 100644 index 00000000..18e4b153 --- /dev/null +++ b/src/base/io/ioRead.c @@ -0,0 +1,74 @@ +/**CFile**************************************************************** + + FileName [ioRead.c] + + SystemName [ABC: Logic synthesis and verification system.] + + PackageName [Command processing package.] + + Synopsis [Procedure to read network from file.] + + Author [Alan Mishchenko] + + Affiliation [UC Berkeley] + + Date [Ver. 1.0. Started - June 20, 2005.] + + Revision [$Id: ioRead.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $] + +***********************************************************************/ + +#include "io.h" + +//////////////////////////////////////////////////////////////////////// +/// DECLARATIONS /// +//////////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////////// +/// FUNCTION DEFITIONS /// +//////////////////////////////////////////////////////////////////////// + +/**Function************************************************************* + + Synopsis [Read the network from a file.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +Abc_Ntk_t * Io_Read( char * pFileName, int fCheck ) +{ + Abc_Ntk_t * pNtk, * pTemp; + // set the new network + if ( Extra_FileNameCheckExtension( pFileName, "blif" ) ) + pNtk = Io_ReadBlif( pFileName, fCheck ); + else if ( Extra_FileNameCheckExtension( pFileName, "v" ) ) + pNtk = Io_ReadVerilog( pFileName, fCheck ); + else if ( Extra_FileNameCheckExtension( pFileName, "bench" ) ) + pNtk = Io_ReadBench( pFileName, fCheck ); + else + { + fprintf( stderr, "Unknown file format\n" ); + return NULL; + } + if ( pNtk == NULL ) + return NULL; + pNtk = Abc_NtkLogic( pTemp = pNtk ); + Abc_NtkDelete( pTemp ); + if ( pNtk == NULL ) + { + fprintf( stdout, "Converting to logic network after reading has failed.\n" ); + return NULL; + } + return pNtk; +} + +//////////////////////////////////////////////////////////////////////// +/// END OF FILE /// +//////////////////////////////////////////////////////////////////////// + + + |