From 975457228385f3456a54bf2161e4e500cac849b5 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Wed, 14 Aug 2019 19:55:16 +0700 Subject: Adding switch to suppress printing simple objects in %retime. --- src/base/wln/wln.h | 2 +- src/base/wln/wlnNdr.c | 4 ++-- src/base/wln/wlnRetime.c | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src/base/wln') diff --git a/src/base/wln/wln.h b/src/base/wln/wln.h index c4fbf997..54150c56 100644 --- a/src/base/wln/wln.h +++ b/src/base/wln/wln.h @@ -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 ); diff --git a/src/base/wln/wlnNdr.c b/src/base/wln/wlnNdr.c index 00f2a144..60179ed4 100644 --- a/src/base/wln/wlnNdr.c +++ b/src/base/wln/wlnNdr.c @@ -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 ); diff --git a/src/base/wln/wlnRetime.c b/src/base/wln/wlnRetime.c index 1ba2d50f..d5247f02 100644 --- a/src/base/wln/wlnRetime.c +++ b/src/base/wln/wlnRetime.c @@ -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: " ); -- cgit v1.2.3