diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2007-03-13 08:01:00 -0700 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2007-03-13 08:01:00 -0700 |
commit | 2696cf05e568f7a928f32b01534d106bf626ef8a (patch) | |
tree | c795e6a7c53151faa830a55bfdc082dc67d98e4e /src/map | |
parent | 93c05287f0d8b044e620b41608df906bbad39db5 (diff) | |
download | abc-2696cf05e568f7a928f32b01534d106bf626ef8a.tar.gz abc-2696cf05e568f7a928f32b01534d106bf626ef8a.tar.bz2 abc-2696cf05e568f7a928f32b01534d106bf626ef8a.zip |
Version abc70313
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/if/ifCore.c | 3 | ||||
-rw-r--r-- | src/map/if/ifSeq.c | 26 | ||||
-rw-r--r-- | src/map/if/ifUtil.c | 12 |
3 files changed, 35 insertions, 6 deletions
diff --git a/src/map/if/ifCore.c b/src/map/if/ifCore.c index 60ddcbe1..c36642bc 100644 --- a/src/map/if/ifCore.c +++ b/src/map/if/ifCore.c @@ -24,6 +24,8 @@ /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// +extern int s_MappingTime; + //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// @@ -133,6 +135,7 @@ int If_ManPerformMappingComb( If_Man_t * p ) PRT( "Total time", clock() - clkTotal ); } // printf( "Cross cut memory = %d.\n", Mem_FixedReadMaxEntriesUsed(p->pMemSet) ); + s_MappingTime = clock() - clkTotal; return 1; } diff --git a/src/map/if/ifSeq.c b/src/map/if/ifSeq.c index e6528233..8d1de8c1 100644 --- a/src/map/if/ifSeq.c +++ b/src/map/if/ifSeq.c @@ -24,6 +24,8 @@ /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// +extern int s_MappingTime; + //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// @@ -186,15 +188,20 @@ int If_ManBinarySearchPeriod( If_Man_t * p ) p->nAttempts++; - // set LValues of of PIs to be 0 and other nodes to be -infinity - // LValues of the PIs are already set to 0 - // undo any previous mapping, except for CIs + // reset initial LValues (PIs to 0; others to -inf) If_ManForEachObj( p, pObj, i ) { if ( If_ObjIsPi(pObj) || If_ObjIsConst1(pObj) ) + { If_ObjSetLValue( pObj, (float)0.0 ); + If_ObjSetArrTime( pObj, (float)0.0 ); + } else + { If_ObjSetLValue( pObj, (float)-IF_INFINITY ); + If_ObjSetArrTime( pObj, (float)-IF_INFINITY ); + } + // undo any previous mapping, except for CIs if ( If_ObjIsAnd(pObj) ) If_ObjCutBest(pObj)->nLeaves = 0; } @@ -368,6 +375,18 @@ int If_ManPerformMappingSeq( If_Man_t * p ) } if ( p->pPars->fVerbose ) { +/* + { + FILE * pTable; + pTable = fopen( "iscas/stats_new.txt", "a+" ); +// fprintf( pTable, "%s ", pNtk->pName ); + fprintf( pTable, "%d ", p->Period ); + // fprintf( pTable, "%.2f ", (float)(s_MappingMem)/(float)(1<<20) ); +// fprintf( pTable, "%.2f", (float)(s_MappingTime)/(float)(CLOCKS_PER_SEC) ); +// fprintf( pTable, "\n" ); + fclose( pTable ); + } +*/ printf( "The best clock period is %3d. ", p->Period ); PRT( "Sequential time", clock() - clkTotal ); } @@ -375,6 +394,7 @@ int If_ManPerformMappingSeq( If_Man_t * p ) // postprocess it using combinational mapping If_ManPerformMappingSeqPost( p ); + s_MappingTime = clock() - clkTotal; return 1; } diff --git a/src/map/if/ifUtil.c b/src/map/if/ifUtil.c index 4fdb4d31..f4ffa4c1 100644 --- a/src/map/if/ifUtil.c +++ b/src/map/if/ifUtil.c @@ -143,7 +143,7 @@ float If_ManDelayMax( If_Man_t * p, int fSeq ) void If_ManComputeRequired( If_Man_t * p ) { If_Obj_t * pObj; - int i; + int i, Counter; // compute area, clean required times, collect nodes used in the mapping p->nNets = 0; @@ -154,13 +154,19 @@ void If_ManComputeRequired( If_Man_t * p ) { assert( !p->pPars->fAreaOnly ); // make sure that the required time hold + Counter = 0; If_ManForEachCo( p, pObj, i ) { if ( If_ObjArrTime(If_ObjFanin0(pObj)) > p->pPars->pTimesReq[i] + p->fEpsilon ) - printf( "Required times are violated for output %d (arr = %d; req = %d).\n", - i, (int)If_ObjArrTime(If_ObjFanin0(pObj)), (int)p->pPars->pTimesReq[i] ); + { + Counter++; +// printf( "Required times are violated for output %d (arr = %d; req = %d).\n", +// i, (int)If_ObjArrTime(If_ObjFanin0(pObj)), (int)p->pPars->pTimesReq[i] ); + } If_ObjFanin0(pObj)->Required = p->pPars->pTimesReq[i]; } + if ( Counter ) + printf( "Required times are violated for %d outputs.\n", Counter ); } else { |