19 #ifndef ABC__aig__kit__cloud_h
20 #define ABC__aig__kit__cloud_h
35 #define inline __inline // compatible with MS VS 6.0
167 #define CLOUD_NODE_BITS 23
169 #define CLOUD_CONST_INDEX ((unsigned)0x0fffffff)
170 #define CLOUD_MARK_ON ((unsigned)0x10000000)
171 #define CLOUD_MARK_OFF ((unsigned)0xefffffff)
174 #define cloudHashBuddy2(x,y,s) ((((x)+(y))*((x)+(y)+1)/2) & ((1<<(32-(s)))-1))
175 #define cloudHashBuddy3(x,y,z,s) (cloudHashBuddy2((cloudHashBuddy2((x),(y),(s))),(z),(s)) & ((1<<(32-(s)))-1))
177 #define DD_P1 12582917
178 #define DD_P2 4256249
180 #define DD_P4 1618033999
181 #define cloudHashCudd2(f,g,s) ((((unsigned)(ABC_PTRUINT_T)(f) * DD_P1 + (unsigned)(ABC_PTRUINT_T)(g)) * DD_P2) >> (s))
182 #define cloudHashCudd3(f,g,h,s) (((((unsigned)(ABC_PTRUINT_T)(f) * DD_P1 + (unsigned)(ABC_PTRUINT_T)(g)) * DD_P2 + (unsigned)(ABC_PTRUINT_T)(h)) * DD_P3) >> (s))
185 #define Cloud_Regular(p) ((CloudNode*)(((ABC_PTRUINT_T)(p)) & ~01)) // get the regular node (w/o bubble)
186 #define Cloud_Not(p) ((CloudNode*)(((ABC_PTRUINT_T)(p)) ^ 01)) // complement the node
187 #define Cloud_NotCond(p,c) ((CloudNode*)(((ABC_PTRUINT_T)(p)) ^ (c))) // complement the node conditionally
188 #define Cloud_IsComplement(p) ((int)(((ABC_PTRUINT_T)(p)) & 01)) // check if complemented
190 #define Cloud_IsConstant(p) (((Cloud_Regular(p))->v & CLOUD_MARK_OFF) == CLOUD_CONST_INDEX)
191 #define cloudIsConstant(p) (((p)->v & CLOUD_MARK_OFF) == CLOUD_CONST_INDEX)
194 #define Cloud_V(p) ((Cloud_Regular(p))->v)
195 #define Cloud_E(p) ((Cloud_Regular(p))->e)
196 #define Cloud_T(p) ((Cloud_Regular(p))->t)
198 #define cloudV(p) ((p)->v)
199 #define cloudE(p) ((p)->e)
200 #define cloudT(p) ((p)->t)
202 #define cloudNodeMark(p) ((p)->v |= CLOUD_MARK_ON)
203 #define cloudNodeUnmark(p) ((p)->v &= CLOUD_MARK_OFF)
204 #define cloudNodeIsMarked(p) ((int)((p)->v & CLOUD_MARK_ON))
207 #define cloudCacheLookup1(p,sign,f) (((p)->s == (sign) && (p)->a == (f))? ((p)->r): (0))
208 #define cloudCacheLookup2(p,sign,f,g) (((p)->s == (sign) && (p)->a == (f) && (p)->b == (g))? ((p)->r): (0))
209 #define cloudCacheLookup3(p,sign,f,g,h) (((p)->s == (sign) && (p)->a == (f) && (p)->b == (g) && (p)->c == (h))? ((p)->r): (0))
211 #define cloudCacheInsert1(p,sign,f,r) (((p)->s = (sign)), ((p)->a = (f)), ((p)->r = (r)))
212 #define cloudCacheInsert2(p,sign,f,g,r) (((p)->s = (sign)), ((p)->a = (f)), ((p)->b = (g)), ((p)->r = (r)))
213 #define cloudCacheInsert3(p,sign,f,g,h,r) (((p)->s = (sign)), ((p)->a = (f)), ((p)->b = (g)), ((p)->c = (h)), ((p)->r = (r)))
216 #define CLOUD_ASSERT(p) assert((p) >= dd->tUnique && (p) < dd->tUnique+dd->nNodesAlloc)
typedefABC_NAMESPACE_HEADER_START struct cloudManager CloudManager
CloudNode * Cloud_Support(CloudManager *dd, CloudNode *n)
CloudNode * Cloud_bddAnd(CloudManager *dd, CloudNode *f, CloudNode *g)
void Cloud_bddPrint(CloudManager *dd, CloudNode *Func)
CloudCacheEntry2 * tCaches[20]
CloudManager * Cloud_Init(int nVars, int nBits)
FUNCTION DECLARATIONS ///.
void Cloud_PrintHashTable(CloudManager *dd)
int Cloud_DagSize(CloudManager *dd, CloudNode *n)
int Cloud_SupportSize(CloudManager *dd, CloudNode *n)
void Cloud_bddPrintCube(CloudManager *dd, CloudNode *Cube)
void Cloud_Restart(CloudManager *dd)
#define ABC_NAMESPACE_HEADER_START
NAMESPACES ///.
void Cloud_Quit(CloudManager *dd)
#define ABC_NAMESPACE_HEADER_END
int Cloud_DagCollect(CloudManager *dd, CloudNode *n)
void Cloud_CacheAllocate(CloudManager *dd, CloudOper oper, int size)
CloudNode * Cloud_MakeNode(CloudManager *dd, CloudVar v, CloudNode *t, CloudNode *e)
CloudNode * Cloud_bddOr(CloudManager *dd, CloudNode *f, CloudNode *g)
void Cloud_PrintInfo(CloudManager *dd)
CloudNode * Cloud_GetOneCube(CloudManager *dd, CloudNode *n)
int Cloud_SharingSize(CloudManager *dd, CloudNode **pn, int nn)