summaryrefslogtreecommitdiffstats
path: root/src/base/io/io.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-03-18 10:18:46 +0700
committerAlan Mishchenko <alanmi@berkeley.edu>2015-03-18 10:18:46 +0700
commitfb5d4a664dc3790e98036a94734a33a848fd3666 (patch)
tree29497d3dd6d38b8e0ec0fff62a7374232680f216 /src/base/io/io.c
parent120a30c2e4d8bd0455c706a5b1664aaaf82e4c74 (diff)
downloadabc-fb5d4a664dc3790e98036a94734a33a848fd3666.tar.gz
abc-fb5d4a664dc3790e98036a94734a33a848fd3666.tar.bz2
abc-fb5d4a664dc3790e98036a94734a33a848fd3666.zip
Adding switch '-b' in 'read_pla'.
Diffstat (limited to 'src/base/io/io.c')
-rw-r--r--src/base/io/io.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/base/io/io.c b/src/base/io/io.c
index 41b08e68..83ffaf53 100644
--- a/src/base/io/io.c
+++ b/src/base/io/io.c
@@ -903,20 +903,19 @@ int IoCommandReadPla( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Abc_Ntk_t * pNtk;
char * pFileName;
- int fCheck;
- int fZeros;
- int c;
+ int c, fZeros = 0, fBoth = 0, fCheck = 1;
- fZeros = 0;
- fCheck = 1;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "zch" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "zbch" ) ) != EOF )
{
switch ( c )
{
case 'z':
fZeros ^= 1;
break;
+ case 'b':
+ fBoth ^= 1;
+ break;
case 'c':
fCheck ^= 1;
break;
@@ -931,10 +930,10 @@ 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
- if ( fZeros )
+ if ( fZeros || fBoth )
{
Abc_Ntk_t * pTemp;
- pNtk = Io_ReadPla( pFileName, fZeros, fCheck );
+ pNtk = Io_ReadPla( pFileName, fZeros, fBoth, fCheck );
if ( pNtk == NULL )
{
printf( "Reading PLA file has failed.\n" );
@@ -953,9 +952,10 @@ int IoCommandReadPla( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- fprintf( pAbc->Err, "usage: read_pla [-zch] <file>\n" );
+ fprintf( pAbc->Err, "usage: read_pla [-zbch] <file>\n" );
fprintf( pAbc->Err, "\t reads 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-b : toggle reading both on-set and off-set as on-set [default = %s]\n", fBoth? "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" );