From 112f797c731ac45b713efd87dd5956695b983ecd Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 11 Feb 2012 00:43:37 -0800 Subject: Added switch -f to 'print_io' to suppress printing flops. --- src/base/abc/abc.h | 2 +- src/base/abci/abc.c | 14 +++++++++----- src/base/abci/abcPrint.c | 5 ++++- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h index 97f8c369..99cf605a 100644 --- a/src/base/abc/abc.h +++ b/src/base/abc/abc.h @@ -750,7 +750,7 @@ extern ABC_DLL int Abc_NtkDontCareCompute( Odc_Man_t * p, Abc_Obj /*=== abcPrint.c ==========================================================*/ extern ABC_DLL float Abc_NtkMfsTotalSwitching( Abc_Ntk_t * pNtk ); extern ABC_DLL void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDumpResult, int fUseLutLib, int fPrintMuxes, int fPower, int fGlitch ); -extern ABC_DLL void Abc_NtkPrintIo( FILE * pFile, Abc_Ntk_t * pNtk ); +extern ABC_DLL void Abc_NtkPrintIo( FILE * pFile, Abc_Ntk_t * pNtk, int fPrintFlops ); extern ABC_DLL void Abc_NtkPrintLatch( FILE * pFile, Abc_Ntk_t * pNtk ); extern ABC_DLL void Abc_NtkPrintFanio( FILE * pFile, Abc_Ntk_t * pNtk ); extern ABC_DLL void Abc_NtkPrintFanioNew( FILE * pFile, Abc_Ntk_t * pNtk, int fMffc ); diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 8a95e252..477adf06 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -1088,14 +1088,17 @@ int Abc_CommandPrintIo( Abc_Frame_t * pAbc, int argc, char ** argv ) { Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); Abc_Obj_t * pNode; - int c; + int c, fPrintFlops = 1; // set defaults Extra_UtilGetoptReset(); - while ( ( c = Extra_UtilGetopt( argc, argv, "h" ) ) != EOF ) + while ( ( c = Extra_UtilGetopt( argc, argv, "fh" ) ) != EOF ) { switch ( c ) { + case 'f': + fPrintFlops ^= 1; + break; case 'h': goto usage; default: @@ -1127,12 +1130,13 @@ int Abc_CommandPrintIo( Abc_Frame_t * pAbc, int argc, char ** argv ) return 0; } // print the nodes - Abc_NtkPrintIo( stdout, pNtk ); + Abc_NtkPrintIo( stdout, pNtk, fPrintFlops ); return 0; usage: - Abc_Print( -2, "usage: print_io [-h] \n" ); - Abc_Print( -2, "\t prints the PIs/POs or fanins/fanouts of a node\n" ); + Abc_Print( -2, "usage: print_io [-fh] \n" ); + Abc_Print( -2, "\t prints the PIs/POs/flops or fanins/fanouts of a node\n" ); + Abc_Print( -2, "\t-f : toggles printing flops [default = %s]\n", fPrintFlops? "yes": "no" ); Abc_Print( -2, "\t-h : print the command usage\n"); Abc_Print( -2, "\tnode : the node to print fanins/fanouts\n"); return 1; diff --git a/src/base/abci/abcPrint.c b/src/base/abci/abcPrint.c index af34029e..01e0a093 100644 --- a/src/base/abci/abcPrint.c +++ b/src/base/abci/abcPrint.c @@ -395,7 +395,7 @@ void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDum SeeAlso [] ***********************************************************************/ -void Abc_NtkPrintIo( FILE * pFile, Abc_Ntk_t * pNtk ) +void Abc_NtkPrintIo( FILE * pFile, Abc_Ntk_t * pNtk, int fPrintFlops ) { Abc_Obj_t * pObj; int i; @@ -411,6 +411,9 @@ void Abc_NtkPrintIo( FILE * pFile, Abc_Ntk_t * pNtk ) fprintf( pFile, " %s", Abc_ObjName(pObj) ); fprintf( pFile, "\n" ); + if ( !fPrintFlops ) + return; + fprintf( pFile, "Latches (%d): ", Abc_NtkLatchNum(pNtk) ); Abc_NtkForEachLatch( pNtk, pObj, i ) fprintf( pFile, " %s(%s=%s)", Abc_ObjName(pObj), -- cgit v1.2.3