Commit df83fb5e by Alan Mishchenko

Fix in reading flop classes.

parent cf2f9364
......@@ -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) )
......
......@@ -332,13 +332,6 @@ box = array containing model name, instance name, followed by pairs of formal
*/
static inline int Abc_Ptr2Int( void * p ) { return (int)(ABC_PTRINT_T)p; }
static inline void * Abc_Int2Ptr( int i ) { return (void *)(ABC_PTRINT_T)i; }
static inline word Abc_Ptr2Wrd( void * p ) { return (word)(ABC_PTRUINT_T)p; }
static inline void * Abc_Wrd2Ptr( word i ) { return (void *)(ABC_PTRUINT_T)i; }
/**Function*************************************************************
Synopsis [Node type conversions.]
......
......@@ -269,6 +269,10 @@ static inline int Abc_LitRegular( int Lit ) { return Lit & ~01
static inline int Abc_Lit2LitV( int * pMap, int Lit ) { return Abc_Var2Lit( pMap[Abc_Lit2Var(Lit)], Abc_LitIsCompl(Lit) ); }
static inline int Abc_Lit2LitL( int * pMap, int Lit ) { return Abc_LitNotCond( pMap[Abc_Lit2Var(Lit)], Abc_LitIsCompl(Lit) ); }
static inline int Abc_Ptr2Int( void * p ) { return (int)(ABC_PTRINT_T)p; }
static inline void * Abc_Int2Ptr( int i ) { return (void *)(ABC_PTRINT_T)i; }
static inline word Abc_Ptr2Wrd( void * p ) { return (word)(ABC_PTRUINT_T)p; }
static inline void * Abc_Wrd2Ptr( word i ) { return (void *)(ABC_PTRUINT_T)i; }
// time counting
typedef ABC_INT64_T abctime;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment