⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cuddaddapply.c

📁 主要进行大规模的电路综合
💻 C
📖 第 1 页 / 共 2 页
字号:
    }    return(NULL);} /* end of Cudd_addOneZeroMaximum *//**Function********************************************************************  Synopsis    [Returns plusinfinity if f=g; returns min(f,g) if f!=g.]  Description [Returns NULL if not a terminal case; f op g otherwise,  where f op g is plusinfinity if f=g; min(f,g) if f!=g.]  SideEffects [None]  SeeAlso     [Cudd_addApply]******************************************************************************/DdNode *Cudd_addDiff(  DdManager * dd,  DdNode ** f,  DdNode ** g){    DdNode *F, *G;    F = *f; G = *g;    if (F == G) return(DD_PLUS_INFINITY(dd));    if (F == DD_PLUS_INFINITY(dd)) return(G);    if (G == DD_PLUS_INFINITY(dd)) return(F);    if (cuddIsConstant(F) && cuddIsConstant(G)) {	if (cuddV(F) != cuddV(G)) {            if (cuddV(F) < cuddV(G)) {                return(F);            } else {                return(G);            }	} else {	    return(DD_PLUS_INFINITY(dd));	}    }    return(NULL);} /* end of Cudd_addDiff *//**Function********************************************************************  Synopsis    [f if f==g; background if f!=g.]  Description [Returns NULL if not a terminal case; f op g otherwise,  where f op g is f if f==g; background if f!=g.]  SideEffects [None]  SeeAlso     [Cudd_addApply]******************************************************************************/DdNode *Cudd_addAgreement(  DdManager * dd,  DdNode ** f,  DdNode ** g){    DdNode *F, *G;    F = *f; G = *g;    if (F == G) return(F);    if (F == dd->background) return(F);    if (G == dd->background) return(G);    if (cuddIsConstant(F) && cuddIsConstant(G)) return(dd->background);    return(NULL);} /* end of Cudd_addAgreement *//**Function********************************************************************  Synopsis    [Disjunction of two 0-1 ADDs.]  Description [Disjunction of two 0-1 ADDs. Returns NULL  if not a terminal case; f OR g otherwise.]  SideEffects [None]  SeeAlso     [Cudd_addApply]******************************************************************************/DdNode *Cudd_addOr(  DdManager * dd,  DdNode ** f,  DdNode ** g){    DdNode *F, *G;    F = *f; G = *g;    if (F == DD_ONE(dd) || G == DD_ONE(dd)) return(DD_ONE(dd));    if (cuddIsConstant(F)) return(G);    if (cuddIsConstant(G)) return(F);    if (F == G) return(F);    if (F > G) { /* swap f and g */	*f = G;	*g = F;    }    return(NULL);} /* end of Cudd_addOr *//**Function********************************************************************  Synopsis    [NAND of two 0-1 ADDs.]  Description [NAND of two 0-1 ADDs. Returns NULL  if not a terminal case; f NAND g otherwise.]  SideEffects [None]  SeeAlso     [Cudd_addApply]******************************************************************************/DdNode *Cudd_addNand(  DdManager * dd,  DdNode ** f,  DdNode ** g){    DdNode *F, *G;    F = *f; G = *g;    if (F == DD_ZERO(dd) || G == DD_ZERO(dd)) return(DD_ONE(dd));    if (cuddIsConstant(F) && cuddIsConstant(G)) return(DD_ZERO(dd));    if (F > G) { /* swap f and g */	*f = G;	*g = F;    }    return(NULL);} /* end of Cudd_addNand *//**Function********************************************************************  Synopsis    [NOR of two 0-1 ADDs.]  Description [NOR of two 0-1 ADDs. Returns NULL  if not a terminal case; f NOR g otherwise.]  SideEffects [None]  SeeAlso     [Cudd_addApply]******************************************************************************/DdNode *Cudd_addNor(  DdManager * dd,  DdNode ** f,  DdNode ** g){    DdNode *F, *G;    F = *f; G = *g;    if (F == DD_ONE(dd) || G == DD_ONE(dd)) return(DD_ZERO(dd));    if (cuddIsConstant(F) && cuddIsConstant(G)) return(DD_ONE(dd));    if (F > G) { /* swap f and g */	*f = G;	*g = F;    }    return(NULL);} /* end of Cudd_addNor *//**Function********************************************************************  Synopsis    [XOR of two 0-1 ADDs.]  Description [XOR of two 0-1 ADDs. Returns NULL  if not a terminal case; f XOR g otherwise.]  SideEffects [None]  SeeAlso     [Cudd_addApply]******************************************************************************/DdNode *Cudd_addXor(  DdManager * dd,  DdNode ** f,  DdNode ** g){    DdNode *F, *G;    F = *f; G = *g;    if (F == G) return(DD_ZERO(dd));    if (F == DD_ONE(dd) && G == DD_ZERO(dd)) return(DD_ONE(dd));    if (G == DD_ONE(dd) && F == DD_ZERO(dd)) return(DD_ONE(dd));    if (cuddIsConstant(F) && cuddIsConstant(G)) return(DD_ZERO(dd));    if (F > G) { /* swap f and g */	*f = G;	*g = F;    }    return(NULL);} /* end of Cudd_addXor *//**Function********************************************************************  Synopsis    [XNOR of two 0-1 ADDs.]  Description [XNOR of two 0-1 ADDs. Returns NULL  if not a terminal case; f XNOR g otherwise.]  SideEffects [None]  SeeAlso     [Cudd_addApply]******************************************************************************/DdNode *Cudd_addXnor(  DdManager * dd,  DdNode ** f,  DdNode ** g){    DdNode *F, *G;    F = *f; G = *g;    if (F == G) return(DD_ONE(dd));    if (F == DD_ONE(dd) && G == DD_ONE(dd)) return(DD_ONE(dd));    if (G == DD_ZERO(dd) && F == DD_ZERO(dd)) return(DD_ONE(dd));    if (cuddIsConstant(F) && cuddIsConstant(G)) return(DD_ZERO(dd));    if (F > G) { /* swap f and g */	*f = G;	*g = F;    }    return(NULL);} /* end of Cudd_addXnor *//**Function********************************************************************  Synopsis    [Applies op to the discriminants of f.]  Description [Applies op to the discriminants of f.  Returns a pointer to the result if succssful; NULL otherwise.]  SideEffects [None]  SeeAlso     [Cudd_addApply Cudd_addLog]******************************************************************************/DdNode *Cudd_addMonadicApply(  DdManager * dd,  DdNode * (*op)(DdManager *, DdNode *),  DdNode * f){    DdNode *res;    do {	dd->reordered = 0;	res = cuddAddMonadicApplyRecur(dd,op,f);    } while (dd->reordered == 1);    return(res);} /* end of Cudd_addMonadicApply *//**Function********************************************************************  Synopsis    [Natural logarithm of an ADD.]  Description [Natural logarithm of an ADDs. Returns NULL  if not a terminal case; log(f) otherwise.  The discriminants of f must  be positive double's.]  SideEffects [None]  SeeAlso     [Cudd_addMonadicApply]******************************************************************************/DdNode *Cudd_addLog(  DdManager * dd,  DdNode * f){    if (cuddIsConstant(f)) {	CUDD_VALUE_TYPE value = log(cuddV(f));	DdNode *res = cuddUniqueConst(dd,value);	return(res);    }    return(NULL);} /* end of Cudd_addLog *//*---------------------------------------------------------------------------*//* Definition of internal functions                                          *//*---------------------------------------------------------------------------*//**Function********************************************************************  Synopsis    [Performs the recursive step of Cudd_addApply.]  Description [Performs the recursive step of Cudd_addApply. Returns a  pointer to the result if successful; NULL otherwise.]  SideEffects [None]  SeeAlso     [cuddAddMonadicApplyRecur]******************************************************************************/DdNode *cuddAddApplyRecur(  DdManager * dd,  DdNode * (*op)(DdManager *, DdNode **, DdNode **),  DdNode * f,  DdNode * g){    DdNode *res,	   *fv, *fvn, *gv, *gvn,	   *T, *E;    unsigned int ford, gord;    unsigned int index;    DdNode *(*cacheOp)(DdManager *, DdNode *, DdNode *);    /* Check terminal cases. Op may swap f and g to increase the     * cache hit rate.     */    statLine(dd);    res = (*op)(dd,&f,&g);    if (res != NULL) return(res);    /* Check cache. */    cacheOp = (DdNode *(*)(DdManager *, DdNode *, DdNode *)) op;    res = cuddCacheLookup2(dd,cacheOp,f,g);    if (res != NULL) return(res);    /* Recursive step. */    ford = cuddI(dd,f->index);    gord = cuddI(dd,g->index);    if (ford <= gord) {	index = f->index;	fv = cuddT(f);	fvn = cuddE(f);    } else {	index = g->index;	fv = fvn = f;    }    if (gord <= ford) {	gv = cuddT(g);	gvn = cuddE(g);    } else {	gv = gvn = g;    }    T = cuddAddApplyRecur(dd,op,fv,gv);    if (T == NULL) return(NULL);    cuddRef(T);    E = cuddAddApplyRecur(dd,op,fvn,gvn);    if (E == NULL) {	Cudd_RecursiveDeref(dd,T);	return(NULL);    }    cuddRef(E);    res = (T == E) ? T : cuddUniqueInter(dd,(int)index,T,E);    if (res == NULL) {	Cudd_RecursiveDeref(dd, T);	Cudd_RecursiveDeref(dd, E);	return(NULL);    }    cuddDeref(T);    cuddDeref(E);    /* Store result. */    cuddCacheInsert2(dd,cacheOp,f,g,res);    return(res);} /* end of cuddAddApplyRecur *//**Function********************************************************************  Synopsis    [Performs the recursive step of Cudd_addMonadicApply.]  Description [Performs the recursive step of Cudd_addMonadicApply. Returns a  pointer to the result if successful; NULL otherwise.]  SideEffects [None]  SeeAlso     [cuddAddApplyRecur]******************************************************************************/DdNode *cuddAddMonadicApplyRecur(  DdManager * dd,  DdNode * (*op)(DdManager *, DdNode *),  DdNode * f){    DdNode *res, *ft, *fe, *T, *E;    unsigned int ford;    unsigned int index;    /* Check terminal cases. */    statLine(dd);    res = (*op)(dd,f);    if (res != NULL) return(res);    /* Check cache. */    res = cuddCacheLookup1(dd,op,f);    if (res != NULL) return(res);    /* Recursive step. */    ford = cuddI(dd,f->index);    index = f->index;    ft = cuddT(f);    fe = cuddE(f);    T = cuddAddMonadicApplyRecur(dd,op,ft);    if (T == NULL) return(NULL);    cuddRef(T);    E = cuddAddMonadicApplyRecur(dd,op,fe);    if (E == NULL) {	Cudd_RecursiveDeref(dd,T);	return(NULL);    }    cuddRef(E);    res = (T == E) ? T : cuddUniqueInter(dd,(int)index,T,E);    if (res == NULL) {	Cudd_RecursiveDeref(dd, T);	Cudd_RecursiveDeref(dd, E);	return(NULL);    }    cuddDeref(T);    cuddDeref(E);    /* Store result. */    cuddCacheInsert1(dd,op,f,res);    return(res);} /* end of cuddAddMonadicApplyRecur *//*---------------------------------------------------------------------------*//* Definition of static functions                                            *//*---------------------------------------------------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -