summaryrefslogtreecommitdiffstats
path: root/src/base/wln/wlnRetime.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2021-07-31 22:46:47 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2021-07-31 22:46:47 -0700
commite162a26197b194e6b9adfcf455edb4312285c644 (patch)
treeb3e3465d4fe40991d34ce7d8e5cdfa36b26eb11f /src/base/wln/wlnRetime.c
parent692dd763190d2e2682c0eeabdcd81f16aaaabe94 (diff)
downloadabc-e162a26197b194e6b9adfcf455edb4312285c644.tar.gz
abc-e162a26197b194e6b9adfcf455edb4312285c644.tar.bz2
abc-e162a26197b194e6b9adfcf455edb4312285c644.zip
Allow retiming to skip some logic.
Diffstat (limited to 'src/base/wln/wlnRetime.c')
-rw-r--r--src/base/wln/wlnRetime.c57
1 files changed, 56 insertions, 1 deletions
diff --git a/src/base/wln/wlnRetime.c b/src/base/wln/wlnRetime.c
index 734ac194..5ccc1dd0 100644
--- a/src/base/wln/wlnRetime.c
+++ b/src/base/wln/wlnRetime.c
@@ -335,6 +335,55 @@ void Wln_RetFindSources( Wln_Ret_t * p )
/**Function*************************************************************
+ Synopsis [Mark paths from PIs to POs.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+int Wln_RetMarkPaths_rec( Wln_Ntk_t * p, int iObj, int fVerbose )
+{
+ int k, iFanin, fPrev = 1;
+ if ( Wln_ObjIsTravIdPrevious(p, iObj) )
+ return 1;
+ if ( Wln_ObjIsTravIdCurrent(p, iObj) )
+ return 0;
+ if ( Wln_ObjIsCio(p, iObj) || Wln_ObjIsFf(p, iObj) )
+ return 0;
+ Wln_ObjForEachFanin( p, iObj, iFanin, k )
+ fPrev &= Wln_RetMarkPaths_rec( p, iFanin, fVerbose );
+ if ( fPrev )
+ {
+ Wln_ObjSetTravIdPrevious( p, iObj );
+ if ( Vec_IntEntry(&p->vInstIds, iObj) > 0 )
+ {
+ if ( fVerbose )
+ printf( "Updating delay %5d -> %5d : ", Vec_IntEntry(&p->vInstIds, iObj), 1 );
+ if ( fVerbose )
+ Wln_ObjPrint( p, iObj );
+ Vec_IntWriteEntry( &p->vInstIds, iObj, 1 );
+ }
+ return 1;
+ }
+ Wln_ObjSetTravIdCurrent( p, iObj );
+ return 0;
+}
+void Wln_RetMarkPaths( Wln_Ntk_t * p, int fVerbose )
+{
+ int i, iObj;
+ Wln_NtkIncrementTravId( p );
+ Wln_NtkIncrementTravId( p );
+ Wln_NtkForEachPi( p, iObj, i )
+ Wln_ObjSetTravIdPrevious( p, iObj );
+ Wln_NtkForEachPo( p, iObj, i )
+ Wln_RetMarkPaths_rec( p, Wln_ObjFanin0(p, iObj), fVerbose );
+}
+
+/**Function*************************************************************
+
Synopsis [Retimability check.]
Description []
@@ -571,7 +620,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 fSkipSimple, int fVerbose )
+Vec_Int_t * Wln_NtkRetime_int( Wln_Ntk_t * pNtk, int fSkipSimple, int fVerbose )
{
Wln_Ret_t * p = Wln_RetAlloc( pNtk );
Vec_Int_t * vSources = &p->vSources;
@@ -666,6 +715,12 @@ Vec_Int_t * Wln_NtkRetime( Wln_Ntk_t * pNtk, int fSkipSimple, int fVerbose )
}
return vMoves;
}
+Vec_Int_t * Wln_NtkRetime( Wln_Ntk_t * pNtk, int fIgnoreIO, int fSkipSimple, int fVerbose )
+{
+ if ( fIgnoreIO )
+ Wln_RetMarkPaths( pNtk, fVerbose );
+ return Wln_NtkRetime_int( pNtk, fSkipSimple, fVerbose );
+}
////////////////////////////////////////////////////////////////////////
/// END OF FILE ///