51 pObj->tArrival = pObj->tSlack = 0.0;
70 int i, j, best_i, temp;
83 if ( pPinDelays[pPinPerm[j]] > pPinDelays[pPinPerm[best_i]] )
88 pPinPerm[i] = pPinPerm[best_i];
89 pPinPerm[best_i] = temp;
96 assert( pPinDelays[pPinPerm[i-1]] >= pPinDelays[pPinPerm[i]] );
135 float pPinDelays[32];
137 float tArrival, * pDelays;
145 if ( pLutLib == NULL )
195 float pPinDelays[32];
197 float tRequired, tDelay, * pDelays;
203 if ( pLutLib == NULL )
232 tDelay =
Nwk_ObjIsCo(pFanout)? 0.0 : pDelays[iFanin];
244 tDelay =
Nwk_ObjIsCo(pFanout)? 0.0 : pDelays[iFanin];
268 float pPinDelays[32];
270 float tRequired = 0.0;
274 if ( pLutLib == NULL )
333 float tArrival, tRequired, tSlack;
339 printf(
"The max LUT size (%d) is less than the max fanin count (%d).\n",
409 assert( tSlack + 0.01 > 0.0 );
430 float tArrival, tRequired;
439 printf(
"Nwk_ManVerifyTiming(): Object %d has different arrival time (%.2f) from computed (%.2f).\n",
442 printf(
"Nwk_ManVerifyTiming(): Object %d has different required time (%.2f) from computed (%.2f).\n",
463 int i, Nodes, * pCounters;
464 float tArrival, tDelta, nSteps, Num;
468 printf(
"The max LUT size (%d) is less than the max fanin count (%d).\n",
474 pCounters =
ABC_ALLOC(
int, nSteps + 1 );
475 memset( pCounters, 0,
sizeof(
int)*(nSteps + 1) );
478 tDelta = tArrival / nSteps;
487 assert( Num >=0 && Num <= nSteps );
488 pCounters[(int)Num]++;
491 printf(
"Max delay = %6.2f. Delay trace using %s model:\n", tArrival, pLutLib?
"LUT library" :
"unit-delay" );
493 for ( i = 0; i < nSteps; i++ )
495 Nodes += pCounters[i];
496 printf(
"%3d %s : %5d (%6.2f %%)\n", pLutLib? 5*(i+1) : i+1,
522 for ( i =
Vec_PtrSize(vQueue) - 1; i > iCurrent + 1; i-- )
525 pTemp2 = (
Nwk_Obj_t *)vQueue->pArray[i-1];
536 vQueue->pArray[i-1] = pTemp1;
537 vQueue->pArray[i] = pTemp2;
540 for ( i = iCurrent + 1; i <
Vec_PtrSize(vQueue) - 1; i++ )
543 pTemp2 = (
Nwk_Obj_t *)vQueue->pArray[i+1];
564 Tim_Man_t * pManTime = pObj->pMan->pManTime;
569 int iCur, k, iBox, iTerm1, nTerms;
606 for ( k = 0; k < nTerms; k++ )
608 pNext =
Nwk_ManCi(pNext->pMan, iTerm1 + k);
643 Tim_Man_t * pManTime = pObj->pMan->pManTime;
648 int iCur, k, iBox, iTerm1, nTerms;
690 for ( k = 0; k < nTerms; k++ )
692 pNext =
Nwk_ManCo(pNext->pMan, iTerm1 + k);
727 Tim_Man_t * pManTime = pObj->pMan->pManTime;
729 int i, iBox, iTerm1, nTerms, Level = 0;
739 for ( i = 0; i < nTerms; i++ )
741 pFanin =
Nwk_ManCo(pObj->pMan, iTerm1 + i);
768 Tim_Man_t * pManTime = pObj->pMan->pManTime;
772 int LevelNew, iCur, k, iBox, iTerm1, nTerms;
797 for ( k = 0; k < nTerms; k++ )
799 pNext =
Nwk_ManCi(pNext->pMan, iTerm1 + k);
838 assert( pObj->MarkA == 0 );
842 printf(
"Object %6d: Mismatch betweeh levels: Actual = %d. Correct = %d.\n",
862 assert( pObj->pMan == pObjNew->pMan );
863 assert( pObj != pObjNew );
872 pObjNew->Level = pObj->Level;
873 pObjNew->tArrival = pObj->tArrival;
874 pObjNew->tRequired = pObj->tRequired;
int Tim_ManBoxOutputFirst(Tim_Man_t *p, int iBox)
int Tim_ManBoxForCi(Tim_Man_t *p, int iCo)
static Nwk_Obj_t * Nwk_ManCo(Nwk_Man_t *p, int i)
float Nwk_NodeComputeRequired(Nwk_Obj_t *pObj, int fUseSorting)
int Tim_ManIsCiTravIdCurrent(Tim_Man_t *p, int iCi)
static int Nwk_ObjIsCi(Nwk_Obj_t *p)
static Nwk_Obj_t * Nwk_ManCi(Nwk_Man_t *p, int i)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
int Nwk_ObjLevelNew(Nwk_Obj_t *pObj)
ABC_DLL void Nwk_ManDeleteNode_rec(Nwk_Obj_t *pObj)
static int Nwk_ObjFanoutNum(Nwk_Obj_t *p)
void Tim_ManSetCurrentTravIdBoxOutputs(Tim_Man_t *p, int iBox)
#define Nwk_ManForEachCo(p, pObj, i)
void Tim_ManIncrementTravId(Tim_Man_t *p)
DECLARATIONS ///.
typedefABC_NAMESPACE_HEADER_START struct Vec_Vec_t_ Vec_Vec_t
INCLUDES ///.
ABC_DLL void Nwk_ObjTransferFanout(Nwk_Obj_t *pNodeFrom, Nwk_Obj_t *pNodeTo)
static int Nwk_ManTimeLess(float f1, float f2, float Eps)
typedefABC_NAMESPACE_HEADER_START struct Nwk_Obj_t_ Nwk_Obj_t
INCLUDES ///.
static float Nwk_ObjSlack(Nwk_Obj_t *pObj)
ABC_DLL Vec_Ptr_t * Nwk_ManDfsReverse(Nwk_Man_t *pNtk)
int Tim_ManBoxForCo(Tim_Man_t *p, int iCi)
static void Nwk_ObjSetSlack(Nwk_Obj_t *pObj, float Time)
void Tim_ManSetCoArrival(Tim_Man_t *p, int iCo, float Delay)
float Nwk_NodePropagateRequired(Nwk_Obj_t *pObj, int fUseSorting)
#define Nwk_ObjForEachFanout(pObj, pFanout, i)
float pLutDelays[IF_MAX_LUTSIZE+1][IF_MAX_LUTSIZE+1]
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
#define ABC_ALLOC(type, num)
void Tim_ManSetCurrentTravIdBoxInputs(Tim_Man_t *p, int iBox)
int Tim_ManBoxOutputNum(Tim_Man_t *p, int iBox)
void Nwk_ManUpdateLevel(Nwk_Obj_t *pObj)
float Nwk_NodeComputeArrival(Nwk_Obj_t *pObj, int fUseSorting)
static int Abc_MaxInt(int a, int b)
static int Vec_PtrSize(Vec_Ptr_t *p)
void Tim_ManSetPreviousTravIdBoxOutputs(Tim_Man_t *p, int iBox)
ABC_DLL int Nwk_ManLevelMax(Nwk_Man_t *pNtk)
static int Nwk_ObjFaninNum(Nwk_Obj_t *p)
ABC_DLL int Nwk_ObjFindFanin(Nwk_Obj_t *pObj, Nwk_Obj_t *pFanin)
void Tim_ManSetPreviousTravIdBoxInputs(Tim_Man_t *p, int iBox)
void Tim_ManSetCiRequired(Tim_Man_t *p, int iCi, float Delay)
ABC_NAMESPACE_IMPL_START void Nwk_ManCleanTiming(Nwk_Man_t *pNtk)
DECLARATIONS ///.
static float Nwk_ObjArrival(Nwk_Obj_t *pObj)
int Tim_ManIsCoTravIdCurrent(Tim_Man_t *p, int iCo)
ABC_DLL Vec_Ptr_t * Nwk_ManDfs(Nwk_Man_t *pNtk)
void Nwk_ManDelayTracePrint(Nwk_Man_t *pNtk)
static int Nwk_ObjIsCo(Nwk_Obj_t *p)
static int Nwk_ObjIsLatch(Nwk_Obj_t *p)
void Nwk_ManDelayTraceSortPins(Nwk_Obj_t *pNode, int *pPinPerm, float *pPinDelays)
#define ABC_NAMESPACE_IMPL_END
int Nwk_ManVerifyLevel(Nwk_Man_t *pNtk)
#define Nwk_ManForEachPo(p, pObj, i)
int Tim_ManBoxInputNum(Tim_Man_t *p, int iBox)
static int Nwk_ObjIsNode(Nwk_Obj_t *p)
ABC_DLL int Nwk_ManGetFaninMax(Nwk_Man_t *pNtk)
#define ABC_NAMESPACE_IMPL_START
static void Nwk_ObjSetArrival(Nwk_Obj_t *pObj, float Time)
static void Nwk_ObjSetLevel(Nwk_Obj_t *pObj, int Level)
static int Nwk_ManTimeEqual(float f1, float f2, float Eps)
static Nwk_Obj_t * Nwk_ObjFanin(Nwk_Obj_t *p, int i)
#define Nwk_ObjForEachFanin(pObj, pFanin, i)
void Nwk_NodeUpdateArrival(Nwk_Obj_t *pObj)
#define TIM_ETERNITY
MACRO DEFINITIONS ///.
void Nwk_ManUpdate(Nwk_Obj_t *pObj, Nwk_Obj_t *pObjNew, Vec_Vec_t *vLevels)
void Nwk_NodeUpdateAddToQueue(Vec_Ptr_t *vQueue, Nwk_Obj_t *pObj, int iCurrent, int fArrival)
#define Nwk_ManForEachObj(p, pObj, i)
void Nwk_NodeUpdateRequired(Nwk_Obj_t *pObj)
static int Nwk_ManNodeNum(Nwk_Man_t *p)
static Nwk_Obj_t * Nwk_ObjFanin0(Nwk_Obj_t *p)
static int Nwk_ObjLevel(Nwk_Obj_t *pObj)
float Tim_ManGetCoRequired(Tim_Man_t *p, int iCo)
int Nwk_ManVerifyTiming(Nwk_Man_t *pNtk)
static void Vec_PtrClear(Vec_Ptr_t *p)
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
static float Nwk_ObjRequired(Nwk_Obj_t *pObj)
float Nwk_ManDelayTraceLut(Nwk_Man_t *pNtk)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
int Tim_ManBoxInputFirst(Tim_Man_t *p, int iBox)
float Tim_ManGetCiArrival(Tim_Man_t *p, int iCi)
static void Nwk_ObjSetRequired(Nwk_Obj_t *pObj, float Time)
int Nwk_ManWhereIsPin(Nwk_Obj_t *pFanout, Nwk_Obj_t *pFanin, int *pPinPerm)
void Tim_ManInitPoRequiredAll(Tim_Man_t *p, float Delay)
static void Vec_PtrFree(Vec_Ptr_t *p)
#define Nwk_ManForEachNode(p, pObj, i)