summaryrefslogtreecommitdiffstats
path: root/src/base/abci
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-06-04 17:31:15 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2016-06-04 17:31:15 -0700
commit00242f2fb229ac13b61e2e280d44603d5191d235 (patch)
treec6760966fc750d85d745a59112a5854280eb01a7 /src/base/abci
parent93c785e80250f4e7f4637d3d9317a5cf2e278b69 (diff)
downloadabc-00242f2fb229ac13b61e2e280d44603d5191d235.tar.gz
abc-00242f2fb229ac13b61e2e280d44603d5191d235.tar.bz2
abc-00242f2fb229ac13b61e2e280d44603d5191d235.zip
New profiling features for word-level optimizations.
Diffstat (limited to 'src/base/abci')
-rw-r--r--src/base/abci/abc.c22
-rw-r--r--src/base/abci/abcPrint.c40
2 files changed, 59 insertions, 3 deletions
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 );
+}
+