summaryrefslogtreecommitdiffstats
path: root/src/base
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-09-02 23:15:15 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-09-02 23:15:15 -0700
commitd1b9ade53587ce2b1a2db65560d0bf38fc674903 (patch)
tree0d4530dd10bc38d37a83086960969eed94310548 /src/base
parentb6cb626a122e8b5e10856fd488b9f773af117404 (diff)
downloadabc-d1b9ade53587ce2b1a2db65560d0bf38fc674903.tar.gz
abc-d1b9ade53587ce2b1a2db65560d0bf38fc674903.tar.bz2
abc-d1b9ade53587ce2b1a2db65560d0bf38fc674903.zip
Adding switch 'ps -s' to skip counting buffers/inverters as nodes.
Diffstat (limited to 'src/base')
-rw-r--r--src/base/abc/abc.h3
-rw-r--r--src/base/abc/abcHie.c2
-rw-r--r--src/base/abc/abcUtil.c20
-rw-r--r--src/base/abci/abc.c16
-rw-r--r--src/base/abci/abcMini.c2
-rw-r--r--src/base/abci/abcPrint.c6
-rw-r--r--src/base/io/ioUtil.c2
7 files changed, 38 insertions, 13 deletions
diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h
index 105efc96..6b1e2404 100644
--- a/src/base/abc/abc.h
+++ b/src/base/abc/abc.h
@@ -773,7 +773,7 @@ extern ABC_DLL void Abc_NtkDontCareFree( Odc_Man_t * p );
extern ABC_DLL int Abc_NtkDontCareCompute( Odc_Man_t * p, Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves, unsigned * puTruth );
/*=== 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_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 );
@@ -959,6 +959,7 @@ extern ABC_DLL int Abc_NtkGetClauseNum( Abc_Ntk_t * pNtk );
extern ABC_DLL double Abc_NtkGetMappedArea( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkGetExorNum( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkGetMuxNum( Abc_Ntk_t * pNtk );
+extern ABC_DLL int Abc_NtkGetBufNum( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkGetChoiceNum( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkGetFaninMax( Abc_Ntk_t * pNtk );
extern ABC_DLL int Abc_NtkGetTotalFanins( Abc_Ntk_t * pNtk );
diff --git a/src/base/abc/abcHie.c b/src/base/abc/abcHie.c
index 886056e2..c8f4e8aa 100644
--- a/src/base/abc/abcHie.c
+++ b/src/base/abc/abcHie.c
@@ -469,7 +469,7 @@ void Abc_NtkPrintBoxInfo( Abc_Ntk_t * pNtk )
Vec_IntAddToEntry( vCounts, Num, 1 );
}
-// Abc_NtkPrintStats( pModel, 0, 0, 0, 0, 0, 0, 0 );
+// Abc_NtkPrintStats( pModel, 0, 0, 0, 0, 0, 0, 0, 0 );
printf( "MODULE " );
printf( "%-30s : ", Abc_NtkName(pModel) );
printf( "PI=%6d ", Abc_NtkPiNum(pModel) );
diff --git a/src/base/abc/abcUtil.c b/src/base/abc/abcUtil.c
index bf41ad45..b755a0c4 100644
--- a/src/base/abc/abcUtil.c
+++ b/src/base/abc/abcUtil.c
@@ -396,6 +396,26 @@ int Abc_NtkGetMuxNum( Abc_Ntk_t * pNtk )
/**Function*************************************************************
+ Synopsis [Counts the number of exors.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Abc_NtkGetBufNum( Abc_Ntk_t * pNtk )
+{
+ Abc_Obj_t * pNode;
+ int i, Counter = 0;
+ Abc_NtkForEachNode( pNtk, pNode, i )
+ Counter += (Abc_ObjFaninNum(pNode) == 1);
+ return Counter;
+}
+
+/**Function*************************************************************
+
Synopsis [Returns 1 if it is an AIG with choice nodes.]
Description []
diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c
index 00552286..5c3263c3 100644
--- a/src/base/abci/abc.c
+++ b/src/base/abci/abc.c
@@ -1046,6 +1046,7 @@ int Abc_CommandPrintStats( Abc_Frame_t * pAbc, int argc, char ** argv )
int fPrintMuxes;
int fPower;
int fGlitch;
+ int fSkipBuf;
int c;
pNtk = Abc_FrameReadNtk(pAbc);
@@ -1059,8 +1060,9 @@ int Abc_CommandPrintStats( Abc_Frame_t * pAbc, int argc, char ** argv )
fPrintMuxes = 0;
fPower = 0;
fGlitch = 0;
+ fSkipBuf = 0;
Extra_UtilGetoptReset();
- while ( ( c = Extra_UtilGetopt( argc, argv, "fbdltmpgh" ) ) != EOF )
+ while ( ( c = Extra_UtilGetopt( argc, argv, "fbdltmpgsh" ) ) != EOF )
{
switch ( c )
{
@@ -1088,6 +1090,9 @@ int Abc_CommandPrintStats( Abc_Frame_t * pAbc, int argc, char ** argv )
case 'g':
fGlitch ^= 1;
break;
+ case 's':
+ fSkipBuf ^= 1;
+ break;
case 'h':
goto usage;
default:
@@ -1105,7 +1110,7 @@ int Abc_CommandPrintStats( Abc_Frame_t * pAbc, int argc, char ** argv )
Abc_Print( -1, "Cannot print LUT delay for a non-logic network.\n" );
return 1;
}
- Abc_NtkPrintStats( pNtk, fFactor, fSaveBest, fDumpResult, fUseLutLib, fPrintMuxes, fPower, fGlitch );
+ Abc_NtkPrintStats( pNtk, fFactor, fSaveBest, fDumpResult, fUseLutLib, fPrintMuxes, fPower, fGlitch, fSkipBuf );
if ( fPrintTime )
{
pAbc->TimeTotal += pAbc->TimeCommand;
@@ -1115,7 +1120,7 @@ int Abc_CommandPrintStats( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
usage:
- Abc_Print( -2, "usage: print_stats [-fbdltmpgh]\n" );
+ Abc_Print( -2, "usage: print_stats [-fbdltmpgsh]\n" );
Abc_Print( -2, "\t prints the network statistics\n" );
Abc_Print( -2, "\t-f : toggles printing the literal count in the factored forms [default = %s]\n", fFactor? "yes": "no" );
Abc_Print( -2, "\t-b : toggles saving the best logic network in \"best.blif\" [default = %s]\n", fSaveBest? "yes": "no" );
@@ -1124,7 +1129,8 @@ usage:
Abc_Print( -2, "\t-t : toggles printing runtime statistics [default = %s]\n", fPrintTime? "yes": "no" );
Abc_Print( -2, "\t-m : toggles printing MUX statistics [default = %s]\n", fPrintMuxes? "yes": "no" );
Abc_Print( -2, "\t-p : toggles printing power dissipation due to switching [default = %s]\n", fPower? "yes": "no" );
- Abc_Print( -2, "\t-q : toggles printing percentage of increased power due to glitching [default = %s]\n", fGlitch? "yes": "no" );
+ Abc_Print( -2, "\t-g : toggles printing percentage of increased power due to glitching [default = %s]\n", fGlitch? "yes": "no" );
+ Abc_Print( -2, "\t-s : toggles not counting single-output nodes as nodes [default = %s]\n", fSkipBuf? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
}
@@ -1205,7 +1211,7 @@ int Abc_CommandPrintExdc( Abc_Frame_t * pAbc, int argc, char ** argv )
}
else
Abc_Print( 1, "EXDC network statistics: \n" );
- Abc_NtkPrintStats( pNtk->pExdc, 0, 0, 0, 0, 0, 0, 0 );
+ Abc_NtkPrintStats( pNtk->pExdc, 0, 0, 0, 0, 0, 0, 0, 0 );
return 0;
usage:
diff --git a/src/base/abci/abcMini.c b/src/base/abci/abcMini.c
index 4778d3d8..c8f3bca5 100644
--- a/src/base/abci/abcMini.c
+++ b/src/base/abci/abcMini.c
@@ -195,7 +195,7 @@ void Abc_NtkMiniAigTest( Abc_Ntk_t * pNtk )
p = Abc_NtkToMiniAig( pNtk );
pNtkNew = Abc_NtkFromMiniAig( p );
Mini_AigStop( p );
- Abc_NtkPrintStats( pNtkNew, 0, 0, 0, 0, 0, 0, 0 );
+ Abc_NtkPrintStats( pNtkNew, 0, 0, 0, 0, 0, 0, 0, 0 );
Abc_NtkDelete( pNtkNew );
// test dumping
diff --git a/src/base/abci/abcPrint.c b/src/base/abci/abcPrint.c
index 365b7767..25136cc9 100644
--- a/src/base/abci/abcPrint.c
+++ b/src/base/abci/abcPrint.c
@@ -193,7 +193,7 @@ float Abc_NtkGetArea( Abc_Ntk_t * pNtk )
SeeAlso []
***********************************************************************/
-void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDumpResult, int fUseLutLib, int fPrintMuxes, int fPower, int fGlitch )
+void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDumpResult, int fUseLutLib, int fPrintMuxes, int fPower, int fGlitch, int fSkipBuf )
{
if ( fPrintMuxes && Abc_NtkIsStrash(pNtk) )
{
@@ -242,7 +242,7 @@ void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDum
}
else
{
- Abc_Print( 1," nd =%6d", Abc_NtkNodeNum(pNtk) );
+ Abc_Print( 1," nd =%6d", Abc_NtkNodeNum(pNtk) - (fSkipBuf ? Abc_NtkGetBufNum(pNtk) : 0) );
Abc_Print( 1," edge =%7d", Abc_NtkGetTotalFanins(pNtk) );
}
@@ -386,7 +386,7 @@ void Abc_NtkPrintStats( Abc_Ntk_t * pNtk, int fFactored, int fSaveBest, int fDum
fflush( stdout );
if ( pNtk->pExdc )
- Abc_NtkPrintStats( pNtk->pExdc, fFactored, fSaveBest, fDumpResult, fUseLutLib, fPrintMuxes, fPower, fGlitch );
+ Abc_NtkPrintStats( pNtk->pExdc, fFactored, fSaveBest, fDumpResult, fUseLutLib, fPrintMuxes, fPower, fGlitch, fSkipBuf );
}
/**Function*************************************************************
diff --git a/src/base/io/ioUtil.c b/src/base/io/ioUtil.c
index bad3f35e..1382337a 100644
--- a/src/base/io/ioUtil.c
+++ b/src/base/io/ioUtil.c
@@ -261,8 +261,6 @@ Abc_Ntk_t * Io_Read( char * pFileName, Io_FileType_t FileType, int fCheck )
// consider the case of BLIF-MV
if ( Io_ReadFileType(pFileName) == IO_FILE_BLIFMV )
{
-//Abc_NtkPrintStats( stdout, pNtk, 0 );
-// Io_WriteBlifMv( pNtk, "_temp_.mv" );
pNtk = Abc_NtkStrashBlifMv( pTemp = pNtk );
Abc_NtkDelete( pTemp );
if ( pNtk == NULL )