diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-01-15 20:47:58 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-01-15 20:47:58 -0800 |
commit | 10478a9cbf37432cb70e8b1ae58d79375d72c5c8 (patch) | |
tree | 5f48c83c2fc1e5cd0f1d9b1aaccd90bc73762ede /src/aig/gia/giaAiger.c | |
parent | bb4897aba6f88bbcccddcebc4389ed46d226e873 (diff) | |
download | abc-10478a9cbf37432cb70e8b1ae58d79375d72c5c8.tar.gz abc-10478a9cbf37432cb70e8b1ae58d79375d72c5c8.tar.bz2 abc-10478a9cbf37432cb70e8b1ae58d79375d72c5c8.zip |
Variable timeframe abstraction.
Diffstat (limited to 'src/aig/gia/giaAiger.c')
-rw-r--r-- | src/aig/gia/giaAiger.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/src/aig/gia/giaAiger.c b/src/aig/gia/giaAiger.c index ea3fa2ef..db194c69 100644 --- a/src/aig/gia/giaAiger.c +++ b/src/aig/gia/giaAiger.c @@ -567,6 +567,14 @@ Gia_Man_t * Gia_ReadAiger2( char * pFileName, int fCheck ) pNew->vGateClasses = Vec_IntStart( Gia_ManObjNum(pNew) ); Gia_ReadFlopClasses( &pCur, pNew->vGateClasses, Gia_ManObjNum(pNew) ); } + if ( *pCur == 'v' ) + { + pCur++; + // read object classes + pNew->vObjClasses = Vec_IntStart( Gia_ReadInt(pCur)/4 ); pCur += 4; + memcpy( Vec_IntArray(pNew->vObjClasses), pCur, 4*Vec_IntSize(pNew->vObjClasses) ); + pCur += 4*Vec_IntSize(pNew->vObjClasses); + } if ( *pCur == 'm' ) { pCur++; @@ -618,7 +626,6 @@ Gia_Man_t * Gia_ReadAiger2( char * pFileName, int fCheck ) return pNew; } - /**Function************************************************************* Synopsis [Reads the AIG in the binary AIGER format.] @@ -833,6 +840,14 @@ Gia_Man_t * Gia_ReadAigerFromMemory( char * pContents, int nFileSize, int fCheck pNew->vGateClasses = Vec_IntStart( Gia_ManObjNum(pNew) ); Gia_ReadFlopClasses( &pCur, pNew->vGateClasses, Gia_ManObjNum(pNew) ); } + if ( *pCur == 'v' ) + { + pCur++; + // read object classes + pNew->vObjClasses = Vec_IntStart( Gia_ReadInt(pCur)/4 ); pCur += 4; + memcpy( Vec_IntArray(pNew->vObjClasses), pCur, 4*Vec_IntSize(pNew->vObjClasses) ); + pCur += 4*Vec_IntSize(pNew->vObjClasses); + } if ( *pCur == 'm' ) { pCur++; @@ -1024,14 +1039,26 @@ Gia_Man_t * Gia_ReadAigerFromMemory( char * pContents, int nFileSize, int fCheck } { - Vec_Int_t * vFlopMap, * vGateMap; + Vec_Int_t * vFlopMap, * vGateMap, * vObjMap; vFlopMap = pNew->vFlopClasses; pNew->vFlopClasses = NULL; vGateMap = pNew->vGateClasses; pNew->vGateClasses = NULL; + vObjMap = pNew->vObjClasses; pNew->vObjClasses = NULL; pNew = Gia_ManCleanup( pTemp = pNew ); Gia_ManStop( pTemp ); pNew->vFlopClasses = vFlopMap; pNew->vGateClasses = vGateMap; + pNew->vObjClasses = vObjMap; + } +/* + { + extern Vec_Int_t * Vta_ManFramesToAbs( Vec_Vec_t * vFrames ); + extern Vec_Ptr_t * Vta_ManAbsToFrames( Vec_Int_t * vAbs ); + Vec_Vec_t * vAbs = (Vec_Vec_t *)Gia_ManUnrollAbs( pNew ); + assert( pNew->vObjClasses == NULL ); + pNew->vObjClasses = Vta_ManFramesToAbs( vAbs ); + Vec_VecFree( vAbs ); } +*/ return pNew; } @@ -1461,6 +1488,16 @@ void Gia_WriteAiger( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int fwrite( Buffer, 1, 4, pFile ); fwrite( Vec_IntArray(p->vGateClasses), 1, nSize, pFile ); } + // write object classes + if ( p->vObjClasses ) + { + unsigned char Buffer[10]; + int nSize = 4*Vec_IntSize(p->vObjClasses); + Gia_WriteInt( Buffer, nSize ); + fprintf( pFile, "v" ); + fwrite( Buffer, 1, 4, pFile ); + fwrite( Vec_IntArray(p->vObjClasses), 1, nSize, pFile ); + } // write mapping if ( p->pMapping ) { |