Commit 112f797c by Alan Mishchenko

Added switch -f to 'print_io' to suppress printing flops.

parent c5067f7d
......@@ -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 );
......
......@@ -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;
......
......@@ -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),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment