30 #define IVY_EVAL_LIMIT 128
64 int nEvals, nEvalsOld, i, k, x, nLeaves;
78 uMaskAll = ((1 << nLeaves) - 1);
82 pEval = pEvals + nEvals;
84 pEval->
Mask = (1 << nEvals);
113 pEval = pEvals + nEvals;
124 for ( i = 1; i < nEvals; i++ )
125 for ( k = 0; k < i; k++ )
131 if ( pTemp == NULL || pTemp->
fMarkB )
134 for ( x = 0; x < nLeaves; x++ )
139 pEval = pEvals + nEvals;
150 if ( pEval->
Mask == uMaskAll )
156 if ( !
Ivy_MultiCover( p, pEvals, nLeaves, nEvals, nLimit, vSols ) )
177 for ( i = nLeaves; i < nEvals; i++ )
180 printf(
"%2d (id = %5d) : |", i-nLeaves,
Ivy_ObjId(pEval->
pArg) );
181 for ( k = 0; k < nLeaves; k++ )
183 if ( pEval->
Mask & (1 << k) )
205 assert( uMask & ~uFound );
206 if ( (uMask & uFound) == 0 )
227 unsigned uMaskAll, uFound, uTemp;
233 uMaskAll = (nLeaves == 32)? (~(
unsigned)0) : ((1 << nLeaves) - 1);
237 printf(
"Solution: " );
239 for ( i = 0; i < nLimit; i++ )
242 for ( k = nEvals - 1; k >= 0; k-- )
245 if ( (pEval->
Mask & ~uFound) == 0 )
258 if ( WeightBest < WeightCur ||
259 (WeightBest == WeightCur && LevelBest > LevelCur) )
263 WeightBest = WeightCur;
264 LevelBest = LevelCur;
269 if ( WeightBest == 1 && BestK >= nLeaves )
271 uTemp = (pEvalBest->
Mask & ~uFound);
272 for ( k = 0; k < nLeaves; k++ )
273 if ( uTemp & (1 << k) )
277 pEvalBest = pEvals + BestK;
281 if ( BestK < nLeaves )
282 printf(
"L(%d) ", BestK );
284 printf(
"%d ", BestK - nLeaves );
288 uFound |= pEvalBest->
Mask;
289 if ( uFound == uMaskAll )
292 if ( uFound == uMaskAll )
295 printf(
" Found \n\n" );
301 printf(
" Not found \n\n" );
static int Ivy_IsComplement(Ivy_Obj_t *p)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
static void Ivy_MultiPrint(Ivy_Man_t *p, Ivy_Eva_t *pEvals, int nLeaves, int nEvals)
static int Ivy_MultiCover(Ivy_Man_t *p, Ivy_Eva_t *pEvals, int nLeaves, int nEvals, int nLimit, Vec_Ptr_t *vSols)
static void Vec_PtrPush(Vec_Ptr_t *p, void *Entry)
static int Vec_PtrSize(Vec_Ptr_t *p)
static Ivy_Obj_t * Ivy_ObjFanin1(Ivy_Obj_t *pObj)
static int Ivy_ObjLevel(Ivy_Obj_t *pObj)
static Ivy_Obj_t * Ivy_ObjFanin0(Ivy_Obj_t *pObj)
Ivy_Obj_t * Ivy_TableLookup(Ivy_Man_t *p, Ivy_Obj_t *pObj)
FUNCTION DEFINITIONS ///.
static int Ivy_ObjRefs(Ivy_Obj_t *pObj)
#define ABC_NAMESPACE_IMPL_END
static Ivy_Obj_t * Ivy_Regular(Ivy_Obj_t *p)
typedefABC_NAMESPACE_HEADER_START struct Ivy_Man_t_ Ivy_Man_t
INCLUDES ///.
#define ABC_NAMESPACE_IMPL_START
#define IVY_EVAL_LIMIT
DECLARATIONS ///.
static Ivy_Obj_t * Ivy_ObjCreateGhost(Ivy_Man_t *p, Ivy_Obj_t *p0, Ivy_Obj_t *p1, Ivy_Type_t Type, Ivy_Init_t Init)
static int Ivy_ObjIsBuf(Ivy_Obj_t *pObj)
static void Vec_PtrClear(Vec_Ptr_t *p)
#define Vec_PtrForEachEntry(Type, vVec, pEntry, i)
MACRO DEFINITIONS ///.
int Ivy_MultiPlus(Ivy_Man_t *p, Vec_Ptr_t *vLeaves, Vec_Ptr_t *vCone, Ivy_Type_t Type, int nLimit, Vec_Ptr_t *vSols)
FUNCTION DEFINITIONS ///.
static int Ivy_MultiWeight(unsigned uMask, int nMaskOnes, unsigned uFound)
static int Ivy_ObjId(Ivy_Obj_t *pObj)