95 int i, iFanin, Count = 0;
99 if ( iFanin == iFaninSkip2 || iFanin == iFaninSkip3 )
106 if ( iFaninSkip2 >= 0 )
110 if ( iFanin == iFaninSkip3 )
118 if ( iFaninSkip3 >= 0 )
122 if ( iFanin == iFaninSkip2 )
149 if ( iFanin != iFaninSkip2 && iFanin != iFaninSkip3 && DelayMax <
Iff_ObjTimeId(p, iFanin) )
152 if ( iFaninSkip2 == -1 )
155 if ( iFanin != iFaninSkip3 && DelayMax <
Iff_ObjTimeId(p, iFanin) )
157 if ( iFaninSkip3 == -1 )
160 if ( iFanin != iFaninSkip2 && DelayMax <
Iff_ObjTimeId(p, iFanin) )
167 int i, iFanin, nSize;
176 assert( nSize <= p->pLib->LutMax );
177 This += p->pLib->pLutDelays[nSize][0];
178 if ( DelayMin > This )
188 int i, k, iFanin, iFanin2, nSize;
195 if ( iFanin == iFanin2 )
203 assert( nSize <= p->pLib->LutMax );
204 This += p->pLib->pLutDelays[nSize][0];
205 if ( DelayMin > This )
230 int iObj, iFanin, iFanin1, iFanin2;
231 int CountAll = 0, Count2 = 0, Count3 = 0;
232 float arrTime1, arrTime2, arrTime3, arrMax = -
ABC_INFINITY;
233 assert( nDegree == 2 || nDegree == 3 );
238 p->nLutSize = nLutSize;
239 p->nDegree = nDegree;
259 if ( arrTime2 < arrTime1 )
262 else if ( nDegree == 3 )
268 if ( arrTime3 == arrTime1 )
270 if ( arrTime3 == arrTime2 )
274 assert( arrTime3 < arrTime2 );
295 printf(
"Max delay = %.2f. Count1 = %d. Count2 = %d. Count3 = %d.\n",
296 arrMax, CountAll - Count2 - Count3, Count2, Count3 );
313 int i, iFanin, iFaninSkip2, iFaninSkip3;
320 if ( iFaninSkip2 == -1 )
322 assert( iFaninSkip3 == -1 );
328 else if ( iFaninSkip3 == -1 )
330 assert( iFaninSkip2 > 0 );
332 if ( iFanin != iFaninSkip2 )
342 assert( iFaninSkip2 > 0 && iFaninSkip3 > 0 );
344 if ( iFanin != iFaninSkip2 && iFanin != iFaninSkip3 )
347 if ( iFanin != iFaninSkip3 )
350 if ( iFanin != iFaninSkip2 )
398 else if ( pLib->
LutMax == 10 )
401 { printf(
"LUT library for packing 4-LUTs should have 7 or 10 inputs.\n" );
return; }
403 else if ( nLutSize <= 6 )
408 else if ( pLib->
LutMax == 16 )
411 { printf(
"LUT library for packing 6-LUTs should have 11 or 16 inputs.\n" );
return; }
415 printf(
"The LUT size is more than 6.\n" );
419 printf(
"Performing %d-clustering with %d-LUTs:\n", nDegree, nLutSize );
float Gia_IffObjTimeTwo(Iff_Man_t *p, int iObj, int *piFanin, float DelayMin)
static int Iff_ObjMatchId(Iff_Man_t *p, int iObj, int Type)
static void Iff_ObjSetTimeId(Iff_Man_t *p, int iObj, float Time)
void Gia_ManIffStop(Iff_Man_t *p)
static void Vec_FltWriteEntry(Vec_Flt_t *p, int i, float Entry)
void Tim_ManIncrementTravId(Tim_Man_t *p)
DECLARATIONS ///.
#define Gia_ManForEachCo(p, pObj, i)
float Gia_IffObjTimeThree(Iff_Man_t *p, int iObj, int *piFanin, int *piFanin2, float DelayMin)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
static void Vec_FltFree(Vec_Flt_t *p)
void Tim_ManSetCoArrival(Tim_Man_t *p, int iCo, float Delay)
int Gia_IffObjCount(Gia_Man_t *pGia, int iObj, int iFaninSkip2, int iFaninSkip3)
static void Iff_ObjSetTime(Iff_Man_t *p, Gia_Obj_t *pObj, float Time)
static float Iff_ObjTimeId(Iff_Man_t *p, int iObj)
static Vec_Int_t * Vec_IntStartFull(int nSize)
static Gia_Obj_t * Gia_ManObj(Gia_Man_t *p, int v)
static float Abc_MaxFloat(float a, float b)
static float Iff_ObjTime(Iff_Man_t *p, Gia_Obj_t *pObj)
#define Gia_ManForEachCi(p, pObj, i)
static void Vec_IntWriteEntry(Vec_Int_t *p, int i, int Entry)
static Vec_Int_t * Vec_IntAlloc(int nCap)
FUNCTION DEFINITIONS ///.
static int Gia_ObjLutSize(Gia_Man_t *p, int Id)
static void Vec_IntAddToEntry(Vec_Int_t *p, int i, int Addition)
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
void Gia_ManPrintPackingStats(Gia_Man_t *p)
static void Vec_IntPush(Vec_Int_t *p, int Entry)
Iff_Man_t * Gia_ManIffStart(Gia_Man_t *pGia)
FUNCTION DEFINITIONS ///.
Tim_Man_t * Tim_ManStart(int nCis, int nCos)
DECLARATIONS ///.
static int Gia_ObjId(Gia_Man_t *p, Gia_Obj_t *pObj)
int Gia_ManLutSizeMax(Gia_Man_t *p)
static void Vec_IntFreeP(Vec_Int_t **p)
void Gia_ManIffTest(Gia_Man_t *pGia, If_LibLut_t *pLib, int fVerbose)
void Tim_ManStopP(Tim_Man_t **p)
static int Gia_ObjIsTravIdCurrentId(Gia_Man_t *p, int Id)
static int Gia_ObjIsCo(Gia_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_START
void Gia_ManIffSelect_rec(Iff_Man_t *p, int iObj, Vec_Int_t *vPacking)
static int Iff_ObjMatch(Iff_Man_t *p, Gia_Obj_t *pObj, int Type)
static Vec_Flt_t * Vec_FltStartFull(int nSize)
static int Gia_ManCiNum(Gia_Man_t *p)
static int Gia_ObjIsAnd(Gia_Obj_t *pObj)
#define ABC_CALLOC(type, num)
static int Gia_ObjFaninId0p(Gia_Man_t *p, Gia_Obj_t *pObj)
typedefABC_NAMESPACE_HEADER_START struct Vec_Flt_t_ Vec_Flt_t
INCLUDES ///.
#define ABC_INFINITY
MACRO DEFINITIONS ///.
static void Iff_ObjSetMatch(Iff_Man_t *p, Gia_Obj_t *pObj, int Type, int Match)
typedefABC_NAMESPACE_HEADER_START struct Tim_Man_t_ Tim_Man_t
INCLUDES ///.
static float Vec_FltEntry(Vec_Flt_t *p, int i)
static int Gia_ObjIsLut(Gia_Man_t *p, int Id)
#define Gia_ManForEachObj1(p, pObj, i)
void Gia_ManIncrementTravId(Gia_Man_t *p)
Iff_Man_t * Gia_ManIffPerform(Gia_Man_t *pGia, If_LibLut_t *pLib, Tim_Man_t *pTime, int nLutSize, int nDegree)
typedefABC_NAMESPACE_IMPL_START struct Iff_Man_t_ Iff_Man_t
DECLARATIONS ///.
static void Vec_IntFree(Vec_Int_t *p)
static int Gia_ObjIsCi(Gia_Obj_t *pObj)
static void Gia_ObjSetTravIdCurrentId(Gia_Man_t *p, int Id)
float Tim_ManGetCiArrival(Tim_Man_t *p, int iCi)
#define Gia_LutForEachFanin(p, i, iFan, k)
Vec_Int_t * Gia_ManIffSelect(Iff_Man_t *p)
static int Gia_ObjCioId(Gia_Obj_t *pObj)
static int Gia_ManObjNum(Gia_Man_t *p)
static int Gia_ManCoNum(Gia_Man_t *p)
float Gia_IffObjTimeOne(Iff_Man_t *p, int iObj, int iFaninSkip2, int iFaninSkip3)
static void Iff_ObjSetMatchId(Iff_Man_t *p, int iObj, int Type, int Match)