diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2006-11-28 08:01:00 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2006-11-28 08:01:00 -0800 |
commit | 44d220d28fa2ee56cb539e03684f021731814f17 (patch) | |
tree | 97ece1e77fa8fff2283c62fb9253424e566e7fba /src/map/if/ifCore.c | |
parent | 6ad22b4d3b0446652919d95b15fefb374bddfac0 (diff) | |
download | abc-44d220d28fa2ee56cb539e03684f021731814f17.tar.gz abc-44d220d28fa2ee56cb539e03684f021731814f17.tar.bz2 abc-44d220d28fa2ee56cb539e03684f021731814f17.zip |
Version abc61128
Diffstat (limited to 'src/map/if/ifCore.c')
-rw-r--r-- | src/map/if/ifCore.c | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/map/if/ifCore.c b/src/map/if/ifCore.c index 4d7e92d0..37a22d8b 100644 --- a/src/map/if/ifCore.c +++ b/src/map/if/ifCore.c @@ -24,6 +24,8 @@ /// DECLARATIONS /// //////////////////////////////////////////////////////////////////////// +static int If_ManPerformMappingRound( If_Man_t * p, int nCutsUsed, int Mode ); + //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// @@ -39,6 +41,72 @@ SeeAlso [] ***********************************************************************/ +int If_ManPerformMapping( If_Man_t * p ) +{ + If_Obj_t * pObj; + int nItersFlow = 2; + int nItersArea = 1; + int clkTotal = clock(); + int i; + // set arrival times and trivial cuts at const 1 and PIs + If_ManConst1(p)->Cuts[0].Delay = 0.0; + If_ManForEachPi( p, pObj, i ) + pObj->Cuts[0].Delay = p->pPars->pTimesArr[i]; + // set the fanout estimates of the PIs + If_ManForEachPi( p, pObj, i ) + pObj->EstRefs = (float)1.0; + // delay oriented mapping + If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0 ); + // area flow oriented mapping + for ( i = 0; i < nItersFlow; i++ ) + If_ManPerformMappingRound( p, p->pPars->nCutsMax, 1 ); + // area oriented mapping + for ( i = 0; i < nItersArea; i++ ) + If_ManPerformMappingRound( p, p->pPars->nCutsMax, 2 ); + if ( p->pPars->fVerbose ) + { + PRT( "Total time", clock() - clkTotal ); + } + return 1; +} + +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +int If_ManPerformMappingRound( If_Man_t * p, int nCutsUsed, int Mode ) +{ + If_Obj_t * pObj; + int i, clk = clock(); + assert( Mode >= 0 && Mode <= 2 ); + // set the cut number + p->nCutsUsed = nCutsUsed; + p->nCutsMerged = 0; + p->nCutsMax = 0; + // map the internal nodes + If_ManForEachNode( p, pObj, i ) + If_ObjPerformMapping( p, pObj, Mode ); + // compute required times and stats + If_ManComputeRequired( p, Mode==0 ); + if ( p->pPars->fVerbose ) + { + char Symb = (Mode == 0)? 'D' : ((Mode == 1)? 'F' : 'A'); + printf( "%c: Del = %6.2f. Area = %8.2f. Cuts = %6d. Lim = %2d. Ave = %5.2f. ", + Symb, p->RequiredGlo, p->AreaGlo, p->nCutsMerged, p->nCutsUsed, 1.0 * p->nCutsMerged / If_ManAndNum(p) ); + PRT( "T", clock() - clk ); +// printf( "Max number of cuts = %d. Average number of cuts = %5.2f.\n", +// p->nCutsMax, 1.0 * p->nCutsMerged / If_ManAndNum(p) ); + } + return 1; +} + //////////////////////////////////////////////////////////////////////// /// END OF FILE /// |