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/dar/darRefact.c | |
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/dar/darRefact.c')
-rw-r--r-- | src/opt/dar/darRefact.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/opt/dar/darRefact.c b/src/opt/dar/darRefact.c index 0dcb54e8..45e150c4 100644 --- a/src/opt/dar/darRefact.c +++ b/src/opt/dar/darRefact.c @@ -61,10 +61,10 @@ struct Ref_Man_t_ int nCutsUsed; // the number of rewriting steps int nCutsTried; // the number of cuts tries // timing statistics - clock_t timeCuts; - clock_t timeEval; - clock_t timeOther; - clock_t timeTotal; + abctime timeCuts; + abctime timeEval; + abctime timeOther; + abctime timeTotal; }; //////////////////////////////////////////////////////////////////////// @@ -501,7 +501,7 @@ int Dar_ManRefactor( Aig_Man_t * pAig, Dar_RefPar_t * pPars ) Aig_Obj_t * pObj, * pObjNew; int nNodesOld, nNodeBefore, nNodeAfter, nNodesSaved, nNodesSaved2; int i, Required, nLevelMin; - clock_t clkStart, clk; + abctime clkStart, clk; // start the manager p = Dar_ManRefStart( pAig, pPars ); @@ -513,7 +513,7 @@ int Dar_ManRefactor( Aig_Man_t * pAig, Dar_RefPar_t * pPars ) Aig_ManStartReverseLevels( pAig, 0 ); // resynthesize each node once - clkStart = clock(); + clkStart = Abc_Clock(); vCut = Vec_VecEntry( p->vCuts, 0 ); vCut2 = Vec_VecEntry( p->vCuts, 1 ); p->nNodesInit = Aig_ManNodeNum(pAig); @@ -530,12 +530,12 @@ int Dar_ManRefactor( Aig_Man_t * pAig, Dar_RefPar_t * pPars ) //printf( "\nConsidering node %d.\n", pObj->Id ); // get the bounded MFFC size -clk = clock(); +clk = Abc_Clock(); nLevelMin = Abc_MaxInt( 0, Aig_ObjLevel(pObj) - 10 ); nNodesSaved = Aig_NodeMffcSupp( pAig, pObj, nLevelMin, vCut ); if ( nNodesSaved < p->pPars->nMffcMin ) // too small to consider { -p->timeCuts += clock() - clk; +p->timeCuts += Abc_Clock() - clk; continue; } p->nNodesTried++; @@ -564,13 +564,13 @@ p->timeCuts += clock() - clk; else p->nNodesBelow++; } -p->timeCuts += clock() - clk; +p->timeCuts += Abc_Clock() - clk; // try the cuts -clk = clock(); +clk = Abc_Clock(); Required = pAig->vLevelR? Aig_ObjRequiredLevel(pAig, pObj) : ABC_INFINITY; Dar_ManRefactorTryCuts( p, pObj, nNodesSaved, Required ); -p->timeEval += clock() - clk; +p->timeEval += Abc_Clock() - clk; // check the best gain if ( !(p->GainBest > 0 || (p->GainBest == 0 && p->pPars->fUseZeros)) ) @@ -594,7 +594,7 @@ p->timeEval += clock() - clk; p->nCutsUsed++; // break; } -p->timeTotal = clock() - clkStart; +p->timeTotal = Abc_Clock() - clkStart; p->timeOther = p->timeTotal - p->timeCuts - p->timeEval; // Bar_ProgressStop( pProgress ); |