summaryrefslogtreecommitdiffstats
path: root/src/base/wlc/wlcNtk.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2018-12-04 23:04:13 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2018-12-04 23:04:13 -0800
commit65b10c0327ce232ba999d51d00a52db53d52bea0 (patch)
tree72bc9d8f7a8a8455d1249a78159e59bc32b1f25b /src/base/wlc/wlcNtk.c
parent163bba53e0a547dbed5e5bc5d2aa4a0d22435813 (diff)
downloadabc-65b10c0327ce232ba999d51d00a52db53d52bea0.tar.gz
abc-65b10c0327ce232ba999d51d00a52db53d52bea0.tar.bz2
abc-65b10c0327ce232ba999d51d00a52db53d52bea0.zip
Experiments with retiming.
Diffstat (limited to 'src/base/wlc/wlcNtk.c')
-rw-r--r--src/base/wlc/wlcNtk.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/base/wlc/wlcNtk.c b/src/base/wlc/wlcNtk.c
index 4ac0c66c..52e2d9a1 100644
--- a/src/base/wlc/wlcNtk.c
+++ b/src/base/wlc/wlcNtk.c
@@ -305,7 +305,7 @@ int Wlc_NtkMemUsage( Wlc_Ntk_t * p )
SeeAlso []
***********************************************************************/
-int Wlc_NtkCreateLevels( Wlc_Ntk_t * p )
+int Wlc_NtkCreateLevels_( Wlc_Ntk_t * p )
{
Wlc_Obj_t * pObj;
int i, k, iFanin, Level, LevelMax = 0;
@@ -346,6 +346,37 @@ int Wlc_NtkCreateLevelsRev( Wlc_Ntk_t * p )
/**Function*************************************************************
+ Synopsis [Assigns object levels.]
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+void Wlc_NtkCreateLevels_rec( Wlc_Ntk_t * p, Wlc_Obj_t * pObj )
+{
+ int k, iFanin, Level = 0;
+ if ( Vec_IntEntry(&p->vLevels, Wlc_ObjId(p, pObj)) > 0 )
+ return;
+ Wlc_ObjForEachFanin( pObj, iFanin, k ) if ( iFanin )
+ Wlc_NtkCreateLevels_rec( p, Wlc_NtkObj(p, iFanin) );
+ Wlc_ObjForEachFanin( pObj, iFanin, k ) if ( iFanin )
+ Level = Abc_MaxInt( Level, Wlc_ObjLevelId(p, iFanin) );
+ Vec_IntWriteEntry( &p->vLevels, Wlc_ObjId(p, pObj), Level + 1 );
+}
+int Wlc_NtkCreateLevels( Wlc_Ntk_t * p )
+{
+ Wlc_Obj_t * pObj; int i;
+ Vec_IntFill( &p->vLevels, Wlc_NtkObjNumMax(p), 0 );
+ Wlc_NtkForEachCo( p, pObj, i )
+ Wlc_NtkCreateLevels_rec( p, pObj );
+ return Vec_IntFindMax( &p->vLevels );
+}
+
+/**Function*************************************************************
+
Synopsis [Collects statistics for each side of the miter.]
Description []