diff options
Diffstat (limited to 'src/map/scl/sclLoad.c')
-rw-r--r-- | src/map/scl/sclLoad.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/map/scl/sclLoad.c b/src/map/scl/sclLoad.c index de8ee130..3cbb34ef 100644 --- a/src/map/scl/sclLoad.c +++ b/src/map/scl/sclLoad.c @@ -141,6 +141,26 @@ void Abc_SclComputeLoad( SC_Man * p ) printf( "Maximum input drive strength is exceeded at primary input %d.\n", i ); } } + // calculate average load + if ( p->EstLoadMax ) + { + double TotalLoad = 0; + int nObjs = 0; + Abc_NtkForEachNode1( p->pNtk, pObj, i ) + { + SC_Pair * pLoad = Abc_SclObjLoad( p, pObj ); + TotalLoad += 0.5 * pLoad->fall + 0.5 * pLoad->rise; + nObjs++; + } + Abc_NtkForEachPi( p->pNtk, pObj, i ) + { + SC_Pair * pLoad = Abc_SclObjLoad( p, pObj ); + TotalLoad += 0.5 * pLoad->fall + 0.5 * pLoad->rise; + nObjs++; + } + p->EstLoadAve = (float)(TotalLoad / nObjs); +// printf( "Average load = %.2f\n", p->EstLoadAve ); + } } /**Function************************************************************* |