This commit is contained in:
parent
508bbcd89c
commit
d77074b341
|
@ -0,0 +1 @@
|
|||
SUBDIRS = src man1 man3
|
|
@ -0,0 +1,47 @@
|
|||
dnl
|
||||
/*
|
||||
dnl This file is part of the Alliance CAD System
|
||||
dnl Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
dnl Universite Pierre et Marie Curie
|
||||
dnl
|
||||
dnl Home page : http://www-asim.lip6.fr/alliance/
|
||||
dnl E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or modify it
|
||||
dnl under the terms of the GNU Library General Public License as published
|
||||
dnl by the Free Software Foundation; either version 2 of the License, or (at
|
||||
dnl your option) any later version.
|
||||
dnl
|
||||
dnl Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
dnl Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License along
|
||||
dnl with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
dnl Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
dnl
|
||||
dnl Purpose : Auto stuffing Alliance
|
||||
dnl Almost ten years since I wrote this stuff, I just can't
|
||||
dnl believe it
|
||||
dnl Date : 01/02/2002
|
||||
dnl Author : Frederic Petrot <Frederic.Petrot@lip6.fr>
|
||||
dnl $Id: configure.in,v 1.1 2002/04/03 13:13:25 ludo Exp $
|
||||
dnl
|
||||
dnl
|
||||
AC_INIT(src/log.h)
|
||||
AM_INIT_AUTOMAKE(log, 2.1)
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_CC
|
||||
AC_HEADER_STDC
|
||||
AC_C_CONST
|
||||
AC_PROG_RANLIB
|
||||
|
||||
AM_ALLIANCE
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
src/Makefile
|
||||
man1/Makefile
|
||||
man3/Makefile
|
||||
])
|
|
@ -0,0 +1 @@
|
|||
man_MANS = log.1
|
|
@ -0,0 +1,38 @@
|
|||
.\" $Id: log.1,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)log.l 0.0 92/08/01 UPMC; Author: Luc Burgun
|
||||
.pl -.4
|
||||
.TH LOG 1 "October 1, 1997" "ASIM/LIP6" "cao\-vlsi reference manual"
|
||||
.SH NAME
|
||||
\fBlog\fP \- logical representations for boolean functions and utilities.
|
||||
.so man1/alc_origin.1
|
||||
.SH DESCRIPTION
|
||||
\fBlog\fP is a set of structures and functions that permits to manipulate several representations of boolean functions. Several programs and libraries of the \fIcao-vlsi cad tools\fP rest on the \fIlog\fP package. Three different kind of functions are available for:
|
||||
.TP 20
|
||||
Hash table management
|
||||
.TP 20
|
||||
Prefixed representation for boolean functions
|
||||
.TP 20
|
||||
Ordered binary decision diagrams representation
|
||||
.SH EXAMPLE
|
||||
Let's suppose that actual mbk version is 'nnn'.
|
||||
In order to use log, \fIlibMutnnn.a\fP library must be called.
|
||||
.br
|
||||
\fImakefile\fP:
|
||||
.br
|
||||
HEADER = -I/labo/include
|
||||
.br
|
||||
LIB = -L/labo/lib -lMutnnn -ltshmmm -lablmmm -lbddmmm
|
||||
.br
|
||||
Each library can be called separatly. The "logmmm.h" header file must be inserted in the files that use the functions or the structures defined in a library.
|
||||
.br
|
||||
.SH SEE ALSO
|
||||
.BR mbk (1),
|
||||
.BR beh (1),
|
||||
.SH AUTHOR
|
||||
L. BURGUN salle 30 T. 55-65 Universite P&M Curie - 4 pl. Jussieu - FRANCE
|
||||
.br
|
||||
.SH THANKS
|
||||
Thanks to P. REMY, F. PETROT, P. ALLEGRE and N. DICTUS.
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
man_MANS = composeBdd.3 initializeBdd.3 resetBdd.3 \
|
||||
ablToBddCct.3 constraintBdd.3 markAllBdd.3 simplifDcOneBdd.3 \
|
||||
addListBdd.3 createNodeTermBdd.3 markBdd.3 simplifDcZeroBdd.3 \
|
||||
applyBdd.3 destroyBdd.3 notBdd.3 supportChain_listBdd.3 \
|
||||
applyBinBdd.3 displayBdd.3 numberNodeAllBdd.3 upVarBdd.3 \
|
||||
bddToAblCct.3 gcNodeBdd.3 numberNodeBdd.3
|
|
@ -0,0 +1,57 @@
|
|||
.\" $Id: ablToBddCct.3,v 1.1 2002/04/03 13:13:25 ludo Exp $
|
||||
.\" @(#)ablToBddCct.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH ABLTOBDDCCT 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBablToBddCct\fP \- converts an ABL into a BDD within a circuit
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
pNode ablToBddCct(pC,expr)
|
||||
pCircuit pC;
|
||||
chain_list *expr;
|
||||
.fi
|
||||
.SH PARAMETERS
|
||||
.TP 20
|
||||
\fIpC\fP
|
||||
Circuit in which is made the conversion
|
||||
.TP 20
|
||||
\fIexpr\fP
|
||||
expression to convert
|
||||
.SH DESCRIPTION
|
||||
\fBablToBddCct()\fP constructs the graph that is computed from \fIexpr\fP. This function provides the basic method for constructing easily the BDDs. The \fBapplyBdd()\fP function is called recursively by going through the ABL.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
chain_list *expr;
|
||||
pNode res;
|
||||
pCircuit pC;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
pC = initializeCct("circuit 1",10,10);
|
||||
|
||||
addInputCct(pC,"a");
|
||||
addInputCct(pC,"b");
|
||||
|
||||
/* let's suppose that expr = (OR (AND (NOT a) b) a) */
|
||||
|
||||
res = ablToBddCct(pC,expr);
|
||||
displayBdd(res,1);
|
||||
|
||||
/* it will display
|
||||
@res INDEX = 3 LOW = @nodeA HIGH = ONE
|
||||
@nodeA INDEX = 2 LOW = ZERO HIGH = ONE
|
||||
*/
|
||||
|
||||
destroyCct(pC);
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR abl (1),
|
||||
.BR bddToAblCct (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
.\" $Id: addListBdd.3,v 1.1 2002/04/03 13:13:25 ludo Exp $
|
||||
.\" @(#)addListBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH ADDLISTBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBaddListBdd\fP \- adds a BDD to a chained list of BDDs
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
chain_list *addListBdd(pt,pBdd)
|
||||
chain_list *pt;
|
||||
pNode pBdd;
|
||||
.fi
|
||||
.SH PARAMETERS
|
||||
.TP 20
|
||||
\fIpt\fP
|
||||
old \fIchain_list\fP pointer
|
||||
.TP 20
|
||||
\fIpBdd\fP
|
||||
BDD to add
|
||||
.SH DESCRIPTION
|
||||
\fBaddListBdd()\fP adds \fIpBdd\fP to \fIpt\fP. This function computes an optimal reordering on \fIpt\fP that minimizes the number of nodes when the \fBapplyBdd()\fP function is called.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA,nodeB,nodeC;
|
||||
pNode res;
|
||||
chain_list *pt;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
nodeB = createNodeTermBdd(3);
|
||||
nodeC = createNodeTermBdd(4);
|
||||
pt = NULL;
|
||||
pt = addListBdd(pt,nodeA);
|
||||
pt = addListBdd(pt,nodeB);
|
||||
pt = addListBdd(pt,nodeC);
|
||||
res = applyBdd(OR,pt);
|
||||
displayBdd(res,1);
|
||||
|
||||
/* it will display
|
||||
@res INDEX = 4 LOW = @inter HIGH = ONE
|
||||
@inter INDEX = 3 LOW = @nodeA HIGH = ONE
|
||||
@nodeA INDEX = 2 LOW = ZERO HIGH = ONE
|
||||
*/
|
||||
/* total number of nodes = 5 */
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR addListBdd (3),
|
||||
.BR addListBdd (3),
|
||||
.BR notBdd (3),
|
||||
.BR constraintBdd (3),
|
||||
.BR composeBdd (3),
|
||||
.BR displayBdd (3),
|
||||
.BR createNodeTermBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
.\" $Id: applyBdd.3,v 1.1 2002/04/03 13:13:25 ludo Exp $
|
||||
.\" @(#)applyBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH APPLYBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBapplyBdd\fP \- applies an operator to a list of BDD.
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
pNode applyBdd(oper,pt)
|
||||
short oper;
|
||||
chain_list *pt;
|
||||
.fi
|
||||
.SH PARAMETERS
|
||||
.TP 20
|
||||
\fIoper\fP
|
||||
operator number to apply (OR,AND,XOR,NAND,NOR,NXOR,NOT)
|
||||
.TP 20
|
||||
\fIpt\fP
|
||||
\fIchain_list\fP of BDD.
|
||||
.SH DESCRIPTION
|
||||
\fBapplyBdd()\fP applies \fIoper\fP to a list of Bdd. This list can be created by \fBaddListBdd()\fP function. This function provides the basic method for creating the representation of a function according to the operators in a boolean expression.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA,nodeB,nodeC;
|
||||
pNode res;
|
||||
chain_list *pt;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
nodeB = createNodeTermBdd(3);
|
||||
nodeC = createNodeTermBdd(4);
|
||||
pt = NULL;
|
||||
pt = addListBdd(pt,nodeA);
|
||||
pt = addListBdd(pt,nodeB);
|
||||
pt = addListBdd(pt,nodeC);
|
||||
res = applyBdd(OR,pt);
|
||||
displayBdd(res,1);
|
||||
|
||||
/* it will display
|
||||
@res INDEX = 4 LOW = @inter HIGH = ONE
|
||||
@inter INDEX = 3 LOW = @nodeA HIGH = ONE
|
||||
@nodeA INDEX = 2 LOW = ZERO HIGH = ONE
|
||||
*/
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH ERRORS
|
||||
"applyBdd : error - unknown operator"
|
||||
.br
|
||||
the operator number must be in (OR,AND,XOR,NAND,NOR,NXOR,NOT)
|
||||
.br
|
||||
"applyBdd : error - chained list is empty"
|
||||
.br
|
||||
chained list pointer \fIpt = NULL\fP.
|
||||
.br
|
||||
"applyBdd : error - bad operator"
|
||||
.br
|
||||
The number of arguments is 1 and the operator is distinct from NOT.
|
||||
.br
|
||||
chained list pointer \fIpt = NULL\fP.
|
||||
.br
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR addListBdd (3),
|
||||
.BR applyBinBdd (3),
|
||||
.BR notBdd (3),
|
||||
.BR constraintBdd (3),
|
||||
.BR composeBdd (3),
|
||||
.BR displayBdd (3),
|
||||
.BR createNodeTermBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
.\" $Id: applyBinBdd.3,v 1.1 2002/04/03 13:13:25 ludo Exp $
|
||||
.\" @(#)applyBinBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH APPLYBINBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBapplyBinBdd\fP \- applies an operator to two BDD.
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
pNode applyBinBdd(oper,pBdd1,pBdd2)
|
||||
short oper;
|
||||
pNode pBdd1;
|
||||
pNode pBdd2;
|
||||
.fi
|
||||
.SH PARAMETERS
|
||||
.TP 20
|
||||
\fIoper\fP
|
||||
operator number to apply (OR,AND,XOR,NAND,NOR,NXOR)
|
||||
.TP 20
|
||||
\fIpBdd1\fP
|
||||
first argument
|
||||
.TP 20
|
||||
\fIpBdd2\fP
|
||||
second argument
|
||||
.SH DESCRIPTION
|
||||
\fBapplyBinBdd()\fP applies \fIoper\fP to \fIpBdd1\fP and \fIpBdd2\fP. This function provides the basic method for creating the representation of a boolean function.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA,nodeB;
|
||||
pNode res;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
nodeB = createNodeTermBdd(3);
|
||||
res = applyBinBdd(OR,nodeA,nodeB);
|
||||
displayBdd(res,1);
|
||||
|
||||
/* it will display
|
||||
@res INDEX = 3 LOW = @nodeA HIGH = ONE
|
||||
@nodeA INDEX = 2 LOW = ZERO HIGH = ONE
|
||||
*/
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR applyBdd (3),
|
||||
.BR notBdd (3),
|
||||
.BR constraintBdd (3),
|
||||
.BR composeBdd (3),
|
||||
.BR addListBdd (3),
|
||||
.BR displayBdd (3),
|
||||
.BR createNodeTermBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
.\" $Id: bddToAblCct.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)bddToAblCct.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH BDDTOABLCCT 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBbddToAblCct\fP \- converts a BDD into an ABL within a circuit
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
chain_list *bddToAblCct(pC,pBdd)
|
||||
pCircuit pC;
|
||||
pNode pBdd;
|
||||
.fi
|
||||
.SH PARAMETERS
|
||||
.TP 20
|
||||
\fIpC\fP
|
||||
Circuit in which is made the conversion
|
||||
.TP 20
|
||||
\fIpBdd\fP
|
||||
BDD to convert
|
||||
.SH DESCRIPTION
|
||||
\fBbddToAblCct()\fP converts \fIpBdd\fP into an expression. This function returns a result that depends from the ordering of the primary input. This function provides the basic method for the logical optimizer called in BOP.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
chain_list *expr;
|
||||
pNode res;
|
||||
pCircuit pC;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
pC = initializeCct("circuit 1",10,10);
|
||||
|
||||
addInputCct(pC,"a");
|
||||
addInputCct(pC,"b");
|
||||
|
||||
/* let's suppose that res = (OR a b) */
|
||||
|
||||
expr = bddToAblCct(pC,applyBinBdd(OR,
|
||||
createNodeTermBdd(searchInputCct(pC,"a"))),
|
||||
createNodeTermBdd(searchInputCct(pC,"b")));
|
||||
displayExpr(expr);
|
||||
|
||||
/* it will display
|
||||
(OR a b)
|
||||
*/
|
||||
|
||||
destroyCct(pC);
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR abl (1),
|
||||
.BR ablToBddCct (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
.\" $Id: composeBdd.3,v 1.1 2002/04/03 13:13:25 ludo Exp $
|
||||
.\" @(#)composeBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH COMPOSEBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBcomposeBdd\fP \- substitutes an index by a BDD in another BDD
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
pNode composeBdd(pBdd1,pBdd2,index)
|
||||
pNode pBdd1;
|
||||
pNode pBdd2;
|
||||
short index;
|
||||
.fi
|
||||
.SH PARAMETERS
|
||||
.TP 20
|
||||
\fIpBdd1\fP
|
||||
BDD in wich \fIindex\fP is substituted
|
||||
.TP 20
|
||||
\fIpBdd2\fP
|
||||
BDD that replaces \fIindex\fP
|
||||
.TP 20
|
||||
\fIindex\fP
|
||||
index to substitute
|
||||
.SH DESCRIPTION
|
||||
\fBcomposeBdd()\fP constructs the graph for the function obtained by composing \fIpBdd1\fP and \fIpBdd2\fP.
|
||||
This function can be used when an auxiliary variable has been mistaken for a primary input.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA,nodeB;
|
||||
pNode res;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
nodeB = createNodeTermBdd(3);
|
||||
res = applyBinBdd(OR,nodeA,nodeB); /* res = (OR a b) */
|
||||
res = composeBdd(res,notBdd(nodeB),2); /* composition : a = (NOT B) */
|
||||
displayBdd(res,1);
|
||||
|
||||
/* it will display
|
||||
@res ONE
|
||||
*/
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR applyBdd (3),
|
||||
.BR notBdd (3),
|
||||
.BR constraintBdd (3),
|
||||
.BR applyBinBdd (3),
|
||||
.BR addListBdd (3),
|
||||
.BR displayBdd (3),
|
||||
.BR createNodeTermBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
.\" $Id: constraintBdd.3,v 1.1 2002/04/03 13:13:25 ludo Exp $
|
||||
.\" @(#)constraintBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH CONSTRAINTBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBconstraintBdd\fP \- restricts a BDD to another BDD
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
pNode constraintBdd(pBdd1,pBdd2)
|
||||
pNode pBdd1;
|
||||
pNode pBdd2;
|
||||
.fi
|
||||
.SH PARAMETERS
|
||||
.TP 20
|
||||
\fIpBdd1\fP
|
||||
BDD to restrict
|
||||
.TP 20
|
||||
\fIpBdd2\fP
|
||||
constraint BDD
|
||||
.SH DESCRIPTION
|
||||
\fBconstraintBdd()\fP constructs the graph for the function obtained by restricting \fIpBdd1\fP on \fIpBdd2\fP.
|
||||
This function can be used for example when a primary input is stuck at 0 or 1.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA,nodeB;
|
||||
pNode res;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
nodeB = createNodeTermBdd(3);
|
||||
res = applyBinBdd(OR,nodeA,nodeB); /* res = (OR a b)
|
||||
res = constraintBdd(res,nodeA); /* a = 1 */
|
||||
displayBdd(res,1);
|
||||
|
||||
/* it will display
|
||||
@res ONE
|
||||
*/
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR simplifDcOneBdd (3),
|
||||
.BR simplifDcZeroBdd (3),
|
||||
.BR composeBdd (3),
|
||||
.BR applyBdd (3),
|
||||
.BR notBdd (3),
|
||||
.BR applyBinBdd (3),
|
||||
.BR addListBdd (3),
|
||||
.BR displayBdd (3),
|
||||
.BR createNodeTermBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
.\" $Id: createNodeTermBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)createNodeTermBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH CREATENODETERMBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBcreateNodeTermBdd\fP \- creates a terminal node of variable.
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
pNode createNodeTermBdd(index)
|
||||
short index;
|
||||
.fi
|
||||
.SH PARAMETER
|
||||
.TP 20
|
||||
\fIindex\fP
|
||||
associated index
|
||||
.SH DESCRIPTION
|
||||
\fBcreateNodeTermBdd()\fP creates a terminal node corresponding to \fIindex\fP. Because of reduction table, this function always returns the same \fIpNode\fP for a given \fIindex\fP. 0 and 1 \fIindex\fP are reserved to the \fIzero\fP and \fIone\fP nodes.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
displayBdd(nodeA,1);
|
||||
|
||||
/* it will display
|
||||
@nodeA INDEX = 2 LOW = ZERO HIGH = ONE
|
||||
*/
|
||||
nodeA = createNodeTermBdd(3); /* nodeA doesn't change */
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH ERROR
|
||||
"createNodeTermBdd : error - index < 2"
|
||||
.br
|
||||
\fIindex\fP must be strictly higher than 1.
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR applyBinBdd (3),
|
||||
.BR applyBdd (3),
|
||||
.BR addListBdd (3),
|
||||
.BR displayBdd (3),
|
||||
.BR notBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
.\" $Id: destroyBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)destroyBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH DESTROYBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBdestroyBdd\fP \- removes the BDDs system
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
void destroyBdd(level)
|
||||
.fi
|
||||
.SH PARAMETER
|
||||
.TP 20
|
||||
\fIlevel\fP
|
||||
desallocate level
|
||||
.SH DESCRIPTION
|
||||
\fBdestroyBdd()\fP removes the BDDs system. This function can be called only after the \fBinitializeBdd()\fP function. if \fIlevel = 0\fP the nodes are saved and it's possible to go through the BDD for treatements that don't modify the BDD (simulation for example).
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
|
||||
initializeBdd(MEDIUM_BDD);
|
||||
|
||||
/* application using BDD ... */
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR initializeBdd (3),
|
||||
.BR gcNodeBdd (3),
|
||||
.BR markAllBdd (3),
|
||||
.BR numberNodeAllBdd (3),
|
||||
.BR resetBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
.\" $Id: displayBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)displayBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH DISPLAYBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBdisplayBdd\fP \- displays a BDD
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
void displayBdd(pBdd,level)
|
||||
pNode pBdd;
|
||||
int level;
|
||||
.fi
|
||||
.SH PARAMETERS
|
||||
.TP 20
|
||||
\fIpBdd\fP
|
||||
BDD to display
|
||||
.TP 20
|
||||
\fIlevel\fP
|
||||
displaying level
|
||||
.SH DESCRIPTION
|
||||
\fBdisplayBdd()\fP displays \fIpBDD\fP. if \fIlevel= 1\fP, this function displays all the nodes of \fIpBdd\fP, if \fIlevel = 0\fP the function displays the root node of \fIpBdd\fP.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA,nodeB,nodeC;
|
||||
pNode res;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
nodeB = createNodeTermBdd(3);
|
||||
nodeC = createNodeTermBdd(4);
|
||||
|
||||
res = applyBinBdd(OR,applyBinBdd(AND,nodeB,nodeC),nodeA);
|
||||
/* corresponding to (OR (AND b c) a) */
|
||||
|
||||
displayBdd(res,1);
|
||||
|
||||
/* it will display
|
||||
@res INDEX = 4 LOW = @nodeA HIGH = @inter1
|
||||
@nodeA INDEX = 2 LOW = ZERO HIGH = ONE
|
||||
@inter1 INDEX = 3 LOW = @nodeA HIGH = ONE
|
||||
*/
|
||||
|
||||
displayBdd(res,0);
|
||||
|
||||
/* it will display
|
||||
@res INDEX = 4 LOW = @nodeA HIGH = @inter1
|
||||
*/
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR createNodeTermBdd (3),
|
||||
.BR applyBinBdd (3),
|
||||
.BR applyBdd (3),
|
||||
.BR constraintBdd (3),
|
||||
.BR composeBdd (3),
|
||||
.BR addListBdd (3),
|
||||
.BR notBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
.\" $Id: gcNodeBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)gcNodeBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH GCNODEBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBgcNodeBdd\fP \- does a garbage collection
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
void gcNodeBdd(pt)
|
||||
chain_list *pt;
|
||||
.fi
|
||||
.SH PARAMETER
|
||||
.TP 20
|
||||
\fIpt\fP
|
||||
chained list of BDD to rescue
|
||||
.SH DESCRIPTION
|
||||
\fBgcNodeBdd()\fP removes all the nodes that aren't used in the BDD pointed in the chained list \fIpt\fP.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA,nodeB,nodeC;
|
||||
pNode res1,res2;
|
||||
chain_list *ptCL;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
nodeB = createNodeTermBdd(3);
|
||||
nodeC = createNodeTermBdd(4);
|
||||
|
||||
res1 = applyBinBdd(OR,applyBinBdd(OR,nodeA,nodeB),nodeC);
|
||||
res2 = applyBinBdd(AND,applyBinBdd(AND,nodeA,nodeB),nodeC);
|
||||
printf("number of nodes in memory = %d",numberAllNodeBdd());
|
||||
|
||||
/* it will display
|
||||
7
|
||||
*/
|
||||
ptCL = addchain(NULL,res1);
|
||||
gcNodeBdd(ptCL); /* only res1 nodes are saved */
|
||||
|
||||
freechain(ptCL);
|
||||
printf("number of nodes in memory = %d",numberAllNodeBdd());
|
||||
|
||||
/* it will display
|
||||
number of nodes in memory = 5
|
||||
*/
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR markBdd (3),
|
||||
.BR supportChain_listBdd (3),
|
||||
.BR markAllBdd (3),
|
||||
.BR numberNodeBdd (3),
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
.\" $Id: initializeBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)initializeBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH INITIALIZEBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBinitializeBdd\fP \- initializes the BDDs system
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
void initializeBdd(size)
|
||||
int size;
|
||||
.fi
|
||||
.SH PARAMETER
|
||||
.TP 20
|
||||
\fIsize\fP
|
||||
First size of BDD system
|
||||
.SH DESCRIPTION
|
||||
\fBinitializeBdd()\fP initializes the BDDs system. \fIsize\fP can be equal to SMALL_BDD, MEDIUM_BDD or LARGE_BDD according to the application size. This function creates the \fIzero\fP and \fIone\fP node that correspond to the 0 and 1 boolean constants.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
|
||||
initializeBdd(MEDIUM_BDD);
|
||||
|
||||
dislayBdd(one);
|
||||
/* it will display
|
||||
ONE
|
||||
*/
|
||||
|
||||
/* application using BDD ... */
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH ERROR
|
||||
"initializeBdd : error - size out of bound"
|
||||
.br
|
||||
\fIsize\fP must be included into \fISMALL_BDD\fP and \fILARGE_BDD\fP.
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR destroyBdd (3),
|
||||
.BR resetBdd (3),
|
||||
.BR markAllBdd (3),
|
||||
.BR numberNodeAllBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
.\" $Id: markAllBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)markAllBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH MARKALLBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBmarkAllBdd\fP \- marks all the nodes of the BDDs system
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
void markAllBdd(value)
|
||||
short value;
|
||||
.fi
|
||||
.SH PARAMETER
|
||||
.TP 20
|
||||
\fIvalue\fP
|
||||
value to assign
|
||||
.SH DESCRIPTION
|
||||
\fBmarkAllBdd()\fP assigns to \fIvalue\fP the marks of all the nodes used in the BDDs system.
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR markBdd (3),
|
||||
.BR numberNodeBdd (3),
|
||||
.BR numberNodeAllBdd (3),
|
||||
.BR supportChain_listBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
.\" $Id: markBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)markBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH MARKBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBmarkBdd\fP \- marks all nodes of a BDD
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
void markBdd(pBdd,value)
|
||||
pNode pBdd;
|
||||
short value;
|
||||
.fi
|
||||
.SH PARAMETERS
|
||||
.TP 20
|
||||
\fIpBdd\fP
|
||||
BDD to mark
|
||||
.TP 20
|
||||
\fIvalue\fP
|
||||
value to assign
|
||||
.SH DESCRIPTION
|
||||
\fBmarkBdd()\fP assigns to \fIvalue\fP the field \fImark\fP of all the nodes used in \fIpBdd\fP. This function is used for the garbage collection. When a node is created, its mark is set to 0 (the default value).
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR markAllBdd (3),
|
||||
.BR numberNodeBdd (3),
|
||||
.BR numberNodeAllBdd (3),
|
||||
.BR gcNodeBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
.\" $Id: notBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)notBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH NOTBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBnotBdd\fP \- complements a BDD
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
pNode notBdd(pBdd)
|
||||
pNode pBdd;
|
||||
.fi
|
||||
.SH PARAMETER
|
||||
.TP 20
|
||||
\fIpBdd\fP
|
||||
BDD to complement
|
||||
.SH DESCRIPTION
|
||||
\fBnotBdd()\fP applies NOT operator to \fIpBdd\fP.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
|
||||
displayBdd(notBdd(nodeA),1);
|
||||
|
||||
/* it will display
|
||||
@nodeA INDEX = 2 LOW = ONE HIGH = ZERO
|
||||
*/
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR applyBinBdd (3),
|
||||
.BR applyBdd (3),
|
||||
.BR constraintBdd (3),
|
||||
.BR composeBdd (3),
|
||||
.BR addListBdd (3),
|
||||
.BR displayBdd (3),
|
||||
.BR createNodeTermBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
.\" $Id: numberNodeAllBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)numberNodeAllBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH NUMBERNODEALLBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBnumberNodeAllBdd\fP \- count the number of nodes used in the BDD system
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
int numberNodeAllBdd()
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
\fBnumberNodeAllBdd()\fP count the number of the nodes that are used in the BDD system
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA,nodeB,nodeC;
|
||||
pNode res;
|
||||
chain_list *pt;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
nodeB = createNodeTermBdd(3);
|
||||
nodeC = createNodeTermBdd(4);
|
||||
pt = NULL;
|
||||
pt = addListBdd(pt,nodeA);
|
||||
pt = addListBdd(pt,nodeB);
|
||||
pt = addListBdd(pt,nodeC);
|
||||
res = applyBdd(OR,pt);
|
||||
printf("number of nodes = %d",numberNodeAllBdd());
|
||||
|
||||
/* it will display
|
||||
number of nodes = 5
|
||||
*/
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR addListBdd (3),
|
||||
.BR numberNodeBdd (3),
|
||||
.BR notBdd (3),
|
||||
.BR constraintBdd (3),
|
||||
.BR composeBdd (3),
|
||||
.BR displayBdd (3),
|
||||
.BR createNodeTermBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
.\" $Id: numberNodeBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)numberNodeBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH NUMBERNODEBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBnumberNodeBdd\fP \- computes the number of nodes used in a BDD
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
int numberNodeBdd(pBdd)
|
||||
pNode pBdd;
|
||||
.fi
|
||||
.SH PARAMETER
|
||||
.TP 20
|
||||
\fIpBdd\fP
|
||||
BDD on wich the compute does
|
||||
.SH DESCRIPTION
|
||||
\fBnumberNodeBdd()\fP computes the number of reduced nodes that are used in \fIpBdd\fP.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA,nodeB,nodeC;
|
||||
pNode res;
|
||||
chain_list *pt;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
nodeB = createNodeTermBdd(3);
|
||||
nodeC = createNodeTermBdd(4);
|
||||
pt = NULL;
|
||||
pt = addListBdd(pt,nodeA);
|
||||
pt = addListBdd(pt,nodeB);
|
||||
pt = addListBdd(pt,nodeC);
|
||||
res = applyBdd(XOR,pt);
|
||||
printf("number of nodes = %d",numberNodeBdd(res));
|
||||
|
||||
/* it will display
|
||||
number of nodes = 5
|
||||
*/
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR addListBdd (3),
|
||||
.BR numberNodeBdd (3),
|
||||
.BR notBdd (3),
|
||||
.BR constraintBdd (3),
|
||||
.BR composeBdd (3),
|
||||
.BR displayBdd (3),
|
||||
.BR createNodeTermBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
.\" $Id: resetBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)resetBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH RESETBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBresetBdd\fP \- resets the BDDs system
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
void resetBdd()
|
||||
.fi
|
||||
.SH DESCRIPTION
|
||||
\fBresetBdd()\fP resets the BDDs system. This function can be only called after the \fBinitializeBdd()\fP function.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
|
||||
initializeBdd(LARGE_BDD);
|
||||
|
||||
/* first application using BDD ... */
|
||||
|
||||
resetBdd();
|
||||
|
||||
/* second application using BDD ... */
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR destroyBdd (3),
|
||||
.BR gcNodeBdd (3),
|
||||
.BR markAllBdd (3),
|
||||
.BR numberNodeAllBdd (3),
|
||||
.BR resetBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
.\" $Id: simplifDcOneBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)simplifDcZeroBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH SIMPLIFDCONEBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBsimplifDcOneBdd\fP \- simplifies a BDD with don't cares on its on-set part
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
pNode simplifDcOneBdd(pBdd1,pBdd2)
|
||||
pNode pBdd1;
|
||||
pNode pBdd2;
|
||||
.fi
|
||||
.SH PARAMETERS
|
||||
.TP 20
|
||||
\fIpBdd1\fP
|
||||
BDD to simplify
|
||||
.TP 20
|
||||
\fIpBdd2\fP
|
||||
"don't care" function
|
||||
.SH DESCRIPTION
|
||||
\fBsimplifDcOneBdd()\fP simplifies \fIpBdd1\fP with \fIpBdd2\fP. \fIpBdd2\fP must be included imperatively in the on-set part of pBdd1. This function returns a BDD that depends to the order of the BDD.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA,nodeB;
|
||||
pNode res,res1,res2;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
nodeB = createNodeTermBdd(3);
|
||||
res1 = applyBinBdd(XOR,nodeA,nodeB); /* res1 = (XOR a b) */
|
||||
res2 = applyBinBdd(AND,notBdd(nodeA),nodeB); /* res2 = (AND (not a) b) */
|
||||
res = simplifDcOneBdd(res1,res2); /* res1 and res2 = res2 */
|
||||
|
||||
/* res = (AND a (not b)) */
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR simplifDcZeroBdd (3),
|
||||
.BR constraintBdd (3),
|
||||
.BR composeBdd (3),
|
||||
.BR upVarBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
.\" $Id: simplifDcZeroBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)simplifDcZeroBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH SIMPLIFDCZEROBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBsimplifDcZeroBdd\fP \- simplifies a BDD with don't cares on its off-set part
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
pNode simplifDcZeroBdd(pBdd1,pBdd2)
|
||||
pNode pBdd1;
|
||||
pNode pBdd2;
|
||||
.fi
|
||||
.SH PARAMETERS
|
||||
.TP 20
|
||||
\fIpBdd1\fP
|
||||
BDD to simplify
|
||||
.TP 20
|
||||
\fIpBdd2\fP
|
||||
"don't care" function
|
||||
.SH DESCRIPTION
|
||||
\fBsimplifDcZeroBdd()\fP simplifies \fIpBdd1\fP with \fIpBdd2\fP. \fIpBdd2\fP must be included imperatively in the off-set part of pBdd1. This function returns a BDD that depends to the order of the BDD.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA,NodeB;
|
||||
pNode res,res1,res2;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
nodeB = createNodeTermBdd(3);
|
||||
res1 = applyBinBdd(OR,nodeA,nodeB); /* res1 = (OR a b) */
|
||||
res2 = applyBinBdd(NOR,nodeA,nodeB); /* res2 = (NOR a b) */
|
||||
res = simplifDcZeroBdd(res1,res2); /* res1 and res2 = 0 */
|
||||
displayBdd(res,1);
|
||||
|
||||
/* it will display
|
||||
@res ONE
|
||||
*/
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR simplifDcOneBdd (3),
|
||||
.BR applyBdd (3),
|
||||
.BR notBdd (3),
|
||||
.BR constraintBdd (3),
|
||||
.BR applyBinBdd (3),
|
||||
.BR addListBdd (3),
|
||||
.BR displayBdd (3),
|
||||
.BR createNodeTermBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
.\" $Id: supportChain_listBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)supportChain_listBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH SUPPORTCHAIN_LISTBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBsupportChain_listBdd\fP \- returns a chained list of nodes that are used in a given BDD.
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
chain_list *supportChain_listBdd(pBdd)
|
||||
pNode pBdd;
|
||||
.fi
|
||||
.SH PARAMETER
|
||||
.TP 20
|
||||
\fIpBdd\fP
|
||||
BDD
|
||||
.SH DESCRIPTION
|
||||
\fBsupportChain_listBdd()\fP creates a chained list in wich all the nodes of \fIpBdd\fP are represented.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA,nodeB,nodeC;
|
||||
pNode res;
|
||||
chain_list *pt;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
nodeB = createNodeTermBdd(3);
|
||||
nodeC = createNodeTermBdd(4);
|
||||
pt = NULL;
|
||||
pt = addListBdd(pt,nodeA);
|
||||
pt = addListBdd(pt,nodeB);
|
||||
pt = addListBdd(pt,nodeC);
|
||||
res = applyBdd(OR,pt);
|
||||
pt = supportChain_listBdd(res);
|
||||
|
||||
while (pt)
|
||||
{
|
||||
printf("--- ");
|
||||
displayBdd((pNode) pt->DATA,0); /* displays the node */
|
||||
pt = pt->NEXT;
|
||||
}
|
||||
/* it will display
|
||||
|
||||
--- @nodeA index = 2 LOW = ZERO HIGH = ONE
|
||||
--- @inter index = 3 LOW = @nodeA HIGH = ONE
|
||||
--- @res index = 4 LOW = @inter HIGH = ONE
|
||||
*/
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR numberNodeBdd (3),
|
||||
.BR addListBdd (3),
|
||||
.BR notBdd (3),
|
||||
.BR constraintBdd (3),
|
||||
.BR composeBdd (3),
|
||||
.BR displayBdd (3),
|
||||
.BR createNodeTermBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
.\" $Id: upVarBdd.3,v 1.1 2002/04/03 13:13:26 ludo Exp $
|
||||
.\" @(#)upVarBdd.2 7.01 92/08/22 ; Labo masi cao-vlsi; Author : Luc Burgun
|
||||
.TH UPVARBDD 3 "October 1, 1997" "ASIM/LIP6" "BDD functions"
|
||||
.so man1/alc_origin.1
|
||||
.SH NAME
|
||||
\fBupVarBdd\fP \- brings up an index in a BDD
|
||||
.SH SYNOPSYS
|
||||
.nf
|
||||
#include "logmmm.h"
|
||||
pNode upVarBdd(pBdd,oldIndex,newIndex)
|
||||
pNode pBdd;
|
||||
short oldIndex,newIndex;
|
||||
.fi
|
||||
.SH PARAMETERS
|
||||
.TP 20
|
||||
\fIpBdd\fP
|
||||
BDD in wich \fIindex\fP is came up
|
||||
.TP 20
|
||||
\fIoldIndex\fP
|
||||
index to come up
|
||||
.TP 20
|
||||
\fInewIndex\fP
|
||||
new index
|
||||
.SH DESCRIPTION
|
||||
\fBupVarBdd()\fP constructs a graph obtained by bringing up \fIoldIndex\fP to \fInewIndex\fP. This function is called by the BDDs reordering function.
|
||||
.SH EXAMPLE
|
||||
.nf
|
||||
#include "mutnnn.h" /* mbk utilities */
|
||||
#include "logmmm.h"
|
||||
pNode nodeA,nodeB;
|
||||
pNode res;
|
||||
|
||||
initializeBdd(SMALL_BDD);
|
||||
nodeA = createNodeTermBdd(3);
|
||||
nodeB = createNodeTermBdd(3);
|
||||
res = applyBinBdd(OR,nodeA,nodeB); /* res = (OR a b)
|
||||
res = upVarBdd(res,2,4);
|
||||
displayBdd(res,1);
|
||||
|
||||
/* it will display
|
||||
@res INDEX 4 LOW = @nodeB HIGH = ONE
|
||||
@nodeB INDEX 3 LOW = ZERO HIGH = ONE
|
||||
*/
|
||||
|
||||
destroyBdd(1);
|
||||
.fi
|
||||
.SH ERROR
|
||||
"upVarBdd : error - newIndex <= oldIndex"
|
||||
.br
|
||||
The new index must be higher than the old index.
|
||||
.SH SEE ALSO
|
||||
.BR log (1),
|
||||
.BR bdd (1),
|
||||
.BR applyBdd (3),
|
||||
.BR notBdd (3),
|
||||
.BR constraintBdd (3),
|
||||
.BR composeBdd (3),
|
||||
.BR applyBinBdd (3),
|
||||
.BR addListBdd (3),
|
||||
.BR displayBdd (3),
|
||||
.BR createNodeTermBdd (3).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,27 @@
|
|||
CFLAGS = @CFLAGS@ \
|
||||
-DALLIANCE_TOP=\"${ALLIANCE_TOP}\"
|
||||
lib_LIBRARIES = libBdd.a
|
||||
include_HEADERS = bdd.h
|
||||
libBdd_a_SOURCES = \
|
||||
bdd.h bddenv.h bddimply.h bddsimpdc.h \
|
||||
bddalloc.c bdderror.c bddlog.c bddsubst.c \
|
||||
bddalloc.h bdderror.h bddlog.h bddsubst.h \
|
||||
bddapply.c bddexist.c bddmark.c bddsupport.c \
|
||||
bddapply.h bddexist.h bddmark.h bddsupport.h \
|
||||
bddassoc.c bddexplosion.c bddnode.c bddsweep.c \
|
||||
bddassoc.h bddexplosion.h bddnode.h bddsweep.h \
|
||||
bddblock.c bddflag.c bddoptimize.c bddsystem.c \
|
||||
bddblock.h bddflag.h bddoptimize.h bddsystem.h \
|
||||
bddcheck.c bddfraction.c bddreduce.c bddtest.c \
|
||||
bddcheck.h bddfraction.h bddreduce.h bddtest.h \
|
||||
bddcircuit.c bddfree.c bddref.c bddtransfert.c \
|
||||
bddcircuit.h bddfree.h bddref.h bddtransfert.h \
|
||||
bddcofactor.c bddgarbage.c bddrelprod.c bdduser.c \
|
||||
bddcofactor.h bddgarbage.h bddrelprod.h bdduser.h \
|
||||
bddcompose.c bddheath.c bddreorder.c bddvar.c \
|
||||
bddcompose.h bddheath.h bddreorder.h bddvar.h \
|
||||
bddconvert.c bddhnode.c bddresize.c bddvaraux.c \
|
||||
bddconvert.h bddhnode.h bddresize.h bddvaraux.h \
|
||||
bdddump.c bddhoper.c bddsatisfy.c \
|
||||
bdddump.h bddhoper.h bddsatisfy.h \
|
||||
bddenv.c bddimply.c bddsimpdc.c
|
|
@ -0,0 +1,424 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Tool : ABL, BDD, HT Librarie
|
||||
* Date : 1991,92
|
||||
* Author : Luc Burgun
|
||||
* Modified by Czo <Olivier.Sirol@lip6.fr> 1996,97
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* $Id: log.h,v 1.1 2002/04/03 13:13:25 ludo Exp $ */
|
||||
|
||||
#ifndef LUC_LOG_H
|
||||
#define LUC_LOG_H
|
||||
|
||||
#undef OR
|
||||
#undef AND
|
||||
#undef XOR
|
||||
#undef NOT
|
||||
#undef NOR
|
||||
#undef NAND
|
||||
#undef NXOR
|
||||
#undef CONTRAINT
|
||||
#undef STABLE
|
||||
#undef RESTRICT
|
||||
#undef CNST 10
|
||||
|
||||
#define OR 0
|
||||
#define AND 1
|
||||
#define XOR 2
|
||||
#define NOT 3
|
||||
#define NOR 4
|
||||
#define NAND 5
|
||||
#define NXOR 6
|
||||
#define CONTRAINT 7
|
||||
#define STABLE 8
|
||||
#define RESTRICT 9
|
||||
#define CNST 10
|
||||
|
||||
/* ==================================================================
|
||||
Gestion de table de hachage Version du 16.07.91
|
||||
Les structures de donnees
|
||||
Burgun L.
|
||||
================================================================== */
|
||||
|
||||
|
||||
#define EMPTYTH -1
|
||||
#define VIDETH -1
|
||||
#define DELETETH -2
|
||||
|
||||
/*------ les structures pour la table de hachage des entiers -----*/
|
||||
|
||||
typedef struct elemTH
|
||||
{
|
||||
char *key;
|
||||
int value;
|
||||
}
|
||||
*pElemTH;
|
||||
|
||||
/* table de hachage
|
||||
length est la longueur de la table,
|
||||
pElemTH le pointeur sur le debut de table,
|
||||
count le nombre d'elements deja rentres. */
|
||||
|
||||
typedef struct tableTH
|
||||
{
|
||||
int length;
|
||||
pElemTH pElem;
|
||||
int count;
|
||||
}
|
||||
*pTH;
|
||||
|
||||
|
||||
/* ==============================================================
|
||||
La bibliotheque des Arbres binaires Lisp-like version 23/08/91
|
||||
Burgun L.
|
||||
Structures de donnees
|
||||
============================================================== */
|
||||
|
||||
|
||||
|
||||
/*----------- Fonctions Lisp-Like de bas-niveau -------------*/
|
||||
|
||||
#define CDR(expr) (expr->NEXT)
|
||||
#define CAR(expr) ((chain_list *) expr->DATA)
|
||||
#define CADR(expr) CAR(CDR(expr))
|
||||
#define ATOM(expr) (!expr->NEXT)
|
||||
#define VALUE_ATOM(expr) (char *) expr->DATA
|
||||
#define OPER(expr) ((int)(CAR(expr))->DATA)
|
||||
|
||||
|
||||
|
||||
/* ==============================================================
|
||||
La bibliotheque des graphes de decision binaires version 06/09/91
|
||||
Burgun L.
|
||||
Structures de donnees
|
||||
============================================================== */
|
||||
|
||||
#undef OUI
|
||||
#undef NON
|
||||
#undef TRUE
|
||||
#undef FALSE
|
||||
#undef INPUT
|
||||
#undef OUTPUT
|
||||
#undef SMALL
|
||||
#undef MEDIUM
|
||||
#undef LARGE
|
||||
|
||||
#undef VIDE
|
||||
#undef DELETE
|
||||
#undef TABLE_PLEINE
|
||||
#undef BDDDELETE
|
||||
#undef BDDTABLE_PLEINE
|
||||
#undef MAX_SIZE_BDD
|
||||
|
||||
#undef DONTCARE0
|
||||
#undef DONTCARE1
|
||||
#undef DONTCARE2
|
||||
|
||||
|
||||
#define OUI 1
|
||||
#define NON 0
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
#define INPUT 0
|
||||
#define OUTPUT 1
|
||||
#define SMALL 999
|
||||
#define MEDIUM 9999
|
||||
#define LARGE 99999
|
||||
#define SMALL_BDD 0
|
||||
#define MEDIUM_BDD 1
|
||||
#define LARGE_BDD 2
|
||||
|
||||
#define VIDE -1
|
||||
#define DELETE -2
|
||||
#define TABLE_PLEINE -3
|
||||
#define BDDDELETE (pNode) DELETE
|
||||
#define BDDTABLE_PLEINE (pNode) TABLE_PLEINE
|
||||
#define MAX_SIZE_BDD 50000000 /* 50 Mega de noeuds Bdd */
|
||||
|
||||
#define DONTCARE0 11
|
||||
#define DONTCARE1 12
|
||||
#define DONTCARE2 13
|
||||
|
||||
|
||||
|
||||
/*---------------- structure d'un noeud de BDD -------------------*/
|
||||
|
||||
typedef struct node
|
||||
{
|
||||
struct node *high, *low; /* les noeuds fils */
|
||||
short index; /* index de la variable */
|
||||
short mark; /* nombre de peres pointant le noeud */
|
||||
}
|
||||
*pNode;
|
||||
|
||||
|
||||
/*--------------- La table de hachage pour des BDD ------------ */
|
||||
|
||||
/* table de hachage qui retourne des pointeurs de BDD
|
||||
lenTableBdd est la longueur de la table,
|
||||
pBddT le pointeur sur le debut de table,
|
||||
compteur le nombre d'elements deja rentres. */
|
||||
|
||||
typedef struct tableBdd
|
||||
{
|
||||
int lenTableBdd;
|
||||
pNode *pBdd;
|
||||
int compteur;
|
||||
}
|
||||
*pTableBdd;
|
||||
|
||||
|
||||
|
||||
/*------ les structures pour la table de hachage local -----*/
|
||||
|
||||
typedef struct vertexLoc
|
||||
{
|
||||
pNode high, low, father;
|
||||
short oper;
|
||||
}
|
||||
*pVertexLoc;
|
||||
|
||||
/* table de hachage pour la recuperation d'operation locale.
|
||||
lenTable est la longueur de la table,
|
||||
pElemT le pointeur sur le debut de table,
|
||||
compteur le nombre d'elements deja rentres. */
|
||||
|
||||
typedef struct tableLoc
|
||||
{
|
||||
int lenTabLoc;
|
||||
pVertexLoc pLoc;
|
||||
}
|
||||
*pTableLoc;
|
||||
|
||||
/*------------- structure pour les circuits -------------*/
|
||||
|
||||
typedef struct circuit
|
||||
{
|
||||
pTH pTI;
|
||||
pTH pTO;
|
||||
short countI;
|
||||
char **pNameI;
|
||||
char *name;
|
||||
}
|
||||
*pCircuit;
|
||||
|
||||
#define MAX_PACK 1000
|
||||
|
||||
/* structure systeme pour la generation de GDB . */
|
||||
|
||||
struct systemBdd
|
||||
{
|
||||
chain_list *lpAT;
|
||||
pTableBdd pRT;
|
||||
pNode pAT;
|
||||
int indiceAT;
|
||||
pTableLoc pMC;
|
||||
}
|
||||
sysBdd;
|
||||
|
||||
pNode one, zero;
|
||||
|
||||
/**************** DECLARATION DES FONCTIONS *******/
|
||||
|
||||
#ifndef __P
|
||||
# if defined(__STDC__) || defined(__GNUC__)
|
||||
# define __P(x) x
|
||||
# else
|
||||
# define __P(x) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Prototypes from log_bdd0.c */
|
||||
|
||||
extern pNode initVertexBdd __P((int index, pNode high, pNode low));
|
||||
extern pNode createNodeTermBdd __P((short index));
|
||||
extern void initializeBdd __P((int size));
|
||||
extern void destroyBdd __P((int level));
|
||||
extern void resetBdd __P(());
|
||||
extern int numberNodeAllBdd __P(());
|
||||
extern int numberNodeBdd __P((pNode pBdd));
|
||||
extern int countNode __P((pNode pt));
|
||||
extern int countNodeTdg __P((pNode pt));
|
||||
extern chain_list * muxAbl __P((pNode high, pNode low, chain_list *a, char **tabName));
|
||||
extern chain_list * bddToAbl __P((pNode pt, char **tabName));
|
||||
extern void displayBddLoc __P((short level, pNode pt));
|
||||
extern void displayBdd __P((pNode pBdd, int level));
|
||||
extern void assignNumNodeBdd __P((pNode bdd, pTH vTable, int *pNodeNumber));
|
||||
extern void displayGraphicBdd __P((pNode pBdd));
|
||||
extern void displayBddName __P((short level, pNode pt, char **TabName));
|
||||
extern pNode notBdd __P((pNode pBdd));
|
||||
extern pNode applyTerm __P((int oper, short index, pNode pBdd));
|
||||
extern pNode applyBinBdd __P((short oper, pNode pBdd1, pNode pBdd2));
|
||||
extern pNode applyBdd __P((short oper, chain_list *pt));
|
||||
extern pNode cnstBdd __P((pNode pBdd1, pNode pBddGc));
|
||||
extern pNode restrictBdd __P((pNode pBdd1, pNode pBddGc));
|
||||
extern pNode constraintBdd __P((pNode pBdd1, pNode pBddGc));
|
||||
extern pNode simplifDcZeroBdd __P((pNode pGon, pNode pGdc));
|
||||
extern pNode simplifPlusDcZeroBdd __P((pNode pGon, pNode pGdc));
|
||||
extern pNode simplifDcOneBdd __P((pNode pGon, pNode pGdc));
|
||||
extern pNode simplifDcOneFPGABdd __P((pNode pGon, pNode pGdc));
|
||||
extern pNode composeBdd __P((pNode pBdd1, pNode pBdd2, int index));
|
||||
extern chain_list * addListBdd __P((chain_list *pt, pNode pBdd));
|
||||
extern int oneBdd __P((pNode pBdd));
|
||||
extern int zeroBdd __P((pNode pBdd));
|
||||
extern int equalBdd __P((pNode pBdd1, pNode pBdd2));
|
||||
extern void markBdd __P((pNode pBdd, short value));
|
||||
extern pNode upVarBdd __P((pNode pF, pNode pFoldIndex, short newIndex));
|
||||
extern void markAllBdd __P((short value));
|
||||
extern void supportBddInt __P((pNode pt, chain_list **ppCL));
|
||||
extern chain_list * supportChain_listBdd __P((pNode pBdd));
|
||||
extern pNode initVertexBddAux __P((short index, pNode high, pNode low, struct systemBdd *sysCible));
|
||||
extern pNode regenereBdd __P((pNode pBdd, struct systemBdd *sysCible, pTH pTHNode));
|
||||
extern void gcNodeBdd __P((chain_list *pt));
|
||||
extern void rempTabIndex __P((pNode pt, char *tabIndex));
|
||||
extern chain_list * supportIndexBdd __P((pNode pt, int sens));
|
||||
|
||||
|
||||
/* Prototypes from log_bdd1.c */
|
||||
|
||||
extern pCircuit initializeCct __P((char *name, int nbI, int nbO));
|
||||
extern void resetCct __P((pCircuit pC));
|
||||
extern void destroyCct __P((pCircuit pC));
|
||||
extern pNode searchOutputCct __P((pCircuit pC, char *name));
|
||||
extern void addOutputCct __P((pCircuit pC, char *name, pNode pt));
|
||||
extern char * searchIndexCct __P((pCircuit pC, short index));
|
||||
extern short searchInputCct __P((pCircuit pC, char *name));
|
||||
extern short addInputCct __P((pCircuit pC, char *name));
|
||||
extern void delInputCct __P((pCircuit pC, char *name));
|
||||
extern void displayCct __P((pCircuit pC, int mode));
|
||||
extern void composeCct __P((pCircuit pC, char *name, pNode pt));
|
||||
extern void constraintCct __P((pCircuit pC, pNode pt));
|
||||
extern void proofCct __P((pCircuit pC1, pCircuit pC2));
|
||||
extern pNode ablToBddCct __P((pCircuit pC, chain_list *expr));
|
||||
extern void cpOrderCct __P((pCircuit CC1, pCircuit CC2));
|
||||
extern void upVarCct __P((pCircuit pC, pNode ptOldIndex, short newIndex));
|
||||
extern int numberNodeCct __P((pCircuit pC));
|
||||
extern int numberNodeTdgCct __P((pCircuit pC));
|
||||
extern chain_list * bddToAblCct __P((pCircuit pC, pNode pBdd));
|
||||
extern void gcNodeCct __P((pCircuit pC));
|
||||
|
||||
|
||||
/* Prototypes from log_prefbib.c */
|
||||
|
||||
extern char * gensym_abl __P((char *name, int num));
|
||||
extern void ablError __P((chain_list *expr, char *func));
|
||||
extern chain_list * createAtom __P((char *name));
|
||||
extern chain_list * createExpr __P((short oper));
|
||||
extern chain_list * notExpr __P((chain_list *expr));
|
||||
extern chain_list * createBinExpr __P((short oper, chain_list *expr1, chain_list *expr2));
|
||||
extern void addQExpr __P((chain_list *expr1, chain_list *expr2));
|
||||
extern void addHExpr __P((chain_list *expr1, chain_list *expr2));
|
||||
extern void freeExpr __P((chain_list *expr));
|
||||
extern char * operToChar __P((short oper));
|
||||
extern short charToOper __P((char *name));
|
||||
extern void displayExprInt __P((chain_list *expr));
|
||||
extern void displayExpr __P((chain_list *expr));
|
||||
extern void displayInfExpr __P((chain_list *expr));
|
||||
extern char * exprToCharInt __P((chain_list *expr, int mode, char *chaine, int *taille));
|
||||
extern char * exprToChar __P((chain_list *expr, int mode));
|
||||
extern char * identExprInt __P((chain_list *expr, char *chaine, int *taille));
|
||||
extern char * identExpr __P((chain_list *expr));
|
||||
extern int profExpr __P((chain_list *expr));
|
||||
extern int profAOExpr __P((chain_list *expr));
|
||||
extern chain_list * mapCarExpr __P((chain_list *(*func)(), short oper, chain_list *expr));
|
||||
extern void mapExpr __P((void (*func)(), chain_list *expr));
|
||||
extern int anyExpr __P((int (*func)(), chain_list *expr));
|
||||
extern int everyExpr __P((int (*func)(), chain_list *expr));
|
||||
extern int searchOperExpr __P((chain_list *expr, short oper));
|
||||
extern short searchExprLow __P((chain_list *expr, char *name));
|
||||
extern int searchExpr __P((chain_list *expr, char *name));
|
||||
extern int equalExpr __P((chain_list *expr1, chain_list *expr2));
|
||||
extern int equalVarExpr __P((chain_list *expr1, chain_list *expr2));
|
||||
extern int lengthExpr __P((chain_list *expr));
|
||||
extern int numberOperBinExpr __P((chain_list *expr));
|
||||
extern int numberAtomExpr __P((chain_list *expr));
|
||||
extern chain_list * copyExpr __P((chain_list *expr));
|
||||
extern void substPhyExpr __P((chain_list *expr1, char *name, chain_list *expr2));
|
||||
extern chain_list * substExpr __P((chain_list *expr1, char *name, chain_list *expr2));
|
||||
extern chain_list * devXorExpr __P((chain_list *expr));
|
||||
extern chain_list * devXor2Expr __P((chain_list *expr));
|
||||
extern chain_list * flatPolarityExpr __P((chain_list *expr, int signe));
|
||||
extern void flatArityExpr __P((chain_list *expr));
|
||||
extern void supportChain_listExprInt __P((chain_list *expr, chain_list **ppCL));
|
||||
extern chain_list * supportChain_listExpr __P((chain_list *expr));
|
||||
extern void supportPtype_listExprInt __P((chain_list *expr, ptype_list **ppCL));
|
||||
extern ptype_list * supportPtype_listExpr __P((chain_list *expr));
|
||||
extern chain_list * maxExpr __P((chain_list *expr, int (*func)()));
|
||||
extern chain_list * minExpr __P((chain_list *expr, int (*func)()));
|
||||
extern void sortExpr __P((chain_list *expr, long (*func)(), int direction));
|
||||
extern int funcNormExpr __P((chain_list *expr));
|
||||
extern void normExpr __P((chain_list *expr));
|
||||
extern void deleteNumExpr __P((chain_list *expr, int i));
|
||||
extern chain_list * searchNumExpr __P((chain_list *expr, int i));
|
||||
extern int numberOccExpr __P((chain_list *exp, char *name));
|
||||
extern void changeOperExpr __P((chain_list *expr, short oper));
|
||||
extern chain_list * simplif10Expr __P((chain_list *expr));
|
||||
extern chain_list * simplifNotExpr __P((chain_list *exp));
|
||||
extern chain_list * charToExprInt __P((char *stringExpr, int *cptCar));
|
||||
extern chain_list * charToExpr __P((char *stringExpr));
|
||||
extern char * tokenExpr __P((char *stringExpr, int *cptCar));
|
||||
extern int PMExprInt __P((chain_list *expr, chain_list *pattern, ptype_list **bind));
|
||||
extern int PMExpr __P((chain_list *expr, chain_list *pattern));
|
||||
|
||||
|
||||
/* Prototypes from log_thash.c */
|
||||
|
||||
extern int hashTH __P((char *pn));
|
||||
extern pTH createTH __P((int len));
|
||||
extern void destroyTH __P((pTH pTable));
|
||||
extern int searchTH __P((pTH pTable, char *key));
|
||||
extern int addTH __P((pTH pTable, char *key, int value));
|
||||
extern int addExistTH __P((pTH pTable, char *key, int value));
|
||||
extern int deleteTH __P((pTH pTable, char *key));
|
||||
extern void displayTH __P((pTH pTable));
|
||||
extern void reAllocTH __P((pTH pTable));
|
||||
|
||||
|
||||
/* Prototypes from log_thashbdd.c */
|
||||
|
||||
extern int hashBdd __P((int index, pNode high, pNode low));
|
||||
extern int newKeyBdd __P((int index, pNode high, pNode low));
|
||||
extern pTableBdd createTableBdd __P((int len));
|
||||
extern void destroyTableBdd __P((pTableBdd pTab));
|
||||
extern pTableBdd reAllocTableBdd __P((pTableBdd pTab));
|
||||
extern pNode searchTableBdd __P((pTableBdd pTab, int index, pNode high, pNode low));
|
||||
extern int addTableBdd __P((pTableBdd pTab, pNode pBdd));
|
||||
extern int deleteTableBdd __P((pTableBdd pTab, pNode pBdd));
|
||||
extern void displayHashBdd __P((pTableBdd pTab));
|
||||
|
||||
|
||||
/* Prototypes from log_thashloc.c */
|
||||
|
||||
extern int hashLoc __P((pNode high, pNode low));
|
||||
extern pTableLoc createTabLoc __P((int len));
|
||||
extern void destroyTabLoc __P((pTableLoc pTab));
|
||||
extern pNode searchTabLoc __P((pTableLoc pTab, pNode high, pNode low, short oper));
|
||||
extern int addTabLoc __P((pTableLoc pTab, pNode high, pNode low, pNode father, short oper));
|
||||
extern void displayLoc __P((pTableLoc pTab));
|
||||
extern void videTabLoc __P((pTableLoc pTab));
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,739 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Tool : ABL, BDD, HT Librarie
|
||||
* Date : 1991,92
|
||||
* Author : Luc Burgun
|
||||
* Modified by Czo <Olivier.Sirol@lip6.fr> 1996,97
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ident "$Id: log_bdd1.c,v 1.1 2002/04/03 13:13:25 ludo Exp $"
|
||||
|
||||
|
||||
/****************************************************************************/
|
||||
/* Produit : librairie BDD - Gestion de BDD */
|
||||
/****************************************************************************/
|
||||
|
||||
#include<stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
initializeCct :cree un circuit .
|
||||
-------------------------------------------------------
|
||||
parametres :nom du circuit, nombre d'entrees et nombre de sorties .
|
||||
-------------------------------------------------------
|
||||
return :pointeur de circuit.
|
||||
------------------------------------------------------------------------------*/
|
||||
pCircuit
|
||||
initializeCct (name, nbI, nbO)
|
||||
char *name;
|
||||
int nbI, nbO;
|
||||
{
|
||||
pCircuit pC;
|
||||
char **pt;
|
||||
int i;
|
||||
/* on assure ... */
|
||||
nbI++;
|
||||
nbO++;
|
||||
|
||||
pC = (pCircuit) mbkalloc (sizeof (struct circuit));
|
||||
pC->countI = 2;
|
||||
pC->pTI = createTH (2 * nbI);
|
||||
pC->pTO = createTH (2 * nbO);
|
||||
pC->pNameI = (char **) mbkalloc (sizeof (char *) * 2 * nbI);
|
||||
pt = pC->pNameI;
|
||||
for (i = 0; i < 2 * nbI; i++)
|
||||
{
|
||||
*pt = NULL;
|
||||
pt++;
|
||||
}
|
||||
pC->name = name;
|
||||
return (pC);
|
||||
}
|
||||
/*------------------------------------------------------------------------------
|
||||
resetCct :vide un circuit .
|
||||
-------------------------------------------------------
|
||||
parametres :pointeur de circuit.
|
||||
-------------------------------------------------------
|
||||
return :rien.
|
||||
------------------------------------------------------------------------------*/
|
||||
void
|
||||
resetCct (pC)
|
||||
pCircuit pC;
|
||||
{
|
||||
pElemTH pEl;
|
||||
short i;
|
||||
char **pt;
|
||||
|
||||
pEl = (pC->pTI)->pElem;
|
||||
for (i = 0; i < (pC->pTI)->length; i++)
|
||||
{
|
||||
pEl->value = EMPTYTH;
|
||||
pEl++;
|
||||
}
|
||||
pEl = (pC->pTO)->pElem;
|
||||
for (i = 0; i < (pC->pTO)->length; i++)
|
||||
{
|
||||
pEl->value = EMPTYTH;
|
||||
pEl++;
|
||||
}
|
||||
pt = pC->pNameI;
|
||||
for (i = 0; i < (pC->pTI)->length; i++)
|
||||
{
|
||||
*pt = NULL;
|
||||
pt++;
|
||||
}
|
||||
pC->countI = 2;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
destroyCct :desalloue un circuit .
|
||||
-------------------------------------------------------
|
||||
parametres :pointeur de circuit.
|
||||
-------------------------------------------------------
|
||||
return :rien.
|
||||
------------------------------------------------------------------------------*/
|
||||
void
|
||||
destroyCct (pC)
|
||||
pCircuit pC;
|
||||
{
|
||||
destroyTH (pC->pTI);
|
||||
destroyTH (pC->pTO);
|
||||
mbkfree (pC->pNameI);
|
||||
mbkfree (pC);
|
||||
}
|
||||
/*------------------------------------------------------------------------------
|
||||
searchOutputCct :recherche le GDB associe a une sortie .
|
||||
-------------------------------------------------------
|
||||
parametres :un pointeur sur le circuit, et le nom de la sortie.
|
||||
-------------------------------------------------------
|
||||
return :pointeur de GDB ou null.
|
||||
------------------------------------------------------------------------------*/
|
||||
pNode
|
||||
searchOutputCct (pC, name)
|
||||
pCircuit pC;
|
||||
char *name;
|
||||
{
|
||||
int res;
|
||||
|
||||
if ((res = searchTH (pC->pTO, namealloc (name))) != EMPTYTH)
|
||||
return ((pNode) res);
|
||||
else
|
||||
return (NULL);
|
||||
}
|
||||
/*------------------------------------------------------------------------------
|
||||
addOutputCct :ajoute un GDB associe a une sortie .
|
||||
-------------------------------------------------------
|
||||
parametres :un pointeur sur le GDB,un pointeur de circuit, et le nom
|
||||
de la sortie.
|
||||
-------------------------------------------------------
|
||||
return :rien.
|
||||
------------------------------------------------------------------------------*/
|
||||
void
|
||||
addOutputCct (pC, name, pt)
|
||||
pCircuit pC;
|
||||
char *name;
|
||||
pNode pt;
|
||||
{
|
||||
name = namealloc (name);
|
||||
addTH (pC->pTO, name, (int)pt);
|
||||
}
|
||||
/*------------------------------------------------------------------------------
|
||||
searchIndexCct :recherche entree associe a un index .
|
||||
-------------------------------------------------------
|
||||
parametres :un pointeur sur le circuit, et l'index
|
||||
-------------------------------------------------------
|
||||
return : NULL ou le pointeur namealloc
|
||||
------------------------------------------------------------------------------*/
|
||||
char *
|
||||
searchIndexCct (pC, index)
|
||||
pCircuit pC;
|
||||
short index;
|
||||
{
|
||||
if (index <= pC->countI)
|
||||
return (*(pC->pNameI + index - 2));
|
||||
else
|
||||
return (NULL);
|
||||
}
|
||||
/*------------------------------------------------------------------------------
|
||||
searchInputCct :recherche index associe a une entree .
|
||||
-------------------------------------------------------
|
||||
parametres :un pointeur sur le circuit, et le nom de l' entree.
|
||||
-------------------------------------------------------
|
||||
return :index ou EMPTYTH.
|
||||
------------------------------------------------------------------------------*/
|
||||
short
|
||||
searchInputCct (pC, name)
|
||||
pCircuit pC;
|
||||
char *name;
|
||||
{
|
||||
int reallocTH;
|
||||
int resul;
|
||||
|
||||
reallocTH = (pC->pTI)->length;
|
||||
resul = searchTH (pC->pTI, namealloc (name));
|
||||
|
||||
/* on doit reallouer pNameI */
|
||||
|
||||
if (reallocTH != (pC->pTI)->length)
|
||||
{
|
||||
int i, j;
|
||||
char **pOldName = pC->pNameI;
|
||||
char **pOldSave = pC->pNameI;
|
||||
char **pt;
|
||||
|
||||
pC->pNameI = (char **) mbkalloc (sizeof (char *) * (pC->pTI)->length);
|
||||
pt = pC->pNameI;
|
||||
for (i = 0; i < (pC->pTI)->length && *pOldName != NULL; i++)
|
||||
{
|
||||
*pt = *pOldName;
|
||||
pt++;
|
||||
pOldName++;
|
||||
}
|
||||
|
||||
/* mise a null du reste de la table */
|
||||
|
||||
for (j = i; j < (pC->pTI)->length; j++)
|
||||
{
|
||||
*pt = NULL;
|
||||
pt++;
|
||||
}
|
||||
mbkfree (pOldSave);
|
||||
}
|
||||
return (resul);
|
||||
}
|
||||
/*------------------------------------------------------------------------------
|
||||
addInputCct :ajoute une entree dans la table des var_index.
|
||||
-------------------------------------------------------
|
||||
parametres :un pointeur de circuit, et le nom de la variable
|
||||
-------------------------------------------------------
|
||||
return :index.
|
||||
------------------------------------------------------------------------------*/
|
||||
short
|
||||
addInputCct (pC, name)
|
||||
pCircuit pC;
|
||||
char *name;
|
||||
{
|
||||
short index;
|
||||
char **ptName;
|
||||
|
||||
name = namealloc (name);
|
||||
if ((index = searchInputCct (pC, name)) != EMPTYTH)
|
||||
{
|
||||
createNodeTermBdd (index);
|
||||
return (index);
|
||||
}
|
||||
else
|
||||
{
|
||||
int reallocTH;
|
||||
|
||||
index = pC->countI;
|
||||
reallocTH = (pC->pTI)->length;
|
||||
addTH (pC->pTI, name, index);
|
||||
|
||||
/* on doit reallouer pNameI */
|
||||
|
||||
if (reallocTH != (pC->pTI)->length)
|
||||
{
|
||||
int i, j;
|
||||
char **pOldName = pC->pNameI;
|
||||
char **pOldSave = pC->pNameI;
|
||||
char **pt;
|
||||
|
||||
pC->pNameI = (char **) mbkalloc (sizeof (char *) * (pC->pTI)->length);
|
||||
pt = pC->pNameI;
|
||||
for (i = 0; i < (pC->pTI)->length && *pOldName != NULL; i++)
|
||||
{
|
||||
*pt = *pOldName;
|
||||
pt++;
|
||||
pOldName++;
|
||||
}
|
||||
|
||||
/* mise a null du reste de la table */
|
||||
|
||||
for (j = i; j < (pC->pTI)->length; j++)
|
||||
{
|
||||
*pt = NULL;
|
||||
pt++;
|
||||
}
|
||||
mbkfree (pOldSave);
|
||||
}
|
||||
ptName = pC->pNameI + pC->countI - 2; /* ajout du nom d'INPUT */
|
||||
*ptName = name;
|
||||
pC->countI++;
|
||||
createNodeTermBdd (index);
|
||||
return (index);
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------------------------
|
||||
delInputCct :detruit une entree dans la table des var_index.
|
||||
-------------------------------------------------------
|
||||
parametres :un pointeur de circuit, et le nom de la variable
|
||||
-------------------------------------------------------
|
||||
return : void.
|
||||
------------------------------------------------------------------------------*/
|
||||
void
|
||||
delInputCct (pC, name)
|
||||
pCircuit pC;
|
||||
char *name;
|
||||
{
|
||||
deleteTH (pC->pTI, name);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
displayCct :visualise le circuit .
|
||||
-------------------------------------------------------
|
||||
parametres :un pointeur de circuit.
|
||||
-------------------------------------------------------
|
||||
return :rien.
|
||||
------------------------------------------------------------------------------*/
|
||||
void
|
||||
displayCct (pC, mode)
|
||||
pCircuit pC;
|
||||
int mode;
|
||||
{
|
||||
pElemTH pEl;
|
||||
short i, cpt = 0;
|
||||
|
||||
pEl = (pC->pTI)->pElem;
|
||||
printf ("\n******* DISPLAY %s *******\n", pC->name);
|
||||
for (i = 0; i < (pC->pTI)->length; i++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
printf ("INPUT = %s INDEX = %d\n", pEl->key, pEl->value);
|
||||
pEl++;
|
||||
}
|
||||
printf ("\n------------- NUMBER OF INPUTS : %d\n\n", (pC->countI) - 2);
|
||||
pEl = (pC->pTO)->pElem;
|
||||
for (i = 0; i < (pC->pTO)->length; i++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
markBdd ((pNode)pEl->value, 0);
|
||||
pEl++;
|
||||
}
|
||||
pEl = (pC->pTO)->pElem;
|
||||
for (i = 0; i < (pC->pTO)->length; i++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
{
|
||||
cpt++;
|
||||
printf ("OUTPUT = %s", pEl->key);
|
||||
if (mode == 0)
|
||||
{
|
||||
printf (" BDD = %d\n", pEl->value);
|
||||
displayBddName (TRUE, (pNode)pEl->value, pC->pNameI);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("\n%s = ", pEl->key);
|
||||
displayExpr (bddToAbl ((pNode)pEl->value, pC->pNameI));
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
pEl++;
|
||||
}
|
||||
pEl = (pC->pTO)->pElem;
|
||||
for (i = 0; i < (pC->pTO)->length; i++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
markBdd ((pNode)pEl->value, 0);
|
||||
pEl++;
|
||||
}
|
||||
printf ("------------- NUMBER OF OUTPUTS : %d\n", cpt);
|
||||
printf ("**************************************\n\n");
|
||||
}
|
||||
/*------------------------------------------------------------------------------
|
||||
composeCct :compose tous les GDB de pC en expansant l'entree name .
|
||||
-------------------------------------------------------
|
||||
parametres :un pointeur de circuit,nom d'entree,le GDB associe.
|
||||
-------------------------------------------------------
|
||||
return :rien .
|
||||
------------------------------------------------------------------------------*/
|
||||
void
|
||||
composeCct (pC, name, pt)
|
||||
pCircuit pC;
|
||||
char *name;
|
||||
pNode pt;
|
||||
{
|
||||
int i;
|
||||
short index;
|
||||
pElemTH pEl;
|
||||
|
||||
pEl = (pC->pTO)->pElem; /* pointeur courant de la table pTI */
|
||||
index = searchInputCct (pC, name);
|
||||
if (index == EMPTYTH)
|
||||
{
|
||||
printf ("bdd1-composeCct : la variable a expanser n'est pas une entree\n");
|
||||
exit (-1);
|
||||
}
|
||||
for (i = 0; i < (pC->pTO)->length; i++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
pEl->value = (int) composeBdd ((pNode)pEl->value, pt, index);
|
||||
pEl++;
|
||||
}
|
||||
deleteTH (pC->pTI, name); /* on elimine name des INPUT */
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
constraintCct :contraint tous les GDB de pC avec le GDB pointe par pt .
|
||||
-------------------------------------------------------
|
||||
parametres :un pointeur de circuit,le GDB .
|
||||
-------------------------------------------------------
|
||||
return :rien .
|
||||
------------------------------------------------------------------------------*/
|
||||
void
|
||||
constraintCct (pC, pt)
|
||||
pCircuit pC;
|
||||
pNode pt;
|
||||
{
|
||||
int i;
|
||||
pElemTH pEl;
|
||||
|
||||
pEl = (pC->pTO)->pElem; /* pointeur courant de la table pTO */
|
||||
for (i = 0; i < (pC->pTO)->length; i++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
pEl->value = (int) constraintBdd ((pNode)pEl->value, pt);
|
||||
pEl++;
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------------------------
|
||||
proofCct :preuve formelle de circuits .
|
||||
-------------------------------------------------------
|
||||
parametres :deux pointeurs de circuits .
|
||||
-------------------------------------------------------
|
||||
return :rien .
|
||||
------------------------------------------------------------------------------*/
|
||||
void
|
||||
proofCct (pC1, pC2)
|
||||
pCircuit pC1, pC2;
|
||||
{
|
||||
pElemTH pEl;
|
||||
pNode noeudCC2;
|
||||
int i;
|
||||
short indexCC2;
|
||||
chain_list *expr;
|
||||
|
||||
printf ("\n\n******* PROOF between %s & %s *******\n", pC1->name, pC2->name);
|
||||
pEl = (pC1->pTI)->pElem; /* pointeur courant de la table pTI */
|
||||
for (i = 0; i < (pC1->pTI)->length; i++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
{
|
||||
/* recherche dans CC2 */
|
||||
|
||||
indexCC2 = searchTH (pC2->pTI, pEl->key);
|
||||
|
||||
|
||||
if (pEl->value != indexCC2)
|
||||
{
|
||||
printf ("INDEX (%s) differents pour les deux circuits\n", pEl->key);
|
||||
printf ("********** END OF PROOF **********\n\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pEl = (pC1->pTO)->pElem; /* pointeur courant de la table CC1 */
|
||||
|
||||
for (i = 0; i < (pC1->pTO)->length; i++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
{
|
||||
/* recherche dans CC2 */
|
||||
|
||||
noeudCC2 = (pNode) searchTH (pC2->pTO, pEl->key);
|
||||
|
||||
|
||||
if (noeudCC2 != (pNode) EMPTYTH)
|
||||
{
|
||||
printf ("OUTPUT %s ", pEl->key);
|
||||
if (noeudCC2 == (pNode) pEl->value)
|
||||
printf ("is equal\n");
|
||||
else
|
||||
{
|
||||
printf ("is different\n");
|
||||
printf ("%s = ", pEl->key);
|
||||
expr = bddToAbl ((pNode) pEl->value, pC1->pNameI);
|
||||
if (numberAtomExpr (expr) < 50)
|
||||
displayExpr (expr);
|
||||
else
|
||||
printf ("too small...");
|
||||
printf ("\n");
|
||||
printf ("%s = ", pEl->key);
|
||||
expr = bddToAbl (noeudCC2, pC2->pNameI);
|
||||
if (numberAtomExpr (expr) < 50)
|
||||
displayExpr (expr);
|
||||
else
|
||||
printf ("too small...");
|
||||
printf ("\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
pEl++;
|
||||
}
|
||||
printf ("********** END OF PROOF **********\n\n");
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
ablToBddCct :traduit la forme prefixee ABL en un GDB .
|
||||
-------------------------------------------------------
|
||||
parametres : un circuit et un pointeur d'ABL .
|
||||
-------------------------------------------------------
|
||||
return :GDB .
|
||||
------------------------------------------------------------------------------*/
|
||||
pNode
|
||||
ablToBddCct (pC, expr)
|
||||
pCircuit pC;
|
||||
chain_list *expr;
|
||||
{
|
||||
short oper;
|
||||
pNode pt;
|
||||
chain_list *lstGdb;
|
||||
|
||||
if (ATOM (expr))
|
||||
{
|
||||
if ((pt = searchOutputCct (pC, VALUE_ATOM (expr))) != NULL)
|
||||
return (pt);
|
||||
else
|
||||
{
|
||||
if (!strcmp (VALUE_ATOM (expr), "'0'"))
|
||||
return (zero);
|
||||
if (!strcmp (VALUE_ATOM (expr), "'d'"))
|
||||
return (zero);
|
||||
if (!strcmp (VALUE_ATOM (expr), "'1'"))
|
||||
return (one);
|
||||
pt = createNodeTermBdd (addInputCct (pC, VALUE_ATOM (expr)));
|
||||
return (pt);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
oper = OPER (expr);
|
||||
lstGdb = NULL;
|
||||
while ((expr = CDR (expr)))
|
||||
lstGdb = addListBdd (lstGdb, ablToBddCct (pC, CAR (expr)));
|
||||
pt = applyBdd (oper, lstGdb);
|
||||
freechain (lstGdb);
|
||||
return (pt);
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------------------------
|
||||
cpOrderCct :copie la table des index de CC1 dans CC2 .
|
||||
-------------------------------------------------------
|
||||
parametres :deux pointeurs de circuits.
|
||||
de la sortie.
|
||||
-------------------------------------------------------
|
||||
return :rien.
|
||||
------------------------------------------------------------------------------*/
|
||||
void
|
||||
cpOrderCct (CC1, CC2)
|
||||
pCircuit CC1, CC2;
|
||||
{
|
||||
int i;
|
||||
pElemTH pEl1;
|
||||
pElemTH pEl2;
|
||||
char **pt1, **pt2;
|
||||
pTH tab;
|
||||
|
||||
if (CC2->pTI->length != CC1->pTI->length)
|
||||
{
|
||||
tab = createTH ((CC1->pTI->length));
|
||||
destroyTH (CC2->pTI);
|
||||
CC2->pTI = tab;
|
||||
}
|
||||
pEl1 = (CC1->pTI)->pElem;
|
||||
pEl2 = (CC2->pTI)->pElem;
|
||||
for (i = 0; i < (CC1->pTI)->length; i++)
|
||||
{
|
||||
pEl2->value = pEl1->value;
|
||||
pEl2->key = pEl1->key;
|
||||
pEl1++;
|
||||
pEl2++;
|
||||
}
|
||||
CC2->pTI->count = CC1->pTI->count;
|
||||
CC2->countI = CC1->countI;
|
||||
pt1 = CC1->pNameI;
|
||||
pt2 = CC2->pNameI;
|
||||
for (i = 0; i < CC1->countI; i++)
|
||||
{
|
||||
*pt2 = *pt1;
|
||||
pt1++;
|
||||
pt2++;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
upVarCct : remontee d'une variable dans un circuit
|
||||
---------------------------------------------------------------------------
|
||||
retour : un void.
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
void
|
||||
upVarCct (pC, ptOldIndex, newIndex)
|
||||
pCircuit pC;
|
||||
pNode ptOldIndex;
|
||||
short newIndex;
|
||||
{
|
||||
int i;
|
||||
pElemTH pEl;
|
||||
|
||||
pEl = (pC->pTO)->pElem;
|
||||
for (i = 0; i < (pC->pTO)->length; i++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
pEl->value = (int) upVarBdd ((pNode)pEl->value, ptOldIndex, newIndex);
|
||||
pEl++;
|
||||
}
|
||||
deleteTH (pC->pTI, *(pC->pNameI + newIndex - 2));
|
||||
*(pC->pNameI + newIndex - 2) = *(pC->pNameI + ptOldIndex->index - 2);
|
||||
addTH (pC->pTI, *(pC->pNameI + ptOldIndex->index - 2), newIndex);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
numberNodeCct : calcule le nombre de noeud d'un circuit
|
||||
---------------------------------------------------------------------------
|
||||
retour : un entier.
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
numberNodeCct (pC)
|
||||
pCircuit pC;
|
||||
{
|
||||
pElemTH pEl;
|
||||
int i, number_node;
|
||||
|
||||
number_node = 0;
|
||||
markAllBdd (0);
|
||||
pEl = (pC->pTO)->pElem;
|
||||
for (i = 0; i < (pC->pTO)->length; i++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
{
|
||||
number_node = number_node + countNode ((pNode) pEl->value);
|
||||
}
|
||||
pEl++;
|
||||
}
|
||||
markAllBdd (0);
|
||||
return (number_node);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
numberNodeTdgCct : calcule le nombre de noeud equivalent TDG d'un circuit
|
||||
---------------------------------------------------------------------------
|
||||
retour : un entier.
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
int
|
||||
numberNodeTdgCct (pC)
|
||||
pCircuit pC;
|
||||
{
|
||||
pElemTH pEl;
|
||||
int i, number_node;
|
||||
|
||||
number_node = 0;
|
||||
markAllBdd (0);
|
||||
pEl = (pC->pTO)->pElem;
|
||||
for (i = 0; i < (pC->pTO)->length; i++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
{
|
||||
number_node = number_node + countNodeTdg ((pNode) pEl->value);
|
||||
}
|
||||
pEl++;
|
||||
}
|
||||
markAllBdd (0);
|
||||
return (number_node);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
bddToAblCct :traduit un BDD en ABL d'une maniere simplifie.
|
||||
-------------------------------------------------------
|
||||
parametres :un pointeur de NODE.
|
||||
-------------------------------------------------------
|
||||
return :une pointeur de CHAIN_LIST.
|
||||
------------------------------------------------------------------------------*/
|
||||
chain_list *
|
||||
bddToAblCct (pC, pBdd)
|
||||
pCircuit pC;
|
||||
pNode pBdd;
|
||||
{
|
||||
return (bddToAbl (pBdd, pC->pNameI));
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
gcNodeCct :effectue un garbage collecteur sur tous les noeuds de systeme
|
||||
en sauvegardant les noeuds pointes par les pNode(s) du circuit.
|
||||
-------------------------------------------------------
|
||||
parametres : pointeur de chain_list.
|
||||
-------------------------------------------------------
|
||||
return : 1 si ok ;
|
||||
0 si erreur .
|
||||
------------------------------------------------------------------------------*/
|
||||
void
|
||||
gcNodeCct (pC)
|
||||
pCircuit pC;
|
||||
{
|
||||
struct systemBdd sysBddAux;
|
||||
pNode zeroAux, oneAux;
|
||||
pTH pTHNode;
|
||||
pElemTH pEl;
|
||||
int j;
|
||||
|
||||
pTHNode = createTH (MEDIUM);
|
||||
sysBddAux.pRT = createTableBdd (MEDIUM);
|
||||
sysBddAux.pMC = createTabLoc (MEDIUM);
|
||||
sysBddAux.indiceAT = MAX_PACK;
|
||||
sysBddAux.lpAT = NULL;
|
||||
zeroAux = initVertexBddAux (0, (pNode) 0, (pNode) 1, &sysBddAux);
|
||||
oneAux = initVertexBddAux (1, (pNode) 0, (pNode) 1, &sysBddAux);
|
||||
addTH (pTHNode, (char *)zero, (int) zeroAux);
|
||||
addTH (pTHNode, (char *)one, (int) oneAux);
|
||||
|
||||
|
||||
/* on regenere les graphes */
|
||||
|
||||
pEl = (pC->pTO)->pElem;
|
||||
for (j = 0; j < (pC->pTO)->length; j++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
pEl->value = (int) regenereBdd ((pNode) pEl->value, &sysBddAux, pTHNode);
|
||||
pEl++;
|
||||
}
|
||||
|
||||
destroyBdd (1);
|
||||
destroyTH (pTHNode);
|
||||
sysBdd.pRT = sysBddAux.pRT;
|
||||
sysBdd.pMC = sysBddAux.pMC;
|
||||
sysBdd.indiceAT = sysBddAux.indiceAT;
|
||||
sysBdd.lpAT = sysBddAux.lpAT;
|
||||
sysBdd.pAT = sysBddAux.pAT;
|
||||
zero = zeroAux;
|
||||
one = oneAux;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,379 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Tool : ABL, BDD, HT Librarie
|
||||
* Date : 1991,92
|
||||
* Author : Luc Burgun
|
||||
* Modified by Czo <Olivier.Sirol@lip6.fr> 1996,97
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
#ident "$Id: log_thash.c,v 1.1 2002/04/03 13:13:25 ludo Exp $"
|
||||
|
||||
/****************************************************************************/
|
||||
/* Produit : librairie TSH - Gestion de tables de hachage */
|
||||
/****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
|
||||
#undef MAX_CALLS
|
||||
#define MAX_CALLS 20
|
||||
|
||||
/* les fonction de l'utilisateurs :
|
||||
------------------------------
|
||||
|
||||
a. creation de table
|
||||
|
||||
pTH createTH(len)
|
||||
int len;
|
||||
|
||||
b. destruction de la table
|
||||
|
||||
destroyTH(pTable)
|
||||
pTH pTable;
|
||||
|
||||
c. recherche d'un element
|
||||
|
||||
int searchTH(pTable,key)
|
||||
pTH pTable;
|
||||
char *key;
|
||||
|
||||
d. ajout d'un element (ecrasement de la valeur s'il existe deja un element
|
||||
dans la table possedant la meme cle)
|
||||
|
||||
int addTH(pTable,key,value)
|
||||
pTH pTable;
|
||||
char *key;
|
||||
int value;
|
||||
|
||||
e. test d'existence et ajout d'un element dans la table.( renvoie 0 si
|
||||
l'element n'existait pas avant son ajout, 1 sinon).
|
||||
|
||||
int addExistTH(pTable,key,value)
|
||||
pTH pTable;
|
||||
char *key;
|
||||
int value;
|
||||
|
||||
f. destruction d'un element
|
||||
|
||||
int deleteTH(pTable,key)
|
||||
pTH pTable;
|
||||
char *key;
|
||||
|
||||
g. affichage total d'une table avec la cle en %s et la valeur en %d.
|
||||
|
||||
void displayTH(pTable)
|
||||
pTH pTable;
|
||||
|
||||
h. reallocation d'une table
|
||||
|
||||
void reAllocTH(pTable)
|
||||
pTH pTable ;
|
||||
*/
|
||||
|
||||
/*--------------- la fonction de base pour le hachage.---------------- */
|
||||
|
||||
|
||||
int
|
||||
hashTH (pn)
|
||||
char *pn;
|
||||
{
|
||||
|
||||
/* return(abs((int) pn * ((int) pn >> 5) >> 4)); */
|
||||
return (((unsigned long) pn >> 2));
|
||||
|
||||
}
|
||||
|
||||
/* creation d'une table de hachage */
|
||||
|
||||
pTH
|
||||
createTH (len)
|
||||
int len;
|
||||
{
|
||||
pTH pTable;
|
||||
pElemTH pEl;
|
||||
int i;
|
||||
|
||||
if (len <= 0)
|
||||
{
|
||||
printf ("createTH : error - length <= 0\n");
|
||||
exit (-1);
|
||||
}
|
||||
pTable = (pTH) mbkalloc (sizeof (struct tableTH));
|
||||
pTable->length = len;
|
||||
|
||||
pEl = (pElemTH) mbkalloc (len * (sizeof (struct elemTH)));
|
||||
pTable->pElem = pEl;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
pEl->key = NULL;
|
||||
pEl->value = EMPTYTH;
|
||||
pEl++;
|
||||
}
|
||||
pTable->count = 0;
|
||||
return (pTable);
|
||||
}
|
||||
|
||||
/* destruction d'une table de hachage */
|
||||
|
||||
void
|
||||
destroyTH (pTable)
|
||||
pTH pTable;
|
||||
{
|
||||
pElemTH pEl;
|
||||
|
||||
pEl = pTable->pElem;
|
||||
mbkfree (pEl);
|
||||
mbkfree (pTable);
|
||||
}
|
||||
|
||||
/* recherche d'un element dans la table
|
||||
renvoie -1 si la recherche echoue. */
|
||||
|
||||
|
||||
int
|
||||
searchTH (pTable, key)
|
||||
pTH pTable;
|
||||
char *key;
|
||||
{
|
||||
int co = 0;
|
||||
int indice = 0;
|
||||
pElemTH pEl;
|
||||
|
||||
indice = hashTH (key) % pTable->length;
|
||||
do
|
||||
{
|
||||
if (co++ > MAX_CALLS)
|
||||
{
|
||||
reAllocTH (pTable);
|
||||
return (searchTH (pTable, key));
|
||||
}
|
||||
|
||||
pEl = (pTable->pElem) + indice;
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
{
|
||||
if ((int) key == (int) pEl->key)
|
||||
return (pEl->value);
|
||||
}
|
||||
else if (pEl->value == EMPTYTH)
|
||||
return (EMPTYTH);
|
||||
indice = (indice + 1) % pTable->length;
|
||||
}
|
||||
while (1);
|
||||
}
|
||||
|
||||
|
||||
/* ajout d'un element a la table */
|
||||
|
||||
int
|
||||
addTH (pTable, key, value)
|
||||
pTH pTable;
|
||||
char *key;
|
||||
int value;
|
||||
{
|
||||
int indice = 0;
|
||||
pElemTH pEl;
|
||||
int co = 0;
|
||||
|
||||
if (value == EMPTYTH || value == DELETETH)
|
||||
{
|
||||
printf ("addTH : error - value is EMPTYTH or DELETETH\n");
|
||||
exit (-1);
|
||||
}
|
||||
if (pTable->count++ > (pTable->length) * 8 / 10)
|
||||
{
|
||||
reAllocTH (pTable);
|
||||
return (addTH (pTable, key, value));
|
||||
}
|
||||
|
||||
indice = hashTH (key) % pTable->length;
|
||||
do
|
||||
{
|
||||
if (co++ > MAX_CALLS)
|
||||
{
|
||||
reAllocTH (pTable);
|
||||
return (addTH (pTable, key, value));
|
||||
}
|
||||
pEl = (pTable->pElem) + indice;
|
||||
if (pEl->value == EMPTYTH || pEl->value == DELETETH)
|
||||
{
|
||||
pEl->value = value;
|
||||
pEl->key = key;
|
||||
return (value);
|
||||
}
|
||||
else if ((int) pEl->key == (int) key)
|
||||
{
|
||||
pTable->count--;
|
||||
pEl->value = value;
|
||||
return (value);
|
||||
}
|
||||
|
||||
indice = (indice + 1) % pTable->length;
|
||||
}
|
||||
while (1);
|
||||
}
|
||||
|
||||
/* test d'existence et ajout d'un element a la table */
|
||||
|
||||
int
|
||||
addExistTH (pTable, key, value)
|
||||
pTH pTable;
|
||||
char *key;
|
||||
int value;
|
||||
{
|
||||
int indice = 0;
|
||||
pElemTH pEl;
|
||||
int co = 0;
|
||||
|
||||
if (value == EMPTYTH || value == DELETETH)
|
||||
{
|
||||
printf ("addExistTH : error - value is EMPTYTH or DELETETH\n");
|
||||
exit (-1);
|
||||
}
|
||||
if (pTable->count++ > (pTable->length) * 8 / 10)
|
||||
{
|
||||
reAllocTH (pTable);
|
||||
return (addExistTH (pTable, key, value));
|
||||
}
|
||||
|
||||
indice = hashTH (key) % pTable->length;
|
||||
do
|
||||
{
|
||||
if (co++ > MAX_CALLS)
|
||||
{
|
||||
reAllocTH (pTable);
|
||||
return (addExistTH (pTable, key, value));
|
||||
}
|
||||
pEl = (pTable->pElem) + indice;
|
||||
if (pEl->value == EMPTYTH || pEl->value == DELETETH)
|
||||
{
|
||||
pEl->value = value;
|
||||
pEl->key = key;
|
||||
return (0);
|
||||
}
|
||||
else if ((int) pEl->key == (int) key)
|
||||
{
|
||||
pTable->count--;
|
||||
pEl->value = value;
|
||||
return (1);
|
||||
}
|
||||
|
||||
indice = (indice + 1) % pTable->length;
|
||||
}
|
||||
while (1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* elimination d'un element de la table */
|
||||
|
||||
|
||||
int
|
||||
deleteTH (pTable, key)
|
||||
pTH pTable;
|
||||
char *key;
|
||||
{
|
||||
int indice = 0;
|
||||
pElemTH pEl;
|
||||
int co = 0;
|
||||
|
||||
indice = hashTH (key) % pTable->length;
|
||||
do
|
||||
{
|
||||
if (co++ > MAX_CALLS)
|
||||
{
|
||||
reAllocTH (pTable);
|
||||
return (deleteTH (pTable, key));
|
||||
}
|
||||
pEl = (pTable->pElem) + indice;
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
{
|
||||
if ((int) key == (int) pEl->key)
|
||||
{
|
||||
pTable->count--;
|
||||
pEl->value = DELETETH;
|
||||
return (pEl->value);
|
||||
}
|
||||
}
|
||||
else if (pEl->value == EMPTYTH)
|
||||
return (EMPTYTH);
|
||||
indice = (indice + 1) % pTable->length;
|
||||
}
|
||||
while (1); /* on sort quand on arrive sur EMPTYTH */
|
||||
}
|
||||
|
||||
|
||||
/* affichage des elements de la table */
|
||||
|
||||
void
|
||||
displayTH (pTable)
|
||||
pTH pTable;
|
||||
{
|
||||
int i;
|
||||
pElemTH pEl;
|
||||
pEl = pTable->pElem;
|
||||
printf ("================== DISPLAYTH ================\n");
|
||||
printf ("length = %d\t count = %d\n", pTable->length, pTable->count);
|
||||
printf ("=============================================\n");
|
||||
for (i = 0; i < pTable->length; i++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
{
|
||||
printf ("index %d\t", i);
|
||||
printf ("key %s\t", pEl->key);
|
||||
printf ("value %d \n", pEl->value);
|
||||
}
|
||||
pEl++;
|
||||
}
|
||||
}
|
||||
|
||||
/********** reallocation table d'entiers **************/
|
||||
|
||||
void
|
||||
reAllocTH (pTable)
|
||||
pTH pTable;
|
||||
{
|
||||
pTH tabBis;
|
||||
pElemTH pEl;
|
||||
int i;
|
||||
|
||||
pEl = pTable->pElem;
|
||||
tabBis = createTH ((pTable->length) * 5);
|
||||
for (i = 0; i < pTable->length; i++)
|
||||
{
|
||||
if (pEl->value != EMPTYTH && pEl->value != DELETETH)
|
||||
addTH (tabBis, pEl->key, pEl->value);
|
||||
pEl++;
|
||||
}
|
||||
mbkfree (pTable->pElem);
|
||||
pTable->length = tabBis->length;
|
||||
pTable->pElem = tabBis->pElem;
|
||||
pTable->count = tabBis->count;
|
||||
mbkfree (tabBis);
|
||||
}
|
|
@ -0,0 +1,352 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Tool : ABL, BDD, HT Librarie
|
||||
* Date : 1991,92
|
||||
* Author : Luc Burgun
|
||||
* Modified by Czo <Olivier.Sirol@lip6.fr> 1996,97
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ident "$Id: log_thashbdd.c,v 1.1 2002/04/03 13:13:25 ludo Exp $"
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
la table de hachage des BDD
|
||||
la version du 10.12.90
|
||||
-------------------------------------------------------------------------- */
|
||||
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
|
||||
#undef NB_APPEL_MAX
|
||||
#define NB_APPEL_MAX 50
|
||||
|
||||
/* les fonction de l'utilisateurs :
|
||||
------------------------------
|
||||
|
||||
initialisation au depart des pointeurs de vertex a NULL.
|
||||
un pointeur de Vertex desalloue est mis a BDDDELETE.
|
||||
Les fonctions qui utilisent le hachage peuvent renvoye BDDTABLE_PLEINE
|
||||
si la table est trop remplie.
|
||||
|
||||
a. creation de table
|
||||
|
||||
pTableBdd createTableBdd(len)
|
||||
int len;
|
||||
|
||||
b. destruction de la table
|
||||
|
||||
destroyTableBdd(pTab)
|
||||
pTableBdd pTab;
|
||||
|
||||
c. re-allocation d'une table de hachage
|
||||
|
||||
reAllocTableBdd(pTab)
|
||||
pTableBdd pTab;
|
||||
|
||||
d. recherche d'un element
|
||||
|
||||
pNode searchTableBdd(pTab,index,high,low)
|
||||
pTableBdd pTab;
|
||||
int index;
|
||||
pNode high,low;
|
||||
|
||||
e. ajout d'un element
|
||||
|
||||
int addTableBdd(pTab,pBdd)
|
||||
pTableBdd pTab;
|
||||
pNode pBdd;
|
||||
|
||||
f. destruction d'un element
|
||||
|
||||
int deleteTableBdd(pTab,key)
|
||||
pTableBdd pTab;
|
||||
pNode pBdd;
|
||||
|
||||
g. affichage total d'une table
|
||||
|
||||
void displayBdd(pTab)
|
||||
pTableBdd pTab;
|
||||
|
||||
h. le garbage collector d'une table de hachage
|
||||
|
||||
void gcTableBdd(pTab);
|
||||
pTableBdd pTab;
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*-------------------- la fonction de hachage ---------------------------- */
|
||||
|
||||
int
|
||||
hashBdd (index, high, low)
|
||||
int index;
|
||||
pNode high, low;
|
||||
{
|
||||
return (abs (index + ((int) high << 1) + (int) low +
|
||||
((int) high >> 4) + ((int) low >> 5)));
|
||||
}
|
||||
|
||||
/*--------------- la fonction de changement de cle ------------------------- */
|
||||
|
||||
int
|
||||
newKeyBdd (index, high, low)
|
||||
int index;
|
||||
pNode high, low;
|
||||
{
|
||||
return (index + (index << 2) + (int) high + ((int) low << 1));
|
||||
}
|
||||
|
||||
/*--------------- La table de hachage pour des BDD ------------ */
|
||||
|
||||
/* la fonction de creation de table de hachage pour les BDD .
|
||||
On alloue en premier lieu une structure TABLE, puis une table
|
||||
qui n'est rien d'autre qu'un tableau de pointeurs de BDD. Il est
|
||||
donc possible de travailler avec plusieurs tables a la fois. */
|
||||
|
||||
pTableBdd
|
||||
createTableBdd (len)
|
||||
int len;
|
||||
{
|
||||
pTableBdd pTab;
|
||||
pNode *pBdd;
|
||||
int i;
|
||||
|
||||
if (!(pTab = (pTableBdd) mbkalloc (sizeof (struct tableBdd))))
|
||||
{
|
||||
printf ("impossible allocation\n");
|
||||
exit (-1);
|
||||
}
|
||||
pTab->lenTableBdd = len;
|
||||
|
||||
if (!(pBdd = (pNode *) mbkalloc (len * sizeof (pNode))))
|
||||
{
|
||||
printf ("impossible allocation\n");
|
||||
exit (-1);
|
||||
}
|
||||
pTab->pBdd = pBdd;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
*pBdd = NULL;
|
||||
pBdd++;
|
||||
}
|
||||
pTab->compteur = 0;
|
||||
return (pTab);
|
||||
}
|
||||
|
||||
/* destruction d'une table de hachage */
|
||||
|
||||
void
|
||||
destroyTableBdd (pTab)
|
||||
pTableBdd pTab;
|
||||
{
|
||||
pNode *pBdd;
|
||||
|
||||
pBdd = pTab->pBdd;
|
||||
mbkfree (pBdd);
|
||||
mbkfree (pTab);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
markBddLst :met a jour les marques de l'ensemble des graphes de LstGdb.
|
||||
-------------------------------------------------------
|
||||
parametres :une liste LstGdb.
|
||||
-------------------------------------------------------
|
||||
return :rien.
|
||||
------------------------------------------------------------------------------*/
|
||||
/*
|
||||
void markBddLst(pC,value)
|
||||
pCircuit pC;
|
||||
int value;
|
||||
{
|
||||
pNode pBdd;
|
||||
|
||||
pEl = (pC->pTO)->pElemT ;
|
||||
|
||||
for (i =0 ; i < (pC->pTO)->lenTable; i++)
|
||||
{
|
||||
if(pEl->value != VIDE && pEl->value != DELETE)
|
||||
markBdd((pNode)pEl->value) ;
|
||||
pEl++ ;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
/* re-allocation d'une table de hachage devenue trop petite... */
|
||||
|
||||
pTableBdd
|
||||
reAllocTableBdd (pTab)
|
||||
pTableBdd pTab;
|
||||
{
|
||||
int i;
|
||||
pNode *pBdd;
|
||||
pTableBdd pTabBis;
|
||||
|
||||
if (pTab->lenTableBdd > MAX_SIZE_BDD)
|
||||
{
|
||||
printf ("BDD's system : not enough memory...\n");
|
||||
exit (-1);
|
||||
}
|
||||
pTabBis = createTableBdd (pTab->lenTableBdd * 3); /* trois fois plus grande */
|
||||
pBdd = pTab->pBdd;
|
||||
for (i = 0; i < pTab->lenTableBdd; i++)
|
||||
{
|
||||
if (*pBdd != NULL && *pBdd != BDDDELETE) /* la recopie */
|
||||
addTableBdd (pTabBis, *pBdd);
|
||||
pBdd++;
|
||||
}
|
||||
destroyTableBdd (pTab);
|
||||
return (pTabBis);
|
||||
}
|
||||
|
||||
/* recherche d'un element dans la table
|
||||
renvoie NULL si la recherche echoue. */
|
||||
|
||||
pNode
|
||||
searchTableBdd (pTab, index, high, low)
|
||||
pTableBdd pTab;
|
||||
int index;
|
||||
pNode high, low;
|
||||
{
|
||||
int co = 0;
|
||||
pNode pBddCur;
|
||||
int key = index;
|
||||
int indice;
|
||||
|
||||
do
|
||||
{
|
||||
if (co++ > NB_APPEL_MAX)
|
||||
return (BDDTABLE_PLEINE);
|
||||
indice = hashBdd (key, high, low) % pTab->lenTableBdd;
|
||||
pBddCur = *((pTab->pBdd) + indice);
|
||||
if (pBddCur != NULL && pBddCur != BDDDELETE)
|
||||
if (high == pBddCur->high &&
|
||||
low == pBddCur->low &&
|
||||
index == pBddCur->index)
|
||||
return (pBddCur);
|
||||
key = newKeyBdd (key, high, low);
|
||||
}
|
||||
while (pBddCur != NULL);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* ajout d'un element a la table */
|
||||
|
||||
|
||||
int
|
||||
addTableBdd (pTab, pBdd)
|
||||
pTableBdd pTab;
|
||||
pNode pBdd;
|
||||
{
|
||||
int co = 0;
|
||||
pNode *pBddCur;
|
||||
int index = pBdd->index;
|
||||
pNode high = pBdd->high;
|
||||
pNode low = pBdd->low;
|
||||
int key = index;
|
||||
int indice;
|
||||
|
||||
if (pTab->compteur++ > (pTab->lenTableBdd) * 8 / 10) /* remplissage au 8/10 */
|
||||
return (TABLE_PLEINE);
|
||||
do
|
||||
{
|
||||
if (co++ > NB_APPEL_MAX)
|
||||
return (TABLE_PLEINE);
|
||||
indice = hashBdd (key, high, low) % pTab->lenTableBdd;
|
||||
pBddCur = ((pTab->pBdd) + indice);
|
||||
if (*pBddCur == NULL || *pBddCur == BDDDELETE)
|
||||
{
|
||||
*pBddCur = pBdd;
|
||||
return (indice); /* retourne la place utilisee */
|
||||
}
|
||||
key = newKeyBdd (key, high, low);
|
||||
}
|
||||
while (1);
|
||||
}
|
||||
|
||||
|
||||
/* elimination d'un element de la table */
|
||||
|
||||
|
||||
int
|
||||
deleteTableBdd (pTab, pBdd)
|
||||
pTableBdd pTab;
|
||||
pNode pBdd;
|
||||
{
|
||||
int co = 0;
|
||||
pNode *pBddCur;
|
||||
pNode high = pBdd->high;
|
||||
pNode low = pBdd->low;
|
||||
int key = pBdd->index;
|
||||
int indice;
|
||||
|
||||
do
|
||||
{
|
||||
if (co++ > NB_APPEL_MAX)
|
||||
return (TABLE_PLEINE);
|
||||
indice = hashBdd (key, high, low) % pTab->lenTableBdd;
|
||||
pBddCur = (pTab->pBdd) + indice;
|
||||
if (*pBddCur != NULL && *pBddCur != BDDDELETE)
|
||||
{
|
||||
if (pBdd == *pBddCur)
|
||||
{
|
||||
*pBddCur = BDDDELETE;
|
||||
return (DELETE);
|
||||
}
|
||||
}
|
||||
key = newKeyBdd (key, high, low);
|
||||
}
|
||||
while (pBddCur != NULL);
|
||||
return ((int) NULL);
|
||||
}
|
||||
|
||||
/* affichage des elements de la table */
|
||||
|
||||
void
|
||||
displayHashBdd (pTab)
|
||||
pTableBdd pTab;
|
||||
{
|
||||
int i;
|
||||
int co = 0;
|
||||
pNode *pBdd;
|
||||
|
||||
pBdd = pTab->pBdd;
|
||||
{
|
||||
printf ("\n---------------------------------------------------------------");
|
||||
printf ("---------\n AFFICHAGE DE LA TABLE DE HACHAGE\n\n");
|
||||
}
|
||||
for (i = 0; i < pTab->lenTableBdd; i++)
|
||||
{
|
||||
if (*pBdd != NULL && *pBdd != BDDDELETE)
|
||||
{
|
||||
co++;
|
||||
printf ("****** indice %d ****** \n", i);
|
||||
displayBdd (*pBdd , FALSE);
|
||||
printf ("\n");
|
||||
}
|
||||
pBdd++;
|
||||
}
|
||||
printf ("\n****** Nombre de noeuds dans la table = %d\n", co);
|
||||
}
|
|
@ -0,0 +1,241 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This progam is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Tool : ABL, BDD, HT Librarie
|
||||
* Date : 1991,92
|
||||
* Author : Luc Burgun
|
||||
* Modified by Czo <Olivier.Sirol@lip6.fr> 1996,97
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ident "$Id: log_thashloc.c,v 1.1 2002/04/03 13:13:25 ludo Exp $"
|
||||
|
||||
/*--------------------------------------------------------------------------
|
||||
la table de hachage local
|
||||
la version du 14.12.90
|
||||
-------------------------------------------------------------------------- */
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
|
||||
|
||||
/* les fonction de l'utilisateurs :
|
||||
------------------------------
|
||||
|
||||
initialisation au depart des pointeurs de vertex a NULL.
|
||||
Les fonctions qui utilisent le hachage peuvent renvoye DDBTABLE_PLEINE
|
||||
si la table est trop remplie.
|
||||
Il n'y a pas de destruction possible d'un element.
|
||||
|
||||
a. creation de table
|
||||
|
||||
pTableLoc createTabLoc(len)
|
||||
int len;
|
||||
|
||||
b. destruction de la table
|
||||
|
||||
void destroyTabLoc(pTab)
|
||||
pTableLoc pTab;
|
||||
|
||||
c. re-allocation d'une table de hachage
|
||||
|
||||
reAllocTabLoc(pTab)
|
||||
pTableLoc pTab;
|
||||
|
||||
d. recherche d'un element
|
||||
|
||||
pNode searchTabLoc(pTab,high,low)
|
||||
pTableLoc pTab;
|
||||
pVertexLoc high,low;
|
||||
|
||||
e. ajout d'un element
|
||||
|
||||
int addTabLoc(pTab,pLoc)
|
||||
pTableLoc pTab;
|
||||
pVertexLoc pLoc;
|
||||
|
||||
f. affichage total d'une table
|
||||
|
||||
void displayLoc(pTab)
|
||||
pTableLoc pTab;
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/*-------------------- la fonction de hachage ---------------------------- */
|
||||
|
||||
int
|
||||
hashLoc (high, low)
|
||||
pNode high, low;
|
||||
{
|
||||
return (abs (high->index + low->index +
|
||||
(((int) high) >> 4) + (((int) low) >> 5) +
|
||||
(int) high + (int) low));
|
||||
}
|
||||
|
||||
/*--------------- La table de hachage pour des LOC ------------ */
|
||||
|
||||
/* la fonction de creation de table de hachage pour les LOC .
|
||||
On alloue en premier lieu une structure TABLE, puis une table
|
||||
qui n'est rien d'autre qu'un tableau de pointeurs de LOC. Il est
|
||||
donc possible de travailler avec plusieurs table a la fois. */
|
||||
|
||||
pTableLoc
|
||||
createTabLoc (len)
|
||||
int len;
|
||||
{
|
||||
pTableLoc pTab;
|
||||
pVertexLoc pLoc;
|
||||
int i;
|
||||
|
||||
if (!(pTab = (pTableLoc) mbkalloc (sizeof (struct tableLoc))))
|
||||
{
|
||||
printf ("allocation impossible\n");
|
||||
exit (-1);
|
||||
}
|
||||
pTab->lenTabLoc = len;
|
||||
|
||||
if (!(pLoc = (pVertexLoc) mbkalloc (len * sizeof (struct vertexLoc))))
|
||||
{
|
||||
printf ("allocation impossible\n");
|
||||
exit (-1);
|
||||
}
|
||||
pTab->pLoc = pLoc;
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
pLoc->oper = EMPTYTH; /* -1 */
|
||||
pLoc++;
|
||||
}
|
||||
return (pTab);
|
||||
}
|
||||
|
||||
/* destruction d'une table de hachage */
|
||||
|
||||
void
|
||||
destroyTabLoc (pTab)
|
||||
pTableLoc pTab;
|
||||
{
|
||||
mbkfree (pTab->pLoc);
|
||||
mbkfree (pTab);
|
||||
}
|
||||
|
||||
/* recherche d'un element dans la table
|
||||
renvoie NULL si la recherche echoue. */
|
||||
|
||||
pNode
|
||||
searchTabLoc (pTab, high, low, oper)
|
||||
pTableLoc pTab;
|
||||
pNode high, low;
|
||||
short oper;
|
||||
{
|
||||
pVertexLoc pLoc;
|
||||
int indice;
|
||||
|
||||
/* un seul acces permis */
|
||||
|
||||
indice = hashLoc (high, low) % pTab->lenTabLoc;
|
||||
pLoc = pTab->pLoc;
|
||||
if (pLoc[indice].oper == oper)
|
||||
if (high == pLoc[indice].high && low == pLoc[indice].low)
|
||||
return (pLoc[indice].father);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/* ajout d'un element a la table */
|
||||
|
||||
|
||||
int
|
||||
addTabLoc (pTab, high, low, father, oper)
|
||||
pTableLoc pTab;
|
||||
pNode high, low, father;
|
||||
short oper;
|
||||
{
|
||||
pVertexLoc pLoc;
|
||||
int indice;
|
||||
|
||||
/* un seul acces permis */
|
||||
|
||||
indice = hashLoc (high, low) % pTab->lenTabLoc;
|
||||
pLoc = pTab->pLoc;
|
||||
pLoc[indice].oper = oper;
|
||||
pLoc[indice].high = high;
|
||||
pLoc[indice].low = low;
|
||||
pLoc[indice].father = father;
|
||||
return (indice); /* retourne la place utilisee */
|
||||
}
|
||||
|
||||
|
||||
/* affichage des elements de la table */
|
||||
|
||||
void
|
||||
displayLoc (pTab)
|
||||
pTableLoc pTab;
|
||||
{
|
||||
int i;
|
||||
int co = 0;
|
||||
pVertexLoc pLoc;
|
||||
|
||||
pLoc = pTab->pLoc;
|
||||
|
||||
printf ("\n---------------------------------------------------------------");
|
||||
printf ("---------\n AFFICHAGE DE LA TABLE DE HACHAGE\n\n");
|
||||
|
||||
for (i = 0; i < pTab->lenTabLoc; i++)
|
||||
{
|
||||
if (pLoc[i].oper != EMPTYTH)
|
||||
{
|
||||
co++;
|
||||
printf ("****** indice %d ****** \n", i);
|
||||
printf ("HIGH %d LOW %d FATHER %d\n", (int) pLoc[i].high, (int) pLoc[i].low, (int) pLoc[i].father);
|
||||
printf ("\n");
|
||||
}
|
||||
}
|
||||
printf ("\n****** Nombre de noeuds dans la table = %d\n", co);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
videTabLoc :vide une table de hachage locale.
|
||||
-------------------------------------------------------
|
||||
parametres :une table de hashage locale.
|
||||
-------------------------------------------------------
|
||||
return :rien.
|
||||
------------------------------------------------------------------------------*/
|
||||
|
||||
void
|
||||
videTabLoc (pTab)
|
||||
pTableLoc pTab;
|
||||
{
|
||||
pVertexLoc pLoc;
|
||||
int i;
|
||||
|
||||
pLoc = pTab->pLoc;
|
||||
|
||||
|
||||
for (i = 0; i < pTab->lenTabLoc; i++)
|
||||
{
|
||||
pLoc[i].oper = EMPTYTH;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue