summaryrefslogtreecommitdiffstats
path: root/src/base/io/ioReadPla.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2008-03-01 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2008-03-01 08:01:00 -0800
commit320c429bc46728c1faddfc561c166810aa134a04 (patch)
treec773cc96431cd38ae35484dae7d7d17a79671ac2 /src/base/io/ioReadPla.c
parentf65983c2c0810cfb933f696952325a81d2378987 (diff)
downloadabc-320c429bc46728c1faddfc561c166810aa134a04.tar.gz
abc-320c429bc46728c1faddfc561c166810aa134a04.tar.bz2
abc-320c429bc46728c1faddfc561c166810aa134a04.zip
Version abc80301
Diffstat (limited to 'src/base/io/ioReadPla.c')
-rw-r--r--src/base/io/ioReadPla.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/base/io/ioReadPla.c b/src/base/io/ioReadPla.c
index fdfdb4f6..288c3704 100644
--- a/src/base/io/ioReadPla.c
+++ b/src/base/io/ioReadPla.c
@@ -24,7 +24,7 @@
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-static Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p );
+static Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros );
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -41,7 +41,7 @@ static Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p );
SeeAlso []
***********************************************************************/
-Abc_Ntk_t * Io_ReadPla( char * pFileName, int fCheck )
+Abc_Ntk_t * Io_ReadPla( char * pFileName, int fZeros, int fCheck )
{
Extra_FileReader_t * p;
Abc_Ntk_t * pNtk;
@@ -52,7 +52,7 @@ Abc_Ntk_t * Io_ReadPla( char * pFileName, int fCheck )
return NULL;
// read the network
- pNtk = Io_ReadPlaNetwork( p );
+ pNtk = Io_ReadPlaNetwork( p, fZeros );
Extra_FileReaderFree( p );
if ( pNtk == NULL )
return NULL;
@@ -77,7 +77,7 @@ Abc_Ntk_t * Io_ReadPla( char * pFileName, int fCheck )
SeeAlso []
***********************************************************************/
-Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p )
+Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros )
{
ProgressBar * pProgress;
Vec_Ptr_t * vTokens;
@@ -205,12 +205,26 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p )
Abc_NtkDelete( pNtk );
return NULL;
}
- for ( i = 0; i < nOutputs; i++ )
+ if ( fZeros )
{
- if ( pCubeOut[i] == '1' )
+ for ( i = 0; i < nOutputs; i++ )
+ {
+ if ( pCubeOut[i] == '0' )
+ {
+ Vec_StrAppend( ppSops[i], pCubeIn );
+ Vec_StrAppend( ppSops[i], " 1\n" );
+ }
+ }
+ }
+ else
+ {
+ for ( i = 0; i < nOutputs; i++ )
{
- Vec_StrAppend( ppSops[i], pCubeIn );
- Vec_StrAppend( ppSops[i], " 1\n" );
+ if ( pCubeOut[i] == '1' )
+ {
+ Vec_StrAppend( ppSops[i], pCubeIn );
+ Vec_StrAppend( ppSops[i], " 1\n" );
+ }
}
}
nCubes++;