diff options
Diffstat (limited to 'src/base/main')
-rw-r--r-- | src/base/main/main.h | 3 | ||||
-rw-r--r-- | src/base/main/mainFrame.c | 34 |
2 files changed, 35 insertions, 2 deletions
diff --git a/src/base/main/main.h b/src/base/main/main.h index 6fc2c356..7f2d11bf 100644 --- a/src/base/main/main.h +++ b/src/base/main/main.h @@ -133,11 +133,10 @@ extern ABC_DLL void Abc_FrameSetCex( Abc_Cex_t * pCex ); extern ABC_DLL void Abc_FrameSetNFrames( int nFrames ); extern ABC_DLL void Abc_FrameSetStatus( int Status ); +extern ABC_DLL int Abc_FrameCheckPoConst( Abc_Frame_t * p, int iPoNum ); ABC_NAMESPACE_HEADER_END - - #endif //////////////////////////////////////////////////////////////////////// diff --git a/src/base/main/mainFrame.c b/src/base/main/mainFrame.c index df1b385e..8c3344ff 100644 --- a/src/base/main/mainFrame.c +++ b/src/base/main/mainFrame.c @@ -648,6 +648,40 @@ void Abc_FrameSetSave2( void * pAig ) void * Abc_FrameReadSave1() { void * pAig = Abc_FrameGetGlobalFrame()->pSave1; Abc_FrameGetGlobalFrame()->pSave1 = NULL; return pAig; } void * Abc_FrameReadSave2() { void * pAig = Abc_FrameGetGlobalFrame()->pSave2; Abc_FrameGetGlobalFrame()->pSave2 = NULL; return pAig; } +/**Function************************************************************* + + Synopsis [Returns 0/1 if pNtkCur is an AIG and PO is 0/1; -1 otherwise.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Abc_FrameCheckPoConst( Abc_Frame_t * p, int iPoNum ) +{ + Abc_Obj_t * pObj; + if ( p->pNtkCur == NULL ) + return -1; + if ( !Abc_NtkIsStrash(p->pNtkCur) ) + return -1; + if ( iPoNum < 0 || iPoNum >= Abc_NtkPoNum(p->pNtkCur) ) + return -1; + pObj = Abc_NtkPo( p->pNtkCur, iPoNum ); + if ( !Abc_AigNodeIsConst(Abc_ObjFanin0(pObj)) ) + return -1; + return !Abc_ObjFaninC0(pObj); +} +void Abc_FrameCheckPoConstTest( Abc_Frame_t * p ) +{ + Abc_Obj_t * pObj; + int i; + Abc_NtkForEachPo( p->pNtkCur, pObj, i ) + printf( "%d = %d\n", i, Abc_FrameCheckPoConst(p, i) ); +} + + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// |