summaryrefslogtreecommitdiffstats
path: root/src/base/io/io.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-06-22 23:04:43 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2015-06-22 23:04:43 -0700
commit70697f868a263930e971c062e5b46e64fbb1ee18 (patch)
tree7ecd062ec16b58d5a625fe3591589728f705814c /src/base/io/io.c
parentd5b0fdee741dbc64bcfe75c54420219a7cbeac1a (diff)
downloadabc-70697f868a263930e971c062e5b46e64fbb1ee18.tar.gz
abc-70697f868a263930e971c062e5b46e64fbb1ee18.tar.bz2
abc-70697f868a263930e971c062e5b46e64fbb1ee18.zip
Version abc90528
committer: Baruch Sterin <baruchs@gmail.com>
Diffstat (limited to 'src/base/io/io.c')
-rw-r--r--src/base/io/io.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/base/io/io.c b/src/base/io/io.c
index e29a3009..ecc6302f 100644
--- a/src/base/io/io.c
+++ b/src/base/io/io.c
@@ -2343,13 +2343,17 @@ int IoCommandWriteTruth( Abc_Frame_t * pAbc, int argc, char **argv )
char * pFileName;
FILE * pFile;
unsigned * pTruth;
+ int fReverse = 0;
int c;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "rh" ) ) != EOF )
{
switch ( c )
{
+ case 'r':
+ fReverse ^= 1;
+ break;
case 'h':
goto usage;
default:
@@ -2394,7 +2398,7 @@ int IoCommandWriteTruth( Abc_Frame_t * pAbc, int argc, char **argv )
// convert to logic
Abc_NtkToAig( pNtk );
vTruth = Vec_IntAlloc( 0 );
- pTruth = Hop_ManConvertAigToTruth( pNtk->pManFunc, pNode->pData, Abc_ObjFaninNum(pNode), vTruth, 0 );
+ pTruth = Hop_ManConvertAigToTruth( pNtk->pManFunc, pNode->pData, Abc_ObjFaninNum(pNode), vTruth, fReverse );
pFile = fopen( pFileName, "w" );
if ( pFile == NULL )
{
@@ -2408,8 +2412,9 @@ int IoCommandWriteTruth( Abc_Frame_t * pAbc, int argc, char **argv )
return 0;
usage:
- fprintf( pAbc->Err, "usage: write_truth [-h] <file>\n" );
+ fprintf( pAbc->Err, "usage: write_truth [-rh] <file>\n" );
fprintf( pAbc->Err, "\t writes truth table into a file\n" );
+ fprintf( pAbc->Err, "\t-r : toggle reversing bits in the truth table [default = %s]\n", fReverse? "yes":"no" );
fprintf( pAbc->Err, "\t-h : print the help massage\n" );
fprintf( pAbc->Err, "\tfile : the name of the file to write\n" );
return 1;