summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-12-03 00:38:37 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2013-12-03 00:38:37 -0800
commit681483c9040dca151e2405949a8bf3c921d34175 (patch)
treeea8d313fe08a8ed757c649d5648e6e255b968667
parent34ab59574ee4feedfd1ffb618e2e71a6a1964a6a (diff)
downloadabc-681483c9040dca151e2405949a8bf3c921d34175.tar.gz
abc-681483c9040dca151e2405949a8bf3c921d34175.tar.bz2
abc-681483c9040dca151e2405949a8bf3c921d34175.zip
Bug fixes in the above patches.
-rw-r--r--src/aig/ioa/ioaWriteAig.c5
-rw-r--r--src/base/io/ioWriteAiger.c8
2 files changed, 7 insertions, 6 deletions
diff --git a/src/aig/ioa/ioaWriteAig.c b/src/aig/ioa/ioaWriteAig.c
index bb0653b9..92e5b335 100644
--- a/src/aig/ioa/ioaWriteAig.c
+++ b/src/aig/ioa/ioaWriteAig.c
@@ -563,6 +563,7 @@ void Ioa_WriteAiger( Aig_Man_t * pMan, char * pFileName, int fWriteSymbols, int
// write the symbol table
if ( fWriteSymbols )
{
+ int bads;
// write PIs
Aig_ManForEachPiSeq( pMan, pObj, i )
fprintf( pFile, "i%d %s\n", i, Aig_ObjName(pObj) );
@@ -570,11 +571,11 @@ void Ioa_WriteAiger( Aig_Man_t * pMan, char * pFileName, int fWriteSymbols, int
Aig_ManForEachLoSeq( pMan, pObj, i )
fprintf( pFile, "l%d %s\n", i, Aig_ObjName(Aig_ObjFanout0(pObj)) );
// write POs
- int bads = Aig_ManCoNum(pMan) - Aig_ManRegNum(pMan) - Aig_ManConstrNum(pMan);
+ bads = Aig_ManCoNum(pMan) - Aig_ManRegNum(pMan) - Aig_ManConstrNum(pMan);
Aig_ManForEachPoSeq( pMan, pObj, i )
if ( !Aig_ManConstrNum(pMan) )
fprintf( pFile, "o%d %s\n", i, Aig_ObjName(pObj) );
- else ( i < bads )
+ else if ( i < bads )
fprintf( pFile, "b%d %s\n", i, Aig_ObjName(pObj) );
else
fprintf( pFile, "c%d %s\n", i - bads, Aig_ObjName(pObj) );
diff --git a/src/base/io/ioWriteAiger.c b/src/base/io/ioWriteAiger.c
index 20689405..74bde820 100644
--- a/src/base/io/ioWriteAiger.c
+++ b/src/base/io/ioWriteAiger.c
@@ -549,11 +549,11 @@ void Io_WriteAigerGz( Abc_Ntk_t * pNtk, char * pFileName, int fWriteSymbols )
// write POs
Abc_NtkForEachPo( pNtk, pObj, i )
if ( !fExtended )
- gzprintf( pFile, "o%d %s\n", i, Aig_ObjName(pObj) );
- else ( i < Abc_NtkPoNum(pNtk) - Abc_NtkConstrNum(pNtk) )
- gzprintf( pFile, "b%d %s\n", i, Aig_ObjName(pObj) );
+ gzprintf( pFile, "o%d %s\n", i, Abc_ObjName(pObj) );
+ else if ( i < Abc_NtkPoNum(pNtk) - Abc_NtkConstrNum(pNtk) )
+ gzprintf( pFile, "b%d %s\n", i, Abc_ObjName(pObj) );
else
- gzprintf( pFile, "c%d %s\n", i - (Abc_NtkPoNum(pNtk) - Abc_NtkConstrNum(pNtk)), Aig_ObjName(pObj) );
+ gzprintf( pFile, "c%d %s\n", i - (Abc_NtkPoNum(pNtk) - Abc_NtkConstrNum(pNtk)), Abc_ObjName(pObj) );
}
// write the comment