summaryrefslogtreecommitdiffstats
path: root/src/map/amap
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/map/amap
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/map/amap')
-rw-r--r--src/map/amap/amapCore.c4
-rw-r--r--src/map/amap/amapLib.c10
-rw-r--r--src/map/amap/amapLiberty.c8
-rw-r--r--src/map/amap/amapMatch.c4
-rw-r--r--src/map/amap/amapMerge.c4
-rw-r--r--src/map/amap/amapParse.c4
-rw-r--r--src/map/amap/amapRule.c2
7 files changed, 18 insertions, 18 deletions
diff --git a/src/map/amap/amapCore.c b/src/map/amap/amapCore.c
index c4ae817a..5a84669c 100644
--- a/src/map/amap/amapCore.c
+++ b/src/map/amap/amapCore.c
@@ -72,7 +72,7 @@ Vec_Ptr_t * Amap_ManTest( Aig_Man_t * pAig, Amap_Par_t * pPars )
Vec_Ptr_t * vRes;
Amap_Man_t * p;
Amap_Lib_t * pLib;
- clock_t clkTotal = clock();
+ abctime clkTotal = Abc_Clock();
pLib = (Amap_Lib_t *)Abc_FrameReadLibGen2();
if ( pLib == NULL )
{
@@ -94,7 +94,7 @@ Vec_Ptr_t * Amap_ManTest( Aig_Man_t * pAig, Amap_Par_t * pPars )
Amap_ManStop( p );
if ( pPars->fVerbose )
{
-ABC_PRT( "Total runtime", clock() - clkTotal );
+ABC_PRT( "Total runtime", Abc_Clock() - clkTotal );
}
return vRes;
}
diff --git a/src/map/amap/amapLib.c b/src/map/amap/amapLib.c
index de02c872..b6350fed 100644
--- a/src/map/amap/amapLib.c
+++ b/src/map/amap/amapLib.c
@@ -262,7 +262,7 @@ Vec_Ptr_t * Amap_LibSelectGates( Amap_Lib_t * p, int fVerbose )
{
Vec_Ptr_t * vSelect;
Amap_Gat_t * pGate, * pGate2;
- int i, k;//, clk = clock();
+ int i, k;//, clk = Abc_Clock();
p->pGate0 = Amap_LibFindGate( p, 0 );
p->pGate1 = Amap_LibFindGate( p, ~0 );
p->pGateBuf = Amap_LibFindGate( p, 0xAAAAAAAA );
@@ -329,7 +329,7 @@ void Amap_LibPrintSelectedGates( Amap_Lib_t * p, int fAllGates )
Amap_Lib_t * Amap_LibReadAndPrepare( char * pFileName, char * pBuffer, int fVerbose, int fVeryVerbose )
{
Amap_Lib_t * p;
- clock_t clk = clock();
+ abctime clk = Abc_Clock();
if ( pBuffer == NULL )
p = Amap_LibReadFile( pFileName, fVerbose );
else
@@ -352,15 +352,15 @@ Amap_Lib_t * Amap_LibReadAndPrepare( char * pFileName, char * pBuffer, int fVerb
if ( fVerbose )
{
printf( "Selected %d functionally unique gates. ", Vec_PtrSize(p->vSelect) );
- ABC_PRT( "Time", clock() - clk );
+ ABC_PRT( "Time", Abc_Clock() - clk );
// Amap_LibPrintSelectedGates( p, 0 );
}
- clk = clock();
+ clk = Abc_Clock();
Amap_LibCreateRules( p, fVeryVerbose );
if ( fVerbose )
{
printf( "Created %d rules and %d matches. ", p->nNodes, p->nSets );
- ABC_PRT( "Time", clock() - clk );
+ ABC_PRT( "Time", Abc_Clock() - clk );
}
return p;
}
diff --git a/src/map/amap/amapLiberty.c b/src/map/amap/amapLiberty.c
index 941abe50..13b18df5 100644
--- a/src/map/amap/amapLiberty.c
+++ b/src/map/amap/amapLiberty.c
@@ -1013,7 +1013,7 @@ int Amap_LibertyParse( char * pFileName, int fVerbose )
{
Amap_Tree_t * p;
char * pPos;
- clock_t clk = clock();
+ abctime clk = Abc_Clock();
int RetValue;
p = Amap_LibertyStart( pFileName );
if ( p == NULL )
@@ -1039,7 +1039,7 @@ int Amap_LibertyParse( char * pFileName, int fVerbose )
if ( fVerbose )
{
printf( "Memory = %7.2f MB. ", 1.0*(p->nContents+p->nItermAlloc*sizeof(Amap_Item_t))/(1<<20) );
- ABC_PRT( "Time", clock() - clk );
+ ABC_PRT( "Time", Abc_Clock() - clk );
}
Amap_LibertyStop( p );
return RetValue;
@@ -1061,7 +1061,7 @@ Vec_Str_t * Amap_LibertyParseStr( char * pFileName, int fVerbose )
Amap_Tree_t * p;
Vec_Str_t * vStr = NULL;
char * pPos;
- clock_t clk = clock();
+ abctime clk = Abc_Clock();
int RetValue;
p = Amap_LibertyStart( pFileName );
if ( p == NULL )
@@ -1087,7 +1087,7 @@ Vec_Str_t * Amap_LibertyParseStr( char * pFileName, int fVerbose )
if ( fVerbose )
{
printf( "Memory = %7.2f MB. ", 1.0*(p->nContents+p->nItermAlloc*sizeof(Amap_Item_t))/(1<<20) );
- ABC_PRT( "Time", clock() - clk );
+ ABC_PRT( "Time", Abc_Clock() - clk );
}
Amap_LibertyStop( p );
return vStr;
diff --git a/src/map/amap/amapMatch.c b/src/map/amap/amapMatch.c
index 8903bf4e..52e80c26 100644
--- a/src/map/amap/amapMatch.c
+++ b/src/map/amap/amapMatch.c
@@ -485,7 +485,7 @@ void Amap_ManMatch( Amap_Man_t * p, int fFlow, int fRefs )
Amap_Obj_t * pObj;
float Area;
int i, nInvs;
- clock_t clk = clock();
+ abctime clk = Abc_Clock();
pMemOld = p->pMemCutBest;
p->pMemCutBest = Aig_MmFlexStart();
Amap_ManForEachNode( p, pObj, i )
@@ -500,7 +500,7 @@ if ( p->pPars->fVerbose )
Area + nInvs * p->fAreaInv,
Area, nInvs * p->fAreaInv, nInvs,
Amap_ManMaxDelay(p) );
-ABC_PRT( "Time ", clock() - clk );
+ABC_PRT( "Time ", Abc_Clock() - clk );
}
// test procedures
// Amap_ManForEachNode( p, pObj, i )
diff --git a/src/map/amap/amapMerge.c b/src/map/amap/amapMerge.c
index b4aaca9d..4b91f7ca 100644
--- a/src/map/amap/amapMerge.c
+++ b/src/map/amap/amapMerge.c
@@ -515,7 +515,7 @@ void Amap_ManMerge( Amap_Man_t * p )
{
Amap_Obj_t * pObj;
int i;
- clock_t clk = clock();
+ abctime clk = Abc_Clock();
p->pCutsPi = Amap_ManSetupPis( p );
Amap_ManForEachNode( p, pObj, i )
Amap_ManMergeNodeCuts( p, pObj );
@@ -527,7 +527,7 @@ void Amap_ManMerge( Amap_Man_t * p )
printf( "Node =%6d. Try =%9d. Try3 =%10d. Used =%7d. R =%6.2f. ",
Amap_ManNodeNum(p), p->nCutsTried, p->nCutsTried3, p->nCutsUsed,
1.0*p->nCutsUsed/Amap_ManNodeNum(p) );
-ABC_PRT( "Time ", clock() - clk );
+ABC_PRT( "Time ", Abc_Clock() - clk );
}
}
diff --git a/src/map/amap/amapParse.c b/src/map/amap/amapParse.c
index f2a38db6..6d8b7520 100644
--- a/src/map/amap/amapParse.c
+++ b/src/map/amap/amapParse.c
@@ -462,13 +462,13 @@ void Amap_LibParseTest( char * pFileName )
{
int fVerbose = 0;
Amap_Lib_t * p;
- clock_t clk = clock();
+ abctime clk = Abc_Clock();
p = Amap_LibReadFile( pFileName, fVerbose );
if ( p == NULL )
return;
Amap_LibParseEquations( p, fVerbose );
Amap_LibFree( p );
- ABC_PRT( "Total time", clock() - clk );
+ ABC_PRT( "Total time", Abc_Clock() - clk );
}
////////////////////////////////////////////////////////////////////////
diff --git a/src/map/amap/amapRule.c b/src/map/amap/amapRule.c
index 772c346d..4ff3cacb 100644
--- a/src/map/amap/amapRule.c
+++ b/src/map/amap/amapRule.c
@@ -338,7 +338,7 @@ void Amap_LibCreateRules( Amap_Lib_t * pLib, int fVeryVerbose )
{
Amap_Gat_t * pGate;
int i, nGates = 0;
-// clock_t clk = clock();
+// abctime clk = Abc_Clock();
pLib->fVerbose = fVeryVerbose;
pLib->vRules = Vec_PtrAlloc( 100 );
pLib->vRulesX = Vec_PtrAlloc( 100 );