summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
Diffstat (limited to 'src/base')
-rw-r--r--src/base/abc/abc.h2
-rw-r--r--src/base/abci/abc.c21
-rw-r--r--src/base/abci/abcPrint.c14
3 files changed, 24 insertions, 13 deletions
diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h
index 215d66be..62df9450 100644
--- a/src/base/abc/abc.h
+++ b/src/base/abc/abc.h
@@ -795,7 +795,7 @@ 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, int fSkipBuf );
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_NtkPrintFanio( FILE * pFile, Abc_Ntk_t * pNtk, int fUsePis );
extern ABC_DLL void Abc_NtkPrintFanioNew( FILE * pFile, Abc_Ntk_t * pNtk, int fMffc );
extern ABC_DLL void Abc_NodePrintFanio( FILE * pFile, Abc_Obj_t * pNode );
extern ABC_DLL void Abc_NtkPrintFactor( FILE * pFile, Abc_Ntk_t * pNtk, int fUseRealNames );
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 812e1820..0ce72bd6 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -1407,17 +1407,17 @@ int Abc_CommandPrintFanio( Abc_Frame_t * pAbc, int argc, char ** argv )
{
Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc);
int c;
- int fMffc;
- int fVerbose;
-
- // set defaults
- fMffc = 0;
- fVerbose = 0;
+ int fUsePis = 0;
+ int fMffc = 0;
+ int fVerbose = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "mvh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "imvh" ) ) != EOF )
{
switch ( c )
{
+ case 'i':
+ fUsePis ^= 1;
+ break;
case 'm':
fMffc ^= 1;
break;
@@ -1430,23 +1430,22 @@ int Abc_CommandPrintFanio( Abc_Frame_t * pAbc, int argc, char ** argv )
goto usage;
}
}
-
if ( pNtk == NULL )
{
Abc_Print( -1, "Empty network.\n" );
return 1;
}
-
// print the nodes
if ( fVerbose )
- Abc_NtkPrintFanio( stdout, pNtk );
+ Abc_NtkPrintFanio( stdout, pNtk, fUsePis );
else
Abc_NtkPrintFanioNew( stdout, pNtk, fMffc );
return 0;
usage:
- Abc_Print( -2, "usage: print_fanio [-mvh]\n" );
+ Abc_Print( -2, "usage: print_fanio [-imvh]\n" );
Abc_Print( -2, "\t prints the statistics about fanins/fanouts of all nodes\n" );
+ Abc_Print( -2, "\t-i : toggles considering fanouts of primary inputs only [default = %s]\n", fUsePis? "yes": "no" );
Abc_Print( -2, "\t-m : toggles printing MFFC sizes instead of fanouts [default = %s]\n", fMffc? "yes": "no" );
Abc_Print( -2, "\t-v : toggles verbose way of printing the stats [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
diff --git a/src/base/abci/abcPrint.c b/src/base/abci/abcPrint.c
index 06e459fe..7358a519 100644
--- a/src/base/abci/abcPrint.c
+++ b/src/base/abci/abcPrint.c
@@ -524,7 +524,7 @@ void Abc_NtkPrintLatch( FILE * pFile, Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-void Abc_NtkPrintFanio( FILE * pFile, Abc_Ntk_t * pNtk )
+void Abc_NtkPrintFanio( FILE * pFile, Abc_Ntk_t * pNtk, int fUsePis )
{
Abc_Obj_t * pNode;
int i, k, nFanins, nFanouts;
@@ -558,6 +558,18 @@ void Abc_NtkPrintFanio( FILE * pFile, Abc_Ntk_t * pNtk )
vFanins->pArray[nFanins]++;
vFanouts->pArray[nFanouts]++;
}
+ if ( fUsePis )
+ {
+ Vec_IntFill( vFanouts, Vec_IntSize(vFanouts), 0 );
+ Abc_NtkForEachCi( pNtk, pNode, i )
+ {
+ if ( Abc_NtkIsNetlist(pNtk) )
+ nFanouts = Abc_ObjFanoutNum( Abc_ObjFanout0(pNode) );
+ else
+ nFanouts = Abc_ObjFanoutNum(pNode);
+ vFanouts->pArray[nFanouts]++;
+ }
+ }
fprintf( pFile, "The distribution of fanins and fanouts in the network:\n" );
fprintf( pFile, " Number Nodes with fanin Nodes with fanout\n" );
for ( k = 0; k < vFanins->nSize; k++ )