00001
00021 #include "if.h"
00022
00026
00027 extern int s_MappingTime;
00028
00032
00044 int If_ManPerformMapping( If_Man_t * p )
00045 {
00046 p->pPars->fAreaOnly = p->pPars->fArea;
00047
00048
00049 If_ManSetupCiCutSets( p );
00050
00051 If_ManSetupSetAll( p, If_ManCrossCut(p) );
00052
00053
00054 if ( p->pPars->fSeqMap )
00055 {
00056 int RetValue;
00057
00058 RetValue = If_ManPerformMappingSeq( p );
00059 return RetValue;
00060
00061 }
00062
00063 return If_ManPerformMappingComb( p );
00064 }
00065
00066
00078 int If_ManPerformMappingComb( If_Man_t * p )
00079 {
00080 If_Obj_t * pObj;
00081 int clkTotal = clock();
00082 int i;
00083
00084
00085 If_ManForEachCi( p, pObj, i )
00086 {
00087 If_ObjSetArrTime( pObj, p->pPars->pTimesArr[i] );
00088 pObj->EstRefs = (float)1.0;
00089 }
00090
00091
00092 if ( p->pPars->fPreprocess && !p->pPars->fArea )
00093 {
00094
00095 If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 1, "Delay" );
00096
00097 p->pPars->fFancy = 1;
00098 If_ManResetOriginalRefs( p );
00099 If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 1, "Delay-2" );
00100 p->pPars->fFancy = 0;
00101
00102 p->pPars->fArea = 1;
00103 If_ManResetOriginalRefs( p );
00104 If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 1, "Area" );
00105 p->pPars->fArea = 0;
00106 }
00107 else
00108 If_ManPerformMappingRound( p, p->pPars->nCutsMax, 0, 0, "Delay" );
00109
00110
00111 if ( p->pPars->fExpRed && !p->pPars->fTruth )
00112 If_ManImproveMapping( p );
00113
00114
00115 for ( i = 0; i < p->pPars->nFlowIters; i++ )
00116 {
00117 If_ManPerformMappingRound( p, p->pPars->nCutsMax, 1, 0, "Flow" );
00118 if ( p->pPars->fExpRed && !p->pPars->fTruth )
00119 If_ManImproveMapping( p );
00120 }
00121
00122
00123 for ( i = 0; i < p->pPars->nAreaIters; i++ )
00124 {
00125 If_ManPerformMappingRound( p, p->pPars->nCutsMax, 2, 0, "Area" );
00126 if ( p->pPars->fExpRed && !p->pPars->fTruth )
00127 If_ManImproveMapping( p );
00128 }
00129
00130 if ( p->pPars->fVerbose )
00131 {
00132
00133
00134
00135 PRT( "Total time", clock() - clkTotal );
00136 }
00137
00138 s_MappingTime = clock() - clkTotal;
00139 return 1;
00140 }
00141
00145
00146