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/opt/dar/darCore.c | 6 ++++-- src/opt/dar/darInt.h | 14 ++++++-------- src/opt/dar/darLib.c | 8 ++++---- src/opt/dar/darRefact.c | 11 ++++++----- src/opt/dar/darScript.c | 8 +++++--- 5 files changed, 25 insertions(+), 22 deletions(-) (limited to 'src/opt/dar') 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 #include #include -#include -//#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; -- cgit v1.2.3