diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2014-11-21 10:01:45 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2014-11-21 10:01:45 -0800 |
commit | 2fca2b2b16a56437d7ed85bd745b3d6ac94ab7dd (patch) | |
tree | ba9d394adefe6a32d35f9e9b41ab9d0bb1a83951 /src/aig/gia/giaAiger.c | |
parent | 9e6d74bc1599099f283c75089ba3f44f25a7c692 (diff) | |
download | abc-2fca2b2b16a56437d7ed85bd745b3d6ac94ab7dd.tar.gz abc-2fca2b2b16a56437d7ed85bd745b3d6ac94ab7dd.tar.bz2 abc-2fca2b2b16a56437d7ed85bd745b3d6ac94ab7dd.zip |
Fix in reading flop classes.
Diffstat (limited to 'src/aig/gia/giaAiger.c')
-rw-r--r-- | src/aig/gia/giaAiger.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/aig/gia/giaAiger.c b/src/aig/gia/giaAiger.c index 14bd1221..adaecb0f 100644 --- a/src/aig/gia/giaAiger.c +++ b/src/aig/gia/giaAiger.c @@ -571,10 +571,12 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS // read flop classes else if ( *pCur == 'f' ) { + int nFlops; pCur++; - assert( Gia_AigerReadInt(pCur) == 4*Gia_ManRegNum(pNew) ); pCur += 4; - pNew->vFlopClasses = Vec_IntStart( Gia_ManRegNum(pNew) ); - memcpy( Vec_IntArray(pNew->vFlopClasses), pCur, 4*Gia_ManRegNum(pNew) ); pCur += 4*Gia_ManRegNum(pNew); + nFlops = Gia_AigerReadInt(pCur); pCur += 4; + //assert( Gia_AigerReadInt(pCur) == 4*Gia_ManRegNum(pNew) ); pCur += 4; + pNew->vFlopClasses = Vec_IntStart( nFlops ); + memcpy( Vec_IntArray(pNew->vFlopClasses), pCur, 4*nFlops ); pCur += 4*nFlops; if ( fVerbose ) printf( "Finished reading extension \"f\".\n" ); } // read gate classes @@ -1186,9 +1188,9 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int if ( p->vFlopClasses ) { fprintf( pFile, "f" ); - Gia_FileWriteBufferSize( pFile, 4*Gia_ManRegNum(p) ); - assert( Vec_IntSize(p->vFlopClasses) == Gia_ManRegNum(p) ); - fwrite( Vec_IntArray(p->vFlopClasses), 1, 4*Gia_ManRegNum(p), pFile ); + Gia_FileWriteBufferSize( pFile, 4*Vec_IntSize(p->vFlopClasses) ); + //assert( Vec_IntSize(p->vFlopClasses) == Gia_ManRegNum(p) ); + fwrite( Vec_IntArray(p->vFlopClasses), 1, 4*Vec_IntSize(p->vFlopClasses), pFile ); } // write gate classes if ( p->vGateClasses ) |