summaryrefslogtreecommitdiffstats
path: root/src/aig/gia
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-11-21 12:01:26 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2014-11-21 12:01:26 -0800
commitdf83fb5e0470cb54eb75dee47d629ee7b276b88c (patch)
tree789c69467bf03c7438b8cdf9c6f037d43c5b81ab /src/aig/gia
parentcf2f9364c52110bf0c2132f1c3d68fde55abf081 (diff)
downloadabc-df83fb5e0470cb54eb75dee47d629ee7b276b88c.tar.gz
abc-df83fb5e0470cb54eb75dee47d629ee7b276b88c.tar.bz2
abc-df83fb5e0470cb54eb75dee47d629ee7b276b88c.zip
Fix in reading flop classes.
Diffstat (limited to 'src/aig/gia')
-rw-r--r--src/aig/gia/giaAiger.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/aig/gia/giaAiger.c b/src/aig/gia/giaAiger.c
index 645f0585..1f6ba03b 100644
--- a/src/aig/gia/giaAiger.c
+++ b/src/aig/gia/giaAiger.c
@@ -655,11 +655,12 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
// read register classes
else if ( *pCur == 'r' )
{
- int nRegs;
+ int i, nRegs;
pCur++;
- nRegs = Gia_AigerReadInt(pCur); pCur += 4;
- pNew->vRegClasses = Vec_IntStart( nRegs );
- memcpy(Vec_IntArray(pNew->vRegClasses), pCur, 4*nRegs); pCur += 4*nRegs;
+ nRegs = Gia_AigerReadInt(pCur)/4; pCur += 4;
+ pNew->vRegClasses = Vec_IntAlloc( nRegs );
+ for ( i = 0; i < nRegs; i++ )
+ Vec_IntPush( pNew->vRegClasses, Gia_AigerReadInt(pCur) ), pCur += 4;
if ( fVerbose ) printf( "Finished reading extension \"r\".\n" );
}
// read choices
@@ -1252,9 +1253,11 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int
// write register classes
if ( p->vRegClasses )
{
+ int i;
fprintf( pFile, "r" );
- Gia_FileWriteBufferSize( pFile, Vec_IntSize(p->vRegClasses) );
- fwrite( Vec_IntArray(p->vRegClasses), 1, 4*Vec_IntSize(p->vRegClasses), pFile );
+ Gia_FileWriteBufferSize( pFile, 4*Vec_IntSize(p->vRegClasses) );
+ for ( i = 0; i < Vec_IntSize(p->vRegClasses); i++ )
+ Gia_FileWriteBufferSize( pFile, Vec_IntEntry(p->vRegClasses, i) );
}
// write choices
if ( Gia_ManHasChoices(p) )