48 int iFanin, i, j, best_i, temp;
62 if ( pPinDelays[pPinPerm[j]] > pPinDelays[pPinPerm[best_i]] )
67 pPinPerm[i] = pPinPerm[best_i];
68 pPinPerm[best_i] = temp;
75 assert( pPinDelays[pPinPerm[i-1]] >= pPinDelays[pPinPerm[i]] );
114 int k, iFanin, pPinPerm[32];
115 float pPinDelays[32];
116 float tArrival, * pDelays;
123 if ( pLutLib == NULL )
173 int k, iFanin, pPinPerm[32];
174 float pPinDelays[32];
175 float tRequired = 0.0;
178 if ( pLutLib == NULL )
236 float tArrival, tArrivalCur, tRequired, tSlack;
242 printf(
"The max LUT size (%d) is less than the max fanin count (%d).\n",
274 if ( tArrival < tArrivalCur )
275 tArrival = tArrivalCur;
317 assert( tSlack + 0.01 > 0.0 );
337 float Gia_ObjComputeRequired(
Gia_Man_t *
p,
int iObj,
int fUseSorting )
341 float pPinDelays[32];
343 float tRequired, tDelay, * pDelays;
348 if ( pLutLib == NULL )
377 tDelay =
Gia_ObjIsCo(pFanout)? 0.0 : pDelays[iFanin];
387 iFanin = Gia_ObjFindFanin( p, pFanout, iObj );
389 tDelay =
Gia_ObjIsCo(pFanout)? 0.0 : pDelays[iFanin];
412 float tArrival, tRequired;
414 Gia_LutForEachObj( p, iObj, i )
419 tRequired = Gia_ObjComputeRequired( p, iObj, 1 );
421 printf(
"Gia_LutVerifyTiming(): Object %d has different arrival time (%.2f) from computed (%.2f).\n",
424 printf(
"Gia_LutVerifyTiming(): Object %d has different required time (%.2f) from computed (%.2f).\n",
446 int i, Nodes, * pCounters;
447 float tArrival, tDelta, nSteps, Num;
451 printf(
"The max LUT size (%d) is less than the max fanin count (%d).\n",
457 pCounters =
ABC_ALLOC(
int, nSteps + 1 );
458 memset( pCounters, 0,
sizeof(
int)*(nSteps + 1) );
461 tDelta = tArrival / nSteps;
470 assert( Num >=0 && Num <= nSteps );
471 pCounters[(int)Num]++;
476 printf(
"Max delay = %6.2f. Delay trace using %s model:\n", tArrival, pLutLib?
"LUT library" :
"unit-delay" );
478 for ( i = 0; i < nSteps; i++ )
480 Nodes += pCounters[i];
481 printf(
"%3d %s : %5d (%6.2f %%)\n", pLutLib? 5*(i+1) : i+1,
505 float pPinDelays[32];
506 float tRequired, * pDelays;
507 unsigned uResult = 0;
510 if ( pLutLib == NULL )
529 uResult |= (1 << pPinPerm[k]);
576 int pCofs[32], nCofs, nSkip, i, k, iResult, iObj;
586 printf(
"Bad node!!!\n" );
592 for ( i = 0; i < nCofs; i++ )
597 pTemp->
Value = ((i & (1<<k)) != 0);
600 pCofs[i] = pTemp->
Value;
605 for ( nSkip = (1<<k), i = 0; i < nCofs; i += 2*nSkip )
610 if ( iResult <= iObj )
632 int iObj, iFanin, iFanin2, nNodesNew;
633 float tDelta, tArrival;
634 int i, k, k2,
Counter, CounterRes, nTimeCris;
635 int fUseLutLib = (p->
pLutLib != NULL);
636 void * pTempTim = NULL;
637 unsigned * puTCEdges;
646 tDelta = fUseLutLib ? tArrival*Percentage/100.0 : 1.0;
649 printf(
"Max delay = %.2f. Delta = %.2f. ", tArrival, tDelta );
650 printf(
"Using %s model. ", fUseLutLib ?
"LUT library" :
"unit-delay" );
652 printf(
"Percentage = %d. ", Percentage );
665 Counter = CounterRes = 0;
673 printf(
"Edges: Total = %7d. 0-slack = %7d. Critical = %7d. Ratio = %4.2f\n",
683 for ( i = 0; i < nNodesNew; i++ )
687 Counter = CounterRes = 0;
699 if ( !fVeryVerbose && nTimeCris == 0 )
709 if ( puTCEdges[iFanin] & (1<<k2) )
729 printf(
"%5d Node %5d : %d %2d %2d ", Counter, iObj,
732 printf(
"%d(%.2f)%s ", iFanin,
Gia_ObjTimeSlack(p, iFanin), (puTCEdges[iObj] & (1<<k))?
"*":
"" );
771 printf(
"Speedup stopped adding choices because there was too many to add.\n" );
780 printf(
"Nodes: Total = %7d. 0-slack = %7d. Workable = %7d. Ratio = %4.2f\n",
781 Gia_ManLutNum(p), Counter, CounterRes, Counter? 1.0*CounterRes/Counter : 0.0 );
static int Gia_ObjToLit(Gia_Man_t *p, Gia_Obj_t *pObj)
ABC_NAMESPACE_IMPL_START void Gia_LutDelayTraceSortPins(Gia_Man_t *p, int iObj, int *pPinPerm, float *pPinDelays)
DECLARATIONS ///.
Gia_Man_t * Gia_ManDup(Gia_Man_t *p)
void Gia_ManStop(Gia_Man_t *p)
void Tim_ManIncrementTravId(Tim_Man_t *p)
DECLARATIONS ///.
#define Gia_ManForEachCo(p, pObj, i)
int Gia_LutWhereIsPin(Gia_Man_t *p, int iFanout, int iFanin, int *pPinPerm)
float Gia_ObjPropagateRequired(Gia_Man_t *p, int iObj, int fUseSorting)
int Gia_ManLutLevel(Gia_Man_t *p)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Gia_ObjIsTravIdCurrent(Gia_Man_t *p, Gia_Obj_t *pObj)
static int Abc_Var2Lit(int Var, int fCompl)
void Tim_ManSetCoArrival(Tim_Man_t *p, int iCo, float Delay)
unsigned Gia_LutDelayTraceTCEdges(Gia_Man_t *p, int iObj, float tDelta)
float Gia_ManDelayTraceLut(Gia_Man_t *p)
float pLutDelays[IF_MAX_LUTSIZE+1][IF_MAX_LUTSIZE+1]
static int Gia_WordCountOnes(unsigned uWord)
#define ABC_ALLOC(type, num)
int Gia_ManLutNum(Gia_Man_t *p)
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
#define Gia_ManForEachLut(p, i)
Gia_Man_t * Gia_ManSpeedup(Gia_Man_t *p, int Percentage, int Degree, int fVerbose, int fVeryVerbose)
#define Gia_ObjForEachFanout(p, pObj, pFanout, iFan, i)
void Tim_ManSetCiRequired(Tim_Man_t *p, int iCi, float Delay)
Gia_Man_t * Gia_ManEquivToChoices(Gia_Man_t *p, int nSnapshots)
static void Gia_ObjSetRepr(Gia_Man_t *p, int Id, int Num)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
float Gia_ManDelayTraceLutPrint(Gia_Man_t *p, int fVerbose)
static void Gia_ObjSetTimeSlack(Gia_Man_t *p, int Id, float t)
static Gia_Obj_t * Gia_ObjFanin0(Gia_Obj_t *pObj)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Gia_ObjLutSize(Gia_Man_t *p, int Id)
static float Gia_ObjTimeSlack(Gia_Man_t *p, int Id)
int Gia_ManLutFaninCount(Gia_Man_t *p)
static int Gia_ObjFanin1Copy(Gia_Obj_t *pObj)
int Gia_ManSpeedupObj_rec(Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vNodes)
static int Vec_IntEntry(Vec_Int_t *p, int i)
static void Gia_ObjSetTravIdCurrent(Gia_Man_t *p, Gia_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
int Gia_ManHashMux(Gia_Man_t *p, int iCtrl, int iData1, int iData0)
void Gia_ManHashStart(Gia_Man_t *p)
static int Gia_ObjFanoutNum(Gia_Man_t *p, Gia_Obj_t *pObj)
static float Gia_ObjTimeRequired(Gia_Man_t *p, int Id)
Tim_Man_t * Tim_ManDup(Tim_Man_t *p, int fUnitDelay)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
static void Gia_ManTimeStop(Gia_Man_t *p)
void Tim_ManStop(Tim_Man_t *p)
int Gia_ManLutSizeMax(Gia_Man_t *p)
static int Gia_ObjFanin0Copy(Gia_Obj_t *pObj)
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
static int Gia_ObjNext(Gia_Man_t *p, int Id)
#define Gia_ManForEachObjVec(vVec, p, pObj, i)
#define ABC_NAMESPACE_IMPL_START
static void Gia_ObjSetNext(Gia_Man_t *p, int Id, int Num)
static void Gia_ObjSetTimeArrival(Gia_Man_t *p, int Id, float t)
static void Gia_ObjSetTimeRequiredObj(Gia_Man_t *p, Gia_Obj_t *pObj, float t)
static int Gia_ObjLutFanin(Gia_Man_t *p, int Id, int i)
static int Vec_IntSize(Vec_Int_t *p)
static int Gia_ManHasMapping(Gia_Man_t *p)
#define TIM_ETERNITY
MACRO DEFINITIONS ///.
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
static void Gia_ManTimeStart(Gia_Man_t *p)
#define Gia_ManForEachObj(p, pObj, i)
MACRO DEFINITIONS ///.
static Gia_Obj_t * Gia_ManConst0(Gia_Man_t *p)
#define ABC_CALLOC(type, num)
static int Abc_Lit2Var(int Lit)
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
static Gia_Obj_t * Gia_ObjFanin1(Gia_Obj_t *pObj)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
static float Gia_ObjTimeArrival(Gia_Man_t *p, int Id)
float Tim_ManGetCoRequired(Tim_Man_t *p, int iCo)
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
static int Gia_ObjIsLut(Gia_Man_t *p, int Id)
float Gia_ObjComputeArrival(Gia_Man_t *p, int iObj, int fUseSorting)
void Gia_ManIncrementTravId(Gia_Man_t *p)
Vec_Int_t * Gia_ManOrderReverse(Gia_Man_t *p)
static void Vec_IntFree(Vec_Int_t *p)
static int Vec_IntPushUnique(Vec_Int_t *p, int Entry)
static void Vec_IntClear(Vec_Int_t *p)
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
static void Gia_ObjSetTimeRequired(Gia_Man_t *p, int Id, float t)
#define Vec_IntForEachEntry(vVec, Entry, i)
MACRO DEFINITIONS ///.
float Tim_ManGetCiArrival(Tim_Man_t *p, int iCi)
void Gia_ManSpeedupObj(Gia_Man_t *pNew, Gia_Man_t *p, Gia_Obj_t *pObj, Vec_Int_t *vLeaves, Vec_Int_t *vTimes)
#define Gia_LutForEachFanin(p, i, iFan, k)
int Gia_ManHashAnd(Gia_Man_t *p, int iLit0, int iLit1)
static int Gia_ObjCioId(Gia_Obj_t *pObj)
static int Gia_ManObjNum(Gia_Man_t *p)
void Tim_ManInitPoRequiredAll(Tim_Man_t *p, float Delay)
static float Gia_ObjTimeArrivalObj(Gia_Man_t *p, Gia_Obj_t *pObj)