diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2011-01-13 12:38:59 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2011-01-13 12:38:59 -0800 |
commit | ae4b51351c93983a1285ce1028e3bbd90a6d5721 (patch) | |
tree | b06797a1771bb1c79124f2ac7d57f1a54c9afc34 /src/base/io/ioReadPla.c | |
parent | f4066b5be3b5473f5c64ab71d1983df6ca7aec76 (diff) | |
download | abc-ae4b51351c93983a1285ce1028e3bbd90a6d5721.tar.gz abc-ae4b51351c93983a1285ce1028e3bbd90a6d5721.tar.bz2 abc-ae4b51351c93983a1285ce1028e3bbd90a6d5721.zip |
Cumulative changes in the last few weeks.
Diffstat (limited to 'src/base/io/ioReadPla.c')
-rw-r--r-- | src/base/io/ioReadPla.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/base/io/ioReadPla.c b/src/base/io/ioReadPla.c index 85029ce8..63ffa296 100644 --- a/src/base/io/ioReadPla.c +++ b/src/base/io/ioReadPla.c @@ -51,6 +51,7 @@ Abc_Ntk_t * Io_ReadPla( char * pFileName, int fZeros, int fCheck ) // start the file p = Extra_FileReaderAlloc( pFileName, "#", "\n\r", " \t|" ); +// p = Extra_FileReaderAlloc( pFileName, "", "\n\r", " \t|" ); if ( p == NULL ) return NULL; @@ -91,7 +92,7 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros ) int nInputs = -1, nOutputs = -1, nProducts = -1; char * pCubeIn, * pCubeOut; int i, k, iLine, nDigits, nCubes; - + // allocate the empty network pNtk = Abc_NtkStartRead( Extra_FileReaderGetFileName(p) ); @@ -103,9 +104,17 @@ Abc_Ntk_t * Io_ReadPlaNetwork( Extra_FileReader_t * p, int fZeros ) Extra_ProgressBarUpdate( pProgress, Extra_FileReaderGetCurPosition(p), NULL ); // if it is the end of file, quit the loop - if ( strcmp( (char *)vTokens->pArray[0], ".e" ) == 0 ) + if ( strncmp( (char *)vTokens->pArray[0], ".e", 2 ) == 0 ) break; + // if it is the model name, get the name + if ( strcmp( (char *)vTokens->pArray[0], ".model" ) == 0 ) + { + ABC_FREE( pNtk->pName ); + pNtk->pName = Extra_UtilStrsav( (char *)vTokens->pArray[1] ); + continue; + } + if ( vTokens->nSize == 1 ) { printf( "%s (line %d): Wrong number of token.\n", |