diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-10-31 09:58:59 -0400 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-10-31 09:58:59 -0400 |
commit | 05c987b6cf63ef8960cef8079d73ccd554190245 (patch) | |
tree | 74ab4c1b4c49cd6224bff89d04fac0703f9804a0 /src/map/scl | |
parent | 431dc61a9e7c77de232dcfced1954ea0baa83ca2 (diff) | |
download | abc-05c987b6cf63ef8960cef8079d73ccd554190245.tar.gz abc-05c987b6cf63ef8960cef8079d73ccd554190245.tar.bz2 abc-05c987b6cf63ef8960cef8079d73ccd554190245.zip |
Improving critical path print-out.
Diffstat (limited to 'src/map/scl')
-rw-r--r-- | src/map/scl/sclSize.c | 53 |
1 files changed, 47 insertions, 6 deletions
diff --git a/src/map/scl/sclSize.c b/src/map/scl/sclSize.c index 70f8e1a6..54ed72bc 100644 --- a/src/map/scl/sclSize.c +++ b/src/map/scl/sclSize.c @@ -128,6 +128,7 @@ static inline void Abc_SclTimeNodePrint( SC_Man * p, Abc_Obj_t * pObj, int fRise } void Abc_SclTimeNtkPrint( SC_Man * p, int fShowAll, int fPrintPath ) { + int fReversePath = 1; int i, nLength = 0, fRise = 0; Abc_Obj_t * pObj, * pPivot = Abc_SclFindCriticalCo( p, &fRise ); float maxDelay = Abc_SclObjTimePs(p, pPivot, fRise); @@ -157,7 +158,10 @@ void Abc_SclTimeNtkPrint( SC_Man * p, int fShowAll, int fPrintPath ) } if ( fPrintPath ) { -// printf( "Critical path: \n" ); + Abc_Obj_t * pTemp, * pPrev = NULL; + int iStart = -1, iEnd = -1; + Vec_Ptr_t * vPath; +// printf( "Critical path: \n" ); // find the longest cell name pObj = Abc_ObjFanin0(pPivot); i = 0; @@ -167,14 +171,51 @@ void Abc_SclTimeNtkPrint( SC_Man * p, int fShowAll, int fPrintPath ) nLength = Abc_MaxInt( nLength, strlen(Abc_SclObjCell(pObj)->pName) ); pObj = Abc_SclFindMostCriticalFanin( p, &fRise, pObj ); } + // print timing - pObj = Abc_ObjFanin0(pPivot); - while ( pObj )//&& Abc_ObjIsNode(pObj) ) + if ( !fReversePath ) { - printf( "Path%3d --", i-- ); - Abc_SclTimeNodePrint( p, pObj, fRise, nLength, maxDelay ); - pObj = Abc_SclFindMostCriticalFanin( p, &fRise, pObj ); + // print timing + pObj = Abc_ObjFanin0(pPivot); + while ( pObj )//&& Abc_ObjIsNode(pObj) ) + { + printf( "Path%3d --", i-- ); + Abc_SclTimeNodePrint( p, pObj, fRise, nLength, maxDelay ); + pPrev = pObj; + pObj = Abc_SclFindMostCriticalFanin( p, &fRise, pObj ); + } + } + else + { + // collect path nodes + vPath = Vec_PtrAlloc( 100 ); + Vec_PtrPush( vPath, pPivot ); + pObj = Abc_ObjFanin0(pPivot); + while ( pObj )//&& Abc_ObjIsNode(pObj) ) + { + Vec_PtrPush( vPath, pObj ); + pPrev = pObj; + pObj = Abc_SclFindMostCriticalFanin( p, &fRise, pObj ); + } + Vec_PtrForEachEntryReverse( Abc_Obj_t *, vPath, pObj, i ) + { + printf( "Path%3d --", Vec_PtrSize(vPath)-1-i ); + Abc_SclTimeNodePrint( p, pObj, fRise, nLength, maxDelay ); + if ( i == 1 ) + break; + } + Vec_PtrFree( vPath ); } + // print start-point and end-point + Abc_NtkForEachPi( p->pNtk, pTemp, iStart ) + if ( pTemp == pPrev ) + break; + Abc_NtkForEachPo( p->pNtk, pTemp, iEnd ) + if ( pTemp == pPivot ) + break; + printf( "Start-point = pi%0*d. End-point = po%0*d.\n", + Abc_Base10Log( Abc_NtkPiNum(p->pNtk) ), iStart, + Abc_Base10Log( Abc_NtkPoNum(p->pNtk) ), iEnd ); } } |