diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-07-07 17:46:54 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-07-07 17:46:54 -0700 |
commit | 3aab7245738a69f1dd4d898493d5dabf6596ea61 (patch) | |
tree | 16a23107ca27a250e82c492dcdd1a2bea640cff6 | |
parent | 16d96fcf533fb77ff4a45992991e38ac7ea74bb3 (diff) | |
download | abc-3aab7245738a69f1dd4d898493d5dabf6596ea61.tar.gz abc-3aab7245738a69f1dd4d898493d5dabf6596ea61.tar.bz2 abc-3aab7245738a69f1dd4d898493d5dabf6596ea61.zip |
Fixing time primtouts throughout the code.
331 files changed, 1277 insertions, 1091 deletions
diff --git a/src/aig/aig/aig.h b/src/aig/aig/aig.h index 3c390a37..adad1837 100644 --- a/src/aig/aig/aig.h +++ b/src/aig/aig/aig.h @@ -30,7 +30,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/vec/vec.h" #include "src/misc/util/utilCex.h" @@ -165,8 +164,8 @@ struct Aig_Man_t_ Vec_Int_t * vCiNumsOrig; // original CI names int nComplEdges; // complemented edges // timing statistics - int time1; - int time2; + clock_t time1; + clock_t time2; }; // cut computation diff --git a/src/aig/aig/aigCuts.c b/src/aig/aig/aigCuts.c index ed824fac..5e3bb93a 100644 --- a/src/aig/aig/aigCuts.c +++ b/src/aig/aig/aigCuts.c @@ -632,7 +632,8 @@ Aig_ManCut_t * Aig_ComputeCuts( Aig_Man_t * pAig, int nCutsMax, int nLeafMax, in { Aig_ManCut_t * p; Aig_Obj_t * pObj; - int i, clk = clock(); + int i; + clock_t clk = clock(); assert( pAig->pManCuts == NULL ); // start the manager p = Aig_ManCutStart( pAig, nCutsMax, nLeafMax, fTruth, fVerbose ); diff --git a/src/aig/aig/aigDfs.c b/src/aig/aig/aigDfs.c index ace723a2..b4b7862e 100644 --- a/src/aig/aig/aigDfs.c +++ b/src/aig/aig/aigDfs.c @@ -767,7 +767,8 @@ int Aig_SupportSize( Aig_Man_t * p, Aig_Obj_t * pObj ) int Aig_SupportSizeTest( Aig_Man_t * p ) { Aig_Obj_t * pObj; - int i, Counter = 0, clk = clock(); + int i, Counter = 0; + clock_t clk = clock(); Aig_ManForEachObj( p, pObj, i ) if ( Aig_ObjIsNode(pObj) ) Counter += (Aig_SupportSize(p, pObj) <= 16); diff --git a/src/aig/aig/aigDoms.c b/src/aig/aig/aigDoms.c index 00350304..fe9403b5 100644 --- a/src/aig/aig/aigDoms.c +++ b/src/aig/aig/aigDoms.c @@ -623,7 +623,8 @@ Aig_Sto_t * Aig_ManComputeDomsFlops( Aig_Man_t * pAig, int Limit ) Aig_Sto_t * pSto; Vec_Ptr_t * vNodes; Aig_Obj_t * pObj; - int i, clk = clock(); + int i; + clock_t clk = clock(); pSto = Aig_ManDomStart( pAig, Limit ); // initialize flop inputs Saig_ManForEachLi( pAig, pObj, i ) @@ -663,7 +664,8 @@ Aig_Sto_t * Aig_ManComputeDomsPis( Aig_Man_t * pAig, int Limit ) Aig_Sto_t * pSto; Vec_Ptr_t * vNodes; Aig_Obj_t * pObj; - int i, clk = clock(); + int i; + clock_t clk = clock(); pSto = Aig_ManDomStart( pAig, Limit ); // initialize flop inputs Aig_ManForEachCo( pAig, pObj, i ) @@ -703,7 +705,8 @@ Aig_Sto_t * Aig_ManComputeDomsNodes( Aig_Man_t * pAig, int Limit ) Aig_Sto_t * pSto; Vec_Ptr_t * vNodes; Aig_Obj_t * pObj; - int i, clk = clock(); + int i; + clock_t clk = clock(); pSto = Aig_ManDomStart( pAig, Limit ); // initialize flop inputs Aig_ManForEachCo( pAig, pObj, i ) diff --git a/src/aig/aig/aigInter.c b/src/aig/aig/aigInter.c index fcf32236..6f183925 100644 --- a/src/aig/aig/aigInter.c +++ b/src/aig/aig/aigInter.c @@ -29,9 +29,9 @@ ABC_NAMESPACE_IMPL_START /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// -extern int timeCnf; -extern int timeSat; -extern int timeInt; +extern clock_t timeCnf; +extern clock_t timeSat; +extern clock_t timeInt; //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// @@ -156,7 +156,7 @@ 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; - int clk; + clock_t clk; int iLast = -1; // Suppress "might be used uninitialized" assert( Aig_ManCiNum(pManOn) == Aig_ManCiNum(pManOff) ); diff --git a/src/aig/aig/aigJust.c b/src/aig/aig/aigJust.c index 2c524c85..2ee60748 100644 --- a/src/aig/aig/aigJust.c +++ b/src/aig/aig/aigJust.c @@ -253,7 +253,9 @@ void Aig_ManJustExperiment( Aig_Man_t * pAig ) Aig_ManPack_t * pPack; Vec_Int_t * vSuppLits, * vNodes; Aig_Obj_t * pObj; - int i, clk = clock(), Count0 = 0, Count0f = 0, Count1 = 0, Count1f = 0; + int i; + clock_t clk = clock(); + int Count0 = 0, Count0f = 0, Count1 = 0, Count1f = 0; int nTotalLits = 0; vSuppLits = Vec_IntAlloc( 100 ); pPack = Aig_ManPackStart( pAig ); diff --git a/src/aig/aig/aigPart.c b/src/aig/aig/aigPart.c index 56d2fd3f..fdbba36a 100644 --- a/src/aig/aig/aigPart.c +++ b/src/aig/aig/aigPart.c @@ -688,7 +688,8 @@ Vec_Ptr_t * Aig_ManPartitionSmart( Aig_Man_t * p, int nSuppSizeLimit, int fVerbo Vec_Ptr_t * vPartSuppsBit; Vec_Ptr_t * vSupports, * vPartsAll, * vPartsAll2, * vPartSuppsAll;//, * vPartPtr; Vec_Int_t * vOne, * vPart, * vPartSupp, * vTemp; - int i, iPart, iOut, clk; + int i, iPart, iOut; + clock_t clk; // compute the supports for all outputs clk = clock(); @@ -812,7 +813,8 @@ Vec_Ptr_t * Aig_ManPartitionSmartRegisters( Aig_Man_t * pAig, int nSuppSizeLimit Vec_Ptr_t * vPartSuppsBit; Vec_Ptr_t * vSupports, * vPartsAll, * vPartsAll2, * vPartSuppsAll; Vec_Int_t * vOne, * vPart, * vPartSupp, * vTemp; - int i, iPart, iOut, clk; + int i, iPart, iOut; + clock_t clk; // add output number to each clk = clock(); diff --git a/src/aig/aig/aigPartSat.c b/src/aig/aig/aigPartSat.c index 839a17ee..d187a19b 100644 --- a/src/aig/aig/aigPartSat.c +++ b/src/aig/aig/aigPartSat.c @@ -497,7 +497,8 @@ int Aig_ManPartitionedSat( Aig_Man_t * p, int nAlgo, int nPartSize, Aig_Man_t * pAig, * pTemp; Vec_Int_t * vNode2Part, * vNode2Var; int nConfRemaining = nConfTotal, nNodes = 0; - int i, clk, status, RetValue = -1; + int i, status, RetValue = -1; + clock_t clk; // perform partitioning according to the selected algorithm clk = clock(); diff --git a/src/aig/aig/aigRepar.c b/src/aig/aig/aigRepar.c index 1b017346..7f9699fd 100644 --- a/src/aig/aig/aigRepar.c +++ b/src/aig/aig/aigRepar.c @@ -129,7 +129,7 @@ void Aig_ManInterTest( Aig_Man_t * pMan, int fVerbose ) Cnf_Dat_t * pCnf; Aig_Obj_t * pObj; int Lit, Cid, Var, status, i; - int clk = clock(); + clock_t clk = clock(); assert( Aig_ManRegNum(pMan) == 0 ); assert( Aig_ManCoNum(pMan) == 1 ); @@ -251,7 +251,7 @@ Aig_Man_t * Aig_ManInterRepar( Aig_Man_t * pMan, int fVerbose ) int nOuts = Aig_ManCoNum(pMan); int ShiftP[2], ShiftCnf[2], ShiftOr[2], ShiftAssume; int Cid, Lit, status, i, k, c; - int clk = clock(); + clock_t clk = clock(); assert( Aig_ManRegNum(pMan) == 0 ); // derive CNFs diff --git a/src/aig/aig/aigRet.c b/src/aig/aig/aigRet.c index 58a04fb0..1cf45ebe 100644 --- a/src/aig/aig/aigRet.c +++ b/src/aig/aig/aigRet.c @@ -839,7 +839,7 @@ 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; - int clk; + clock_t clk; // create the retiming manager clk = clock(); diff --git a/src/aig/aig/aigSplit.c b/src/aig/aig/aigSplit.c index f187860f..50f96a81 100644 --- a/src/aig/aig/aigSplit.c +++ b/src/aig/aig/aigSplit.c @@ -258,7 +258,8 @@ Aig_Man_t * Aig_ManSplit( Aig_Man_t * p, int nVars, int fVerbose ) DdNode * bFunc; DdManager * dd; Vec_Ptr_t * vSupp, * vSubs, * vCofs; - int i, clk = clock(); + int i; + clock_t clk = clock(); if ( Saig_ManPoNum(p) != 1 ) { printf( "Currently works only for one primary output.\n" ); diff --git a/src/aig/aig/aigTable.c b/src/aig/aig/aigTable.c index ec2531c7..abd9960a 100644 --- a/src/aig/aig/aigTable.c +++ b/src/aig/aig/aigTable.c @@ -70,7 +70,8 @@ void Aig_TableResize( Aig_Man_t * p ) { Aig_Obj_t * pEntry, * pNext; Aig_Obj_t ** pTableOld, ** ppPlace; - int nTableSizeOld, Counter, i, clk; + int nTableSizeOld, Counter, i; + clock_t clk; assert( p->pTable != NULL ); clk = clock(); // save the old table diff --git a/src/aig/gia/gia.h b/src/aig/gia/gia.h index a5c075c3..0d97dd61 100644 --- a/src/aig/gia/gia.h +++ b/src/aig/gia/gia.h @@ -30,7 +30,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/vec/vec.h" #include "src/misc/util/utilCex.h" diff --git a/src/aig/gia/giaAbsGla.c b/src/aig/gia/giaAbsGla.c index 1a4e9cd2..c25c6e48 100644 --- a/src/aig/gia/giaAbsGla.c +++ b/src/aig/gia/giaAbsGla.c @@ -800,13 +800,10 @@ Vec_Int_t * Gla_ManRefinement( Gla_Man_t * p ) // select objects vSelect = Vec_IntAlloc( 100 ); -// Vec_IntFill( p->vPrioSels, Vec_IntSize(vPPis)+1, 0 ); Vec_IntFill( p->vObjCounts, p->pPars->iFrame+1, 0 ); Gla_ManRefSelect_rec( p, Gia_ObjFanin0(Gia_ManPo(p->pGia, 0)), p->pPars->iFrame, vSelect, Sign ); Vec_IntUniqify( vSelect ); -// printf( "\nSelected %d.\n", Vec_IntSize(vSelect) ); - /* for ( f = 0; f < p->pPars->iFrame; f++ ) printf( "%2d", Vec_IntEntry(p->vObjCounts, f) ); @@ -976,7 +973,6 @@ Gla_Man_t * Gla_ManStart( Gia_Man_t * pGia0, Gia_ParVta_t * pPars ) p->pGia = Gia_ManDupMapped( pGia0, p->pCnf->vMapping ); if ( pPars->fPropFanout ) Gia_ManStaticFanoutStart( p->pGia ); -//printf( "Old GIA = %d. New GIA = %d.\n", Gia_ManObjNum(pGia0), Gia_ManObjNum(p->pGia) ); // derive new gate map assert( pGia0->vGateClasses != 0 ); @@ -1797,7 +1793,7 @@ int Gia_GlaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars, int fStartVta ) p->timeInit = clock() - clk; // set runtime limit if ( p->pPars->nTimeOut ) - sat_solver2_set_runtime_limit( p->pSat, time(NULL) + p->pPars->nTimeOut - 1 ); + sat_solver2_set_runtime_limit( p->pSat, p->pPars->nTimeOut * CLOCKS_PER_SEC + clock() ); // perform initial abstraction if ( p->pPars->fVerbose ) { @@ -1831,9 +1827,9 @@ int Gia_GlaPerform( Gia_Man_t * pAig, Gia_ParVta_t * pPars, int fStartVta ) goto finish; } // check timeout - if ( p->pSat->nRuntimeLimit && time(NULL) > p->pSat->nRuntimeLimit ) + if ( p->pSat->nRuntimeLimit && clock() > p->pSat->nRuntimeLimit ) { - Gla_ManRollBack( p ); // 1155046 + Gla_ManRollBack( p ); goto finish; } if ( vCore != NULL ) @@ -1960,7 +1956,7 @@ finish: pAig->vGateClasses = Gla_ManTranslate( p ); if ( Status == -1 ) { - if ( p->pPars->nTimeOut && time(NULL) >= p->pSat->nRuntimeLimit ) + if ( p->pPars->nTimeOut && clock() >= p->pSat->nRuntimeLimit ) Abc_Print( 1, "SAT solver ran out of time at %d sec in frame %d. ", p->pPars->nTimeOut, f ); else if ( pPars->nConfLimit && sat_solver2_nconflicts(p->pSat) >= pPars->nConfLimit ) Abc_Print( 1, "SAT solver ran out of resources at %d conflicts in frame %d. ", pPars->nConfLimit, f ); diff --git a/src/aig/gia/giaAbsVta.c b/src/aig/gia/giaAbsVta.c index 7b66b7dd..11c84853 100644 --- a/src/aig/gia/giaAbsVta.c +++ b/src/aig/gia/giaAbsVta.c @@ -1564,7 +1564,7 @@ int Gia_VtaPerformInt( Gia_Man_t * pAig, Gia_ParVta_t * pPars ) p = Vga_ManStart( pAig, pPars ); // set runtime limit if ( p->pPars->nTimeOut ) - sat_solver2_set_runtime_limit( p->pSat, time(NULL) + p->pPars->nTimeOut - 1 ); + sat_solver2_set_runtime_limit( p->pSat, p->pPars->nTimeOut * CLOCKS_PER_SEC + clock() ); // perform initial abstraction if ( p->pPars->fVerbose ) { @@ -1609,7 +1609,7 @@ int Gia_VtaPerformInt( Gia_Man_t * pAig, Gia_ParVta_t * pPars ) goto finish; } // check timeout - if ( p->pSat->nRuntimeLimit && time(NULL) > p->pSat->nRuntimeLimit ) + if ( p->pSat->nRuntimeLimit && clock() > p->pSat->nRuntimeLimit ) { Vga_ManRollBack( p, nObjOld ); goto finish; @@ -1716,7 +1716,7 @@ finish: pAig->vObjClasses = Gia_VtaFramesToAbs( (Vec_Vec_t *)p->vCores ); if ( Status == -1 ) { - if ( p->pPars->nTimeOut && time(NULL) >= p->pSat->nRuntimeLimit ) + if ( p->pPars->nTimeOut && clock() >= p->pSat->nRuntimeLimit ) Abc_Print( 1, "SAT solver ran out of time at %d sec in frame %d. ", p->pPars->nTimeOut, f ); else if ( pPars->nConfLimit && sat_solver2_nconflicts(p->pSat) >= pPars->nConfLimit ) Abc_Print( 1, "SAT solver ran out of resources at %d conflicts in frame %d. ", pPars->nConfLimit, f ); diff --git a/src/aig/gia/giaCCof.c b/src/aig/gia/giaCCof.c index 6fbd1095..ce863051 100644 --- a/src/aig/gia/giaCCof.c +++ b/src/aig/gia/giaCCof.c @@ -219,8 +219,9 @@ int Gia_ManCofOneDerive( Ccf_Man_t * p, int LitProp ) ***********************************************************************/ int Gia_ManCofGetReachable( Ccf_Man_t * p, int Lit ) { - int ObjPrev = 0, ConfPrev = 0, clk; + int ObjPrev = 0, ConfPrev = 0; int Count = 0, LitOut, RetValue; + clock_t clk; // try solving for the first time and quit if converged RetValue = sat_solver_solve( p->pSat, &Lit, &Lit + 1, p->nConfMax, 0, 0, 0 ); if ( RetValue == l_False ) @@ -268,8 +269,8 @@ Gia_Man_t * Gia_ManCofTest( Gia_Man_t * pGia, int nFrameMax, int nConfMax, int n Ccf_Man_t * p; Gia_Obj_t * pObj; int f, i, Lit, RetValue = -1, fFailed = 0; - int nTimeToStop = time(NULL) + nTimeMax; - int clk = clock(); + clock_t nTimeToStop = clock() + nTimeMax * CLOCKS_PER_SEC; + clock_t clk = clock(); assert( Gia_ManPoNum(pGia) == 1 ); // create reachability manager @@ -309,7 +310,7 @@ Gia_Man_t * Gia_ManCofTest( Gia_Man_t * pGia, int nFrameMax, int nConfMax, int n } // report the result - if ( nTimeToStop && time(NULL) > nTimeToStop ) + if ( nTimeToStop && clock() > nTimeToStop ) printf( "Runtime limit (%d sec) is reached after %d frames. ", nTimeMax, f ); else if ( f == nFrameMax ) printf( "Completed %d frames without converging. ", f ); diff --git a/src/aig/gia/giaCSat.c b/src/aig/gia/giaCSat.c index d83f79e9..b4bc5b3e 100644 --- a/src/aig/gia/giaCSat.c +++ b/src/aig/gia/giaCSat.c @@ -81,10 +81,10 @@ struct Cbs_Man_t_ int nConfSat; // conflicts in sat problems int nConfUndec; // conflicts in undec problems // runtime stats - int timeSatUnsat; // unsat - int timeSatSat; // sat - int timeSatUndec; // undecided - int timeTotal; // total runtime + clock_t timeSatUnsat; // unsat + clock_t timeSatSat; // sat + clock_t timeSatUndec; // undecided + clock_t timeTotal; // total runtime }; static inline int Cbs_VarIsAssigned( Gia_Obj_t * pVar ) { return pVar->fMark0; } @@ -1003,7 +1003,8 @@ Vec_Int_t * Cbs_ManSolveMiterNc( Gia_Man_t * pAig, int nConfs, Vec_Str_t ** pvSt Vec_Int_t * vCex, * vVisit, * vCexStore; Vec_Str_t * vStatus; Gia_Obj_t * pRoot; - int i, status, clk, clkTotal = clock(); + int i, status; + clock_t clk, clkTotal = clock(); assert( Gia_ManRegNum(pAig) == 0 ); // Gia_ManCollectTest( pAig ); // prepare AIG diff --git a/src/aig/gia/giaCSatOld.c b/src/aig/gia/giaCSatOld.c index 8198c17f..1dd4a425 100644 --- a/src/aig/gia/giaCSatOld.c +++ b/src/aig/gia/giaCSatOld.c @@ -73,10 +73,10 @@ struct Cbs0_Man_t_ int nConfSat; // conflicts in sat problems int nConfUndec; // conflicts in undec problems // runtime stats - int timeSatUnsat; // unsat - int timeSatSat; // sat - int timeSatUndec; // undecided - int timeTotal; // total runtime + clock_t timeSatUnsat; // unsat + clock_t timeSatSat; // sat + clock_t timeSatUndec; // undecided + clock_t timeTotal; // total runtime }; static inline int Cbs0_VarIsAssigned( Gia_Obj_t * pVar ) { return pVar->fMark0; } @@ -712,7 +712,8 @@ Vec_Int_t * Cbs_ManSolveMiter( Gia_Man_t * pAig, int nConfs, Vec_Str_t ** pvStat Vec_Int_t * vCex, * vVisit, * vCexStore; Vec_Str_t * vStatus; Gia_Obj_t * pRoot; - int i, status, clk, clkTotal = clock(); + int i, status; + clock_t clk, clkTotal = clock(); assert( Gia_ManRegNum(pAig) == 0 ); // prepare AIG Gia_ManCreateRefs( pAig ); diff --git a/src/aig/gia/giaCTas.c b/src/aig/gia/giaCTas.c index 8cfa9efc..6dd0e0fa 100644 --- a/src/aig/gia/giaCTas.c +++ b/src/aig/gia/giaCTas.c @@ -108,10 +108,10 @@ struct Tas_Man_t_ int nConfSat; // conflicts in sat problems int nConfUndec; // conflicts in undec problems // runtime stats - int timeSatUnsat; // unsat - int timeSatSat; // sat - int timeSatUndec; // undecided - int timeTotal; // total runtime + clock_t timeSatUnsat; // unsat + clock_t timeSatSat; // sat + clock_t timeSatUndec; // undecided + clock_t timeTotal; // total runtime }; static inline int Tas_VarIsAssigned( Gia_Obj_t * pVar ) { return pVar->fMark0; } @@ -1524,7 +1524,8 @@ Vec_Int_t * Tas_ManSolveMiterNc( Gia_Man_t * pAig, int nConfs, Vec_Str_t ** pvSt Gia_Obj_t * pRoot;//, * pRootCopy; // Gia_Man_t * pAigCopy = Gia_ManDup( pAig ), * pAigTemp; - int i, status, clk, clkTotal = clock(); + int i, status; + clock_t clk, clkTotal = clock(); assert( Gia_ManRegNum(pAig) == 0 ); // Gia_ManCollectTest( pAig ); // prepare AIG @@ -1703,7 +1704,8 @@ void Tas_ManSolveMiterNc2( Gia_Man_t * pAig, int nConfs, Gia_Man_t * pAigOld, Ve Vec_Int_t * vCex, * vVisit, * vCexStore; Vec_Str_t * vStatus; Gia_Obj_t * pRoot, * pOldRoot; - int i, status, clk, clkTotal = clock(); + int i, status; + clock_t clk, clkTotal = clock(); int Tried = 0, Stored = 0, Step = Gia_ManCoNum(pAig) / nPatMax; assert( Gia_ManRegNum(pAig) == 0 ); // Gia_ManCollectTest( pAig ); diff --git a/src/aig/gia/giaCTas2.c b/src/aig/gia/giaCTas2.c index 855dcdd3..2b1d7169 100644 --- a/src/aig/gia/giaCTas2.c +++ b/src/aig/gia/giaCTas2.c @@ -115,10 +115,10 @@ struct Tas_Man_t_ int nConfUndec; // conflicts in undec problems int nConfTotal; // total conflicts // runtime stats - int timeSatUnsat; // unsat - int timeSatSat; // sat - int timeSatUndec; // undecided - int timeTotal; // total runtime + clock_t timeSatUnsat; // unsat + clock_t timeSatSat; // sat + clock_t timeSatUndec; // undecided + clock_t timeTotal; // total runtime }; static inline int Tas_VarIsAssigned( Tas_Var_t * pVar ) { return pVar->fAssign; } diff --git a/src/aig/gia/giaCof.c b/src/aig/gia/giaCof.c index cf8ecf00..68d269cd 100644 --- a/src/aig/gia/giaCof.c +++ b/src/aig/gia/giaCof.c @@ -672,7 +672,7 @@ void Cof_ManPrintFanio( Cof_Man_t * p ) void Gia_ManPrintFanio( Gia_Man_t * pGia, int nNodes ) { Cof_Man_t * p; - int clk = clock(); + clock_t clk = clock(); p = Cof_ManCreateLogicSimple( pGia ); p->nLevels = 1 + Gia_ManLevelNum( pGia ); p->pLevels = ABC_CALLOC( int, p->nLevels ); diff --git a/src/aig/gia/giaDfs.c b/src/aig/gia/giaDfs.c index 1ec18767..1da2da1f 100644 --- a/src/aig/gia/giaDfs.c +++ b/src/aig/gia/giaDfs.c @@ -209,7 +209,8 @@ void Gia_ManCollectTest( Gia_Man_t * p ) { Vec_Int_t * vNodes; Gia_Obj_t * pObj; - int i, iNode, clk = clock(); + int i, iNode; + clock_t clk = clock(); vNodes = Vec_IntAlloc( 100 ); Gia_ManIncrementTravId( p ); Gia_ManForEachCo( p, pObj, i ) @@ -275,7 +276,8 @@ int Gia_ManSuppSizeOne( Gia_Man_t * p, Gia_Obj_t * pObj ) int Gia_ManSuppSizeTest( Gia_Man_t * p ) { Gia_Obj_t * pObj; - int i, Counter = 0, clk = clock(); + int i, Counter = 0; + clock_t clk = clock(); Gia_ManForEachObj( p, pObj, i ) if ( Gia_ObjIsAnd(pObj) ) Counter += (Gia_ManSuppSizeOne(p, pObj) <= 16); diff --git a/src/aig/gia/giaEmbed.c b/src/aig/gia/giaEmbed.c index 1daf52a1..f71281cb 100644 --- a/src/aig/gia/giaEmbed.c +++ b/src/aig/gia/giaEmbed.c @@ -838,7 +838,8 @@ int Emb_ManComputeDistance_old( Emb_Man_t * p, Emb_Obj_t * pPivot ) void Gia_ManTestDistanceInternal( Emb_Man_t * p ) { int nAttempts = 20; - int i, iNode, Dist, clk; + int i, iNode, Dist; + clock_t clk; Emb_Obj_t * pPivot, * pNext; Gia_ManRandom( 1 ); Emb_ManResetTravId( p ); @@ -903,7 +904,7 @@ void Gia_ManTestDistanceInternal( Emb_Man_t * p ) void Gia_ManTestDistance( Gia_Man_t * pGia ) { Emb_Man_t * p; - int clk = clock(); + clock_t clk = clock(); p = Emb_ManStart( pGia ); // Emb_ManPrintFanio( p ); Emb_ManPrintStats( p ); @@ -1529,7 +1530,7 @@ void Emb_ManPlacementRefine( Emb_Man_t * p, int nIters, int fVerbose ) float VertX, VertY; int * pPermX, * pPermY; int i, k, Iter, iMinX, iMaxX, iMinY, iMaxY; - int clk = clock(); + clock_t clk = clock(); if ( p->pPlacement == NULL ) return; pEdgeX = ABC_ALLOC( float, p->nObjs ); @@ -1790,7 +1791,8 @@ void Emb_ManDumpGnuplot( Emb_Man_t * p, char * pName, int fDumpLarge, int fShowI void Gia_ManSolveProblem( Gia_Man_t * pGia, Emb_Par_t * pPars ) { Emb_Man_t * p; - int i, clk, clkSetup; + int i, clkSetup; + clock_t clk; // Gia_ManTestDistance( pGia ); // transform AIG into internal data-structure diff --git a/src/aig/gia/giaEra.c b/src/aig/gia/giaEra.c index 672149bc..03832e4a 100644 --- a/src/aig/gia/giaEra.c +++ b/src/aig/gia/giaEra.c @@ -501,7 +501,8 @@ int Gia_ManCollectReachable( Gia_Man_t * pAig, int nStatesMax, int fMiter, int f { Gia_ManEra_t * p; Gia_ObjEra_t * pState; - int Hash, clk = clock(); + int Hash; + clock_t clk = clock(); int RetValue = 1; assert( Gia_ManPiNum(pAig) <= 12 ); assert( Gia_ManRegNum(pAig) > 0 ); diff --git a/src/aig/gia/giaEra2.c b/src/aig/gia/giaEra2.c index 265335e2..f5f9fdb3 100644 --- a/src/aig/gia/giaEra2.c +++ b/src/aig/gia/giaEra2.c @@ -1536,7 +1536,8 @@ int Gia_ManAreDeriveNexts_rec( Gia_ManAre_t * p, Gia_PtrAre_t Sta ) Gia_Obj_t * pPivot; Vec_Int_t * vLits, * vTfos; Gia_Obj_t * pObj; - int i, clk; + int i; + clock_t clk; if ( ++p->nRecCalls == MAX_CALL_NUM ) return 0; if ( (pPivot = Gia_ManAreMostUsedPi(p)) == NULL ) @@ -1611,7 +1612,8 @@ int Gia_ManAreDeriveNexts( Gia_ManAre_t * p, Gia_PtrAre_t Sta ) { Gia_StaAre_t * pSta; Gia_Obj_t * pObj; - int i, RetValue, clk = clock(); + int i, RetValue; + clock_t clk = clock(); pSta = Gia_ManAreSta( p, Sta ); if ( Gia_StaIsUnused(pSta) ) return 0; @@ -1671,7 +1673,7 @@ int Gia_ManAreDeriveNexts( Gia_ManAre_t * p, Gia_PtrAre_t Sta ) SeeAlso [] ***********************************************************************/ -void Gia_ManArePrintReport( Gia_ManAre_t * p, int Time, int fFinal ) +void Gia_ManArePrintReport( Gia_ManAre_t * p, clock_t Time, int fFinal ) { printf( "States =%10d. Reached =%10d. R = %5.3f. Depth =%6d. Mem =%9.2f Mb. ", p->iStaCur, p->nStas, 1.0*p->iStaCur/p->nStas, Gia_ManAreDepth(p, p->iStaCur), @@ -1703,7 +1705,7 @@ int Gia_ManArePerform( Gia_Man_t * pAig, int nStatesMax, int fMiter, int fVerbos // extern Gia_Man_t * Gia_ManCompress2( Gia_Man_t * p, int fUpdateLevel, int fVerbose ); extern Abc_Cex_t * Gia_ManAreDeriveCex( Gia_ManAre_t * p, Gia_StaAre_t * pLast ); Gia_ManAre_t * p; - int clk = clock(); + clock_t clk = clock(); int RetValue = 1; if ( Gia_ManRegNum(pAig) > MAX_VARS_NUM ) { diff --git a/src/aig/gia/giaForce.c b/src/aig/gia/giaForce.c index 94ad069b..a905b220 100644 --- a/src/aig/gia/giaForce.c +++ b/src/aig/gia/giaForce.c @@ -892,7 +892,7 @@ void Frc_ManPlacementRefine( Frc_Man_t * p, int nIters, int fVerbose ) float * pVertX, VertX; int * pPermX, * pHandles; int k, h, Iter, iMinX, iMaxX, Counter, nCutStart, nCutCur, nCutCur2, nCutPrev; - int clk = clock(), clk2, clk2Total = 0; + clock_t clk = clock(), clk2, clk2Total = 0; // create starting one-dimensional placement vCoOrder = Frc_ManCollectCos( p ); if ( fRandomize ) @@ -1068,7 +1068,7 @@ void For_ManFileExperiment() FILE * pFile; int * pBuffer; int i, Size, Exp = 25; - int clk = clock(); + clock_t clk = clock(); int RetValue; Size = (1 << Exp); diff --git a/src/aig/gia/giaFrames.c b/src/aig/gia/giaFrames.c index 48a0568e..f3dbd95c 100644 --- a/src/aig/gia/giaFrames.c +++ b/src/aig/gia/giaFrames.c @@ -226,7 +226,7 @@ Gia_ManUnr_t * Gia_ManUnrStart( Gia_Man_t * pAig, Gia_ParFra_t * pPars ) Gia_ManUnr_t * p; Gia_Obj_t * pObj; int i, k, iRank, iFanin, Degree, Shift; - int clk = clock(); + clock_t clk = clock(); p = ABC_CALLOC( Gia_ManUnr_t, 1 ); p->pAig = pAig; @@ -605,7 +605,7 @@ Gia_Man_t * Gia_ManUnroll( Gia_ManUnr_t * p ) Gia_Man_t * Gia_ManFrames2( Gia_Man_t * pAig, Gia_ParFra_t * pPars ) { Gia_Man_t * pNew; - int clk = clock(); + clock_t clk = clock(); pNew = Gia_ManUnroll( pAig, pPars ); if ( pPars->fVerbose ) Abc_PrintTime( 1, "Time", clock() - clk ); diff --git a/src/aig/gia/giaGiarf.c b/src/aig/gia/giaGiarf.c index 2f18c16d..1e2d1d18 100644 --- a/src/aig/gia/giaGiarf.c +++ b/src/aig/gia/giaGiarf.c @@ -764,7 +764,7 @@ int Gia_ComputeEquivalencesLevel( Hcd_Man_t * p, Gia_Man_t * pGiaLev, Vec_Ptr_t Gia_Obj_t * pRoot, * pMember, * pMemberPrev, * pRepr, * pTempRepr; int i, k, nIter, iRoot, iRootNew, iMember, iMemberPrev, status, fOneFailed;//, iRepr;//, fTwoMember; int nSaved = 0, nRecords = 0, nUndec = 0, nClassRefs = 0, nTsat = 0, nMiniSat = 0; - int clk, timeTsat = 0, timeMiniSat = 0, timeSim = 0, timeTotal = clock(); + clock_t clk, timeTsat = 0, timeMiniSat = 0, timeSim = 0, timeTotal = clock(); if ( Vec_PtrSize(vOldRoots) == 0 ) return 0; // start SAT solvers @@ -1031,7 +1031,8 @@ void Gia_ComputeEquivalences( Gia_Man_t * pGia, int nBTLimit, int fUseMiniSat, i Hcd_Man_t * p; Vec_Ptr_t * vRoots; Gia_Man_t * pGiaLev; - int i, Lev, nLevels, nIters, clk; + int i, Lev, nLevels, nIters; + clock_t clk; Gia_ManRandom( 1 ); Gia_ManSetPhase( pGia ); nLevels = Gia_ManLevelNum( pGia ); diff --git a/src/aig/gia/giaGlitch.c b/src/aig/gia/giaGlitch.c index fc4d2736..2b958cba 100644 --- a/src/aig/gia/giaGlitch.c +++ b/src/aig/gia/giaGlitch.c @@ -740,7 +740,8 @@ void Gli_ManSetPiRandomSeq( Gli_Man_t * p, float PiTransProb ) ***********************************************************************/ void Gli_ManSwitchesAndGlitches( Gli_Man_t * p, int nPatterns, float PiTransProb, int fVerbose ) { - int i, k, clk = clock(); + int i, k; + clock_t clk = clock(); Gia_ManRandom( 1 ); Gli_ManFinalize( p ); if ( p->nRegs == 0 ) diff --git a/src/aig/gia/giaHcd.c b/src/aig/gia/giaHcd.c index 3f37e724..656c880a 100644 --- a/src/aig/gia/giaHcd.c +++ b/src/aig/gia/giaHcd.c @@ -44,7 +44,7 @@ struct Hcd_Pars_t_ int fUseGia; // uses GIA package int fUseCSat; // uses circuit-based solver int fVerbose; // verbose stats - int timeSynth; // synthesis runtime + clock_t timeSynth; // synthesis runtime int nNodesAhead; // the lookahead in terms of nodes int nCallsRecycle; // calls to perform before recycling SAT solver }; @@ -610,7 +610,8 @@ Aig_Man_t * Hcd_ComputeChoices( Aig_Man_t * pAig, int nBTLimit, int fSynthesis, Vec_Ptr_t * vGias; Gia_Man_t * pGia, * pMiter; Aig_Man_t * pAigNew; - int i, clk = clock(); + int i; + clock_t clk = clock(); // perform synthesis if ( fSynthesis ) { diff --git a/src/aig/gia/giaIso.c b/src/aig/gia/giaIso.c index dcfee68f..16d0e46c 100644 --- a/src/aig/gia/giaIso.c +++ b/src/aig/gia/giaIso.c @@ -82,12 +82,12 @@ struct Gia_IsoMan_t_ Vec_Int_t * vClasses; Vec_Int_t * vClasses2; // statistics - int timeStart; - int timeSim; - int timeRefine; - int timeSort; - int timeOther; - int timeTotal; + clock_t timeStart; + clock_t timeSim; + clock_t timeRefine; + clock_t timeSort; + clock_t timeOther; + clock_t timeTotal; }; static inline unsigned Gia_IsoGetValue( Gia_IsoMan_t * p, int i ) { return (unsigned)(p->pStoreW[i]); } @@ -178,7 +178,7 @@ void Gia_IsoPrintClasses( Gia_IsoMan_t * p ) printf( "\n" ); } } -void Gia_IsoPrint( Gia_IsoMan_t * p, int Iter, int Time ) +void Gia_IsoPrint( Gia_IsoMan_t * p, int Iter, clock_t Time ) { printf( "Iter %4d : ", Iter ); printf( "Entries =%8d. ", p->nEntries ); @@ -298,8 +298,9 @@ void Gia_IsoAssignUnique( Gia_IsoMan_t * p ) int Gia_IsoSort( Gia_IsoMan_t * p ) { Gia_Obj_t * pObj, * pObj0; - int i, k, fSameValue, iBegin, iBeginOld, nSize, nSizeNew, clk; + int i, k, fSameValue, iBegin, iBeginOld, nSize, nSizeNew; int fRefined = 0; + clock_t clk; // go through the equiv classes p->nSingles = 0; @@ -722,7 +723,8 @@ Vec_Ptr_t * Gia_IsoDeriveEquivPos( Gia_Man_t * pGia, int fForward, int fVerbose Gia_IsoMan_t * p; Vec_Ptr_t * vEquivs = NULL; int fRefined, fRefinedAll; - int i, c, clk = clock(), clkTotal = clock(); + int i, c; + clock_t clk = clock(), clkTotal = clock(); assert( Gia_ManCiNum(pGia) > 0 ); assert( Gia_ManPoNum(pGia) > 0 ); @@ -1070,7 +1072,8 @@ Gia_Man_t * Gia_ManIsoReduce( Gia_Man_t * pInit, Vec_Ptr_t ** pvPosEquivs, int f Vec_Ptr_t * vEquivs, * vEquivs2, * vStrings; Vec_Int_t * vRemain, * vLevel, * vLevel2; Vec_Str_t * vStr, * vStr2; - int i, k, s, sStart, Entry, Counter, clk = clock(); + int i, k, s, sStart, Entry, Counter; + clock_t clk = clock(); if ( pvPosEquivs ) *pvPosEquivs = NULL; @@ -1203,7 +1206,7 @@ Gia_Man_t * Gia_ManIsoReduce( Gia_Man_t * pInit, Vec_Ptr_t ** pvPosEquivs, int f void Gia_IsoTest( Gia_Man_t * p, int fVerbose ) { Vec_Ptr_t * vEquivs; - int clk = clock(); + clock_t clk = clock(); vEquivs = Gia_IsoDeriveEquivPos( p, 0, fVerbose ); printf( "Reduced %d outputs to %d. ", Gia_ManPoNum(p), vEquivs ? Vec_PtrSize(vEquivs) : 1 ); Abc_PrintTime( 1, "Time", clock() - clk ); diff --git a/src/aig/gia/giaRetime.c b/src/aig/gia/giaRetime.c index 0b9a6bfb..c1ff852e 100644 --- a/src/aig/gia/giaRetime.c +++ b/src/aig/gia/giaRetime.c @@ -266,7 +266,8 @@ Gia_Man_t * Gia_ManRetimeForwardOne( Gia_Man_t * p, int * pnRegFixed, int * pnRe Gia_Man_t * Gia_ManRetimeForward( Gia_Man_t * p, int nMaxIters, int fVerbose ) { Gia_Man_t * pNew, * pTemp; - int i, clk, nRegFixed, nRegMoves = 1; + int i, nRegFixed, nRegMoves = 1; + clock_t clk; pNew = p; for ( i = 0; i < nMaxIters && nRegMoves > 0; i++ ) { diff --git a/src/aig/gia/giaShrink.c b/src/aig/gia/giaShrink.c index ad03f1e4..2db815fc 100644 --- a/src/aig/gia/giaShrink.c +++ b/src/aig/gia/giaShrink.c @@ -52,7 +52,8 @@ Gia_Man_t * Gia_ManPerformMapShrink( Gia_Man_t * p, int fKeepLevel, int fVerbose Gia_Man_t * pNew, * pTemp; Gia_Obj_t * pObj, * pFanin; unsigned * pTruth; - int i, k, iFan, clk = clock(); + int i, k, iFan; + clock_t clk = clock(); // int ClassCounts[222] = {0}; int * pLutClass, Counter = 0; assert( p->pMapping != NULL ); diff --git a/src/aig/gia/giaSim.c b/src/aig/gia/giaSim.c index 37406c8d..3f11679d 100644 --- a/src/aig/gia/giaSim.c +++ b/src/aig/gia/giaSim.c @@ -109,7 +109,7 @@ Vec_Int_t * Gia_ManSimDeriveResets( Gia_Man_t * pGia ) int i, k, Lit, Count; int Counter0 = 0, Counter1 = 0; int CounterPi0 = 0, CounterPi1 = 0; - int clk = clock(); + clock_t clk = clock(); // create reset counters for each literal vCountLits = Vec_IntStart( 2 * Gia_ManObjNum(pGia) ); @@ -609,9 +609,9 @@ int Gia_ManSimSimulate( Gia_Man_t * pAig, Gia_ParSim_t * pPars ) { extern int Gia_ManSimSimulateEquiv( Gia_Man_t * pAig, Gia_ParSim_t * pPars ); Gia_ManSim_t * p; - int i, clkTotal = clock(); - int iOut, iPat, RetValue = 0; -// int nTimeToStop = pPars->TimeLimit ? pPars->TimeLimit + time(NULL) : 0; + clock_t clkTotal = clock(); + int i, iOut, iPat, RetValue = 0; + clock_t nTimeToStop = pPars->TimeLimit ? pPars->TimeLimit * CLOCKS_PER_SEC + clock(): 0; if ( pAig->pReprs && pAig->pNexts ) return Gia_ManSimSimulateEquiv( pAig, pPars ); ABC_FREE( pAig->pCexSeq ); @@ -648,7 +648,7 @@ int Gia_ManSimSimulate( Gia_Man_t * pAig, Gia_ParSim_t * pPars ) RetValue = 1; break; } - if ( time(NULL) > pPars->TimeLimit ) + if ( clock() > nTimeToStop ) { i++; break; diff --git a/src/aig/gia/giaSim2.c b/src/aig/gia/giaSim2.c index 74a34d1b..5ac1392f 100644 --- a/src/aig/gia/giaSim2.c +++ b/src/aig/gia/giaSim2.c @@ -639,9 +639,9 @@ int Gia_ManSimSimulateEquiv( Gia_Man_t * pAig, Gia_ParSim_t * pPars ) { Gia_Sim2_t * p; Gia_Obj_t * pObj; - int i, clkTotal = clock(); - int RetValue = 0, iOut, iPat; - int nTimeToStop = pPars->TimeLimit ? pPars->TimeLimit + time(NULL) : 0; + clock_t clkTotal = clock(); + int i, RetValue = 0, iOut, iPat; + clock_t nTimeToStop = pPars->TimeLimit ? pPars->TimeLimit * CLOCKS_PER_SEC + clock(): 0; assert( pAig->pReprs && pAig->pNexts ); ABC_FREE( pAig->pCexSeq ); p = Gia_Sim2Create( pAig, pPars ); @@ -682,7 +682,7 @@ int Gia_ManSimSimulateEquiv( Gia_Man_t * pAig, Gia_ParSim_t * pPars ) } if ( pAig->pReprs && pAig->pNexts ) Gia_Sim2InfoRefineEquivs( p ); - if ( time(NULL) > nTimeToStop ) + if ( clock() > nTimeToStop ) { i++; break; diff --git a/src/aig/gia/giaSort.c b/src/aig/gia/giaSort.c index f73e92bb..5183c441 100644 --- a/src/aig/gia/giaSort.c +++ b/src/aig/gia/giaSort.c @@ -160,7 +160,7 @@ void Gia_SortTest() { int nSize = 100000000; int * pArray; - int clk = clock(); + clock_t clk = clock(); printf( "Sorting %d integers\n", nSize ); pArray = Gia_SortGetTest( nSize ); diff --git a/src/aig/gia/giaSwitch.c b/src/aig/gia/giaSwitch.c index 628427d0..d1440ae0 100644 --- a/src/aig/gia/giaSwitch.c +++ b/src/aig/gia/giaSwitch.c @@ -559,7 +559,8 @@ Vec_Int_t * Gia_ManSwiSimulate( Gia_Man_t * pAig, Gia_ParSwi_t * pPars ) Gia_Obj_t * pObj; Vec_Int_t * vSwitching; float * pSwitching; - int i, clk, clkTotal = clock(); + int i; + clock_t clk, clkTotal = clock(); if ( pPars->fProbOne && pPars->fProbTrans ) printf( "Conflict of options: Can either compute probability of 1, or probability of switching by observing transitions.\n" ); // create manager diff --git a/src/aig/gia/giaTsim.c b/src/aig/gia/giaTsim.c index c306e867..2f5e0293 100644 --- a/src/aig/gia/giaTsim.c +++ b/src/aig/gia/giaTsim.c @@ -669,7 +669,8 @@ Gia_ManTer_t * Gia_ManTerSimulate( Gia_Man_t * pAig, int fVerbose ) { Gia_ManTer_t * p; unsigned * pState, * pPrev, * pLoop; - int i, Counter, clk, clkTotal = clock(); + int i, Counter; + clock_t clk, clkTotal = clock(); assert( Gia_ManRegNum(pAig) > 0 ); // create manager clk = clock(); diff --git a/src/aig/hop/hop.h b/src/aig/hop/hop.h index 6411265f..d23f3508 100644 --- a/src/aig/hop/hop.h +++ b/src/aig/hop/hop.h @@ -30,7 +30,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/vec/vec.h" @@ -106,8 +105,8 @@ struct Hop_Man_t_ Vec_Ptr_t * vPages; // memory pages used by nodes Hop_Obj_t * pListFree; // the list of free nodes // timing statistics - int time1; - int time2; + clock_t time1; + clock_t time2; }; //////////////////////////////////////////////////////////////////////// diff --git a/src/aig/hop/hopTable.c b/src/aig/hop/hopTable.c index 7db93f62..1adab015 100644 --- a/src/aig/hop/hopTable.c +++ b/src/aig/hop/hopTable.c @@ -167,7 +167,8 @@ void Hop_TableResize( Hop_Man_t * p ) { Hop_Obj_t * pEntry, * pNext; Hop_Obj_t ** pTableOld, ** ppPlace; - int nTableSizeOld, Counter, nEntries, i, clk; + int nTableSizeOld, Counter, nEntries, i; + clock_t clk; clk = clock(); // save the old table pTableOld = p->pTable; diff --git a/src/aig/ioa/ioa.h b/src/aig/ioa/ioa.h index a427f507..809e8e3f 100644 --- a/src/aig/ioa/ioa.h +++ b/src/aig/ioa/ioa.h @@ -30,7 +30,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/vec/vec.h" //#include "bar.h" diff --git a/src/aig/ivy/ivy.h b/src/aig/ivy/ivy.h index 8d062134..f0292e6c 100644 --- a/src/aig/ivy/ivy.h +++ b/src/aig/ivy/ivy.h @@ -125,8 +125,8 @@ struct Ivy_Man_t_ Vec_Ptr_t * vPages; // memory pages used by nodes Ivy_Obj_t * pListFree; // the list of free nodes // timing statistics - int time1; - int time2; + clock_t time1; + clock_t time2; }; struct Ivy_FraigParams_t_ diff --git a/src/aig/ivy/ivyCut.c b/src/aig/ivy/ivyCut.c index d5a31dee..19d37bb2 100644 --- a/src/aig/ivy/ivyCut.c +++ b/src/aig/ivy/ivyCut.c @@ -969,7 +969,7 @@ void Ivy_ManTestCutsAll( Ivy_Man_t * p ) { Ivy_Obj_t * pObj; int i, nCutsCut, nCutsTotal, nNodeTotal, nNodeOver; - int clk = clock(); + clock_t clk = clock(); nNodeTotal = nNodeOver = 0; nCutsTotal = -Ivy_ManNodeNum(p); Ivy_ManForEachObj( p, pObj, i ) diff --git a/src/aig/ivy/ivyCutTrav.c b/src/aig/ivy/ivyCutTrav.c index a053c713..5834a6fc 100644 --- a/src/aig/ivy/ivyCutTrav.c +++ b/src/aig/ivy/ivyCutTrav.c @@ -439,7 +439,7 @@ void Ivy_ManTestCutsTravAll( Ivy_Man_t * p ) Vec_Int_t * vStore; Vec_Vec_t * vBitCuts; int i, nCutsCut, nCutsTotal, nNodeTotal, nNodeOver; - int clk = clock(); + clock_t clk = clock(); vNodes = Vec_PtrAlloc( 100 ); vFront = Vec_PtrAlloc( 100 ); diff --git a/src/aig/ivy/ivyFastMap.c b/src/aig/ivy/ivyFastMap.c index 1d9efca1..feeb36f2 100644 --- a/src/aig/ivy/ivyFastMap.c +++ b/src/aig/ivy/ivyFastMap.c @@ -67,7 +67,7 @@ static inline Ivy_Supp_t * Ivy_ObjSuppStart( Ivy_Man_t * pAig, Ivy_Obj_t * pObj return pSupp; } -static void Ivy_FastMapPrint( Ivy_Man_t * pAig, int Delay, int Area, int Time, char * pStr ); +static void Ivy_FastMapPrint( Ivy_Man_t * pAig, int Delay, int Area, clock_t Time, char * pStr ); static int Ivy_FastMapDelay( Ivy_Man_t * pAig ); static int Ivy_FastMapArea( Ivy_Man_t * pAig ); static void Ivy_FastMapNode( Ivy_Man_t * pAig, Ivy_Obj_t * pObj, int nLimit ); @@ -83,8 +83,8 @@ static int Ivy_FastMapNodeRef( Ivy_Man_t * pAig, Ivy_Obj_t * pObj ); static int Ivy_FastMapNodeDeref( Ivy_Man_t * pAig, Ivy_Obj_t * pObj ); -extern int s_MappingTime; -extern int s_MappingMem; +extern clock_t s_MappingTime; +extern clock_t s_MappingMem; //////////////////////////////////////////////////////////////////////// @@ -106,7 +106,8 @@ void Ivy_FastMapPerform( Ivy_Man_t * pAig, int nLimit, int fRecovery, int fVerbo { Ivy_SuppMan_t * pMan; Ivy_Obj_t * pObj; - int i, Delay, Area, clk, clkTotal = clock(); + int i, Delay, Area; + clock_t clk, clkTotal = clock(); // start the memory for supports pMan = ABC_ALLOC( Ivy_SuppMan_t, 1 ); memset( pMan, 0, sizeof(Ivy_SuppMan_t) ); @@ -210,7 +211,7 @@ void Ivy_FastMapStop( Ivy_Man_t * pAig ) SeeAlso [] ***********************************************************************/ -void Ivy_FastMapPrint( Ivy_Man_t * pAig, int Delay, int Area, int Time, char * pStr ) +void Ivy_FastMapPrint( Ivy_Man_t * pAig, int Delay, int Area, clock_t Time, char * pStr ) { printf( "%s : Delay = %3d. Area = %6d. ", pStr, Delay, Area ); ABC_PRT( "Time", Time ); diff --git a/src/aig/ivy/ivyFraig.c b/src/aig/ivy/ivyFraig.c index cc6250e4..411402fb 100644 --- a/src/aig/ivy/ivyFraig.c +++ b/src/aig/ivy/ivyFraig.c @@ -93,16 +93,16 @@ struct Ivy_FraigMan_t_ int nSatFails; int nSatFailsReal; // runtime - int timeSim; - int timeTrav; - int timeSat; - int timeSatUnsat; - int timeSatSat; - int timeSatFail; - int timeRef; - int timeTotal; - int time1; - int time2; + clock_t timeSim; + clock_t timeTrav; + clock_t timeSat; + clock_t timeSatUnsat; + clock_t timeSatSat; + clock_t timeSatFail; + clock_t timeRef; + clock_t timeTotal; + clock_t time1; + clock_t time2; }; typedef struct Prove_ParamsStruct_t_ Prove_Params_t; @@ -198,7 +198,7 @@ static int Ivy_FraigSetActivityFactors( Ivy_FraigMan_t * p, Ivy_Obj_t static void Ivy_FraigAddToPatScores( Ivy_FraigMan_t * p, Ivy_Obj_t * pClass, Ivy_Obj_t * pClassNew ); static int Ivy_FraigMiterStatus( Ivy_Man_t * pMan ); static void Ivy_FraigMiterProve( Ivy_FraigMan_t * p ); -static void Ivy_FraigMiterPrint( Ivy_Man_t * pNtk, char * pString, int clk, int fVerbose ); +static void Ivy_FraigMiterPrint( Ivy_Man_t * pNtk, char * pString, clock_t clk, int fVerbose ); static int * Ivy_FraigCreateModel( Ivy_FraigMan_t * p ); static int Ivy_FraigNodesAreEquivBdd( Ivy_Obj_t * pObj1, Ivy_Obj_t * pObj2 ); @@ -257,7 +257,8 @@ int Ivy_FraigProve( Ivy_Man_t ** ppManAig, void * pPars ) Prove_Params_t * pParams = (Prove_Params_t *)pPars; Ivy_FraigParams_t Params, * pIvyParams = &Params; Ivy_Man_t * pManAig, * pManTemp; - int RetValue, nIter, clk;//, Counter; + int RetValue, nIter; + clock_t clk;//, Counter; ABC_INT64_T nSatConfs = 0, nSatInspects = 0; // start the network and parameters @@ -414,7 +415,7 @@ Ivy_Man_t * Ivy_FraigPerform_int( Ivy_Man_t * pManAig, Ivy_FraigParams_t * pPara { Ivy_FraigMan_t * p; Ivy_Man_t * pManAigNew; - int clk; + clock_t clk; if ( Ivy_ManNodeNum(pManAig) == 0 ) return Ivy_ManDup(pManAig); clk = clock(); @@ -451,7 +452,7 @@ Ivy_Man_t * Ivy_FraigPerform( Ivy_Man_t * pManAig, Ivy_FraigParams_t * pParams ) { Ivy_FraigMan_t * p; Ivy_Man_t * pManAigNew; - int clk; + clock_t clk; if ( Ivy_ManNodeNum(pManAig) == 0 ) return Ivy_ManDup(pManAig); clk = clock(); @@ -481,7 +482,8 @@ Ivy_Man_t * Ivy_FraigMiter( Ivy_Man_t * pManAig, Ivy_FraigParams_t * pParams ) Ivy_FraigMan_t * p; Ivy_Man_t * pManAigNew; Ivy_Obj_t * pObj; - int i, clk; + int i; + clock_t clk; clk = clock(); assert( Ivy_ManLatchNum(pManAig) == 0 ); p = Ivy_FraigStartSimple( pManAig, pParams ); @@ -988,7 +990,8 @@ unsigned Ivy_NodeHash( Ivy_FraigMan_t * p, Ivy_Obj_t * pObj ) void Ivy_FraigSimulateOne( Ivy_FraigMan_t * p ) { Ivy_Obj_t * pObj; - int i, clk; + int i; + clock_t clk; clk = clock(); Ivy_ManForEachNode( p->pManAig, pObj, i ) { @@ -1020,7 +1023,7 @@ p->nSimRounds++; void Ivy_FraigSimulateOneSim( Ivy_FraigMan_t * p ) { Ivy_FraigSim_t * pSims; - int clk; + clock_t clk; clk = clock(); for ( pSims = p->pSimStart; pSims; pSims = pSims->pNext ) Ivy_NodeSimulateSim( p, pSims ); @@ -1384,7 +1387,8 @@ int Ivy_FraigCheckOutputSims( Ivy_FraigMan_t * p ) int Ivy_FraigRefineClasses( Ivy_FraigMan_t * p ) { Ivy_Obj_t * pClass, * pClass2; - int clk, RetValue, Counter = 0; + int RetValue, Counter = 0; + clock_t clk; // check if some outputs already became non-constant // this is a special case when computation can be stopped!!! if ( p->pParams->fProve ) @@ -1789,7 +1793,7 @@ void Ivy_FraigResimulate( Ivy_FraigMan_t * p ) SeeAlso [] ***********************************************************************/ -void Ivy_FraigMiterPrint( Ivy_Man_t * pNtk, char * pString, int clk, int fVerbose ) +void Ivy_FraigMiterPrint( Ivy_Man_t * pNtk, char * pString, clock_t clk, int fVerbose ) { if ( !fVerbose ) return; @@ -1876,7 +1880,8 @@ int Ivy_FraigMiterStatus( Ivy_Man_t * pMan ) void Ivy_FraigMiterProve( Ivy_FraigMan_t * p ) { Ivy_Obj_t * pObj, * pObjNew; - int i, RetValue, clk = clock(); + int i, RetValue; + clock_t clk = clock(); int fVerbose = 0; Ivy_ManForEachPo( p->pManAig, pObj, i ) { @@ -2093,7 +2098,8 @@ void Ivy_FraigPrintActivity( Ivy_FraigMan_t * p ) ***********************************************************************/ int Ivy_FraigNodesAreEquiv( Ivy_FraigMan_t * p, Ivy_Obj_t * pOld, Ivy_Obj_t * pNew ) { - int pLits[4], RetValue, RetValue1, nBTLimit, clk; //, clk2 = clock(); + int pLits[4], RetValue, RetValue1, nBTLimit; + clock_t clk; //, clk2 = clock(); // make sure the nodes are not complemented assert( !Ivy_IsComplement(pNew) ); @@ -2259,7 +2265,8 @@ p->timeSatFail += clock() - clk; ***********************************************************************/ int Ivy_FraigNodeIsConst( Ivy_FraigMan_t * p, Ivy_Obj_t * pNew ) { - int pLits[2], RetValue1, clk; + int pLits[2], RetValue1; + clock_t clk; int RetValue; // make sure the nodes are not complemented @@ -2628,7 +2635,8 @@ int Ivy_FraigSetActivityFactors_rec( Ivy_FraigMan_t * p, Ivy_Obj_t * pObj, int L ***********************************************************************/ int Ivy_FraigSetActivityFactors( Ivy_FraigMan_t * p, Ivy_Obj_t * pOld, Ivy_Obj_t * pNew ) { - int clk, LevelMin, LevelMax; + int LevelMin, LevelMax; + clock_t clk; assert( pOld || pNew ); clk = clock(); // reset the active variables diff --git a/src/aig/ivy/ivyResyn.c b/src/aig/ivy/ivyResyn.c index 8d571110..dc483bf6 100644 --- a/src/aig/ivy/ivyResyn.c +++ b/src/aig/ivy/ivyResyn.c @@ -44,7 +44,7 @@ ABC_NAMESPACE_IMPL_START ***********************************************************************/ Ivy_Man_t * Ivy_ManResyn0( Ivy_Man_t * pMan, int fUpdateLevel, int fVerbose ) { - int clk; + clock_t clk; Ivy_Man_t * pTemp; if ( fVerbose ) { printf( "Original:\n" ); } @@ -85,7 +85,7 @@ if ( fVerbose ) Ivy_ManPrintStats( pMan ); ***********************************************************************/ Ivy_Man_t * Ivy_ManResyn( Ivy_Man_t * pMan, int fUpdateLevel, int fVerbose ) { - int clk; + clock_t clk; Ivy_Man_t * pTemp; if ( fVerbose ) { printf( "Original:\n" ); } @@ -154,7 +154,7 @@ if ( fVerbose ) Ivy_ManPrintStats( pMan ); ***********************************************************************/ Ivy_Man_t * Ivy_ManRwsat( Ivy_Man_t * pMan, int fVerbose ) { - int clk; + clock_t clk; Ivy_Man_t * pTemp; if ( fVerbose ) { printf( "Original:\n" ); } diff --git a/src/aig/ivy/ivyRwr.c b/src/aig/ivy/ivyRwr.c index 39131210..292bd3f9 100644 --- a/src/aig/ivy/ivyRwr.c +++ b/src/aig/ivy/ivyRwr.c @@ -57,7 +57,7 @@ int Ivy_ManRewritePre( Ivy_Man_t * p, int fUpdateLevel, int fUseZeroCost, int fV Rwt_Man_t * pManRwt; Ivy_Obj_t * pNode; int i, nNodes, nGain; - int clk, clkStart = clock(); + clock_t clk, clkStart = clock(); // start the rewriting manager pManRwt = Rwt_ManStart( 0 ); p->pData = pManRwt; @@ -164,7 +164,7 @@ int Ivy_NodeRewrite( Ivy_Man_t * pMan, Rwt_Man_t * p, Ivy_Obj_t * pNode, int fUp int Required, nNodesSaved; int nNodesSaveCur = -1; // Suppress "might be used uninitialized" int i, c, GainCur, GainBest = -1; - int clk, clk2; + clock_t clk, clk2; p->nNodesConsidered++; // get the required times diff --git a/src/aig/ivy/ivySeq.c b/src/aig/ivy/ivySeq.c index 283bf9fe..4a999780 100644 --- a/src/aig/ivy/ivySeq.c +++ b/src/aig/ivy/ivySeq.c @@ -65,7 +65,7 @@ int Ivy_ManRewriteSeq( Ivy_Man_t * p, int fUseZeroCost, int fVerbose ) Rwt_Man_t * pManRwt; Ivy_Obj_t * pNode; int i, nNodes, nGain; - int clk, clkStart = clock(); + clock_t clk, clkStart = clock(); // set the DC latch values Ivy_ManForEachLatch( p, pNode, i ) @@ -157,7 +157,7 @@ int Ivy_NodeRewriteSeq( Ivy_Man_t * pMan, Rwt_Man_t * p, Ivy_Obj_t * pNode, int int nNodesSaved; int nNodesSaveCur = -1; // Suppress "might be used uninitialized" int i, c, GainCur, GainBest = -1; - int clk, clk2;//, clk3; + clock_t clk, clk2;//, clk3; p->nNodesConsidered++; // get the node's cuts @@ -1110,7 +1110,7 @@ void Ivy_CutComputeAll( Ivy_Man_t * p, int nInputs ) Ivy_Store_t * pStore; Ivy_Obj_t * pObj; int i, nCutsTotal, nCutsTotalM, nNodeTotal, nNodeOver; - int clk = clock(); + clock_t clk = clock(); if ( nInputs > IVY_CUT_INPUT ) { printf( "Cannot compute cuts for more than %d inputs.\n", IVY_CUT_INPUT ); diff --git a/src/aig/ivy/ivyTable.c b/src/aig/ivy/ivyTable.c index d2c1ab9a..d2753aa8 100644 --- a/src/aig/ivy/ivyTable.c +++ b/src/aig/ivy/ivyTable.c @@ -206,7 +206,8 @@ int Ivy_TableCountEntries( Ivy_Man_t * p ) void Ivy_TableResize( Ivy_Man_t * p ) { int * pTableOld, * pPlace; - int nTableSizeOld, Counter, nEntries, e, clk; + int nTableSizeOld, Counter, nEntries, e; + clock_t clk; clk = clock(); // save the old table pTableOld = p->pTable; diff --git a/src/aig/saig/saigAbsCba.c b/src/aig/saig/saigAbsCba.c index 55a429e1..0b59274a 100644 --- a/src/aig/saig/saigAbsCba.c +++ b/src/aig/saig/saigAbsCba.c @@ -721,7 +721,7 @@ Abc_Cex_t * Saig_ManCbaFindCexCareBits( Aig_Man_t * pAig, Abc_Cex_t * pCex, int Saig_ManCba_t * p; Vec_Int_t * vReasons; Abc_Cex_t * pCare; - int clk = clock(); + clock_t clk = clock(); clk = clock(); p = Saig_ManCbaStart( pAig, pCex, nInputs, fVerbose ); @@ -831,7 +831,8 @@ ABC_PRT( "Time", clock() - clk ); Vec_Int_t * Saig_ManCbaPerform( Aig_Man_t * pAbs, int nInputs, Saig_ParBmc_t * pPars ) { Vec_Int_t * vAbsFfsToAdd; - int RetValue, clk = clock(); + int RetValue; + clock_t clk = clock(); // assert( pAbs->nRegs > 0 ); // perform BMC RetValue = Saig_ManBmcScalable( pAbs, pPars ); diff --git a/src/aig/saig/saigAbsPba.c b/src/aig/saig/saigAbsPba.c index 42744459..9a10edb6 100644 --- a/src/aig/saig/saigAbsPba.c +++ b/src/aig/saig/saigAbsPba.c @@ -254,9 +254,9 @@ Vec_Int_t * Saig_ManPbaDerive( Aig_Man_t * pAig, int nInputs, int nStart, int nF sat_solver * pSat; Cnf_Dat_t * pCnf; Aig_Obj_t * pObj; - int nTimeToStop = time(NULL) + TimeLimit; int nCoreLits, * pCoreLits; - int i, iVar, RetValue, clk; + int i, iVar, RetValue; + clock_t clk; if ( fVerbose ) { if ( TimeLimit ) @@ -296,7 +296,7 @@ Abc_PrintTime( 1, "Preparing", clock() - clk ); // set runtime limit if ( TimeLimit ) - sat_solver_set_runtime_limit( pSat, nTimeToStop ); + sat_solver_set_runtime_limit( pSat, TimeLimit ? TimeLimit * CLOCKS_PER_SEC + clock(): 0 ); // run SAT solver clk = clock(); diff --git a/src/aig/saig/saigAbsStart.c b/src/aig/saig/saigAbsStart.c index 0054d8b0..77517c18 100644 --- a/src/aig/saig/saigAbsStart.c +++ b/src/aig/saig/saigAbsStart.c @@ -172,7 +172,8 @@ int Saig_ManCexRefineStep( Aig_Man_t * p, Vec_Int_t * vFlops, Vec_Int_t * vFlopC { Aig_Man_t * pAbs; Vec_Int_t * vFlopsNew; - int i, Entry, clk = clock(); + int i, Entry; + clock_t clk = clock(); pAbs = Saig_ManDupAbstraction( p, vFlops ); if ( fSensePath ) vFlopsNew = Saig_ManExtendCounterExampleTest2( pAbs, Saig_ManCexFirstFlopPi(p, pAbs), pCex, fVerbose ); diff --git a/src/aig/saig/saigAbsVfa.c b/src/aig/saig/saigAbsVfa.c index 24414c5a..e991ac35 100644 --- a/src/aig/saig/saigAbsVfa.c +++ b/src/aig/saig/saigAbsVfa.c @@ -209,7 +209,8 @@ int Abs_VfaManCreateFrame_rec( Abs_VfaMan_t * p, Aig_Obj_t * pObj, int f ) void Abs_VfaManCreateFrame( Abs_VfaMan_t * p, int f ) { Aig_Obj_t * pObj; - int i, clk = clock(); + int i; + clock_t clk = clock(); Saig_ManForEachPo( p->pAig, pObj, i ) Abs_VfaManCreateFrame_rec( p, pObj, f ); diff --git a/src/aig/saig/saigBmc.c b/src/aig/saig/saigBmc.c index 60f406ad..021ad5d0 100644 --- a/src/aig/saig/saigBmc.c +++ b/src/aig/saig/saigBmc.c @@ -190,7 +190,8 @@ int Saig_ManBmcSimple( Aig_Man_t * pAig, int nFrames, int nSizeMax, int nConfLim Cnf_Dat_t * pCnf; Aig_Man_t * pFrames, * pAigTemp; Aig_Obj_t * pObj; - int status, clk, Lit, i, RetValue = -1; + int status, Lit, i, RetValue = -1; + clock_t clk; // derive the timeframes clk = clock(); @@ -264,7 +265,7 @@ int Saig_ManBmcSimple( Aig_Man_t * pAig, int nFrames, int nSizeMax, int nConfLim } else { - int clkPart = clock(); + clock_t clkPart = clock(); Aig_ManForEachCo( pFrames, pObj, i ) { //if ( s_fInterrupt ) diff --git a/src/aig/saig/saigBmc2.c b/src/aig/saig/saigBmc2.c index 4a95bdbc..8ff9a7a7 100644 --- a/src/aig/saig/saigBmc2.c +++ b/src/aig/saig/saigBmc2.c @@ -202,7 +202,7 @@ Vec_Ptr_t * Abs_ManTernarySimulate( Aig_Man_t * p, int nFramesMax, int fVerbose Vec_Ptr_t * vSimInfo; Aig_Obj_t * pObj; int i, f, nFramesLimit, nFrameWords; - int clk = clock(); + clock_t clk = clock(); assert( Aig_ManRegNum(p) > 0 ); // the maximum number of frames will be determined to use at most 200Mb of RAM nFramesLimit = 1 + (200000000 * 4)/Aig_ManObjNum(p); @@ -742,9 +742,10 @@ int Saig_BmcPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, int nNodesMax Saig_Bmc_t * p; Aig_Man_t * pNew; Cnf_Dat_t * pCnf; - int nTimeToStop = time(NULL) + nTimeOut; int nOutsSolved = 0; - int Iter, RetValue = -1, clk = clock(), clk2, clkTotal = clock(); + int Iter, RetValue = -1; + clock_t nTimeToStop = nTimeOut ? nTimeOut * CLOCKS_PER_SEC + clock(): 0; + clock_t clk = clock(), clk2, clkTotal = clock(); int Status = -1; /* Vec_Ptr_t * vSimInfo; @@ -763,7 +764,7 @@ int Saig_BmcPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, int nNodesMax p = Saig_BmcManStart( pAig, nFramesMax, nNodesMax, nConfMaxOne, nConfMaxAll, fVerbose ); // set runtime limit if ( nTimeOut ) - sat_solver_set_runtime_limit( p->pSat, nTimeToStop ); + sat_solver_set_runtime_limit( p->pSat, nTimeOut ); for ( Iter = 0; ; Iter++ ) { clk2 = clock(); @@ -796,7 +797,7 @@ int Saig_BmcPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, int nNodesMax if ( RetValue != l_False ) break; // check the timeout - if ( nTimeOut && time(NULL) > nTimeToStop ) + if ( nTimeOut && clock() > nTimeToStop ) { printf( "Reached timeout (%d seconds).\n", nTimeOut ); if ( piFrames ) @@ -839,7 +840,7 @@ int Saig_BmcPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, int nNodesMax printf( "Reached limit on the number of timeframes (%d).\n", p->nFramesMax ); else if ( p->nConfMaxAll && p->pSat->stats.conflicts > p->nConfMaxAll ) printf( "Reached global conflict limit (%d).\n", p->nConfMaxAll ); - else if ( nTimeOut && time(NULL) > nTimeToStop ) + else if ( nTimeOut && clock() > nTimeToStop ) printf( "Reached timeout (%d seconds).\n", nTimeOut ); else printf( "Reached local conflict limit (%d).\n", p->nConfMaxOne ); diff --git a/src/aig/saig/saigBmc3.c b/src/aig/saig/saigBmc3.c index 9107a796..12e982cc 100644 --- a/src/aig/saig/saigBmc3.c +++ b/src/aig/saig/saigBmc3.c @@ -1251,8 +1251,9 @@ int Saig_ManBmcScalable( Aig_Man_t * pAig, Saig_ParBmc_t * pPars ) unsigned * pInfo; int RetValue = -1, fFirst = 1, nJumpFrame = 0, fUnfinished = 0; int nOutDigits = Abc_Base10Log( Saig_ManPoNum(pAig) ); - int i, f, Lit, status, clk, clk2, clkOther = 0, clkTotal = clock(); - int nTimeToStop = time(NULL) + pPars->nTimeOut; + int i, f, Lit, status; + clock_t clk, clk2, clkOther = 0, clkTotal = clock(); + clock_t nTimeToStop = pPars->nTimeOut ? pPars->nTimeOut * CLOCKS_PER_SEC + clock(): 0; p = Saig_Bmc3ManStart( pAig ); p->pPars = pPars; if ( pPars->fVerbose ) @@ -1411,7 +1412,7 @@ clkOther += clock() - clk2; else { assert( status == l_Undef ); - if ( pPars->nTimeOut && time(NULL) > nTimeToStop ) + if ( pPars->nTimeOut && clock() > nTimeToStop ) { printf( "Reached timeout (%d seconds).\n", pPars->nTimeOut ); Saig_Bmc3ManStop( p ); @@ -1427,7 +1428,7 @@ clkOther += clock() - clk2; Saig_Bmc3ManStop( p ); return RetValue; } - if ( pPars->nTimeOut && time(NULL) > nTimeToStop ) + if ( pPars->nTimeOut && clock() > nTimeToStop ) { printf( "Reached timeout (%d seconds).\n", pPars->nTimeOut ); Saig_Bmc3ManStop( p ); @@ -1450,7 +1451,7 @@ clkOther += clock() - clk2; // printf( "%4.0f Mb", 4.0*Vec_IntSize(p->vVisited) /(1<<20) ); printf( "%4.0f Mb", 4.0*(f+1)*p->nObjNums /(1<<20) ); printf( "%4.0f Mb", 1.0*sat_solver_memory(p->pSat)/(1<<20) ); - printf( "%9.2f sec ", (float)(clock() - clkTotal)/(float)(CLOCKS_PER_SEC) ); + printf( "%9.2f sec ", 1.0*(clock() - clkTotal)/CLOCKS_PER_SEC ); // printf( "\n" ); // ABC_PRMn( "Id2Var", (f+1)*p->nObjNums*4 ); // ABC_PRMn( "SAT", 42 * p->pSat->size + 16 * (int)p->pSat->stats.clauses + 4 * (int)p->pSat->stats.clauses_literals ); diff --git a/src/aig/saig/saigConstr2.c b/src/aig/saig/saigConstr2.c index f54f2dbe..85e79e3f 100644 --- a/src/aig/saig/saigConstr2.c +++ b/src/aig/saig/saigConstr2.c @@ -59,7 +59,8 @@ int Ssw_ManProfileConstraints( Aig_Man_t * p, int nWords, int nFrames, int fVerb Vec_Int_t * vProbs, * vProbs2; Aig_Obj_t * pObj, * pObjLi; unsigned * pInfo, * pInfo0, * pInfo1, * pInfoMask, * pInfoMask2; - int i, w, f, RetValue = 1, clk = clock(); + int i, w, f, RetValue = 1; + clock_t clk = clock(); if ( fVerbose ) printf( "Simulating %d nodes and %d flops for %d frames with %d words... ", Aig_ManNodeNum(p), Aig_ManRegNum(p), nFrames, nWords ); diff --git a/src/aig/saig/saigGlaCba.c b/src/aig/saig/saigGlaCba.c index 459d8ede..d39ff944 100644 --- a/src/aig/saig/saigGlaCba.c +++ b/src/aig/saig/saigGlaCba.c @@ -59,9 +59,9 @@ struct Aig_Gla1Man_t_ // SAT solver sat_solver * pSat; // statistics - int timeSat; - int timeRef; - int timeTotal; + clock_t timeSat; + clock_t timeRef; + clock_t timeTotal; }; //////////////////////////////////////////////////////////////////////// @@ -687,8 +687,9 @@ Vec_Int_t * Aig_Gla1ManPerform( Aig_Man_t * pAig, Vec_Int_t * vGateClassesOld, i Abc_Cex_t * pCex; Vec_Int_t * vPPiRefine; int f, g, r, i, iSatVar, Lit, Entry, RetValue; - int nConfBef, nConfAft, clk, clkTotal = clock(); - int nTimeToStop = time(NULL) + TimeLimit; + int nConfBef, nConfAft; + clock_t clk, clkTotal = clock(); + clock_t nTimeToStop = TimeLimit ? TimeLimit * CLOCKS_PER_SEC + clock(): 0; assert( Saig_ManPoNum(pAig) == 1 ); if ( nFramesMax == 0 ) @@ -753,7 +754,7 @@ Vec_Int_t * Aig_Gla1ManPerform( Aig_Man_t * pAig, Vec_Int_t * vGateClassesOld, i printf( "== %3d ==", f ); else printf( " " ); - if ( TimeLimit && time(NULL) > nTimeToStop ) + if ( TimeLimit && clock() > nTimeToStop ) printf( " SAT solver timed out after %d seconds.\n", TimeLimit ); else if ( RetValue != l_False ) printf( " SAT solver returned UNDECIDED after %5d conflicts.\n", nConfAft - nConfBef ); diff --git a/src/aig/saig/saigGlaPba.c b/src/aig/saig/saigGlaPba.c index 6f461995..e039ed75 100644 --- a/src/aig/saig/saigGlaPba.c +++ b/src/aig/saig/saigGlaPba.c @@ -48,46 +48,15 @@ struct Aig_Gla2Man_t_ // SAT solver sat_solver * pSat; // statistics - int timePre; - int timeSat; - int timeTotal; + clock_t timePre; + clock_t timeSat; + clock_t timeTotal; }; //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// -#define ABC_CPS 1000 - -/**Function************************************************************* - - Synopsis [Procedure returns miliseconds elapsed since the last reset.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ -int Abc_Clock( int Timer, int fReset ) -{ - static int Time[16], Clock[16]; - int Clock2, Diff; - assert( Timer >= 0 && Timer < 16 ); - if ( fReset ) - { - Time[Timer] = time(NULL); - Clock[Timer] = clock(); - return 0; - } - Clock2 = clock(); - if ( Clock2 > Clock[Timer] ) - Diff = (Clock2 - Clock[Timer]) % CLOCKS_PER_SEC; - else - Diff = CLOCKS_PER_SEC - (Clock[Timer] - Clock2) % CLOCKS_PER_SEC; - return (time(NULL) - Time[Timer]) * ABC_CPS + (Diff * ABC_CPS) / CLOCKS_PER_SEC; -} /**Function************************************************************* @@ -432,7 +401,8 @@ Vec_Int_t * Saig_AbsSolverUnsatCore( sat_solver * pSat, int nConfMax, int fVerbo Vec_Int_t * vCore; void * pSatCnf; Intp_Man_t * pManProof; - int RetValue, clk = clock(); + int RetValue; + clock_t clk = clock(); if ( piRetValue ) *piRetValue = -1; // solve the problem @@ -556,8 +526,8 @@ Vec_Int_t * Aig_Gla2ManPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, in { Aig_Gla2Man_t * p; Vec_Int_t * vCore, * vResult; - int nTimeToStop = time(NULL) + TimeLimit; - int clk, clk2 = clock(); + clock_t nTimeToStop = TimeLimit ? TimeLimit * CLOCKS_PER_SEC + clock(): 0; + clock_t clk, clk2 = clock(); assert( Saig_ManPoNum(pAig) == 1 ); if ( fVerbose ) diff --git a/src/aig/saig/saigGlaPba2.c b/src/aig/saig/saigGlaPba2.c index a7122d01..42850e01 100644 --- a/src/aig/saig/saigGlaPba2.c +++ b/src/aig/saig/saigGlaPba2.c @@ -47,9 +47,9 @@ struct Aig_Gla3Man_t_ // SAT solver sat_solver2 * pSat; // statistics - int timePre; - int timeSat; - int timeTotal; + clock_t timePre; + clock_t timeSat; + clock_t timeTotal; }; //////////////////////////////////////////////////////////////////////// @@ -393,7 +393,8 @@ void Aig_Gla3ManStop( Aig_Gla3Man_t * p ) Vec_Int_t * Aig_Gla3ManUnsatCore( sat_solver2 * pSat, int nConfMax, int fVerbose, int * piRetValue ) { Vec_Int_t * vCore; - int RetValue, clk = clock(); + int RetValue; + clock_t clk = clock(); if ( piRetValue ) *piRetValue = -1; // solve the problem @@ -495,8 +496,7 @@ Vec_Int_t * Aig_Gla3ManPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, in { Aig_Gla3Man_t * p; Vec_Int_t * vCore, * vResult; - int nTimeToStop = time(NULL) + TimeLimit; - int clk, clk2 = clock(); + clock_t clk, clk2 = clock(); assert( Saig_ManPoNum(pAig) == 1 ); if ( fVerbose ) @@ -521,7 +521,7 @@ Vec_Int_t * Aig_Gla3ManPerform( Aig_Man_t * pAig, int nStart, int nFramesMax, in // set runtime limit if ( TimeLimit ) - sat_solver2_set_runtime_limit( p->pSat, nTimeToStop ); + sat_solver2_set_runtime_limit( p->pSat, TimeLimit * CLOCKS_PER_SEC + clock() ); // compute UNSAT core clk = clock(); diff --git a/src/aig/saig/saigHaig.c b/src/aig/saig/saigHaig.c index aedc98e2..b92b7a9b 100644 --- a/src/aig/saig/saigHaig.c +++ b/src/aig/saig/saigHaig.c @@ -206,7 +206,7 @@ int Aig_ManHaigVerify( Aig_Man_t * p, Aig_Man_t * pAig, Aig_Man_t * pHaig, int n sat_solver * pSat; Aig_Obj_t * pObj1, * pObj2; int i, RetValue1, RetValue2, Counter, Lits[2], nOvers; - int clk = clock(), clkVerif; + clock_t clk = clock(), clkVerif; nOvers = Aig_ManMapHaigNodes( pHaig ); @@ -412,7 +412,7 @@ int Aig_ManHaigVerify2( Aig_Man_t * p, Aig_Man_t * pAig, Aig_Man_t * pHaig, int sat_solver * pSat; Aig_Obj_t * pObj1, * pObj2; int i, RetValue1, RetValue2, Counter, Lits[2]; - int clk = clock(); + clock_t clk = clock(); int Delta; int Id1, Id2; @@ -624,7 +624,8 @@ Aig_Man_t * Saig_ManHaigRecord( Aig_Man_t * p, int nIters, int nSteps, int fReti Dar_RwrPar_t ParsRwr, * pParsRwr = &ParsRwr; Aig_Man_t * pNew, * pTemp; Aig_Obj_t * pObj; - int i, k, nStepsReal, clk = clock(), clkSynth; + int i, k, nStepsReal; + clock_t clk = clock(), clkSynth; Dar_ManDefaultRwrParams( pParsRwr ); clk = clock(); diff --git a/src/aig/saig/saigInd.c b/src/aig/saig/saigInd.c index aa417fb0..39ec734a 100644 --- a/src/aig/saig/saigInd.c +++ b/src/aig/saig/saigInd.c @@ -150,8 +150,9 @@ int Saig_ManInduction( Aig_Man_t * p, int nFramesMax, int nConfMax, int fUnique, Vec_Int_t * vTopVarNums, * vState, * vTopVarIds = NULL; Vec_Ptr_t * vTop, * vBot; Aig_Obj_t * pObjPi, * pObjPiCopy, * pObjPo; - int i, k, f, clk, Lits[2], status = -1, RetValue, nSatVarNum, nConfPrev; + int i, k, f, Lits[2], status = -1, RetValue, nSatVarNum, nConfPrev; int nOldSize, iReg, iLast, fAdded, nConstrs = 0, nClauses = 0; + clock_t clk; assert( fUnique == 0 || fUniqueAll == 0 ); assert( Saig_ManPoNum(p) == 1 ); Aig_ManSetCioIds( p ); diff --git a/src/aig/saig/saigIso.c b/src/aig/saig/saigIso.c index 2250126b..ccff1bde 100644 --- a/src/aig/saig/saigIso.c +++ b/src/aig/saig/saigIso.c @@ -426,7 +426,8 @@ Aig_Man_t * Iso_ManFilterPos( Aig_Man_t * pAig, Vec_Ptr_t ** pvPosEquivs, int fV Vec_Ptr_t * vBuffers, * vClasses; Vec_Int_t * vLevel, * vRemain; Vec_Str_t * vStr, * vPrev; - int i, nPos, clk = clock(); + int i, nPos; + clock_t clk = clock(); int clkDup = 0, clkAig = 0, clkIso = 0, clk2; *pvPosEquivs = NULL; @@ -539,7 +540,7 @@ Aig_Man_t * Iso_ManFilterPos( Aig_Man_t * pAig, Vec_Ptr_t ** pvPosEquivs, int fV Aig_Man_t * Iso_ManTest( Aig_Man_t * pAig, int fVerbose ) { Vec_Int_t * vPerm; - int clk = clock(); + clock_t clk = clock(); vPerm = Saig_ManFindIsoPerm( pAig, fVerbose ); Vec_IntFree( vPerm ); Abc_PrintTime( 1, "Time", clock() - clk ); @@ -560,7 +561,7 @@ Aig_Man_t * Iso_ManTest( Aig_Man_t * pAig, int fVerbose ) Aig_Man_t * Saig_ManIsoReduce( Aig_Man_t * pAig, Vec_Ptr_t ** pvPosEquivs, int fVerbose ) { Aig_Man_t * pPart; - int clk = clock(); + clock_t clk = clock(); pPart = Iso_ManFilterPos( pAig, pvPosEquivs, fVerbose ); printf( "Reduced %d outputs to %d outputs. ", Saig_ManPoNum(pAig), Saig_ManPoNum(pPart) ); Abc_PrintTime( 1, "Time", clock() - clk ); diff --git a/src/aig/saig/saigIsoFast.c b/src/aig/saig/saigIsoFast.c index a7cc942c..8b60368f 100644 --- a/src/aig/saig/saigIsoFast.c +++ b/src/aig/saig/saigIsoFast.c @@ -160,7 +160,7 @@ void Iso_StoCollectInfo_rec( Aig_Man_t * p, Aig_Obj_t * pObj, int fCompl, Vec_In Vec_IntPush( vVisited, Aig_ObjId(pObj) ); } -//static int time_Trav = 0; +//static clock_t time_Trav = 0; /**Function************************************************************* @@ -286,7 +286,8 @@ Vec_Vec_t * Saig_IsoDetectFast( Aig_Man_t * pAig ) Aig_Obj_t * pObj; Vec_Ptr_t * vClasses, * vInfos; Vec_Int_t * vInfo, * vPrev, * vLevel; - int i, Number, nUnique = 0, clk = clock(); + int i, Number, nUnique = 0; + clock_t clk = clock(); // collect infos and remember their number pMan = Iso_StoStart( pAig ); diff --git a/src/aig/saig/saigIsoSlow.c b/src/aig/saig/saigIsoSlow.c index 3dcd7777..25cd68f0 100644 --- a/src/aig/saig/saigIsoSlow.c +++ b/src/aig/saig/saigIsoSlow.c @@ -290,11 +290,11 @@ struct Iso_Man_t_ Vec_Ptr_t * vClasses; // other classes Vec_Ptr_t * vTemp1; // other classes Vec_Ptr_t * vTemp2; // other classes - int timeHash; - int timeFout; - int timeSort; - int timeOther; - int timeTotal; + clock_t timeHash; + clock_t timeFout; + clock_t timeSort; + clock_t timeOther; + clock_t timeTotal; }; static inline Iso_Obj_t * Iso_ManObj( Iso_Man_t * p, int i ) { assert( i >= 0 && i < p->nObjs ); return i ? p->pObjs + i : NULL; } @@ -556,7 +556,8 @@ static inline int Iso_ObjHashAdd( Iso_Man_t * p, Iso_Obj_t * pIso ) void Iso_ManCollectClasses( Iso_Man_t * p ) { Iso_Obj_t * pIso; - int i, clk = clock(); + int i; + clock_t clk = clock(); Vec_PtrClear( p->vSingles ); Vec_PtrClear( p->vClasses ); for ( i = 0; i < p->nBins; i++ ) @@ -1171,8 +1172,7 @@ Vec_Int_t * Saig_ManFindIsoPerm( Aig_Man_t * pAig, int fVerbose ) int fVeryVerbose = 0; Vec_Int_t * vRes; Iso_Man_t * p; - int clk, clk2 = clock(); - clk = clock(); + clock_t clk = clock(), clk2 = clock(); p = Iso_ManCreate( pAig ); p->timeFout += clock() - clk; Iso_ManPrintClasses( p, fVerbose, fVeryVerbose ); diff --git a/src/aig/saig/saigMiter.c b/src/aig/saig/saigMiter.c index f7832f10..f3f6f279 100644 --- a/src/aig/saig/saigMiter.c +++ b/src/aig/saig/saigMiter.c @@ -1076,7 +1076,8 @@ int Ssw_SecSpecial( Aig_Man_t * pPart0, Aig_Man_t * pPart1, int nFrames, int fVe // extern int Fra_FraigCec( Aig_Man_t ** ppAig, int nConfLimit, int fVerbose ); int iOut, nOuts; Aig_Man_t * pMiterCec; - int RetValue, clkTotal = clock(); + int RetValue; + clock_t clkTotal = clock(); if ( fVerbose ) { Aig_ManPrintStats( pPart0 ); diff --git a/src/aig/saig/saigRefSat.c b/src/aig/saig/saigRefSat.c index 6a351e10..d99320ce 100644 --- a/src/aig/saig/saigRefSat.c +++ b/src/aig/saig/saigRefSat.c @@ -510,7 +510,7 @@ Abc_Cex_t * Saig_RefManRunSat( Saig_RefMan_t * p, int fNewOrder ) Vec_Int_t * vAssumps, * vVar2PiId; int i, k, Entry, RetValue;//, f = 0, Counter = 0; int nCoreLits, * pCoreLits; - int clk = clock(); + clock_t clk = clock(); // create CNF assert( Aig_ManRegNum(p->pFrames) == 0 ); // pCnf = Cnf_Derive( p->pFrames, 0 ); // too slow @@ -868,7 +868,7 @@ Abc_Cex_t * Saig_ManFindCexCareBits( Aig_Man_t * pAig, Abc_Cex_t * pCex, int nIn Saig_RefMan_t * p; Vec_Int_t * vReasons; Abc_Cex_t * pCare; - int clk = clock(); + clock_t clk = clock(); clk = clock(); p = Saig_RefManStart( pAig, pCex, nInputs, fVerbose ); @@ -931,7 +931,7 @@ Vec_Int_t * Saig_ManExtendCounterExampleTest3( Aig_Man_t * pAig, int iFirstFlopP { Saig_RefMan_t * p; Vec_Int_t * vRes, * vReasons; - int clk; + clock_t clk; if ( Saig_ManPiNum(pAig) != pCex->nPis ) { printf( "Saig_ManExtendCounterExampleTest3(): The PI count of AIG (%d) does not match that of cex (%d).\n", diff --git a/src/aig/saig/saigRetFwd.c b/src/aig/saig/saigRetFwd.c index bbd7f397..006167d5 100644 --- a/src/aig/saig/saigRetFwd.c +++ b/src/aig/saig/saigRetFwd.c @@ -213,7 +213,8 @@ Aig_Man_t * Saig_ManRetimeForwardOne( Aig_Man_t * p, int * pnRegFixed, int * pnR Aig_Man_t * Saig_ManRetimeForward( Aig_Man_t * p, int nMaxIters, int fVerbose ) { Aig_Man_t * pNew, * pTemp; - int i, clk, nRegFixed, nRegMoves = 1; + int i, nRegFixed, nRegMoves = 1; + clock_t clk; pNew = p; for ( i = 0; i < nMaxIters && nRegMoves > 0; i++ ) { diff --git a/src/aig/saig/saigSimExt.c b/src/aig/saig/saigSimExt.c index c83a7a64..36f3d903 100644 --- a/src/aig/saig/saigSimExt.c +++ b/src/aig/saig/saigSimExt.c @@ -521,7 +521,7 @@ Vec_Int_t * Saig_ManExtendCounterExampleTest( Aig_Man_t * p, int iFirstFlopPi, A { Vec_Int_t * vRes; Vec_Ptr_t * vSimInfo; - int clk; + clock_t clk; if ( Saig_ManPiNum(p) != pCex->nPis ) { printf( "Saig_ManExtendCounterExampleTest(): The PI count of AIG (%d) does not match that of cex (%d).\n", diff --git a/src/aig/saig/saigSimExt2.c b/src/aig/saig/saigSimExt2.c index f5aecc71..335c4034 100644 --- a/src/aig/saig/saigSimExt2.c +++ b/src/aig/saig/saigSimExt2.c @@ -337,7 +337,7 @@ Vec_Int_t * Saig_ManExtendCounterExampleTest2( Aig_Man_t * p, int iFirstFlopPi, { Vec_Int_t * vRes; Vec_Ptr_t * vSimInfo; - int clk; + clock_t clk; if ( Saig_ManPiNum(p) != pCex->nPis ) { printf( "Saig_ManExtendCounterExampleTest2(): The PI count of AIG (%d) does not match that of cex (%d).\n", @@ -446,7 +446,7 @@ Abc_Cex_t * Saig_ManFindCexCareBitsSense( Aig_Man_t * p, Abc_Cex_t * pCex, int i { Abc_Cex_t * pCare; Vec_Ptr_t * vSimInfo; - int clk; + clock_t clk; if ( Saig_ManPiNum(p) != pCex->nPis ) { printf( "Saig_ManExtendCounterExampleTest2(): The PI count of AIG (%d) does not match that of cex (%d).\n", diff --git a/src/aig/saig/saigSimFast.c b/src/aig/saig/saigSimFast.c index 27855bfd..e54e58ac 100644 --- a/src/aig/saig/saigSimFast.c +++ b/src/aig/saig/saigSimFast.c @@ -348,7 +348,8 @@ Vec_Int_t * Faig_ManComputeSwitchProbs4( Aig_Man_t * p, int nFrames, int nPref, Vec_Int_t * vSwitching; int * pProbs; float * pSwitching; - int nFramesReal, clk;//, clkTotal = clock(); + int nFramesReal; + clock_t clk;//, clkTotal = clock(); if ( fProbOne ) fTrans = 0; vSwitching = Vec_IntStart( Aig_ManObjNumMax(p) ); diff --git a/src/aig/saig/saigSimMv.c b/src/aig/saig/saigSimMv.c index 11bd088c..71259930 100644 --- a/src/aig/saig/saigSimMv.c +++ b/src/aig/saig/saigSimMv.c @@ -881,7 +881,8 @@ Vec_Ptr_t * Saig_MvManSimulate( Aig_Man_t * pAig, int nFramesSymb, int nFramesSa Vec_Ptr_t * vMap; Saig_MvMan_t * p; Saig_MvObj_t * pEntry; - int f, i, iState, clk = clock(); + int f, i, iState; + clock_t clk = clock(); assert( nFramesSymb >= 1 && nFramesSymb <= nFramesSatur ); // start manager diff --git a/src/aig/saig/saigSimSeq.c b/src/aig/saig/saigSimSeq.c index 86c45f37..ee4085b1 100644 --- a/src/aig/saig/saigSimSeq.c +++ b/src/aig/saig/saigSimSeq.c @@ -456,7 +456,7 @@ int Raig_ManSimulate( Aig_Man_t * pAig, int nWords, int nIters, int TimeLimit, i Raig_Man_t * p; Sec_MtrStatus_t Status; int i, iPat, RetValue = 0; - int clk, clkTotal = clock(); + clock_t clk, clkTotal = clock(); assert( Aig_ManRegNum(pAig) > 0 ); Status = Sec_MiterStatus( pAig ); if ( Status.nSat > 0 ) diff --git a/src/aig/saig/saigStrSim.c b/src/aig/saig/saigStrSim.c index 5d33595f..2feaba1b 100644 --- a/src/aig/saig/saigStrSim.c +++ b/src/aig/saig/saigStrSim.c @@ -877,7 +877,8 @@ Vec_Int_t * Saig_StrSimPerformMatching( Aig_Man_t * p0, Aig_Man_t * p1, int nDis Vec_Int_t * vPairs; Aig_Man_t * pPart0, * pPart1; Aig_Obj_t * pObj0, * pObj1; - int i, nMatches, clk, clkTotal = clock(); + int i, nMatches; + clock_t clk, clkTotal = clock(); Aig_ManRandom( 1 ); // consider the case when a miter is given if ( p1 == NULL ) diff --git a/src/aig/saig/saigSwitch.c b/src/aig/saig/saigSwitch.c index 4c54e3ad..8f4f962f 100644 --- a/src/aig/saig/saigSwitch.c +++ b/src/aig/saig/saigSwitch.c @@ -268,7 +268,8 @@ Vec_Int_t * Saig_ManComputeSwitchProb4s( Aig_Man_t * p, int nFrames, int nPref, Saig_SimObj_t * pAig, * pEntry; Vec_Int_t * vSwitching; float * pSwitching; - int nFramesReal, clk;//, clkTotal = clock(); + int nFramesReal; + clock_t clk;//, clkTotal = clock(); vSwitching = Vec_IntStart( Aig_ManObjNumMax(p) ); pSwitching = (float *)vSwitching->pArray; clk = clock(); diff --git a/src/aig/saig/saigSynch.c b/src/aig/saig/saigSynch.c index c592d0a5..28c8150f 100644 --- a/src/aig/saig/saigSynch.c +++ b/src/aig/saig/saigSynch.c @@ -504,7 +504,8 @@ Aig_Man_t * Saig_SynchSequenceApply( Aig_Man_t * pAig, int nWords, int fVerbose Aig_Man_t * pAigZero; Vec_Str_t * vSequence; Vec_Ptr_t * vSimInfo; - int RetValue, clk; + int RetValue; + clock_t clk; clk = clock(); // derive synchronization sequence @@ -557,7 +558,8 @@ Aig_Man_t * Saig_Synchronize( Aig_Man_t * pAig1, Aig_Man_t * pAig2, int nWords, Aig_Man_t * pAig1z, * pAig2z, * pMiter; Vec_Str_t * vSeq1, * vSeq2; Vec_Ptr_t * vSimInfo; - int RetValue, clk; + int RetValue; + clock_t clk; /* { unsigned u = Saig_SynchRandomTernary(); diff --git a/src/aig/saig/saigTrans.c b/src/aig/saig/saigTrans.c index 9be84e31..55c9772a 100644 --- a/src/aig/saig/saigTrans.c +++ b/src/aig/saig/saigTrans.c @@ -379,7 +379,7 @@ Aig_Man_t * Saig_ManTimeframeSimplify( Aig_Man_t * pAig, int nFrames, int nFrame { // extern Aig_Man_t * Fra_FraigEquivence( Aig_Man_t * pManAig, int nConfMax, int fProve ); Aig_Man_t * pFrames, * pFraig, * pRes1, * pRes2; - int clk; + clock_t clk; // create uninitialized timeframes with map1 pFrames = Saig_ManFramesNonInitial( pAig, nFrames ); // perform fraiging for the unrolled timeframes diff --git a/src/base/abc/abc.h b/src/base/abc/abc.h index 56f1df85..cbebf318 100644 --- a/src/base/abc/abc.h +++ b/src/base/abc/abc.h @@ -30,7 +30,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/vec/vec.h" #include "src/aig/hop/hop.h" diff --git a/src/base/abc/abcAig.c b/src/base/abc/abcAig.c index d594846b..4e725a01 100644 --- a/src/base/abc/abcAig.c +++ b/src/base/abc/abcAig.c @@ -589,7 +589,8 @@ void Abc_AigResize( Abc_Aig_t * pMan ) { Abc_Obj_t ** pBinsNew; Abc_Obj_t * pEnt, * pEnt2; - int nBinsNew, Counter, i, clk; + int nBinsNew, Counter, i; + clock_t clk; unsigned Key; clk = clock(); diff --git a/src/base/abc/abcDfs.c b/src/base/abc/abcDfs.c index 6d67785b..a96263c1 100644 --- a/src/base/abc/abcDfs.c +++ b/src/base/abc/abcDfs.c @@ -835,7 +835,8 @@ int Abc_ObjSuppSize( Abc_Obj_t * pObj ) int Abc_NtkSuppSizeTest( Abc_Ntk_t * p ) { Abc_Obj_t * pObj; - int i, Counter = 0, clk = clock(); + int i, Counter = 0; + clock_t clk = clock(); Abc_NtkForEachObj( p, pObj, i ) if ( Abc_ObjIsNode(pObj) ) Counter += (Abc_ObjSuppSize(pObj) <= 16); diff --git a/src/base/abc/abcHieCec.c b/src/base/abc/abcHieCec.c index b3a3718f..83a332c2 100644 --- a/src/base/abc/abcHieCec.c +++ b/src/base/abc/abcHieCec.c @@ -667,7 +667,8 @@ Gia_Man_t * Abc_NtkHieCecTest( char * pFileName, int fVerbose ) Vec_Ptr_t * vMods, * vOrder; Abc_Ntk_t * pNtk, * pModel; Gia_Man_t * pGia; - int i, clk = clock(); + int i; + clock_t clk = clock(); // read hierarchical netlist pNtk = Io_ReadBlifMv( pFileName, 0, fCheck ); diff --git a/src/base/abc/abcHieNew.c b/src/base/abc/abcHieNew.c index d4598ac1..fe1496d9 100644 --- a/src/base/abc/abcHieNew.c +++ b/src/base/abc/abcHieNew.c @@ -22,7 +22,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/vec/vec.h" #include "src/misc/util/utilNam.h" @@ -1491,8 +1490,8 @@ Gia_Man_t * Au_ManDeriveTest( Abc_Ntk_t * pRoot ) Abc_Ntk_t * pMod; Au_Man_t * pMan; Au_Ntk_t * pNtk = NULL; - int i, clk1, clk2 = 0, clk3 = 0, clk = clock(); -// int clk4 = 0; + clock_t clk1, clk2 = 0, clk3 = 0, clk = clock(); + int i; clk1 = clock(); pMan = Au_ManAlloc( pRoot->pDesign ? pRoot->pDesign->pName : pRoot->pName ); @@ -1570,7 +1569,7 @@ Gia_Man_t * Abc_NtkHieCecTest2( char * pFileName, char * pModelName, int fVerbos int fSimulation = 0; Gia_Man_t * pGia = NULL; Au_Ntk_t * pNtk, * pNtkClp = NULL; - int clk1 = 0, clk = clock(); + clock_t clk1 = 0, clk = clock(); // read hierarchical netlist pNtk = Au_NtkParseCBlif( pFileName ); diff --git a/src/base/abci/abc.c b/src/base/abci/abc.c index 590e5875..03eb8d21 100644 --- a/src/base/abci/abc.c +++ b/src/base/abci/abc.c @@ -10986,7 +10986,8 @@ int Abc_CommandIProve( Abc_Frame_t * pAbc, int argc, char ** argv ) { Prove_Params_t Params, * pParams = &Params; Abc_Ntk_t * pNtk, * pNtkTemp; - int c, clk, RetValue, iOut = -1; + int c, RetValue, iOut = -1; + clock_t clk; extern int Abc_NtkIvyProve( Abc_Ntk_t ** ppNtk, void * pPars ); @@ -18797,7 +18798,7 @@ int Abc_CommandSat( Abc_Frame_t * pAbc, int argc, char ** argv ) int fVerbose; int nConfLimit; int nInsLimit; - int clk; + clock_t clk; // set defaults fVerbose = 0; nConfLimit = 0; @@ -18927,7 +18928,7 @@ int Abc_CommandDSat( Abc_Frame_t * pAbc, int argc, char ** argv ) int fVerbose; int nConfLimit; int nInsLimit; - int clk; + clock_t clk; extern int Abc_NtkDSat( Abc_Ntk_t * pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimit, int fAlignPol, int fAndOuts, int fNewSolver, int fVerbose ); // set defaults @@ -19057,7 +19058,7 @@ int Abc_CommandPSat( Abc_Frame_t * pAbc, int argc, char ** argv ) { Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); int RetValue; - int c, clk; + int c; int nAlgo; int nPartSize; int nConfPart; @@ -19065,6 +19066,7 @@ int Abc_CommandPSat( Abc_Frame_t * pAbc, int argc, char ** argv ) int fAlignPol; int fSynthesize; int fVerbose; + clock_t clk; extern int Abc_NtkPartitionedSat( Abc_Ntk_t * pNtk, int nAlgo, int nPartSize, int nConfPart, int nConfTotal, int fAlignPol, int fSynthesize, int fVerbose ); // set defaults @@ -19215,7 +19217,8 @@ int Abc_CommandProve( Abc_Frame_t * pAbc, int argc, char ** argv ) { Abc_Ntk_t * pNtk, * pNtkTemp; Prove_Params_t Params, * pParams = &Params; - int c, clk, RetValue; + int c, RetValue; + clock_t clk; pNtk = Abc_FrameReadNtk(pAbc); // set defaults diff --git a/src/base/abci/abcAuto.c b/src/base/abci/abcAuto.c index e1e479e3..7b4d7694 100644 --- a/src/base/abci/abcAuto.c +++ b/src/base/abci/abcAuto.c @@ -128,7 +128,7 @@ void Abc_NtkAutoPrintAll( DdManager * dd, int nInputs, DdNode * pbOutputs[], int int nAutoSymsMaxSupp; int nAutoSymOuts; int nSuppSizeMax; - int clk; + clock_t clk; nAutoSymOuts = 0; nAutoSyms = 0; diff --git a/src/base/abci/abcBidec.c b/src/base/abci/abcBidec.c index fc093420..507b7355 100644 --- a/src/base/abci/abcBidec.c +++ b/src/base/abci/abcBidec.c @@ -114,7 +114,7 @@ void Abc_NtkBidecResyn( Abc_Ntk_t * pNtk, int fVerbose ) Abc_Obj_t * pObj; Vec_Int_t * vTruth; int i, nGainTotal = 0, nNodes1, nNodes2; - int clk = clock(); + clock_t clk = clock(); assert( Abc_NtkIsLogic(pNtk) ); if ( !Abc_NtkToAig(pNtk) ) return; diff --git a/src/base/abci/abcBm.c b/src/base/abci/abcBm.c index d2f80aeb..19c8e9ff 100644 --- a/src/base/abci/abcBm.c +++ b/src/base/abci/abcBm.c @@ -870,7 +870,8 @@ int Abc_NtkMiterSatBm( Abc_Ntk_t * pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nIn { static sat_solver * pSat = NULL; lbool status; - int RetValue, clk; + int RetValue; + clock_t clk; extern int Abc_NodeAddClausesTop( sat_solver * pSat, Abc_Obj_t * pNode, Vec_Int_t * vVars ); extern Vec_Int_t * Abc_NtkGetCiSatVarNums( Abc_Ntk_t * pNtk ); @@ -1582,7 +1583,7 @@ float refineBySAT(Abc_Ntk_t * pNtk1, Vec_Int_t ** iMatch1, int * iGroup1, Vec_In Vec_Int_t * oMatchedGroups; FILE *result; int matchFound; - int clk = clock(); + clock_t clk = clock(); float satTime = 0.0; /*matchFile = fopen("satmatch.txt", "w");*/ @@ -1787,7 +1788,7 @@ void bmGateWay( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int p_equivalence ) char * vPiValues1, * vPiValues2; int * observability1, * observability2; - int clk = clock(); + clock_t clk = clock(); float initTime; float simulTime; float satTime; diff --git a/src/base/abci/abcCas.c b/src/base/abci/abcCas.c index 7e80c919..51ab4130 100644 --- a/src/base/abci/abcCas.c +++ b/src/base/abci/abcCas.c @@ -60,8 +60,8 @@ Abc_Ntk_t * Abc_NtkCascade( Abc_Ntk_t * pNtk, int nLutSize, int fCheck, int fVer Abc_Obj_t * pNode; char * pFileGeneric; int fBddSizeMax = 500000; - int fReorder = 1; - int i, clk = clock(); + int i, fReorder = 1; + clock_t clk = clock(); assert( Abc_NtkIsStrash(pNtk) ); // compute the global BDDs diff --git a/src/base/abci/abcCollapse.c b/src/base/abci/abcCollapse.c index 69525e2f..e6a6db79 100644 --- a/src/base/abci/abcCollapse.c +++ b/src/base/abci/abcCollapse.c @@ -49,7 +49,7 @@ static Abc_Obj_t * Abc_NodeFromGlobalBdds( Abc_Ntk_t * pNtkNew, DdManager * dd, Abc_Ntk_t * Abc_NtkCollapse( Abc_Ntk_t * pNtk, int fBddSizeMax, int fDualRail, int fReorder, int fVerbose ) { Abc_Ntk_t * pNtkNew; - int clk = clock(); + clock_t clk = clock(); assert( Abc_NtkIsStrash(pNtk) ); // compute the global BDDs diff --git a/src/base/abci/abcCut.c b/src/base/abci/abcCut.c index 6116649e..a2ab9315 100644 --- a/src/base/abci/abcCut.c +++ b/src/base/abci/abcCut.c @@ -128,7 +128,7 @@ Cut_Man_t * Abc_NtkCuts( Abc_Ntk_t * pNtk, Cut_Params_t * pParams ) Vec_Ptr_t * vNodes; Vec_Int_t * vChoices; int i; - int clk = clock(); + clock_t clk = clock(); extern void Abc_NtkBalanceAttach( Abc_Ntk_t * pNtk ); extern void Abc_NtkBalanceDetach( Abc_Ntk_t * pNtk ); diff --git a/src/base/abci/abcDar.c b/src/base/abci/abcDar.c index a5ae7e9b..82b3d916 100644 --- a/src/base/abci/abcDar.c +++ b/src/base/abci/abcDar.c @@ -1047,7 +1047,7 @@ Abc_Ntk_t * Abc_NtkDRewrite( Abc_Ntk_t * pNtk, Dar_RwrPar_t * pPars ) { Aig_Man_t * pMan, * pTemp; Abc_Ntk_t * pNtkAig; - int clk; + clock_t clk; assert( Abc_NtkIsStrash(pNtk) ); pMan = Abc_NtkToDar( pNtk, 0, 0 ); if ( pMan == NULL ) @@ -1091,7 +1091,7 @@ Abc_Ntk_t * Abc_NtkDRefactor( Abc_Ntk_t * pNtk, Dar_RefPar_t * pPars ) { Aig_Man_t * pMan, * pTemp; Abc_Ntk_t * pNtkAig; - int clk; + clock_t clk; assert( Abc_NtkIsStrash(pNtk) ); pMan = Abc_NtkToDar( pNtk, 0, 0 ); if ( pMan == NULL ) @@ -1128,7 +1128,7 @@ Abc_Ntk_t * Abc_NtkDC2( Abc_Ntk_t * pNtk, int fBalance, int fUpdateLevel, int fF { Aig_Man_t * pMan, * pTemp; Abc_Ntk_t * pNtkAig; - int clk; + clock_t clk; assert( Abc_NtkIsStrash(pNtk) ); pMan = Abc_NtkToDar( pNtk, 0, 0 ); if ( pMan == NULL ) @@ -1191,7 +1191,7 @@ Abc_Ntk_t * Abc_NtkDch( Abc_Ntk_t * pNtk, Dch_Pars_t * pPars ) Aig_Man_t * pMan, * pTemp; Abc_Ntk_t * pNtkAig; Gia_Man_t * pGia; - int clk; + clock_t clk; assert( Abc_NtkIsStrash(pNtk) ); pMan = Abc_NtkToDar( pNtk, 0, 0 ); if ( pMan == NULL ) @@ -1234,7 +1234,7 @@ Abc_Ntk_t * Abc_NtkDrwsat( Abc_Ntk_t * pNtk, int fBalance, int fVerbose ) { Aig_Man_t * pMan, * pTemp; Abc_Ntk_t * pNtkAig; - int clk; + clock_t clk; assert( Abc_NtkIsStrash(pNtk) ); pMan = Abc_NtkToDar( pNtk, 0, 0 ); if ( pMan == NULL ) @@ -1342,7 +1342,7 @@ Abc_Ntk_t * Abc_NtkDarToCnf( Abc_Ntk_t * pNtk, char * pFileName, int fFastAlgo, // Cnf_Man_t * pManCnf = NULL; Cnf_Dat_t * pCnf; Abc_Ntk_t * pNtkNew = NULL; - int clk = clock(); + clock_t clk = clock(); assert( Abc_NtkIsStrash(pNtk) ); // convert to the AIG manager @@ -1457,7 +1457,8 @@ int Abc_NtkDarCec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConfLimit, int fPa { Aig_Man_t * pMan, * pMan1, * pMan2; Abc_Ntk_t * pMiter; - int RetValue, clkTotal = clock(); + int RetValue; + clock_t clkTotal = clock(); /* { extern void Cec_ManVerifyTwoAigs( Aig_Man_t * pAig0, Aig_Man_t * pAig1, int fVerbose ); @@ -1574,7 +1575,7 @@ Abc_Ntk_t * Abc_NtkDarSeqSweep( Abc_Ntk_t * pNtk, Fra_Ssw_t * pPars ) Fraig_Params_t Params; Abc_Ntk_t * pNtkAig = NULL, * pNtkFraig; Aig_Man_t * pMan, * pTemp; - int clk = clock(); + clock_t clk = clock(); // preprocess the miter by fraiging it // (note that for each functional class, fraiging leaves one representative; @@ -1857,8 +1858,9 @@ int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int { Aig_Man_t * pMan; Vec_Int_t * vMap = NULL; - int status, RetValue = -1, clk = clock(); - int nTimeLimit = nTimeOut ? time(NULL) + nTimeOut : 0; + int status, RetValue = -1; + clock_t clk = clock(); + clock_t nTimeLimit = nTimeOut ? nTimeOut * CLOCKS_PER_SEC + clock(): 0; // derive the AIG manager if ( fOrDecomp ) pMan = Abc_NtkToDarBmc( pNtk, &vMap ); @@ -1889,7 +1891,7 @@ int Abc_NtkDarBmc( Abc_Ntk_t * pNtk, int nStart, int nFrames, int nSizeMax, int else if ( RetValue == -1 ) { Abc_Print( 1, "No output asserted in %d frames. Resource limit reached ", Abc_MaxInt(iFrame,0) ); - if ( nTimeLimit && time(NULL) > nTimeLimit ) + if ( nTimeLimit && clock() > nTimeLimit ) Abc_Print( 1, "(timeout %d sec). ", nTimeLimit ); else Abc_Print( 1, "(conf limit %d). ", nBTLimit ); @@ -1938,8 +1940,9 @@ int Abc_NtkDarBmc3( Abc_Ntk_t * pNtk, Saig_ParBmc_t * pPars, int fOrDecomp ) { Aig_Man_t * pMan; Vec_Int_t * vMap = NULL; - int status, RetValue = -1, clk = clock(); - int nTimeOut = pPars->nTimeOut ? time(NULL) + pPars->nTimeOut : 0; + int status, RetValue = -1; + clock_t clk = clock(); + clock_t nTimeOut = pPars->nTimeOut ? pPars->nTimeOut * CLOCKS_PER_SEC + clock(): 0; if ( fOrDecomp && !pPars->fSolveAll ) pMan = Abc_NtkToDarBmc( pNtk, &vMap ); else @@ -1966,7 +1969,7 @@ int Abc_NtkDarBmc3( Abc_Ntk_t * pNtk, Saig_ParBmc_t * pPars, int fOrDecomp ) if ( pPars->nFailOuts == 0 ) { Abc_Print( 1, "No output asserted in %d frames. Resource limit reached ", Abc_MaxInt(pPars->iFrame,0) ); - if ( nTimeOut && time(NULL) > nTimeOut ) + if ( nTimeOut && clock() > nTimeOut ) Abc_Print( 1, "(timeout %d sec). ", pPars->nTimeOut ); else Abc_Print( 1, "(conf limit %d). ", pPars->nConfLimit ); @@ -1974,7 +1977,7 @@ int Abc_NtkDarBmc3( Abc_Ntk_t * pNtk, Saig_ParBmc_t * pPars, int fOrDecomp ) else { Abc_Print( 1, "The total of %d outputs asserted in %d frames. Resource limit reached ", pPars->nFailOuts, pPars->iFrame ); - if ( time(NULL) > nTimeOut ) + if ( clock() > nTimeOut ) Abc_Print( 1, "(timeout %d sec). ", pPars->nTimeOut ); else Abc_Print( 1, "(conf limit %d). ", pPars->nConfLimit ); @@ -2030,7 +2033,8 @@ int Abc_NtkDarBmc3( Abc_Ntk_t * pNtk, Saig_ParBmc_t * pPars, int fOrDecomp ) ***********************************************************************/ int Abc_NtkDarBmcInter_int( Aig_Man_t * pMan, Inter_ManParams_t * pPars, Aig_Man_t ** ppNtkRes ) { - int RetValue = -1, iFrame, clk = clock(); + int RetValue = -1, iFrame; + clock_t clk = clock(); int nTotalProvedSat = 0; assert( pMan->nRegs > 0 ); if ( ppNtkRes ) @@ -2354,12 +2358,14 @@ int Abc_NtkDarDemiterDual( Abc_Ntk_t * pNtk, int fVerbose ) int Abc_NtkDarProve( Abc_Ntk_t * pNtk, Fra_Sec_t * pSecPar, int nBmcFramesMax, int nBmcConfMax ) { Aig_Man_t * pMan; - int iFrame = -1, RetValue = -1, clkTotal = clock(); + int iFrame = -1, RetValue = -1; + clock_t clkTotal = clock(); if ( pSecPar->fTryComb || Abc_NtkLatchNum(pNtk) == 0 ) { Prove_Params_t Params, * pParams = &Params; Abc_Ntk_t * pNtkComb; - int RetValue, clk = clock(); + int RetValue; + clock_t clk = clock(); if ( Abc_NtkLatchNum(pNtk) == 0 ) Abc_Print( 1, "The network has no latches. Running CEC.\n" ); // create combinational network @@ -2549,7 +2555,8 @@ int Abc_NtkDarSec( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, Fra_Sec_t * pSecPar ) ***********************************************************************/ int Abc_NtkDarPdr( Abc_Ntk_t * pNtk, Pdr_Par_t * pPars, Abc_Cex_t ** ppCex ) { - int RetValue = -1, clk = clock(); + int RetValue = -1; + clock_t clk = clock(); Aig_Man_t * pMan; *ppCex = NULL; pMan = Abc_NtkToDar( pNtk, 0, 1 ); @@ -3004,7 +3011,8 @@ int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, in extern int Raig_ManSimulate( Aig_Man_t * pAig, int nWords, int nIters, int TimeLimit, int fMiter, int fVerbose ); Aig_Man_t * pMan; Abc_Cex_t * pCex; - int status, RetValue = -1, clk = clock(); + int status, RetValue = -1; + clock_t clk = clock(); if ( Abc_NtkGetChoiceNum(pNtk) ) { Abc_Print( 1, "Removing %d choices from the AIG.\n", Abc_NtkGetChoiceNum(pNtk) ); @@ -3194,7 +3202,8 @@ int Abc_NtkDarSeqSim( Abc_Ntk_t * pNtk, int nFrames, int nWords, int TimeOut, in int Abc_NtkDarSeqSim3( Abc_Ntk_t * pNtk, int nFrames, int nWords, int nBinSize, int nRounds, int nRandSeed, int TimeOut, int fVerbose ) { Aig_Man_t * pMan; - int status, RetValue = -1, clk = clock(); + int status, RetValue = -1; + clock_t clk = clock(); if ( Abc_NtkGetChoiceNum(pNtk) ) { Abc_Print( 1, "Removing %d choices from the AIG.\n", Abc_NtkGetChoiceNum(pNtk) ); @@ -3328,7 +3337,7 @@ Abc_Ntk_t * Abc_NtkDarTempor( Abc_Ntk_t * pNtk, int nFrames, int TimeOut, int nC int Abc_NtkDarInduction( Abc_Ntk_t * pNtk, int nFramesMax, int nConfMax, int fUnique, int fUniqueAll, int fGetCex, int fVerbose, int fVeryVerbose ) { Aig_Man_t * pMan; - int clkTotal = clock(); + clock_t clkTotal = clock(); int RetValue; pMan = Abc_NtkToDar( pNtk, 0, 1 ); if ( pMan == NULL ) @@ -3442,9 +3451,9 @@ void Abc_NtkInterFast( Abc_Ntk_t * pNtkOn, Abc_Ntk_t * pNtkOff, int fVerbose ) Aig_ManStop( pManOff ); } -int timeCnf; -int timeSat; -int timeInt; +clock_t timeCnf; +clock_t timeSat; +clock_t timeInt; /**Function************************************************************* diff --git a/src/base/abci/abcDebug.c b/src/base/abci/abcDebug.c index baf87944..ebed2efa 100644 --- a/src/base/abci/abcDebug.c +++ b/src/base/abci/abcDebug.c @@ -51,7 +51,8 @@ void Abc_NtkAutoDebug( Abc_Ntk_t * pNtk, int (*pFuncError) (Abc_Ntk_t *) ) { Abc_Ntk_t * pNtkMod; char * pFileName = "bug_found.blif"; - int i, nSteps, nIter, ModNum, RandNum = 1, clk, clkTotal = clock(); + int i, nSteps, nIter, ModNum, RandNum = 1; + clock_t clk, clkTotal = clock(); assert( Abc_NtkIsLogic(pNtk) ); srand( 0x123123 ); // create internal copy of the network diff --git a/src/base/abci/abcDress2.c b/src/base/abci/abcDress2.c index efd7db3b..84bf1229 100644 --- a/src/base/abci/abcDress2.c +++ b/src/base/abci/abcDress2.c @@ -358,7 +358,7 @@ void Abc_NtkDressPrintEquivs( Vec_Ptr_t * vRes ) SeeAlso [] ***********************************************************************/ -void Abc_NtkDressPrintStats( Vec_Ptr_t * vRes, int nNodes0, int nNodes1, int Time ) +void Abc_NtkDressPrintStats( Vec_Ptr_t * vRes, int nNodes0, int nNodes1, clock_t Time ) { Vec_Int_t * vClass; int i, k, Entry; @@ -419,7 +419,7 @@ void Abc_NtkDressPrintStats( Vec_Ptr_t * vRes, int nNodes0, int nNodes1, int Tim void Abc_NtkDress2( Abc_Ntk_t * pNtk1, Abc_Ntk_t * pNtk2, int nConflictLimit, int fVerbose ) { Vec_Ptr_t * vRes; - int clk = clock(); + clock_t clk = clock(); vRes = Abc_NtkDressComputeEquivs( pNtk1, pNtk2, nConflictLimit, fVerbose ); // Abc_NtkDressPrintEquivs( vRes ); Abc_NtkDressPrintStats( vRes, Abc_NtkNodeNum(pNtk1), Abc_NtkNodeNum(pNtk1), clock() - clk ); diff --git a/src/base/abci/abcIf.c b/src/base/abci/abcIf.c index cf32d8ec..0a4b9d56 100644 --- a/src/base/abci/abcIf.c +++ b/src/base/abci/abcIf.c @@ -70,7 +70,8 @@ void Abc_NtkIfComputeSwitching( Abc_Ntk_t * pNtk, If_Man_t * pIfMan ) Aig_Obj_t * pObjAig; Aig_Man_t * pAig; If_Obj_t * pObjIf; - int i, clk = clock(); + int i; + clock_t clk = clock(); // map IF objects into old network Abc_NtkForEachObj( pNtk, pObjAbc, i ) if ( (pObjIf = (If_Obj_t *)pObjAbc->pTemp) ) diff --git a/src/base/abci/abcIvy.c b/src/base/abci/abcIvy.c index c2637a08..0c422ab5 100644 --- a/src/base/abci/abcIvy.c +++ b/src/base/abci/abcIvy.c @@ -197,7 +197,7 @@ Abc_Ntk_t * Abc_NtkIvyHaig( Abc_Ntk_t * pNtk, int nIters, int fUseZeroCost, int { Abc_Ntk_t * pNtkAig; Ivy_Man_t * pMan; - int clk; + clock_t clk; // int i; /* extern int nMoves; diff --git a/src/base/abci/abcLutmin.c b/src/base/abci/abcLutmin.c index bbea264c..bdeb53ff 100644 --- a/src/base/abci/abcLutmin.c +++ b/src/base/abci/abcLutmin.c @@ -85,7 +85,8 @@ void Abc_NtkCheckAbsorb( Abc_Ntk_t * pNtk, int nLutSize ) Vec_Int_t * vCounts; Vec_Ptr_t * vFanins; Abc_Obj_t * pObj, * pFanin; - int i, k, Counter = 0, Counter2 = 0, clk = clock(); + int i, k, Counter = 0, Counter2 = 0; + clock_t clk = clock(); vCounts = Vec_IntStart( Abc_NtkObjNumMax(pNtk) ); vFanins = Vec_PtrAlloc( 100 ); Abc_NtkForEachNode( pNtk, pObj, i ) diff --git a/src/base/abci/abcMap.c b/src/base/abci/abcMap.c index 723e5688..988da5c2 100644 --- a/src/base/abci/abcMap.c +++ b/src/base/abci/abcMap.c @@ -64,7 +64,7 @@ Abc_Ntk_t * Abc_NtkMap( Abc_Ntk_t * pNtk, double DelayTarget, int fRecovery, int Map_Man_t * pMan; Vec_Int_t * vSwitching = NULL; float * pSwitching = NULL; - int clk, clkTotal = clock(); + clock_t clk, clkTotal = clock(); assert( Abc_NtkIsStrash(pNtk) ); diff --git a/src/base/abci/abcMerge.c b/src/base/abci/abcMerge.c index 917a97da..cc606488 100644 --- a/src/base/abci/abcMerge.c +++ b/src/base/abci/abcMerge.c @@ -285,7 +285,8 @@ Vec_Int_t * Abc_NtkLutMerge( Abc_Ntk_t * pNtk, Nwk_LMPars_t * pPars ) Vec_Int_t * vResult; Vec_Ptr_t * vStart, * vNext, * vCands1, * vCands2; Abc_Obj_t * pLut, * pCand; - int i, k, nVertsMax, nCands, clk = clock(); + int i, k, nVertsMax, nCands; + clock_t clk = clock(); // count the number of vertices nVertsMax = 0; Abc_NtkForEachNode( pNtk, pLut, i ) diff --git a/src/base/abci/abcMffc.c b/src/base/abci/abcMffc.c index f26cd233..3a911c67 100644 --- a/src/base/abci/abcMffc.c +++ b/src/base/abci/abcMffc.c @@ -545,7 +545,8 @@ void Abc_NktMffcTestSuper( Abc_Ntk_t * pNtk ) Abc_Obj_t * pObj, * pFanin; Vec_Int_t * vCounts, * vNumbers, * vSizes, * vMarks; Vec_Int_t * vNode1, * vNode2; - int i, k, Entry, nSizes, clk = clock(); + int i, k, Entry, nSizes; + clock_t clk = clock(); vRoots = Abc_NktMffcMarkRoots( pNtk, 1 ); vFanins = Vec_PtrStart( Abc_NtkObjNumMax(pNtk) ); vFanouts = Vec_PtrStart( Abc_NtkObjNumMax(pNtk) ); @@ -892,7 +893,8 @@ Vec_Ptr_t * Abc_NktMffcDerive( Abc_Ntk_t * pNtk, Vec_Ptr_t ** pvFanins, Vec_Ptr_ { Vec_Ptr_t * vRoots, * vFanins, * vFanouts, * vVolumes, * vNodes, * vLeaves; Abc_Obj_t * pObj, * pFanin; - int i, k, clk = clock(); + int i, k; + clock_t clk = clock(); // create roots vRoots = Abc_NktMffcMarkRoots( pNtk, 0 ); // create fanins/fanouts/volumes @@ -1205,7 +1207,8 @@ void Abc_NktMffcServerTest( Abc_Ntk_t * pNtk ) Vec_Ptr_t * vGlobs; Vec_Int_t * vGlob, * vLeaves, * vRoots; double Cost, CostAll = 0.0; - int i, k, Entry, nNodes = 0, clk = clock(); + int i, k, Entry, nNodes = 0; + clock_t clk = clock(); vGlobs = Abc_NktMffcServer( pNtk, 18, 3 ); vLeaves = Vec_IntAlloc( 100 ); vRoots = Vec_IntAlloc( 100 ); diff --git a/src/base/abci/abcNpnSave.c b/src/base/abci/abcNpnSave.c index b57d2ef3..b99b1e52 100644 --- a/src/base/abci/abcNpnSave.c +++ b/src/base/abci/abcNpnSave.c @@ -392,7 +392,8 @@ void Npn_ManResize( Npn_Man_t * p ) { Npn_Obj_t * pEntry, * pNext; int * pBinsOld, * ppPlace; - int nBinsOld, Counter, i, clk; + int nBinsOld, Counter, i; + clock_t clk; assert( p->pBins != NULL ); clk = clock(); // save the old Bins diff --git a/src/base/abci/abcNtbdd.c b/src/base/abci/abcNtbdd.c index a1fab695..2fac9497 100644 --- a/src/base/abci/abcNtbdd.c +++ b/src/base/abci/abcNtbdd.c @@ -571,7 +571,8 @@ void Abc_NtkBddImplicationTest() DdNode * bImp, * bSum, * bTemp; int nVars = 200; int nImps = 200; - int i, clk; + int i; + clock_t clk; clk = clock(); dd = Cudd_Init( nVars, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 ); Cudd_AutodynEnable( dd, CUDD_REORDER_SIFT ); diff --git a/src/base/abci/abcOdc.c b/src/base/abci/abcOdc.c index e0f6d6de..ff85035b 100644 --- a/src/base/abci/abcOdc.c +++ b/src/base/abci/abcOdc.c @@ -86,14 +86,14 @@ struct Odc_Man_t_ int nTotalDcs; // total percentage of DCs // runtime - int timeClean; // windowing - int timeWin; // windowing - int timeMiter; // computing the miter - int timeSim; // simulation - int timeQuant; // quantification - int timeTruth; // truth table - int timeTotal; // useful runtime - int timeAbort; // aborted runtime + clock_t timeClean; // windowing + clock_t timeWin; // windowing + clock_t timeMiter; // computing the miter + clock_t timeSim; // simulation + clock_t timeQuant; // quantification + clock_t timeTruth; // truth table + clock_t timeTotal; // useful runtime + clock_t timeAbort; // aborted runtime }; @@ -241,7 +241,7 @@ Odc_Man_t * Abc_NtkDontCareAlloc( int nVarsMax, int nLevels, int fVerbose, int f ***********************************************************************/ void Abc_NtkDontCareClear( Odc_Man_t * p ) { - int clk = clock(); + clock_t clk = clock(); // clean the structural hashing table if ( Vec_IntSize(p->vUsedSpots) > p->nTableSize/3 ) // more than one third memset( p->pTable, 0, sizeof(Odc_Lit_t) * p->nTableSize ); @@ -1033,7 +1033,7 @@ int Abc_NtkDontCareSimulateBefore( Odc_Man_t * p, unsigned * puTruth ) int Abc_NtkDontCareCompute( Odc_Man_t * p, Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves, unsigned * puTruth ) { int nMints, RetValue; - int clk, clkTotal = clock(); + clock_t clk, clkTotal = clock(); p->nWins++; diff --git a/src/base/abci/abcPart.c b/src/base/abci/abcPart.c index 7ae435d8..163c81b9 100644 --- a/src/base/abci/abcPart.c +++ b/src/base/abci/abcPart.c @@ -725,7 +725,8 @@ Vec_Ptr_t * Abc_NtkPartitionSmart( Abc_Ntk_t * pNtk, int nSuppSizeLimit, int fVe Vec_Ptr_t * vPartSuppsChar; Vec_Ptr_t * vSupps, * vPartsAll, * vPartsAll2, * vPartSuppsAll; Vec_Int_t * vOne, * vPart, * vPartSupp, * vTemp; - int i, iPart, iOut, clk, clk2, timeFind = 0; + int i, iPart, iOut, timeFind = 0; + clock_t clk, clk2; // compute the supports for all outputs clk = clock(); @@ -1163,7 +1164,7 @@ void Abc_NtkFraigPartitionedTime( Abc_Ntk_t * pNtk, void * pParams ) Vec_Int_t * vOne; Abc_Ntk_t * pNtkAig, * pNtkFraig; int i; - int clk = clock(); + clock_t clk = clock(); // perform partitioning assert( Abc_NtkIsStrash(pNtk) ); diff --git a/src/base/abci/abcPrint.c b/src/base/abci/abcPrint.c index 664ddec1..c0f97530 100644 --- a/src/base/abci/abcPrint.c +++ b/src/base/abci/abcPrint.c @@ -1294,7 +1294,8 @@ void Abc_ObjPrint( FILE * pFile, Abc_Obj_t * pObj ) void Abc_NtkPrintMiter( Abc_Ntk_t * pNtk ) { Abc_Obj_t * pObj, * pChild, * pConst1 = Abc_AigConst1(pNtk); - int i, iOut = -1, Time = clock(); + int i, iOut = -1; + clock_t Time = clock(); int nUnsat = 0; int nSat = 0; int nUndec = 0; diff --git a/src/base/abci/abcProve.c b/src/base/abci/abcProve.c index 3a6c42a4..f4bd89ef 100644 --- a/src/base/abci/abcProve.c +++ b/src/base/abci/abcProve.c @@ -60,7 +60,8 @@ int Abc_NtkMiterProve( Abc_Ntk_t ** ppNtk, void * pPars ) { Prove_Params_t * pParams = (Prove_Params_t *)pPars; Abc_Ntk_t * pNtk, * pNtkTemp; - int RetValue = -1, nIter, nSatFails, Counter, clk; //, timeStart = clock(); + int RetValue = -1, nIter, nSatFails, Counter; + clock_t clk; //, timeStart = clock(); ABC_INT64_T nSatConfs, nSatInspects, nInspectLimit; // get the starting network diff --git a/src/base/abci/abcQbf.c b/src/base/abci/abcQbf.c index 98cb3eb6..2fec2a07 100644 --- a/src/base/abci/abcQbf.c +++ b/src/base/abci/abcQbf.c @@ -64,7 +64,7 @@ void Abc_NtkQbf( Abc_Ntk_t * pNtk, int nPars, int nItersMax, int fVerbose ) { Abc_Ntk_t * pNtkVer, * pNtkSyn, * pNtkSyn2, * pNtkTemp; Vec_Int_t * vPiValues; - int clkTotal = clock(), clkS, clkV; + clock_t clkTotal = clock(), clkS, clkV; int nIters, nIterMax = 500, nInputs, RetValue, fFound = 0; assert( Abc_NtkIsStrash(pNtk) ); diff --git a/src/base/abci/abcQuant.c b/src/base/abci/abcQuant.c index 7185cf8d..0951795f 100644 --- a/src/base/abci/abcQuant.c +++ b/src/base/abci/abcQuant.c @@ -327,10 +327,11 @@ Abc_Ntk_t * Abc_NtkReachability( Abc_Ntk_t * pNtkRel, int nIters, int fVerbose ) { Abc_Obj_t * pObj; Abc_Ntk_t * pNtkFront, * pNtkReached, * pNtkNext, * pNtkTemp; - int clk, i, v, nVars, nNodesOld, nNodesNew, nNodesPrev; + int i, v, nVars, nNodesOld, nNodesNew, nNodesPrev; int fFixedPoint = 0; int fSynthesis = 1; int fMoreEffort = 1; + clock_t clk; assert( Abc_NtkIsStrash(pNtkRel) ); assert( Abc_NtkLatchNum(pNtkRel) == 0 ); diff --git a/src/base/abci/abcReach.c b/src/base/abci/abcReach.c index e1ffa309..216dc2d2 100644 --- a/src/base/abci/abcReach.c +++ b/src/base/abci/abcReach.c @@ -258,7 +258,8 @@ void Abc_NtkVerifyUsingBdds( Abc_Ntk_t * pNtk, int nBddMax, int nIterMax, int fP DdManager * dd; DdNode ** pbParts; DdNode * bOutput, * bReached, * bInitial; - int i, clk = clock(); + int i; + clock_t clk = clock(); assert( Abc_NtkIsStrash(pNtk) ); assert( Abc_NtkPoNum(pNtk) == 1 ); diff --git a/src/base/abci/abcRec.c b/src/base/abci/abcRec.c index 4e5b7d6e..276f29c9 100644 --- a/src/base/abci/abcRec.c +++ b/src/base/abci/abcRec.c @@ -107,23 +107,23 @@ struct Abc_ManRec_t_ int nFunsDelayComput; // the times delay computed, just for statistics int nNoBetter; // the number of functions found but no better than the current structures. // rewriting runtime - int timeIfTotal; // time used on the whole process of rewriting a structure. - int timeIfComputDelay; // time used on the structure's delay computation. - int timeIfCanonicize; // time used on canonicize the function - int timeIfDerive; // time used on derive the final network; - int timeIfCopmutCur; // time used on compute the current structures info - int timeIfOther; // time used on other things + clock_t timeIfTotal; // time used on the whole process of rewriting a structure. + clock_t timeIfComputDelay; // time used on the structure's delay computation. + clock_t timeIfCanonicize; // time used on canonicize the function + clock_t timeIfDerive; // time used on derive the final network; + clock_t timeIfCopmutCur; // time used on compute the current structures info + clock_t timeIfOther; // time used on other things // record runtime - int timeTrim; // the runtime to filter the library - int timeCollect; // the runtime to collect the node of a structure. - int timeTruth; // the runtime to compute truth table. - int timeCanon; // the runtime to canonicize - int timeInsert; // the runtime to insert a structure. - int timeBuild; // the runtime to build a new structure in the library. - int timeMerge; // the runtime to merge libraries; - int timeReHash; // the runtime to resize the hash table. - int timeOther; // the runtime of other - int timeTotal; // the runtime to total. + clock_t timeTrim; // the runtime to filter the library + clock_t timeCollect; // the runtime to collect the node of a structure. + clock_t timeTruth; // the runtime to compute truth table. + clock_t timeCanon; // the runtime to canonicize + clock_t timeInsert; // the runtime to insert a structure. + clock_t timeBuild; // the runtime to build a new structure in the library. + clock_t timeMerge; // the runtime to merge libraries; + clock_t timeReHash; // the runtime to resize the hash table. + clock_t timeOther; // the runtime of other + clock_t timeTotal; // the runtime to total. }; @@ -860,7 +860,7 @@ Hop_Obj_t * Abc_RecToHop( Hop_Man_t * pMan, If_Man_t * pIfMan, If_Cut_t * pCut, char pCanonPerm[16]; unsigned *pInOut = s_pMan->pTemp1; unsigned *pTemp = s_pMan->pTemp2; - int time = clock(); + clock_t time = clock(); int fCompl; int * pCompl = &fCompl; nLeaves = If_CutLeaveNum(pCut); @@ -1008,7 +1008,7 @@ void Abc_NtkRecFilter(int nLimit) Rec_Obj_t * previous = NULL, * entry = NULL, * pTemp; int i; Abc_Ntk_t * pNtk = s_pMan->pNtk; - int time = clock(); + clock_t time = clock(); if (nLimit > 0) { for ( i = 0; i < s_pMan->nBins; i++ ) @@ -1135,7 +1135,7 @@ void Abc_NtkRecLibMerge(Abc_Ntk_t* pNtk) int i; Abc_Obj_t * pObj; Abc_ManRec_t * p = s_pMan; - int clk = clock(); + clock_t clk = clock(); if ( Abc_NtkPiNum(pNtk) > s_pMan->nVars ) { printf( "The library has more inputs than the record.\n"); @@ -1183,7 +1183,7 @@ void Abc_NtkRecRezieHash(Abc_ManRec_t* p) Rec_Obj_t ** pBinsNew, **ppSpot; Rec_Obj_t * pEntry, * pTemp; int nBinsNew, Counter, i; - int clk = clock(); + clock_t clk = clock(); // get the new table size nBinsNew = Cudd_Prime( 3 * p->nBins ); printf("Hash table resize from %d to %d.\n", p->nBins, nBinsNew); @@ -1232,7 +1232,7 @@ void Abc_NtkRecStart( Abc_Ntk_t * pNtk, int nVars, int nCuts, int fTrim ) char Buffer[10]; unsigned * pTruth; int i, RetValue; - int clkTotal = clock(), clk, timeInsert; + clock_t clkTotal = clock(), clk, timeInsert; //int testNum = 0; assert( s_pMan == NULL ); @@ -1690,7 +1690,7 @@ void Abc_NtkRecAdd( Abc_Ntk_t * pNtk, int fUseSOPB) If_Par_t Pars, * pPars = &Pars; Abc_Ntk_t * pNtkNew; - int clk = clock(); + clock_t clk = clock(); if ( Abc_NtkGetChoiceNum( pNtk ) ) printf( "Performing renoding with choices.\n" ); @@ -2068,7 +2068,7 @@ void Abc_NtkRecAddSOPB( If_Man_t * pIfMan, If_Cut_t * pCut, unsigned* pInOut, ch If_And_t This; Rec_Obj_t ** ppSpot; char Buffer[40], Name[20], Truth[20]; - int timeBuild = clock(); + clock_t timeBuild = clock(); unsigned * pTruth; vAnds = If_CutDelaySopArray( pIfMan, pCut ); if(Vec_WrdSize(vAnds) > nLeaves + 3*(nLeaves-1) + s_MaxSize[nLeaves]) @@ -2778,7 +2778,7 @@ void SetUseCut(If_Cut_t* pCut, Rec_Obj_t * pRecObj, char * pCanonPerm) int If_CutDelayRecCost(If_Man_t* p, If_Cut_t* pCut, If_Obj_t * pObj) { //int fVerbose = 0; - int timeDelayComput, timeTotal = clock(), timeCanonicize; + clock_t timeDelayComput, timeTotal = clock(), timeCanonicize; int nLeaves, i, DelayMin = ABC_INFINITY , * pDelayBest = &DelayMin; char pCanonPerm[16]; unsigned uCanonPhase; diff --git a/src/base/abci/abcRefactor.c b/src/base/abci/abcRefactor.c index 69d84b0c..361b91ce 100644 --- a/src/base/abci/abcRefactor.c +++ b/src/base/abci/abcRefactor.c @@ -50,15 +50,15 @@ struct Abc_ManRef_t_ int nNodesBeg; int nNodesEnd; // runtime statistics - int timeCut; - int timeBdd; - int timeDcs; - int timeSop; - int timeFact; - int timeEval; - int timeRes; - int timeNtk; - int timeTotal; + clock_t timeCut; + clock_t timeBdd; + clock_t timeDcs; + clock_t timeSop; + clock_t timeFact; + clock_t timeEval; + clock_t timeRes; + clock_t timeNtk; + clock_t timeTotal; }; static void Abc_NtkManRefPrintStats( Abc_ManRef_t * p ); @@ -95,7 +95,7 @@ int Abc_NtkRefactor( Abc_Ntk_t * pNtk, int nNodeSizeMax, int nConeSizeMax, int f Dec_Graph_t * pFForm; Vec_Ptr_t * vFanins; Abc_Obj_t * pNode; - int clk, clkStart = clock(); + clock_t clk, clkStart = clock(); int i, nNodes; assert( Abc_NtkIsStrash(pNtk) ); diff --git a/src/base/abci/abcRestruct.c b/src/base/abci/abcRestruct.c index 66b1d8e8..4be177f7 100644 --- a/src/base/abci/abcRestruct.c +++ b/src/base/abci/abcRestruct.c @@ -107,7 +107,7 @@ int Abc_NtkRestructure( Abc_Ntk_t * pNtk, int nCutMax, int fUpdateLevel, int fUs Cut_Cut_t * pCutList; Dec_Graph_t * pGraph; Abc_Obj_t * pNode; - int clk, clkStart = clock(); + clock_t clk, clkStart = clock(); int fMulti = 1; int fResub = 0; int i, nNodes; diff --git a/src/base/abci/abcResub.c b/src/base/abci/abcResub.c index b03c36aa..6e2b95c3 100644 --- a/src/base/abci/abcResub.c +++ b/src/base/abci/abcResub.c @@ -62,18 +62,18 @@ struct Abc_ManRes_t_ // other data Vec_Ptr_t * vTemp; // temporary array of nodes // runtime statistics - int timeCut; - int timeTruth; - int timeRes; - int timeDiv; - int timeMffc; - int timeSim; - int timeRes1; - int timeResD; - int timeRes2; - int timeRes3; - int timeNtk; - int timeTotal; + clock_t timeCut; + clock_t timeTruth; + clock_t timeRes; + clock_t timeDiv; + clock_t timeMffc; + clock_t timeSim; + clock_t timeRes1; + clock_t timeResD; + clock_t timeRes2; + clock_t timeRes3; + clock_t timeNtk; + clock_t timeTotal; // improvement statistics int nUsedNodeC; int nUsedNode0; @@ -144,7 +144,7 @@ int Abc_NtkResubstitute( Abc_Ntk_t * pNtk, int nCutMax, int nStepsMax, int nLeve Dec_Graph_t * pFForm; Vec_Ptr_t * vLeaves; Abc_Obj_t * pNode; - int clk, clkStart = clock(); + clock_t clk, clkStart = clock(); int i, nNodes; assert( Abc_NtkIsStrash(pNtk) ); @@ -1624,7 +1624,7 @@ Dec_Graph_t * Abc_ManResubEval( Abc_ManRes_t * p, Abc_Obj_t * pRoot, Vec_Ptr_t * extern int Abc_NodeMffcInside( Abc_Obj_t * pNode, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vInside ); Dec_Graph_t * pGraph; int Required; - int clk; + clock_t clk; Required = fUpdateLevel? Abc_ObjRequiredLevel(pRoot) : ABC_INFINITY; diff --git a/src/base/abci/abcRewrite.c b/src/base/abci/abcRewrite.c index 5e2745b9..091ac647 100644 --- a/src/base/abci/abcRewrite.c +++ b/src/base/abci/abcRewrite.c @@ -68,7 +68,7 @@ int Abc_NtkRewrite( Abc_Ntk_t * pNtk, int fUpdateLevel, int fUseZeros, int fVerb // Vec_Ptr_t * vAddedCells = NULL, * vUpdatedNets = NULL; Dec_Graph_t * pGraph; int i, nNodes, nGain, fCompl; - int clk, clkStart = clock(); + clock_t clk, clkStart = clock(); assert( Abc_NtkIsStrash(pNtk) ); // cleanup the AIG diff --git a/src/base/abci/abcRr.c b/src/base/abci/abcRr.c index 61c8d085..83b7e85e 100644 --- a/src/base/abci/abcRr.c +++ b/src/base/abci/abcRr.c @@ -56,11 +56,11 @@ struct Abc_RRMan_t_ int nLevelsOld; // the old number of levels int nEdgesTried; // the number of nodes tried int nEdgesRemoved; // the number of nodes proved - int timeWindow; // the time to construct the window - int timeMiter; // the time to construct the miter - int timeProve; // the time to prove the miter - int timeUpdate; // the network update time - int timeTotal; // the total runtime + clock_t timeWindow; // the time to construct the window + clock_t timeMiter; // the time to construct the miter + clock_t timeProve; // the time to prove the miter + clock_t timeUpdate; // the network update time + clock_t timeTotal; // the total runtime }; static Abc_RRMan_t * Abc_RRManStart(); @@ -100,7 +100,8 @@ int Abc_NtkRR( Abc_Ntk_t * pNtk, int nFaninLevels, int nFanoutLevels, int fUseFa ProgressBar * pProgress; Abc_RRMan_t * p; Abc_Obj_t * pNode, * pFanin, * pFanout; - int i, k, m, nNodes, RetValue, clk, clkTotal = clock(); + int i, k, m, nNodes, RetValue; + clock_t clk, clkTotal = clock(); // start the manager p = Abc_RRManStart(); p->pNtk = pNtk; @@ -351,7 +352,8 @@ void Abc_RRManClean( Abc_RRMan_t * p ) int Abc_NtkRRProve( Abc_RRMan_t * p ) { Abc_Ntk_t * pWndCopy; - int RetValue, clk; + int RetValue; + clock_t clk; // Abc_NtkShowAig( p->pWnd, 0 ); pWndCopy = Abc_NtkDup( p->pWnd ); Abc_NtkRRUpdate( pWndCopy, p->pNode->pCopy->pCopy, p->pFanin->pCopy->pCopy, p->pFanout? p->pFanout->pCopy->pCopy : NULL ); diff --git a/src/base/abci/abcSat.c b/src/base/abci/abcSat.c index 29f13bda..a10be364 100644 --- a/src/base/abci/abcSat.c +++ b/src/base/abci/abcSat.c @@ -54,7 +54,8 @@ int Abc_NtkMiterSat( Abc_Ntk_t * pNtk, ABC_INT64_T nConfLimit, ABC_INT64_T nInsL { sat_solver * pSat; lbool status; - int RetValue, clk; + int RetValue; + clock_t clk; if ( pNumConfs ) *pNumConfs = 0; diff --git a/src/base/abci/abcSymm.c b/src/base/abci/abcSymm.c index 2a36be14..29927563 100644 --- a/src/base/abci/abcSymm.c +++ b/src/base/abci/abcSymm.c @@ -89,7 +89,7 @@ void Abc_NtkSymmetriesUsingSandS( Abc_Ntk_t * pNtk, int fVerbose ) void Abc_NtkSymmetriesUsingBdds( Abc_Ntk_t * pNtk, int fNaive, int fReorder, int fVerbose ) { DdManager * dd; - int clk, clkBdd, clkSym; + clock_t clk, clkBdd, clkSym; int fGarbCollect = 1; // compute the global functions diff --git a/src/base/abci/abcUnate.c b/src/base/abci/abcUnate.c index a56973b6..870b462b 100644 --- a/src/base/abci/abcUnate.c +++ b/src/base/abci/abcUnate.c @@ -73,8 +73,9 @@ void Abc_NtkPrintUnateBdd( Abc_Ntk_t * pNtk, int fUseNaive, int fVerbose ) // DdNode ** pbGlobal; // temporary storage for global BDDs int TotalSupps = 0; int TotalUnate = 0; - int i, clk = clock(); - int clkBdd, clkUnate; + int i; + clock_t clk = clock(); + clock_t clkBdd, clkUnate; // compute the global BDDs dd = (DdManager *)Abc_NtkBuildGlobalBdds(pNtk, 10000000, 1, 1, fVerbose); diff --git a/src/base/cmd/cmdPlugin.c b/src/base/cmd/cmdPlugin.c index f14eed55..e6b36f2a 100644 --- a/src/base/cmd/cmdPlugin.c +++ b/src/base/cmd/cmdPlugin.c @@ -417,7 +417,8 @@ int Cmd_CommandAbcPlugIn( Abc_Frame_t * pAbc, int argc, char ** argv ) Vec_Int_t * vCex; FILE * pFile; Gia_Man_t * pGia; - int i, fd, clk; + int i, fd; + clock_t clk; int fLeaveFiles; /* Abc_Ntk_t * pNtk = Abc_FrameReadNtk(pAbc); diff --git a/src/base/io/ioReadAiger.c b/src/base/io/ioReadAiger.c index 0644aed9..8ff32ac9 100644 --- a/src/base/io/ioReadAiger.c +++ b/src/base/io/ioReadAiger.c @@ -25,7 +25,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/bzlib/bzlib.h" #include "src/misc/zlib/zlib.h" diff --git a/src/base/io/ioReadBblif.c b/src/base/io/ioReadBblif.c index 873a5671..ee7c5ee7 100644 --- a/src/base/io/ioReadBblif.c +++ b/src/base/io/ioReadBblif.c @@ -164,7 +164,8 @@ Abc_Ntk_t * Bbl_ManToAig( Bbl_Man_t * p ) Bbl_Obj_t * pObj, * pFanin; Vec_Ptr_t * vCopy, * vNodes, * vFaninAigs; Dec_Graph_t ** pFForms; - int i, clk; + int i; + clock_t clk; clk = clock(); // map SOP handles into factored forms pFForms = ABC_CALLOC( Dec_Graph_t *, Bbl_ManFncSize(p) ); @@ -270,7 +271,7 @@ void Bbl_ManTest( Abc_Ntk_t * pNtk ) Abc_Ntk_t * pNtkNew; Bbl_Man_t * p, * pNew; char * pFileName = "test.bblif"; - int clk, clk1, clk2, clk3, clk4, clk5; + clock_t clk, clk1, clk2, clk3, clk4, clk5; clk = clock(); p = Bbl_ManFromAbc( pNtk ); Bbl_ManPrintStats( p ); diff --git a/src/base/io/ioWriteAiger.c b/src/base/io/ioWriteAiger.c index a22d16ba..ef2be673 100644 --- a/src/base/io/ioWriteAiger.c +++ b/src/base/io/ioWriteAiger.c @@ -25,8 +25,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> -#include <stdarg.h> #include "src/misc/bzlib/bzlib.h" #include "src/misc/zlib/zlib.h" diff --git a/src/bdd/cas/casCore.c b/src/bdd/cas/casCore.c index b73b5b3f..66d11082 100644 --- a/src/bdd/cas/casCore.c +++ b/src/bdd/cas/casCore.c @@ -21,7 +21,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <time.h> #include "src/base/main/main.h" #include "src/base/cmd/cmd.h" @@ -82,7 +81,7 @@ int Abc_CascadeExperiment( char * pFileGeneric, DdManager * dd, DdNode ** pOutpu int i; int nVars = nInputs; int nOuts = nOutputs; - long clk1; + clock_t clk1; int nVarsEnc; // the number of additional variables to encode outputs DdNode * pbVarsEnc[MAXOUTPUTS]; // the BDDs of the encoding vars @@ -955,7 +954,7 @@ void WriteDDintoBLIFfileReorder( DdManager * dd, FILE * pFile, DdNode * Func, ch /////////////////////////////////////////////////////////////// DdNode * bFmin; - int clk1; + clock_t clk1; if ( s_ddmin == NULL ) s_ddmin = Cudd_Init( dd->size, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0); diff --git a/src/bdd/cas/casDec.c b/src/bdd/cas/casDec.c index ea132540..794f6fd3 100644 --- a/src/bdd/cas/casDec.c +++ b/src/bdd/cas/casDec.c @@ -21,7 +21,6 @@ #include <stdio.h> #include <string.h> #include <stdlib.h> -#include <time.h> #include "src/misc/extra/extraBdd.h" #include "cas.h" @@ -129,7 +128,7 @@ int CreateDecomposedNetwork( DdManager * dd, DdNode * aFunc, char ** pNames, int int nLutOutputs = 0; int nLutOutputsOrig = 0; - long clk1; + clock_t clk1; s_LutSize = nLutSize; @@ -285,7 +284,7 @@ int CreateDecomposedNetwork( DdManager * dd, DdNode * aFunc, char ** pNames, int } else { - long clk2 = clock(); + clock_t clk2 = clock(); // p->bRelation = PerformTheEncoding( dd, p->pbCols, p->nCols, bVarsCube, bCVars, p->nMulti, &p->nSimple ); Cudd_Ref( p->bRelation ); p->bRelation = Extra_bddEncodingNonStrict( dd, p->pbCols, p->nCols, bVarsCube, bCVars, p->nMulti, &p->nSimple ); Cudd_Ref( p->bRelation ); s_EncodingTime += clock() - clk2; diff --git a/src/bdd/cudd/cuddAndAbs.c b/src/bdd/cudd/cuddAndAbs.c index 00ba67b4..0db3e4e4 100644 --- a/src/bdd/cudd/cuddAndAbs.c +++ b/src/bdd/cudd/cuddAndAbs.c @@ -259,7 +259,7 @@ cuddBddAndAbstractRecur( } } - if ( manager->TimeStop && manager->TimeStop < time(NULL) ) + if ( manager->TimeStop && clock() > manager->TimeStop ) return NULL; if (topf == top) { diff --git a/src/bdd/cudd/cuddBddIte.c b/src/bdd/cudd/cuddBddIte.c index 18ebee20..43dbcd60 100644 --- a/src/bdd/cudd/cuddBddIte.c +++ b/src/bdd/cudd/cuddBddIte.c @@ -926,7 +926,7 @@ cuddBddAndRecur( if (r != NULL) return(r); } - if ( manager->TimeStop && manager->TimeStop < time(NULL) ) + if ( manager->TimeStop && clock() > manager->TimeStop ) return NULL; /* Here we can skip the use of cuddI, because the operands are known diff --git a/src/bdd/cudd/cuddBridge.c b/src/bdd/cudd/cuddBridge.c index 75a5fa2a..cedf920b 100644 --- a/src/bdd/cudd/cuddBridge.c +++ b/src/bdd/cudd/cuddBridge.c @@ -976,9 +976,9 @@ cuddBddTransferRecur( if (st_lookup(table, (const char *)f, (char **)&res)) return(Cudd_NotCond(res,comple)); - if ( ddS->TimeStop && ddS->TimeStop < time(NULL) ) + if ( ddS->TimeStop && clock() > ddS->TimeStop ) return NULL; - if ( ddD->TimeStop && ddD->TimeStop < time(NULL) ) + if ( ddD->TimeStop && clock() > ddD->TimeStop ) return NULL; /* Recursive step. */ diff --git a/src/bdd/cudd/cuddCompose.c b/src/bdd/cudd/cuddCompose.c index 6264513f..d88491b0 100644 --- a/src/bdd/cudd/cuddCompose.c +++ b/src/bdd/cudd/cuddCompose.c @@ -1251,7 +1251,7 @@ cuddBddVarMapRecur( return(Cudd_NotCond(res,F != f)); } - if ( manager->TimeStop && manager->TimeStop < time(NULL) ) + if ( manager->TimeStop && clock() > manager->TimeStop ) return NULL; /* Split and recur on children of this node. */ diff --git a/src/bdd/cudd/cuddInt.h b/src/bdd/cudd/cuddInt.h index 3d4b3db9..6e32acd2 100644 --- a/src/bdd/cudd/cuddInt.h +++ b/src/bdd/cudd/cuddInt.h @@ -481,7 +481,7 @@ struct DdManager { /* specialized DD symbol table */ #endif DdNode * bFunc; DdNode * bFunc2; - int TimeStop; /* timeout for reordering */ + clock_t TimeStop; /* timeout for reordering */ }; typedef struct Move { diff --git a/src/bdd/cudd/cuddSymmetry.c b/src/bdd/cudd/cuddSymmetry.c index dfdc6c85..d2269a36 100644 --- a/src/bdd/cudd/cuddSymmetry.c +++ b/src/bdd/cudd/cuddSymmetry.c @@ -367,7 +367,7 @@ cuddSymmSifting( if (ddTotalNumberSwapping >= table->siftMaxSwap) break; // enable timeout during variable reodering - alanmi 2/13/11 - if ( table->TimeStop && table->TimeStop < time(NULL) ) + if ( table->TimeStop && clock() > table->TimeStop ) break; x = table->perm[var[i]]; #ifdef DD_STATS diff --git a/src/bdd/dsd/dsdProc.c b/src/bdd/dsd/dsdProc.c index 7171315c..291648b3 100644 --- a/src/bdd/dsd/dsdProc.c +++ b/src/bdd/dsd/dsdProc.c @@ -114,7 +114,7 @@ void Dsd_Decompose( Dsd_Manager_t * pDsdMan, DdNode ** pbFuncs, int nFuncs ) { DdManager * dd = pDsdMan->dd; int i; - long clk; + clock_t clk; Dsd_Node_t * pTemp; int SumMaxGateSize = 0; int nDecOutputs = 0; @@ -156,7 +156,7 @@ s_Loops2Useless = 0; int nCascades; int MaxBlock; int nPrimeBlocks; - long clk; + clock_t clk; clk = clock(); nLiteralsPrev = s_nLiterals; diff --git a/src/bdd/reo/reoShuffle.c b/src/bdd/reo/reoShuffle.c index 8d43cb3b..86aab4b9 100644 --- a/src/bdd/reo/reoShuffle.c +++ b/src/bdd/reo/reoShuffle.c @@ -161,7 +161,8 @@ void Extra_ShuffleTest( reo_man * pReo, DdManager * dd, DdNode * Func ) // extern int runtime1, runtime2; DdNode * Temp, * bRemap; - int nSuppSize, OffSet, Num, i, clk; + int nSuppSize, OffSet, Num, i; + clock_t clk; int pOrder[1000], pOrderInv[1000]; assert( dd->size < 1000 ); diff --git a/src/bdd/reo/reoTest.c b/src/bdd/reo/reoTest.c index f59da1a7..1e5fa1e0 100644 --- a/src/bdd/reo/reoTest.c +++ b/src/bdd/reo/reoTest.c @@ -222,7 +222,7 @@ int Extra_addReorderTest( DdManager * dd, DdNode * aF ) DdNode * aFmin; int nNodesBeg; int nNodesEnd; - int clk1; + clock_t clk1; if ( s_ddmin == NULL ) s_ddmin = Cudd_Init( dd->size, 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0); diff --git a/src/bool/bdc/bdcCore.c b/src/bool/bdc/bdcCore.c index 58324f81..fb318e0d 100644 --- a/src/bool/bdc/bdcCore.c +++ b/src/bool/bdc/bdcCore.c @@ -231,7 +231,7 @@ void Bdc_ManDecPrint( Bdc_Man_t * p ) int Bdc_ManDecompose( Bdc_Man_t * p, unsigned * puFunc, unsigned * puCare, int nVars, Vec_Ptr_t * vDivs, int nNodesMax ) { Bdc_Isf_t Isf, * pIsf = &Isf; - int clk = clock(); + clock_t clk = clock(); assert( nVars <= p->pPars->nVarsMax ); // set current manager parameters p->nVars = nVars; diff --git a/src/bool/bdc/bdcDec.c b/src/bool/bdc/bdcDec.c index 61f46f17..0695f7e9 100644 --- a/src/bool/bdc/bdcDec.c +++ b/src/bool/bdc/bdcDec.c @@ -45,7 +45,7 @@ ABC_NAMESPACE_IMPL_START void Bdc_SuppMinimize2( Bdc_Man_t * p, Bdc_Isf_t * pIsf ) { int v; - int clk = 0; // Suppress "might be used uninitialized" + clock_t clk = 0; // Suppress "might be used uninitialized" if ( p->pPars->fVerbose ) clk = clock(); // compute support @@ -87,7 +87,7 @@ void Bdc_SuppMinimize2( Bdc_Man_t * p, Bdc_Isf_t * pIsf ) void Bdc_SuppMinimize( Bdc_Man_t * p, Bdc_Isf_t * pIsf ) { int v; - int clk = 0; // Suppress "might be used uninitialized" + clock_t clk = 0; // Suppress "might be used uninitialized" if ( p->pPars->fVerbose ) clk = clock(); // go through the support variables @@ -549,7 +549,7 @@ int Bdc_DecomposeStepMux( Bdc_Man_t * p, Bdc_Isf_t * pIsf, Bdc_Isf_t * pIsfL, Bd { int Var, VarMin, nSuppMin, nSuppCur; unsigned uSupp0, uSupp1; - int clk = 0; // Suppress "might be used uninitialized" + clock_t clk = 0; // Suppress "might be used uninitialized" if ( p->pPars->fVerbose ) clk = clock(); VarMin = -1; @@ -681,7 +681,7 @@ Bdc_Fun_t * Bdc_ManDecompose_rec( Bdc_Man_t * p, Bdc_Isf_t * pIsf ) Bdc_Isf_t IsfL, * pIsfL = &IsfL; Bdc_Isf_t IsfB, * pIsfR = &IsfB; int iVar; - int clk = 0; // Suppress "might be used uninitialized" + clock_t clk = 0; // Suppress "might be used uninitialized" /* printf( "Init function (%d):\n", LocalCounter ); Extra_PrintBinary( stdout, pIsf->puOn, 1<<4 );printf("\n"); diff --git a/src/bool/bdc/bdcInt.h b/src/bool/bdc/bdcInt.h index 05ce20b6..cca10957 100644 --- a/src/bool/bdc/bdcInt.h +++ b/src/bool/bdc/bdcInt.h @@ -118,11 +118,11 @@ struct Bdc_Man_t_ int numWeaks; int numReuse; // runtime - int timeCache; - int timeCheck; - int timeMuxes; - int timeSupps; - int timeTotal; + clock_t timeCache; + clock_t timeCheck; + clock_t timeMuxes; + clock_t timeSupps; + clock_t timeTotal; }; static inline Bdc_Fun_t * Bdc_FunNew( Bdc_Man_t * p ) { Bdc_Fun_t * pRes; if ( p->nNodes >= p->nNodesAlloc || p->nNodesNew >= p->nNodesMax ) return NULL; pRes = p->pNodes + p->nNodes++; p->nNodesNew++; memset( pRes, 0, sizeof(Bdc_Fun_t) ); return pRes; } diff --git a/src/bool/bdc/bdcSpfd.c b/src/bool/bdc/bdcSpfd.c index 54217282..1695cf2c 100644 --- a/src/bool/bdc/bdcSpfd.c +++ b/src/bool/bdc/bdcSpfd.c @@ -181,7 +181,8 @@ void Bdc_SpfdDecompose( word Truth, int nVars, int nCands, int nGatesMax ) Vec_Int_t * vBegs, * vWeight; Bdc_Nod_t * pNode, * pNode0, * pNode1, * pNode2; int Count0, Count1, * pPerm; - int i, j, k, c, n, clk; + int i, j, k, c, n; + clock_t clk; assert( nGatesMax < (1<<8) ); assert( nCands < (1<<12) ); assert( (1<<(nVars-1))*(1<<(nVars-1)) < (1<<12) ); // max SPFD @@ -586,7 +587,8 @@ Vec_Wrd_t * Bdc_SpfdDecomposeTest__( Vec_Int_t ** pvWeights ) int nSize = 201326611; // the hash table size to use int Limit = 6; - int * pPlace, i, n, m, k, s, fCompl, clk = clock(), clk2; + int * pPlace, i, n, m, k, s, fCompl; + clock_t clk = clock(), clk2; Vec_Int_t * vStops; Vec_Wrd_t * vTruths; Vec_Int_t * vWeights; @@ -919,7 +921,7 @@ void Bdc_SpfdDecomposeTest44() Vec_Wrd_t * vDivs; word c0, c1, s, tt, tbest; int i, j, Cost, CostBest = 100000; - int clk = clock(); + clock_t clk = clock(); return; @@ -1028,7 +1030,8 @@ void Bdc_SpfdDecomposeTest3() int nSizeK = (1 << 3); Vec_Wrd_t * v1M; Vec_Wrd_t * v1K; - int i, k, Counter, clk; + int i, k, Counter; + clock_t clk; // int EntryM, EntryK; Aig_ManRandom64( 1 ); @@ -1083,7 +1086,8 @@ void Bdc_SpfdDecomposeTest8() Vec_Wrd_t * vDivs; word Func, FuncBest; int Cost, CostBest = ABC_INFINITY; - int i, clk = clock(); + int i; + clock_t clk = clock(); // return; @@ -1133,7 +1137,8 @@ void Bdc_SpfdDecomposeTest() int nSizeK = (1 << 3); // small array size Vec_Wrd_t * v1M, * v1K; int EntryM, EntryK; - int i, k, Counter, clk; + int i, k, Counter; + clock_t clk; Aig_ManRandom64( 1 ); diff --git a/src/bool/kit/cloud.c b/src/bool/kit/cloud.c index 1ab53c00..ca2d81eb 100644 --- a/src/bool/kit/cloud.c +++ b/src/bool/kit/cloud.c @@ -71,7 +71,7 @@ CloudManager * Cloud_Init( int nVars, int nBits ) { CloudManager * dd; int i; - int clk1, clk2; + clock_t clk1, clk2; assert( nVars <= 100000 ); assert( nBits < 32 ); diff --git a/src/bool/kit/cloud.h b/src/bool/kit/cloud.h index 208a47ec..e2d451ae 100644 --- a/src/bool/kit/cloud.h +++ b/src/bool/kit/cloud.h @@ -23,7 +23,6 @@ #include <stdio.h> #include <stdlib.h> #include <assert.h> -#include <time.h> #include "src/misc/util/abc_global.h" diff --git a/src/bool/kit/kit.h b/src/bool/kit/kit.h index 4ca75622..990fa54a 100644 --- a/src/bool/kit/kit.h +++ b/src/bool/kit/kit.h @@ -30,7 +30,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/vec/vec.h" #include "src/misc/extra/extraBdd.h" diff --git a/src/bool/kit/kitPerm.c b/src/bool/kit/kitPerm.c index d3e9ff5a..9d6f9373 100644 --- a/src/bool/kit/kitPerm.c +++ b/src/bool/kit/kitPerm.c @@ -22,7 +22,8 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> + +#include "kit.h" #define inline __inline // compatible with MS VS 6.0 @@ -260,7 +261,7 @@ word Tf ( word f, int n) } -#define ABC_PRT(a,t) (printf("%s = ", (a)), printf("%7.2f sec\n", (float)(t)/(float)(CLOCKS_PER_SEC))) +//#define ABC_PRT(a,t) (printf("%s = ", (a)), printf("%7.2f sec\n", (float)(t)/(float)(CLOCKS_PER_SEC))) #define NFUNCS (1<<20) /**Function************************************************************* @@ -278,7 +279,8 @@ void Kit_PermComputeTest() { word * T = (word *)malloc( 8 * NFUNCS ); word i, o, w = 0; - int k, b, clk; + int k, b; + clock_t clk; srand( 0 ); diff --git a/src/map/amap/amapCore.c b/src/map/amap/amapCore.c index ce1f61bd..507dcc5e 100644 --- a/src/map/amap/amapCore.c +++ b/src/map/amap/amapCore.c @@ -72,7 +72,7 @@ Vec_Ptr_t * Amap_ManTest( Aig_Man_t * pAig, Amap_Par_t * pPars ) Vec_Ptr_t * vRes; Amap_Man_t * p; Amap_Lib_t * pLib; - int clkTotal = clock(); + clock_t clkTotal = clock(); pLib = (Amap_Lib_t *)Abc_FrameReadLibGen2(); if ( pLib == NULL ) { diff --git a/src/map/amap/amapLib.c b/src/map/amap/amapLib.c index b11e3222..cf087218 100644 --- a/src/map/amap/amapLib.c +++ b/src/map/amap/amapLib.c @@ -328,7 +328,7 @@ void Amap_LibPrintSelectedGates( Amap_Lib_t * p, int fAllGates ) Amap_Lib_t * Amap_LibReadAndPrepare( char * pFileName, int fVerbose, int fVeryVerbose ) { Amap_Lib_t * p; - int clk = clock(); + clock_t clk = clock(); p = Amap_LibReadFile( pFileName, fVerbose ); if ( fVerbose ) printf( "Read %d gates from file \"%s\".\n", Vec_PtrSize(p->vGates), pFileName ); diff --git a/src/map/amap/amapLiberty.c b/src/map/amap/amapLiberty.c index 49b36848..c1798f09 100644 --- a/src/map/amap/amapLiberty.c +++ b/src/map/amap/amapLiberty.c @@ -888,7 +888,7 @@ int Amap_LibertyParse( char * pFileName, char * pFileGenlib, int fVerbose ) { Amap_Tree_t * p; char * pPos; - int clk = clock(); + clock_t clk = clock(); int RetValue; p = Amap_LibertyStart( pFileName ); if ( p == NULL ) diff --git a/src/map/amap/amapMatch.c b/src/map/amap/amapMatch.c index 4c213f9c..8903bf4e 100644 --- a/src/map/amap/amapMatch.c +++ b/src/map/amap/amapMatch.c @@ -484,7 +484,8 @@ void Amap_ManMatch( Amap_Man_t * p, int fFlow, int fRefs ) Aig_MmFlex_t * pMemOld; Amap_Obj_t * pObj; float Area; - int i, nInvs, clk = clock(); + int i, nInvs; + clock_t clk = clock(); pMemOld = p->pMemCutBest; p->pMemCutBest = Aig_MmFlexStart(); Amap_ManForEachNode( p, pObj, i ) diff --git a/src/map/amap/amapMerge.c b/src/map/amap/amapMerge.c index 19470d63..85a1713c 100644 --- a/src/map/amap/amapMerge.c +++ b/src/map/amap/amapMerge.c @@ -514,7 +514,8 @@ void Amap_ManMergeNodeCuts( Amap_Man_t * p, Amap_Obj_t * pNode ) void Amap_ManMerge( Amap_Man_t * p ) { Amap_Obj_t * pObj; - int i, clk = clock(); + int i; + clock_t clk = clock(); p->pCutsPi = Amap_ManSetupPis( p ); Amap_ManForEachNode( p, pObj, i ) Amap_ManMergeNodeCuts( p, pObj ); diff --git a/src/map/amap/amapParse.c b/src/map/amap/amapParse.c index 6fa469a9..2242fa7a 100644 --- a/src/map/amap/amapParse.c +++ b/src/map/amap/amapParse.c @@ -461,7 +461,7 @@ void Amap_LibParseTest( char * pFileName ) { int fVerbose = 1; Amap_Lib_t * p; - int clk = clock(); + clock_t clk = clock(); p = Amap_LibReadFile( pFileName, fVerbose ); if ( p == NULL ) return; diff --git a/src/map/cov/covCore.c b/src/map/cov/covCore.c index f40e908a..1a1d025f 100644 --- a/src/map/cov/covCore.c +++ b/src/map/cov/covCore.c @@ -108,7 +108,8 @@ Abc_Ntk_t * Abc_NtkSopEsopCover( Abc_Ntk_t * pNtk, int nFaninMax, int fUseEsop, void Abc_NtkCovCovers( Cov_Man_t * p, Abc_Ntk_t * pNtk, int fVerbose ) { Abc_Obj_t * pObj; - int i, clk = clock(); + int i; + clock_t clk = clock(); // start the manager p->vFanCounts = Abc_NtkFanoutCounts(pNtk); @@ -154,7 +155,8 @@ int Abc_NtkCovCoversOne( Cov_Man_t * p, Abc_Ntk_t * pNtk, int fVerbose ) ProgressBar * pProgress; Abc_Obj_t * pObj; Vec_Ptr_t * vBoundary; - int i, clk = clock(); + int i; + clock_t clk = clock(); int Counter = 0; int fStop = 1; diff --git a/src/map/fpga/fpga.h b/src/map/fpga/fpga.h index b63d2448..22982b4e 100644 --- a/src/map/fpga/fpga.h +++ b/src/map/fpga/fpga.h @@ -83,15 +83,11 @@ extern int Fpga_ManReadVerbose( Fpga_Man_t * p ); extern int Fpga_ManReadVarMax( Fpga_Man_t * p ); extern float * Fpga_ManReadLutAreas( Fpga_Man_t * p ); extern Fpga_NodeVec_t* Fpga_ManReadMapping( Fpga_Man_t * p ); -extern void Fpga_ManSetTimeToMap( Fpga_Man_t * p, int Time ); -extern void Fpga_ManSetTimeToNet( Fpga_Man_t * p, int Time ); -extern void Fpga_ManSetTimeTotal( Fpga_Man_t * p, int Time ); extern void Fpga_ManSetOutputNames( Fpga_Man_t * p, char ** ppNames ); extern void Fpga_ManSetInputArrivals( Fpga_Man_t * p, float * pArrivals ); extern void Fpga_ManSetAreaRecovery( Fpga_Man_t * p, int fAreaRecovery ); extern void Fpga_ManSetDelayLimit( Fpga_Man_t * p, float DelayLimit ); extern void Fpga_ManSetAreaLimit( Fpga_Man_t * p, float AreaLimit ); -extern void Fpga_ManSetTimeLimit( Fpga_Man_t * p, float TimeLimit ); extern void Fpga_ManSetObeyFanoutLimits( Fpga_Man_t * p, int fObeyFanoutLimits ); extern void Fpga_ManSetNumIterations( Fpga_Man_t * p, int nNumIterations ); extern int Fpga_ManReadFanoutViolations( Fpga_Man_t * p ); diff --git a/src/map/fpga/fpgaCore.c b/src/map/fpga/fpgaCore.c index 74739852..64b26689 100644 --- a/src/map/fpga/fpgaCore.c +++ b/src/map/fpga/fpgaCore.c @@ -27,8 +27,8 @@ ABC_NAMESPACE_IMPL_START static int Fpga_MappingPostProcess( Fpga_Man_t * p ); -extern int s_MappingTime; -extern int s_MappingMem; +extern clock_t s_MappingTime; +extern clock_t s_MappingMem; //////////////////////////////////////////////////////////////////////// @@ -52,7 +52,7 @@ extern int s_MappingMem; ***********************************************************************/ int Fpga_Mapping( Fpga_Man_t * p ) { - int clk, clkTotal = clock(); + clock_t clk, clkTotal = clock(); // collect the nodes reachable from POs in the DFS order (including the choices) p->vAnds = Fpga_MappingDfs( p, 1 ); @@ -112,7 +112,8 @@ int Fpga_MappingPostProcess( Fpga_Man_t * p ) int fRecoverAreaFlow = 1; int fRecoverArea = 1; float aAreaTotalCur, aAreaTotalCur2; - int Iter, clk; + int Iter; + clock_t clk; //if ( p->fVerbose ) // printf( "Best clock period = %5.2f\n", Fpga_TimeComputeArrivalMax(p) ); diff --git a/src/map/fpga/fpgaCreate.c b/src/map/fpga/fpgaCreate.c index 64f6d750..e3079ad7 100644 --- a/src/map/fpga/fpgaCreate.c +++ b/src/map/fpga/fpgaCreate.c @@ -58,15 +58,11 @@ int Fpga_ManReadVerbose( Fpga_Man_t * p ) { retu int Fpga_ManReadVarMax( Fpga_Man_t * p ) { return p->pLutLib->LutMax; } float * Fpga_ManReadLutAreas( Fpga_Man_t * p ) { return p->pLutLib->pLutAreas; } Fpga_NodeVec_t* Fpga_ManReadMapping( Fpga_Man_t * p ) { return p->vMapping; } -void Fpga_ManSetTimeToMap( Fpga_Man_t * p, int Time ) { p->timeToMap = Time; } -void Fpga_ManSetTimeToNet( Fpga_Man_t * p, int Time ) { p->timeToNet = Time; } -void Fpga_ManSetTimeTotal( Fpga_Man_t * p, int Time ) { p->timeTotal = Time; } void Fpga_ManSetOutputNames( Fpga_Man_t * p, char ** ppNames ) { p->ppOutputNames = ppNames; } void Fpga_ManSetInputArrivals( Fpga_Man_t * p, float * pArrivals ) { p->pInputArrivals = pArrivals; } void Fpga_ManSetAreaRecovery( Fpga_Man_t * p, int fAreaRecovery ) { p->fAreaRecovery = fAreaRecovery;} void Fpga_ManSetDelayLimit( Fpga_Man_t * p, float DelayLimit ) { p->DelayLimit = DelayLimit; } void Fpga_ManSetAreaLimit( Fpga_Man_t * p, float AreaLimit ) { p->AreaLimit = AreaLimit; } -void Fpga_ManSetTimeLimit( Fpga_Man_t * p, float TimeLimit ) { p->TimeLimit = TimeLimit; } void Fpga_ManSetChoiceNodeNum( Fpga_Man_t * p, int nChoiceNodes ) { p->nChoiceNodes = nChoiceNodes; } void Fpga_ManSetChoiceNum( Fpga_Man_t * p, int nChoices ) { p->nChoices = nChoices; } void Fpga_ManSetVerbose( Fpga_Man_t * p, int fVerbose ) { p->fVerbose = fVerbose; } @@ -425,7 +421,8 @@ void Fpga_TableResize( Fpga_Man_t * pMan ) { Fpga_Node_t ** pBinsNew; Fpga_Node_t * pEnt, * pEnt2; - int nBinsNew, Counter, i, clk; + int nBinsNew, Counter, i; + clock_t clk; unsigned Key; clk = clock(); diff --git a/src/map/fpga/fpgaCut.c b/src/map/fpga/fpgaCut.c index 2e9ea77e..75007888 100644 --- a/src/map/fpga/fpgaCut.c +++ b/src/map/fpga/fpgaCut.c @@ -133,7 +133,7 @@ void Fpga_MappingCuts( Fpga_Man_t * p ) Fpga_CutTable_t * pTable; Fpga_Node_t * pNode; int nCuts, nNodes, i; - int clk = clock(); + clock_t clk = clock(); // set the elementary cuts for the PI variables assert( p->nVarsMax > 1 && p->nVarsMax < 11 ); diff --git a/src/map/fpga/fpgaInt.h b/src/map/fpga/fpgaInt.h index c9272154..f2c482af 100644 --- a/src/map/fpga/fpgaInt.h +++ b/src/map/fpga/fpgaInt.h @@ -155,15 +155,15 @@ struct Fpga_ManStruct_t_ float TimeLimit; // for resynthesis // runtime statistics - int timeToMap; // time to transfer to the mapping structure - int timeCuts; // time to compute k-feasible cuts - int timeTruth; // time to compute the truth table for each cut - int timeMatch; // time to perform matching for each node - int timeRecover; // time to perform area recovery - int timeToNet; // time to transfer back to the network - int timeTotal; // the total mapping time - int time1; // time to transfer to the mapping structure - int time2; // time to transfer to the mapping structure + clock_t timeToMap; // time to transfer to the mapping structure + clock_t timeCuts; // time to compute k-feasible cuts + clock_t timeTruth; // time to compute the truth table for each cut + clock_t timeMatch; // time to perform matching for each node + clock_t timeRecover; // time to perform area recovery + clock_t timeToNet; // time to transfer back to the network + clock_t timeTotal; // the total mapping time + clock_t time1; // time to transfer to the mapping structure + clock_t time2; // time to transfer to the mapping structure }; // the LUT library diff --git a/src/map/fpga/fpgaMatch.c b/src/map/fpga/fpgaMatch.c index 08db4bb1..dd04e562 100644 --- a/src/map/fpga/fpgaMatch.c +++ b/src/map/fpga/fpgaMatch.c @@ -119,7 +119,7 @@ int Fpga_MappingMatches( Fpga_Man_t * p, int fDelayOriented ) int Fpga_MatchNode( Fpga_Man_t * p, Fpga_Node_t * pNode, int fDelayOriented ) { Fpga_Cut_t * pCut, * pCutBestOld; - int clk; + clock_t clk; // make sure that at least one cut other than the trivial is present if ( pNode->pCuts->pNext == NULL ) { @@ -269,7 +269,7 @@ int Fpga_MatchNodeArea( Fpga_Man_t * p, Fpga_Node_t * pNode ) { Fpga_Cut_t * pCut, * pCutBestOld; float aAreaCutBest; - int clk; + clock_t clk; // make sure that at least one cut other than the trivial is present if ( pNode->pCuts->pNext == NULL ) { @@ -390,7 +390,7 @@ int Fpga_MatchNodeSwitch( Fpga_Man_t * p, Fpga_Node_t * pNode ) { Fpga_Cut_t * pCut, * pCutBestOld; float aAreaCutBest = FPGA_FLOAT_LARGE; - int clk; + clock_t clk; // make sure that at least one cut other than the trivial is present if ( pNode->pCuts->pNext == NULL ) { diff --git a/src/map/if/if.h b/src/map/if/if.h index 69878111..0654c05b 100644 --- a/src/map/if/if.h +++ b/src/map/if/if.h @@ -30,7 +30,7 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> + #include "src/misc/vec/vec.h" #include "src/misc/mem/mem.h" #include "src/misc/tim/tim.h" @@ -223,7 +223,7 @@ struct If_Man_t_ void ** pHashTable[2]; // hash table bins Mem_Fixed_t * pMemEntries; // memory manager for hash table entries // statistics -// int timeTruth; +// clock_t timeTruth; }; // priority cut diff --git a/src/map/if/ifCore.c b/src/map/if/ifCore.c index 9cdddccd..0ddfafd6 100644 --- a/src/map/if/ifCore.c +++ b/src/map/if/ifCore.c @@ -80,7 +80,7 @@ int If_ManPerformMapping( If_Man_t * p ) int If_ManPerformMappingComb( If_Man_t * p ) { If_Obj_t * pObj; - int clkTotal = clock(); + clock_t clkTotal = clock(); int i; // set arrival times and fanout estimates diff --git a/src/map/if/ifCut.c b/src/map/if/ifCut.c index 36aa935d..c1d770fd 100644 --- a/src/map/if/ifCut.c +++ b/src/map/if/ifCut.c @@ -1354,7 +1354,7 @@ int If_CutGetCones( If_Man_t * p ) { If_Obj_t * pObj; int i, Counter = 0; - int clk = clock(); + clock_t clk = clock(); If_ManForEachObj( p, pObj, i ) { if ( If_ObjIsAnd(pObj) && pObj->nRefs ) diff --git a/src/map/if/ifMap.c b/src/map/if/ifMap.c index 570fb4ae..ea1d5f33 100644 --- a/src/map/if/ifMap.c +++ b/src/map/if/ifMap.c @@ -389,7 +389,8 @@ int If_ManPerformMappingRound( If_Man_t * p, int nCutsUsed, int Mode, int fPrepr { // ProgressBar * pProgress; If_Obj_t * pObj; - int i, clk = clock(); + int i; + clock_t clk = clock(); float arrTime; assert( Mode >= 0 && Mode <= 2 ); // set the sorting function diff --git a/src/map/if/ifReduce.c b/src/map/if/ifReduce.c index b45a9b25..65e321c0 100644 --- a/src/map/if/ifReduce.c +++ b/src/map/if/ifReduce.c @@ -51,7 +51,7 @@ static void If_ManImproveNodeFaninCompact( If_Man_t * p, If_Obj_t * pObj, int nL ***********************************************************************/ void If_ManImproveMapping( If_Man_t * p ) { - int clk; + clock_t clk; clk = clock(); If_ManImproveExpand( p, p->pPars->nLutSize ); diff --git a/src/map/if/ifSeq.c b/src/map/if/ifSeq.c index 6cfb5131..d34cf538 100644 --- a/src/map/if/ifSeq.c +++ b/src/map/if/ifSeq.c @@ -123,7 +123,8 @@ Vec_Ptr_t * If_ManCollectLatches( If_Man_t * p ) int If_ManPerformMappingRoundSeq( If_Man_t * p, int nIter ) { If_Obj_t * pObj; - int i, clk = clock(); + int i; + clock_t clk = clock(); int fVeryVerbose = 0; int fChange = 0; @@ -337,7 +338,7 @@ void If_ManPerformMappingSeqPost( If_Man_t * p ) ***********************************************************************/ int If_ManPerformMappingSeq( If_Man_t * p ) { - int clkTotal = clock(); + clock_t clkTotal = clock(); int PeriodBest; p->SortMode = 0; diff --git a/src/map/if/ifTime.c b/src/map/if/ifTime.c index 5f7f8142..0b86093b 100644 --- a/src/map/if/ifTime.c +++ b/src/map/if/ifTime.c @@ -252,7 +252,7 @@ Vec_Wrd_t * If_CutDelaySopAnds( If_Man_t * p, If_Cut_t * pCut, Vec_Int_t * vCove ***********************************************************************/ Vec_Wrd_t * If_CutDelaySopArray( If_Man_t * p, If_Cut_t * pCut ) { - int clk; + clock_t clk; Vec_Wrd_t * vAnds; int RetValue; if ( p->vCover == NULL ) @@ -493,7 +493,7 @@ int If_CutDelaySopAnds2( If_Man_t * p, If_Cut_t * pCut, Vec_Int_t * vCover, int } int If_CutDelaySopArray2( If_Man_t * p, If_Cut_t * pCut, int * pArea ) { - int clk; + clock_t clk; int RetValue; if ( p->vCover == NULL ) p->vCover = Vec_IntAlloc(0); diff --git a/src/map/mapper/mapper.h b/src/map/mapper/mapper.h index 29bc98ef..0c8a8f42 100644 --- a/src/map/mapper/mapper.h +++ b/src/map/mapper/mapper.h @@ -78,7 +78,7 @@ extern Map_Man_t * Map_ManCreate( int nInputs, int nOutputs, int fVerbose ); extern Map_Node_t * Map_NodeCreate( Map_Man_t * p, Map_Node_t * p1, Map_Node_t * p2 ); extern void Map_ManFree( Map_Man_t * pMan ); extern void Map_ManPrintTimeStats( Map_Man_t * p ); -extern void Map_ManPrintStatsToFile( char * pName, float Area, float Delay, int Time ); +extern void Map_ManPrintStatsToFile( char * pName, float Area, float Delay, clock_t Time ); extern int Map_ManReadInputNum( Map_Man_t * p ); extern int Map_ManReadOutputNum( Map_Man_t * p ); extern Map_Node_t ** Map_ManReadInputs ( Map_Man_t * p ); @@ -89,10 +89,6 @@ extern Mio_Library_t * Map_ManReadGenLib ( Map_Man_t * p ); extern int Map_ManReadVerbose( Map_Man_t * p ); extern float Map_ManReadAreaFinal( Map_Man_t * p ); extern float Map_ManReadRequiredGlo( Map_Man_t * p ); -extern void Map_ManSetTimeToMap( Map_Man_t * p, int Time ); -extern void Map_ManSetTimeToNet( Map_Man_t * p, int Time ); -extern void Map_ManSetTimeSweep( Map_Man_t * p, int Time ); -extern void Map_ManSetTimeTotal( Map_Man_t * p, int Time ); extern void Map_ManSetOutputNames( Map_Man_t * p, char ** ppNames ); extern void Map_ManSetAreaRecovery( Map_Man_t * p, int fAreaRecovery ); extern void Map_ManSetDelayTarget( Map_Man_t * p, float DelayTarget ); diff --git a/src/map/mapper/mapperCore.c b/src/map/mapper/mapperCore.c index 7a4f7c4e..9df22923 100644 --- a/src/map/mapper/mapperCore.c +++ b/src/map/mapper/mapperCore.c @@ -53,7 +53,7 @@ int Map_Mapping( Map_Man_t * p ) int fUseAreaFlow = 1; int fUseExactArea = !p->fSwitching; int fUseExactAreaWithPhase = !p->fSwitching; - int clk; + clock_t clk; ////////////////////////////////////////////////////////////////////// // perform pre-mapping computations diff --git a/src/map/mapper/mapperCreate.c b/src/map/mapper/mapperCreate.c index 2b1663a4..42094477 100644 --- a/src/map/mapper/mapperCreate.c +++ b/src/map/mapper/mapperCreate.c @@ -58,10 +58,6 @@ Mio_Library_t * Map_ManReadGenLib ( Map_Man_t * p ) { return int Map_ManReadVerbose( Map_Man_t * p ) { return p->fVerbose; } float Map_ManReadAreaFinal( Map_Man_t * p ) { return p->AreaFinal; } float Map_ManReadRequiredGlo( Map_Man_t * p ) { return p->fRequiredGlo; } -void Map_ManSetTimeToMap( Map_Man_t * p, int Time ) { p->timeToMap = Time; } -void Map_ManSetTimeToNet( Map_Man_t * p, int Time ) { p->timeToNet = Time; } -void Map_ManSetTimeSweep( Map_Man_t * p, int Time ) { p->timeSweep = Time; } -void Map_ManSetTimeTotal( Map_Man_t * p, int Time ) { p->timeTotal = Time; } void Map_ManSetOutputNames( Map_Man_t * p, char ** ppNames ) { p->ppOutputNames = ppNames;} void Map_ManSetAreaRecovery( Map_Man_t * p, int fAreaRecovery ) { p->fAreaRecovery = fAreaRecovery;} void Map_ManSetDelayTarget( Map_Man_t * p, float DelayTarget ) { p->DelayTarget = DelayTarget;} @@ -317,7 +313,7 @@ void Map_ManPrintTimeStats( Map_Man_t * p ) SeeAlso [] ***********************************************************************/ -void Map_ManPrintStatsToFile( char * pName, float Area, float Delay, int Time ) +void Map_ManPrintStatsToFile( char * pName, float Area, float Delay, clock_t Time ) { FILE * pTable; pTable = fopen( "map_stats.txt", "a+" ); @@ -472,7 +468,8 @@ void Map_TableResize( Map_Man_t * pMan ) { Map_Node_t ** pBinsNew; Map_Node_t * pEnt, * pEnt2; - int nBinsNew, Counter, i, clk; + int nBinsNew, Counter, i; + clock_t clk; unsigned Key; clk = clock(); diff --git a/src/map/mapper/mapperCut.c b/src/map/mapper/mapperCut.c index 29861531..12ee5d92 100644 --- a/src/map/mapper/mapperCut.c +++ b/src/map/mapper/mapperCut.c @@ -117,7 +117,7 @@ void Map_MappingCuts( Map_Man_t * p ) Map_Node_t * pNode; Map_Cut_t * pCut; int nCuts, nNodes, i; - int clk = clock(); + clock_t clk = clock(); // set the elementary cuts for the PI variables assert( p->nVarsMax > 1 && p->nVarsMax < 7 ); for ( i = 0; i < p->nInputs; i++ ) diff --git a/src/map/mapper/mapperInt.h b/src/map/mapper/mapperInt.h index 8d1e3fb7..95c5b0c7 100644 --- a/src/map/mapper/mapperInt.h +++ b/src/map/mapper/mapperInt.h @@ -149,17 +149,17 @@ struct Map_ManStruct_t_ int nFanoutViolations; // the number of nodes in mapped circuit violating fanout // runtime statistics - int timeToMap; // time to transfer to the mapping structure - int timeCuts; // time to compute k-feasible cuts - int timeTruth; // time to compute the truth table for each cut - int timeMatch; // time to perform matching for each node - int timeArea; // time to recover area after delay oriented mapping - int timeSweep; // time to perform technology dependent sweep - int timeToNet; // time to transfer back to the network - int timeTotal; // the total mapping time - int time1; // time to transfer to the mapping structure - int time2; // time to transfer to the mapping structure - int time3; // time to transfer to the mapping structure + clock_t timeToMap; // time to transfer to the mapping structure + clock_t timeCuts; // time to compute k-feasible cuts + clock_t timeTruth; // time to compute the truth table for each cut + clock_t timeMatch; // time to perform matching for each node + clock_t timeArea; // time to recover area after delay oriented mapping + clock_t timeSweep; // time to perform technology dependent sweep + clock_t timeToNet; // time to transfer back to the network + clock_t timeTotal; // the total mapping time + clock_t time1; // time to transfer to the mapping structure + clock_t time2; // time to transfer to the mapping structure + clock_t time3; // time to transfer to the mapping structure }; // the supergate library diff --git a/src/map/mapper/mapperLib.c b/src/map/mapper/mapperLib.c index c8b677bf..8b30f294 100644 --- a/src/map/mapper/mapperLib.c +++ b/src/map/mapper/mapperLib.c @@ -56,7 +56,7 @@ ABC_NAMESPACE_IMPL_START Map_SuperLib_t * Map_SuperLibCreate( char * pFileName, char * pExcludeFile, int fAlgorithm, int fVerbose ) { Map_SuperLib_t * p; - int clk; + clock_t clk; // start the supergate library p = ABC_ALLOC( Map_SuperLib_t, 1 ); diff --git a/src/map/super/superAnd.c b/src/map/super/superAnd.c index 17ba9771..b6a30025 100644 --- a/src/map/super/superAnd.c +++ b/src/map/super/superAnd.c @@ -115,7 +115,7 @@ void Super2_Precompute( int nInputs, int nLevels, int fVerbose ) Super2_Man_t * pMan; Super2_Lib_t * pLibCur, * pLibNext; int Level; - int clk; + clock_t clk; assert( nInputs < 6 ); @@ -463,7 +463,7 @@ void Super2_LibWrite( Super2_Lib_t * pLib ) Super2_Gate_t * pGate; FILE * pFile; char FileName[100]; - int clk; + clock_t clk; if ( pLib->nLevels > 5 ) { diff --git a/src/map/super/superGate.c b/src/map/super/superGate.c index 840028c4..380065d3 100644 --- a/src/map/super/superGate.c +++ b/src/map/super/superGate.c @@ -70,7 +70,7 @@ struct Super_ManStruct_t_ int nAliases; // the number of hash table lookups thrown away due to aliasing // runtime - int Time; // the runtime of the generation procedure + clock_t Time; // the runtime of the generation procedure int TimeLimit; // the runtime limit (in seconds) int TimeSec; // the time passed (in seconds) double TimeStop; // the time to stop computation (in miliseconds) @@ -144,7 +144,8 @@ void Super_Precompute( Mio_Library_t * pLibGen, int nVarsMax, int nLevels, int n { Super_Man_t * pMan; Mio_Gate_t ** ppGates; - int nGates, Level, clk, clockStart; + int nGates, Level; + clock_t clk, clockStart; assert( nVarsMax < 7 ); if ( nGatesMax < nVarsMax ) @@ -705,7 +706,7 @@ done: ***********************************************************************/ int Super_CheckTimeout( ProgressBar * pPro, Super_Man_t * pMan ) { - int TimeNow = clock(); + clock_t TimeNow = clock(); if ( TimeNow > pMan->TimePrint ) { Extra_ProgressBarUpdate( pPro, ++pMan->TimeSec, NULL ); @@ -949,7 +950,8 @@ void Super_Write( Super_Man_t * pMan ) { Super_Gate_t * pGateRoot, * pGate; stmm_generator * gen; - int fZeroFound, clk, v; + int fZeroFound, v; + clock_t clk; ABC_PTRUINT_T Key; if ( pMan->nGates < 1 ) diff --git a/src/misc/bbl/bblif.c b/src/misc/bbl/bblif.c index 47190fb7..eefff9f7 100644 --- a/src/misc/bbl/bblif.c +++ b/src/misc/bbl/bblif.c @@ -22,7 +22,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/util/abc_global.h" #include "bblif.h" diff --git a/src/misc/extra/extra.h b/src/misc/extra/extra.h index e9daa87e..2f04e781 100644 --- a/src/misc/extra/extra.h +++ b/src/misc/extra/extra.h @@ -42,7 +42,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/st/st.h" diff --git a/src/misc/extra/extraBdd.h b/src/misc/extra/extraBdd.h index 25df14bb..fcd10320 100644 --- a/src/misc/extra/extraBdd.h +++ b/src/misc/extra/extraBdd.h @@ -42,7 +42,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/st/st.h" #include "src/bdd/cudd/cuddInt.h" diff --git a/src/misc/extra/extraBddCas.c b/src/misc/extra/extraBddCas.c index 0416a0d2..08b0f95f 100644 --- a/src/misc/extra/extraBddCas.c +++ b/src/misc/extra/extraBddCas.c @@ -192,7 +192,7 @@ Extra_bddEncodingNonStrict( { DdNode * bEncoded, * bResult; int nVarsCol = Cudd_SupportSize(dd,bVarsCol); - long clk; + clock_t clk; // cannot work with more that 32-bit codes assert( nMulti < 32 ); diff --git a/src/misc/extra/extraBddMisc.c b/src/misc/extra/extraBddMisc.c index a5f987e3..b54449b4 100644 --- a/src/misc/extra/extraBddMisc.c +++ b/src/misc/extra/extraBddMisc.c @@ -1348,9 +1348,9 @@ extraTransferPermuteRecur( if ( st_lookup( table, ( char * ) f, ( char ** ) &res ) ) return ( Cudd_NotCond( res, comple ) ); - if ( ddS->TimeStop && time(NULL) > ddS->TimeStop ) + if ( ddS->TimeStop && clock() > ddS->TimeStop ) return NULL; - if ( ddD->TimeStop && time(NULL) > ddD->TimeStop ) + if ( ddD->TimeStop && clock() > ddD->TimeStop ) return NULL; /* Recursive step. */ @@ -1909,9 +1909,9 @@ DdNode * extraBddAndPermute( DdHashTable * table, DdManager * ddF, DdNode * bF, return bRes; Counter++; - if ( ddF->TimeStop && time(NULL) > ddF->TimeStop ) + if ( ddF->TimeStop && clock() > ddF->TimeStop ) return NULL; - if ( ddG->TimeStop && time(NULL) > ddG->TimeStop ) + if ( ddG->TimeStop && clock() > ddG->TimeStop ) return NULL; // find the topmost variable in F and G using var order of F @@ -1982,7 +1982,7 @@ void Extra_TestAndPerm( DdManager * ddF, DdNode * bF, DdNode * bG ) { DdManager * ddG; DdNode * bG2, * bRes1, * bRes2; - int clk; + clock_t clk; // disable variable ordering in ddF Cudd_AutodynDisable( ddF ); diff --git a/src/misc/extra/extraBddTime.c b/src/misc/extra/extraBddTime.c index 853f8a64..b5e2672a 100644 --- a/src/misc/extra/extraBddTime.c +++ b/src/misc/extra/extraBddTime.c @@ -225,7 +225,7 @@ cuddBddAndRecurTime( } // if ( TimeOut && ((*pRecCalls)++ % CHECK_FACTOR) == 0 && TimeOut < clock() ) - if ( TimeOut && time(NULL) > TimeOut ) + if ( TimeOut && clock() > TimeOut ) return NULL; /* Here we can skip the use of cuddI, because the operands are known @@ -379,7 +379,7 @@ cuddBddAndAbstractRecurTime( } // if ( TimeOut && ((*pRecCalls)++ % CHECK_FACTOR) == 0 && TimeOut < clock() ) - if ( TimeOut && time(NULL) > TimeOut ) + if ( TimeOut && clock() > TimeOut ) return NULL; if (topf == top) { @@ -596,7 +596,7 @@ extraTransferPermuteRecurTime( if ( st_lookup( table, ( char * ) f, ( char ** ) &res ) ) return ( Cudd_NotCond( res, comple ) ); - if ( TimeOut && time(NULL) > TimeOut ) + if ( TimeOut && clock() > TimeOut ) return NULL; /* Recursive step. */ diff --git a/src/misc/extra/extraUtilUtil.c b/src/misc/extra/extraUtilUtil.c index fe8b25f1..7f19480c 100644 --- a/src/misc/extra/extraUtilUtil.c +++ b/src/misc/extra/extraUtilUtil.c @@ -347,7 +347,7 @@ void (*Extra_UtilMMoutOfMemory)( long size ) = (void (*)( long size ))Extra_Util SeeAlso [] ***********************************************************************/ -long Extra_CpuTime() +clock_t Extra_CpuTime() { return clock(); } @@ -366,7 +366,7 @@ long Extra_CpuTime() #if defined(NT) || defined(NT64) || defined(WIN32) double Extra_CpuTimeDouble() { - return (double)clock()/CLOCKS_PER_SEC; + return 1.0*clock()/CLOCKS_PER_SEC; } #else diff --git a/src/misc/nm/nmTable.c b/src/misc/nm/nmTable.c index 4c2b7a0a..1a792242 100644 --- a/src/misc/nm/nmTable.c +++ b/src/misc/nm/nmTable.c @@ -256,7 +256,8 @@ void Nm_ManProfile( Nm_Man_t * p ) void Nm_ManResize( Nm_Man_t * p ) { Nm_Entry_t ** pBinsNewI2N, ** pBinsNewN2I, * pEntry, * pEntry2, ** ppSpot; - int nBinsNew, Counter, e, clk; + int nBinsNew, Counter, e; + clock_t clk; clk = clock(); // get the new table size diff --git a/src/misc/tim/tim.c b/src/misc/tim/tim.c index 9056d261..c56bfaaf 100644 --- a/src/misc/tim/tim.c +++ b/src/misc/tim/tim.c @@ -22,7 +22,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/vec/vec.h" #include "src/misc/mem/mem.h" diff --git a/src/misc/util/utilSort.c b/src/misc/util/utilSort.c index eb2b32c3..48321c9f 100644 --- a/src/misc/util/utilSort.c +++ b/src/misc/util/utilSort.c @@ -398,9 +398,10 @@ int Abc_SortNumCompare( int * pNum1, int * pNum2 ) void Abc_SortTest() { int fUseNew = 0; - int i, clk, nSize = 50000000; + int i, nSize = 50000000; int * pArray = (int *)malloc( sizeof(int) * nSize ); int * pPerm; + clock_t clk; // generate numbers srand( 1000 ); for ( i = 0; i < nSize; i++ ) @@ -743,7 +744,8 @@ void Abc_QuickSortTest() int nSize = 1000000; int fVerbose = 0; word * pData1, * pData2; - int i, clk = clock(); + int i; + clock_t clk = clock(); // generate numbers pData1 = ABC_ALLOC( word, nSize ); pData2 = ABC_ALLOC( word, nSize ); diff --git a/src/misc/util/util_hack.h b/src/misc/util/util_hack.h index 9c702bfe..505b8c99 100644 --- a/src/misc/util/util_hack.h +++ b/src/misc/util/util_hack.h @@ -25,7 +25,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include <math.h> #include "abc_global.h" diff --git a/src/opt/cgt/cgtCore.c b/src/opt/cgt/cgtCore.c index 73195413..82f4e105 100644 --- a/src/opt/cgt/cgtCore.c +++ b/src/opt/cgt/cgtCore.c @@ -200,7 +200,8 @@ void Cgt_ClockGatingRangeCheck( Cgt_Man_t * p, int iStart, int nOutputs ) ***********************************************************************/ int Cgt_ClockGatingRange( Cgt_Man_t * p, int iStart ) { - int nOutputs, iStop, clk, clkTotal = clock(); + int nOutputs, iStop; + clock_t clk, clkTotal = clock(); int nCallsUnsat = p->nCallsUnsat; int nCallsSat = p->nCallsSat; int nCallsUndec = p->nCallsUndec; @@ -247,7 +248,8 @@ Vec_Vec_t * Cgt_ClockGatingCandidates( Aig_Man_t * pAig, Aig_Man_t * pCare, Cgt_ Cgt_Par_t Pars; Cgt_Man_t * p; Vec_Vec_t * vGatesAll; - int iStart, clk = clock(), clkTotal = clock(); + int iStart; + clock_t clk = clock(), clkTotal = clock(); // reset random numbers Aig_ManRandom( 1 ); if ( pPars == NULL ) diff --git a/src/opt/cgt/cgtDecide.c b/src/opt/cgt/cgtDecide.c index c5b49bbc..4e4a57b1 100644 --- a/src/opt/cgt/cgtDecide.c +++ b/src/opt/cgt/cgtDecide.c @@ -192,7 +192,8 @@ Vec_Vec_t * Cgt_ManDecideSimple( Aig_Man_t * pAig, Vec_Vec_t * vGatesAll, int nO Vec_Vec_t * vGates; Vec_Ptr_t * vCands; Aig_Obj_t * pObjLi, * pObjLo, * pCand, * pCandBest; - int i, k, nHitsCur, nHitsMax, Counter = 0, clk = clock(); + int i, k, nHitsCur, nHitsMax, Counter = 0; + clock_t clk = clock(); int nTransTotal = 0, nTransSaved = 0; vGates = Vec_VecStart( Saig_ManRegNum(pAig) ); pSml = Ssw_SmlSimulateSeq( pAig, 0, nFrames, nWords ); @@ -259,7 +260,8 @@ Vec_Vec_t * Cgt_ManDecideArea( Aig_Man_t * pAig, Vec_Vec_t * vGatesAll, int nOdc Vec_Vec_t * vGates; Vec_Ptr_t * vCompletes, * vOne; Aig_Obj_t * pGate; - int i, k, Counter = 0, clk = clock(); + int i, k, Counter = 0; + clock_t clk = clock(); // derive and label complete gates vCompletes = Cgt_ManCompleteGates( pAig, vGatesAll, nOdcMax, fVerbose ); // label complete gates diff --git a/src/opt/cgt/cgtInt.h b/src/opt/cgt/cgtInt.h index 1fdbf35f..78c27224 100644 --- a/src/opt/cgt/cgtInt.h +++ b/src/opt/cgt/cgtInt.h @@ -74,15 +74,15 @@ struct Cgt_Man_t_ int nCallsUnsat; // unsatisfiable calls int nCallsUndec; // undecided calls int nCallsFiltered; // filtered out calls - int timeAig; // constructing AIG - int timePrepare; // partitioning and SAT solving - int timeSat; // total runtime - int timeSatSat; // satisfiable runtime - int timeSatUnsat; // unsatisfiable runtime - int timeSatUndec; // undecided runtime - int timeDecision; // making decision about what gates to use - int timeOther; // other runtime - int timeTotal; // total runtime + clock_t timeAig; // constructing AIG + clock_t timePrepare; // partitioning and SAT solving + clock_t timeSat; // total runtime + clock_t timeSatSat; // satisfiable runtime + clock_t timeSatUnsat; // unsatisfiable runtime + clock_t timeSatUndec; // undecided runtime + clock_t timeDecision; // making decision about what gates to use + clock_t timeOther; // other runtime + clock_t timeTotal; // total runtime }; //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/cgt/cgtSat.c b/src/opt/cgt/cgtSat.c index 0a2a1daa..b6d3c599 100644 --- a/src/opt/cgt/cgtSat.c +++ b/src/opt/cgt/cgtSat.c @@ -46,7 +46,8 @@ ABC_NAMESPACE_IMPL_START int Cgt_CheckImplication( Cgt_Man_t * p, Aig_Obj_t * pGate, Aig_Obj_t * pMiter ) { int nBTLimit = p->pPars->nConfMax; - int pLits[2], RetValue, clk; + int pLits[2], RetValue; + clock_t clk; p->nCalls++; // sanity checks diff --git a/src/opt/csw/cswCore.c b/src/opt/csw/cswCore.c index f1c2d934..3702b346 100644 --- a/src/opt/csw/cswCore.c +++ b/src/opt/csw/cswCore.c @@ -47,7 +47,8 @@ Aig_Man_t * Csw_Sweep( Aig_Man_t * pAig, int nCutsMax, int nLeafMax, int fVerbos Csw_Man_t * p; Aig_Man_t * pRes; Aig_Obj_t * pObj, * pObjNew, * pObjRes; - int i, clk; + int i; + clock_t clk; clk = clock(); // start the manager p = Csw_ManStart( pAig, nCutsMax, nLeafMax, fVerbose ); diff --git a/src/opt/csw/cswCut.c b/src/opt/csw/cswCut.c index bb6677c2..0b1d9254 100644 --- a/src/opt/csw/cswCut.c +++ b/src/opt/csw/cswCut.c @@ -497,7 +497,8 @@ Aig_Obj_t * Csw_ObjSweep( Csw_Man_t * p, Aig_Obj_t * pObj, int fTriv ) Aig_Obj_t * pFanin1 = Aig_ObjFanin1(pObj); Aig_Obj_t * pObjNew; unsigned * pTruth; - int i, k, nVars, nFanins, iVar, clk; + int i, k, nVars, nFanins, iVar; + clock_t clk; assert( !Aig_IsComplement(pObj) ); if ( !Aig_ObjIsNode(pObj) ) diff --git a/src/opt/csw/cswInt.h b/src/opt/csw/cswInt.h index e6c10b36..65228fcd 100644 --- a/src/opt/csw/cswInt.h +++ b/src/opt/csw/cswInt.h @@ -30,7 +30,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/aig/aig/aig.h" #include "src/opt/dar/dar.h" @@ -94,10 +93,10 @@ struct Csw_Man_t_ int nNodesTriv2; // the number of trivial nodes int nNodesCuts; // the number of rewritten nodes int nNodesTried; // the number of nodes tried - int timeCuts; // time to compute the cut and its truth table - int timeHash; // time for hashing cuts - int timeOther; // other time - int timeTotal; // total time + clock_t timeCuts; // time to compute the cut and its truth table + clock_t timeHash; // time for hashing cuts + clock_t timeOther; // other time + clock_t timeTotal; // total time }; static inline int Csw_CutLeaveNum( Csw_Cut_t * pCut ) { return pCut->nFanins; } diff --git a/src/opt/cut/cut.h b/src/opt/cut/cut.h index cd87e5a0..64d3108a 100644 --- a/src/opt/cut/cut.h +++ b/src/opt/cut/cut.h @@ -124,7 +124,7 @@ extern int Cut_CutCountList( Cut_Cut_t * pList ); extern Cut_Man_t * Cut_ManStart( Cut_Params_t * pParams ); extern void Cut_ManStop( Cut_Man_t * p ); extern void Cut_ManPrintStats( Cut_Man_t * p ); -extern void Cut_ManPrintStatsToFile( Cut_Man_t * p, char * pFileName, int TimeTotal ); +extern void Cut_ManPrintStatsToFile( Cut_Man_t * p, char * pFileName, clock_t TimeTotal ); extern void Cut_ManSetFanoutCounts( Cut_Man_t * p, Vec_Int_t * vFanCounts ); extern void Cut_ManSetNodeAttrs( Cut_Man_t * p, Vec_Int_t * vFanCounts ); extern int Cut_ManReadVarsMax( Cut_Man_t * p ); diff --git a/src/opt/cut/cutInt.h b/src/opt/cut/cutInt.h index 39606b00..a66a5786 100644 --- a/src/opt/cut/cutInt.h +++ b/src/opt/cut/cutInt.h @@ -92,12 +92,12 @@ struct Cut_ManStruct_t_ int nNodesDag; int nNodesNoCuts; // runtime - int timeMerge; - int timeUnion; - int timeTruth; - int timeFilter; - int timeHash; - int timeMap; + clock_t timeMerge; + clock_t timeUnion; + clock_t timeTruth; + clock_t timeFilter; + clock_t timeHash; + clock_t timeMap; }; // iterator through all the cuts of the list diff --git a/src/opt/cut/cutMan.c b/src/opt/cut/cutMan.c index 4a9f8f4b..12c65935 100644 --- a/src/opt/cut/cutMan.c +++ b/src/opt/cut/cutMan.c @@ -201,7 +201,7 @@ void Cut_ManPrintStats( Cut_Man_t * p ) SeeAlso [] ***********************************************************************/ -void Cut_ManPrintStatsToFile( Cut_Man_t * p, char * pFileName, int TimeTotal ) +void Cut_ManPrintStatsToFile( Cut_Man_t * p, char * pFileName, clock_t TimeTotal ) { FILE * pTable; pTable = fopen( "cut_stats.txt", "a+" ); diff --git a/src/opt/cut/cutNode.c b/src/opt/cut/cutNode.c index 010e1e00..4f94011a 100644 --- a/src/opt/cut/cutNode.c +++ b/src/opt/cut/cutNode.c @@ -370,7 +370,7 @@ Cut_Cut_t * Cut_NodeComputeCuts( Cut_Man_t * p, int Node, int Node0, int Node1, { Cut_List_t Super, * pSuper = &Super; Cut_Cut_t * pList, * pCut; - int clk; + clock_t clk; // start the number of cuts at the node p->nNodes++; p->nNodeCuts = 0; @@ -681,7 +681,7 @@ Cut_Cut_t * Cut_NodeUnionCuts( Cut_Man_t * p, Vec_Int_t * vNodes ) Cut_Cut_t * pList, * pListStart, * pCut, * pCut2; Cut_Cut_t * pTop = NULL; // Suppress "might be used uninitialized" int i, k, Node, Root, Limit = p->pParams->nVarsMax; - int clk = clock(); + clock_t clk = clock(); // start the new list Cut_ListStart( pSuper ); @@ -797,7 +797,7 @@ Cut_Cut_t * Cut_NodeUnionCutsSeq( Cut_Man_t * p, Vec_Int_t * vNodes, int CutSetN Cut_List_t Super, * pSuper = &Super; Cut_Cut_t * pList, * pListStart, * pCut, * pCut2, * pTop; int i, k, Node, Root, Limit = p->pParams->nVarsMax; - int clk = clock(); + clock_t clk = clock(); // start the new list Cut_ListStart( pSuper ); diff --git a/src/opt/cut/cutOracle.c b/src/opt/cut/cutOracle.c index b26e7d5e..5b740da5 100644 --- a/src/opt/cut/cutOracle.c +++ b/src/opt/cut/cutOracle.c @@ -46,7 +46,7 @@ struct Cut_OracleStruct_t_ int EntrySize; int nTruthWords; // stats - int timeTotal; + clock_t timeTotal; int nCuts; int nCutsTriv; }; @@ -322,7 +322,7 @@ Cut_Cut_t * Cut_OracleComputeCuts( Cut_Oracle_t * p, int Node, int Node0, int No Cut_Cut_t * pList = NULL, ** ppTail = &pList; Cut_Cut_t * pCut, * pCut0, * pCut1, * pList0, * pList1; int iCutStart, nCuts, i, Entry; - int clk = clock(); + clock_t clk = clock(); // get the cuts of the children pList0 = (Cut_Cut_t *)Vec_PtrEntry( p->vCutsNew, Node0 ); diff --git a/src/opt/cut/cutPre22.c b/src/opt/cut/cutPre22.c index d51d9056..4e507fba 100644 --- a/src/opt/cut/cutPre22.c +++ b/src/opt/cut/cutPre22.c @@ -69,9 +69,9 @@ struct Cut_CMan_t_ int nVarCounts[CUT_CELL_MVAR+1]; int nSymGroups[CUT_CELL_MVAR+1]; int nSymGroupsE[CUT_CELL_MVAR+1]; - int timeCanon; - int timeSupp; - int timeTable; + clock_t timeCanon; + clock_t timeSupp; + clock_t timeTable; int nCellFound; int nCellNotFound; }; @@ -234,7 +234,8 @@ void Cut_CellPrecompute() { Cut_CMan_t * p; Cut_Cell_t * pCell, * pTemp; - int i1, i2, i3, i, j, k, c, clk = clock(); //, clk2 = clock(); + int i1, i2, i3, i, j, k, c; + clock_t clk = clock(); //, clk2 = clock(); p = Cut_CManStart(); @@ -840,7 +841,7 @@ void Cut_CellDumpToFile() int NumUsed[10][5] = {{0}}; int BoxUsed[22][5] = {{0}}; int i, k, Counter; - int clk = clock(); + clock_t clk = clock(); if ( p == NULL ) { diff --git a/src/opt/cut/cutSeq.c b/src/opt/cut/cutSeq.c index 3f671d24..e1df2c95 100644 --- a/src/opt/cut/cutSeq.c +++ b/src/opt/cut/cutSeq.c @@ -73,7 +73,7 @@ void Cut_NodeComputeCutsSeq( Cut_Man_t * p, int Node, int Node0, int Node1, int { Cut_List_t Super, * pSuper = &Super; Cut_Cut_t * pListNew; - int clk; + clock_t clk; // get the number of cuts at the node p->nNodeCuts = Cut_CutCountList( Cut_NodeReadCutsOld(p, Node) ); diff --git a/src/opt/dar/darCore.c b/src/opt/dar/darCore.c index 958ab70a..ba945f77 100644 --- a/src/opt/dar/darCore.c +++ b/src/opt/dar/darCore.c @@ -83,7 +83,8 @@ int Dar_ManRewrite( Aig_Man_t * pAig, Dar_RwrPar_t * pPars ) Dar_Cut_t * pCut; Aig_Obj_t * pObj, * pObjNew; int i, k, nNodesOld, nNodeBefore, nNodeAfter, Required; - int clk = 0, clkStart, Counter = 0; + clock_t clk = 0, clkStart; + int Counter = 0; int nMffcSize;//, nMffcGains[MAX_VAL+1][MAX_VAL+1] = {{0}}; // prepare the library Dar_LibPrepare( pPars->nSubgMax ); @@ -287,7 +288,8 @@ Aig_MmFixed_t * Dar_ManComputeCuts( Aig_Man_t * pAig, int nCutsMax, int fSkipTtM Dar_RwrPar_t Pars, * pPars = &Pars; Aig_Obj_t * pObj; Aig_MmFixed_t * pMemCuts; - int i, nNodes, clk = clock(); + int i, nNodes; + clock_t clk = clock(); // remove dangling nodes if ( (nNodes = Aig_ManCleanup( pAig )) ) { diff --git a/src/opt/dar/darInt.h b/src/opt/dar/darInt.h index caea213c..6bf347e1 100644 --- a/src/opt/dar/darInt.h +++ b/src/opt/dar/darInt.h @@ -30,9 +30,7 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> -//#include "bar.h" #include "src/misc/vec/vec.h" #include "src/aig/aig/aig.h" #include "dar.h" @@ -98,12 +96,12 @@ struct Dar_Man_t_ int nCutsGood; // good cuts int nCutsSkipped; // skipped bad cuts // timing statistics - int timeCuts; - int timeEval; - int timeOther; - int timeTotal; - int time1; - int time2; + clock_t timeCuts; + clock_t timeEval; + clock_t timeOther; + clock_t timeTotal; + clock_t time1; + clock_t time2; }; static inline Dar_Cut_t * Dar_ObjCuts( Aig_Obj_t * pObj ) { return (Dar_Cut_t *)pObj->pData; } diff --git a/src/opt/dar/darLib.c b/src/opt/dar/darLib.c index 41794d18..67a5f59e 100644 --- a/src/opt/dar/darLib.c +++ b/src/opt/dar/darLib.c @@ -920,8 +920,8 @@ void Dar_LibEval( Dar_Man_t * p, Aig_Obj_t * pRoot, Dar_Cut_t * pCut, int Requir int fTraining = 0; float PowerSaved, PowerAdded; Dar_LibObj_t * pObj; - int Out, k, Class, nNodesSaved, nNodesAdded, nNodesGained, clk; - clk = clock(); + int Out, k, Class, nNodesSaved, nNodesAdded, nNodesGained; + clock_t clk = clock(); if ( pCut->nLeaves != 4 ) return; // check if the cut exits and assigns leaves and their levels @@ -1188,8 +1188,8 @@ int Dar2_LibEval( Gia_Man_t * p, Vec_Int_t * vCutLits, unsigned uTruth, int fKee int p_ClassBest = -1; // int fTraining = 0; Dar_LibObj_t * pObj; - int Out, k, Class, nNodesSaved, nNodesAdded, nNodesGained, clk; - clk = clock(); + int Out, k, Class, nNodesSaved, nNodesAdded, nNodesGained; + clock_t clk = clock(); assert( Vec_IntSize(vCutLits) == 4 ); assert( (uTruth >> 16) == 0 ); // check if the cut exits and assigns leaves and their levels diff --git a/src/opt/dar/darRefact.c b/src/opt/dar/darRefact.c index 0ff7c44f..dcfbeac7 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 - int timeCuts; - int timeEval; - int timeOther; - int timeTotal; + clock_t timeCuts; + clock_t timeEval; + clock_t timeOther; + clock_t timeTotal; }; //////////////////////////////////////////////////////////////////////// @@ -500,7 +500,8 @@ int Dar_ManRefactor( Aig_Man_t * pAig, Dar_RefPar_t * pPars ) Vec_Ptr_t * vCut, * vCut2; Aig_Obj_t * pObj, * pObjNew; int nNodesOld, nNodeBefore, nNodeAfter, nNodesSaved, nNodesSaved2; - int i, Required, nLevelMin, clkStart, clk; + int i, Required, nLevelMin; + clock_t clkStart, clk; // start the manager p = Dar_ManRefStart( pAig, pPars ); diff --git a/src/opt/dar/darScript.c b/src/opt/dar/darScript.c index 5561908d..be67b212 100644 --- a/src/opt/dar/darScript.c +++ b/src/opt/dar/darScript.c @@ -398,7 +398,8 @@ Aig_Man_t * Dar_ManChoice( Aig_Man_t * pAig, int fBalance, int fUpdateLevel, int { Aig_Man_t * pMan, * pTemp; Vec_Ptr_t * vAigs; - int i, clk; + int i; + clock_t clk; clk = clock(); // vAigs = Dar_ManChoiceSynthesisExt(); @@ -802,7 +803,8 @@ Aig_Man_t * Dar_ManChoiceNewAig( Aig_Man_t * pAig, Dch_Pars_t * pPars ) Vec_Ptr_t * vPios; void * pManTime; char * pName, * pSpec; - int i, clk; + int i; + clock_t clk; clk = clock(); vAigs = Dar_ManChoiceSynthesis( pAig, 1, 1, pPars->fPower, fVerbose ); @@ -873,7 +875,7 @@ Aig_Man_t * Dar_ManChoiceNew( Aig_Man_t * pAig, Dch_Pars_t * pPars ) Vec_Ptr_t * vPios; void * pManTime; char * pName, * pSpec; - int clk; + clock_t clk; // save useful things pManTime = pAig->pManTime; pAig->pManTime = NULL; diff --git a/src/opt/lpk/lpkAbcDec.c b/src/opt/lpk/lpkAbcDec.c index de5b66cc..731c37e6 100644 --- a/src/opt/lpk/lpkAbcDec.c +++ b/src/opt/lpk/lpkAbcDec.c @@ -148,7 +148,7 @@ int Lpk_Decompose_rec( Lpk_Man_t * pMan, Lpk_Fun_t * p ) { Lpk_Res_t * pResMux, * pResDsd; Lpk_Fun_t * p2; - int clk; + clock_t clk; // is only called for non-trivial blocks assert( p->nLutK >= 3 && p->nLutK <= 6 ); diff --git a/src/opt/lpk/lpkCore.c b/src/opt/lpk/lpkCore.c index 5019ba83..6ab13bda 100644 --- a/src/opt/lpk/lpkCore.c +++ b/src/opt/lpk/lpkCore.c @@ -133,7 +133,8 @@ int Lpk_ExploreCut( Lpk_Man_t * p, Lpk_Cut_t * pCut, Kit_DsdNtk_t * pNtk ) Kit_DsdObj_t * pRoot; If_Obj_t * pDriver, * ppLeaves[16]; Abc_Obj_t * pLeaf, * pObjNew; - int nGain, i, clk; + int nGain, i; + clock_t clk; int nNodesBef; // int nOldShared; @@ -242,7 +243,8 @@ int Lpk_ResynthesizeNode( Lpk_Man_t * p ) Kit_DsdNtk_t * pDsdNtk; Lpk_Cut_t * pCut; unsigned * pTruth; - int i, k, nSuppSize, nCutNodes, RetValue, clk; + int i, k, nSuppSize, nCutNodes, RetValue; + clock_t clk; // compute the cuts clk = clock(); @@ -371,7 +373,8 @@ int Lpk_ResynthesizeNodeNew( Lpk_Man_t * p ) Lpk_Cut_t * pCut; unsigned * pTruth; int nNodesBef, nNodesAft, nCutNodes; - int i, k, clk; + int i, k; + clock_t clk; int Required = Abc_ObjRequiredLevel(p->pObj); // CloudNode * pFun2;//, * pFun1; @@ -507,7 +510,8 @@ int Lpk_Resynthesize( Abc_Ntk_t * pNtk, Lpk_Par_t * pPars ) Abc_Obj_t * pObj; double Delta; // int * pnFanouts, nObjMax; - int i, Iter, nNodes, nNodesPrev, clk = clock(); + int i, Iter, nNodes, nNodesPrev; + clock_t clk = clock(); assert( Abc_NtkIsLogic(pNtk) ); // sweep dangling nodes as a preprocessing step diff --git a/src/opt/lpk/lpkInt.h b/src/opt/lpk/lpkInt.h index 61fa1624..2ff47dc4 100644 --- a/src/opt/lpk/lpkInt.h +++ b/src/opt/lpk/lpkInt.h @@ -121,20 +121,20 @@ struct Lpk_Man_t_ // counter of non-DSD blocks int nBlocks[17]; // runtime - int timeCuts; - int timeTruth; - int timeSupps; - int timeTruth2; - int timeTruth3; - int timeEval; - int timeMap; - int timeOther; - int timeTotal; + clock_t timeCuts; + clock_t timeTruth; + clock_t timeSupps; + clock_t timeTruth2; + clock_t timeTruth3; + clock_t timeEval; + clock_t timeMap; + clock_t timeOther; + clock_t timeTotal; // runtime of eval - int timeEvalMuxAn; - int timeEvalMuxSp; - int timeEvalDsdAn; - int timeEvalDsdSp; + clock_t timeEvalMuxAn; + clock_t timeEvalMuxSp; + clock_t timeEvalDsdAn; + clock_t timeEvalDsdSp; }; diff --git a/src/opt/mfs/mfsCore.c b/src/opt/mfs/mfsCore.c index 5214e833..8ca9edcf 100644 --- a/src/opt/mfs/mfsCore.c +++ b/src/opt/mfs/mfsCore.c @@ -235,7 +235,7 @@ void Abc_NtkMfsPowerResub( Mfs_Man_t * p, Mfs_Par_t * pPars) ***********************************************************************/ int Abc_NtkMfsResub( Mfs_Man_t * p, Abc_Obj_t * pNode ) { - int clk; + clock_t clk; p->nNodesTried++; // prepare data structure for this node Mfs_ManClean( p ); @@ -307,7 +307,8 @@ int Abc_NtkMfsNode( Mfs_Man_t * p, Abc_Obj_t * pNode ) float dProb; extern Hop_Obj_t * Abc_NodeIfNodeResyn( Bdc_Man_t * p, Hop_Man_t * pHop, Hop_Obj_t * pRoot, int nVars, Vec_Int_t * vTruth, unsigned * puCare, float dProb ); - int nGain, clk; + int nGain; + clock_t clk; p->nNodesTried++; // prepare data structure for this node Mfs_ManClean( p ); @@ -380,7 +381,8 @@ int Abc_NtkMfs( Abc_Ntk_t * pNtk, Mfs_Par_t * pPars ) Abc_Obj_t * pObj; Vec_Vec_t * vLevels; Vec_Ptr_t * vNodes; - int i, k, nNodes, nFaninMax, clk = clock(), clk2; + int i, k, nNodes, nFaninMax; + clock_t clk = clock(), clk2; int nTotalNodesBeg = Abc_NtkNodeNum(pNtk); int nTotalEdgesBeg = Abc_NtkGetTotalFanins(pNtk); diff --git a/src/opt/mfs/mfsInt.h b/src/opt/mfs/mfsInt.h index fe154093..8b28fe61 100644 --- a/src/opt/mfs/mfsInt.h +++ b/src/opt/mfs/mfsInt.h @@ -119,14 +119,14 @@ struct Mfs_Man_t_ float TotalSwitchingBeg; float TotalSwitchingEnd; // statistics - int timeWin; - int timeDiv; - int timeAig; - int timeGia; - int timeCnf; - int timeSat; - int timeInt; - int timeTotal; + clock_t timeWin; + clock_t timeDiv; + clock_t timeAig; + clock_t timeGia; + clock_t timeCnf; + clock_t timeSat; + clock_t timeInt; + clock_t timeTotal; }; static inline float Abc_MfsObjProb( Mfs_Man_t * p, Abc_Obj_t * pObj ) { return (p->vProbs && pObj->Id < Vec_IntSize(p->vProbs))? Abc_Int2Float(Vec_IntEntry(p->vProbs,pObj->Id)) : 0.0; } diff --git a/src/opt/mfs/mfsResub.c b/src/opt/mfs/mfsResub.c index e908a56c..54f40721 100644 --- a/src/opt/mfs/mfsResub.c +++ b/src/opt/mfs/mfsResub.c @@ -167,7 +167,8 @@ int Abc_NtkMfsSolveSatResub( Mfs_Man_t * p, Abc_Obj_t * pNode, int iFanin, int f int fVeryVerbose = p->pPars->fVeryVerbose && Vec_PtrSize(p->vDivs) < 80;// || pNode->Id == 556; unsigned * pData; int pCands[MFS_FANIN_MAX]; - int RetValue, iVar, i, nCands, nWords, w, clk; + int RetValue, iVar, i, nCands, nWords, w; + clock_t clk; Abc_Obj_t * pFanin; Hop_Obj_t * pFunc; assert( iFanin >= 0 ); @@ -314,7 +315,8 @@ int Abc_NtkMfsSolveSatResub2( Mfs_Man_t * p, Abc_Obj_t * pNode, int iFanin, int int fVeryVerbose = p->pPars->fVeryVerbose && Vec_PtrSize(p->vDivs) < 80; unsigned * pData, * pData2; int pCands[MFS_FANIN_MAX]; - int RetValue, iVar, iVar2, i, w, nCands, clk, nWords, fBreak; + int RetValue, iVar, iVar2, i, w, nCands, nWords, fBreak; + clock_t clk; Abc_Obj_t * pFanin; Hop_Obj_t * pFunc; assert( iFanin >= 0 ); diff --git a/src/opt/nwk/nwkBidec.c b/src/opt/nwk/nwkBidec.c index 1b6439d2..2f1c0366 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; - int clk = clock(); + clock_t clk = clock(); pPars->nVarsMax = Nwk_ManGetFaninMax( pNtk ); pPars->fVerbose = fVerbose; if ( pPars->nVarsMax < 2 ) diff --git a/src/opt/nwk/nwkFlow.c b/src/opt/nwk/nwkFlow.c index 3961e5c2..50a4787f 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; - int clk = clock(); + clock_t clk = clock(); // set the sequential parameters pMan->nLatches = nLatches; pMan->nTruePis = Nwk_ManCiNum(pMan) - nLatches; @@ -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; - int clk = clock(); + clock_t clk = clock(); // set the sequential parameters pMan->nLatches = nLatches; pMan->nTruePis = Nwk_ManCiNum(pMan) - nLatches; diff --git a/src/opt/nwk/nwkMap.c b/src/opt/nwk/nwkMap.c index 5f08e179..3de55c43 100644 --- a/src/opt/nwk/nwkMap.c +++ b/src/opt/nwk/nwkMap.c @@ -109,7 +109,8 @@ If_Man_t * Nwk_ManToIf( Aig_Man_t * p, If_Par_t * pPars, Vec_Ptr_t * vAigToIf ) If_Man_t * pIfMan; If_Obj_t * pIfObj; Aig_Obj_t * pNode, * pFanin, * pPrev; - int i, clk = clock(); + int i; + clock_t clk = clock(); // set the number of registers (switch activity will be combinational) Aig_ManSetRegNum( p, 0 ); if ( pPars->fPower ) diff --git a/src/opt/nwk/nwkMerge.c b/src/opt/nwk/nwkMerge.c index 2a43bc16..b733e2a3 100644 --- a/src/opt/nwk/nwkMerge.c +++ b/src/opt/nwk/nwkMerge.c @@ -704,7 +704,7 @@ int Nwk_ManLutMergeGraphTest( char * pFileName ) { int nPairs; Nwk_Grf_t * p; - int clk = clock(); + clock_t clk = clock(); p = Nwk_ManLutMergeReadGraph( pFileName ); ABC_PRT( "Reading", clock() - clk ); clk = clock(); @@ -974,7 +974,8 @@ Vec_Int_t * Nwk_ManLutMerge( Nwk_Man_t * pNtk, void * pParsInit ) Vec_Int_t * vResult; Vec_Ptr_t * vStart, * vNext, * vCands1, * vCands2; Nwk_Obj_t * pLut, * pCand; - int i, k, nVertsMax, nCands, clk = clock(); + int i, k, nVertsMax, nCands; + clock_t clk = clock(); // count the number of vertices nVertsMax = 0; Nwk_ManForEachNode( pNtk, pLut, i ) diff --git a/src/opt/nwk/nwkUtil.c b/src/opt/nwk/nwkUtil.c index 9d23c869..cf3e5bf3 100644 --- a/src/opt/nwk/nwkUtil.c +++ b/src/opt/nwk/nwkUtil.c @@ -543,7 +543,8 @@ int Nwk_ManMinimumBaseInt( Nwk_Man_t * pNtk, int fVerbose ) ***********************************************************************/ void Nwk_ManMinimumBaseRec( Nwk_Man_t * pNtk, int fVerbose ) { - int i, clk = clock(); + int i; + clock_t clk = clock(); for ( i = 0; Nwk_ManMinimumBaseInt( pNtk, fVerbose ); i++ ); ABC_PRT( "Minbase", clock() - clk ); } diff --git a/src/opt/res/resCore.c b/src/opt/res/resCore.c index effc7e65..acb8542c 100644 --- a/src/opt/res/resCore.c +++ b/src/opt/res/resCore.c @@ -60,18 +60,18 @@ struct Res_Man_t_ int nTotalNets2; // the total number of nets int nTotalNodes2; // the total number of nodess // runtime - int timeWin; // windowing - int timeDiv; // divisors - int timeAig; // strashing - int timeSim; // simulation - int timeCand; // resubstitution candidates - int timeSatTotal; // SAT solving total - int timeSatSat; // SAT solving (sat calls) - int timeSatUnsat; // SAT solving (unsat calls) - int timeSatSim; // SAT solving (simulation) - int timeInt; // interpolation - int timeUpd; // updating - int timeTotal; // total runtime + clock_t timeWin; // windowing + clock_t timeDiv; // divisors + clock_t timeAig; // strashing + clock_t timeSim; // simulation + clock_t timeCand; // resubstitution candidates + clock_t timeSatTotal; // SAT solving total + clock_t timeSatSat; // SAT solving (sat calls) + clock_t timeSatUnsat; // SAT solving (unsat calls) + clock_t timeSatSim; // SAT solving (simulation) + clock_t timeInt; // interpolation + clock_t timeUpd; // updating + clock_t timeTotal; // total runtime }; extern Hop_Obj_t * Kit_GraphToHop( Hop_Man_t * pMan, Kit_Graph_t * pGraph ); @@ -220,7 +220,7 @@ int Abc_NtkResynthesize( Abc_Ntk_t * pNtk, Res_Par_t * pPars ) Vec_Ptr_t * vFanins; unsigned * puTruth; int i, k, RetValue, nNodesOld, nFanins, nFaninsMax; - int clk, clkTotal = clock(); + clock_t clk, clkTotal = clock(); // start the manager p = Res_ManAlloc( pPars ); diff --git a/src/opt/res/resInt.h b/src/opt/res/resInt.h index cd0cf84b..f9709bf6 100644 --- a/src/opt/res/resInt.h +++ b/src/opt/res/resInt.h @@ -91,7 +91,7 @@ struct Res_Sim_t_ // resub candidates Vec_Vec_t * vCands; // resubstitution candidates // statistics - int timeSat; + clock_t timeSat; }; //////////////////////////////////////////////////////////////////////// diff --git a/src/opt/res/resSat.c b/src/opt/res/resSat.c index 111442b4..eec4012a 100644 --- a/src/opt/res/resSat.c +++ b/src/opt/res/resSat.c @@ -216,7 +216,7 @@ int Res_SatSimulate( Res_Sim_t * p, int nPatsLimit, int fOnSet ) sat_solver * pSat; int RetValue = -1; // Suppress "might be used uninitialized" int i, k, value, status, Lit, Var, iPat; - int clk = clock(); + clock_t clk = clock(); //printf( "Looking for %s: ", fOnSet? "onset " : "offset" ); diff --git a/src/opt/ret/retCore.c b/src/opt/ret/retCore.c index 1b574001..35d5f4d0 100644 --- a/src/opt/ret/retCore.c +++ b/src/opt/ret/retCore.c @@ -27,7 +27,7 @@ ABC_NAMESPACE_IMPL_START /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// -int timeRetime = 0; +clock_t timeRetime = 0; //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// @@ -48,7 +48,8 @@ int Abc_NtkRetime( Abc_Ntk_t * pNtk, int Mode, int nDelayLim, int fForwardOnly, { int nLatches = Abc_NtkLatchNum(pNtk); int nLevels = Abc_NtkLevel(pNtk); - int RetValue = 0, clkTotal = clock(); + int RetValue = 0; + clock_t clkTotal = clock(); int nNodesOld, nLatchesOld; assert( Mode > 0 && Mode < 7 ); assert( !fForwardOnly || !fBackwardOnly ); diff --git a/src/opt/ret/retFlow.c b/src/opt/ret/retFlow.c index f684939c..9b215dab 100644 --- a/src/opt/ret/retFlow.c +++ b/src/opt/ret/retFlow.c @@ -145,7 +145,7 @@ Vec_Ptr_t * Abc_NtkMaxFlow( Abc_Ntk_t * pNtk, int fForward, int fVerbose ) Vec_Ptr_t * vMinCut; Abc_Obj_t * pLatch; int Flow, FlowCur, RetValue, i; - int clk = clock(); + clock_t clk = clock(); int fUseDirectedFlow = 1; // find the max-flow diff --git a/src/opt/ret/retInit.c b/src/opt/ret/retInit.c index 44331e72..b3f6180a 100644 --- a/src/opt/ret/retInit.c +++ b/src/opt/ret/retInit.c @@ -48,7 +48,8 @@ Vec_Int_t * Abc_NtkRetimeInitialValues( Abc_Ntk_t * pNtkCone, Vec_Int_t * vValue { Vec_Int_t * vSolution; Abc_Ntk_t * pNtkMiter, * pNtkLogic; - int RetValue, clk; + int RetValue; + clock_t clk; if ( pNtkCone == NULL ) return Vec_IntDup( vValues ); // convert the target network to AIG diff --git a/src/opt/ret/retLvalue.c b/src/opt/ret/retLvalue.c index 95569867..5bcc2583 100644 --- a/src/opt/ret/retLvalue.c +++ b/src/opt/ret/retLvalue.c @@ -93,7 +93,8 @@ Vec_Int_t * Abc_NtkRetimeGetLags( Abc_Ntk_t * pNtk, int nIterLimit, int fVerbose Vec_Int_t * vLags; Vec_Ptr_t * vNodes, * vLatches; Abc_Obj_t * pNode; - int i, FiMax, FiBest, RetValue, clk, clkIter; + int i, FiMax, FiBest, RetValue; + clock_t clk, clkIter; char NodeLag; // get the upper bound on the clock period diff --git a/src/opt/rwr/rwr.h b/src/opt/rwr/rwr.h index 50ea7998..d6c57329 100644 --- a/src/opt/rwr/rwr.h +++ b/src/opt/rwr/rwr.h @@ -86,13 +86,13 @@ struct Rwr_Man_t_ int nCutsBad; int nSubgraphs; // runtime statistics - int timeStart; - int timeCut; - int timeRes; - int timeEval; - int timeMffc; - int timeUpdate; - int timeTotal; + clock_t timeStart; + clock_t timeCut; + clock_t timeRes; + clock_t timeEval; + clock_t timeMffc; + clock_t timeUpdate; + clock_t timeTotal; }; struct Rwr_Node_t_ // 24 bytes @@ -146,9 +146,9 @@ extern void Rwr_ManPrintStatsFile( Rwr_Man_t * p ); extern void * Rwr_ManReadDecs( Rwr_Man_t * p ); extern Vec_Ptr_t * Rwr_ManReadLeaves( Rwr_Man_t * p ); extern int Rwr_ManReadCompl( Rwr_Man_t * p ); -extern void Rwr_ManAddTimeCuts( Rwr_Man_t * p, int Time ); -extern void Rwr_ManAddTimeUpdate( Rwr_Man_t * p, int Time ); -extern void Rwr_ManAddTimeTotal( Rwr_Man_t * p, int Time ); +extern void Rwr_ManAddTimeCuts( Rwr_Man_t * p, clock_t Time ); +extern void Rwr_ManAddTimeUpdate( Rwr_Man_t * p, clock_t Time ); +extern void Rwr_ManAddTimeTotal( Rwr_Man_t * p, clock_t Time ); /*=== rwrPrint.c ========================================================*/ extern void Rwr_ManPrint( Rwr_Man_t * p ); /*=== rwrUtil.c ========================================================*/ diff --git a/src/opt/rwr/rwrEva.c b/src/opt/rwr/rwrEva.c index 83eb8d7b..d3d5143c 100644 --- a/src/opt/rwr/rwrEva.c +++ b/src/opt/rwr/rwrEva.c @@ -69,7 +69,7 @@ int Rwr_NodeRewrite( Rwr_Man_t * p, Cut_Man_t * pManCut, Abc_Obj_t * pNode, int int Required, nNodesSaved; int nNodesSaveCur = -1; // Suppress "might be used uninitialized" int i, GainCur, GainBest = -1; - int clk, clk2;//, Counter; + clock_t clk, clk2;//, Counter; p->nNodesConsidered++; // get the required times diff --git a/src/opt/rwr/rwrExp.c b/src/opt/rwr/rwrExp.c index c4664fbf..2e5bc536 100644 --- a/src/opt/rwr/rwrExp.c +++ b/src/opt/rwr/rwrExp.c @@ -226,7 +226,7 @@ void Rwt_Man5ExplorePrint() int * pDistrib; unsigned * pReprs; unsigned uTruth, uTruthC; - int clk = clock(); + clock_t clk = clock(); Vec_Int_t * vClassesNN, * vClassesNPN; // find the max number of occurences diff --git a/src/opt/rwr/rwrMan.c b/src/opt/rwr/rwrMan.c index 00273b38..78ee2067 100644 --- a/src/opt/rwr/rwrMan.c +++ b/src/opt/rwr/rwrMan.c @@ -48,7 +48,7 @@ Rwr_Man_t * Rwr_ManStart( int fPrecompute ) { Dec_Man_t * pManDec; Rwr_Man_t * p; - int clk = clock(); + clock_t clk = clock(); clk = clock(); p = ABC_ALLOC( Rwr_Man_t, 1 ); memset( p, 0, sizeof(Rwr_Man_t) ); @@ -258,7 +258,7 @@ int Rwr_ManReadCompl( Rwr_Man_t * p ) SeeAlso [] ***********************************************************************/ -void Rwr_ManAddTimeCuts( Rwr_Man_t * p, int Time ) +void Rwr_ManAddTimeCuts( Rwr_Man_t * p, clock_t Time ) { p->timeCut += Time; } @@ -274,7 +274,7 @@ void Rwr_ManAddTimeCuts( Rwr_Man_t * p, int Time ) SeeAlso [] ***********************************************************************/ -void Rwr_ManAddTimeUpdate( Rwr_Man_t * p, int Time ) +void Rwr_ManAddTimeUpdate( Rwr_Man_t * p, clock_t Time ) { p->timeUpdate += Time; } @@ -290,7 +290,7 @@ void Rwr_ManAddTimeUpdate( Rwr_Man_t * p, int Time ) SeeAlso [] ***********************************************************************/ -void Rwr_ManAddTimeTotal( Rwr_Man_t * p, int Time ) +void Rwr_ManAddTimeTotal( Rwr_Man_t * p, clock_t Time ) { p->timeTotal += Time; } diff --git a/src/opt/rwr/rwrUtil.c b/src/opt/rwr/rwrUtil.c index ac723588..97ddca3c 100644 --- a/src/opt/rwr/rwrUtil.c +++ b/src/opt/rwr/rwrUtil.c @@ -428,7 +428,8 @@ void Rwr_ManWriteToArray( Rwr_Man_t * p ) FILE * pFile; Rwr_Node_t * pNode; unsigned Entry0, Entry1; - int i, nEntries, clk = clock(); + int i, nEntries; + clock_t clk = clock(); // prepare the buffer nEntries = p->vForest->nSize - 5; pFile = fopen( "npn4_aig_array.txt", "w" ); @@ -474,7 +475,8 @@ void Rwr_ManLoadFromArray( Rwr_Man_t * p, int fVerbose ) Rwr_Node_t * p0, * p1; unsigned Entry0, Entry1; int Level, Volume, nEntries, fExor; - int i, clk = clock(); + int i; + clock_t clk = clock(); // reconstruct the forest for ( i = 0; ; i++ ) @@ -524,7 +526,8 @@ void Rwr_ManWriteToFile( Rwr_Man_t * p, char * pFileName ) FILE * pFile; Rwr_Node_t * pNode; unsigned * pBuffer; - int i, nEntries, clk = clock(); + int i, nEntries; + clock_t clk = clock(); // prepare the buffer nEntries = p->vForest->nSize - 5; pBuffer = ABC_ALLOC( unsigned, nEntries * 2 ); @@ -562,7 +565,8 @@ void Rwr_ManLoadFromFile( Rwr_Man_t * p, char * pFileName ) Rwr_Node_t * p0, * p1; unsigned * pBuffer; int Level, Volume, nEntries, fExor; - int i, clk = clock(); + int i; + clock_t clk = clock(); int RetValue; // load the data diff --git a/src/opt/rwt/rwt.h b/src/opt/rwt/rwt.h index a528a307..2e6de2cd 100644 --- a/src/opt/rwt/rwt.h +++ b/src/opt/rwt/rwt.h @@ -94,14 +94,14 @@ struct Rwt_Man_t_ int nCutsBad; int nSubgraphs; // runtime statistics - int timeStart; - int timeTruth; - int timeCut; - int timeRes; - int timeEval; - int timeMffc; - int timeUpdate; - int timeTotal; + clock_t timeStart; + clock_t timeTruth; + clock_t timeCut; + clock_t timeRes; + clock_t timeEval; + clock_t timeMffc; + clock_t timeUpdate; + clock_t timeTotal; }; struct Rwt_Node_t_ // 24 bytes @@ -142,9 +142,9 @@ extern void Rwt_ManPrintStatsFile( Rwt_Man_t * p ); extern void * Rwt_ManReadDecs( Rwt_Man_t * p ); extern Vec_Ptr_t * Rwt_ManReadLeaves( Rwt_Man_t * p ); extern int Rwt_ManReadCompl( Rwt_Man_t * p ); -extern void Rwt_ManAddTimeCuts( Rwt_Man_t * p, int Time ); -extern void Rwt_ManAddTimeUpdate( Rwt_Man_t * p, int Time ); -extern void Rwt_ManAddTimeTotal( Rwt_Man_t * p, int Time ); +extern void Rwt_ManAddTimeCuts( Rwt_Man_t * p, clock_t Time ); +extern void Rwt_ManAddTimeUpdate( Rwt_Man_t * p, clock_t Time ); +extern void Rwt_ManAddTimeTotal( Rwt_Man_t * p, clock_t Time ); /*=== rwrUtil.c ========================================================*/ extern void Rwt_ManLoadFromArray( Rwt_Man_t * p, int fVerbose ); extern char * Rwt_ManGetPractical( Rwt_Man_t * p ); diff --git a/src/opt/rwt/rwtMan.c b/src/opt/rwt/rwtMan.c index 775d3a88..17799407 100644 --- a/src/opt/rwt/rwtMan.c +++ b/src/opt/rwt/rwtMan.c @@ -87,7 +87,7 @@ void Rwt_ManGlobalStop() Rwt_Man_t * Rwt_ManStart( int fPrecompute ) { Rwt_Man_t * p; - int clk = clock(); + clock_t clk = clock(); clk = clock(); p = ABC_ALLOC( Rwt_Man_t, 1 ); memset( p, 0, sizeof(Rwt_Man_t) ); @@ -298,7 +298,7 @@ int Rwt_ManReadCompl( Rwt_Man_t * p ) SeeAlso [] ***********************************************************************/ -void Rwt_ManAddTimeCuts( Rwt_Man_t * p, int Time ) +void Rwt_ManAddTimeCuts( Rwt_Man_t * p, clock_t Time ) { p->timeCut += Time; } @@ -314,7 +314,7 @@ void Rwt_ManAddTimeCuts( Rwt_Man_t * p, int Time ) SeeAlso [] ***********************************************************************/ -void Rwt_ManAddTimeUpdate( Rwt_Man_t * p, int Time ) +void Rwt_ManAddTimeUpdate( Rwt_Man_t * p, clock_t Time ) { p->timeUpdate += Time; } @@ -330,7 +330,7 @@ void Rwt_ManAddTimeUpdate( Rwt_Man_t * p, int Time ) SeeAlso [] ***********************************************************************/ -void Rwt_ManAddTimeTotal( Rwt_Man_t * p, int Time ) +void Rwt_ManAddTimeTotal( Rwt_Man_t * p, clock_t Time ) { p->timeTotal += Time; } diff --git a/src/opt/rwt/rwtUtil.c b/src/opt/rwt/rwtUtil.c index 6cdaf657..d6011b20 100644 --- a/src/opt/rwt/rwtUtil.c +++ b/src/opt/rwt/rwtUtil.c @@ -592,7 +592,8 @@ void Rwt_ManLoadFromArray( Rwt_Man_t * p, int fVerbose ) Rwt_Node_t * p0, * p1; unsigned Entry0, Entry1; int Level, Volume, nEntries, fExor; - int i, clk = clock(); + int i; + clock_t clk = clock(); // reconstruct the forest for ( i = 0; ; i++ ) diff --git a/src/opt/sim/sim.h b/src/opt/sim/sim.h index 84b2ed51..93553a84 100644 --- a/src/opt/sim/sim.h +++ b/src/opt/sim/sim.h @@ -88,13 +88,13 @@ struct Sym_Man_t_ int nPairsRem; int nPairsTotal; // runtime statistics - int timeStruct; - int timeCount; - int timeMatr; - int timeSim; - int timeFraig; - int timeSat; - int timeTotal; + clock_t timeStruct; + clock_t timeCount; + clock_t timeMatr; + clock_t timeSim; + clock_t timeFraig; + clock_t timeSat; + clock_t timeTotal; }; typedef struct Sim_Man_t_ Sim_Man_t; @@ -126,11 +126,11 @@ struct Sim_Man_t_ int nSatRunsSat; int nSatRunsUnsat; // runtime statistics - int timeSim; - int timeTrav; - int timeFraig; - int timeSat; - int timeTotal; + clock_t timeSim; + clock_t timeTrav; + clock_t timeFraig; + clock_t timeSat; + clock_t timeTotal; }; typedef struct Sim_Pat_t_ Sim_Pat_t; diff --git a/src/opt/sim/simSupp.c b/src/opt/sim/simSupp.c index a7ceaee7..b383376e 100644 --- a/src/opt/sim/simSupp.c +++ b/src/opt/sim/simSupp.c @@ -104,7 +104,8 @@ Vec_Ptr_t * Sim_ComputeFunSupp( Abc_Ntk_t * pNtk, int fVerbose ) { Sim_Man_t * p; Vec_Ptr_t * vResult; - int nSolved, i, clk = clock(); + int nSolved, i; + clock_t clk = clock(); srand( 0xABC ); @@ -172,7 +173,7 @@ int Sim_ComputeSuppRound( Sim_Man_t * p, int fUseTargets ) { Vec_Int_t * vTargets; int i, Counter = 0; - int clk; + clock_t clk; // perform one round of random simulation clk = clock(); Sim_UtilSimulate( p, 0 ); @@ -209,7 +210,7 @@ int Sim_ComputeSuppRoundNode( Sim_Man_t * p, int iNumCi, int fUseTargets ) int i, k, v, Output, LuckyPat, fType0, fType1; int Counter = 0; int fFirst = 1; - int clk; + clock_t clk; // collect nodes by level in the TFO of the CI // this proceduredoes not collect the CIs and COs // but it increments TravId of the collected nodes and CIs/COs @@ -456,7 +457,7 @@ void Sim_SolveTargetsUsingSat( Sim_Man_t * p, int Limit ) int * pModel; int RetValue, Output, Input, k, v; int Counter = 0; - int clk; + clock_t clk; p->nSatRuns = 0; // put targets into one array diff --git a/src/opt/sim/simSym.c b/src/opt/sim/simSym.c index 801d4218..0367c2af 100644 --- a/src/opt/sim/simSym.c +++ b/src/opt/sim/simSym.c @@ -48,7 +48,8 @@ int Sim_ComputeTwoVarSymms( Abc_Ntk_t * pNtk, int fVerbose ) Sym_Man_t * p; Vec_Ptr_t * vResult; int Result; - int i, clk, clkTotal = clock(); + int i; + clock_t clk, clkTotal = clock(); srand( 0xABC ); diff --git a/src/opt/sim/simSymSat.c b/src/opt/sim/simSymSat.c index 2043e2d7..e252e0f4 100644 --- a/src/opt/sim/simSymSat.c +++ b/src/opt/sim/simSymSat.c @@ -137,7 +137,8 @@ int Sim_SymmsSatProveOne( Sym_Man_t * p, int Out, int Var1, int Var2, unsigned * Fraig_Params_t Params; Fraig_Man_t * pMan; Abc_Ntk_t * pMiter; - int RetValue, i, clk; + int RetValue, i; + clock_t clk; int * pModel; // get the miter for this problem diff --git a/src/opt/sim/simSymSim.c b/src/opt/sim/simSymSim.c index fddf602e..2c2a8a9e 100644 --- a/src/opt/sim/simSymSim.c +++ b/src/opt/sim/simSymSim.c @@ -50,7 +50,7 @@ void Sim_SymmsSimulate( Sym_Man_t * p, unsigned * pPat, Vec_Ptr_t * vMatrsNonSym { Abc_Obj_t * pNode; int i, nPairsTotal, nPairsSym, nPairsNonSym; - int clk; + clock_t clk; // create the simulation matrix Sim_SymmsCreateSquare( p, pPat ); diff --git a/src/opt/sim/simUtils.c b/src/opt/sim/simUtils.c index 77597e83..586fab42 100644 --- a/src/opt/sim/simUtils.c +++ b/src/opt/sim/simUtils.c @@ -633,7 +633,8 @@ int Sim_UtilCountPairsOnePrint( Extra_BitMat_t * pMat, Vec_Int_t * vSupport ) ***********************************************************************/ void Sim_UtilCountPairsAllPrint( Sym_Man_t * p ) { - int i, clk; + int i; + clock_t clk; clk = clock(); for ( i = 0; i < p->nOutputs; i++ ) { @@ -657,7 +658,8 @@ p->timeCount += clock() - clk; ***********************************************************************/ void Sim_UtilCountPairsAll( Sym_Man_t * p ) { - int nPairsTotal, nPairsSym, nPairsNonSym, i, clk; + int nPairsTotal, nPairsSym, nPairsNonSym, i; + clock_t clk; clk = clock(); p->nPairsSymm = 0; p->nPairsNonSymm = 0; diff --git a/src/proof/bbr/bbrCex.c b/src/proof/bbr/bbrCex.c index 7ee95e7c..60fef07c 100644 --- a/src/proof/bbr/bbrCex.c +++ b/src/proof/bbr/bbrCex.c @@ -55,7 +55,7 @@ Abc_Cex_t * Aig_ManVerifyUsingBddsCountExample( Aig_Man_t * p, DdManager * dd, DdNode * bTemp, * bVar, * bRing; int i, v, RetValue, nPiOffset; char * pValues; - int clk = clock(); + clock_t clk = clock(); //printf( "\nDeriving counter-example.\n" ); // allocate room for the counter-example diff --git a/src/proof/bbr/bbrReach.c b/src/proof/bbr/bbrReach.c index 1cce1a90..19d87bc2 100644 --- a/src/proof/bbr/bbrReach.c +++ b/src/proof/bbr/bbrReach.c @@ -246,7 +246,8 @@ int Aig_ManComputeReachable( DdManager * dd, Aig_Man_t * p, DdNode ** pbParts, D DdNode * bTemp; Cudd_ReorderingType method; int i, nIters, nBddSize = 0, status; - int nThreshold = 10000, clk = clock(); + int nThreshold = 10000; + clock_t clk = clock(); Vec_Ptr_t * vOnionRings; status = Cudd_ReorderingStatus( dd, &method ); @@ -280,7 +281,7 @@ int Aig_ManComputeReachable( DdManager * dd, Aig_Man_t * p, DdNode ** pbParts, D for ( nIters = 0; nIters < pPars->nIterMax; nIters++ ) { // check the runtime limit - if ( pPars->TimeLimit && ((float)pPars->TimeLimit <= (float)(clock()-clk)/(float)(CLOCKS_PER_SEC)) ) + if ( pPars->TimeLimit && pPars->TimeLimit <= (clock()-clk)/CLOCKS_PER_SEC ) { printf( "Reached timeout after image computation (%d seconds).\n", pPars->TimeLimit ); Vec_PtrFree( vOnionRings ); @@ -433,7 +434,8 @@ int Aig_ManVerifyUsingBdds_int( Aig_Man_t * p, Saig_ParBbr_t * pPars ) DdManager * dd; DdNode ** pbParts, ** pbOutputs; DdNode * bInitial, * bTemp; - int RetValue, i, clk = clock(); + int RetValue, i; + clock_t clk = clock(); Vec_Ptr_t * vOnionRings; assert( Saig_ManRegNum(p) > 0 ); @@ -450,7 +452,7 @@ int Aig_ManVerifyUsingBdds_int( Aig_Man_t * p, Saig_ParBbr_t * pPars ) printf( "Shared BDD size is %6d nodes.\n", Cudd_ReadKeys(dd) - Cudd_ReadDead(dd) ); // check the runtime limit - if ( pPars->TimeLimit && ((float)pPars->TimeLimit <= (float)(clock()-clk)/(float)(CLOCKS_PER_SEC)) ) + if ( pPars->TimeLimit && pPars->TimeLimit <= (clock()-clk)/CLOCKS_PER_SEC ) { printf( "Reached timeout after constructing global BDDs (%d seconds).\n", pPars->TimeLimit ); Cudd_Quit( dd ); diff --git a/src/proof/cec/cecCec.c b/src/proof/cec/cecCec.c index b9b3e1f1..841b6a0b 100644 --- a/src/proof/cec/cecCec.c +++ b/src/proof/cec/cecCec.c @@ -72,7 +72,8 @@ int Cec_ManVerifyOld( Gia_Man_t * pMiter, int fVerbose, int * piOutFail ) extern int Ssw_SecCexResimulate( Aig_Man_t * p, int * pModel, int * pnOutputs ); Gia_Man_t * pTemp = Gia_ManTransformMiter( pMiter ); Aig_Man_t * pMiterCec = Gia_ManToAig( pTemp, 0 ); - int RetValue, iOut, nOuts, clkTotal = clock(); + int RetValue, iOut, nOuts; + clock_t clkTotal = clock(); if ( piOutFail ) *piOutFail = -1; Gia_ManStop( pTemp ); @@ -134,7 +135,8 @@ int Cec_ManHandleSpecialCases( Gia_Man_t * p, Cec_ParCec_t * pPars ) { Gia_Obj_t * pObj1, * pObj2; Gia_Obj_t * pDri1, * pDri2; - int i, clk = clock(); + int i; + clock_t clk = clock(); Gia_ManSetPhase( p ); Gia_ManForEachPo( p, pObj1, i ) { @@ -206,8 +208,9 @@ int Cec_ManVerify( Gia_Man_t * pInit, Cec_ParCec_t * pPars ) int fDumpUndecided = 0; Cec_ParFra_t ParsFra, * pParsFra = &ParsFra; Gia_Man_t * p, * pNew; - int RetValue, clk = clock(); - double clkTotal = clock(); + int RetValue; + clock_t clk = clock(); + clock_t clkTotal = clock(); // consider special cases: // 1) (SAT) a pair of POs have different value under all-0 pattern // 2) (SAT) a pair of POs has different PI/Const drivers @@ -263,7 +266,7 @@ int Cec_ManVerify( Gia_Man_t * pInit, Cec_ParCec_t * pPars ) Gia_WriteAiger( pNew, "gia_cec_undecided.aig", 0, 0 ); Abc_Print( 1, "The result is written into file \"%s\".\n", "gia_cec_undecided.aig" ); } - if ( pPars->TimeLimit && ((double)clock() - clkTotal)/CLOCKS_PER_SEC >= pPars->TimeLimit ) + if ( pPars->TimeLimit && (clock() - clkTotal)/CLOCKS_PER_SEC >= pPars->TimeLimit ) { Gia_ManStop( pNew ); return -1; diff --git a/src/proof/cec/cecChoice.c b/src/proof/cec/cecChoice.c index 3ddb975e..05b372f8 100644 --- a/src/proof/cec/cecChoice.c +++ b/src/proof/cec/cecChoice.c @@ -208,8 +208,8 @@ int Cec_ManChoiceComputation_int( Gia_Man_t * pAig, Cec_ParChc_t * pPars ) Cec_ManSim_t * pSim; Gia_Man_t * pSrm; int r, RetValue; - int clkSat = 0, clkSim = 0, clkSrm = 0, clkTotal = clock(); - int clk2, clk = clock(); + clock_t clkSat = 0, clkSim = 0, clkSrm = 0, clkTotal = clock(); + clock_t clk2, clk = clock(); ABC_FREE( pAig->pReprs ); ABC_FREE( pAig->pNexts ); Gia_ManRandom( 1 ); diff --git a/src/proof/cec/cecCore.c b/src/proof/cec/cecCore.c index 65c4b970..71519323 100644 --- a/src/proof/cec/cecCore.c +++ b/src/proof/cec/cecCore.c @@ -257,7 +257,8 @@ Gia_Man_t * Cec_ManSatSolving( Gia_Man_t * pAig, Cec_ParSat_t * pPars ) int Cec_ManSimulationOne( Gia_Man_t * pAig, Cec_ParSim_t * pPars ) { Cec_ManSim_t * pSim; - int RetValue = 0, clkTotal = clock(); + int RetValue = 0; + clock_t clkTotal = clock(); pSim = Cec_ManSimStart( pAig, pPars ); if ( (pAig->pReprs == NULL && (RetValue = Cec_ManSimClassesPrepare( pSim, -1 ))) || (RetValue == 0 && (RetValue = Cec_ManSimClassesRefine( pSim ))) ) @@ -342,8 +343,8 @@ Gia_Man_t * Cec_ManSatSweeping( Gia_Man_t * pAig, Cec_ParFra_t * pPars ) Cec_ManFra_t * p; Cec_ManSim_t * pSim; Cec_ManPat_t * pPat; - int i, fTimeOut = 0, nMatches = 0, clk, clk2; - double clkTotal = clock(); + int i, fTimeOut = 0, nMatches = 0; + clock_t clk, clk2, clkTotal = clock(); // duplicate AIG and transfer equivalence classes Gia_ManRandom( 1 ); @@ -457,7 +458,7 @@ p->timeSat += clock() - clk; break; } // check resource limits - if ( p->pPars->TimeLimit && ((double)clock() - clkTotal)/CLOCKS_PER_SEC >= p->pPars->TimeLimit ) + if ( p->pPars->TimeLimit && (clock() - clkTotal)/CLOCKS_PER_SEC >= p->pPars->TimeLimit ) { fTimeOut = 1; break; diff --git a/src/proof/cec/cecCorr.c b/src/proof/cec/cecCorr.c index d080dfea..e8b25b48 100644 --- a/src/proof/cec/cecCorr.c +++ b/src/proof/cec/cecCorr.c @@ -719,7 +719,7 @@ Gia_Man_t * Gia_ManCorrReduce( Gia_Man_t * p ) SeeAlso [] ***********************************************************************/ -void Cec_ManRefinedClassPrintStats( Gia_Man_t * p, Vec_Str_t * vStatus, int iIter, int Time ) +void Cec_ManRefinedClassPrintStats( Gia_Man_t * p, Vec_Str_t * vStatus, int iIter, clock_t Time ) { int nLits, CounterX = 0, Counter0 = 0, Counter = 0; int i, Entry, nProve = 0, nDispr = 0, nFail = 0; @@ -789,7 +789,7 @@ void Cec_ManLSCorrespondenceBmc( Gia_Man_t * pAig, Cec_ParCor_t * pPars, int nPr fChanges = 1; while ( fChanges ) { - int clkBmc = clock(); + clock_t clkBmc = clock(); fChanges = 0; pSrm = Gia_ManCorrSpecReduceInit( pAig, pPars->nFrames, nPrefs, !pPars->fLatchCorr, &vOutputs, pPars->fUseRings ); if ( Gia_ManPoNum(pSrm) == 0 ) @@ -844,9 +844,10 @@ int Cec_ManLSCorrespondenceClasses( Gia_Man_t * pAig, Cec_ParCor_t * pPars ) Cec_ParSat_t ParsSat, * pParsSat = &ParsSat; Cec_ManSim_t * pSim; Gia_Man_t * pSrm; - int r, RetValue, clkTotal = clock(); - int clkSat = 0, clkSim = 0, clkSrm = 0; - int clk2, clk = clock(); + int r, RetValue; + clock_t clkTotal = clock(); + clock_t clkSat = 0, clkSim = 0, clkSrm = 0; + clock_t clk2, clk = clock(); if ( Gia_ManRegNum(pAig) == 0 ) { Abc_Print( 1, "Cec_ManLatchCorrespondence(): Not a sequential AIG.\n" ); diff --git a/src/proof/cec/cecCorr_updated.c b/src/proof/cec/cecCorr_updated.c index 1db30705..3bea8dbf 100644 --- a/src/proof/cec/cecCorr_updated.c +++ b/src/proof/cec/cecCorr_updated.c @@ -728,7 +728,7 @@ Gia_Man_t * Gia_ManCorrReduce( Gia_Man_t * p ) SeeAlso [] ***********************************************************************/ -void Cec_ManRefinedClassPrintStats( Gia_Man_t * p, Vec_Str_t * vStatus, int iIter, int Time ) +void Cec_ManRefinedClassPrintStats( Gia_Man_t * p, Vec_Str_t * vStatus, int iIter, clock_t Time ) { int nLits, CounterX = 0, Counter0 = 0, Counter = 0; int i, Entry, nProve = 0, nDispr = 0, nFail = 0; diff --git a/src/proof/cec/cecInt.h b/src/proof/cec/cecInt.h index 371dedda..8d9fe472 100644 --- a/src/proof/cec/cecInt.h +++ b/src/proof/cec/cecInt.h @@ -61,13 +61,13 @@ struct Cec_ManPat_t_ int nSeries; // simulation series int fVerbose; // verbose stats // runtime statistics - int timeFind; // detecting the pattern - int timeShrink; // minimizing the pattern - int timeVerify; // verifying the result of minimisation - int timeSort; // sorting literals - int timePack; // packing into sim info structures - int timeTotal; // total runtime - int timeTotalSave; // total runtime for saving + clock_t timeFind; // detecting the pattern + clock_t timeShrink; // minimizing the pattern + clock_t timeVerify; // verifying the result of minimisation + clock_t timeSort; // sorting literals + clock_t timePack; // packing into sim info structures + clock_t timeTotal; // total runtime + clock_t timeTotalSave; // total runtime for saving }; // SAT solving manager @@ -154,10 +154,10 @@ struct Cec_ManFra_t_ int nAllDisproved; // total number of disproved nodes int nAllFailed; // total number of failed nodes // runtime stats - int timeSim; // unsat - int timePat; // unsat - int timeSat; // sat - int timeTotal; // total runtime + clock_t timeSim; // unsat + clock_t timePat; // unsat + clock_t timeSat; // sat + clock_t timeTotal; // total runtime }; //////////////////////////////////////////////////////////////////////// @@ -169,7 +169,7 @@ struct Cec_ManFra_t_ //////////////////////////////////////////////////////////////////////// /*=== cecCorr.c ============================================================*/ -extern void Cec_ManRefinedClassPrintStats( Gia_Man_t * p, Vec_Str_t * vStatus, int iIter, int Time ); +extern void Cec_ManRefinedClassPrintStats( Gia_Man_t * p, Vec_Str_t * vStatus, int iIter, clock_t Time ); /*=== cecClass.c ============================================================*/ extern int Cec_ManSimClassRemoveOne( Cec_ManSim_t * p, int i ); extern int Cec_ManSimClassesPrepare( Cec_ManSim_t * p, int LevelMax ); diff --git a/src/proof/cec/cecPat.c b/src/proof/cec/cecPat.c index cb1dae46..f372f3bb 100644 --- a/src/proof/cec/cecPat.c +++ b/src/proof/cec/cecPat.c @@ -359,7 +359,8 @@ void Cec_ManPatCleanMark0( Gia_Man_t * p, Gia_Obj_t * pObj ) void Cec_ManPatSavePattern( Cec_ManPat_t * pMan, Cec_ManSat_t * p, Gia_Obj_t * pObj ) { Vec_Int_t * vPat; - int nPatLits, clk, clkTotal = clock(); + int nPatLits; + clock_t clk, clkTotal = clock(); assert( Gia_ObjIsCo(pObj) ); pMan->nPats++; pMan->nPatsAll++; @@ -451,7 +452,7 @@ Vec_Ptr_t * Cec_ManPatCollectPatterns( Cec_ManPat_t * pMan, int nInputs, int nW int iStartOld = pMan->iStart; int nWords = nWordsInit; int nBits = 32 * nWords; - int clk = clock(); + clock_t clk = clock(); vInfo = Vec_PtrAllocSimInfo( nInputs, nWords ); Gia_ManRandomInfo( vInfo, 0, 0, nWords ); vPres = Vec_PtrAllocSimInfo( nInputs, nWords ); diff --git a/src/proof/cec/cecSeq.c b/src/proof/cec/cecSeq.c index 2ccbe524..3afbd1c8 100644 --- a/src/proof/cec/cecSeq.c +++ b/src/proof/cec/cecSeq.c @@ -215,7 +215,8 @@ int Cec_ManSeqResimulateInfo( Gia_Man_t * pAig, Vec_Ptr_t * vSimInfo, Abc_Cex_t int Cec_ManSeqResimulateCounter( Gia_Man_t * pAig, Cec_ParSim_t * pPars, Abc_Cex_t * pCex ) { Vec_Ptr_t * vSimInfo; - int RetValue, clkTotal = clock(); + int RetValue; + clock_t clkTotal = clock(); if ( pCex == NULL ) { Abc_Print( 1, "Cec_ManSeqResimulateCounter(): Counter-example is not available.\n" ); diff --git a/src/proof/cec/cecSolve.c b/src/proof/cec/cecSolve.c index e779e68c..5e108ae5 100644 --- a/src/proof/cec/cecSolve.c +++ b/src/proof/cec/cecSolve.c @@ -471,7 +471,8 @@ int Cec_ManSatCheckNode( Cec_ManSat_t * p, Gia_Obj_t * pObj ) { Gia_Obj_t * pObjR = Gia_Regular(pObj); int nBTLimit = p->pPars->nBTLimit; - int Lit, RetValue, status, clk, clk2, nConflicts; + int Lit, RetValue, status, nConflicts; + clock_t clk, clk2; if ( pObj == Gia_ManConst0(p->pAig) ) return 1; @@ -570,7 +571,8 @@ int Cec_ManSatCheckNodeTwo( Cec_ManSat_t * p, Gia_Obj_t * pObj1, Gia_Obj_t * pOb Gia_Obj_t * pObjR1 = Gia_Regular(pObj1); Gia_Obj_t * pObjR2 = Gia_Regular(pObj2); int nBTLimit = p->pPars->nBTLimit; - int Lits[2], RetValue, status, clk, clk2, nConflicts; + int Lits[2], RetValue, status, nConflicts; + clock_t clk, clk2; if ( pObj1 == Gia_ManConst0(p->pAig) || pObj2 == Gia_ManConst0(p->pAig) || pObj1 == Gia_Not(pObj2) ) return 1; @@ -676,7 +678,8 @@ void Cec_ManSatSolve( Cec_ManPat_t * pPat, Gia_Man_t * pAig, Cec_ParSat_t * pPar Bar_Progress_t * pProgress = NULL; Cec_ManSat_t * p; Gia_Obj_t * pObj; - int i, status, clk = clock(), clk2; + int i, status; + clock_t clk = clock(), clk2; // reset the manager if ( pPat ) { @@ -717,7 +720,7 @@ clk2 = clock(); // save the pattern if ( pPat ) { - int clk3 = clock(); + clock_t clk3 = clock(); Cec_ManPatSavePattern( pPat, p, pObj ); pPat->timeTotalSave += clock() - clk3; } @@ -799,7 +802,8 @@ Vec_Str_t * Cec_ManSatSolveSeq( Vec_Ptr_t * vPatts, Gia_Man_t * pAig, Cec_ParSat Cec_ManSat_t * p; Gia_Obj_t * pObj; int iPat = 0, nPatsInit, nPats; - int i, status, clk = clock(); + int i, status; + clock_t clk = clock(); nPatsInit = nPats = 32 * Vec_PtrReadWordsSimInfo(vPatts); Gia_ManSetPhase( pAig ); Gia_ManLevelNum( pAig ); @@ -957,7 +961,8 @@ Vec_Int_t * Cec_ManSatSolveMiter( Gia_Man_t * pAig, Cec_ParSat_t * pPars, Vec_St Vec_Str_t * vStatus; Cec_ManSat_t * p; Gia_Obj_t * pObj; - int i, status, clk = clock(); + int i, status; + clock_t clk = clock(); // prepare AIG Gia_ManSetPhase( pAig ); Gia_ManLevelNum( pAig ); diff --git a/src/proof/cec/cecSweep.c b/src/proof/cec/cecSweep.c index 4523810e..505de076 100644 --- a/src/proof/cec/cecSweep.c +++ b/src/proof/cec/cecSweep.c @@ -188,7 +188,8 @@ int Cec_ManFraClassesUpdate( Cec_ManFra_t * p, Cec_ManSim_t * pSim, Cec_ManPat_t { Vec_Ptr_t * vInfo; Gia_Obj_t * pObj, * pObjOld, * pReprOld; - int i, k, iRepr, iNode, clk; + int i, k, iRepr, iNode; + clock_t clk; clk = clock(); vInfo = Cec_ManPatCollectPatterns( pPat, Gia_ManCiNum(p->pAig), pSim->nWords ); p->timePat += clock() - clk; diff --git a/src/proof/cec/cecSynth.c b/src/proof/cec/cecSynth.c index 21470dd4..b13b5204 100644 --- a/src/proof/cec/cecSynth.c +++ b/src/proof/cec/cecSynth.c @@ -297,7 +297,8 @@ int Cec_SequentialSynthesisPart( Gia_Man_t * p, Cec_ParSeq_t * pPars ) Vec_Int_t * vPart; int * pMapBack, * pReprs; int i, nCountPis, nCountRegs; - int nClasses, clk = clock(); + int nClasses; + clock_t clk = clock(); // save parameters if ( fPrintParts ) diff --git a/src/proof/dch/dch.h b/src/proof/dch/dch.h index 731eb776..ff29f0da 100644 --- a/src/proof/dch/dch.h +++ b/src/proof/dch/dch.h @@ -54,7 +54,7 @@ struct Dch_Pars_t_ int fUseCSat; // uses circuit-based solver int fLightSynth; // uses lighter version of synthesis int fVerbose; // verbose stats - int timeSynth; // synthesis runtime + clock_t timeSynth; // synthesis runtime int nNodesAhead; // the lookahead in terms of nodes int nCallsRecycle; // calls to perform before recycling SAT solver }; diff --git a/src/proof/dch/dchCore.c b/src/proof/dch/dchCore.c index bc78682b..bfef8d8c 100644 --- a/src/proof/dch/dchCore.c +++ b/src/proof/dch/dchCore.c @@ -89,7 +89,7 @@ Aig_Man_t * Dch_ComputeChoices( Aig_Man_t * pAig, Dch_Pars_t * pPars ) { Dch_Man_t * p; Aig_Man_t * pResult; - int clk, clkTotal = clock(); + clock_t clk, clkTotal = clock(); // reset random numbers Aig_ManRandom(1); // start the choicing manager @@ -131,7 +131,7 @@ p->timeTotal = clock() - clkTotal; void Dch_ComputeEquivalences( Aig_Man_t * pAig, Dch_Pars_t * pPars ) { Dch_Man_t * p; - int clk, clkTotal = clock(); + clock_t clk, clkTotal = clock(); // reset random numbers Aig_ManRandom(1); // start the choicing manager diff --git a/src/proof/dch/dchInt.h b/src/proof/dch/dchInt.h index c9f2f4f6..b22834cf 100644 --- a/src/proof/dch/dchInt.h +++ b/src/proof/dch/dchInt.h @@ -84,15 +84,15 @@ struct Dch_Man_t_ int nEquivs; // the number of final equivalences int nChoices; // the number of final choice nodes // runtime stats - int timeSimInit; // simulation and class computation - int timeSimSat; // simulation of the counter-examples - int timeSat; // solving SAT - int timeSatSat; // sat - int timeSatUnsat; // unsat - int timeSatUndec; // undecided - int timeChoice; // choice computation - int timeOther; // other runtime - int timeTotal; // total runtime + clock_t timeSimInit; // simulation and class computation + clock_t timeSimSat; // simulation of the counter-examples + clock_t timeSat; // solving SAT + clock_t timeSatSat; // sat + clock_t timeSatUnsat; // unsat + clock_t timeSatUndec; // undecided + clock_t timeChoice; // choice computation + clock_t timeOther; // other runtime + clock_t timeTotal; // total runtime }; //////////////////////////////////////////////////////////////////////// diff --git a/src/proof/dch/dchSat.c b/src/proof/dch/dchSat.c index f5e346ef..fefd5ce2 100644 --- a/src/proof/dch/dchSat.c +++ b/src/proof/dch/dchSat.c @@ -45,7 +45,8 @@ ABC_NAMESPACE_IMPL_START int Dch_NodesAreEquiv( Dch_Man_t * p, Aig_Obj_t * pOld, Aig_Obj_t * pNew ) { int nBTLimit = p->pPars->nBTLimit; - int pLits[2], RetValue, RetValue1, status, clk; + int pLits[2], RetValue, RetValue1, status; + clock_t clk; p->nSatCalls++; // sanity checks diff --git a/src/proof/dch/dchSimSat.c b/src/proof/dch/dchSimSat.c index 6f69b47e..26de4643 100644 --- a/src/proof/dch/dchSimSat.c +++ b/src/proof/dch/dchSimSat.c @@ -177,7 +177,8 @@ void Dch_ManResimulateOther_rec( Dch_Man_t * p, Aig_Obj_t * pObj ) void Dch_ManResimulateCex( Dch_Man_t * p, Aig_Obj_t * pObj, Aig_Obj_t * pRepr ) { Aig_Obj_t * pRoot, ** ppClass; - int i, k, nSize, RetValue1, RetValue2, clk = clock(); + int i, k, nSize, RetValue1, RetValue2; + clock_t clk = clock(); // get the equivalence classes Dch_ManCollectTfoCands( p, pObj, pRepr ); // resimulate the cone of influence of the solved nodes @@ -224,7 +225,8 @@ p->timeSimSat += clock() - clk; void Dch_ManResimulateCex2( Dch_Man_t * p, Aig_Obj_t * pObj, Aig_Obj_t * pRepr ) { Aig_Obj_t * pRoot; - int i, RetValue, clk = clock(); + int i, RetValue; + clock_t clk = clock(); // get the equivalence class if ( Dch_ObjIsConst1Cand(p->pAigTotal, pObj) ) Dch_ClassesCollectConst1Group( p->ppClasses, pObj, 500, p->vSimRoots ); diff --git a/src/proof/fra/fra.h b/src/proof/fra/fra.h index 3e50ff57..c1dd6b44 100644 --- a/src/proof/fra/fra.h +++ b/src/proof/fra/fra.h @@ -30,7 +30,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/vec/vec.h" #include "src/aig/aig/aig.h" @@ -238,17 +237,17 @@ struct Fra_Man_t_ int nSatCallsRecent; int nSatCallsSkipped; // runtime - int timeSim; - int timeTrav; - int timeRwr; - int timeSat; - int timeSatUnsat; - int timeSatSat; - int timeSatFail; - int timeRef; - int timeTotal; - int time1; - int time2; + clock_t timeSim; + clock_t timeTrav; + clock_t timeRwr; + clock_t timeSat; + clock_t timeSatUnsat; + clock_t timeSatSat; + clock_t timeSatFail; + clock_t timeRef; + clock_t timeTotal; + clock_t time1; + clock_t time2; }; //////////////////////////////////////////////////////////////////////// diff --git a/src/proof/fra/fraBmc.c b/src/proof/fra/fraBmc.c index 2ddecf48..4b68a79a 100644 --- a/src/proof/fra/fraBmc.c +++ b/src/proof/fra/fraBmc.c @@ -311,7 +311,8 @@ Aig_Man_t * Fra_BmcFrames( Fra_Bmc_t * p, int fKeepPos ) void Fra_BmcPerform( Fra_Man_t * p, int nPref, int nDepth ) { Aig_Obj_t * pObj; - int i, nImpsOld = 0, clk = clock(); + int i, nImpsOld = 0; + clock_t clk = clock(); assert( p->pBmc == NULL ); // derive and fraig the frames p->pBmc = Fra_BmcStart( p->pManAig, nPref, nDepth ); @@ -385,7 +386,8 @@ void Fra_BmcPerformSimple( Aig_Man_t * pAig, int nFrames, int nBTLimit, int fRew Fra_Man_t * pTemp; Fra_Bmc_t * pBmc; Aig_Man_t * pAigTemp; - int clk, iOutput; + clock_t clk; + int iOutput; // derive and fraig the frames clk = clock(); pBmc = Fra_BmcStart( pAig, 0, nFrames ); diff --git a/src/proof/fra/fraCec.c b/src/proof/fra/fraCec.c index 0acca245..20805ec2 100644 --- a/src/proof/fra/fraCec.c +++ b/src/proof/fra/fraCec.c @@ -53,7 +53,8 @@ int Fra_FraigSat( Aig_Man_t * pMan, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimi sat_solver2 * pSat; Cnf_Dat_t * pCnf; - int status, RetValue, clk = clock(); + int status, RetValue; + clock_t clk = clock(); Vec_Int_t * vCiIds; assert( Aig_ManRegNum(pMan) == 0 ); @@ -159,7 +160,8 @@ int Fra_FraigSat( Aig_Man_t * pMan, ABC_INT64_T nConfLimit, ABC_INT64_T nInsLimi { sat_solver * pSat; Cnf_Dat_t * pCnf; - int status, RetValue, clk = clock(); + int status, RetValue; + clock_t clk = clock(); Vec_Int_t * vCiIds; assert( Aig_ManRegNum(pMan) == 0 ); @@ -282,7 +284,8 @@ int Fra_FraigCec( Aig_Man_t ** ppAig, int nConfLimit, int fVerbose ) Fra_Par_t Params, * pParams = &Params; Aig_Man_t * pAig = *ppAig, * pTemp; - int i, RetValue, clk; + int i, RetValue; + clock_t clk; // report the original miter if ( fVerbose ) @@ -457,7 +460,8 @@ int Fra_FraigCecTop( Aig_Man_t * pMan1, Aig_Man_t * pMan2, int nConfLimit, int n { Aig_Man_t * pTemp; //Abc_NtkDarCec( pNtk1, pNtk2, fPartition, fVerbose ); - int RetValue, clkTotal = clock(); + int RetValue; + clock_t clkTotal = clock(); if ( Aig_ManCiNum(pMan1) != Aig_ManCiNum(pMan1) ) { diff --git a/src/proof/fra/fraClaus.c b/src/proof/fra/fraClaus.c index f651b0ad..97ac3e40 100644 --- a/src/proof/fra/fraClaus.c +++ b/src/proof/fra/fraClaus.c @@ -605,7 +605,8 @@ int Fra_ClausProcessClauses( Clu_Man_t * p, int fRefs ) Fra_Sml_t * pComb, * pSeq; Aig_Obj_t * pObj; Dar_Cut_t * pCut; - int Scores[16], uScores, i, k, j, clk, nCuts = 0; + int Scores[16], uScores, i, k, j, nCuts = 0; + clock_t clk; // simulate the AIG clk = clock(); @@ -727,7 +728,8 @@ int Fra_ClausProcessClauses2( Clu_Man_t * p, int fRefs ) Fra_Sml_t * pComb, * pSeq; Aig_Obj_t * pObj; Aig_Cut_t * pCut; - int i, k, j, clk, nCuts = 0; + int i, k, j, nCuts = 0; + clock_t clk; int ScoresSeq[1<<12], ScoresComb[1<<12]; assert( p->nLutSize < 13 ); @@ -1622,7 +1624,7 @@ void Fra_ClausEstimateCoverage( Clu_Man_t * p ) unsigned * pResultTot, * pResultOne; int nCovered, Beg, End, i, w; int * pStart, * pVar2Id; - int clk = clock(); + clock_t clk = clock(); // simulate the circuit with nCombSimWords * 32 = 64K patterns // srand( 0xAABBAABB ); Aig_ManRandom(1); @@ -1680,7 +1682,7 @@ void Fra_ClausEstimateCoverage( Clu_Man_t * p ) int Fra_Claus( Aig_Man_t * pAig, int nFrames, int nPref, int nClausesMax, int nLutSize, int nLevels, int nCutsMax, int nBatches, int fStepUp, int fBmc, int fRefs, int fTarget, int fVerbose, int fVeryVerbose ) { Clu_Man_t * p; - int clk, clkTotal = clock(), clkInd; + clock_t clk, clkTotal = clock(), clkInd; int b, Iter, Counter, nPrefOld; int nClausesBeg = 0; diff --git a/src/proof/fra/fraCore.c b/src/proof/fra/fraCore.c index 37aaa0da..35888f43 100644 --- a/src/proof/fra/fraCore.c +++ b/src/proof/fra/fraCore.c @@ -376,7 +376,7 @@ Aig_Man_t * Fra_FraigPerform( Aig_Man_t * pManAig, Fra_Par_t * pPars ) { Fra_Man_t * p; Aig_Man_t * pManAigNew; - int clk; + clock_t clk; if ( Aig_ManNodeNum(pManAig) == 0 ) return Aig_ManDupOrdered(pManAig); clk = clock(); @@ -402,7 +402,7 @@ Fra_ClassesPrint( p->pCla, 1 ); Fra_ManFinalizeComb( p ); if ( p->pPars->fChoicing ) { -int clk2 = clock(); +clock_t clk2 = clock(); Fra_ClassesCopyReprs( p->pCla, p->vTimeouts ); pManAigNew = Aig_ManDupRepr( p->pManAig, 1 ); Aig_ManReprStart( pManAigNew, Aig_ManObjNumMax(pManAigNew) ); diff --git a/src/proof/fra/fraHot.c b/src/proof/fra/fraHot.c index 338b5717..a91c939f 100644 --- a/src/proof/fra/fraHot.c +++ b/src/proof/fra/fraHot.c @@ -332,7 +332,7 @@ void Fra_OneHotEstimateCoverage( Fra_Man_t * p, Vec_Int_t * vOneHots ) Vec_Ptr_t * vSimInfo; unsigned * pSim1, * pSim2, * pSimTot; int i, w, Out1, Out2, nCovered, Counter = 0; - int clk = clock(); + clock_t clk = clock(); // generate random sim-info at register outputs vSimInfo = Vec_PtrAllocSimInfo( nRegs + 1, nSimWords ); diff --git a/src/proof/fra/fraImp.c b/src/proof/fra/fraImp.c index f65aca5c..4d33717a 100644 --- a/src/proof/fra/fraImp.c +++ b/src/proof/fra/fraImp.c @@ -327,7 +327,8 @@ Vec_Int_t * Fra_ImpDerive( Fra_Man_t * p, int nImpMaxLimit, int nImpUseLimit, in int * pImpCosts, * pNodesI, * pNodesK; int nImpsTotal = 0, nImpsTried = 0, nImpsNonSeq = 0, nImpsComb = 0, nImpsCollected = 0; int CostMin = ABC_INFINITY, CostMax = 0; - int i, k, Imp, CostRange, clk = clock(); + int i, k, Imp, CostRange; + clock_t clk = clock(); assert( Aig_ManObjNumMax(p->pManAig) < (1 << 15) ); assert( nImpMaxLimit > 0 && nImpUseLimit > 0 && nImpUseLimit <= nImpMaxLimit ); // normalize both managers diff --git a/src/proof/fra/fraInd.c b/src/proof/fra/fraInd.c index 29a76eea..633f8979 100644 --- a/src/proof/fra/fraInd.c +++ b/src/proof/fra/fraInd.c @@ -49,7 +49,8 @@ void Fra_FraigInductionRewrite( Fra_Man_t * p ) { Aig_Man_t * pTemp; Aig_Obj_t * pObj, * pObjPo; - int nTruePis, k, i, clk = clock(); + int nTruePis, k, i; + clock_t clk = clock(); // perform AIG rewriting on the speculated frames // pTemp = Dar_ManRwsat( pTemp, 1, 0 ); pTemp = Dar_ManRewriteDefault( p->pManFraig ); @@ -259,7 +260,7 @@ Aig_Man_t * Fra_FraigInductionPart( Aig_Man_t * pAig, Fra_Ssw_t * pPars ) int * pMapBack; int i, nCountPis, nCountRegs; int nClasses, nPartSize, fVerbose; - int clk = clock(); + clock_t clk = clock(); // save parameters nPartSize = pPars->nPartSize; pPars->nPartSize = 0; @@ -357,8 +358,9 @@ Aig_Man_t * Fra_FraigInduction( Aig_Man_t * pManAig, Fra_Ssw_t * pParams ) Aig_Man_t * pManAigNew = NULL; int nNodesBeg, nRegsBeg; int nIter = -1; // Suppress "might be used uninitialized" - int i, clk = clock(), clk2; - int TimeToStop = (pParams->TimeLimit == 0.0)? 0 : clock() + (int)(pParams->TimeLimit * CLOCKS_PER_SEC); + int i; + clock_t clk = clock(), clk2; + clock_t TimeToStop = pParams->TimeLimit ? pParams->TimeLimit * CLOCKS_PER_SEC + clock() : 0; if ( Aig_ManNodeNum(pManAig) == 0 ) { @@ -473,7 +475,7 @@ ABC_PRT( "Time", clock() - clk ); int nLitsOld = Fra_ClassesCountLits(p->pCla); int nImpsOld = p->pCla->vImps? Vec_IntSize(p->pCla->vImps) : 0; int nHotsOld = p->vOneHots? Fra_OneHotCount(p, p->vOneHots) : 0; - int clk3 = clock(); + clock_t clk3 = clock(); if ( pParams->TimeLimit != 0.0 && clock() > TimeToStop ) { diff --git a/src/proof/fra/fraIndVer.c b/src/proof/fra/fraIndVer.c index 7c5e9e70..099256ac 100644 --- a/src/proof/fra/fraIndVer.c +++ b/src/proof/fra/fraIndVer.c @@ -50,7 +50,7 @@ int Fra_InvariantVerify( Aig_Man_t * pAig, int nFrames, Vec_Int_t * vClauses, Ve int * pStart; int RetValue, Beg, End, i, k; int CounterBase = 0, CounterInd = 0; - int clk = clock(); + clock_t clk = clock(); if ( nFrames != 1 ) { diff --git a/src/proof/fra/fraLcr.c b/src/proof/fra/fraLcr.c index 8ea6d297..2941f24f 100644 --- a/src/proof/fra/fraLcr.c +++ b/src/proof/fra/fraLcr.c @@ -54,12 +54,12 @@ struct Fra_Lcr_t_ int nRegsBeg; int nRegsEnd; // runtime - int timeSim; - int timePart; - int timeTrav; - int timeFraig; - int timeUpdate; - int timeTotal; + clock_t timeSim; + clock_t timePart; + clock_t timeTrav; + clock_t timeFraig; + clock_t timeUpdate; + clock_t timeTotal; }; //////////////////////////////////////////////////////////////////////// @@ -538,8 +538,9 @@ Aig_Man_t * Fra_FraigLatchCorrespondence( Aig_Man_t * pAig, int nFramesP, int nC Fra_Man_t * pTemp; Aig_Man_t * pAigPart, * pAigTemp, * pAigNew = NULL; Vec_Int_t * vPart; - int i, nIter, timeSim, clk2, clk3, clk = clock(); - int TimeToStop = (TimeLimit == 0.0)? 0 : clock() + (int)(TimeLimit * CLOCKS_PER_SEC); + int i, nIter; + clock_t timeSim, clk2, clk3, clk = clock(); + clock_t TimeToStop = TimeLimit ? TimeLimit * CLOCKS_PER_SEC + clock() : 0; if ( Aig_ManNodeNum(pAig) == 0 ) { if ( pnIter ) *pnIter = 0; diff --git a/src/proof/fra/fraPart.c b/src/proof/fra/fraPart.c index e3bb2850..e1c8ddf4 100644 --- a/src/proof/fra/fraPart.c +++ b/src/proof/fra/fraPart.c @@ -53,7 +53,7 @@ void Fra_ManPartitionTest( Aig_Man_t * p, int nComLim ) int i, k, nCommon, CountOver, CountQuant; int nTotalSupp, nTotalSupp2, Entry, Largest;//, iVar; double Ratio, R; - int clk; + clock_t clk; nTotalSupp = 0; nTotalSupp2 = 0; @@ -190,7 +190,8 @@ void Fra_ManPartitionTest2( Aig_Man_t * p ) Vec_Int_t * vSup, * vSup2, * vSup3; Aig_Obj_t * pObj; int Entry, Entry2, Entry3, Counter; - int i, k, m, n, clk; + int i, k, m, n; + clock_t clk; char * pSupp; // compute supports diff --git a/src/proof/fra/fraSat.c b/src/proof/fra/fraSat.c index 2702113c..fc95fd62 100644 --- a/src/proof/fra/fraSat.c +++ b/src/proof/fra/fraSat.c @@ -47,7 +47,8 @@ static int Fra_SetActivityFactors( Fra_Man_t * p, Aig_Obj_t * pOld, Aig_Obj_t * ***********************************************************************/ int Fra_NodesAreEquiv( Fra_Man_t * p, Aig_Obj_t * pOld, Aig_Obj_t * pNew ) { - int pLits[4], RetValue, RetValue1, nBTLimit, clk;//, clk2 = clock(); + int pLits[4], RetValue, RetValue1, nBTLimit; + clock_t clk;//, clk2 = clock(); int status; // make sure the nodes are not complemented @@ -207,7 +208,8 @@ p->timeSatFail += clock() - clk; ***********************************************************************/ int Fra_NodesAreImp( Fra_Man_t * p, Aig_Obj_t * pOld, Aig_Obj_t * pNew, int fComplL, int fComplR ) { - int pLits[4], RetValue, RetValue1, nBTLimit, clk;//, clk2 = clock(); + int pLits[4], RetValue, RetValue1, nBTLimit; + clock_t clk;//, clk2 = clock(); int status; // make sure the nodes are not complemented @@ -314,7 +316,8 @@ p->timeSatFail += clock() - clk; ***********************************************************************/ int Fra_NodesAreClause( Fra_Man_t * p, Aig_Obj_t * pOld, Aig_Obj_t * pNew, int fComplL, int fComplR ) { - int pLits[4], RetValue, RetValue1, nBTLimit, clk;//, clk2 = clock(); + int pLits[4], RetValue, RetValue1, nBTLimit; + clock_t clk;//, clk2 = clock(); int status; // make sure the nodes are not complemented @@ -421,7 +424,8 @@ p->timeSatFail += clock() - clk; ***********************************************************************/ int Fra_NodeIsConst( Fra_Man_t * p, Aig_Obj_t * pNew ) { - int pLits[2], RetValue1, RetValue, clk; + int pLits[2], RetValue1, RetValue; + clock_t clk; // make sure the nodes are not complemented assert( !Aig_IsComplement(pNew) ); @@ -535,7 +539,8 @@ int Fra_SetActivityFactors_rec( Fra_Man_t * p, Aig_Obj_t * pObj, int LevelMin, i ***********************************************************************/ int Fra_SetActivityFactors( Fra_Man_t * p, Aig_Obj_t * pOld, Aig_Obj_t * pNew ) { - int clk, LevelMin, LevelMax; + int LevelMin, LevelMax; + clock_t clk; assert( pOld || pNew ); clk = clock(); // reset the active variables diff --git a/src/proof/fra/fraSec.c b/src/proof/fra/fraSec.c index cde56809..ac6cd67e 100644 --- a/src/proof/fra/fraSec.c +++ b/src/proof/fra/fraSec.c @@ -98,7 +98,8 @@ int Fra_FraigSec( Aig_Man_t * p, Fra_Sec_t * pParSec, Aig_Man_t ** ppResult ) Fra_Ssw_t Pars, * pPars = &Pars; Fra_Sml_t * pSml; Aig_Man_t * pNew, * pTemp; - int nFrames, RetValue, nIter, clk, clkTotal = clock(); + int nFrames, RetValue, nIter; + clock_t clk, clkTotal = clock(); int TimeOut = 0; int fLatchCorr = 0; float TimeLeft = 0.0; diff --git a/src/proof/fra/fraSim.c b/src/proof/fra/fraSim.c index 66579be3..555789e2 100644 --- a/src/proof/fra/fraSim.c +++ b/src/proof/fra/fraSim.c @@ -662,7 +662,8 @@ int Fra_SmlCheckNonConstOutputs( Fra_Sml_t * p ) void Fra_SmlSimulateOne( Fra_Sml_t * p ) { Aig_Obj_t * pObj, * pObjLi, * pObjLo; - int f, i, clk; + int f, i; + clock_t clk; clk = clock(); for ( f = 0; f < p->nFrames; f++ ) { @@ -700,7 +701,8 @@ p->nSimRounds++; ***********************************************************************/ void Fra_SmlResimulate( Fra_Man_t * p ) { - int nChanges, clk; + int nChanges; + clock_t clk; Fra_SmlAssignDist1( p->pSml, p->pPatWords ); Fra_SmlSimulateOne( p->pSml ); // if ( p->pPars->fPatScores ) @@ -735,7 +737,8 @@ p->timeRef += clock() - clk; void Fra_SmlSimulate( Fra_Man_t * p, int fInit ) { int fVerbose = 0; - int nChanges, nClasses, clk; + int nChanges, nClasses; + clock_t clk; assert( !fInit || Aig_ManRegNum(p->pManAig) ); // start the classes Fra_SmlInitialize( p->pSml, fInit ); diff --git a/src/proof/fraig/fraig.h b/src/proof/fraig/fraig.h index 6d672716..0c021feb 100644 --- a/src/proof/fraig/fraig.h +++ b/src/proof/fraig/fraig.h @@ -154,9 +154,6 @@ extern void Fraig_ManSetDoSparse( Fraig_Man_t * p, int fDoSparse extern void Fraig_ManSetChoicing( Fraig_Man_t * p, int fChoicing ); extern void Fraig_ManSetTryProve( Fraig_Man_t * p, int fTryProve ); extern void Fraig_ManSetVerbose( Fraig_Man_t * p, int fVerbose ); -extern void Fraig_ManSetTimeToGraph( Fraig_Man_t * p, int Time ); -extern void Fraig_ManSetTimeToNet( Fraig_Man_t * p, int Time ); -extern void Fraig_ManSetTimeTotal( Fraig_Man_t * p, int Time ); extern void Fraig_ManSetOutputNames( Fraig_Man_t * p, char ** ppNames ); extern void Fraig_ManSetInputNames( Fraig_Man_t * p, char ** ppNames ); extern void Fraig_ManSetPo( Fraig_Man_t * p, Fraig_Node_t * pNode ); diff --git a/src/proof/fraig/fraigApi.c b/src/proof/fraig/fraigApi.c index 6e0ab959..b0b47075 100644 --- a/src/proof/fraig/fraigApi.c +++ b/src/proof/fraig/fraigApi.c @@ -91,9 +91,6 @@ void Fraig_ManSetDoSparse( Fraig_Man_t * p, int fDoSparse ) { p- void Fraig_ManSetChoicing( Fraig_Man_t * p, int fChoicing ) { p->fChoicing = fChoicing; } void Fraig_ManSetTryProve( Fraig_Man_t * p, int fTryProve ) { p->fTryProve = fTryProve; } void Fraig_ManSetVerbose( Fraig_Man_t * p, int fVerbose ) { p->fVerbose = fVerbose; } -void Fraig_ManSetTimeToGraph( Fraig_Man_t * p, int Time ) { p->timeToAig = Time; } -void Fraig_ManSetTimeToNet( Fraig_Man_t * p, int Time ) { p->timeToNet = Time; } -void Fraig_ManSetTimeTotal( Fraig_Man_t * p, int Time ) { p->timeTotal = Time; } void Fraig_ManSetOutputNames( Fraig_Man_t * p, char ** ppNames ) { p->ppOutputNames = ppNames; } void Fraig_ManSetInputNames( Fraig_Man_t * p, char ** ppNames ) { p->ppInputNames = ppNames; } diff --git a/src/proof/fraig/fraigChoice.c b/src/proof/fraig/fraigChoice.c index 21d4fe10..e1d6e8a7 100644 --- a/src/proof/fraig/fraigChoice.c +++ b/src/proof/fraig/fraigChoice.c @@ -45,7 +45,7 @@ void Fraig_ManAddChoices( Fraig_Man_t * pMan, int fVerbose, int nLimit ) { // ProgressBar * pProgress; char Buffer[100]; - int clkTotal = clock(); + clock_t clkTotal = clock(); int i, nNodesBefore, nNodesAfter, nInputs, nMaxNodes; int /*nMaxLevel,*/ nDistributive; Fraig_Node_t *pNode, *pRepr; diff --git a/src/proof/fraig/fraigFeed.c b/src/proof/fraig/fraigFeed.c index 47f946e1..4cb1276b 100644 --- a/src/proof/fraig/fraigFeed.c +++ b/src/proof/fraig/fraigFeed.c @@ -80,7 +80,8 @@ void Fraig_FeedBackInit( Fraig_Man_t * p ) void Fraig_FeedBack( Fraig_Man_t * p, int * pModel, Msat_IntVec_t * vVars, Fraig_Node_t * pOld, Fraig_Node_t * pNew ) { int nVarsPi, nWords; - int i, clk = clock(); + int i; + clock_t clk = clock(); // get the number of PI vars in the feedback (also sets the PI values) nVarsPi = Fraig_FeedBackPrepare( p, pModel, vVars ); diff --git a/src/proof/fraig/fraigInt.h b/src/proof/fraig/fraigInt.h index f6a5d74f..1ff8727e 100644 --- a/src/proof/fraig/fraigInt.h +++ b/src/proof/fraig/fraigInt.h @@ -28,7 +28,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/util/abc_global.h" #include "fraig.h" @@ -189,18 +188,18 @@ struct Fraig_ManStruct_t_ int nImplies1; // runtime statistics - int timeToAig; // time to transfer to the mapping structure - int timeSims; // time to compute k-feasible cuts - int timeTrav; // time to traverse the network - int timeFeed; // time for solver feedback (recording and resimulating) - int timeImply; // time to analyze implications - int timeSat; // time to compute the truth table for each cut - int timeToNet; // time to transfer back to the network - int timeTotal; // the total mapping time - int time1; // time to perform one task - int time2; // time to perform another task - int time3; // time to perform another task - int time4; // time to perform another task + clock_t timeToAig; // time to transfer to the mapping structure + clock_t timeSims; // time to compute k-feasible cuts + clock_t timeTrav; // time to traverse the network + clock_t timeFeed; // time for solver feedback (recording and resimulating) + clock_t timeImply; // time to analyze implications + clock_t timeSat; // time to compute the truth table for each cut + clock_t timeToNet; // time to transfer back to the network + clock_t timeTotal; // the total mapping time + clock_t time1; // time to perform one task + clock_t time2; // time to perform another task + clock_t time3; // time to perform another task + clock_t time4; // time to perform another task }; // the mapping node diff --git a/src/proof/fraig/fraigMan.c b/src/proof/fraig/fraigMan.c index 125a4da1..bc7c423d 100644 --- a/src/proof/fraig/fraigMan.c +++ b/src/proof/fraig/fraigMan.c @@ -25,8 +25,8 @@ ABC_NAMESPACE_IMPL_START /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// -int timeSelect; -int timeAssign; +clock_t timeSelect; +clock_t timeAssign; //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// @@ -323,8 +323,8 @@ void Fraig_ManFree( Fraig_Man_t * p ) ***********************************************************************/ void Fraig_ManCreateSolver( Fraig_Man_t * p ) { - extern int timeSelect; - extern int timeAssign; + extern clock_t timeSelect; + extern clock_t timeAssign; assert( p->pSat == NULL ); // allocate data for SAT solving p->pSat = Msat_SolverAlloc( 500, 1, 1, 1, 1, 0 ); diff --git a/src/proof/fraig/fraigNode.c b/src/proof/fraig/fraigNode.c index 609d5f65..5310534b 100644 --- a/src/proof/fraig/fraigNode.c +++ b/src/proof/fraig/fraigNode.c @@ -87,7 +87,8 @@ Fraig_Node_t * Fraig_NodeCreateConst( Fraig_Man_t * p ) Fraig_Node_t * Fraig_NodeCreatePi( Fraig_Man_t * p ) { Fraig_Node_t * pNode, * pNodeRes; - int i, clk; + int i; + clock_t clk; // create the node pNode = (Fraig_Node_t *)Fraig_MemFixedEntryFetch( p->mmNodes ); @@ -159,7 +160,7 @@ p->timeSims += clock() - clk; Fraig_Node_t * Fraig_NodeCreate( Fraig_Man_t * p, Fraig_Node_t * p1, Fraig_Node_t * p2 ) { Fraig_Node_t * pNode; - int clk; + clock_t clk; // create the node pNode = (Fraig_Node_t *)Fraig_MemFixedEntryFetch( p->mmNodes ); diff --git a/src/proof/fraig/fraigSat.c b/src/proof/fraig/fraigSat.c index 6ccd1b86..7a11c072 100644 --- a/src/proof/fraig/fraigSat.c +++ b/src/proof/fraig/fraigSat.c @@ -85,7 +85,8 @@ int Fraig_NodesAreEqual( Fraig_Man_t * p, Fraig_Node_t * pNode1, Fraig_Node_t * void Fraig_ManProveMiter( Fraig_Man_t * p ) { Fraig_Node_t * pNode; - int i, clk; + int i; + clock_t clk; if ( !p->fTryProve ) return; @@ -300,7 +301,8 @@ void Fraig_VarsStudy( Fraig_Man_t * p, Fraig_Node_t * pOld, Fraig_Node_t * pNew ***********************************************************************/ int Fraig_NodeIsEquivalent( Fraig_Man_t * p, Fraig_Node_t * pOld, Fraig_Node_t * pNew, int nBTLimit, int nTimeLimit ) { - int RetValue, RetValue1, i, fComp, clk; + int RetValue, RetValue1, i, fComp; + clock_t clk; int fVerbose = 0; int fSwitch = 0; @@ -548,7 +550,8 @@ p->time3 += clock() - clk; ***********************************************************************/ int Fraig_NodeIsImplication( Fraig_Man_t * p, Fraig_Node_t * pOld, Fraig_Node_t * pNew, int nBTLimit ) { - int RetValue, RetValue1, i, fComp, clk; + int RetValue, RetValue1, i, fComp; + clock_t clk; int fVerbose = 0; // make sure the nodes are not complemented @@ -650,7 +653,8 @@ p->time3 += clock() - clk; int Fraig_ManCheckClauseUsingSat( Fraig_Man_t * p, Fraig_Node_t * pNode1, Fraig_Node_t * pNode2, int nBTLimit ) { Fraig_Node_t * pNode1R, * pNode2R; - int RetValue, RetValue1, i, clk; + int RetValue, RetValue1, i; + clock_t clk; int fVerbose = 0; pNode1R = Fraig_Regular(pNode1); diff --git a/src/proof/fraig/fraigTable.c b/src/proof/fraig/fraigTable.c index 6611e4fa..d184ab7f 100644 --- a/src/proof/fraig/fraigTable.c +++ b/src/proof/fraig/fraigTable.c @@ -260,7 +260,8 @@ void Fraig_TableResizeS( Fraig_HashTable_t * p ) { Fraig_Node_t ** pBinsNew; Fraig_Node_t * pEnt, * pEnt2; - int nBinsNew, Counter, i, clk; + int nBinsNew, Counter, i; + clock_t clk; unsigned Key; clk = clock(); @@ -303,7 +304,8 @@ void Fraig_TableResizeF( Fraig_HashTable_t * p, int fUseSimR ) { Fraig_Node_t ** pBinsNew; Fraig_Node_t * pEnt, * pEnt2; - int nBinsNew, Counter, i, clk; + int nBinsNew, Counter, i; + clock_t clk; unsigned Key; clk = clock(); diff --git a/src/proof/fraig/fraigUtil.c b/src/proof/fraig/fraigUtil.c index ae78a61f..316b492e 100644 --- a/src/proof/fraig/fraigUtil.c +++ b/src/proof/fraig/fraigUtil.c @@ -844,7 +844,7 @@ int Fraig_ManPrintRefs( Fraig_Man_t * pMan ) Fraig_NodeVec_t * vPivots; Fraig_Node_t * pNode, * pNode2; int i, k, Counter, nProved; - int clk; + clock_t clk; vPivots = Fraig_NodeVecAlloc( 1000 ); for ( i = 0; i < pMan->vNodes->nSize; i++ ) diff --git a/src/proof/int/intCheck.c b/src/proof/int/intCheck.c index 2b14d8ae..28ef54a7 100644 --- a/src/proof/int/intCheck.c +++ b/src/proof/int/intCheck.c @@ -217,7 +217,7 @@ void Inter_CheckAddEqual( Inter_Check_t * p, int iVarA, int iVarB ) SeeAlso [] ***********************************************************************/ -int Inter_CheckPerform( Inter_Check_t * p, Cnf_Dat_t * pCnfInt, int nTimeNewOut ) +int Inter_CheckPerform( Inter_Check_t * p, Cnf_Dat_t * pCnfInt, clock_t nTimeNewOut ) { Aig_Obj_t * pObj, * pObj2; int i, f, VarA, VarB, RetValue, Entry, status; diff --git a/src/proof/int/intCore.c b/src/proof/int/intCore.c index d4ef1f94..c226c7e1 100644 --- a/src/proof/int/intCore.c +++ b/src/proof/int/intCore.c @@ -80,8 +80,9 @@ int Inter_ManPerformInterpolation( Aig_Man_t * pAig, Inter_ManParams_t * pPars, Inter_Man_t * p; Inter_Check_t * pCheck = NULL; Aig_Man_t * pAigTemp; - int s, i, RetValue, Status, clk, clk2, clkTotal = clock(), timeTemp = 0; - int nTimeNewOut = pPars->nSecLimit ? time(NULL) + pPars->nSecLimit : 0; + int s, i, RetValue, Status; + clock_t clk, clk2, clkTotal = clock(), timeTemp = 0; + clock_t nTimeNewOut = pPars->nSecLimit ? pPars->nSecLimit * CLOCKS_PER_SEC + clock() : 0; // enable ORing of the interpolants, if containment check is performed inductively with K > 1 if ( pPars->nFramesK > 1 ) @@ -256,7 +257,7 @@ p->timeEqu += clock() - clk; } else if ( RetValue == -1 ) { - if ( pPars->nSecLimit && time(NULL) > nTimeNewOut ) // timed out + if ( pPars->nSecLimit && clock() > nTimeNewOut ) // timed out { if ( pPars->fVerbose ) printf( "Reached timeout (%d seconds).\n", pPars->nSecLimit ); @@ -341,7 +342,7 @@ p->timeEqu += clock() - clk - timeTemp; Inter_CheckStop( pCheck ); return 1; } - if ( pPars->nSecLimit && time(NULL) > nTimeNewOut ) + if ( pPars->nSecLimit && clock() > nTimeNewOut ) { printf( "Reached timeout (%d seconds).\n", pPars->nSecLimit ); p->timeTotal = clock() - clkTotal; diff --git a/src/proof/int/intCtrex.c b/src/proof/int/intCtrex.c index 04aaa271..840ae75d 100644 --- a/src/proof/int/intCtrex.c +++ b/src/proof/int/intCtrex.c @@ -99,7 +99,8 @@ void * Inter_ManGetCounterExample( Aig_Man_t * pAig, int nFrames, int fVerbose ) Aig_Man_t * pFrames; sat_solver * pSat; Cnf_Dat_t * pCnf; - int status, clk = clock(); + int status; + clock_t clk = clock(); Vec_Int_t * vCiIds; // create timeframes assert( Saig_ManPoNum(pAig) == 1 ); diff --git a/src/proof/int/intInt.h b/src/proof/int/intInt.h index 6a033d85..ec2a0356 100644 --- a/src/proof/int/intInt.h +++ b/src/proof/int/intInt.h @@ -70,13 +70,13 @@ struct Inter_Man_t_ int nConfLimit; // the limit on the number of conflicts int fVerbose; // the verbosiness flag // runtime - int timeRwr; - int timeCnf; - int timeSat; - int timeInt; - int timeEqu; - int timeOther; - int timeTotal; + clock_t timeRwr; + clock_t timeCnf; + clock_t timeSat; + clock_t timeInt; + clock_t timeEqu; + clock_t timeOther; + clock_t timeTotal; }; // containment checking manager @@ -93,7 +93,7 @@ typedef struct Inter_Check_t_ Inter_Check_t; /*=== intCheck.c ============================================================*/ extern Inter_Check_t * Inter_CheckStart( Aig_Man_t * pTrans, int nFramesK ); extern void Inter_CheckStop( Inter_Check_t * p ); -extern int Inter_CheckPerform( Inter_Check_t * p, Cnf_Dat_t * pCnf, int nTimeNewOut ); +extern int Inter_CheckPerform( Inter_Check_t * p, Cnf_Dat_t * pCnf, clock_t nTimeNewOut ); /*=== intContain.c ============================================================*/ extern int Inter_ManCheckContainment( Aig_Man_t * pNew, Aig_Man_t * pOld ); @@ -117,7 +117,7 @@ extern void Inter_ManClean( Inter_Man_t * p ); extern void Inter_ManStop( Inter_Man_t * p, int fProved ); /*=== intM114.c ============================================================*/ -extern int Inter_ManPerformOneStep( Inter_Man_t * p, int fUseBias, int fUseBackward, int nTimeNewOut ); +extern int Inter_ManPerformOneStep( Inter_Man_t * p, int fUseBias, int fUseBackward, clock_t nTimeNewOut ); /*=== intM114p.c ============================================================*/ #ifdef ABC_USE_LIBRARIES diff --git a/src/proof/int/intM114.c b/src/proof/int/intM114.c index ed3ef80e..bf44696d 100644 --- a/src/proof/int/intM114.c +++ b/src/proof/int/intM114.c @@ -200,15 +200,16 @@ sat_solver * Inter_ManDeriveSatSolver( SeeAlso [] ***********************************************************************/ -int Inter_ManPerformOneStep( Inter_Man_t * p, int fUseBias, int fUseBackward, int nTimeNewOut ) +int Inter_ManPerformOneStep( Inter_Man_t * p, int fUseBias, int fUseBackward, clock_t nTimeNewOut ) { sat_solver * pSat; void * pSatCnf = NULL; Inta_Man_t * pManInterA; // Intb_Man_t * pManInterB; int * pGlobalVars; - int clk, status, RetValue; + int status, RetValue; int i, Var; + clock_t clk; // assert( p->pInterNew == NULL ); // derive the SAT solver diff --git a/src/proof/int/intUtil.c b/src/proof/int/intUtil.c index 8027bdef..b93a7453 100644 --- a/src/proof/int/intUtil.c +++ b/src/proof/int/intUtil.c @@ -49,7 +49,7 @@ int Inter_ManCheckInitialState( Aig_Man_t * p ) Aig_Obj_t * pObj; sat_solver * pSat; int i, status; - int clk = clock(); + clock_t clk = clock(); pCnf = Cnf_Derive( p, Saig_ManRegNum(p) ); pSat = (sat_solver *)Cnf_DataWriteIntoSolver( pCnf, 1, 1 ); if ( pSat == NULL ) @@ -87,7 +87,7 @@ int Inter_ManCheckAllStates( Aig_Man_t * p ) Cnf_Dat_t * pCnf; sat_solver * pSat; int status; - int clk = clock(); + clock_t clk = clock(); pCnf = Cnf_Derive( p, Saig_ManRegNum(p) ); pSat = (sat_solver *)Cnf_DataWriteIntoSolver( pCnf, 1, 0 ); Cnf_DataFree( pCnf ); diff --git a/src/proof/llb/llb.h b/src/proof/llb/llb.h index a9bfd891..464f4526 100644 --- a/src/proof/llb/llb.h +++ b/src/proof/llb/llb.h @@ -65,7 +65,7 @@ struct Gia_ParLlb_t_ int TimeLimit; // time limit for one reachability run int TimeLimitGlo; // time limit for all reachability runs // internal parameters - int TimeTarget; // the time to stop + clock_t TimeTarget; // the time to stop int iFrame; // explored up to this frame }; diff --git a/src/proof/llb/llb1Core.c b/src/proof/llb/llb1Core.c index 56e0cc6b..b16fdee7 100644 --- a/src/proof/llb/llb1Core.c +++ b/src/proof/llb/llb1Core.c @@ -114,7 +114,7 @@ int Llb_ManModelCheckAig( Aig_Man_t * pAigGlo, Gia_ParLlb_t * pPars, Vec_Int_t * Llb_Man_t * p = NULL; Aig_Man_t * pAig; int RetValue = -1; - int clk = clock(); + clock_t clk = clock(); if ( pPars->fIndConstr ) { diff --git a/src/proof/llb/llb1Hint.c b/src/proof/llb/llb1Hint.c index 51d3a9fc..07877a98 100644 --- a/src/proof/llb/llb1Hint.c +++ b/src/proof/llb/llb1Hint.c @@ -165,7 +165,7 @@ int Llb_ManModelCheckAigWithHints( Aig_Man_t * pAigGlo, Gia_ParLlb_t * pPars ) Vec_Int_t * vHints; Vec_Int_t * vHFCands; int i, Entry, RetValue = -1; - int clk = clock(); + clock_t clk = clock(); assert( pPars->nHintDepth > 0 ); /* // perform reachability without hints diff --git a/src/proof/llb/llb1Reach.c b/src/proof/llb/llb1Reach.c index 60124378..fed0389a 100644 --- a/src/proof/llb/llb1Reach.c +++ b/src/proof/llb/llb1Reach.c @@ -47,7 +47,8 @@ DdNode * Llb_ManConstructOutBdd( Aig_Man_t * pAig, Aig_Obj_t * pNode, DdManager DdNode * bBdd0, * bBdd1, * bFunc; Vec_Ptr_t * vNodes; Aig_Obj_t * pObj; - int i, TimeStop; + int i; + clock_t TimeStop; if ( Aig_ObjFanin0(pNode) == Aig_ManConst1(pAig) ) return Cudd_NotCond( Cudd_ReadOne(dd), Aig_ObjFaninC0(pNode) ); TimeStop = dd->TimeStop; dd->TimeStop = 0; @@ -156,7 +157,7 @@ DdNode * Llb_ManConstructQuantCubeIntern( Llb_Man_t * p, Llb_Grp_t * pGroup, int Aig_Obj_t * pObj; DdNode * bRes, * bTemp, * bVar; int i, iGroupFirst, iGroupLast; - int TimeStop; + clock_t TimeStop; TimeStop = p->dd->TimeStop; p->dd->TimeStop = 0; bRes = Cudd_ReadOne( p->dd ); Cudd_Ref( bRes ); Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vIns, pObj, i ) @@ -205,7 +206,8 @@ DdNode * Llb_ManConstructQuantCubeFwd( Llb_Man_t * p, Llb_Grp_t * pGroup, int iG { Aig_Obj_t * pObj; DdNode * bRes, * bTemp, * bVar; - int i, iGroupLast, TimeStop; + int i, iGroupLast; + clock_t TimeStop; TimeStop = p->dd->TimeStop; p->dd->TimeStop = 0; bRes = Cudd_ReadOne( p->dd ); Cudd_Ref( bRes ); Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vIns, pObj, i ) @@ -248,7 +250,8 @@ DdNode * Llb_ManConstructQuantCubeBwd( Llb_Man_t * p, Llb_Grp_t * pGroup, int iG { Aig_Obj_t * pObj; DdNode * bRes, * bTemp, * bVar; - int i, iGroupFirst, TimeStop; + int i, iGroupFirst; + clock_t TimeStop; TimeStop = p->dd->TimeStop; p->dd->TimeStop = 0; bRes = Cudd_ReadOne( p->dd ); Cudd_Ref( bRes ); Vec_PtrForEachEntry( Aig_Obj_t *, pGroup->vIns, pObj, i ) @@ -295,7 +298,8 @@ DdNode * Llb_ManComputeInitState( Llb_Man_t * p, DdManager * dd ) { Aig_Obj_t * pObj; DdNode * bRes, * bVar, * bTemp; - int i, iVar, TimeStop; + int i, iVar; + clock_t TimeStop; TimeStop = dd->TimeStop; dd->TimeStop = 0; bRes = Cudd_ReadOne( dd ); Cudd_Ref( bRes ); Saig_ManForEachLo( p->pAig, pObj, i ) @@ -409,7 +413,8 @@ DdNode * Llb_ManCreateConstraints( Llb_Man_t * p, Vec_Int_t * vHints, int fUseNs { DdNode * bConstr, * bFunc, * bTemp; Aig_Obj_t * pObj; - int i, Entry, TimeStop; + int i, Entry; + clock_t TimeStop; if ( vHints == NULL ) return Cudd_ReadOne( p->dd ); TimeStop = p->dd->TimeStop; p->dd->TimeStop = 0; @@ -581,11 +586,12 @@ int Llb_ManReachability( Llb_Man_t * p, Vec_Int_t * vHints, DdManager ** pddGlo int * pGlo2Cs = Vec_IntArray( p->vGlo2Cs ); DdNode * bCurrent, * bReached, * bNext, * bTemp, * bCube; DdNode * bConstrCs, * bConstrNs; - int clk2, clk = clock(), nIters, nBddSize = 0; + clock_t clk2, clk = clock(); + int nIters, nBddSize = 0; // int nThreshold = 10000; // compute time to stop - p->pPars->TimeTarget = p->pPars->TimeLimit ? time(NULL) + p->pPars->TimeLimit : 0; + p->pPars->TimeTarget = p->pPars->TimeLimit ? p->pPars->TimeLimit * CLOCKS_PER_SEC + clock(): 0; // define variable limits Llb_ManPrepareVarLimits( p ); @@ -656,7 +662,7 @@ int Llb_ManReachability( Llb_Man_t * p, Vec_Int_t * vHints, DdManager ** pddGlo { clk2 = clock(); // check the runtime limit - if ( p->pPars->TimeLimit && time(NULL) > p->pPars->TimeTarget ) + if ( p->pPars->TimeLimit && clock() > p->pPars->TimeTarget ) { if ( !p->pPars->fSilent ) printf( "Reached timeout during image computation (%d seconds).\n", p->pPars->TimeLimit ); diff --git a/src/proof/llb/llb2Bad.c b/src/proof/llb/llb2Bad.c index f4359493..57745c1d 100644 --- a/src/proof/llb/llb2Bad.c +++ b/src/proof/llb/llb2Bad.c @@ -42,7 +42,7 @@ ABC_NAMESPACE_IMPL_START SeeAlso [] ***********************************************************************/ -DdNode * Llb_BddComputeBad( Aig_Man_t * pInit, DdManager * dd, int TimeOut ) +DdNode * Llb_BddComputeBad( Aig_Man_t * pInit, DdManager * dd, clock_t TimeOut ) { Vec_Ptr_t * vNodes; DdNode * bBdd0, * bBdd1, * bTemp, * bResult; @@ -110,7 +110,8 @@ DdNode * Llb_BddQuantifyPis( Aig_Man_t * pInit, DdManager * dd, DdNode * bFunc ) { DdNode * bVar, * bCube, * bTemp; Aig_Obj_t * pObj; - int i, TimeStop; + int i; + clock_t TimeStop; assert( Cudd_ReadSize(dd) == Aig_ManCiNum(pInit) ); TimeStop = dd->TimeStop; dd->TimeStop = 0; // create PI cube diff --git a/src/proof/llb/llb2Core.c b/src/proof/llb/llb2Core.c index 3b98c32a..f19f757e 100644 --- a/src/proof/llb/llb2Core.c +++ b/src/proof/llb/llb2Core.c @@ -68,7 +68,8 @@ struct Llb_Img_t_ DdNode * Llb_CoreComputeCube( DdManager * dd, Vec_Int_t * vVars, int fUseVarIndex, char * pValues ) { DdNode * bRes, * bVar, * bTemp; - int i, iVar, Index, TimeStop; + int i, iVar, Index; + clock_t TimeStop; TimeStop = dd->TimeStop; dd->TimeStop = 0; bRes = Cudd_ReadOne( dd ); Cudd_Ref( bRes ); Vec_IntForEachEntry( vVars, Index, i ) @@ -209,7 +210,8 @@ int Llb_CoreReachability_int( Llb_Img_t * p, Vec_Ptr_t * vQuant0, Vec_Ptr_t * vQ int * pLoc2GloR = p->pPars->fBackward? Vec_IntArray( p->vNs2Glo ) : Vec_IntArray( p->vCs2Glo ); int * pGlo2Loc = p->pPars->fBackward? Vec_IntArray( p->vGlo2Ns ) : Vec_IntArray( p->vGlo2Cs ); DdNode * bCurrent, * bReached, * bNext, * bTemp; - int clk2, clk = clock(), nIters, nBddSize;//, iOutFail = -1; + clock_t clk2, clk = clock(); + int nIters, nBddSize;//, iOutFail = -1; /* // compute time to stop if ( p->pPars->TimeLimit ) @@ -218,7 +220,7 @@ int Llb_CoreReachability_int( Llb_Img_t * p, Vec_Ptr_t * vQuant0, Vec_Ptr_t * vQ p->pPars->TimeTarget = 0; */ - if ( time(NULL) > p->pPars->TimeTarget ) + if ( clock() > p->pPars->TimeTarget ) { if ( !p->pPars->fSilent ) printf( "Reached timeout (%d seconds) before image computation.\n", p->pPars->TimeLimit ); @@ -286,7 +288,7 @@ int Llb_CoreReachability_int( Llb_Img_t * p, Vec_Ptr_t * vQuant0, Vec_Ptr_t * vQ { clk2 = clock(); // check the runtime limit - if ( p->pPars->TimeLimit && time(NULL) > p->pPars->TimeTarget ) + if ( p->pPars->TimeLimit && clock() > p->pPars->TimeTarget ) { if ( !p->pPars->fSilent ) printf( "Reached timeout (%d seconds) during image computation.\n", p->pPars->TimeLimit ); @@ -529,7 +531,7 @@ int Llb_CoreReachability( Llb_Img_t * p ) SeeAlso [] ***********************************************************************/ -Vec_Ptr_t * Llb_CoreConstructAll( Aig_Man_t * p, Vec_Ptr_t * vResult, Vec_Int_t * vVarsNs, int TimeTarget ) +Vec_Ptr_t * Llb_CoreConstructAll( Aig_Man_t * p, Vec_Ptr_t * vResult, Vec_Int_t * vVarsNs, clock_t TimeTarget ) { DdManager * dd; Vec_Ptr_t * vDdMans; @@ -689,7 +691,7 @@ void Llb_CoreStop( Llb_Img_t * p ) SeeAlso [] ***********************************************************************/ -int Llb_CoreExperiment( Aig_Man_t * pInit, Aig_Man_t * pAig, Gia_ParLlb_t * pPars, Vec_Ptr_t * vResult, int TimeTarget ) +int Llb_CoreExperiment( Aig_Man_t * pInit, Aig_Man_t * pAig, Gia_ParLlb_t * pPars, Vec_Ptr_t * vResult, clock_t TimeTarget ) { int RetValue; Llb_Img_t * p; @@ -726,10 +728,10 @@ int Llb_ManReachMinCut( Aig_Man_t * pAig, Gia_ParLlb_t * pPars ) Vec_Ptr_t * vResult; Aig_Man_t * p; int RetValue = -1; - int clk = clock(); + clock_t clk = clock(); // compute time to stop - pPars->TimeTarget = pPars->TimeLimit ? time(NULL) + pPars->TimeLimit : 0; + pPars->TimeTarget = pPars->TimeLimit ? pPars->TimeLimit * CLOCKS_PER_SEC + clock(): 0; p = Aig_ManDupFlopsOnly( pAig ); //Aig_ManShow( p, 0, NULL ); @@ -741,7 +743,7 @@ int Llb_ManReachMinCut( Aig_Man_t * pAig, Gia_ParLlb_t * pPars ) vResult = Llb_ManComputeCuts( p, pPars->nPartValue, pPars->fVerbose, pPars->fVeryVerbose ); - if ( pPars->TimeLimit && time(NULL) > pPars->TimeTarget ) + if ( pPars->TimeLimit && clock() > pPars->TimeTarget ) { if ( !pPars->fSilent ) printf( "Reached timeout (%d seconds) after partitioning.\n", pPars->TimeLimit ); diff --git a/src/proof/llb/llb2Driver.c b/src/proof/llb/llb2Driver.c index 4998b1ad..40d7a116 100644 --- a/src/proof/llb/llb2Driver.c +++ b/src/proof/llb/llb2Driver.c @@ -129,7 +129,8 @@ DdNode * Llb_DriverPhaseCube( Aig_Man_t * pAig, Vec_Int_t * vDriRefs, DdManager { DdNode * bCube, * bVar, * bTemp; Aig_Obj_t * pObj; - int i, TimeStop; + int i; + clock_t TimeStop; TimeStop = dd->TimeStop; dd->TimeStop = 0; bCube = Cudd_ReadOne( dd ); Cudd_Ref( bCube ); Saig_ManForEachLi( pAig, pObj, i ) @@ -159,7 +160,7 @@ DdNode * Llb_DriverPhaseCube( Aig_Man_t * pAig, Vec_Int_t * vDriRefs, DdManager SeeAlso [] ***********************************************************************/ -DdManager * Llb_DriverLastPartition( Aig_Man_t * p, Vec_Int_t * vVarsNs, int TimeTarget ) +DdManager * Llb_DriverLastPartition( Aig_Man_t * p, Vec_Int_t * vVarsNs, clock_t TimeTarget ) { // int fVerbose = 1; DdManager * dd; diff --git a/src/proof/llb/llb2Flow.c b/src/proof/llb/llb2Flow.c index 40ca19e5..f82fcf58 100644 --- a/src/proof/llb/llb2Flow.c +++ b/src/proof/llb/llb2Flow.c @@ -1226,7 +1226,8 @@ Vec_Ptr_t * Llb_ManComputeCuts( Aig_Man_t * p, int Num, int fVerbose, int fVeryV { int nVolMax = Aig_ManNodeNum(p) / Num; Vec_Ptr_t * vResult, * vMinCut = NULL, * vLower, * vUpper; - int i, k, nVol, clk = clock(); + int i, k, nVol; + clock_t clk = clock(); vResult = Vec_PtrAlloc( 100 ); Vec_PtrPush( vResult, Llb_ManComputeCutLo(p) ); Vec_PtrPush( vResult, Llb_ManComputeCutLi(p) ); diff --git a/src/proof/llb/llb2Image.c b/src/proof/llb/llb2Image.c index 99ffbdc4..cfaef13c 100644 --- a/src/proof/llb/llb2Image.c +++ b/src/proof/llb/llb2Image.c @@ -179,7 +179,7 @@ void Llb_ImgSchedule( Vec_Ptr_t * vSupps, Vec_Ptr_t ** pvQuant0, Vec_Ptr_t ** pv SeeAlso [] ***********************************************************************/ -DdManager * Llb_ImgPartition( Aig_Man_t * p, Vec_Ptr_t * vLower, Vec_Ptr_t * vUpper, int TimeTarget ) +DdManager * Llb_ImgPartition( Aig_Man_t * p, Vec_Ptr_t * vLower, Vec_Ptr_t * vUpper, clock_t TimeTarget ) { Vec_Ptr_t * vNodes, * vRange; Aig_Obj_t * pObj; @@ -259,7 +259,8 @@ DdNode * Llb_ImgComputeCube( Aig_Man_t * pAig, Vec_Int_t * vNodeIds, DdManager * { DdNode * bProd, * bTemp; Aig_Obj_t * pObj; - int i, TimeStop; + int i; + clock_t TimeStop; TimeStop = dd->TimeStop; dd->TimeStop = 0; bProd = Cudd_ReadOne(dd); Cudd_Ref( bProd ); Aig_ManForEachObjVec( vNodeIds, pAig, pObj, i ) @@ -287,7 +288,8 @@ void Llb_ImgQuantifyFirst( Aig_Man_t * pAig, Vec_Ptr_t * vDdMans, Vec_Ptr_t * vQ { DdManager * dd; DdNode * bProd, * bRes, * bTemp; - int i, clk = clock(); + int i; + clock_t clk = clock(); Vec_PtrForEachEntry( DdManager *, vDdMans, dd, i ) { // remember unquantified ones @@ -360,12 +362,13 @@ void Llb_ImgQuantifyReset( Vec_Ptr_t * vDdMans ) ***********************************************************************/ DdNode * Llb_ImgComputeImage( Aig_Man_t * pAig, Vec_Ptr_t * vDdMans, DdManager * dd, DdNode * bInit, Vec_Ptr_t * vQuant0, Vec_Ptr_t * vQuant1, Vec_Int_t * vDriRefs, - int TimeTarget, int fBackward, int fReorder, int fVerbose ) + clock_t TimeTarget, int fBackward, int fReorder, int fVerbose ) { // int fCheckSupport = 0; DdManager * ddPart; DdNode * bImage, * bGroup, * bCube, * bTemp; - int i, clk, clk0 = clock(); + int i; + clock_t clk, clk0 = clock(); bImage = bInit; Cudd_Ref( bImage ); if ( fBackward ) diff --git a/src/proof/llb/llb3Image.c b/src/proof/llb/llb3Image.c index 708af6d5..dcce8441 100644 --- a/src/proof/llb/llb3Image.c +++ b/src/proof/llb/llb3Image.c @@ -79,7 +79,7 @@ static inline Llb_Prt_t * Llb_MgrPart( Llb_Mgr_t * p, int i ) { return p->pPart for ( i = 0; (i < Vec_IntSize(pVar->vParts)) && (((pPart) = Llb_MgrPart(p, Vec_IntEntry(pVar->vParts,i))), 1); i++ ) // statistics -int timeBuild, timeAndEx, timeOther; +clock_t timeBuild, timeAndEx, timeOther; int nSuppMax; //////////////////////////////////////////////////////////////////////// @@ -140,7 +140,8 @@ DdNode * Llb_NonlinCreateCube1( Llb_Mgr_t * p, Llb_Prt_t * pPart ) { DdNode * bCube, * bTemp; Llb_Var_t * pVar; - int i, TimeStop; + int i; + clock_t TimeStop; TimeStop = p->dd->TimeStop; p->dd->TimeStop = 0; bCube = Cudd_ReadOne(p->dd); Cudd_Ref( bCube ); Llb_PartForEachVar( p, pPart, pVar, i ) @@ -172,7 +173,8 @@ DdNode * Llb_NonlinCreateCube2( Llb_Mgr_t * p, Llb_Prt_t * pPart1, Llb_Prt_t * p { DdNode * bCube, * bTemp; Llb_Var_t * pVar; - int i, TimeStop; + int i; + clock_t TimeStop; TimeStop = p->dd->TimeStop; p->dd->TimeStop = 0; bCube = Cudd_ReadOne(p->dd); Cudd_Ref( bCube ); Llb_PartForEachVar( p, pPart1, pVar, i ) @@ -337,7 +339,7 @@ int Llb_NonlinQuantify1( Llb_Mgr_t * p, Llb_Prt_t * pPart, int fSubset ) SeeAlso [] ***********************************************************************/ -int Llb_NonlinQuantify2( Llb_Mgr_t * p, Llb_Prt_t * pPart1, Llb_Prt_t * pPart2, int Limit, int TimeOut ) +int Llb_NonlinQuantify2( Llb_Mgr_t * p, Llb_Prt_t * pPart1, Llb_Prt_t * pPart2 ) { int fVerbose = 0; Llb_Var_t * pVar; @@ -373,7 +375,7 @@ Extra_bddPrintSupport( p->dd, bCube ); printf( "\n" ); RetValue = Llb_NonlinQuantify1( p, pPart2, 1 ); if ( RetValue ) Limit = Limit + 1000; - Llb_NonlinQuantify2( p, pPart1, pPart2, Limit, TimeOut ); + Llb_NonlinQuantify2( p, pPart1, pPart2 ); return 0; } Cudd_Ref( bFunc ); @@ -537,7 +539,7 @@ Vec_Ptr_t * Llb_NonlinCutNodes( Aig_Man_t * p, Vec_Ptr_t * vLower, Vec_Ptr_t * v SeeAlso [] ***********************************************************************/ -Vec_Ptr_t * Llb_NonlinBuildBdds( Aig_Man_t * p, Vec_Ptr_t * vLower, Vec_Ptr_t * vUpper, DdManager * dd, int TimeOut ) +Vec_Ptr_t * Llb_NonlinBuildBdds( Aig_Man_t * p, Vec_Ptr_t * vLower, Vec_Ptr_t * vUpper, DdManager * dd ) { Vec_Ptr_t * vNodes, * vResult; Aig_Obj_t * pObj; @@ -655,13 +657,13 @@ void Llb_NonlinAddPartition( Llb_Mgr_t * p, int i, DdNode * bFunc ) SeeAlso [] ***********************************************************************/ -int Llb_NonlinStart( Llb_Mgr_t * p, int TimeOut ) +int Llb_NonlinStart( Llb_Mgr_t * p ) { Vec_Ptr_t * vRootBdds; DdNode * bFunc; int i; // create and collect BDDs - vRootBdds = Llb_NonlinBuildBdds( p->pAig, p->vLeaves, p->vRoots, p->dd, TimeOut ); // come referenced + vRootBdds = Llb_NonlinBuildBdds( p->pAig, p->vLeaves, p->vRoots, p->dd ); // come referenced if ( vRootBdds == NULL ) return 0; // add pairs (refs are consumed inside) @@ -745,7 +747,7 @@ int Llb_NonlinNextPartitions( Llb_Mgr_t * p, Llb_Prt_t ** ppPart1, Llb_Prt_t ** ***********************************************************************/ void Llb_NonlinReorder( DdManager * dd, int fTwice, int fVerbose ) { - int clk = clock(); + clock_t clk = clock(); if ( fVerbose ) Abc_Print( 1, "Reordering... Before =%5d. ", Cudd_ReadKeys(dd) - Cudd_ReadDead(dd) ); Cudd_ReduceHeap( dd, CUDD_REORDER_SYMM_SIFT, 100 ); @@ -880,17 +882,17 @@ void Llb_NonlinFree( Llb_Mgr_t * p ) ***********************************************************************/ DdNode * Llb_NonlinImage( Aig_Man_t * pAig, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vRoots, int * pVars2Q, - DdManager * dd, DdNode * bCurrent, int fReorder, int fVerbose, int * pOrder, int Limit, int TimeOut ) + DdManager * dd, DdNode * bCurrent, int fReorder, int fVerbose, int * pOrder ) { Llb_Prt_t * pPart, * pPart1, * pPart2; Llb_Mgr_t * p; DdNode * bFunc, * bTemp; int i, nReorders, timeInside; - int clk = clock(), clk2; + clock_t clk = clock(), clk2; // start the manager clk2 = clock(); p = Llb_NonlinAlloc( pAig, vLeaves, vRoots, pVars2Q, dd ); - if ( !Llb_NonlinStart( p, TimeOut ) ) + if ( !Llb_NonlinStart( p ) ) { Llb_NonlinFree( p ); return NULL; @@ -913,7 +915,7 @@ DdNode * Llb_NonlinImage( Aig_Man_t * pAig, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vRo { clk2 = clock(); nReorders = Cudd_ReadReorderings(dd); - if ( !Llb_NonlinQuantify2( p, pPart1, pPart2, Limit, TimeOut ) ) + if ( !Llb_NonlinQuantify2( p, pPart1, pPart2 ) ) { Llb_NonlinFree( p ); return NULL; @@ -958,10 +960,10 @@ static Llb_Mgr_t * p = NULL; SeeAlso [] ***********************************************************************/ -DdManager * Llb_NonlinImageStart( Aig_Man_t * pAig, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vRoots, int * pVars2Q, int * pOrder, int fFirst, int TimeTarget ) +DdManager * Llb_NonlinImageStart( Aig_Man_t * pAig, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vRoots, int * pVars2Q, int * pOrder, int fFirst, clock_t TimeTarget ) { DdManager * dd; - int clk = clock(); + clock_t clk = clock(); assert( p == NULL ); // start a new manager (disable reordering) dd = Cudd_Init( Aig_ManObjNumMax(pAig), 0, CUDD_UNIQUE_SLOTS, CUDD_CACHE_SLOTS, 0 ); @@ -971,7 +973,7 @@ DdManager * Llb_NonlinImageStart( Aig_Man_t * pAig, Vec_Ptr_t * vLeaves, Vec_Ptr Cudd_AutodynEnable( dd, CUDD_REORDER_SYMM_SIFT ); // start the manager p = Llb_NonlinAlloc( pAig, vLeaves, vRoots, pVars2Q, dd ); - if ( !Llb_NonlinStart( p, 0 ) ) + if ( !Llb_NonlinStart( p ) ) { Llb_NonlinFree( p ); p = NULL; @@ -999,7 +1001,7 @@ DdNode * Llb_NonlinImageCompute( DdNode * bCurrent, int fReorder, int fDrop, int Llb_Prt_t * pPart, * pPart1, * pPart2; DdNode * bFunc, * bTemp; int i, nReorders, timeInside = 0; - int clk = clock(), clk2; + clock_t clk = clock(), clk2; // add partition Llb_NonlinAddPartition( p, p->iPartFree++, bCurrent ); @@ -1020,7 +1022,7 @@ DdNode * Llb_NonlinImageCompute( DdNode * bCurrent, int fReorder, int fDrop, int { clk2 = clock(); nReorders = Cudd_ReadReorderings(p->dd); - if ( !Llb_NonlinQuantify2( p, pPart1, pPart2, 0, 0 ) ) + if ( !Llb_NonlinQuantify2( p, pPart1, pPart2 ) ) { Llb_NonlinFree( p ); return NULL; diff --git a/src/proof/llb/llb3Nonlin.c b/src/proof/llb/llb3Nonlin.c index 38d9b8ae..48724136 100644 --- a/src/proof/llb/llb3Nonlin.c +++ b/src/proof/llb/llb3Nonlin.c @@ -54,14 +54,14 @@ struct Llb_Mnn_t_ int ddLocReos; int ddLocGrbs; - int timeImage; - int timeTran1; - int timeTran2; - int timeGloba; - int timeOther; - int timeTotal; - int timeReo; - int timeReoG; + clock_t timeImage; + clock_t timeTran1; + clock_t timeTran2; + clock_t timeGloba; + clock_t timeOther; + clock_t timeTotal; + clock_t timeReo; + clock_t timeReoG; }; @@ -90,7 +90,7 @@ int Llb_NonlinFindBestVar( DdManager * dd, DdNode * bFunc, Aig_Man_t * pAig ) DdNode * bCof, * bVar; int i, iVar, iVarBest = -1, iValue, iValueBest = ABC_INFINITY, Size0Best = -1; int Size, Size0, Size1; - int clk = clock(); + clock_t clk = clock(); Size = Cudd_DagSize(bFunc); // printf( "Original = %6d. SuppSize = %3d. Vars = %3d.\n", // Size = Cudd_DagSize(bFunc), Cudd_SupportSize(dd, bFunc), Aig_ManRegNum(pAig) ); @@ -215,7 +215,8 @@ DdNode * Llb_NonlinComputeInitState( Aig_Man_t * pAig, DdManager * dd ) { Aig_Obj_t * pObj; DdNode * bRes, * bVar, * bTemp; - int i, iVar, TimeStop; + int i, iVar; + clock_t TimeStop; TimeStop = dd->TimeStop; dd->TimeStop = 0; bRes = Cudd_ReadOne( dd ); Cudd_Ref( bRes ); Saig_ManForEachLo( pAig, pObj, i ) @@ -302,7 +303,7 @@ Abc_Cex_t * Llb_NonlinDeriveCex( Llb_Mnn_t * p ) //Extra_bddPrintSupport( p->dd, bRing ); printf( "\n" ); // compute the next states bImage = Llb_NonlinImage( p->pAig, p->vLeaves, p->vRoots, p->pVars2Q, p->dd, bState, - p->pPars->fReorder, p->pPars->fVeryVerbose, NULL, ABC_INFINITY, ABC_INFINITY ); // consumed reference + p->pPars->fReorder, p->pPars->fVeryVerbose, NULL ); // consumed reference assert( bImage != NULL ); Cudd_Ref( bImage ); //Extra_bddPrintSupport( p->dd, bImage ); printf( "\n" ); @@ -429,11 +430,11 @@ int Llb_NonlinReachability( Llb_Mnn_t * p ) { DdNode * bTemp, * bNext; int nIters, nBddSize0, nBddSize = -1, NumCmp;//, Limit = p->pPars->nBddMax; - int clk2, clk3, clk = clock(); + clock_t clk2, clk3, clk = clock(); assert( Aig_ManRegNum(p->pAig) > 0 ); // compute time to stop - p->pPars->TimeTarget = p->pPars->TimeLimit ? time(NULL) + p->pPars->TimeLimit : 0; + p->pPars->TimeTarget = p->pPars->TimeLimit ? p->pPars->TimeLimit * CLOCKS_PER_SEC + clock(): 0; // set the stop time parameter p->dd->TimeStop = p->pPars->TimeTarget; @@ -472,7 +473,7 @@ int Llb_NonlinReachability( Llb_Mnn_t * p ) { // check the runtime limit clk2 = clock(); - if ( p->pPars->TimeLimit && time(NULL) > p->pPars->TimeTarget ) + if ( p->pPars->TimeLimit && clock() > p->pPars->TimeTarget ) { if ( !p->pPars->fSilent ) printf( "Reached timeout (%d seconds) during image computation.\n", p->pPars->TimeLimit ); @@ -807,7 +808,7 @@ void Llb_NonlinExperiment( Aig_Man_t * pAig, int Num ) Llb_Mnn_t * pMnn; Gia_ParLlb_t Pars, * pPars = &Pars; Aig_Man_t * p; - int clk = clock(); + clock_t clk = clock(); Llb_ManSetDefaultParams( pPars ); pPars->fVerbose = 1; @@ -851,7 +852,7 @@ int Llb_NonlinCoreReach( Aig_Man_t * pAig, Gia_ParLlb_t * pPars ) if ( !pPars->fSkipReach ) { - int clk = clock(); + clock_t clk = clock(); pMnn = Llb_MnnStart( pAig, p, pPars ); RetValue = Llb_NonlinReachability( pMnn ); pMnn->timeTotal = clock() - clk; diff --git a/src/proof/llb/llb4Image.c b/src/proof/llb/llb4Image.c index 039be164..4ae087b5 100644 --- a/src/proof/llb/llb4Image.c +++ b/src/proof/llb/llb4Image.c @@ -77,7 +77,7 @@ static inline Llb_Prt_t * Llb_MgrPart( Llb_Mgr_t * p, int i ) { return p->pPart for ( i = 0; (i < Vec_IntSize(pVar->vParts)) && (((pPart) = Llb_MgrPart(p, Vec_IntEntry(pVar->vParts,i))), 1); i++ ) // statistics -//int timeBuild, timeAndEx, timeOther; +//clock_t timeBuild, timeAndEx, timeOther; //int nSuppMax; //////////////////////////////////////////////////////////////////////// @@ -139,7 +139,8 @@ DdNode * Llb_Nonlin4CreateCube1( Llb_Mgr_t * p, Llb_Prt_t * pPart ) { DdNode * bCube, * bTemp; Llb_Var_t * pVar; - int i, TimeStop; + int i; + clock_t TimeStop; TimeStop = p->dd->TimeStop; p->dd->TimeStop = 0; bCube = Cudd_ReadOne(p->dd); Cudd_Ref( bCube ); Llb_PartForEachVar( p, pPart, pVar, i ) @@ -171,7 +172,8 @@ DdNode * Llb_Nonlin4CreateCube2( Llb_Mgr_t * p, Llb_Prt_t * pPart1, Llb_Prt_t * { DdNode * bCube, * bTemp; Llb_Var_t * pVar; - int i, TimeStop; + int i; + clock_t TimeStop; TimeStop = p->dd->TimeStop; p->dd->TimeStop = 0; bCube = Cudd_ReadOne(p->dd); Cudd_Ref( bCube ); Llb_PartForEachVar( p, pPart1, pVar, i ) diff --git a/src/proof/llb/llb4Nonlin.c b/src/proof/llb/llb4Nonlin.c index af8dad75..f2973922 100644 --- a/src/proof/llb/llb4Nonlin.c +++ b/src/proof/llb/llb4Nonlin.c @@ -47,11 +47,11 @@ struct Llb_Mnx_t_ Vec_Int_t * vOrder; // for each object ID, its BDD variable number or -1 Vec_Int_t * vVars2Q; // 1 if variable is quantifiable; 0 othervise - int timeImage; - int timeRemap; - int timeReo; - int timeOther; - int timeTotal; + clock_t timeImage; + clock_t timeRemap; + clock_t timeReo; + clock_t timeOther; + clock_t timeTotal; }; //extern int timeBuild, timeAndEx, timeOther; @@ -446,7 +446,8 @@ DdNode * Llb_Nonlin4ComputeInitState( DdManager * dd, Aig_Man_t * pAig, Vec_Int_ { Aig_Obj_t * pObjLi, * pObjLo; DdNode * bRes, * bVar, * bTemp; - int i, TimeStop; + int i; + clock_t TimeStop; TimeStop = dd->TimeStop; dd->TimeStop = 0; bRes = Cudd_ReadOne( dd ); Cudd_Ref( bRes ); Saig_ManForEachLiLo( pAig, pObjLi, pObjLo, i ) @@ -475,7 +476,8 @@ DdNode * Llb_Nonlin4ComputeCube( DdManager * dd, Aig_Man_t * pAig, Vec_Int_t * v { Aig_Obj_t * pObjLo, * pObjLi, * pObjTemp; DdNode * bRes, * bVar, * bTemp; - int i, TimeStop; + int i; + clock_t TimeStop; TimeStop = dd->TimeStop; dd->TimeStop = 0; bRes = Cudd_ReadOne( dd ); Cudd_Ref( bRes ); Saig_ManForEachLiLo( pAig, pObjLi, pObjLo, i ) @@ -667,7 +669,7 @@ int Llb_Nonlin4Reachability( Llb_Mnx_t * p ) { DdNode * bAux; int nIters, nBddSizeFr = 0, nBddSizeTo = 0, nBddSizeTo2 = 0; - int clkTemp, clkIter, clk = clock(); + clock_t clkTemp, clkIter, clk = clock(); assert( Aig_ManRegNum(p->pAig) > 0 ); if ( p->pPars->fBackward ) @@ -736,7 +738,7 @@ int Llb_Nonlin4Reachability( Llb_Mnx_t * p ) { clkIter = clock(); // check the runtime limit - if ( p->pPars->TimeLimit && time(NULL) > p->pPars->TimeTarget ) + if ( p->pPars->TimeLimit && clock() > p->pPars->TimeTarget ) { if ( !p->pPars->fSilent ) printf( "Reached timeout (%d seconds) during image computation.\n", p->pPars->TimeLimit ); @@ -904,7 +906,7 @@ printf( "Before = %d. After = %d.\n", Cudd_DagSize(bAux), Cudd_DagSize(p->bCurr ***********************************************************************/ void Llb_Nonlin4Reorder( DdManager * dd, int fTwice, int fVerbose ) { - int clk = clock(); + clock_t clk = clock(); if ( fVerbose ) Abc_Print( 1, "Reordering... Before =%5d. ", Cudd_ReadKeys(dd) - Cudd_ReadDead(dd) ); Cudd_ReduceHeap( dd, CUDD_REORDER_SYMM_SIFT, 100 ); @@ -940,7 +942,7 @@ Llb_Mnx_t * Llb_MnxStart( Aig_Man_t * pAig, Gia_ParLlb_t * pPars ) p->pPars = pPars; // compute time to stop - p->pPars->TimeTarget = p->pPars->TimeLimit ? time(NULL) + p->pPars->TimeLimit : 0; + p->pPars->TimeTarget = p->pPars->TimeLimit ? p->pPars->TimeLimit * CLOCKS_PER_SEC + clock(): 0; if ( pPars->fCluster ) { @@ -1071,7 +1073,7 @@ int Llb_Nonlin4CoreReach( Aig_Man_t * pAig, Gia_ParLlb_t * pPars ) return RetValue; } { - int clk = clock(); + clock_t clk = clock(); pMnn = Llb_MnxStart( pAig, pPars ); //Llb_MnxCheckNextStateVars( pMnn ); if ( !pPars->fSkipReach ) diff --git a/src/proof/llb/llb4Sweep.c b/src/proof/llb/llb4Sweep.c index 6b223ab9..709bd61a 100644 --- a/src/proof/llb/llb4Sweep.c +++ b/src/proof/llb/llb4Sweep.c @@ -286,7 +286,8 @@ DdNode * Llb4_Nonlin4SweepBadMonitor( Aig_Man_t * pAig, Vec_Int_t * vOrder, DdMa { Aig_Obj_t * pObj; DdNode * bRes, * bVar, * bTemp; - int i, TimeStop; + int i; + clock_t TimeStop; TimeStop = dd->TimeStop; dd->TimeStop = 0; bRes = Cudd_ReadOne( dd ); Cudd_Ref( bRes ); Saig_ManForEachPo( pAig, pObj, i ) diff --git a/src/proof/llb/llbInt.h b/src/proof/llb/llbInt.h index d81aadcf..58e2b543 100644 --- a/src/proof/llb/llbInt.h +++ b/src/proof/llb/llbInt.h @@ -152,34 +152,34 @@ extern int Llb_ManReachability( Llb_Man_t * p, Vec_Int_t * vHints, D extern void Llb_MtrSchedule( Llb_Mtr_t * p ); /*=== llb2Bad.c ======================================================*/ -extern DdNode * Llb_BddComputeBad( Aig_Man_t * pInit, DdManager * dd, int TimeOut ); +extern DdNode * Llb_BddComputeBad( Aig_Man_t * pInit, DdManager * dd, clock_t TimeOut ); extern DdNode * Llb_BddQuantifyPis( Aig_Man_t * pInit, DdManager * dd, DdNode * bFunc ); /*=== llb2Core.c ======================================================*/ extern DdNode * Llb_CoreComputeCube( DdManager * dd, Vec_Int_t * vVars, int fUseVarIndex, char * pValues ); -extern int Llb_CoreExperiment( Aig_Man_t * pInit, Aig_Man_t * pAig, Gia_ParLlb_t * pPars, Vec_Ptr_t * vResult, int TimeTarget ); +extern int Llb_CoreExperiment( Aig_Man_t * pInit, Aig_Man_t * pAig, Gia_ParLlb_t * pPars, Vec_Ptr_t * vResult, clock_t TimeTarget ); /*=== llb2Driver.c ======================================================*/ extern Vec_Int_t * Llb_DriverCountRefs( Aig_Man_t * p ); extern Vec_Int_t * Llb_DriverCollectNs( Aig_Man_t * pAig, Vec_Int_t * vDriRefs ); extern Vec_Int_t * Llb_DriverCollectCs( Aig_Man_t * pAig ); extern DdNode * Llb_DriverPhaseCube( Aig_Man_t * pAig, Vec_Int_t * vDriRefs, DdManager * dd ); -extern DdManager * Llb_DriverLastPartition( Aig_Man_t * p, Vec_Int_t * vVarsNs, int TimeTarget ); +extern DdManager * Llb_DriverLastPartition( Aig_Man_t * p, Vec_Int_t * vVarsNs, clock_t TimeTarget ); /*=== llb2Image.c ======================================================*/ extern Vec_Ptr_t * Llb_ImgSupports( Aig_Man_t * p, Vec_Ptr_t * vDdMans, Vec_Int_t * vStart, Vec_Int_t * vStop, int fAddPis, int fVerbose ); extern void Llb_ImgSchedule( Vec_Ptr_t * vSupps, Vec_Ptr_t ** pvQuant0, Vec_Ptr_t ** pvQuant1, int fVerbose ); -extern DdManager * Llb_ImgPartition( Aig_Man_t * p, Vec_Ptr_t * vLower, Vec_Ptr_t * vUpper, int TimeTarget ); +extern DdManager * Llb_ImgPartition( Aig_Man_t * p, Vec_Ptr_t * vLower, Vec_Ptr_t * vUpper, clock_t TimeTarget ); extern void Llb_ImgQuantifyFirst( Aig_Man_t * pAig, Vec_Ptr_t * vDdMans, Vec_Ptr_t * vQuant0, int fVerbose ); extern void Llb_ImgQuantifyReset( Vec_Ptr_t * vDdMans ); extern DdNode * Llb_ImgComputeImage( Aig_Man_t * pAig, Vec_Ptr_t * vDdMans, DdManager * dd, DdNode * bInit, Vec_Ptr_t * vQuant0, Vec_Ptr_t * vQuant1, Vec_Int_t * vDriRefs, - int TimeTarget, int fBackward, int fReorder, int fVerbose ); + clock_t TimeTarget, int fBackward, int fReorder, int fVerbose ); -extern DdManager * Llb_NonlinImageStart( Aig_Man_t * pAig, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vRoots, int * pVars2Q, int * pOrder, int fFirst, int TimeTarget ); +extern DdManager * Llb_NonlinImageStart( Aig_Man_t * pAig, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vRoots, int * pVars2Q, int * pOrder, int fFirst, clock_t TimeTarget ); extern DdNode * Llb_NonlinImageCompute( DdNode * bCurrent, int fReorder, int fDrop, int fVerbose, int * pOrder ); extern void Llb_NonlinImageQuit(); /*=== llb3Image.c =======================================================*/ extern DdNode * Llb_NonlinImage( Aig_Man_t * pAig, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vRoots, int * pVars2Q, - DdManager * dd, DdNode * bCurrent, int fReorder, int fVerbose, int * pOrder, int Limit, int TimeTarget ); + DdManager * dd, DdNode * bCurrent, int fReorder, int fVerbose, int * pOrder ); /*=== llb3Nonlin.c ======================================================*/ extern DdNode * Llb_NonlinComputeInitState( Aig_Man_t * pAig, DdManager * dd ); diff --git a/src/proof/pdr/pdrCore.c b/src/proof/pdr/pdrCore.c index 9cecbd78..765894e3 100644 --- a/src/proof/pdr/pdrCore.c +++ b/src/proof/pdr/pdrCore.c @@ -418,7 +418,8 @@ int Pdr_ManBlockCube( Pdr_Man_t * p, Pdr_Set_t * pCube ) Pdr_Obl_t * pThis; Pdr_Set_t * pPred, * pCubeMin; int i, k, RetValue, Prio = ABC_INFINITY, Counter = 0; - int kMax = Vec_PtrSize(p->vSolvers)-1, clk; + int kMax = Vec_PtrSize(p->vSolvers)-1; + clock_t clk; p->nBlocks++; // create first proof obligation assert( p->pQueue == NULL ); @@ -528,7 +529,7 @@ int Pdr_ManBlockCube( Pdr_Man_t * p, Pdr_Set_t * pCube ) } // check the timeout - if ( p->timeToStop && time(NULL) > p->timeToStop ) + if ( p->timeToStop && clock() > p->timeToStop ) return -1; } return 1; @@ -551,7 +552,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p ) Pdr_Set_t * pCube; int k, RetValue = -1; clock_t clkStart = clock(); - p->timeToStop = p->pPars->nTimeOut ? time(NULL) + p->pPars->nTimeOut : 0; + p->timeToStop = p->pPars->nTimeOut ? p->pPars->nTimeOut * CLOCKS_PER_SEC + clock(): 0; assert( Vec_PtrSize(p->vSolvers) == 0 ); // create the first timeframe Pdr_ManCreateSolver( p, (k = 0) ); @@ -633,7 +634,7 @@ int Pdr_ManSolveInt( Pdr_Man_t * p ) } // check the timeout - if ( p->timeToStop && time(NULL) > p->timeToStop ) + if ( p->timeToStop && clock() > p->timeToStop ) { if ( fPrintClauses ) { diff --git a/src/proof/ssw/sswBmc.c b/src/proof/ssw/sswBmc.c index ff428fa1..4fa9c07a 100644 --- a/src/proof/ssw/sswBmc.c +++ b/src/proof/ssw/sswBmc.c @@ -128,7 +128,8 @@ int Ssw_BmcDynamic( Aig_Man_t * pAig, int nFramesMax, int nConfLimit, int fVerbo Ssw_Frm_t * pFrm; Ssw_Sat_t * pSat; Aig_Obj_t * pObj, * pObjFrame; - int status, clkPart, Lit, i, f, RetValue; + int status, Lit, i, f, RetValue; + clock_t clkPart; // start managers assert( Saig_ManRegNum(pAig) > 0 ); diff --git a/src/proof/ssw/sswClass.c b/src/proof/ssw/sswClass.c index 581b8aed..28c4947a 100644 --- a/src/proof/ssw/sswClass.c +++ b/src/proof/ssw/sswClass.c @@ -610,7 +610,8 @@ Ssw_Cla_t * Ssw_ClassesPrepare( Aig_Man_t * pAig, int nFramesK, int fLatchCorr, Ssw_Sml_t * pSml; Vec_Ptr_t * vCands; Aig_Obj_t * pObj; - int i, k, RetValue, clk; + int i, k, RetValue; + clock_t clk; // start the classes p = Ssw_ClassesStart( pAig ); diff --git a/src/proof/ssw/sswConstr.c b/src/proof/ssw/sswConstr.c index 82977edb..5459aa72 100644 --- a/src/proof/ssw/sswConstr.c +++ b/src/proof/ssw/sswConstr.c @@ -408,7 +408,8 @@ int Ssw_ManSweepBmcConstr_old( Ssw_Man_t * p ) { Bar_Progress_t * pProgress = NULL; Aig_Obj_t * pObj, * pObjNew, * pObjLi, * pObjLo; - int i, f, iLits, clk; + int i, f, iLits; + clock_t clk; clk = clock(); // start initialized timeframes @@ -497,7 +498,8 @@ p->timeBmc += clock() - clk; int Ssw_ManSweepBmcConstr( Ssw_Man_t * p ) { Aig_Obj_t * pObj, * pObjNew, * pObjLi, * pObjLo; - int i, f, iLits, clk; + int i, f, iLits; + clock_t clk; clk = clock(); // start initialized timeframes @@ -618,7 +620,8 @@ int Ssw_ManSweepConstr( Ssw_Man_t * p ) { Bar_Progress_t * pProgress = NULL; Aig_Obj_t * pObj, * pObj2, * pObjNew; - int nConstrPairs, clk, i, f, iLits; + int nConstrPairs, i, f, iLits; + clock_t clk; //Ssw_ManPrintPolarity( p->pAig ); // perform speculative reduction diff --git a/src/proof/ssw/sswCore.c b/src/proof/ssw/sswCore.c index c51d421c..b27e7eaf 100644 --- a/src/proof/ssw/sswCore.c +++ b/src/proof/ssw/sswCore.c @@ -236,7 +236,7 @@ Aig_Man_t * Ssw_SignalCorrespondenceRefine( Ssw_Man_t * p ) int nSatProof, nSatCallsSat, nRecycles, nSatFailsReal, nUniques; Aig_Man_t * pAigNew; int RetValue, nIter = -1; - int clk, clkTotal = clock(); + clock_t clk, clkTotal = clock(); // get the starting stats p->nLitsBeg = Ssw_ClassesLitNum( p->ppClasses ); p->nNodesBeg = Aig_ManNodeNum(p->pAig); diff --git a/src/proof/ssw/sswDyn.c b/src/proof/ssw/sswDyn.c index 617bb40f..760f457a 100644 --- a/src/proof/ssw/sswDyn.c +++ b/src/proof/ssw/sswDyn.c @@ -262,7 +262,8 @@ void Ssw_ManSweepTransferDyn( Ssw_Man_t * p ) ***********************************************************************/ int Ssw_ManSweepResimulateDyn( Ssw_Man_t * p, int f ) { - int RetValue1, RetValue2, clk = clock(); + int RetValue1, RetValue2; + clock_t clk = clock(); // transfer PI simulation information from storage // Ssw_SmlAssignDist1Plus( p->pSml, p->pPatWords ); Ssw_ManSweepTransferDyn( p ); @@ -294,7 +295,8 @@ p->timeSimSat += clock() - clk; int Ssw_ManSweepResimulateDynLocal( Ssw_Man_t * p, int f ) { Aig_Obj_t * pObj, * pRepr, ** ppClass; - int i, k, nSize, RetValue1, RetValue2, clk = clock(); + int i, k, nSize, RetValue1, RetValue2; + clock_t clk = clock(); p->nSimRounds++; // transfer PI simulation information from storage // Ssw_SmlAssignDist1Plus( p->pSml, p->pPatWords ); @@ -372,7 +374,8 @@ int Ssw_ManSweepDyn( Ssw_Man_t * p ) { Bar_Progress_t * pProgress = NULL; Aig_Obj_t * pObj, * pObjNew; - int clk, i, f; + int i, f; + clock_t clk; // perform speculative reduction clk = clock(); diff --git a/src/proof/ssw/sswFilter.c b/src/proof/ssw/sswFilter.c index 5f467123..3fff79bb 100644 --- a/src/proof/ssw/sswFilter.c +++ b/src/proof/ssw/sswFilter.c @@ -278,7 +278,8 @@ Aig_Obj_t * Ssw_ManSweepBmcFilter_rec( Ssw_Man_t * p, Aig_Obj_t * pObj, int f ) int Ssw_ManSweepBmcFilter( Ssw_Man_t * p, int TimeLimit ) { Aig_Obj_t * pObj, * pObjNew, * pObjLi, * pObjLo; - int f, f1, i, clkTotal = clock(); + int f, f1, i; + clock_t clkTotal = clock(); // start initialized timeframes p->pFrames = Aig_ManStart( Aig_ManObjNumMax(p->pAig) * p->pPars->nFramesK ); Saig_ManForEachLo( p->pAig, pObj, i ) @@ -383,7 +384,7 @@ void Ssw_SignalFilter( Aig_Man_t * pAig, int nFramesMax, int nConfMax, int nRoun Ssw_Pars_t Pars, * pPars = &Pars; Ssw_Man_t * p; int r, TimeLimitPart;//, clkTotal = clock(); - int nTimeToStop = TimeLimit ? TimeLimit + time(NULL) : 0; + clock_t nTimeToStop = TimeLimit ? TimeLimit * CLOCKS_PER_SEC + clock(): 0; assert( Aig_ManRegNum(pAig) > 0 ); assert( Aig_ManConstrNum(pAig) == 0 ); // consider the case of empty AIG @@ -429,7 +430,7 @@ void Ssw_SignalFilter( Aig_Man_t * pAig, int nFramesMax, int nConfMax, int nRoun Ssw_ClassesPrint( p->ppClasses, 0 ); } p->pMSat = Ssw_SatStart( 0 ); - TimeLimitPart = TimeLimit ? nTimeToStop - time(NULL) : 0; + TimeLimitPart = TimeLimit ? (nTimeToStop - clock()) / CLOCKS_PER_SEC : 0; if ( TimeLimit2 ) { if ( TimeLimitPart ) @@ -444,7 +445,7 @@ void Ssw_SignalFilter( Aig_Man_t * pAig, int nFramesMax, int nConfMax, int nRoun // simulate pattern forward Ssw_ManRollForward( p, p->pPars->nFramesK ); // check timeout - if ( TimeLimit && time(NULL) > nTimeToStop ) + if ( TimeLimit && clock() > nTimeToStop ) { printf( "Reached timeout (%d seconds).\n", TimeLimit ); break; diff --git a/src/proof/ssw/sswInt.h b/src/proof/ssw/sswInt.h index acd273fd..8749cec1 100644 --- a/src/proof/ssw/sswInt.h +++ b/src/proof/ssw/sswInt.h @@ -127,16 +127,16 @@ struct Ssw_Man_t_ int nRegsBegC; int nRegsEndC; // runtime stats - int timeBmc; // bounded model checking - int timeReduce; // speculative reduction - int timeMarkCones; // marking the cones not to be refined - int timeSimSat; // simulation of the counter-examples - int timeSat; // solving SAT - int timeSatSat; // sat - int timeSatUnsat; // unsat - int timeSatUndec; // undecided - int timeOther; // other runtime - int timeTotal; // total runtime + clock_t timeBmc; // bounded model checking + clock_t timeReduce; // speculative reduction + clock_t timeMarkCones; // marking the cones not to be refined + clock_t timeSimSat; // simulation of the counter-examples + clock_t timeSat; // solving SAT + clock_t timeSatSat; // sat + clock_t timeSatUnsat; // unsat + clock_t timeSatUndec; // undecided + clock_t timeOther; // other runtime + clock_t timeTotal; // total runtime }; // internal SAT manager diff --git a/src/proof/ssw/sswIslands.c b/src/proof/ssw/sswIslands.c index 8f54432d..97e9cf54 100644 --- a/src/proof/ssw/sswIslands.c +++ b/src/proof/ssw/sswIslands.c @@ -479,7 +479,8 @@ int Ssw_SecWithSimilarityPairs( Aig_Man_t * p0, Aig_Man_t * p1, Vec_Int_t * vPai { Ssw_Pars_t Pars; Aig_Man_t * pAigRes; - int RetValue, clk = clock(); + int RetValue; + clock_t clk = clock(); // derive parameters if not given if ( pPars == NULL ) Ssw_ManSetDefaultParams( pPars = &Pars ); diff --git a/src/proof/ssw/sswLcorr.c b/src/proof/ssw/sswLcorr.c index 71f148e3..e58e9b50 100644 --- a/src/proof/ssw/sswLcorr.c +++ b/src/proof/ssw/sswLcorr.c @@ -77,7 +77,8 @@ void Ssw_ManSweepTransfer( Ssw_Man_t * p ) ***********************************************************************/ int Ssw_ManSweepResimulate( Ssw_Man_t * p ) { - int RetValue1, RetValue2, clk = clock(); + int RetValue1, RetValue2; + clock_t clk = clock(); // transfer PI simulation information from storage Ssw_ManSweepTransfer( p ); // simulate internal nodes @@ -159,7 +160,8 @@ void Ssw_ManBuildCone_rec( Ssw_Man_t * p, Aig_Obj_t * pObj ) void Ssw_ManSweepLatchOne( Ssw_Man_t * p, Aig_Obj_t * pObjRepr, Aig_Obj_t * pObj ) { Aig_Obj_t * pObjFraig, * pObjReprFraig, * pObjLi; - int RetValue, clk; + int RetValue; + clock_t clk; assert( Aig_ObjIsCi(pObj) ); assert( Aig_ObjIsCi(pObjRepr) || Aig_ObjIsConst1(pObjRepr) ); // check if it makes sense to skip some calls diff --git a/src/proof/ssw/sswPairs.c b/src/proof/ssw/sswPairs.c index e356aa60..e4228685 100644 --- a/src/proof/ssw/sswPairs.c +++ b/src/proof/ssw/sswPairs.c @@ -320,7 +320,8 @@ Aig_Man_t * Ssw_SignalCorrespondeceTestPairs( Aig_Man_t * pAig ) Ssw_Pars_t Pars, * pPars = &Pars; Vec_Int_t * vIds1, * vIds2; Aig_Obj_t * pObj, * pRepr; - int RetValue, i, clk = clock(); + int RetValue, i; + clock_t clk = clock(); Ssw_ManSetDefaultParams( pPars ); pPars->fVerbose = 1; pAigNew = Ssw_SignalCorrespondence( pAig, pPars ); @@ -379,7 +380,8 @@ Aig_Man_t * Ssw_SignalCorrespondeceTestPairs( Aig_Man_t * pAig ) int Ssw_SecWithPairs( Aig_Man_t * pAig1, Aig_Man_t * pAig2, Vec_Int_t * vIds1, Vec_Int_t * vIds2, Ssw_Pars_t * pPars ) { Aig_Man_t * pAigRes; - int RetValue, clk = clock(); + int RetValue; + clock_t clk = clock(); assert( vIds1 != NULL && vIds2 != NULL ); // try the new AIGs printf( "Performing specialized verification with node pairs.\n" ); @@ -413,7 +415,8 @@ int Ssw_SecWithPairs( Aig_Man_t * pAig1, Aig_Man_t * pAig2, Vec_Int_t * vIds1, V int Ssw_SecGeneral( Aig_Man_t * pAig1, Aig_Man_t * pAig2, Ssw_Pars_t * pPars ) { Aig_Man_t * pAigRes, * pMiter; - int RetValue, clk = clock(); + int RetValue; + clock_t clk = clock(); // try the new AIGs printf( "Performing general verification without node pairs.\n" ); pMiter = Saig_ManCreateMiter( pAig1, pAig2, 0 ); @@ -449,7 +452,8 @@ int Ssw_SecGeneral( Aig_Man_t * pAig1, Aig_Man_t * pAig2, Ssw_Pars_t * pPars ) int Ssw_SecGeneralMiter( Aig_Man_t * pMiter, Ssw_Pars_t * pPars ) { Aig_Man_t * pAigRes; - int RetValue, clk = clock(); + int RetValue; + clock_t clk = clock(); // try the new AIGs // printf( "Performing general verification without node pairs.\n" ); pAigRes = Ssw_SignalCorrespondence( pMiter, pPars ); diff --git a/src/proof/ssw/sswPart.c b/src/proof/ssw/sswPart.c index 5a3aea10..22340779 100644 --- a/src/proof/ssw/sswPart.c +++ b/src/proof/ssw/sswPart.c @@ -53,7 +53,7 @@ Aig_Man_t * Ssw_SignalCorrespondencePart( Aig_Man_t * pAig, Ssw_Pars_t * pPars ) int * pMapBack; int i, nCountPis, nCountRegs; int nClasses, nPartSize, fVerbose; - int clk = clock(); + clock_t clk = clock(); if ( pPars->fConstrs ) { printf( "Cannot use partitioned computation with constraints.\n" ); diff --git a/src/proof/ssw/sswRarity.c b/src/proof/ssw/sswRarity.c index 032bc5ba..7048927f 100644 --- a/src/proof/ssw/sswRarity.c +++ b/src/proof/ssw/sswRarity.c @@ -286,7 +286,8 @@ void transpose64Simple( word A[64], word B[64] ) void TransposeTest() { word M[64], N[64]; - int i, clk; + int i; + clock_t clk; Aig_ManRandom64( 1 ); // for ( i = 0; i < 64; i++ ) // M[i] = Aig_ManRandom64( 0 ); @@ -896,8 +897,9 @@ int Ssw_RarSimulate( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize, in int fTryBmc = 0; int fMiter = 1; Ssw_RarMan_t * p; - int r, f = -1, clk, clkTotal = clock(); - int nTimeToStop = time(NULL) + TimeOut; + int r, f = -1; + clock_t clk, clkTotal = clock(); + clock_t nTimeToStop = TimeOut ? TimeOut * CLOCKS_PER_SEC + clock(): 0; int RetValue = -1; int iFrameFail = -1; assert( Aig_ManRegNum(pAig) > 0 ); @@ -945,7 +947,7 @@ int Ssw_RarSimulate( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize, in goto finish; } // check timeout - if ( TimeOut && time(NULL) > nTimeToStop ) + if ( TimeOut && clock() > nTimeToStop ) { if ( fVerbose ) printf( "\n" ); printf( "Reached timeout (%d seconds).\n", TimeOut ); @@ -1013,8 +1015,9 @@ int Ssw_RarSimulateGia( Gia_Man_t * p, int nFrames, int nWords, int nBinSize, in int Ssw_RarSignalFilter( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize, int nRounds, int nRandSeed, int TimeOut, int fMiter, Abc_Cex_t * pCex, int fLatchOnly, int fVerbose ) { Ssw_RarMan_t * p; - int r, f = -1, i, k, clkTotal = clock(); - int nTimeToStop = time(NULL) + TimeOut; + int r, f = -1, i, k; + clock_t clkTotal = clock(); + clock_t nTimeToStop = TimeOut ? TimeOut * CLOCKS_PER_SEC + clock(): 0; int RetValue = -1; assert( Aig_ManRegNum(pAig) > 0 ); assert( Aig_ManConstrNum(pAig) == 0 ); @@ -1084,7 +1087,7 @@ int Ssw_RarSignalFilter( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize goto finish; } // check timeout - if ( TimeOut && time(NULL) > nTimeToStop ) + if ( TimeOut && clock() > nTimeToStop ) { if ( fVerbose ) printf( "\n" ); printf( "Reached timeout (%d seconds).\n", TimeOut ); diff --git a/src/proof/ssw/sswRarity2.c b/src/proof/ssw/sswRarity2.c index 0851cf3d..1d93de60 100644 --- a/src/proof/ssw/sswRarity2.c +++ b/src/proof/ssw/sswRarity2.c @@ -308,8 +308,9 @@ int Ssw_RarSimulate2( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize, i { int fMiter = 1; Ssw_RarMan_t * p; - int r, clk, clkTotal = clock(); - int nTimeToStop = time(NULL) + TimeOut; + int r; + clock_t clk, clkTotal = clock(); + clock_t nTimeToStop = TimeOut ? TimeOut * CLOCKS_PER_SEC + clock(): 0; int RetValue = -1; assert( Aig_ManRegNum(pAig) > 0 ); assert( Aig_ManConstrNum(pAig) == 0 ); @@ -352,7 +353,7 @@ int Ssw_RarSimulate2( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSize, i printf( "." ); } // check timeout - if ( TimeOut && time(NULL) > nTimeToStop ) + if ( TimeOut && clock() > nTimeToStop ) { if ( fVerbose ) printf( "\n" ); printf( "Reached timeout (%d seconds).\n", TimeOut ); @@ -386,8 +387,9 @@ int Ssw_RarSignalFilter2( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSiz { int fMiter = 0; Ssw_RarMan_t * p; - int r, i, k, clkTotal = clock(); - int nTimeToStop = time(NULL) + TimeOut; + int r, i, k; + clock_t clkTotal = clock(); + clock_t nTimeToStop = TimeOut ? TimeOut * CLOCKS_PER_SEC + clock(): 0; int RetValue = -1; assert( Aig_ManRegNum(pAig) > 0 ); assert( Aig_ManConstrNum(pAig) == 0 ); @@ -460,7 +462,7 @@ int Ssw_RarSignalFilter2( Aig_Man_t * pAig, int nFrames, int nWords, int nBinSiz Ssw_RarTransferPatterns( p, p->vInits ); Ssw_SmlInitializeSpecial( p->pSml, p->vInits ); // check timeout - if ( TimeOut && time(NULL) > nTimeToStop ) + if ( TimeOut && clock() > nTimeToStop ) { if ( fVerbose ) printf( "\n" ); printf( "Reached timeout (%d seconds).\n", TimeOut ); diff --git a/src/proof/ssw/sswSat.c b/src/proof/ssw/sswSat.c index 7d371cac..e5971a64 100644 --- a/src/proof/ssw/sswSat.c +++ b/src/proof/ssw/sswSat.c @@ -45,7 +45,8 @@ ABC_NAMESPACE_IMPL_START int Ssw_NodesAreEquiv( Ssw_Man_t * p, Aig_Obj_t * pOld, Aig_Obj_t * pNew ) { int nBTLimit = p->pPars->nBTLimit; - int pLits[3], nLits, RetValue, RetValue1, clk;//, status; + int pLits[3], nLits, RetValue, RetValue1; + clock_t clk;//, status; p->nSatCalls++; p->pMSat->nSolverCalls++; diff --git a/src/proof/ssw/sswSemi.c b/src/proof/ssw/sswSemi.c index a04f6f54..e58ba848 100644 --- a/src/proof/ssw/sswSemi.c +++ b/src/proof/ssw/sswSemi.c @@ -179,7 +179,8 @@ int Ssw_ManFilterBmc( Ssw_Sem_t * pBmc, int iPat, int fCheckTargets ) Ssw_Man_t * p = pBmc->pMan; Aig_Obj_t * pObj, * pObjNew, * pObjLi, * pObjLo; unsigned * pInfo; - int i, f, clk, RetValue, fFirst = 0; + int i, f, RetValue, fFirst = 0; + clock_t clk; clk = clock(); // start initialized timeframes @@ -260,7 +261,8 @@ p->timeBmc += clock() - clk; int Ssw_FilterUsingSemi( Ssw_Man_t * pMan, int fCheckTargets, int nConfMax, int fVerbose ) { Ssw_Sem_t * p; - int RetValue, Frames, Iter, clk = clock(); + int RetValue, Frames, Iter; + clock_t clk = clock(); p = Ssw_SemManStart( pMan, nConfMax, fVerbose ); if ( fCheckTargets && Ssw_SemCheckTargets( p ) ) { diff --git a/src/proof/ssw/sswSim.c b/src/proof/ssw/sswSim.c index b53e8baf..bb4a55d2 100644 --- a/src/proof/ssw/sswSim.c +++ b/src/proof/ssw/sswSim.c @@ -38,7 +38,7 @@ struct Ssw_Sml_t_ int nWordsPref; // the number of word in the prefix int fNonConstOut; // have seen a non-const-0 output during simulation int nSimRounds; // statistics - int timeSim; // statistics + clock_t timeSim; // statistics unsigned pData[0]; // simulation data for the nodes }; @@ -1005,7 +1005,8 @@ int Ssw_SmlCheckNonConstOutputs( Ssw_Sml_t * p ) void Ssw_SmlSimulateOne( Ssw_Sml_t * p ) { Aig_Obj_t * pObj, * pObjLi, * pObjLo; - int f, i, clk; + int f, i; + clock_t clk; clk = clock(); for ( f = 0; f < p->nFrames; f++ ) { @@ -1116,7 +1117,8 @@ void Ssw_SmlSimulateOneDyn_rec( Ssw_Sml_t * p, Aig_Obj_t * pObj, int f, int * pV void Ssw_SmlSimulateOneFrame( Ssw_Sml_t * p ) { Aig_Obj_t * pObj, * pObjLi, * pObjLo; - int i, clk; + int i; + clock_t clk; clk = clock(); // simulate the nodes Aig_ManForEachNode( p->pAig, pObj, i ) diff --git a/src/proof/ssw/sswSimSat.c b/src/proof/ssw/sswSimSat.c index 098b1e0f..4d1b3ba2 100644 --- a/src/proof/ssw/sswSimSat.c +++ b/src/proof/ssw/sswSimSat.c @@ -45,7 +45,8 @@ ABC_NAMESPACE_IMPL_START void Ssw_ManResimulateBit( Ssw_Man_t * p, Aig_Obj_t * pCand, Aig_Obj_t * pRepr ) { Aig_Obj_t * pObj; - int i, RetValue1, RetValue2, clk = clock(); + int i, RetValue1, RetValue2; + clock_t clk = clock(); // set the PI simulation information Aig_ManConst1(p->pAig)->fMarkB = 1; Aig_ManForEachCi( p->pAig, pObj, i ) @@ -90,7 +91,8 @@ p->timeSimSat += clock() - clk; ***********************************************************************/ void Ssw_ManResimulateWord( Ssw_Man_t * p, Aig_Obj_t * pCand, Aig_Obj_t * pRepr, int f ) { - int RetValue1, RetValue2, clk = clock(); + int RetValue1, RetValue2; + clock_t clk = clock(); // set the PI simulation information Ssw_SmlAssignDist1Plus( p->pSml, p->pPatWords ); // simulate internal nodes diff --git a/src/proof/ssw/sswSweep.c b/src/proof/ssw/sswSweep.c index 5dd7a1f2..ab6952a2 100644 --- a/src/proof/ssw/sswSweep.c +++ b/src/proof/ssw/sswSweep.c @@ -187,7 +187,8 @@ void Ssw_SmlAddPatternDyn( Ssw_Man_t * p ) int Ssw_ManSweepNode( Ssw_Man_t * p, Aig_Obj_t * pObj, int f, int fBmc, Vec_Int_t * vPairs ) { Aig_Obj_t * pObjRepr, * pObjFraig, * pObjFraig2, * pObjReprFraig; - int RetValue, clk; + int RetValue; + clock_t clk; // get representative of this class pObjRepr = Aig_ObjRepr( p->pAig, pObj ); if ( pObjRepr == NULL ) @@ -267,7 +268,8 @@ int Ssw_ManSweepBmc( Ssw_Man_t * p ) { Bar_Progress_t * pProgress = NULL; Aig_Obj_t * pObj, * pObjNew, * pObjLi, * pObjLo; - int i, f, clk; + int i, f; + clock_t clk; clk = clock(); // start initialized timeframes @@ -365,7 +367,8 @@ int Ssw_ManSweep( Ssw_Man_t * p ) static int Counter; Bar_Progress_t * pProgress = NULL; Aig_Obj_t * pObj, * pObj2, * pObjNew; - int nConstrPairs, clk, i, f; + int nConstrPairs, i, f; + clock_t clk; Vec_Int_t * vDisproved; // perform speculative reduction diff --git a/src/sat/bsat/satChecker.c b/src/sat/bsat/satChecker.c index f478928c..70bb9c85 100644 --- a/src/sat/bsat/satChecker.c +++ b/src/sat/bsat/satChecker.c @@ -22,7 +22,7 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> + #include "misc/vec/vec.h" ABC_NAMESPACE_IMPL_START diff --git a/src/sat/bsat/satInter.c b/src/sat/bsat/satInter.c index 8617def9..6f564225 100644 --- a/src/sat/bsat/satInter.c +++ b/src/sat/bsat/satInter.c @@ -22,7 +22,7 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> + #include "satStore.h" ABC_NAMESPACE_IMPL_START @@ -71,9 +71,9 @@ struct Int_Man_t_ int nResLits; // the number of literals of the resolvent int nResLitsAlloc;// the number of literals of the resolvent // runtime stats - int timeBcp; // the runtime for BCP - int timeTrace; // the runtime of trace construction - int timeTotal; // the total runtime of interpolation + clock_t timeBcp; // the runtime for BCP + clock_t timeTrace; // the runtime of trace construction + clock_t timeTotal; // the total runtime of interpolation }; // procedure to get hold of the clauses' truth table @@ -535,7 +535,7 @@ Sto_Cls_t * Int_ManPropagate( Int_Man_t * p, int Start ) { Sto_Cls_t * pClause; int i; - int clk = clock(); + clock_t clk = clock(); for ( i = Start; i < p->nTrailSize; i++ ) { pClause = Int_ManPropagateOne( p, p->pTrail[i] ); @@ -591,7 +591,7 @@ int Int_ManProofTraceOne( Int_Man_t * p, Sto_Cls_t * pConflict, Sto_Cls_t * pFin Sto_Cls_t * pReason; int i, v, Var, PrevId; int fPrint = 0; - int clk = clock(); + clock_t clk = clock(); // collect resolvent literals if ( p->fProofVerif ) @@ -1006,7 +1006,7 @@ int Int_ManInterpolate( Int_Man_t * p, Sto_Man_t * pCnf, int fVerbose, unsigned { Sto_Cls_t * pClause; int RetValue = 1; - int clkTotal = clock(); + clock_t clkTotal = clock(); // check that the CNF makes sense assert( pCnf->nVars > 0 && pCnf->nClauses > 0 ); diff --git a/src/sat/bsat/satInterA.c b/src/sat/bsat/satInterA.c index 4057ce7e..8b2ef8b7 100644 --- a/src/sat/bsat/satInterA.c +++ b/src/sat/bsat/satInterA.c @@ -22,7 +22,7 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> + #include "satStore.h" #include "src/aig/aig/aig.h" @@ -70,9 +70,9 @@ struct Inta_Man_t_ int nResLits; // the number of literals of the resolvent int nResLitsAlloc;// the number of literals of the resolvent // runtime stats - int timeBcp; // the runtime for BCP - int timeTrace; // the runtime of trace construction - int timeTotal; // the total runtime of interpolation + clock_t timeBcp; // the runtime for BCP + clock_t timeTrace; // the runtime of trace construction + clock_t timeTotal; // the total runtime of interpolation }; // procedure to get hold of the clauses' truth table @@ -491,7 +491,7 @@ Sto_Cls_t * Inta_ManPropagate( Inta_Man_t * p, int Start ) { Sto_Cls_t * pClause; int i; - int clk = clock(); + clock_t clk = clock(); for ( i = Start; i < p->nTrailSize; i++ ) { pClause = Inta_ManPropagateOne( p, p->pTrail[i] ); @@ -547,7 +547,7 @@ int Inta_ManProofTraceOne( Inta_Man_t * p, Sto_Cls_t * pConflict, Sto_Cls_t * pF Sto_Cls_t * pReason; int i, v, Var, PrevId; int fPrint = 0; - int clk = clock(); + clock_t clk = clock(); // collect resolvent literals if ( p->fProofVerif ) @@ -954,7 +954,7 @@ void * Inta_ManInterpolate( Inta_Man_t * p, Sto_Man_t * pCnf, void * vVarsAB, in Aig_Obj_t * pObj; Sto_Cls_t * pClause; int RetValue = 1; - int clkTotal = clock(); + clock_t clkTotal = clock(); // check that the CNF makes sense assert( pCnf->nVars > 0 && pCnf->nClauses > 0 ); diff --git a/src/sat/bsat/satInterB.c b/src/sat/bsat/satInterB.c index a9b18fd5..5a154aa0 100644 --- a/src/sat/bsat/satInterB.c +++ b/src/sat/bsat/satInterB.c @@ -22,7 +22,7 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> + #include "satStore.h" #include "src/aig/aig/aig.h" @@ -70,9 +70,9 @@ struct Intb_Man_t_ int nResLits; // the number of literals of the resolvent int nResLitsAlloc;// the number of literals of the resolvent // runtime stats - int timeBcp; // the runtime for BCP - int timeTrace; // the runtime of trace construction - int timeTotal; // the total runtime of interpolation + clock_t timeBcp; // the runtime for BCP + clock_t timeTrace; // the runtime of trace construction + clock_t timeTotal; // the total runtime of interpolation }; // procedure to get hold of the clauses' truth table @@ -493,7 +493,7 @@ Sto_Cls_t * Intb_ManPropagate( Intb_Man_t * p, int Start ) { Sto_Cls_t * pClause; int i; - int clk = clock(); + clock_t clk = clock(); for ( i = Start; i < p->nTrailSize; i++ ) { pClause = Intb_ManPropagateOne( p, p->pTrail[i] ); @@ -570,7 +570,7 @@ int Intb_ManProofTraceOne( Intb_Man_t * p, Sto_Cls_t * pConflict, Sto_Cls_t * pF Sto_Cls_t * pReason; int i, v, Var, PrevId; int fPrint = 0; - int clk = clock(); + clock_t clk = clock(); // collect resolvent literals if ( p->fProofVerif ) @@ -990,7 +990,7 @@ void * Intb_ManInterpolate( Intb_Man_t * p, Sto_Man_t * pCnf, void * vVarsAB, in Aig_Obj_t * pObj; Sto_Cls_t * pClause; int RetValue = 1; - int clkTotal = clock(); + clock_t clkTotal = clock(); // check that the CNF makes sense assert( pCnf->nVars > 0 && pCnf->nClauses > 0 ); diff --git a/src/sat/bsat/satInterP.c b/src/sat/bsat/satInterP.c index b8ab473a..2e3caeeb 100644 --- a/src/sat/bsat/satInterP.c +++ b/src/sat/bsat/satInterP.c @@ -22,7 +22,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "satStore.h" #include "src/misc/vec/vec.h" @@ -70,9 +69,9 @@ struct Intp_Man_t_ int nResLits; // the number of literals of the resolvent int nResLitsAlloc;// the number of literals of the resolvent // runtime stats - int timeBcp; // the runtime for BCP - int timeTrace; // the runtime of trace construction - int timeTotal; // the total runtime of interpolation + clock_t timeBcp; // the runtime for BCP + clock_t timeTrace; // the runtime of trace construction + clock_t timeTotal; // the total runtime of interpolation }; // reading/writing the proof for a clause @@ -420,7 +419,7 @@ Sto_Cls_t * Intp_ManPropagate( Intp_Man_t * p, int Start ) { Sto_Cls_t * pClause; int i; - int clk = clock(); + clock_t clk = clock(); for ( i = Start; i < p->nTrailSize; i++ ) { pClause = Intp_ManPropagateOne( p, p->pTrail[i] ); @@ -476,7 +475,7 @@ int Intp_ManProofTraceOne( Intp_Man_t * p, Sto_Cls_t * pConflict, Sto_Cls_t * pF Sto_Cls_t * pReason; int i, v, Var, PrevId; int fPrint = 0; - int clk = clock(); + clock_t clk = clock(); // collect resolvent literals if ( p->fProofVerif ) @@ -864,7 +863,8 @@ void Intp_ManUnsatCoreVerify( Sto_Man_t * pCnf, Vec_Int_t * vCore ) sat_solver * pSat; Sto_Cls_t * pClause; Vec_Ptr_t * vClauses; - int i, iClause, RetValue, clk = clock(); + int i, iClause, RetValue; + clock_t clk = clock(); // collect the clauses vClauses = Vec_PtrAlloc( 1000 ); Sto_ManForEachClauseRoot( pCnf, pClause ) @@ -962,7 +962,7 @@ void * Intp_ManUnsatCore( Intp_Man_t * p, Sto_Man_t * pCnf, int fVerbose ) Vec_Int_t * vVisited; Sto_Cls_t * pClause; int RetValue = 1; - int clkTotal = clock(); + clock_t clkTotal = clock(); // check that the CNF makes sense assert( pCnf->nVars > 0 && pCnf->nClauses > 0 ); diff --git a/src/sat/bsat/satProof.c b/src/sat/bsat/satProof.c index f56c20cc..f7e08592 100644 --- a/src/sat/bsat/satProof.c +++ b/src/sat/bsat/satProof.c @@ -145,7 +145,7 @@ Vec_Int_t * Proof_CollectUsedIter( Vec_Set_t * vProof, Vec_Int_t * vRoots, int f { int fVerify = 0; Vec_Int_t * vUsed, * vStack; - int clk = clock(); + clock_t clk = clock(); int i, Entry, iPrev = 0; vUsed = Vec_IntAlloc( 1000 ); vStack = Vec_IntAlloc( 1000 ); @@ -309,8 +309,9 @@ void Sat_ProofReduce2( sat_solver2 * s ) int fVerbose = 0; Vec_Int_t * vUsed; satset * pNode, * pFanin, * pPivot; - int i, k, hTemp, clk = clock(); - static int TimeTotal = 0; + int i, k, hTemp; + clock_t clk = clock(); + static clock_t TimeTotal = 0; // collect visited nodes vUsed = Proof_CollectUsedIter( vProof, vRoots, 1 ); @@ -371,8 +372,9 @@ void Sat_ProofReduce( sat_solver2 * s ) int fVerbose = 0; Vec_Ptr_t * vUsed; satset * pNode, * pFanin, * pPivot; - int i, j, k, hTemp, nSize, clk = clock(); - static int TimeTotal = 0; + int i, j, k, hTemp, nSize; + clock_t clk = clock(); + static clock_t TimeTotal = 0; // collect visited nodes nSize = Proof_MarkUsedRec( vProof, vRoots ); @@ -525,7 +527,8 @@ void Sat_ProofCheck( sat_solver2 * s ) Vec_Set_t * vResolves; Vec_Int_t * vUsed, * vTemp; satset * pSet, * pSet0 = NULL, * pSet1; - int i, k, hRoot, Handle, Counter = 0, clk = clock(); + int i, k, hRoot, Handle, Counter = 0; + clock_t clk = clock(); hRoot = s->hProofLast; if ( hRoot == -1 ) return; diff --git a/src/sat/bsat/satSolver.c b/src/sat/bsat/satSolver.c index 2d41e2fe..f143916a 100644 --- a/src/sat/bsat/satSolver.c +++ b/src/sat/bsat/satSolver.c @@ -1605,7 +1605,7 @@ int sat_solver_solve(sat_solver* s, lit* begin, lit* end, ABC_INT64_T nConfLimit while (status == l_Undef){ double Ratio = (s->stats.learnts == 0)? 0.0 : s->stats.learnts_literals / (double)s->stats.learnts; - if ( s->nRuntimeLimit && time(NULL) > s->nRuntimeLimit ) + if ( s->nRuntimeLimit && clock() > s->nRuntimeLimit ) break; if (s->verbosity >= 1) { @@ -1629,7 +1629,7 @@ int sat_solver_solve(sat_solver* s, lit* begin, lit* end, ABC_INT64_T nConfLimit break; if ( s->nInsLimit && s->stats.propagations > s->nInsLimit ) break; - if ( s->nRuntimeLimit && time(NULL) > s->nRuntimeLimit ) + if ( s->nRuntimeLimit && clock() > s->nRuntimeLimit ) break; } if (s->verbosity >= 1) diff --git a/src/sat/bsat/satSolver.h b/src/sat/bsat/satSolver.h index 40f637ee..62ad5e0c 100644 --- a/src/sat/bsat/satSolver.h +++ b/src/sat/bsat/satSolver.h @@ -142,7 +142,7 @@ struct sat_solver_t ABC_INT64_T nConfLimit; // external limit on the number of conflicts ABC_INT64_T nInsLimit; // external limit on the number of implications - int nRuntimeLimit; // external limit on runtime + clock_t nRuntimeLimit; // external limit on runtime veci act_vars; // variables whose activity has changed double* factors; // the activity factors @@ -198,9 +198,9 @@ static int sat_solver_final(sat_solver* s, int ** ppArray) return s->conf_final.size; } -static int sat_solver_set_runtime_limit(sat_solver* s, int Limit) +static clock_t sat_solver_set_runtime_limit(sat_solver* s, clock_t Limit) { - int nRuntimeLimit = s->nRuntimeLimit; + clock_t nRuntimeLimit = s->nRuntimeLimit; s->nRuntimeLimit = Limit; return nRuntimeLimit; } diff --git a/src/sat/bsat/satSolver2.c b/src/sat/bsat/satSolver2.c index 2e0a5f4a..cbe6bc52 100644 --- a/src/sat/bsat/satSolver2.c +++ b/src/sat/bsat/satSolver2.c @@ -1398,12 +1398,13 @@ void luby2_test() // updates clauses, watches, units, and proof void sat_solver2_reducedb(sat_solver2* s) { - static int TimeTotal = 0; + static clock_t TimeTotal = 0; satset * c, * pivot; cla h,* pArray,* pArray2; int * pPerm, * pClaAct, nClaAct, ActCutOff; int i, j, k, hTemp, hHandle, LastSize = 0; - int Counter, CounterStart, clk = clock(); + int Counter, CounterStart; + clock_t clk = clock(); // check if it is time to reduce if ( s->nLearntMax == 0 || s->stats.learnts < (unsigned)s->nLearntMax ) @@ -1845,7 +1846,7 @@ int sat_solver2_solve(sat_solver2* s, lit* begin, lit* end, ABC_INT64_T nConfLim s->progress_estimate*100); fflush(stdout); } - if ( s->nRuntimeLimit && time(NULL) > s->nRuntimeLimit ) + if ( s->nRuntimeLimit && clock() > s->nRuntimeLimit ) break; // reduce the set of learnt clauses: sat_solver2_reducedb(s); diff --git a/src/sat/bsat/satSolver2.h b/src/sat/bsat/satSolver2.h index 79eb64ed..ffab91be 100644 --- a/src/sat/bsat/satSolver2.h +++ b/src/sat/bsat/satSolver2.h @@ -160,7 +160,7 @@ struct sat_solver2_t stats_t stats; ABC_INT64_T nConfLimit; // external limit on the number of conflicts ABC_INT64_T nInsLimit; // external limit on the number of implications - int nRuntimeLimit; // external limit on runtime + clock_t nRuntimeLimit; // external limit on runtime }; typedef struct satset_t satset; @@ -240,9 +240,9 @@ static inline int sat_solver2_final(sat_solver2* s, int ** ppArray) return s->conf_final.size; } -static inline int sat_solver2_set_runtime_limit(sat_solver2* s, int Limit) +static inline clock_t sat_solver2_set_runtime_limit(sat_solver2* s, clock_t Limit) { - int temp = s->nRuntimeLimit; + clock_t temp = s->nRuntimeLimit; s->nRuntimeLimit = Limit; return temp; } diff --git a/src/sat/bsat/satStore.c b/src/sat/bsat/satStore.c index ac74c4a6..fab13666 100644 --- a/src/sat/bsat/satStore.c +++ b/src/sat/bsat/satStore.c @@ -22,7 +22,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "satStore.h" diff --git a/src/sat/cnf/cnf.h b/src/sat/cnf/cnf.h index 478755d6..16aaa21f 100644 --- a/src/sat/cnf/cnf.h +++ b/src/sat/cnf/cnf.h @@ -30,7 +30,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include "src/misc/vec/vec.h" #include "src/aig/aig/aig.h" @@ -88,9 +87,9 @@ struct Cnf_Man_t_ int nMergeLimit; // the limit on the size of merged cut unsigned * pTruths[4]; // temporary truth tables Vec_Int_t * vMemory; // memory for intermediate ISOP representation - int timeCuts; - int timeMap; - int timeSave; + clock_t timeCuts; + clock_t timeMap; + clock_t timeSave; }; diff --git a/src/sat/cnf/cnfCore.c b/src/sat/cnf/cnfCore.c index 65d7ef60..f08ea6d1 100644 --- a/src/sat/cnf/cnfCore.c +++ b/src/sat/cnf/cnfCore.c @@ -50,7 +50,7 @@ Vec_Int_t * Cnf_DeriveMappingArray( Aig_Man_t * pAig ) Cnf_Man_t * p; Vec_Ptr_t * vMapped; Aig_MmFixed_t * pMemCuts; - int clk; + clock_t clk; // allocate the CNF manager if ( s_pManCnf == NULL ) s_pManCnf = Cnf_ManStart(); @@ -103,7 +103,7 @@ Cnf_Dat_t * Cnf_Derive( Aig_Man_t * pAig, int nOutputs ) Cnf_Dat_t * pCnf; Vec_Ptr_t * vMapped; Aig_MmFixed_t * pMemCuts; - int clk; + clock_t clk; // allocate the CNF manager if ( s_pManCnf == NULL ) s_pManCnf = Cnf_ManStart(); @@ -156,7 +156,7 @@ Cnf_Dat_t * Cnf_DeriveOther( Aig_Man_t * pAig, int fSkipTtMin ) Cnf_Dat_t * pCnf; Vec_Ptr_t * vMapped; Aig_MmFixed_t * pMemCuts; - int clk; + clock_t clk; // allocate the CNF manager if ( s_pManCnf == NULL ) s_pManCnf = Cnf_ManStart(); diff --git a/src/sat/cnf/cnfFast.c b/src/sat/cnf/cnfFast.c index 492ddb61..93b3072b 100644 --- a/src/sat/cnf/cnfFast.c +++ b/src/sat/cnf/cnfFast.c @@ -666,7 +666,7 @@ Cnf_Dat_t * Cnf_DeriveFastClauses( Aig_Man_t * p, int nOutputs ) Cnf_Dat_t * Cnf_DeriveFast( Aig_Man_t * p, int nOutputs ) { Cnf_Dat_t * pCnf = NULL; - int clk;//, clkTotal = clock(); + clock_t clk;//, clkTotal = clock(); // printf( "\n" ); Aig_ManCleanMarkAB( p ); // create initial marking diff --git a/src/sat/msat/msatInt.h b/src/sat/msat/msatInt.h index 58baa7b4..a1d9e14d 100644 --- a/src/sat/msat/msatInt.h +++ b/src/sat/msat/msatInt.h @@ -30,7 +30,6 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> #include <math.h> #include "src/misc/util/abc_global.h" diff --git a/src/sat/msat/msatOrderH.c b/src/sat/msat/msatOrderH.c index 4bdefc6d..d0c9c997 100644 --- a/src/sat/msat/msatOrderH.c +++ b/src/sat/msat/msatOrderH.c @@ -58,7 +58,7 @@ static void Msat_HeapIncrease( Msat_Order_t * p, int n ); static void Msat_HeapPercolateUp( Msat_Order_t * p, int i ); static void Msat_HeapPercolateDown( Msat_Order_t * p, int i ); -extern int timeSelect; +extern clock_t timeSelect; //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// @@ -191,7 +191,7 @@ int Msat_OrderVarSelect( Msat_Order_t * p ) // return var_Undef; int Var; - int clk = clock(); + clock_t clk = clock(); while ( !HEMPTY(p) ) { @@ -237,7 +237,7 @@ void Msat_OrderVarUnassigned( Msat_Order_t * p, int Var ) // if (!heap.inHeap(x)) // heap.insert(x); - int clk = clock(); + clock_t clk = clock(); if ( !HINHEAP(p,Var) ) Msat_HeapInsert( p, Var ); timeSelect += clock() - clk; @@ -259,7 +259,7 @@ void Msat_OrderUpdate( Msat_Order_t * p, int Var ) // if (heap.inHeap(x)) // heap.increase(x); - int clk = clock(); + clock_t clk = clock(); if ( HINHEAP(p,Var) ) Msat_HeapIncrease( p, Var ); timeSelect += clock() - clk; diff --git a/src/sat/msat/msatOrderJ.c b/src/sat/msat/msatOrderJ.c index 2be6b47b..a9c27bd0 100644 --- a/src/sat/msat/msatOrderJ.c +++ b/src/sat/msat/msatOrderJ.c @@ -81,8 +81,8 @@ struct Msat_Order_t_ static void Msat_OrderRingAddLast( Msat_OrderRing_t * pRing, Msat_OrderVar_t * pVar ); static void Msat_OrderRingRemove( Msat_OrderRing_t * pRing, Msat_OrderVar_t * pVar ); -extern int timeSelect; -extern int timeAssign; +extern clock_t timeSelect; +extern clock_t timeAssign; //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// diff --git a/src/sat/msat/msatSolverCore.c b/src/sat/msat/msatSolverCore.c index 4ef40ad0..eff1d6d7 100644 --- a/src/sat/msat/msatSolverCore.c +++ b/src/sat/msat/msatSolverCore.c @@ -140,7 +140,7 @@ int Msat_SolverSolve( Msat_Solver_t * p, Msat_IntVec_t * vAssumps, int nBackTra Msat_SearchParams_t Params = { 0.95, 0.999 }; double nConflictsLimit, nLearnedLimit; Msat_Type_t Status; - int timeStart = clock(); + clock_t timeStart = clock(); // p->pFreq = ABC_ALLOC( int, p->nVarsAlloc ); // memset( p->pFreq, 0, sizeof(int) * p->nVarsAlloc ); diff --git a/src/sat/proof/pr.c b/src/sat/proof/pr.c index 45bc2e33..f559d851 100644 --- a/src/sat/proof/pr.c +++ b/src/sat/proof/pr.c @@ -22,9 +22,7 @@ #include <stdlib.h> #include <string.h> #include <assert.h> -#include <time.h> -//#include "vec.h" #include "src/misc/util/abc_global.h" #include "pr.h" @@ -90,10 +88,10 @@ struct Pr_Man_t_ int nResLits; // the number of literals of the resolvent int nResLitsAlloc;// the number of literals of the resolvent // runtime stats - int timeBcp; - int timeTrace; - int timeRead; - int timeTotal; + clock_t timeBcp; + clock_t timeTrace; + clock_t timeRead; + clock_t timeTotal; }; // variable assignments @@ -580,7 +578,7 @@ Pr_Cls_t * Pr_ManPropagate( Pr_Man_t * p, int Start ) { Pr_Cls_t * pClause; int i; - int clk = clock(); + clock_t clk = clock(); for ( i = Start; i < p->nTrailSize; i++ ) { pClause = Pr_ManPropagateOne( p, p->pTrail[i] ); @@ -676,7 +674,7 @@ int Pr_ManProofTraceOne( Pr_Man_t * p, Pr_Cls_t * pConflict, Pr_Cls_t * pFinal ) Pr_Cls_t * pReason; int i, v, Var, PrevId; int fPrint = 0; - int clk = clock(); + clock_t clk = clock(); // collect resolvent literals if ( p->fProofVerif ) @@ -1228,7 +1226,7 @@ int Pr_ManProofCount_rec( Pr_Cls_t * pClause ) int Pr_ManProofTest( char * pFileName ) { Pr_Man_t * p; - int clk, clkTotal = clock(); + clock_t clk, clkTotal = clock(); clk = clock(); p = Pr_ManProofRead( pFileName ); |