From 3aab7245738a69f1dd4d898493d5dabf6596ea61 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 7 Jul 2012 17:46:54 -0700 Subject: Fixing time primtouts throughout the code. --- src/bool/bdc/bdcCore.c | 2 +- src/bool/bdc/bdcDec.c | 8 ++++---- src/bool/bdc/bdcInt.h | 10 +++++----- src/bool/bdc/bdcSpfd.c | 17 +++++++++++------ 4 files changed, 21 insertions(+), 16 deletions(-) (limited to 'src/bool/bdc') 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 ); -- cgit v1.2.3