summaryrefslogtreecommitdiffstats
path: root/src/opt/ret
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/ret
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/ret')
-rw-r--r--src/opt/ret/retCore.c8
-rw-r--r--src/opt/ret/retFlow.c4
-rw-r--r--src/opt/ret/retInit.c6
-rw-r--r--src/opt/ret/retLvalue.c6
4 files changed, 12 insertions, 12 deletions
diff --git a/src/opt/ret/retCore.c b/src/opt/ret/retCore.c
index 35d5f4d0..f3484d2c 100644
--- a/src/opt/ret/retCore.c
+++ b/src/opt/ret/retCore.c
@@ -27,7 +27,7 @@ ABC_NAMESPACE_IMPL_START
/// DECLARATIONS ///
////////////////////////////////////////////////////////////////////////
-clock_t timeRetime = 0;
+abctime timeRetime = 0;
////////////////////////////////////////////////////////////////////////
/// FUNCTION DEFINITIONS ///
@@ -49,7 +49,7 @@ int Abc_NtkRetime( Abc_Ntk_t * pNtk, int Mode, int nDelayLim, int fForwardOnly,
int nLatches = Abc_NtkLatchNum(pNtk);
int nLevels = Abc_NtkLevel(pNtk);
int RetValue = 0;
- clock_t clkTotal = clock();
+ abctime clkTotal = Abc_Clock();
int nNodesOld, nLatchesOld;
assert( Mode > 0 && Mode < 7 );
assert( !fForwardOnly || !fBackwardOnly );
@@ -98,9 +98,9 @@ int Abc_NtkRetime( Abc_Ntk_t * pNtk, int Mode, int nDelayLim, int fForwardOnly,
{
printf( "Reduction in area = %3d. Reduction in delay = %3d. ",
nLatches - Abc_NtkLatchNum(pNtk), nLevels - Abc_NtkLevel(pNtk) );
- ABC_PRT( "Total runtime", clock() - clkTotal );
+ ABC_PRT( "Total runtime", Abc_Clock() - clkTotal );
}
- timeRetime = clock() - clkTotal;
+ timeRetime = Abc_Clock() - clkTotal;
return RetValue;
}
diff --git a/src/opt/ret/retFlow.c b/src/opt/ret/retFlow.c
index 9b215dab..3ce0458b 100644
--- a/src/opt/ret/retFlow.c
+++ b/src/opt/ret/retFlow.c
@@ -145,7 +145,7 @@ Vec_Ptr_t * Abc_NtkMaxFlow( Abc_Ntk_t * pNtk, int fForward, int fVerbose )
Vec_Ptr_t * vMinCut;
Abc_Obj_t * pLatch;
int Flow, FlowCur, RetValue, i;
- clock_t clk = clock();
+ abctime clk = Abc_Clock();
int fUseDirectedFlow = 1;
// find the max-flow
@@ -231,7 +231,7 @@ Vec_Ptr_t * Abc_NtkMaxFlow( Abc_Ntk_t * pNtk, int fForward, int fVerbose )
{
printf( "L = %6d. %s max-flow = %6d. Min-cut = %6d. ",
Abc_NtkLatchNum(pNtk), fForward? "Forward " : "Backward", Flow, Vec_PtrSize(vMinCut) );
-ABC_PRT( "Time", clock() - clk );
+ABC_PRT( "Time", Abc_Clock() - clk );
}
// Abc_NtkMaxFlowPrintCut( pNtk, vMinCut );
diff --git a/src/opt/ret/retInit.c b/src/opt/ret/retInit.c
index b3f6180a..8e09e1b3 100644
--- a/src/opt/ret/retInit.c
+++ b/src/opt/ret/retInit.c
@@ -49,7 +49,7 @@ Vec_Int_t * Abc_NtkRetimeInitialValues( Abc_Ntk_t * pNtkCone, Vec_Int_t * vValue
Vec_Int_t * vSolution;
Abc_Ntk_t * pNtkMiter, * pNtkLogic;
int RetValue;
- clock_t clk;
+ abctime clk;
if ( pNtkCone == NULL )
return Vec_IntDup( vValues );
// convert the target network to AIG
@@ -60,10 +60,10 @@ Vec_Int_t * Abc_NtkRetimeInitialValues( Abc_Ntk_t * pNtkCone, Vec_Int_t * vValue
if ( fVerbose )
printf( "The miter for initial state computation has %d AIG nodes. ", Abc_NtkNodeNum(pNtkMiter) );
// solve the miter
- clk = clock();
+ clk = Abc_Clock();
RetValue = Abc_NtkMiterSat( pNtkMiter, (ABC_INT64_T)500000, (ABC_INT64_T)50000000, 0, NULL, NULL );
if ( fVerbose )
- { ABC_PRT( "SAT solving time", clock() - clk ); }
+ { ABC_PRT( "SAT solving time", Abc_Clock() - clk ); }
// analyze the result
if ( RetValue == 1 )
printf( "Abc_NtkRetimeInitialValues(): The problem is unsatisfiable. DC latch values are used.\n" );
diff --git a/src/opt/ret/retLvalue.c b/src/opt/ret/retLvalue.c
index 5bcc2583..d48bc6cd 100644
--- a/src/opt/ret/retLvalue.c
+++ b/src/opt/ret/retLvalue.c
@@ -94,7 +94,7 @@ Vec_Int_t * Abc_NtkRetimeGetLags( Abc_Ntk_t * pNtk, int nIterLimit, int fVerbose
Vec_Ptr_t * vNodes, * vLatches;
Abc_Obj_t * pNode;
int i, FiMax, FiBest, RetValue;
- clock_t clk, clkIter;
+ abctime clk, clkIter;
char NodeLag;
// get the upper bound on the clock period
@@ -112,9 +112,9 @@ Vec_Int_t * Abc_NtkRetimeGetLags( Abc_Ntk_t * pNtk, int nIterLimit, int fVerbose
}
// search for the optimal clock period between 0 and nLevelMax
-clk = clock();
+clk = Abc_Clock();
FiBest = Abc_NtkRetimeSearch_rec( pNtk, vNodes, vLatches, 0, FiMax, nIterLimit, fVerbose );
-clkIter = clock() - clk;
+clkIter = Abc_Clock() - clk;
// recompute the best l-values
RetValue = Abc_NtkRetimeForPeriod( pNtk, vNodes, vLatches, FiBest, nIterLimit, fVerbose );