mirror of https://github.com/YosysHQ/abc.git
Adding switch 'ps -s' to skip counting buffers/inverters as nodes.
This commit is contained in:
parent
b6cb626a12
commit
d1b9ade535
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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) );
|
||||
|
|
|
|||
|
|
@ -394,6 +394,26 @@ int Abc_NtkGetMuxNum( Abc_Ntk_t * pNtk )
|
|||
return Counter;
|
||||
}
|
||||
|
||||
/**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.]
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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*************************************************************
|
||||
|
|
|
|||
|
|
@ -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 )
|
||||
|
|
|
|||
Loading…
Reference in New Issue