summaryrefslogtreecommitdiffstats
path: root/src/aig/gia/giaCCof.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2012-07-07 17:46:54 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2012-07-07 17:46:54 -0700
commit3aab7245738a69f1dd4d898493d5dabf6596ea61 (patch)
tree16a23107ca27a250e82c492dcdd1a2bea640cff6 /src/aig/gia/giaCCof.c
parent16d96fcf533fb77ff4a45992991e38ac7ea74bb3 (diff)
downloadabc-3aab7245738a69f1dd4d898493d5dabf6596ea61.tar.gz
abc-3aab7245738a69f1dd4d898493d5dabf6596ea61.tar.bz2
abc-3aab7245738a69f1dd4d898493d5dabf6596ea61.zip
Fixing time primtouts throughout the code.
Diffstat (limited to 'src/aig/gia/giaCCof.c')
-rw-r--r--src/aig/gia/giaCCof.c9
1 files changed, 5 insertions, 4 deletions
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 );