42 static inline int Abc_NodeComputeLag(
int LValue,
int Fi ) {
return (LValue + (1<<16)*Fi)/Fi - (1<<16) - (
int)(LValue % Fi == 0); }
75 fprintf( stdout,
"Abc_NtkRetimeLValue(): Network check has failed.\n" );
96 int i, FiMax, FiBest, RetValue;
110 printf(
"Abc_NtkRetimeGetLags() error: The upper bound on the clock period cannot be computed.\n" );
146 printf(
"The best clock period is %3d. (Currently, network is not modified.)\n", FiBest );
176 if ( FiMin + 1 == FiMax )
178 Median = FiMin + (FiMax - FiMin)/2;
199 int c, i, fConverged;
208 for ( c = 1; c <= nMaxIters; c++ )
222 printf(
"Period = %3d. Iterations = %3d. Infeasible %s\n", Fi, c, (c > nMaxIters)?
"(timeout)" :
"" );
224 printf(
"Period = %3d. Iterations = %3d. Feasible\n", Fi, c );
252 int i, k, lValueNew, fChange;
365 int fChanges, fForward, nTotalMoves, Lag,
Counter, i;
375 fForward = (Lag < 0);
384 }
while ( fChanges );
386 printf(
"Total latch moves = %d.\n", nTotalMoves );
392 printf(
"Warning! The number of nodes with unrealized lag = %d.\n", Counter );
static int Abc_NtkRetimeForPeriod(Abc_Ntk_t *pNtk, Vec_Ptr_t *vNodes, Vec_Ptr_t *vLatches, int Fi, int nMaxIters, int fVerbose)
void Abc_ManCollectLatches_rec(Abc_Obj_t *pObj, Vec_Ptr_t *vLatches)
static int Abc_NtkRetimeUsingLags(Abc_Ntk_t *pNtk, Vec_Int_t *vLags, int fVerbose)
static int Abc_NtkIsLogic(Abc_Ntk_t *pNtk)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static void Abc_NodeSetLValue(Abc_Obj_t *pNode, int Value)
static int Abc_NtkObjNumMax(Abc_Ntk_t *pNtk)
static int Abc_ObjIsBo(Abc_Obj_t *pObj)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static int Abc_NodeGetLValue(Abc_Obj_t *pNode)
static int Abc_ObjIsLatch(Abc_Obj_t *pObj)
static int Abc_ObjFaninNum(Abc_Obj_t *pObj)
static int Abc_NtkLatchNum(Abc_Ntk_t *pNtk)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
ABC_DLL int Abc_NtkCheck(Abc_Ntk_t *pNtk)
FUNCTION DEFINITIONS ///.
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
static abctime Abc_Clock()
static int Vec_PtrSize(Vec_Ptr_t *p)
static Abc_Obj_t * Abc_ObjFanin0(Abc_Obj_t *pObj)
static int Abc_NodeComputeLag(int LValue, int Fi)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static int Abc_ObjIsNode(Abc_Obj_t *pObj)
static Vec_Int_t * Vec_IntStart(int nSize)
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
void Abc_NtkRetimeNode(Abc_Obj_t *pObj, int fForward, int fInitial)
static int Vec_IntEntry(Vec_Int_t *p, int i)
#define ABC_NAMESPACE_IMPL_END
#define Abc_NtkForEachLatch(pNtk, pObj, i)
int Abc_NtkRetimeNodeIsEnabled(Abc_Obj_t *pObj, int fForward)
#define Abc_NtkForEachNode(pNtk, pNode, i)
#define ABC_NAMESPACE_IMPL_START
static int Abc_NtkRetimeSearch_rec(Abc_Ntk_t *pNtk, Vec_Ptr_t *vNodes, Vec_Ptr_t *vLatches, int FiMin, int FiMax, int nMaxIters, int fVerbose)
static int Abc_NodeIsTravIdCurrent(Abc_Obj_t *p)
static int Abc_NtkRetimeUpdateLValue(Abc_Ntk_t *pNtk, Vec_Ptr_t *vNodes, Vec_Ptr_t *vLatches, int Fi)
static Vec_Ptr_t * Vec_PtrAlloc(int nCap)
FUNCTION DEFINITIONS ///.
#define Abc_ObjForEachFanin(pObj, pFanin, i)
static Vec_Int_t * Abc_NtkRetimeGetLags(Abc_Ntk_t *pNtk, int nIterLimit, int fVerbose)
static void Abc_NtkIncrementTravId(Abc_Ntk_t *p)
#define ABC_INFINITY
MACRO DEFINITIONS ///.
static Vec_Ptr_t * Abc_ManCollectLatches(Abc_Ntk_t *pNtk)
#define Abc_NtkForEachPo(pNtk, pPo, i)
static void Vec_IntFree(Vec_Int_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
#define Abc_NtkForEachObj(pNtk, pObj, i)
ITERATORS ///.
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
static int Abc_NtkRetimePosOverLimit(Abc_Ntk_t *pNtk, int Fi)
static Abc_Obj_t * Abc_ObjFanout0(Abc_Obj_t *pObj)
int Abc_NtkRetimeLValue(Abc_Ntk_t *pNtk, int nIterLimit, int fVerbose)
FUNCTION DEFINITIONS ///.
static void Abc_NodeSetTravIdCurrent(Abc_Obj_t *p)
static void Vec_PtrFree(Vec_Ptr_t *p)