diff options
Diffstat (limited to 'src/bool/bdc')
-rw-r--r-- | src/bool/bdc/bdcCore.c | 4 | ||||
-rw-r--r-- | src/bool/bdc/bdcDec.c | 32 | ||||
-rw-r--r-- | src/bool/bdc/bdcInt.h | 10 | ||||
-rw-r--r-- | src/bool/bdc/bdcSpfd.c | 48 |
4 files changed, 47 insertions, 47 deletions
diff --git a/src/bool/bdc/bdcCore.c b/src/bool/bdc/bdcCore.c index a810146d..5a7a0c3a 100644 --- a/src/bool/bdc/bdcCore.c +++ b/src/bool/bdc/bdcCore.c @@ -291,7 +291,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; - clock_t clk = clock(); + abctime clk = Abc_Clock(); assert( nVars <= p->pPars->nVarsMax ); // set current manager parameters p->nVars = nVars; @@ -318,7 +318,7 @@ int Bdc_ManDecompose( Bdc_Man_t * p, unsigned * puFunc, unsigned * puCare, int n Bdc_SuppMinimize( p, pIsf ); // call decomposition p->pRoot = Bdc_ManDecompose_rec( p, pIsf ); - p->timeTotal += clock() - clk; + p->timeTotal += Abc_Clock() - clk; p->numCalls++; p->numNodes += p->nNodesNew; if ( p->pRoot == NULL ) diff --git a/src/bool/bdc/bdcDec.c b/src/bool/bdc/bdcDec.c index 0695f7e9..6a746540 100644 --- a/src/bool/bdc/bdcDec.c +++ b/src/bool/bdc/bdcDec.c @@ -45,9 +45,9 @@ ABC_NAMESPACE_IMPL_START void Bdc_SuppMinimize2( Bdc_Man_t * p, Bdc_Isf_t * pIsf ) { int v; - clock_t clk = 0; // Suppress "might be used uninitialized" + abctime clk = 0; // Suppress "might be used uninitialized" if ( p->pPars->fVerbose ) - clk = clock(); + clk = Abc_Clock(); // compute support pIsf->uSupp = Kit_TruthSupport( pIsf->puOn, p->nVars ) | Kit_TruthSupport( pIsf->puOff, p->nVars ); @@ -70,7 +70,7 @@ void Bdc_SuppMinimize2( Bdc_Man_t * p, Bdc_Isf_t * pIsf ) pIsf->uSupp &= ~(1 << v); } if ( p->pPars->fVerbose ) - p->timeSupps += clock() - clk; + p->timeSupps += Abc_Clock() - clk; } /**Function************************************************************* @@ -87,9 +87,9 @@ void Bdc_SuppMinimize2( Bdc_Man_t * p, Bdc_Isf_t * pIsf ) void Bdc_SuppMinimize( Bdc_Man_t * p, Bdc_Isf_t * pIsf ) { int v; - clock_t clk = 0; // Suppress "might be used uninitialized" + abctime clk = 0; // Suppress "might be used uninitialized" if ( p->pPars->fVerbose ) - clk = clock(); + clk = Abc_Clock(); // go through the support variables pIsf->uSupp = 0; for ( v = 0; v < p->nVars; v++ ) @@ -106,7 +106,7 @@ void Bdc_SuppMinimize( Bdc_Man_t * p, Bdc_Isf_t * pIsf ) pIsf->uSupp |= (1 << v); } if ( p->pPars->fVerbose ) - p->timeSupps += clock() - clk; + p->timeSupps += Abc_Clock() - clk; } /**Function************************************************************* @@ -549,9 +549,9 @@ int Bdc_DecomposeStepMux( Bdc_Man_t * p, Bdc_Isf_t * pIsf, Bdc_Isf_t * pIsfL, Bd { int Var, VarMin, nSuppMin, nSuppCur; unsigned uSupp0, uSupp1; - clock_t clk = 0; // Suppress "might be used uninitialized" + abctime clk = 0; // Suppress "might be used uninitialized" if ( p->pPars->fVerbose ) - clk = clock(); + clk = Abc_Clock(); VarMin = -1; nSuppMin = 1000; for ( Var = 0; Var < p->nVars; Var++ ) @@ -582,7 +582,7 @@ int Bdc_DecomposeStepMux( Bdc_Man_t * p, Bdc_Isf_t * pIsf, Bdc_Isf_t * pIsfL, Bd Bdc_SuppMinimize( p, pIsfR ); } if ( p->pPars->fVerbose ) - p->timeMuxes += clock() - clk; + p->timeMuxes += Abc_Clock() - clk; return VarMin; } @@ -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; - clock_t clk = 0; // Suppress "might be used uninitialized" + abctime clk = 0; // Suppress "might be used uninitialized" /* printf( "Init function (%d):\n", LocalCounter ); Extra_PrintBinary( stdout, pIsf->puOn, 1<<4 );printf("\n"); @@ -690,25 +690,25 @@ Extra_PrintBinary( stdout, pIsf->puOff, 1<<4 );printf("\n"); // check computed results assert( Kit_TruthIsDisjoint(pIsf->puOn, pIsf->puOff, p->nVars) ); if ( p->pPars->fVerbose ) - clk = clock(); + clk = Abc_Clock(); pFunc = Bdc_TableLookup( p, pIsf ); if ( p->pPars->fVerbose ) - p->timeCache += clock() - clk; + p->timeCache += Abc_Clock() - clk; if ( pFunc ) return pFunc; // decide on the decomposition type if ( p->pPars->fVerbose ) - clk = clock(); + clk = Abc_Clock(); Type = Bdc_DecomposeStep( p, pIsf, pIsfL, pIsfR ); if ( p->pPars->fVerbose ) - p->timeCheck += clock() - clk; + p->timeCheck += Abc_Clock() - clk; if ( Type == BDC_TYPE_MUX ) { if ( p->pPars->fVerbose ) - clk = clock(); + clk = Abc_Clock(); iVar = Bdc_DecomposeStepMux( p, pIsf, pIsfL, pIsfR ); if ( p->pPars->fVerbose ) - p->timeMuxes += clock() - clk; + p->timeMuxes += Abc_Clock() - clk; p->numMuxes++; pFunc0 = Bdc_ManDecompose_rec( p, pIsfL ); pFunc1 = Bdc_ManDecompose_rec( p, pIsfR ); diff --git a/src/bool/bdc/bdcInt.h b/src/bool/bdc/bdcInt.h index da6cce5a..08c97a54 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 - clock_t timeCache; - clock_t timeCheck; - clock_t timeMuxes; - clock_t timeSupps; - clock_t timeTotal; + abctime timeCache; + abctime timeCheck; + abctime timeMuxes; + abctime timeSupps; + abctime 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 9a5bd777..8a00b02f 100644 --- a/src/bool/bdc/bdcSpfd.c +++ b/src/bool/bdc/bdcSpfd.c @@ -182,7 +182,7 @@ void Bdc_SpfdDecompose( word Truth, int nVars, int nCands, int nGatesMax ) Bdc_Nod_t * pNode, * pNode0, * pNode1, * pNode2; int Count0, Count1, * pPerm; int i, j, k, c, n; - clock_t clk; + abctime clk; assert( nGatesMax < (1<<8) ); assert( nCands < (1<<12) ); assert( (1<<(nVars-1))*(1<<(nVars-1)) < (1<<12) ); // max SPFD @@ -219,7 +219,7 @@ void Bdc_SpfdDecompose( word Truth, int nVars, int nCands, int nGatesMax ) Vec_IntPush( vBegs, nVars ); // the next level -clk = clock(); +clk = Abc_Clock(); pNode0 = pNode; pNode = ABC_CALLOC( Bdc_Nod_t, 5 * nVars * (nVars - 1) / 2 ); for ( c = i = 0; i < nVars; i++ ) @@ -246,14 +246,14 @@ clk = clock(); } } printf( "Selected %6d gates on level %2d. ", c, 1 ); -Abc_PrintTime( 1, "Time", clock() - clk ); +Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); // iterate through levels pNode = ABC_CALLOC( Bdc_Nod_t, nSize ); for ( n = 2; n <= nGatesMax; n++ ) { -clk = clock(); +clk = Abc_Clock(); c = 0; pNode1 = (Bdc_Nod_t *)Vec_PtrEntry( vLevels, n-1 ); Count1 = Vec_IntEntry( vBegs, n-1 ); @@ -320,7 +320,7 @@ Bdc_SpfdPrint( pNode + i, 1, vLevels, Truth ); Vec_IntPush( vBegs, j ); printf( "Selected %6d gates (out of %6d) on level %2d. ", j, c, n ); -Abc_PrintTime( 1, "Time", clock() - clk ); +Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); for ( i = 0; i < 10; i++ ) Bdc_SpfdPrint( pNode2 + i, n, vLevels, Truth ); @@ -588,7 +588,7 @@ Vec_Wrd_t * Bdc_SpfdDecomposeTest__( Vec_Int_t ** pvWeights ) int Limit = 6; int * pPlace, i, n, m, k, s, fCompl; - clock_t clk = clock(), clk2; + abctime clk = Abc_Clock(), clk2; Vec_Int_t * vStops; Vec_Wrd_t * vTruths; Vec_Int_t * vWeights; @@ -644,7 +644,7 @@ Vec_Wrd_t * Bdc_SpfdDecomposeTest__( Vec_Int_t ** pvWeights ) pBeg1 = p + Vec_IntEntry( vStops, m ); pEnd1 = p + Vec_IntEntry( vStops, m+1 ); - clk2 = clock(); + clk2 = Abc_Clock(); printf( "Trying %7d x %7d. ", (int)(pEnd0-pBeg0), (int)(pEnd1-pBeg1) ); for ( pThis0 = pBeg0; pThis0 < pEnd0; pThis0++ ) for ( pThis1 = pBeg1; pThis1 < pEnd1; pThis1++ ) @@ -682,11 +682,11 @@ Vec_Wrd_t * Bdc_SpfdDecomposeTest__( Vec_Int_t ** pvWeights ) } } printf( "Added %d + %d + 1 = %d. Total = %8d. ", k, m, n+1, (int)(q-p) ); - Abc_PrintTime( 1, "Time", clock() - clk2 ); + Abc_PrintTime( 1, "Time", Abc_Clock() - clk2 ); } Vec_IntPush( vStops, q-p ); } - Abc_PrintTime( 1, "Time", clock() - clk ); + Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); { @@ -921,7 +921,7 @@ void Bdc_SpfdDecomposeTest44() Vec_Wrd_t * vDivs; word c0, c1, s, tt, tbest; int i, j, Cost, CostBest = 100000; - clock_t clk = clock(); + abctime clk = Abc_Clock(); return; @@ -1007,7 +1007,7 @@ void Bdc_SpfdDecomposeTest44() printf( "Best solution found with cost %d. ", CostBest ); Extra_PrintHex( stdout, (unsigned *)&tbest, 6 ); //printf( "\n" ); - Abc_PrintTime( 1, " Time", clock() - clk ); + Abc_PrintTime( 1, " Time", Abc_Clock() - clk ); Vec_WrdFree( vDivs ); Vec_IntFree( vWeights ); @@ -1031,7 +1031,7 @@ void Bdc_SpfdDecomposeTest3() Vec_Wrd_t * v1M; Vec_Wrd_t * v1K; int i, k, Counter; - clock_t clk; + abctime clk; // int EntryM, EntryK; Aig_ManRandom64( 1 ); @@ -1043,7 +1043,7 @@ void Bdc_SpfdDecomposeTest3() for ( i = 0; i < nSizeK; i++ ) Vec_WrdPush( v1K, Aig_ManRandom64(0) ); - clk = clock(); + clk = Abc_Clock(); Counter = 0; for ( i = 0; i < nSizeM; i++ ) for ( k = 0; k < nSizeK; k++ ) @@ -1053,15 +1053,15 @@ void Bdc_SpfdDecomposeTest3() // Counter += ((EntryM & EntryK) == EntryK); printf( "Total = %8d. ", Counter ); - Abc_PrintTime( 1, "Time", clock() - clk ); + Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); - clk = clock(); + clk = Abc_Clock(); Counter = 0; for ( k = 0; k < nSizeK; k++ ) for ( i = 0; i < nSizeM; i++ ) Counter += ((v1M->pArray[i] & v1K->pArray[k]) == v1K->pArray[k]); printf( "Total = %8d. ", Counter ); - Abc_PrintTime( 1, "Time", clock() - clk ); + Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); } @@ -1087,7 +1087,7 @@ void Bdc_SpfdDecomposeTest8() word Func, FuncBest; int Cost, CostBest = ABC_INFINITY; int i; - clock_t clk = clock(); + abctime clk = Abc_Clock(); // return; @@ -1095,7 +1095,7 @@ void Bdc_SpfdDecomposeTest8() printf( "Best init = %4d. ", Bdc_SpfdAdjCost(t) ); Extra_PrintHex( stdout, (unsigned *)&t, 6 ); //printf( "\n" ); - Abc_PrintTime( 1, " Time", clock() - clk ); + Abc_PrintTime( 1, " Time", Abc_Clock() - clk ); Vec_WrdForEachEntry( vDivs, Func, i ) { @@ -1109,7 +1109,7 @@ void Bdc_SpfdDecomposeTest8() printf( "Best cost = %4d. ", CostBest ); Extra_PrintHex( stdout, (unsigned *)&FuncBest, 6 ); //printf( "\n" ); - Abc_PrintTime( 1, " Time", clock() - clk ); + Abc_PrintTime( 1, " Time", Abc_Clock() - clk ); Abc_Show6VarFunc( 0, t ); Abc_Show6VarFunc( 0, FuncBest ); @@ -1138,7 +1138,7 @@ void Bdc_SpfdDecomposeTest() Vec_Wrd_t * v1M, * v1K; int EntryM, EntryK; int i, k, Counter; - clock_t clk; + abctime clk; Aig_ManRandom64( 1 ); @@ -1150,7 +1150,7 @@ void Bdc_SpfdDecomposeTest() for ( i = 0; i < nSizeK; i++ ) Vec_WrdPush( v1K, Aig_ManRandom64(0) ); - clk = clock(); + clk = Abc_Clock(); Counter = 0; // for ( i = 0; i < nSizeM; i++ ) // for ( k = 0; k < nSizeK; k++ ) @@ -1159,9 +1159,9 @@ void Bdc_SpfdDecomposeTest() Vec_WrdForEachEntry( v1K, EntryK, k ) Counter += ((EntryM & EntryK) == EntryK); printf( "Total = %8d. ", Counter ); - Abc_PrintTime( 1, "Time", clock() - clk ); + Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); - clk = clock(); + clk = Abc_Clock(); Counter = 0; // for ( k = 0; k < nSizeK; k++ ) // for ( i = 0; i < nSizeM; i++ ) @@ -1170,7 +1170,7 @@ void Bdc_SpfdDecomposeTest() Vec_WrdForEachEntry( v1M, EntryM, i ) Counter += ((EntryM & EntryK) == EntryK); printf( "Total = %8d. ", Counter ); - Abc_PrintTime( 1, "Time", clock() - clk ); + Abc_PrintTime( 1, "Time", Abc_Clock() - clk ); } |