From 00242f2fb229ac13b61e2e280d44603d5191d235 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 4 Jun 2016 17:31:15 -0700 Subject: New profiling features for word-level optimizations. --- src/base/abci/abc.c | 22 +++++++++++++++++++--- src/base/abci/abcPrint.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 3 deletions(-) (limited to 'src/base/abci') diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 270101b7..befa1127 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -2626,13 +2626,18 @@ usage: ***********************************************************************/ int Abc_CommandPrintStatus( Abc_Frame_t * pAbc, int argc, char ** argv ) { - int c, fShort = 1; + extern void Abc_NtkPrintPoEquivs( Abc_Ntk_t * pNtk ); + Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); + int c, fOutStatus = 0, fShort = 1; // set defaults Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "sh" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "osh" ) ) != EOF ) { switch ( c ) { + case 'o': + fOutStatus ^= 1; + break; case 's': fShort ^= 1; break; @@ -2642,6 +2647,16 @@ int Abc_CommandPrintStatus( Abc_Frame_t * pAbc, int argc, char ** argv ) goto usage; } } + if ( fOutStatus ) + { + if ( pNtk == NULL ) + { + Abc_Print( -1, "Empty network.\n" ); + return 1; + } + Abc_NtkPrintPoEquivs( pNtk ); + return 0; + } Abc_Print( 1,"Status = %d Frames = %d ", pAbc->Status, pAbc->nFrames ); if ( pAbc->pCex == NULL && pAbc->vCexVec == NULL ) Abc_Print( 1,"Cex is not defined.\n" ); @@ -2691,8 +2706,9 @@ int Abc_CommandPrintStatus( Abc_Frame_t * pAbc, int argc, char ** argv ) return 0; usage: - Abc_Print( -2, "usage: print_status [-sh]\n" ); + Abc_Print( -2, "usage: print_status [-osh]\n" ); Abc_Print( -2, "\t prints verification status\n" ); + Abc_Print( -2, "\t-o : toggle printing output status [default = %s]\n", fOutStatus? "yes": "no" ); Abc_Print( -2, "\t-s : toggle using short print-out [default = %s]\n", fShort? "yes": "no" ); Abc_Print( -2, "\t-h : print the command usage\n"); return 1; diff --git a/src/base/abci/abcPrint.c b/src/base/abci/abcPrint.c index bbb4060b..40ce38b4 100644 --- a/src/base/abci/abcPrint.c +++ b/src/base/abci/abcPrint.c @@ -1695,6 +1695,46 @@ void Abc_NtkPrintMiter( Abc_Ntk_t * pNtk ) printf( "The first satisfiable output is number %d (%s).\n", iOut, Abc_ObjName( Abc_NtkPo(pNtk, iOut) ) ); } +/**Function************************************************************* + + Synopsis [Checks the status of the miter.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +void Abc_NtkPrintPoEquivs( Abc_Ntk_t * pNtk ) +{ + Abc_Obj_t * pObj, * pDriver, * pRepr; int i, iRepr; + Vec_Int_t * vMap = Vec_IntStartFull( Abc_NtkObjNumMax(pNtk) ); + Abc_NtkForEachPo( pNtk, pObj, i ) + { + pDriver = Abc_ObjFanin0(pObj); + if ( Abc_NtkIsStrash(pNtk) && pDriver == Abc_AigConst1(pNtk) ) + { + printf( "%s = Const%d\n", Abc_ObjName(pObj), !Abc_ObjFaninC0(pObj) ); + continue; + } + else if ( !Abc_NtkIsStrash(pNtk) && Abc_NodeIsConst(pDriver) ) + { + printf( "%s = Const%d\n", Abc_ObjName(pObj), Abc_NodeIsConst1(pDriver) ); + continue; + } + iRepr = Vec_IntEntry( vMap, Abc_ObjId(pDriver) ); + if ( iRepr == -1 ) + { + Vec_IntWriteEntry( vMap, Abc_ObjId(pDriver), i ); + continue; + } + pRepr = Abc_NtkCo(pNtk, iRepr); + printf( "%s = %s%s\n", Abc_ObjName(pObj), Abc_ObjFaninC0(pRepr) == Abc_ObjFaninC0(pObj) ? "" : "!", Abc_ObjName(pRepr) ); + } + Vec_IntFree( vMap ); +} + -- cgit v1.2.3