diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2013-05-27 15:09:23 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2013-05-27 15:09:23 -0700 |
commit | 19c25fd6aab057b2373717f996fe538507c1b1e1 (patch) | |
tree | 7aa7cd7609a5de31d11b3455b6388fd9300c8d0f /src/opt/nwk | |
parent | 94356f0d1fa8e671303299717f631ecf0ca2f17e (diff) | |
download | abc-19c25fd6aab057b2373717f996fe538507c1b1e1.tar.gz abc-19c25fd6aab057b2373717f996fe538507c1b1e1.tar.bz2 abc-19c25fd6aab057b2373717f996fe538507c1b1e1.zip |
Adding a wrapper around clock() for more accurate time counting in ABC.
Diffstat (limited to 'src/opt/nwk')
-rw-r--r-- | src/opt/nwk/nwkBidec.c | 4 | ||||
-rw-r--r-- | src/opt/nwk/nwkFlow.c | 8 | ||||
-rw-r--r-- | src/opt/nwk/nwkMap.c | 4 | ||||
-rw-r--r-- | src/opt/nwk/nwkMerge.c | 16 | ||||
-rw-r--r-- | src/opt/nwk/nwkUtil.c | 4 |
5 files changed, 18 insertions, 18 deletions
diff --git a/src/opt/nwk/nwkBidec.c b/src/opt/nwk/nwkBidec.c index 2f1c0366..1d3d2c26 100644 --- a/src/opt/nwk/nwkBidec.c +++ b/src/opt/nwk/nwkBidec.c @@ -133,7 +133,7 @@ void Nwk_ManBidecResyn( Nwk_Man_t * pNtk, int fVerbose ) Nwk_Obj_t * pObj; Vec_Int_t * vTruth; int i, nGainTotal = 0, nNodes1, nNodes2; - clock_t clk = clock(); + abctime clk = Abc_Clock(); pPars->nVarsMax = Nwk_ManGetFaninMax( pNtk ); pPars->fVerbose = fVerbose; if ( pPars->nVarsMax < 2 ) @@ -163,7 +163,7 @@ void Nwk_ManBidecResyn( Nwk_Man_t * pNtk, int fVerbose ) if ( fVerbose ) { printf( "Total gain in AIG nodes = %d. ", nGainTotal ); - ABC_PRT( "Total runtime", clock() - clk ); + ABC_PRT( "Total runtime", Abc_Clock() - clk ); } } diff --git a/src/opt/nwk/nwkFlow.c b/src/opt/nwk/nwkFlow.c index 50a4787f..8a672c72 100644 --- a/src/opt/nwk/nwkFlow.c +++ b/src/opt/nwk/nwkFlow.c @@ -444,7 +444,7 @@ Vec_Ptr_t * Nwk_ManRetimeCutForward( Nwk_Man_t * pMan, int nLatches, int fVerbos Vec_Ptr_t * vNodes; Nwk_Obj_t * pObj; int i, RetValue, Counter = 0, Counter2 = 0; - clock_t clk = clock(); + abctime clk = Abc_Clock(); // set the sequential parameters pMan->nLatches = nLatches; pMan->nTruePis = Nwk_ManCiNum(pMan) - nLatches; @@ -504,7 +504,7 @@ Vec_Ptr_t * Nwk_ManRetimeCutForward( Nwk_Man_t * pMan, int nLatches, int fVerbos if ( fVerbose ) { printf( "Min-cut = %4d. Unmoved = %4d. ", Vec_PtrSize(vNodes), Counter ); - ABC_PRT( "Time", clock() - clk ); + ABC_PRT( "Time", Abc_Clock() - clk ); } return vNodes; } @@ -525,7 +525,7 @@ Vec_Ptr_t * Nwk_ManRetimeCutBackward( Nwk_Man_t * pMan, int nLatches, int fVerbo Vec_Ptr_t * vNodes; Nwk_Obj_t * pObj; int i, RetValue, Counter = 0, Counter2 = 0; - clock_t clk = clock(); + abctime clk = Abc_Clock(); // set the sequential parameters pMan->nLatches = nLatches; pMan->nTruePis = Nwk_ManCiNum(pMan) - nLatches; @@ -591,7 +591,7 @@ Vec_Ptr_t * Nwk_ManRetimeCutBackward( Nwk_Man_t * pMan, int nLatches, int fVerbo if ( fVerbose ) { printf( "Min-cut = %4d. Unmoved = %4d. ", Vec_PtrSize(vNodes), Counter ); - ABC_PRT( "Time", clock() - clk ); + ABC_PRT( "Time", Abc_Clock() - clk ); } return vNodes; } diff --git a/src/opt/nwk/nwkMap.c b/src/opt/nwk/nwkMap.c index e8be5a2d..0b54e74e 100644 --- a/src/opt/nwk/nwkMap.c +++ b/src/opt/nwk/nwkMap.c @@ -110,7 +110,7 @@ If_Man_t * Nwk_ManToIf( Aig_Man_t * p, If_Par_t * pPars, Vec_Ptr_t * vAigToIf ) If_Obj_t * pIfObj; Aig_Obj_t * pNode, * pFanin, * pPrev; int i; - clock_t clk = clock(); + abctime clk = Abc_Clock(); // set the number of registers (switch activity will be combinational) Aig_ManSetRegNum( p, 0 ); if ( pPars->fPower ) @@ -118,7 +118,7 @@ If_Man_t * Nwk_ManToIf( Aig_Man_t * p, If_Par_t * pPars, Vec_Ptr_t * vAigToIf ) vSwitching = Saig_ManComputeSwitchProbs( p, 48, 16, 0 ); if ( pPars->fVerbose ) { - ABC_PRT( "Computing switching activity", clock() - clk ); + ABC_PRT( "Computing switching activity", Abc_Clock() - clk ); } pSwitching = (float *)vSwitching->pArray; vSwitching2 = Vec_IntStart( Aig_ManObjNumMax(p) ); diff --git a/src/opt/nwk/nwkMerge.c b/src/opt/nwk/nwkMerge.c index c913e0d1..3e458a06 100644 --- a/src/opt/nwk/nwkMerge.c +++ b/src/opt/nwk/nwkMerge.c @@ -704,14 +704,14 @@ int Nwk_ManLutMergeGraphTest( char * pFileName ) { int nPairs; Nwk_Grf_t * p; - clock_t clk = clock(); + abctime clk = Abc_Clock(); p = Nwk_ManLutMergeReadGraph( pFileName ); - ABC_PRT( "Reading", clock() - clk ); - clk = clock(); + ABC_PRT( "Reading", Abc_Clock() - clk ); + clk = Abc_Clock(); Nwk_ManGraphSolve( p ); printf( "GRAPH: Nodes = %6d. Edges = %6d. Pairs = %6d. ", p->nVerts, p->nEdges, Vec_IntSize(p->vPairs)/2 ); - ABC_PRT( "Solving", clock() - clk ); + ABC_PRT( "Solving", Abc_Clock() - clk ); nPairs = Vec_IntSize(p->vPairs)/2; Nwk_ManGraphReportMemoryUsage( p ); Nwk_ManGraphFree( p ); @@ -975,7 +975,7 @@ Vec_Int_t * Nwk_ManLutMerge( Nwk_Man_t * pNtk, void * pParsInit ) Vec_Ptr_t * vStart, * vNext, * vCands1, * vCands2; Nwk_Obj_t * pLut, * pCand; int i, k, nVertsMax, nCands; - clock_t clk = clock(); + abctime clk = Abc_Clock(); // count the number of vertices nVertsMax = 0; Nwk_ManForEachNode( pNtk, pLut, i ) @@ -1015,16 +1015,16 @@ Vec_Int_t * Nwk_ManLutMerge( Nwk_Man_t * pNtk, void * pParsInit ) if ( pPars->fVerbose ) { printf( "Mergable LUTs = %6d. Total cands = %6d. ", p->nVertsMax, nCands ); - ABC_PRT( "Deriving graph", clock() - clk ); + ABC_PRT( "Deriving graph", Abc_Clock() - clk ); } // solve the graph problem - clk = clock(); + clk = Abc_Clock(); Nwk_ManGraphSolve( p ); if ( pPars->fVerbose ) { printf( "GRAPH: Nodes = %6d. Edges = %6d. Pairs = %6d. ", p->nVerts, p->nEdges, Vec_IntSize(p->vPairs)/2 ); - ABC_PRT( "Solving", clock() - clk ); + ABC_PRT( "Solving", Abc_Clock() - clk ); Nwk_ManGraphReportMemoryUsage( p ); } vResult = p->vPairs; p->vPairs = NULL; diff --git a/src/opt/nwk/nwkUtil.c b/src/opt/nwk/nwkUtil.c index 2771e723..5b42b881 100644 --- a/src/opt/nwk/nwkUtil.c +++ b/src/opt/nwk/nwkUtil.c @@ -544,9 +544,9 @@ int Nwk_ManMinimumBaseInt( Nwk_Man_t * pNtk, int fVerbose ) void Nwk_ManMinimumBaseRec( Nwk_Man_t * pNtk, int fVerbose ) { int i; - clock_t clk = clock(); + abctime clk = Abc_Clock(); for ( i = 0; Nwk_ManMinimumBaseInt( pNtk, fVerbose ); i++ ); - ABC_PRT( "Minbase", clock() - clk ); + ABC_PRT( "Minbase", Abc_Clock() - clk ); } /**Function************************************************************* |