summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-02-11 00:43:37 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2012-02-11 00:43:37 -0800
commit112f797c731ac45b713efd87dd5956695b983ecd (patch)
treee1bb5ccba8e41559e9642394a888d9d30e6c0bd1
parentc5067f7d04dc4c8ee919d9597a4a94a5c4ac3552 (diff)
downloadabc-112f797c731ac45b713efd87dd5956695b983ecd.tar.gz
abc-112f797c731ac45b713efd87dd5956695b983ecd.tar.bz2
abc-112f797c731ac45b713efd87dd5956695b983ecd.zip
Added switch -f to 'print_io' to suppress printing flops.
-rw-r--r--src/base/abc/abc.h2
-rw-r--r--src/base/abci/abc.c14
-rw-r--r--src/base/abci/abcPrint.c5
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] <node>\n" );
- Abc_Print( -2, "\t prints the PIs/POs or fanins/fanouts of a node\n" );
+ Abc_Print( -2, "usage: print_io [-fh] <node>\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),