summaryrefslogtreecommitdiffstats
path: root/src/opt/dar/darLib.c
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2013-05-27 15:09:23 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2013-05-27 15:09:23 -0700
commit19c25fd6aab057b2373717f996fe538507c1b1e1 (patch)
tree7aa7cd7609a5de31d11b3455b6388fd9300c8d0f /src/opt/dar/darLib.c
parent94356f0d1fa8e671303299717f631ecf0ca2f17e (diff)
downloadabc-19c25fd6aab057b2373717f996fe538507c1b1e1.tar.gz
abc-19c25fd6aab057b2373717f996fe538507c1b1e1.tar.bz2
abc-19c25fd6aab057b2373717f996fe538507c1b1e1.zip
Adding a wrapper around clock() for more accurate time counting in ABC.
Diffstat (limited to 'src/opt/dar/darLib.c')
-rw-r--r--src/opt/dar/darLib.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/opt/dar/darLib.c b/src/opt/dar/darLib.c
index 27408328..ee440872 100644
--- a/src/opt/dar/darLib.c
+++ b/src/opt/dar/darLib.c
@@ -129,7 +129,7 @@ Dar_Lib_t * Dar_LibAlloc( int nObjs )
{
unsigned uTruths[4] = { 0xAAAA, 0xCCCC, 0xF0F0, 0xFF00 };
Dar_Lib_t * p;
- int i;//, clk = clock();
+ int i;//, clk = Abc_Clock();
p = ABC_ALLOC( Dar_Lib_t, 1 );
memset( p, 0, sizeof(Dar_Lib_t) );
// allocate objects
@@ -146,7 +146,7 @@ Dar_Lib_t * Dar_LibAlloc( int nObjs )
p->pObjs[i].fTerm = 1;
p->pObjs[i].Num = uTruths[i];
}
-// ABC_PRT( "Library start", clock() - clk );
+// ABC_PRT( "Library start", Abc_Clock() - clk );
return p;
}
@@ -592,11 +592,11 @@ Dar_Lib_t * Dar_LibRead()
***********************************************************************/
void Dar_LibStart()
{
-// clock_t clk = clock();
+// abctime clk = Abc_Clock();
assert( s_DarLib == NULL );
s_DarLib = Dar_LibRead();
// printf( "The 4-input library started with %d nodes and %d subgraphs. ", s_DarLib->nObjs - 4, s_DarLib->nSubgrTotal );
-// ABC_PRT( "Time", clock() - clk );
+// ABC_PRT( "Time", Abc_Clock() - clk );
}
/**Function*************************************************************
@@ -921,7 +921,7 @@ void Dar_LibEval( Dar_Man_t * p, Aig_Obj_t * pRoot, Dar_Cut_t * pCut, int Requir
float PowerSaved, PowerAdded;
Dar_LibObj_t * pObj;
int Out, k, Class, nNodesSaved, nNodesAdded, nNodesGained;
- clock_t clk = clock();
+ abctime clk = Abc_Clock();
if ( pCut->nLeaves != 4 )
return;
// check if the cut exits and assigns leaves and their levels
@@ -963,7 +963,7 @@ void Dar_LibEval( Dar_Man_t * p, Aig_Obj_t * pRoot, Dar_Cut_t * pCut, int Requir
assert( p->LevelBest <= Required );
*pnMffcSize = nNodesSaved;
}
-clk = clock() - clk;
+clk = Abc_Clock() - clk;
p->ClassTimes[Class] += clk;
p->timeEval += clk;
}
@@ -1189,7 +1189,7 @@ int Dar2_LibEval( Gia_Man_t * p, Vec_Int_t * vCutLits, unsigned uTruth, int fKee
// int fTraining = 0;
Dar_LibObj_t * pObj;
int Out, k, Class, nNodesSaved, nNodesAdded, nNodesGained;
-// clock_t clk = clock();
+// abctime clk = Abc_Clock();
assert( Vec_IntSize(vCutLits) == 4 );
assert( (uTruth >> 16) == 0 );
// check if the cut exits and assigns leaves and their levels
@@ -1233,7 +1233,7 @@ int Dar2_LibEval( Gia_Man_t * p, Vec_Int_t * vCutLits, unsigned uTruth, int fKee
p_ClassBest = Class;
// assert( p_LevelBest <= Required );
}
-//clk = clock() - clk;
+//clk = Abc_Clock() - clk;
//p->ClassTimes[Class] += clk;
//p->timeEval += clk;
assert( p_OutBest != -1 );