53 for ( i = 0; i <
p->pPars->nLatchesCi; i++ )
55 pObjLi = If_ManLi(
p, i );
56 pObjLo = If_ManLo(
p, i );
57 pObjLo->
pFanin0 = If_ObjFanin0( pObjLi );
58 pObjLo->
fCompl0 = If_ObjFaninC0( pObjLi );
75 if ( !If_ObjIsLatch(pObj) )
81 Vec_PtrPush( vLatches, pObj );
101 vLatches = Vec_PtrAlloc(
p->pPars->nLatchesCi );
107 assert( Vec_PtrSize(vLatches) ==
p->pPars->nLatchesCi );
128 int fVeryVerbose = 0;
136 If_ObjSetLValue( pObj, If_ObjLValue(If_ObjFanin0(pObj)) -
p->Period );
137 If_ObjSetArrTime( pObj, If_ObjLValue(pObj) );
155 if ( If_ObjLValue(pObj) < If_ObjCutBest(pObj)->Delay -
p->fEpsilon )
157 If_ObjSetLValue( pObj, If_ObjCutBest(pObj)->Delay );
170 If_ObjSetLValue( pObj, If_ObjLValue(If_ObjFanin0(pObj)) -
p->Period );
171 If_ObjSetArrTime( pObj, If_ObjLValue(pObj) );
180 Abc_Print( 1,
"S%d: Fi = %6.2f. Del = %6.2f. Area = %8.2f. Cuts = %8d. ",
181 nIter, (
float)
p->Period,
p->RequiredGlo,
p->AreaGlo,
p->nCutsMerged );
182 Abc_PrintTime( 1,
"T", Abc_Clock() - clk );
201 int i, c, fConverged;
211 if ( If_ObjIsAnd(pObj) )
212 If_ObjCutBest(pObj)->nLeaves = 0;
214 pObj = If_ManConst1(
p );
215 If_ObjSetLValue( pObj, (
float)0.0 );
216 If_ObjSetArrTime( pObj, (
float)0.0 );
219 pObj = If_ManCi(
p, i );
220 If_ObjSetLValue( pObj, (
float)0.0 );
221 If_ObjSetArrTime( pObj, (
float)0.0 );
226 for ( c = 1; c <=
p->nMaxIters; c++ )
236 if (
p->RequiredGlo >
p->Period +
p->fEpsilon )
242 if (
p->pPars->fVerbose )
245 Abc_Print( 1,
"Attempt = %2d. Iters = %3d. Area = %10.2f. Fi = %6.2f. ",
p->nAttempts, c,
p->AreaGlo, (
float)
p->Period );
247 Abc_Print( 1,
" Feasible" );
248 else if ( c >
p->nMaxIters )
249 Abc_Print( 1,
"Infeasible (timeout)" );
251 Abc_Print( 1,
"Infeasible" );
252 Abc_Print( 1,
"\n" );
272 if ( FiMin + 1 == FiMax )
275 p->Period = FiMin + (FiMax - FiMin)/2;
295 If_Obj_t * pObjLi, * pObjLo, * pObj;
300 assert(
p->pPars->pTimesArr != NULL );
302 p->pPars->pTimesArr[i] = If_ObjLValue(pObjLo);
305 assert(
p->pPars->pTimesReq == NULL );
306 p->pPars->pTimesReq =
ABC_ALLOC(
float, If_ManCoNum(
p) );
308 p->pPars->pTimesReq[i] =
p->RequiredGlo2;
310 p->pPars->pTimesReq[i] = If_ObjLValue(If_ObjFanin0(pObjLi));
314 if ( If_ObjIsAnd(pObj) )
315 If_ObjCutBest(pObj)->nLeaves = 0;
336 abctime clkTotal = Abc_Clock();
344 p->RequiredGlo2 =
p->RequiredGlo;
353 p->nCutsUsed =
p->pPars->nCutsMax;
356 p->Period = (int)
p->RequiredGlo;
361 Abc_Print( 1,
"If_ManPerformMappingSeq(): The upper bound on the clock period cannot be computed.\n" );
369 if (
p->Period != PeriodBest )
371 p->Period = PeriodBest;
374 Abc_Print( 1,
"If_ManPerformMappingSeq(): The final clock period cannot be confirmed.\n" );
380 Abc_Print( 1,
"The best clock period is %3d. ",
p->Period );
381 Abc_PrintTime( 1,
"Time", Abc_Clock() - clkTotal );
383 p->RequiredGlo = (float)(PeriodBest);
#define ABC_ALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
Vec_Ptr_t * If_ManCollectLatches(If_Man_t *p)
int If_ManBinarySearch_rec(If_Man_t *p, int FiMin, int FiMax)
int If_ManPerformMappingRoundSeq(If_Man_t *p, int nIter)
void If_ManPerformMappingSeqPost(If_Man_t *p)
void If_ManPrepareMappingSeq(If_Man_t *p)
FUNCTION DEFINITIONS ///.
void If_ManCollectLatches_rec(If_Obj_t *pObj, Vec_Ptr_t *vLatches)
int If_ManPerformMappingSeq(If_Man_t *p)
int If_ManBinarySearchPeriod(If_Man_t *p)
#define If_ManForEachObj(p, pObj, i)
void If_ObjPerformMappingAnd(If_Man_t *p, If_Obj_t *pObj, int Mode, int fPreprocess, int fFirst)
#define If_ManForEachPi(p, pObj, i)
int If_ManPerformMappingComb(If_Man_t *p)
void If_ManMarkMapping(If_Man_t *p)
void If_ObjPerformMappingChoice(If_Man_t *p, If_Obj_t *pObj, int Mode, int fPreprocess)
float If_ManDelayMax(If_Man_t *p, int fSeq)
int If_ManPerformMappingRound(If_Man_t *p, int nCutsUsed, int Mode, int fPreprocess, int fFirst, char *pLabel)
#define If_ManForEachLatchInput(p, pObj, i)
struct If_Man_t_ If_Man_t
BASIC TYPES ///.
#define If_ManForEachNode(p, pObj, i)
#define If_ManForEachPo(p, pObj, i)
struct If_Obj_t_ If_Obj_t
#define If_ManForEachLatchOutput(p, pObj, i)
abctime s_MappingTime
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.