Commit f0d961c8 by Alan Mishchenko

Unifification of custom extensions.

parent 72d11512
...@@ -531,7 +531,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS ...@@ -531,7 +531,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
{ {
extern Gia_Rpr_t * Gia_AigerReadEquivClasses( unsigned char ** ppPos, int nSize ); extern Gia_Rpr_t * Gia_AigerReadEquivClasses( unsigned char ** ppPos, int nSize );
pCur++; pCur++;
// pCurTemp = pCur + Gia_AigerReadInt(pCur); pCur += 4; // pCurTemp = pCur + Gia_AigerReadInt(pCur) + 4; pCur += 4;
pNew->pReprs = Gia_AigerReadEquivClasses( &pCur, Gia_ManObjNum(pNew) ); pNew->pReprs = Gia_AigerReadEquivClasses( &pCur, Gia_ManObjNum(pNew) );
pNew->pNexts = Gia_ManDeriveNexts( pNew ); pNew->pNexts = Gia_ManDeriveNexts( pNew );
// assert( pCur == pCurTemp ); // assert( pCur == pCurTemp );
...@@ -567,7 +567,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS ...@@ -567,7 +567,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
{ {
extern Vec_Int_t * Gia_AigerReadPacking( unsigned char ** ppPos, int nSize ); extern Vec_Int_t * Gia_AigerReadPacking( unsigned char ** ppPos, int nSize );
pCur++; pCur++;
pCurTemp = pCur + Gia_AigerReadInt(pCur); pCur += 4; pCurTemp = pCur + Gia_AigerReadInt(pCur) + 4; pCur += 4;
pNew->vPacking = Gia_AigerReadPacking( &pCur, pCurTemp - pCur ); pNew->vPacking = Gia_AigerReadPacking( &pCur, pCurTemp - pCur );
assert( pCur == pCurTemp ); assert( pCur == pCurTemp );
} }
...@@ -576,7 +576,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS ...@@ -576,7 +576,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
{ {
extern int * Gia_AigerReadMapping( unsigned char ** ppPos, int nSize ); extern int * Gia_AigerReadMapping( unsigned char ** ppPos, int nSize );
pCur++; pCur++;
pCurTemp = pCur + Gia_AigerReadInt(pCur); pCur += 4; pCurTemp = pCur + Gia_AigerReadInt(pCur) + 4; pCur += 4;
pNew->pMapping = Gia_AigerReadMapping( &pCur, Gia_ManObjNum(pNew) ); pNew->pMapping = Gia_AigerReadMapping( &pCur, Gia_ManObjNum(pNew) );
assert( pCur == pCurTemp ); assert( pCur == pCurTemp );
} }
...@@ -590,7 +590,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS ...@@ -590,7 +590,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
} }
else else
{ {
pCurTemp = pCur + Gia_AigerReadInt(pCur); pCur += 4; pCurTemp = pCur + Gia_AigerReadInt(pCur) + 4; pCur += 4;
ABC_FREE( pNew->pName ); ABC_FREE( pNew->pName );
pNew->pName = Abc_UtilStrsav( (char *)pCur ); pCur += strlen(pNew->pName) + 1; pNew->pName = Abc_UtilStrsav( (char *)pCur ); pCur += strlen(pNew->pName) + 1;
assert( pCur == pCurTemp ); assert( pCur == pCurTemp );
...@@ -601,7 +601,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS ...@@ -601,7 +601,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
{ {
Gia_Plc_t * pPlacement; Gia_Plc_t * pPlacement;
pCur++; pCur++;
pCurTemp = pCur + Gia_AigerReadInt(pCur); pCur += 4; pCurTemp = pCur + Gia_AigerReadInt(pCur) + 4; pCur += 4;
pPlacement = ABC_ALLOC( Gia_Plc_t, Gia_ManObjNum(pNew) ); pPlacement = ABC_ALLOC( Gia_Plc_t, Gia_ManObjNum(pNew) );
memcpy( pPlacement, pCur, 4*Gia_ManObjNum(pNew) ); pCur += 4*Gia_ManObjNum(pNew); memcpy( pPlacement, pCur, 4*Gia_ManObjNum(pNew) ); pCur += 4*Gia_ManObjNum(pNew);
assert( pCur == pCurTemp ); assert( pCur == pCurTemp );
...@@ -611,7 +611,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS ...@@ -611,7 +611,7 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
{ {
unsigned char * pSwitching; unsigned char * pSwitching;
pCur++; pCur++;
pCurTemp = pCur + Gia_AigerReadInt(pCur); pCur += 4; pCurTemp = pCur + Gia_AigerReadInt(pCur) + 4; pCur += 4;
pSwitching = ABC_ALLOC( unsigned char, Gia_ManObjNum(pNew) ); pSwitching = ABC_ALLOC( unsigned char, Gia_ManObjNum(pNew) );
memcpy( pSwitching, pCur, Gia_ManObjNum(pNew) ); pCur += Gia_ManObjNum(pNew); memcpy( pSwitching, pCur, Gia_ManObjNum(pNew) ); pCur += Gia_ManObjNum(pNew);
assert( pCur == pCurTemp ); assert( pCur == pCurTemp );
...@@ -1098,14 +1098,6 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int ...@@ -1098,14 +1098,6 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int
fwrite( Vec_StrArray(vStrExt), 1, Vec_StrSize(vStrExt), pFile ); fwrite( Vec_StrArray(vStrExt), 1, Vec_StrSize(vStrExt), pFile );
Vec_StrFree( vStrExt ); Vec_StrFree( vStrExt );
} }
// write name
if ( p->pName )
{
fprintf( pFile, "n" );
Gia_FileWriteBufferSize( pFile, strlen(p->pName)+1 );
fwrite( p->pName, 1, strlen(p->pName), pFile );
fprintf( pFile, "\0" );
}
// write placement // write placement
if ( p->pPlacement ) if ( p->pPlacement )
{ {
...@@ -1137,6 +1129,14 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int ...@@ -1137,6 +1129,14 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int
assert( Vec_IntSize(p->vObjClasses) == Gia_ManObjNum(p) ); assert( Vec_IntSize(p->vObjClasses) == Gia_ManObjNum(p) );
fwrite( Vec_IntArray(p->vObjClasses), 1, 4*Gia_ManObjNum(p), pFile ); fwrite( Vec_IntArray(p->vObjClasses), 1, 4*Gia_ManObjNum(p), pFile );
} }
// write name
if ( p->pName )
{
fprintf( pFile, "n" );
Gia_FileWriteBufferSize( pFile, strlen(p->pName)+1 );
fwrite( p->pName, 1, strlen(p->pName), pFile );
fprintf( pFile, "%c", '\0' );
}
// write comments // write comments
fprintf( pFile, "\nThis file was produced by the GIA package in ABC on %s\n", Gia_TimeStamp() ); fprintf( pFile, "\nThis file was produced by the GIA package in ABC on %s\n", Gia_TimeStamp() );
fprintf( pFile, "For information about AIGER format, refer to %s\n", "http://fmv.jku.at/aiger" ); fprintf( pFile, "For information about AIGER format, refer to %s\n", "http://fmv.jku.at/aiger" );
......
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