From 19c25fd6aab057b2373717f996fe538507c1b1e1 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Mon, 27 May 2013 15:09:23 -0700 Subject: Adding a wrapper around clock() for more accurate time counting in ABC. --- src/bdd/cudd/cuddAndAbs.c | 2 +- src/bdd/cudd/cuddBddIte.c | 2 +- src/bdd/cudd/cuddBridge.c | 4 ++-- src/bdd/cudd/cuddCompose.c | 2 +- src/bdd/cudd/cuddInt.h | 2 +- src/bdd/cudd/cuddSymmetry.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/bdd/cudd') diff --git a/src/bdd/cudd/cuddAndAbs.c b/src/bdd/cudd/cuddAndAbs.c index 8e1fd161..d9ad1d23 100644 --- a/src/bdd/cudd/cuddAndAbs.c +++ b/src/bdd/cudd/cuddAndAbs.c @@ -259,7 +259,7 @@ cuddBddAndAbstractRecur( } } - if ( manager->TimeStop && clock() > manager->TimeStop ) + if ( manager->TimeStop && Abc_Clock() > manager->TimeStop ) return NULL; if (topf == top) { diff --git a/src/bdd/cudd/cuddBddIte.c b/src/bdd/cudd/cuddBddIte.c index 0d28ce96..803d5f19 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 && clock() > manager->TimeStop ) + if ( manager->TimeStop && Abc_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 8cbb22d5..94b388f5 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 && clock() > ddS->TimeStop ) + if ( ddS->TimeStop && Abc_Clock() > ddS->TimeStop ) return NULL; - if ( ddD->TimeStop && clock() > ddD->TimeStop ) + if ( ddD->TimeStop && Abc_Clock() > ddD->TimeStop ) return NULL; /* Recursive step. */ diff --git a/src/bdd/cudd/cuddCompose.c b/src/bdd/cudd/cuddCompose.c index f3aff14b..0341ef53 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 && clock() > manager->TimeStop ) + if ( manager->TimeStop && Abc_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 f0aab056..2ccf86a7 100644 --- a/src/bdd/cudd/cuddInt.h +++ b/src/bdd/cudd/cuddInt.h @@ -486,7 +486,7 @@ struct DdManager { /* specialized DD symbol table */ #endif DdNode * bFunc; DdNode * bFunc2; - clock_t TimeStop; /* timeout for reordering */ + abctime TimeStop; /* timeout for reordering */ }; typedef struct Move { diff --git a/src/bdd/cudd/cuddSymmetry.c b/src/bdd/cudd/cuddSymmetry.c index 5813f123..c2b1e858 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 && clock() > table->TimeStop ) + if ( table->TimeStop && Abc_Clock() > table->TimeStop ) break; x = table->perm[var[i]]; #ifdef DD_STATS -- cgit v1.2.3