summaryrefslogtreecommitdiffstats
path: root/src/aig/gia/giaAiger.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-02-06 19:36:05 +0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-02-06 19:36:05 +0700
commitf402293bcdb0aa5a247f8da64b03970a3f7026d3 (patch)
tree456624130cdb3146d48ae0c07257f10799230c16 /src/aig/gia/giaAiger.c
parent930369f36fedd58efd25a1ca2603fefc7034ff39 (diff)
downloadabc-f402293bcdb0aa5a247f8da64b03970a3f7026d3.tar.gz
abc-f402293bcdb0aa5a247f8da64b03970a3f7026d3.tar.bz2
abc-f402293bcdb0aa5a247f8da64b03970a3f7026d3.zip
Integration of timing manager.
Diffstat (limited to 'src/aig/gia/giaAiger.c')
-rw-r--r--src/aig/gia/giaAiger.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/aig/gia/giaAiger.c b/src/aig/gia/giaAiger.c
index 476a9d36..bc338db8 100644
--- a/src/aig/gia/giaAiger.c
+++ b/src/aig/gia/giaAiger.c
@@ -629,8 +629,28 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS
pPlacement = ABC_ALLOC( Gia_Plc_t, Gia_ManObjNum(pNew) );
memcpy( pPlacement, pCur, 4*Gia_ManObjNum(pNew) ); pCur += 4*Gia_ManObjNum(pNew);
assert( pCur == pCurTemp );
+ pNew->pPlacement = pPlacement;
if ( fVerbose ) printf( "Finished reading extension \"p\".\n" );
}
+ // read choices
+ else if ( *pCur == 'q' )
+ {
+ int i, nPairs, iRepr, iNode;
+ assert( pNew->pSibls == NULL );
+ pNew->pSibls = ABC_CALLOC( int, Gia_ManObjNum(pNew) );
+ pCur++;
+ pCurTemp = pCur + Gia_AigerReadInt(pCur) + 4; pCur += 4;
+ nPairs = Gia_AigerReadInt(pCur); pCur += 4;
+ for ( i = 0; i < nPairs; i++ )
+ {
+ iRepr = Gia_AigerReadInt(pCur); pCur += 4;
+ iNode = Gia_AigerReadInt(pCur); pCur += 4;
+ pNew->pSibls[iRepr] = iNode;
+ assert( iRepr > iNode );
+ }
+ assert( pCur == pCurTemp );
+ if ( fVerbose ) printf( "Finished reading extension \"q\".\n" );
+ }
// read switching activity
else if ( *pCur == 's' )
{
@@ -1170,6 +1190,24 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int
Gia_FileWriteBufferSize( pFile, 4*Gia_ManObjNum(p) );
fwrite( p->pPlacement, 1, 4*Gia_ManObjNum(p), pFile );
}
+ // write choices
+ if ( p->pSibls )
+ {
+ int i, nPairs = 0;
+ fprintf( pFile, "q" );
+ for ( i = 0; i < Gia_ManObjNum(p); i++ )
+ nPairs += (Gia_ObjSibl(p, i) > 0);
+ Gia_FileWriteBufferSize( pFile, 4*(nPairs * 2 + 1) );
+ Gia_FileWriteBufferSize( pFile, nPairs );
+ for ( i = 0; i < Gia_ManObjNum(p); i++ )
+ if ( Gia_ObjSibl(p, i) )
+ {
+ assert( i > Gia_ObjSibl(p, i) );
+ Gia_FileWriteBufferSize( pFile, i );
+ Gia_FileWriteBufferSize( pFile, Gia_ObjSibl(p, i) );
+ }
+ if ( fVerbose ) printf( "Finished writing extension \"q\".\n" );
+ }
// write switching activity
if ( p->pSwitching )
{