diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2005-11-28 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2005-11-28 08:01:00 -0800 |
commit | 5e0f86a2c9bdc773251db2b741b7b051cc4a147a (patch) | |
tree | cda989b7f0cb2db3c9719cab14eb2ce1a9782e1e /src/base/seq/seqUtil.c | |
parent | 3a1ca9fa0ebfb2ae431501067d1a1a63fe6ecba5 (diff) | |
download | abc-5e0f86a2c9bdc773251db2b741b7b051cc4a147a.tar.gz abc-5e0f86a2c9bdc773251db2b741b7b051cc4a147a.tar.bz2 abc-5e0f86a2c9bdc773251db2b741b7b051cc4a147a.zip |
Version abc51128
Diffstat (limited to 'src/base/seq/seqUtil.c')
-rw-r--r-- | src/base/seq/seqUtil.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/base/seq/seqUtil.c b/src/base/seq/seqUtil.c index a3b8bc84..d9fad0ea 100644 --- a/src/base/seq/seqUtil.c +++ b/src/base/seq/seqUtil.c @@ -417,6 +417,50 @@ int Seq_NtkCountNodesAboveLimit( Abc_Ntk_t * pNtk, int Limit ) return Counter; } +/**Function************************************************************* + + Synopsis [Computes area flows.] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int Seq_MapComputeAreaFlows( Abc_Ntk_t * pNtk, int fVerbose ) +{ + Abc_Seq_t * p = pNtk->pManFunc; + Abc_Obj_t * pObj; + float AFlow; + int i, c; + + assert( Abc_NtkIsSeq(pNtk) ); + + Vec_IntFill( p->vAFlows, p->nSize, Abc_Float2Int( (float)0.0 ) ); + + // update all values iteratively + for ( c = 0; c < 7; c++ ) + { + Abc_AigForEachAnd( pNtk, pObj, i ) + { + AFlow = (float)1.0 + Seq_NodeGetFlow( Abc_ObjFanin0(pObj) ) + Seq_NodeGetFlow( Abc_ObjFanin1(pObj) ); + AFlow /= Abc_ObjFanoutNum(pObj); + pObj->pNext = (void *)Abc_Float2Int( AFlow ); + } + Abc_AigForEachAnd( pNtk, pObj, i ) + { + AFlow = Abc_Int2Float( (int)pObj->pNext ); + pObj->pNext = NULL; + Seq_NodeSetFlow( pObj, AFlow ); + +// printf( "%5d : %6.1f\n", pObj->Id, Seq_NodeGetFlow(pObj) ); + } +// printf( "\n" ); + } + return 1; +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// //////////////////////////////////////////////////////////////////////// |