Commit 97545722 by Alan Mishchenko

Adding switch to suppress printing simple objects in %retime.

parent 9017fa91
......@@ -1323,15 +1323,19 @@ usage:
******************************************************************************/
int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
{
extern void Wln_NtkRetimeTest( char * pFileName, int fVerbose );
extern void Wln_NtkRetimeTest( char * pFileName, int fSkipSimple, int fVerbose );
FILE * pFile;
char * pFileName = NULL;
int fSkipSimple = 0;
int c, fVerbose = 0;
Extra_UtilGetoptReset();
while ( ( c = Extra_UtilGetopt( argc, argv, "vh" ) ) != EOF )
while ( ( c = Extra_UtilGetopt( argc, argv, "svh" ) ) != EOF )
{
switch ( c )
{
case 's':
fSkipSimple ^= 1;
break;
case 'v':
fVerbose ^= 1;
break;
......@@ -1351,7 +1355,7 @@ int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
printf( "Transforming NDR into internal represnetation has failed.\n" );
return 0;
}
vMoves = Wln_NtkRetime( pNtk, fVerbose );
vMoves = Wln_NtkRetime( pNtk, fSkipSimple, fVerbose );
Wln_NtkFree( pNtk );
ABC_FREE( pAbc->pNdrArray );
if ( vMoves ) pAbc->pNdrArray = Vec_IntReleaseNewArray( vMoves );
......@@ -1374,11 +1378,12 @@ int Abc_CommandRetime( Abc_Frame_t * pAbc, int argc, char ** argv )
return 0;
}
fclose( pFile );
Wln_NtkRetimeTest( pFileName, fVerbose );
Wln_NtkRetimeTest( pFileName, fSkipSimple, fVerbose );
return 0;
usage:
Abc_Print( -2, "usage: %%retime [-vh]\n" );
Abc_Print( -2, "usage: %%retime [-svh]\n" );
Abc_Print( -2, "\t performs retiming for the NDR design\n" );
Abc_Print( -2, "\t-s : toggle printing simple nodes [default = %s]\n", !fSkipSimple? "yes": "no" );
Abc_Print( -2, "\t-v : toggle printing verbose information [default = %s]\n", fVerbose? "yes": "no" );
Abc_Print( -2, "\t-h : print the command usage\n");
return 1;
......
......@@ -244,7 +244,7 @@ extern int Wln_ObjClone( Wln_Ntk_t * pNew, Wln_Ntk_t * p, int iObj );
extern int Wln_ObjCreateCo( Wln_Ntk_t * p, int iFanin );
extern void Wln_ObjPrint( Wln_Ntk_t * p, int iObj );
/*=== wlcRetime.c ========================================================*/
extern Vec_Int_t * Wln_NtkRetime( Wln_Ntk_t * p, int fVerbose );
extern Vec_Int_t * Wln_NtkRetime( Wln_Ntk_t * p, int fSkipSimple, int fVerbose );
extern void Wln_NtkRetimeCreateDelayInfo( Wln_Ntk_t * pNtk );
/*=== wlcWriteVer.c ========================================================*/
extern void Wln_WriteVer( Wln_Ntk_t * p, char * pFileName );
......
......@@ -309,7 +309,7 @@ void Wln_ReadNdrTest()
Wln_NtkStaticFanoutTest( pNtk );
Wln_NtkFree( pNtk );
}
void Wln_NtkRetimeTest( char * pFileName, int fVerbose )
void Wln_NtkRetimeTest( char * pFileName, int fSkipSimple, int fVerbose )
{
Vec_Int_t * vMoves;
void * pData = Ndr_Read( pFileName );
......@@ -321,7 +321,7 @@ void Wln_NtkRetimeTest( char * pFileName, int fVerbose )
}
Ndr_Delete( pData );
Wln_NtkRetimeCreateDelayInfo( pNtk );
vMoves = Wln_NtkRetime( pNtk, fVerbose );
vMoves = Wln_NtkRetime( pNtk, fSkipSimple, fVerbose );
//Vec_IntPrint( vMoves );
Vec_IntFree( vMoves );
Wln_NtkFree( pNtk );
......
......@@ -499,7 +499,7 @@ void Wln_RetRetimeBackward( Wln_Ret_t * p, Vec_Int_t * vSet )
Wln_RetInsertOneFanin( p, iObj, iFlop );
}
}
void Wln_RetAddToMoves( Wln_Ret_t * p, Vec_Int_t * vSet, int Delay, int fForward, int nMoves, int fVerbose )
void Wln_RetAddToMoves( Wln_Ret_t * p, Vec_Int_t * vSet, int Delay, int fForward, int nMoves, int fSkipSimple, int fVerbose )
{
int i, iObj;
if ( vSet == NULL )
......@@ -513,6 +513,8 @@ void Wln_RetAddToMoves( Wln_Ret_t * p, Vec_Int_t * vSet, int Delay, int fForward
Vec_IntForEachEntry( vSet, iObj, i )
{
int NameId = Vec_IntEntry( &p->pNtk->vNameIds, iObj );
if ( fSkipSimple && (Wln_ObjIsFf(p->pNtk, iObj) || Wln_ObjType(p->pNtk, iObj) == ABC_OPER_SLICE || Wln_ObjType(p->pNtk, iObj) == ABC_OPER_CONCAT) )
continue;
Vec_IntPush( &p->vMoves, fForward ? -NameId : NameId );
if ( fVerbose )
printf( " %d (NameID = %d) ", fForward ? -iObj : iObj, fForward ? -NameId : NameId );
......@@ -560,7 +562,7 @@ void Wln_NtkRetimeCreateDelayInfo( Wln_Ntk_t * pNtk )
printf( "Assuming default delays: 10 units for most nodes and 1 unit for bit-slice, concat, and buffers driving COs.\n" );
}
}
Vec_Int_t * Wln_NtkRetime( Wln_Ntk_t * pNtk, int fVerbose )
Vec_Int_t * Wln_NtkRetime( Wln_Ntk_t * pNtk, int fSkipSimple, int fVerbose )
{
Wln_Ret_t * p = Wln_RetAlloc( pNtk );
Vec_Int_t * vSources = &p->vSources;
......@@ -573,7 +575,7 @@ Vec_Int_t * Wln_NtkRetime( Wln_Ntk_t * pNtk, int fVerbose )
Wln_RetMarkChanges( p, NULL );
p->DelayMax = DelayInit = DelayBest = Wln_RetPropDelay( p );
Wln_RetFindSources( p );
Wln_RetAddToMoves( p, NULL, p->DelayMax, 0, nMoves, fVerbose );
Wln_RetAddToMoves( p, NULL, p->DelayMax, 0, nMoves, fSkipSimple, fVerbose );
while ( Vec_IntSize(vSources) || Vec_IntSize(vSinks) )
{
int DelayMaxPrev = p->DelayMax;
......@@ -616,7 +618,7 @@ Vec_Int_t * Wln_NtkRetime( Wln_Ntk_t * pNtk, int fVerbose )
//Wln_RetPrint( p );
if ( fVerbose )
printf( "\n" );
Wln_RetAddToMoves( p, vFront, p->DelayMax, fForward, nMoves, fVerbose );
Wln_RetAddToMoves( p, vFront, p->DelayMax, fForward, nMoves, fSkipSimple, fVerbose );
if ( fVerbose )
{
printf( "Sinks: " );
......
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