diff options
-rw-r--r-- | src/base/main/main.h | 1 | ||||
-rw-r--r-- | src/base/main/mainFrame.c | 1 | ||||
-rw-r--r-- | src/python/pyabc.i | 32 |
3 files changed, 34 insertions, 0 deletions
diff --git a/src/base/main/main.h b/src/base/main/main.h index da9032d1..7d9b7292 100644 --- a/src/base/main/main.h +++ b/src/base/main/main.h @@ -116,6 +116,7 @@ extern ABC_DLL int Abc_FrameReadBmcFrames( Abc_Frame_t * p ); extern ABC_DLL int Abc_FrameReadProbStatus( Abc_Frame_t * p ); extern ABC_DLL Abc_Cex_t * Abc_FrameReadCex( Abc_Frame_t * p ); extern ABC_DLL Vec_Ptr_t * Abc_FrameReadCexVec( Abc_Frame_t * p ); +extern ABC_DLL Vec_Int_t * Abc_FrameReadStatusVec( Abc_Frame_t * p ); extern ABC_DLL Vec_Ptr_t * Abc_FrameReadPoEquivs( Abc_Frame_t * p ); extern ABC_DLL Vec_Int_t * Abc_FrameReadPoStatuses( Abc_Frame_t * p ); extern ABC_DLL Vec_Int_t * Abc_FrameReadObjIds( Abc_Frame_t * p ); diff --git a/src/base/main/mainFrame.c b/src/base/main/mainFrame.c index 63509a44..ee4b665e 100644 --- a/src/base/main/mainFrame.c +++ b/src/base/main/mainFrame.c @@ -65,6 +65,7 @@ int Abc_FrameReadBmcFrames( Abc_Frame_t * p ) { return s_GlobalFr int Abc_FrameReadProbStatus( Abc_Frame_t * p ) { return s_GlobalFrame->Status; } Abc_Cex_t * Abc_FrameReadCex( Abc_Frame_t * p ) { return s_GlobalFrame->pCex; } Vec_Ptr_t * Abc_FrameReadCexVec( Abc_Frame_t * p ) { return s_GlobalFrame->vCexVec; } +Vec_Int_t * Abc_FrameReadStatusVec( Abc_Frame_t * p ) { return s_GlobalFrame->vStatuses; } Vec_Ptr_t * Abc_FrameReadPoEquivs( Abc_Frame_t * p ) { return s_GlobalFrame->vPoEquivs; } Vec_Int_t * Abc_FrameReadPoStatuses( Abc_Frame_t * p ) { return s_GlobalFrame->vStatuses; } Vec_Int_t * Abc_FrameReadObjIds( Abc_Frame_t * p ) { return s_GlobalFrame->vAbcObjIds; } diff --git a/src/python/pyabc.i b/src/python/pyabc.i index 23a37eec..fa55eb06 100644 --- a/src/python/pyabc.i +++ b/src/python/pyabc.i @@ -247,6 +247,32 @@ Abc_Cex_t* _cex_get_vec(int i) return Abc_CexDup( pCex, -1 ); } +int _status_get_vec_len() +{ + Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame(); + Vec_Int_t* vStatusVec = Abc_FrameReadStatusVec(pAbc); + + if( ! vStatusVec ) + { + return 0; + } + + return Vec_IntSize(vStatusVec); +} + +int _status_get_vec(int i) +{ + Abc_Frame_t* pAbc = Abc_FrameGetGlobalFrame(); + Vec_Int_t* vStatusVec = Abc_FrameReadStatusVec(pAbc); + + if( ! vStatusVec ) + { + return NULL; + } + + return Vec_IntEntry( vStatusVec, i ); +} + void _cex_put(Abc_Cex_t* pCex) { if ( pCex ) @@ -649,6 +675,8 @@ int is_const_po( int iPoNum ); Abc_Cex_t* _cex_get(); int _cex_get_vec_len(); Abc_Cex_t* _cex_get_vec(int i); +int _status_get_vec_len(); +int _status_get_vec(int i); void _cex_put(Abc_Cex_t* pCex); void _cex_free(Abc_Cex_t* pCex); int _cex_n_regs(Abc_Cex_t* pCex); @@ -711,6 +739,10 @@ def cex_get_vector(): return [ _Cex(_cex_get_vec(i)) for i in xrange(_cex_get_vec_len()) ] +def status_get_vector(): + + return [ _Cex(_status_get_vec(i)) for i in xrange(_status_get_vec_len()) ] + def cex_get(): return _Cex( _cex_get() ) |