diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2015-10-04 09:51:57 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2015-10-04 09:51:57 -0700 |
commit | 26dc25b7f5e23689636b4d89b98281e821cf7fe8 (patch) | |
tree | ff4e262b60ac139762f75925f22dde402cb17a2b /src/aig/gia/giaAiger.c | |
parent | 7d9e3c2ffe131098a48e493eb9890c551144200b (diff) | |
download | abc-26dc25b7f5e23689636b4d89b98281e821cf7fe8.tar.gz abc-26dc25b7f5e23689636b4d89b98281e821cf7fe8.tar.bz2 abc-26dc25b7f5e23689636b4d89b98281e821cf7fe8.zip |
Adding support for flop init-states in extended AIG.
Diffstat (limited to 'src/aig/gia/giaAiger.c')
-rw-r--r-- | src/aig/gia/giaAiger.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/aig/gia/giaAiger.c b/src/aig/gia/giaAiger.c index 7ceff2fb..fb7717b4 100644 --- a/src/aig/gia/giaAiger.c +++ b/src/aig/gia/giaAiger.c @@ -671,6 +671,19 @@ Gia_Man_t * Gia_AigerReadFromMemory( char * pContents, int nFileSize, int fSkipS assert( pCur == pCurTemp ); if ( fVerbose ) printf( "Finished reading extension \"r\".\n" ); } + // read register inits + else if ( *pCur == 's' ) + { + int i, nRegs; + pCur++; + pCurTemp = pCur + Gia_AigerReadInt(pCur) + 4; pCur += 4; + nRegs = Gia_AigerReadInt(pCur); pCur += 4; + pNew->vRegInits = Vec_IntAlloc( nRegs ); + for ( i = 0; i < nRegs; i++ ) + Vec_IntPush( pNew->vRegInits, Gia_AigerReadInt(pCur) ), pCur += 4; + assert( pCur == pCurTemp ); + if ( fVerbose ) printf( "Finished reading extension \"s\".\n" ); + } // read configuration data else if ( *pCur == 'b' ) { @@ -1285,6 +1298,16 @@ void Gia_AigerWrite( Gia_Man_t * pInit, char * pFileName, int fWriteSymbols, int for ( i = 0; i < Vec_IntSize(p->vRegClasses); i++ ) Gia_FileWriteBufferSize( pFile, Vec_IntEntry(p->vRegClasses, i) ); } + // write register inits + if ( p->vRegInits ) + { + int i; + fprintf( pFile, "s" ); + Gia_FileWriteBufferSize( pFile, 4*(Vec_IntSize(p->vRegInits)+1) ); + Gia_FileWriteBufferSize( pFile, Vec_IntSize(p->vRegInits) ); + for ( i = 0; i < Vec_IntSize(p->vRegInits); i++ ) + Gia_FileWriteBufferSize( pFile, Vec_IntEntry(p->vRegInits, i) ); + } // write configuration data if ( p->vConfigs ) { |