61 static unsigned uVars[5] = { 0xAAAAAAAA, 0xCCCCCCCC, 0xF0F0F0F0, 0xFF00FF00, 0xFFFF0000 };
63 unsigned uCof0, uCof1;
71 if ( uTruth == uVars[0] )
72 return dd->vars[nVarsAll-1];
73 if ( uTruth == ~uVars[0] )
79 uCof0 = uTruth & ~uVars[nVars-1];
80 uCof1 = uTruth & uVars[nVars-1];
81 uCof0 |= uCof0 << (1<<(nVars-1));
82 uCof1 |= uCof1 >> (1<<(nVars-1));
85 if ( uCof0 == ~uCof1 )
112 unsigned * pTruth0, * pTruth1;
173 if ( nNodes >= (1<<12) )
176 assert( nNodes < dd->nNodesLimit );
179 dd->ppNodes[0]->s = 0;
180 for ( i = 1; i < nNodes; i++ )
182 dd->ppNodes[i]->s = i;
183 Mux.v = dd->ppNodes[i]->v;
184 Mux.t = dd->ppNodes[i]->t->s;
193 for ( i = 0; i < nNodes; i++ )
194 dd->ppNodes[i]->s = dd->nSignCur;
231 unsigned * pThis, * pFan0, * pFan1;
240 assert( (
int)Mux.e < i && (
int)Mux.t < i && (
int)Mux.v < nVars );
267 unsigned * pThis, * pFan0, * pFan1;
269 int i, Entry, RetValue;
276 printf(
"Kit_TruthCompose(): Internal failure!!!\n" );
291 Kit_TruthMuxPhase( pThis, pFan0, pFan1, pInputs[nVars-1-Mux.v], nVarsAll, Mux.c );
313 unsigned * puSuppAll;
314 unsigned * pThis = NULL;
315 unsigned * pFan0, * pFan1;
316 int i, v,
Var, Entry, nSupps;
324 memset( puSuppAll, 0,
sizeof(
unsigned) * nSupps );
329 Var = nVars - 1 - Mux.v;
330 pFan0 = puSuppAll + nSupps * Mux.e;
331 pFan1 = puSuppAll + nSupps * Mux.t;
332 pThis = puSuppAll + nSupps * i;
333 for ( v = 0; v < nSupps; v++ )
334 pThis[v] = pFan0[v] | pFan1[v] | (1<<Var);
335 assert( pFan0[2*Var + 0] == pFan0[2*Var + 1] );
336 assert( pFan1[2*Var + 0] == pFan1[2*Var + 1] );
337 pThis[2*Var + 0] = pFan0[2*Var + 0];
338 pThis[2*Var + 1] = pFan1[2*Var + 0];
341 memcpy( puSupps, pThis,
sizeof(
unsigned) * nSupps );
349 memset( puSuppAll, 0,
sizeof(
unsigned) * nSupps );
356 pFan0 = puSuppAll + nSupps * Mux.e;
357 pFan1 = puSuppAll + nSupps * Mux.t;
358 pThis = puSuppAll + nSupps * i;
359 for ( v = 0; v < nSupps; v++ )
360 pThis[v] = pFan0[v] | pFan1[v] | (1<<Var);
361 assert( pFan0[2*Var + 0] == pFan0[2*Var + 1] );
362 assert( pFan1[2*Var + 0] == pFan1[2*Var + 1] );
363 pThis[2*Var + 0] = pFan0[2*Var + 0];
364 pThis[2*Var + 1] = pFan1[2*Var + 0];
368 for ( Var = 0; Var < nSupps; Var++ )
static int * Vec_IntArray(Vec_Int_t *p)
int Kit_CreateCloud(CloudManager *dd, CloudNode *pFunc, Vec_Int_t *vNodes)
typedefABC_NAMESPACE_HEADER_START struct Vec_Ptr_t_ Vec_Ptr_t
INCLUDES ///.
int Kit_CreateCloudFromTruth(CloudManager *dd, unsigned *pTruth, int nVars, Vec_Int_t *vNodes)
static int Kit_TruthWordNum(int nVars)
typedefABC_NAMESPACE_HEADER_START struct cloudManager CloudManager
static void Kit_TruthFill(unsigned *pOut, int nVars)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
#define Cloud_IsComplement(p)
void Kit_TruthMuxVarPhase(unsigned *pOut, unsigned *pCof0, unsigned *pCof1, int nVars, int iVar, int fCompl0)
unsigned * Kit_TruthCompose(CloudManager *dd, unsigned *pTruth, int nVars, unsigned **pInputs, int nVarsAll, Vec_Ptr_t *vStore, Vec_Int_t *vNodes)
static int Kit_TruthIsEqual(unsigned *pIn0, unsigned *pIn1, int nVars)
static int Kit_TruthIsConst0(unsigned *pIn, int nVars)
static int Vec_PtrSize(Vec_Ptr_t *p)
void Cloud_Restart(CloudManager *dd)
typedefABC_NAMESPACE_IMPL_START struct Kit_Mux_t_ Kit_Mux_t
DECLARATIONS ///.
static void Vec_IntGrow(Vec_Int_t *p, int nCapMin)
static int Kit_TruthIsConst1(unsigned *pIn, int nVars)
#define ABC_NAMESPACE_IMPL_END
static void Vec_IntPush(Vec_Int_t *p, int Entry)
CloudNode * Cloud_MakeNode(CloudManager *dd, CloudVar v, CloudNode *t, CloudNode *e)
#define Vec_IntForEachEntryStart(vVec, Entry, i, Start)
static void Kit_TruthNot(unsigned *pOut, unsigned *pIn, int nVars)
CloudNode * Kit_TruthToCloud(CloudManager *dd, unsigned *pTruth, int nVars)
static void Kit_TruthMuxPhase(unsigned *pOut, unsigned *pIn0, unsigned *pIn1, unsigned *pCtrl, int nVars, int fComp0)
#define ABC_NAMESPACE_IMPL_START
static void * Vec_PtrEntry(Vec_Ptr_t *p, int i)
static int Vec_IntSize(Vec_Int_t *p)
CloudNode * Kit_TruthToCloud_rec(CloudManager *dd, unsigned *pTruth, int nVars, int nVarsAll)
unsigned * Kit_CloudToTruth(Vec_Int_t *vNodes, int nVars, Vec_Ptr_t *vStore, int fInv)
static int Kit_TruthIsOpposite(unsigned *pIn0, unsigned *pIn1, int nVars)
void Kit_TruthCofSupports(Vec_Int_t *vBddDir, Vec_Int_t *vBddInv, int nVars, Vec_Int_t *vMemory, unsigned *puSupps)
static int Kit_Mux2Int(Kit_Mux_t m)
static Kit_Mux_t Kit_Int2Mux(int m)
CloudNode * Kit_TruthToCloud5_rec(CloudManager *dd, unsigned uTruth, int nVars, int nVarsAll)
FUNCTION DEFINITIONS ///.
int Cloud_DagSize(CloudManager *dd, CloudNode *n)
static void Vec_IntClear(Vec_Int_t *p)
int Cloud_DagCollect(CloudManager *dd, CloudNode *n)
static unsigned Kit_BitMask(int nBits)