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/aig/aig | |
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/aig/aig')
-rw-r--r-- | src/aig/aig/aig.h | 4 | ||||
-rw-r--r-- | src/aig/aig/aigCanon.c | 6 | ||||
-rw-r--r-- | src/aig/aig/aigCuts.c | 4 | ||||
-rw-r--r-- | src/aig/aig/aigDfs.c | 4 | ||||
-rw-r--r-- | src/aig/aig/aigDoms.c | 12 | ||||
-rw-r--r-- | src/aig/aig/aigInter.c | 24 | ||||
-rw-r--r-- | src/aig/aig/aigJust.c | 4 | ||||
-rw-r--r-- | src/aig/aig/aigPart.c | 28 | ||||
-rw-r--r-- | src/aig/aig/aigPartSat.c | 12 | ||||
-rw-r--r-- | src/aig/aig/aigRet.c | 14 | ||||
-rw-r--r-- | src/aig/aig/aigSplit.c | 4 | ||||
-rw-r--r-- | src/aig/aig/aigTable.c | 6 |
12 files changed, 61 insertions, 61 deletions
diff --git a/src/aig/aig/aig.h b/src/aig/aig/aig.h index 61ed26e4..697238ae 100644 --- a/src/aig/aig/aig.h +++ b/src/aig/aig/aig.h @@ -161,8 +161,8 @@ struct Aig_Man_t_ Vec_Int_t * vCiNumsOrig; // original CI names int nComplEdges; // complemented edges // timing statistics - clock_t time1; - clock_t time2; + abctime time1; + abctime time2; }; // cut computation diff --git a/src/aig/aig/aigCanon.c b/src/aig/aig/aigCanon.c index f8a50fab..5ae3cd65 100644 --- a/src/aig/aig/aigCanon.c +++ b/src/aig/aig/aigCanon.c @@ -176,9 +176,9 @@ void Aig_RManTableResize( Aig_RMan_t * p ) Aig_Tru_t * pEntry, * pNext; Aig_Tru_t ** pBinsOld, ** ppPlace; int nBinsOld, Counter, i; - clock_t clk; + abctime clk; assert( p->pBins != NULL ); -clk = clock(); +clk = Abc_Clock(); // save the old Bins pBinsOld = p->pBins; nBinsOld = p->nBins; @@ -200,7 +200,7 @@ clk = clock(); Counter++; } assert( Counter == p->nEntries ); -// ABC_PRT( "Time", clock() - clk ); +// ABC_PRT( "Time", Abc_Clock() - clk ); ABC_FREE( pBinsOld ); } diff --git a/src/aig/aig/aigCuts.c b/src/aig/aig/aigCuts.c index 1ab117f8..af4edcbb 100644 --- a/src/aig/aig/aigCuts.c +++ b/src/aig/aig/aigCuts.c @@ -633,7 +633,7 @@ Aig_ManCut_t * Aig_ComputeCuts( Aig_Man_t * pAig, int nCutsMax, int nLeafMax, in Aig_ManCut_t * p; Aig_Obj_t * pObj; int i; - clock_t clk = clock(); + abctime clk = Abc_Clock(); assert( pAig->pManCuts == NULL ); // start the manager p = Aig_ManCutStart( pAig, nCutsMax, nLeafMax, fTruth, fVerbose ); @@ -652,7 +652,7 @@ Aig_ManCut_t * Aig_ComputeCuts( Aig_Man_t * pAig, int nCutsMax, int nLeafMax, in Aig_ManObjNum(pAig), nCuts, nLeafMax, nCutsK ); printf( "Cut size = %2d. Truth size = %2d. Total mem = %5.2f MB ", p->nCutSize, 4*p->nTruthWords, 1.0*Aig_MmFixedReadMemUsage(p->pMemCuts)/(1<<20) ); - ABC_PRT( "Runtime", clock() - clk ); + ABC_PRT( "Runtime", Abc_Clock() - clk ); /* Aig_ManForEachNode( pAig, pObj, i ) if ( i % 300 == 0 ) diff --git a/src/aig/aig/aigDfs.c b/src/aig/aig/aigDfs.c index 5334aac0..834da0b2 100644 --- a/src/aig/aig/aigDfs.c +++ b/src/aig/aig/aigDfs.c @@ -781,12 +781,12 @@ int Aig_SupportSizeTest( Aig_Man_t * p ) { Aig_Obj_t * pObj; int i, Counter = 0; - clock_t clk = clock(); + abctime clk = Abc_Clock(); Aig_ManForEachObj( p, pObj, i ) if ( Aig_ObjIsNode(pObj) ) Counter += (Aig_SupportSize(p, pObj) <= 16); printf( "Nodes with small support %d (out of %d)\n", Counter, Aig_ManNodeNum(p) ); - Abc_PrintTime( 1, "Time", clock() - clk ); + Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); return Counter; } diff --git a/src/aig/aig/aigDoms.c b/src/aig/aig/aigDoms.c index a537e2ab..7e3bc504 100644 --- a/src/aig/aig/aigDoms.c +++ b/src/aig/aig/aigDoms.c @@ -624,7 +624,7 @@ Aig_Sto_t * Aig_ManComputeDomsFlops( Aig_Man_t * pAig, int Limit ) Vec_Ptr_t * vNodes; Aig_Obj_t * pObj; int i; - clock_t clk = clock(); + abctime clk = Abc_Clock(); pSto = Aig_ManDomStart( pAig, Limit ); // initialize flop inputs Saig_ManForEachLi( pAig, pObj, i ) @@ -644,7 +644,7 @@ Aig_Sto_t * Aig_ManComputeDomsFlops( Aig_Man_t * pAig, int Limit ) pSto->nDomNodes, Aig_ManRegNum(pSto->pAig), pSto->nDomsTotal, // pSto->nDomsFilter1, pSto->nDomsFilter2, 1.0 * pSto->nDomsTotal / (pSto->nDomNodes + Aig_ManRegNum(pSto->pAig)) ); - Abc_PrintTime( 1, "Time", clock() - clk ); + Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); return pSto; } @@ -665,7 +665,7 @@ Aig_Sto_t * Aig_ManComputeDomsPis( Aig_Man_t * pAig, int Limit ) Vec_Ptr_t * vNodes; Aig_Obj_t * pObj; int i; - clock_t clk = clock(); + abctime clk = Abc_Clock(); pSto = Aig_ManDomStart( pAig, Limit ); // initialize flop inputs Aig_ManForEachCo( pAig, pObj, i ) @@ -685,7 +685,7 @@ Aig_Sto_t * Aig_ManComputeDomsPis( Aig_Man_t * pAig, int Limit ) pSto->nDomNodes, Saig_ManPiNum(pSto->pAig), pSto->nDomsTotal, // pSto->nDomsFilter1, pSto->nDomsFilter2, 1.0 * pSto->nDomsTotal / (pSto->nDomNodes + Saig_ManPiNum(pSto->pAig)) ); - Abc_PrintTime( 1, "Time", clock() - clk ); + Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); return pSto; } @@ -706,7 +706,7 @@ Aig_Sto_t * Aig_ManComputeDomsNodes( Aig_Man_t * pAig, int Limit ) Vec_Ptr_t * vNodes; Aig_Obj_t * pObj; int i; - clock_t clk = clock(); + abctime clk = Abc_Clock(); pSto = Aig_ManDomStart( pAig, Limit ); // initialize flop inputs Aig_ManForEachCo( pAig, pObj, i ) @@ -724,7 +724,7 @@ Aig_Sto_t * Aig_ManComputeDomsNodes( Aig_Man_t * pAig, int Limit ) pSto->nDomNodes, pSto->nDomsTotal, // pSto->nDomsFilter1, pSto->nDomsFilter2, 1.0 * pSto->nDomsTotal / pSto->nDomNodes ); - Abc_PrintTime( 1, "Time", clock() - clk ); + Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); return pSto; } diff --git a/src/aig/aig/aigInter.c b/src/aig/aig/aigInter.c index 636cb494..8f9318b3 100644 --- a/src/aig/aig/aigInter.c +++ b/src/aig/aig/aigInter.c @@ -29,9 +29,9 @@ ABC_NAMESPACE_IMPL_START /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// -extern clock_t timeCnf; -extern clock_t timeSat; -extern clock_t timeInt; +extern abctime timeCnf; +extern abctime timeSat; +extern abctime timeInt; //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// @@ -54,7 +54,7 @@ void Aig_ManInterFast( Aig_Man_t * pManOn, Aig_Man_t * pManOff, int fVerbose ) Cnf_Dat_t * pCnfOn, * pCnfOff; Aig_Obj_t * pObj, * pObj2; int Lits[3], status, i; -// clock_t clk = clock(); +// abctime clk = Abc_Clock(); assert( Aig_ManCiNum(pManOn) == Aig_ManCiNum(pManOff) ); assert( Aig_ManCoNum(pManOn) == Aig_ManCoNum(pManOff) ); @@ -132,7 +132,7 @@ void Aig_ManInterFast( Aig_Man_t * pManOn, Aig_Man_t * pManOff, int fVerbose ) Cnf_DataFree( pCnfOn ); Cnf_DataFree( pCnfOff ); sat_solver_delete( pSat ); -// ABC_PRT( "Fast interpolation time", clock() - clk ); +// ABC_PRT( "Fast interpolation time", Abc_Clock() - clk ); } /**Function************************************************************* @@ -156,21 +156,21 @@ Aig_Man_t * Aig_ManInter( Aig_Man_t * pManOn, Aig_Man_t * pManOff, int fRelation Vec_Int_t * vVarsAB; Aig_Obj_t * pObj, * pObj2; int Lits[3], status, i; - clock_t clk; + abctime clk; int iLast = -1; // Suppress "might be used uninitialized" assert( Aig_ManCiNum(pManOn) == Aig_ManCiNum(pManOff) ); -clk = clock(); +clk = Abc_Clock(); // derive CNFs // pCnfOn = Cnf_Derive( pManOn, 0 ); // pCnfOff = Cnf_Derive( pManOff, 0 ); pCnfOn = Cnf_DeriveSimple( pManOn, 0 ); pCnfOff = Cnf_DeriveSimple( pManOff, 0 ); Cnf_DataLift( pCnfOff, pCnfOn->nVars ); -timeCnf += clock() - clk; +timeCnf += Abc_Clock() - clk; -clk = clock(); +clk = Abc_Clock(); // start the solver pSat = sat_solver_new(); sat_solver_store_alloc( pSat ); @@ -246,7 +246,7 @@ clk = clock(); // solve the problem status = sat_solver_solve( pSat, NULL, NULL, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0, (ABC_INT64_T)0 ); -timeSat += clock() - clk; +timeSat += Abc_Clock() - clk; if ( status == l_False ) { pSatCnf = sat_solver_store_release( pSat ); @@ -269,11 +269,11 @@ timeSat += clock() - clk; } // create the resulting manager -clk = clock(); +clk = Abc_Clock(); pManInter = Inta_ManAlloc(); pRes = (Aig_Man_t *)Inta_ManInterpolate( pManInter, (Sto_Man_t *)pSatCnf, vVarsAB, fVerbose ); Inta_ManFree( pManInter ); -timeInt += clock() - clk; +timeInt += Abc_Clock() - clk; /* // test UNSAT core computation { diff --git a/src/aig/aig/aigJust.c b/src/aig/aig/aigJust.c index 2ee60748..c420b2d9 100644 --- a/src/aig/aig/aigJust.c +++ b/src/aig/aig/aigJust.c @@ -254,7 +254,7 @@ void Aig_ManJustExperiment( Aig_Man_t * pAig ) Vec_Int_t * vSuppLits, * vNodes; Aig_Obj_t * pObj; int i; - clock_t clk = clock(); + abctime clk = Abc_Clock(); int Count0 = 0, Count0f = 0, Count1 = 0, Count1f = 0; int nTotalLits = 0; vSuppLits = Vec_IntAlloc( 100 ); @@ -295,7 +295,7 @@ void Aig_ManJustExperiment( Aig_Man_t * pAig ) Vec_IntFree( vSuppLits ); printf( "PO =%6d. C0 =%6d. C0f =%6d. C1 =%6d. C1f =%6d. (%6.2f %%) Ave =%4.1f ", Aig_ManCoNum(pAig), Count0, Count0f, Count1, Count1f, 100.0*(Count0+Count1)/Aig_ManCoNum(pAig), 1.0*nTotalLits/(Count0+Count1) ); - Abc_PrintTime( 1, "T", clock() - clk ); + Abc_PrintTime( 1, "T", Abc_Clock() - clk ); Aig_ManCleanMarkAB( pAig ); Aig_ManPackStop( pPack ); Vec_IntFree( vNodes ); diff --git a/src/aig/aig/aigPart.c b/src/aig/aig/aigPart.c index 717f3192..9b978e3b 100644 --- a/src/aig/aig/aigPart.c +++ b/src/aig/aig/aigPart.c @@ -689,20 +689,20 @@ Vec_Ptr_t * Aig_ManPartitionSmart( Aig_Man_t * p, int nSuppSizeLimit, int fVerbo Vec_Ptr_t * vSupports, * vPartsAll, * vPartsAll2, * vPartSuppsAll;//, * vPartPtr; Vec_Int_t * vOne, * vPart, * vPartSupp, * vTemp; int i, iPart, iOut; - clock_t clk; + abctime clk; // compute the supports for all outputs -clk = clock(); +clk = Abc_Clock(); vSupports = Aig_ManSupports( p ); if ( fVerbose ) { -ABC_PRT( "Supps", clock() - clk ); +ABC_PRT( "Supps", Abc_Clock() - clk ); } // start char-based support representation vPartSuppsBit = Vec_PtrAlloc( 1000 ); // create partitions -clk = clock(); +clk = Abc_Clock(); vPartsAll = Vec_PtrAlloc( 256 ); vPartSuppsAll = Vec_PtrAlloc( 256 ); Vec_PtrForEachEntry( Vec_Int_t *, vSupports, vOne, i ) @@ -748,10 +748,10 @@ clk = clock(); //printf( "\n" ); if ( fVerbose ) { -ABC_PRT( "Parts", clock() - clk ); +ABC_PRT( "Parts", Abc_Clock() - clk ); } -clk = clock(); +clk = Abc_Clock(); // reorder partitions in the decreasing order of support sizes // remember partition number in each partition support Vec_PtrForEachEntry( Vec_Int_t *, vPartSuppsAll, vOne, i ) @@ -774,7 +774,7 @@ clk = clock(); if ( fVerbose ) { -//ABC_PRT( "Comps", clock() - clk ); +//ABC_PRT( "Comps", Abc_Clock() - clk ); } // cleanup @@ -814,24 +814,24 @@ Vec_Ptr_t * Aig_ManPartitionSmartRegisters( Aig_Man_t * pAig, int nSuppSizeLimit Vec_Ptr_t * vSupports, * vPartsAll, * vPartsAll2, * vPartSuppsAll; Vec_Int_t * vOne, * vPart, * vPartSupp, * vTemp; int i, iPart, iOut; - clock_t clk; + abctime clk; // add output number to each -clk = clock(); +clk = Abc_Clock(); vSupports = Aig_ManSupportsRegisters( pAig ); assert( Vec_PtrSize(vSupports) == Aig_ManRegNum(pAig) ); Vec_PtrForEachEntry( Vec_Int_t *, vSupports, vOne, i ) Vec_IntPush( vOne, i ); if ( fVerbose ) { -ABC_PRT( "Supps", clock() - clk ); +ABC_PRT( "Supps", Abc_Clock() - clk ); } // start char-based support representation vPartSuppsBit = Vec_PtrAlloc( 1000 ); // create partitions -clk = clock(); +clk = Abc_Clock(); vPartsAll = Vec_PtrAlloc( 256 ); vPartSuppsAll = Vec_PtrAlloc( 256 ); Vec_PtrForEachEntry( Vec_Int_t *, vSupports, vOne, i ) @@ -877,10 +877,10 @@ clk = clock(); //printf( "\n" ); if ( fVerbose ) { -ABC_PRT( "Parts", clock() - clk ); +ABC_PRT( "Parts", Abc_Clock() - clk ); } -clk = clock(); +clk = Abc_Clock(); // reorder partitions in the decreasing order of support sizes // remember partition number in each partition support Vec_PtrForEachEntry( Vec_Int_t *, vPartSuppsAll, vOne, i ) @@ -903,7 +903,7 @@ clk = clock(); if ( fVerbose ) { -//ABC_PRT( "Comps", clock() - clk ); +//ABC_PRT( "Comps", Abc_Clock() - clk ); } // cleanup diff --git a/src/aig/aig/aigPartSat.c b/src/aig/aig/aigPartSat.c index ec6a6d73..2794e886 100644 --- a/src/aig/aig/aigPartSat.c +++ b/src/aig/aig/aigPartSat.c @@ -498,10 +498,10 @@ int Aig_ManPartitionedSat( Aig_Man_t * p, int nAlgo, int nPartSize, Vec_Int_t * vNode2Part, * vNode2Var; int nConfRemaining = nConfTotal, nNodes = 0; int i, status, RetValue = -1; - clock_t clk; + abctime clk; // perform partitioning according to the selected algorithm - clk = clock(); + clk = Abc_Clock(); switch ( nAlgo ) { case 0: @@ -524,7 +524,7 @@ int Aig_ManPartitionedSat( Aig_Man_t * p, int nAlgo, int nPartSize, if ( fVerbose ) { printf( "Partitioning derived %d partitions. ", Vec_IntFindMax(vNode2Part) + 1 ); - ABC_PRT( "Time", clock() - clk ); + ABC_PRT( "Time", Abc_Clock() - clk ); } // split the original AIG into partition AIGs (vAigs) @@ -536,7 +536,7 @@ int Aig_ManPartitionedSat( Aig_Man_t * p, int nAlgo, int nPartSize, if ( fVerbose ) { printf( "Partions were transformed into AIGs. " ); - ABC_PRT( "Time", clock() - clk ); + ABC_PRT( "Time", Abc_Clock() - clk ); } // synthesize partitions @@ -557,7 +557,7 @@ int Aig_ManPartitionedSat( Aig_Man_t * p, int nAlgo, int nPartSize, // add partitions, one at a time, and run the SAT solver Vec_PtrForEachEntry( Aig_Man_t *, vAigs, pAig, i ) { -clk = clock(); +clk = Abc_Clock(); // transform polarity of the AIG if ( fAlignPol ) Aig_ManPartSetNodePolarity( p, pAig, Vec_VecEntryInt(vPio2Id,i) ); @@ -577,7 +577,7 @@ clk = clock(); printf( "%4d : Aig = %6d. Vs = %7d. RootCs = %7d. LearnCs = %6d. ", i, nNodes += Aig_ManNodeNum(pAig), sat_solver_nvars(pSat), (int)pSat->stats.clauses, (int)pSat->stats.learnts ); -ABC_PRT( "Time", clock() - clk ); +ABC_PRT( "Time", Abc_Clock() - clk ); } // analize the result if ( status == l_False ) diff --git a/src/aig/aig/aigRet.c b/src/aig/aig/aigRet.c index c36e8709..fbdee61f 100644 --- a/src/aig/aig/aigRet.c +++ b/src/aig/aig/aigRet.c @@ -839,10 +839,10 @@ Aig_Man_t * Rtm_ManRetime( Aig_Man_t * p, int fForward, int nStepsMax, int fVerb Rtm_Obj_t * pObj, * pNext; Aig_Obj_t * pObjAig; int i, k, nAutos, Degree, DegreeMax = 0; - clock_t clk; + abctime clk; // create the retiming manager -clk = clock(); +clk = Abc_Clock(); pRtm = Rtm_ManFromAig( p ); // set registers Aig_ManForEachLoSeq( p, pObjAig, i ) @@ -855,7 +855,7 @@ clk = clock(); if ( fVerbose ) { printf( "Detected %d autonomous objects. ", nAutos ); - ABC_PRT( "Time", clock() - clk ); + ABC_PRT( "Time", Abc_Clock() - clk ); } // set the current retiming number @@ -866,7 +866,7 @@ clk = clock(); pObj->Num = 0; } -clk = clock(); +clk = Abc_Clock(); // put the LOs on the queue vQueue = Vec_PtrAlloc( 1000 ); if ( fForward ) @@ -946,7 +946,7 @@ clk = clock(); printf( "Performed %d %s latch moves of max depth %d and max latch count %d.\n", Vec_PtrSize(vQueue), fForward? "fwd":"bwd", DegreeMax, Rtm_ManLatchMax(pRtm) ); printf( "Memory usage = %d. ", pRtm->nExtraCur ); - ABC_PRT( "Time", clock() - clk ); + ABC_PRT( "Time", Abc_Clock() - clk ); } Vec_PtrFree( vQueue ); @@ -956,11 +956,11 @@ clk = clock(); pNew->pSpec = Abc_UtilStrsav( p->pSpec ); Rtm_ManFree( pRtm ); // group the registers -clk = clock(); +clk = Abc_Clock(); pNew = Aig_ManReduceLaches( pNew, fVerbose ); if ( fVerbose ) { - ABC_PRT( "Register sharing time", clock() - clk ); + ABC_PRT( "Register sharing time", Abc_Clock() - clk ); } return pNew; } diff --git a/src/aig/aig/aigSplit.c b/src/aig/aig/aigSplit.c index 7f89638a..90884b8b 100644 --- a/src/aig/aig/aigSplit.c +++ b/src/aig/aig/aigSplit.c @@ -259,7 +259,7 @@ Aig_Man_t * Aig_ManSplit( Aig_Man_t * p, int nVars, int fVerbose ) DdManager * dd; Vec_Ptr_t * vSupp, * vSubs, * vCofs; int i; - clock_t clk = clock(); + abctime clk = Abc_Clock(); if ( Saig_ManPoNum(p) != 1 ) { printf( "Currently works only for one primary output.\n" ); @@ -297,7 +297,7 @@ Aig_Man_t * Aig_ManSplit( Aig_Man_t * p, int nVars, int fVerbose ) if ( fVerbose ) printf( "Created %d cofactors (out of %d). ", Saig_ManPoNum(pRes), Vec_PtrSize(vCofs) ); if ( fVerbose ) - Abc_PrintTime( 1, "Time", clock() - clk ); + Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); // dereference Cudd_RecursiveDeref( dd, bFunc ); Vec_PtrForEachEntry( DdNode *, vCofs, bFunc, i ) diff --git a/src/aig/aig/aigTable.c b/src/aig/aig/aigTable.c index abd9960a..2c7adee7 100644 --- a/src/aig/aig/aigTable.c +++ b/src/aig/aig/aigTable.c @@ -71,9 +71,9 @@ void Aig_TableResize( Aig_Man_t * p ) Aig_Obj_t * pEntry, * pNext; Aig_Obj_t ** pTableOld, ** ppPlace; int nTableSizeOld, Counter, i; - clock_t clk; + abctime clk; assert( p->pTable != NULL ); -clk = clock(); +clk = Abc_Clock(); // save the old table pTableOld = p->pTable; nTableSizeOld = p->nTableSize; @@ -97,7 +97,7 @@ clk = clock(); } assert( Counter == Aig_ManNodeNum(p) ); // printf( "Increasing the structural table size from %6d to %6d. ", nTableSizeOld, p->nTableSize ); -// ABC_PRT( "Time", clock() - clk ); +// ABC_PRT( "Time", Abc_Clock() - clk ); // replace the table and the parameters ABC_FREE( pTableOld ); } |