diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2008-03-01 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2008-03-01 08:01:00 -0800 |
commit | 320c429bc46728c1faddfc561c166810aa134a04 (patch) | |
tree | c773cc96431cd38ae35484dae7d7d17a79671ac2 /src/base/io/io.c | |
parent | f65983c2c0810cfb933f696952325a81d2378987 (diff) | |
download | abc-320c429bc46728c1faddfc561c166810aa134a04.tar.gz abc-320c429bc46728c1faddfc561c166810aa134a04.tar.bz2 abc-320c429bc46728c1faddfc561c166810aa134a04.zip |
Version abc80301
Diffstat (limited to 'src/base/io/io.c')
-rw-r--r-- | src/base/io/io.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src/base/io/io.c b/src/base/io/io.c index fe88a285..628ef2b9 100644 --- a/src/base/io/io.c +++ b/src/base/io/io.c @@ -722,14 +722,19 @@ int IoCommandReadPla( Abc_Frame_t * pAbc, int argc, char ** argv ) Abc_Ntk_t * pNtk; char * pFileName; int fCheck; + int fZeros; int c; + fZeros = 0; fCheck = 1; Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "ch" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "zch" ) ) != EOF ) { switch ( c ) { + case 'z': + fZeros ^= 1; + break; case 'c': fCheck ^= 1; break; @@ -744,7 +749,20 @@ int IoCommandReadPla( Abc_Frame_t * pAbc, int argc, char ** argv ) // get the input file name pFileName = argv[globalUtilOptind]; // read the file using the corresponding file reader - pNtk = Io_Read( pFileName, IO_FILE_PLA, fCheck ); + if ( fZeros ) + { + Abc_Ntk_t * pTemp; + pNtk = Io_ReadPla( pFileName, fZeros, fCheck ); + if ( pNtk == NULL ) + { + printf( "Reading PLA file has failed.\n" ); + return 1; + } + pNtk = Abc_NtkToLogic( pTemp = pNtk ); + Abc_NtkDelete( pTemp ); + } + else + pNtk = Io_Read( pFileName, IO_FILE_PLA, fCheck ); if ( pNtk == NULL ) return 1; // replace the current network @@ -752,8 +770,9 @@ int IoCommandReadPla( Abc_Frame_t * pAbc, int argc, char ** argv ) return 0; usage: - fprintf( pAbc->Err, "usage: read_pla [-ch] <file>\n" ); + fprintf( pAbc->Err, "usage: read_pla [-zch] <file>\n" ); fprintf( pAbc->Err, "\t read the network in PLA\n" ); + fprintf( pAbc->Err, "\t-z : toggle reading on-set and off-set [default = %s]\n", fZeros? "off-set":"on-set" ); fprintf( pAbc->Err, "\t-c : toggle network check after reading [default = %s]\n", fCheck? "yes":"no" ); fprintf( pAbc->Err, "\t-h : prints the command summary\n" ); fprintf( pAbc->Err, "\tfile : the name of a file to read\n" ); |