30#define IFIF_MAX_LEAVES 6
52static inline float Abc_IffDelay(
Abc_IffMan_t *
p,
Abc_Obj_t * pObj,
int fDelay1 ) {
return Abc_IffObj(
p, Abc_ObjId(pObj))->Delay[fDelay1]; }
76 p->nObjs = Abc_NtkObjNumMax( pNtk );
104 ppNodes[k++] = pFanin;
105 if ( Abc_ObjIsCi(pFanin) )
107 for ( a = k-1; a > 0; a-- )
108 if ( Abc_IffDelay(
p, ppNodes[a-1], fDelay1) +
p->pPars->pLutDelays[a-1] < Abc_IffDelay(
p, ppNodes[a], fDelay1) +
p->pPars->pLutDelays[a] )
140 for ( i = 0; i < Abc_ObjFaninNum(pObj); i++ )
141 Delay0 = Abc_MaxFloat( Delay0, Abc_IffDelay(
p, ppNodes[i], 1) +
p->pPars->pLutDelays[i] );
158 int i, fVeryVerbose = 0;
161 float Delay1, DelayNew;
163 if ( Abc_ObjFaninNum(pObj) == 0 )
172 printf(
"Object %d Level %d\n", Abc_ObjId(pObj), Abc_ObjLevel(pObj) );
173 for ( i = 0; i < Abc_ObjFaninNum(pObj); i++ )
175 printf(
"Fanin %d : ", i );
176 printf(
"D0 %3.2f ", Abc_IffDelay(
p, ppNodes[i], 0) );
177 printf(
"D0* %3.2f ", Abc_IffDelay(
p, ppNodes[i], 0) +
p->pPars->pLutDelays[i] -
p->pPars->DelayWire );
178 printf(
"D1 %3.2f", Abc_IffDelay(
p, ppNodes[i], 1) +
p->pPars->pLutDelays[i] );
202 for ( i = 0; i < Abc_ObjFaninNum(pObj); i++ )
204 if ( i < p->pPars->nDegree )
205 DelayNew = Abc_MinFloat( Abc_IffDelay(
p, ppNodes[i], 1) +
p->pPars->pLutDelays[i],
206 Abc_IffDelay(
p, ppNodes[i], 0) +
p->pPars->pLutDelays[i] -
p->pPars->DelayWire );
208 DelayNew = Abc_IffDelay(
p, ppNodes[i], 1) +
p->pPars->pLutDelays[i];
209 Delay1 = Abc_MaxFloat( Delay1, DelayNew );
230 float Delay0 = 0, DelayNew;
232 assert( d >= 0 && d <= p->pPars->nDegree );
234 for ( i = 0; i < Abc_ObjFaninNum(pObj); i++ )
236 DelayNew = Abc_IffDelay(
p, ppNodes[i],
p->pPars->nDegree) +
p->pPars->pLutDelays[i];
237 if ( i == 0 && d > 0 )
238 DelayNew = Abc_MinFloat(DelayNew, Abc_IffDelay(
p, ppNodes[i], d-1) +
p->pPars->pLutDelays[i] -
p->pPars->DelayWire );
239 Delay0 = Abc_MaxFloat( Delay0, DelayNew );
261 float Delay, Delay10, DegreeFinal;
273 printf(
"Running mapper into LUT structures with the following parameters:\n" );
274 printf(
"Pin+Wire: {" );
278 printf(
"Wire %3.2f Degree %d Type: %s\n",
290 assert( Abc_ObjIsNode(pObj) );
291 pIffObj = Abc_IffObj(
p, Abc_ObjId(pObj) );
295 for ( d = 0; d <= pPars->
nDegree; d++ )
311 if (
p->pPars->fVeryVerbose )
314 printf(
"Node %3d : Lev =%3d ", Abc_ObjId(pObj), Abc_ObjLevel(pObj) );
315 for ( d = 0; d <= DegreeFinal; d++ )
316 printf(
"Del%d =%4.2f ", d, Abc_IffDelay(
p, pObj, d) );
319 Vec_PtrFree( vNodes );
325 Delay = Abc_MaxFloat( Delay, Abc_IffDelay(
p, Abc_ObjFanin0(pObj), DegreeFinal) );
326 Delay10 = 0.9 * Delay;
331 if ( Abc_IffDelay(
p, Abc_ObjFanin0(pObj), DegreeFinal) >= Delay10 )
334 printf(
"Critical delay %5.2f. Critical outputs %5.2f %%\n", Delay, 100.0 * Count10 / Abc_NtkCoNum(pNtk) );
#define IFIF_MAX_LEAVES
DECLARATIONS ///.
Abc_IffMan_t * Abc_NtkIfifStart(Abc_Ntk_t *pNtk, Ifif_Par_t *pPars)
FUNCTION DEFINITIONS ///.
void Abc_NtkPerformIfif(Abc_Ntk_t *pNtk, Ifif_Par_t *pPars)
float Abc_ObjDelay0(Abc_IffMan_t *p, Abc_Obj_t *pObj)
float Abc_ObjDelay1(Abc_IffMan_t *p, Abc_Obj_t *pObj)
struct Abc_IffMan_t_ Abc_IffMan_t
struct Abc_IffObj_t_ Abc_IffObj_t
float Abc_ObjDelayDegree(Abc_IffMan_t *p, Abc_Obj_t *pObj, int d)
void Abc_ObjSortByDelay(Abc_IffMan_t *p, Abc_Obj_t *pObj, int fDelay1, Abc_Obj_t **ppNodes)
void Abc_NtkIfifStop(Abc_IffMan_t *p)
struct Abc_Obj_t_ Abc_Obj_t
#define Abc_NtkForEachCo(pNtk, pCo, i)
ABC_DLL Vec_Ptr_t * Abc_NtkDfs(Abc_Ntk_t *pNtk, int fCollectAll)
#define Abc_ObjForEachFanin(pObj, pFanin, i)
struct Abc_Ntk_t_ Abc_Ntk_t
ABC_DLL int Abc_NtkLevel(Abc_Ntk_t *pNtk)
ABC_DLL int Abc_NtkToAig(Abc_Ntk_t *pNtk)
#define ABC_SWAP(Type, a, b)
#define ABC_CALLOC(type, num)
#define ABC_NAMESPACE_IMPL_START
#define ABC_NAMESPACE_IMPL_END
struct Ifif_Par_t_ Ifif_Par_t
float Delay[IFIF_MAX_LEAVES+1]
float pLutDelays[IF_MAX_LUTSIZE]
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.