diff --git a/alliance/README.IRIX b/alliance/README.IRIX new file mode 100644 index 00000000..4d591c5c --- /dev/null +++ b/alliance/README.IRIX @@ -0,0 +1,277 @@ +# Alliance VLSI CAD System # +# Copyright (C) 1990, 2002 ASIM/LIP6/UPMC # +# # +# Home page : http://asim.lip6.fr/alliance/ # +# E-mail support : mailto:alliance-users@asim.lip6.fr # +# ftp site : ftp://asim.lip6.fr/pub/alliance/ # +# # +# $Id: README.IRIX,v 1.1 2002/09/18 18:57:43 pnt Exp $ # + + This file discuss about installation of Alliance on IRIX machines. + + =================================================================== + + Alliance VLSI CAD System + Copyright (C) Laboratoire LIP6 - Département ASIM + Universite Pierre et Marie Curie + 4, place Jussieu + 75252 Paris Cedex 05 + France + + + "Alliance VLSI CAD System" is free Software. + +Alliance is available under the terms of the GNU General Public License +GPL (http://www.gnu.org/copyleft/gpl.html). + +You are welcome to use the software package even for commercial designs +without any fee. You are just required to mention : + +"Designed with Alliance CAD system, Copyright (C) 1991, 2002 Université + Pierre et Marie Curie" + + + + + IRIX notes + ========== + + +I Generalities +============== + +Alliance is available for both 32-bit and 64-bit platforms: + +Alliance-X.Y-IRIX-6.5-N32.tardist is a N32 ABI precompiled package +Alliance-X.Y-IRIX-6.5-N64.tardist is a N64 ABI precompiled package + +where X.Y is the version number. + +You can install the 64-bit version only on 64-bit machines, 32-bit +version is suitable to all machines (For more informations on the +Application Binary Interface, please see the techpubs page +at SGI: http://techpubs.sgi.com). + +Sources are included but not installed by default. If you want the sources +to be installed, select the custom installation in the Software Manager +and check the box related to the sources. + + +II Downloading binary distribution +================================= + +You can get Alliance via anonymous FTP from ftp.lip6.fr + + ftp://ftp-asim.lip6.fr/pub/alliance/contrib/ (IRIX) + ftp://ftp-asim.lip6.fr/pub/alliance/ (Linux,Solaris) + +If you are using a web browser, just click on the appropriate tardist file; the +Software Manager should be automatically launched. + +Otherwise, download the file, untar it in a directory and run the Software Manager. + + +III Installation +=============== + +Depending on the package, +- The alliance software will be located in /usr/local/alliance/archi/IRIX with +the N32 interface +- The alliance software will be located in /usr/local/alliance/archi/IRIX64 with +the N64 interface + +Note: you need to be root to run the Software Manager. + +If you want the sources, then select the Customize option from the Software Manager +and check the box related to the sources. +The sources will be installed in /usr/local/alliance/archi/src. + + +IV Usage +======== + +Each user has to source alc_env.[c]sh to set Alliance environment +variables to be able to run the Alliance tools. + +in sh > . /usr/local/alliance/share/etc/alc_env.sh + +in csh > source /usr/local/alliance/share/etc/alc_env.csh + +This sets various default environment variables which could be changed by user +later (Like MBK_OUT_LO to set the netlist output file format). + +If you are a SysAdmin, you should consider linking these scripts in +the system's profile (e.g.: /etc/profile.d/ on Linux) so that configuration +would be done at user login. + +If you encounter problems, check the value of these variables in alc_env.[c]sh + + $ALLIANCE_OS : actually IRIX + or IRIX64 + + $ALLIANCE_TOP : actually /usr/local/alliance/archi/IRIX + or /usr/local/alliance/archi/IRIX64 + + +V Optional: compilation +======================= + +Get the Alliance software package and install it with the sources (see the options +in the Software Manager). + +We assume that the sources are located in /usr/local/alliance/src. +We also assume that you have a working C and a working C++ compiler. + + +V.a Choose the ABI +------------------ + +On IRIX systems you can choose to use the O32, N32 or N64 part of the Application +Binary Interface, depending on your computer (for more informations on the ABI please +see the techpubs page at SGI: http://techpubs.sgi.com): +* Type "uname -s" in the shell command. If you get back "IRIX", then use the N32 libraries. +If you get "IRIX64", then use the N64 libraries. +* Or on a 64-bit system you can force a specific compilation, N32 or N64. + + +For a N32 compilation, set up the following compilation environment: + +| setenv CC /usr/freeware/bin/gcc (optional) +| setenv CXX /usr/freeware/bin/g++ (optional) +| setenv CFLAGS "-mabi=n32 -mips3 -gdwarf-2" +| setenv OFLAGS "-mabi=n32 -mips3" +| setenv CXXFLAGS "-mabi=n32 -mips3" +| setenv SGI_ABI n32 +| setenv LDFLAGS "-L/usr/freeware/lib32 -L/usr/freeware/lib32/X11" (optional) + + +We assume that the library path is set thru the LD_LIBRAYN32_PATH variable, for +example: + + +| if ! $?LD_LIBRARYN32_PATH then +| setenv LD_LIBRARYN32_PATH /usr/lib32 +| else +| setenv LD_LIBRARYN32_PATH "$LD_LIBRARYN32_PATH":/usr/lib32 +| endif +| +| setenv LD_LIBRARYN32_PATH "$LD_LIBRARYN32_PATH":/lib32 +| setenv LD_LIBRARYN32_PATH "$LD_LIBRARYN32_PATH":/usr/lib32/X11 +| setenv LD_LIBRARYN32_PATH "$LD_LIBRARYN32_PATH":/usr/Motif-2.1/lib32 +| setenv LD_LIBRARYN32_PATH "$LD_LIBRARYN32_PATH":/usr/freeware/lib32 +| setenv LD_LIBRARYN32_PATH "$LD_LIBRARYN32_PATH":/usr/freeware/lib32/X11 + + + +For a N64 compilation, set up the following compilation environment: + +| setenv CC /usr/freeware/bin/gcc (optional) +| setenv CXX /usr/freeware/bin/g++ (optional) +| setenv CFLAGS "-mabi=64 -mips4 -gdwarf-2" +| setenv OFLAGS "-mabi=64 -mips4" +| setenv CXXFLAGS "-mabi=64 -mips4" +| setenv SGI_ABI 64 +| setenv LDFLAGS "-L/usr/freeware/lib64 -L/usr/freeware/lib64/X11" (optional) + + +We assume that the library path is set thru the LD_LIBRAY64_PATH variable, for +example: + + +| if ! $?LD_LIBRARY64_PATH then +| setenv LD_LIBRARY64_PATH /usr/lib64 +| else +| setenv LD_LIBRARY64_PATH "$LD_LIBRARY64_PATH":/usr/lib64 +| endif +| +| setenv LD_LIBRARY64_PATH "$LD_LIBRARY64_PATH":/lib64 +| setenv LD_LIBRARY64_PATH "$LD_LIBRARY64_PATH":/usr/lib64/X11 +| setenv LD_LIBRARY64_PATH "$LD_LIBRARY64_PATH":/usr/Motif-2.1/lib64 +| setenv LD_LIBRARY64_PATH "$LD_LIBRARY64_PATH":/usr/freeware/lib64 +| setenv LD_LIBRARY64_PATH "$LD_LIBRARY64_PATH":/usr/freeware/lib64/X11 + + + +V.b Autoconf, automake +---------------------- + +Our advice is to create a separate directory for the compilation. For +example create a build directory in /usr/local/alliance: + +| cd /usr/local/alliance/ + +then: + +| mkdir build +| mkdir build/IRIX for a N32 compilation + +or: + +| mkdir build +| mkdir build/IRIX64 for a N64 compilation + + +Then go to /usr/local/alliance/src and run the autostuff script. It will run automatically +aclocal, autoconf and automake: + +| cd /usr/local/alliance/ +| ./autostuff + + +V.c Compilation +--------------- + +Go to the /usr/local/alliance/build/IRIX or /usr/local/alliance/build/IRIX64 directory and +run the configure script. + +For the N32 interface: + +| cd /usr/local/alliance/build/IRIX +| ../../src/configure --prefix=/usr/local/alliance/archi/IRIX --with-stabs + +For the N64 interface: + +| cd /usr/local/alliance/build/IRIX64 +| ../../src/configure --prefix=/usr/local/alliance/archi/IRIX64 --with-stabs --enable-system64 + + +Notes : the --prefix option allows you to choose the installation directory. + + : the --with-stabs allows you to debug in dwarf format and g++ (default on SGI) + + : the --enable-system64 allows you to compile on a 64-bit architecture + + +Then run gmake : + +| gmake install + + +Note: run "gmake install" instead of "gmake ; gmake install", or the libraries won't be found. + +Note: if make fails, try gmake as I did... + + + +V.d Enjoy ! +----------- + + +VI Other informations +===================== + +Alliance 5.0 for IRIX was compiled on the following system: + +Octane +MIPS R10000 Processor 250 MHZ IP30 +IRIX 6.5.15f +autoconf +automake +aclocal +configure options: --prefix, --with-stabs, --enable-system64 on a 64-bit architecture +gnu gcc and gnu c++ compiler +gcc option: -gdwarf-2 +freeware installed +gmake + +Note: gdb does not support debugging 64-bit executables or programs using pthreads on IRIX. Use dbx instead. \ No newline at end of file diff --git a/alliance/src/abe/Makefile.am b/alliance/src/abe/Makefile.am deleted file mode 100644 index af437a64..00000000 --- a/alliance/src/abe/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = src diff --git a/alliance/src/abe/configure.in b/alliance/src/abe/configure.in deleted file mode 100644 index 87651623..00000000 --- a/alliance/src/abe/configure.in +++ /dev/null @@ -1,45 +0,0 @@ -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 -dnl $Id: configure.in,v 1.1 2002/03/20 13:18:21 ludo Exp $ -dnl -dnl -AC_INIT(src/abe.h) -AM_INIT_AUTOMAKE(abe, 2.1) -AC_PROG_INSTALL -AC_PROG_CC -AC_HEADER_STDC -AC_C_CONST -AC_PROG_RANLIB - -AM_ALLIANCE - -AC_OUTPUT([ -Makefile -src/Makefile -]) diff --git a/alliance/src/abe/src/Makefile.am b/alliance/src/abe/src/Makefile.am deleted file mode 100644 index e0d4ebf1..00000000 --- a/alliance/src/abe/src/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -CFLAGS = @CFLAGS@ \ - -DALLIANCE_TOP=\"${ALLIANCE_TOP}\" -lib_LIBRARIES = libAbe.a -include_HEADERS = abe.h -libAbe_a_SOURCES = \ -abe.h beh_del.c beh_error.c beh_getgenva.c beh_rmv.c beh_view.c \ -beh_add.c beh_dict.c beh_fre.c beh_message.c beh_toolbug.c diff --git a/alliance/src/abe/src/abe.h b/alliance/src/abe/src/abe.h deleted file mode 100644 index 399e7e4c..00000000 --- a/alliance/src/abe/src/abe.h +++ /dev/null @@ -1,321 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : abe201.h */ -/* date : Feb 15 1995 */ -/* version : v201 */ -/* contents : defines and structure definitions used in BEH library */ -/* */ -/* ###--------------------------------------------------------------### */ - -#ifndef ABE_BEHDEF -#define ABE_BEHDEF - - /* ###------------------------------------------------------### */ - /* defines */ - /* ###------------------------------------------------------### */ - -#define BEH_GENERIC 203698 /* generic ptype code */ -#define BEH_STABLE 0x01 /* description used STABLE attribute */ - - /* ###------------------------------------------------------### */ - /* structure definitions */ - /* ###------------------------------------------------------### */ - -struct beden /* dictionary entry point */ - { - struct beden *NEXT; /* next entry */ - struct bedrd *DATA; /* data */ - char *KEY; /* key */ - }; - -struct bedrd /* dictionary record */ - { - struct bedrd *NEXT; /* next record */ - char *KEY; /* context key */ - short FD0_VAL; /* data field */ - short FD1_VAL; /* data field */ - short FD2_VAL; /* data field */ - short FD3_VAL; /* data field */ - short FD4_VAL; /* data field */ - short FD5_VAL; /* data field */ - short FD6_VAL; /* data field */ - long PNT_VAL; /* data field */ - }; - -typedef struct befig /* behaviour figure */ - { - struct befig *NEXT; /* next figure */ - char *NAME; /* figure's name */ - struct bereg *BEREG; /* list of internal signals (REGISTER) */ - struct bemsg *BEMSG; /* list of assert instructions */ - struct berin *BERIN; /* list of inputs (registers and ports) */ - struct beout *BEOUT; /* list of output ports */ - struct bebus *BEBUS; /* list of output ports (BUS) */ - struct beaux *BEAUX; /* list of internal signals */ - struct beaux *BEDLY; /* internal signals used for 'DELAYED */ - struct bebux *BEBUX; /* list of internal signals (BUS) */ - struct bepor *BEPOR; /* list of figure's port built in the */ - /* reverse order of the port clause */ - struct begen *BEGEN; /* list of generic data */ - struct bepgm *BEPGM; /* list of pragmas (new field !!) */ - - struct bddcircuit *CIRCUI; /* Circuit pointer used during ABL to */ - /* BDD transformation */ - void *USER; /* reserved for user's applications */ - long FLAGS; - char ERRFLG; /* error flag */ - char TYPE; /* description type (not used) */ - } -befig_list; - -typedef struct bereg /* register */ - { - struct bereg *NEXT; /* next register */ - char *NAME; /* register's name */ - struct biabl *BIABL; /* list of drivers (ABL) */ - struct binode *BINODE; /* list of drivers (BDD) */ - void *USER; - long FLAGS; - } -bereg_list; - -typedef struct bemsg /* assert instruction */ - { - struct bemsg *NEXT; /* next assertion */ - char LEVEL; /* severity level of the assertion */ - char *LABEL; /* instruction's label */ - char *MESSAGE; /* assertion's message */ - ablexpr *ABL; /* assertion's condition (ABL) */ - struct bddnode *NODE; /* assertion's condition (BDD) */ - void *USER; - long FLAGS; - } -bemsg_list; - -typedef struct beout /* output port */ - { - struct beout *NEXT; /* next output */ - char *NAME; /* port's name */ - ablexpr *ABL; /* port's equation (ABL) */ - struct bddnode *NODE; /* port's equation (BDD) */ - void *USER; - long FLAGS; - } -beout_list; - -typedef struct bebus /* output port (BUS) */ - { - struct bebus *NEXT; /* next bus port */ - char *NAME; /* port's name */ - struct biabl *BIABL; /* list of drivers (ABL) */ - struct binode *BINODE; /* list of drivers (BDD) */ - char TYPE; /* port's type : W or M */ - void *USER; - long FLAGS; - } -bebus_list; - -typedef struct beaux /* auxiliary signal */ - { - struct beaux *NEXT; /* next signal */ - char *NAME; /* signal's name */ - ablexpr *ABL; /* signal's equation (ABL) */ - struct bddnode *NODE; /* signal's equation (BDD) */ - void *USER; - long FLAGS; - } -beaux_list; - -typedef struct bebux /* internal signal (BUS) */ - { - struct bebux *NEXT; /* next signal */ - char *NAME; /* signal's name */ - struct biabl *BIABL; /* list of drivers (ABL) */ - struct binode *BINODE; /* list of drivers (BDD) */ - char TYPE; /* signal's type : W or M */ - void *USER; - long FLAGS; - } -bebux_list; - -typedef struct bepor /* port */ - { - struct bepor *NEXT; /* next port */ - char *NAME; /* port's name */ - char DIRECTION; /* port's mode (same as LOCON) */ - char TYPE; /* port's type (B, M or W) */ - void *USER; - long FLAGS; - } -bepor_list; - -typedef struct biabl /* couple of ABL */ - { - struct biabl *NEXT; /* next couple */ - char *LABEL; /* driver's label */ - ablexpr *CNDABL; /* driver's connection condition (ABL) */ - ablexpr *VALABL; /* equation of driven value (ABL) */ - void *USER; /* user field */ - long FLAGS; - } -biabl_list; - -typedef struct binode /* couple of BDD */ - { - struct binode *NEXT; /* next figure */ - struct bddnode *CNDNODE; /* driver's connection condition (BDD) */ - struct bddnode *VALNODE; /* equation of driven value (BDD) */ - void *USER; - long FLAGS; - } -binode_list; - -typedef struct berin /* primary inputs */ - { - struct berin *NEXT; /* next input */ - char *NAME; /* input's name */ - struct chain *OUT_REF; /* outputs which depends on this input */ - struct chain *BUS_REF; /* busses which depends on this input */ - struct chain *AUX_REF; /* aux sig. which depends on this input */ - struct chain *REG_REF; /* registers which depends on this input*/ - struct chain *BUX_REF; /* busses which depends on this input */ - struct chain *MSG_REF; /* messages which depends on this input */ - struct chain *DLY_REF; /* delayed internal signals depending ..*/ - void *USER; - long FLAGS; - } -berin_list; - -typedef struct begen /* generic */ - { - struct begen *NEXT; /* next generic */ - char *NAME; /* generic`s name */ - char *TYPE; /* generic type`s name */ - void *VALUE; /* generic`s value */ - void *USER; - long FLAGS; - } -begen_list; - -typedef struct begex - { - struct chain *OPERAND; /* list of operands or NULL for term */ - unsigned int TERM ; /* operator or terminal's index */ - unsigned short TYPE ; /* expression's type index */ - } -begex_list; - -typedef struct bepgm /* pragma */ - { - struct bepgm *NEXT; /* next pragma */ - char *TYPE; /* prgma's type */ - char *NAME; /* object's name */ - void *VALUE; /* prgma's content */ - void *USER; - } -bepgm_list; - - /* ###------------------------------------------------------### */ - /* functions */ - /* ###------------------------------------------------------### */ - -extern struct beaux *beh_addbeaux (); -extern struct bebux *beh_addbebux (); -extern struct bebus *beh_addbebus (); -extern struct befig *beh_addbefig (); -extern struct begen *beh_addbegen (); -extern struct bemsg *beh_addbemsg (); -extern struct beout *beh_addbeout (); -extern struct bepor *beh_addbepor (); -extern struct bereg *beh_addbereg (); -extern struct berin *beh_addberin (); -extern struct bepgm *beh_addbepgm (); -extern struct biabl *beh_addbiabl (); -extern struct binode *beh_addbinode (); - -extern struct beaux *beh_delbeaux (); -extern struct bebux *beh_delbebux (); -extern struct bebus *beh_delbebus (); -extern struct befig *beh_delbefig (); -extern struct begen *beh_delbegen (); -extern struct bemsg *beh_delbemsg (); -extern struct beout *beh_delbeout (); -extern struct bepor *beh_delbepor (); -extern struct bereg *beh_delbereg (); -extern struct berin *beh_delberin (); -extern struct bepgm *beh_delbepgm (); -extern struct biabl *beh_delbiabl (); -extern struct binode *beh_delbinode (); - -extern void beh_frebeaux (); -extern void beh_frebebux (); -extern void beh_frebebus (); -extern void beh_frebefig (); -extern void beh_frebegen (); -extern void beh_frebemsg (); -extern void beh_frebeout (); -extern void beh_frebepor (); -extern void beh_frebereg (); -extern void beh_freberin (); -extern void beh_frebepgm (); -extern void beh_frebiabl (); -extern void beh_frebinode (); - -extern void beh_viewbefig(); -extern void beh_viewbiabl(); -extern void beh_viewbereg(); -extern void beh_viewbebux(); -extern void beh_viewbebus(); -extern void beh_viewbeout(); -extern void beh_viewbeaux(); -extern void beh_viewbepor(); - -extern struct beaux *beh_rmvbeaux (); -extern struct bebux *beh_rmvbebux (); -extern struct bebus *beh_rmvbebus (); -extern struct befig *beh_rmvbefig (); -extern struct begen *beh_rmvbegen (); -extern struct bemsg *beh_rmvbemsg (); -extern struct beout *beh_rmvbeout (); -extern struct bepor *beh_rmvbepor (); -extern struct bereg *beh_rmvbereg (); -extern struct berin *beh_rmvberin (); -extern struct bepgm *beh_rmvbepgm (); - -extern struct beden **beh_initab (); -extern void beh_addtab (); -extern long beh_chktab (); -extern void beh_fretab (); - -extern int beh_error (); -extern void beh_message (); -extern void beh_toolbug (); - -#endif diff --git a/alliance/src/abe/src/beh_add.c b/alliance/src/abe/src/beh_add.c deleted file mode 100644 index fecd5bc2..00000000 --- a/alliance/src/abe/src/beh_add.c +++ /dev/null @@ -1,540 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_addbeaux.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -#include -#include MUT_H -#include AUT_H -#include ABL_H -#include ABE_H - -/* ###--------------------------------------------------------------### */ -/* function : beh_addbeaux */ -/* description : create a BEAUX structure at the top the list */ -/* called func. : namealloc, autallocblock */ -/* ###--------------------------------------------------------------### */ - -struct beaux *beh_addbeaux (lastbeaux, name, abl_expr, bdd_expr) - -struct beaux *lastbeaux; /* pointer on the last beaux structure */ -char *name; /* signal's name */ -struct chain *abl_expr; /* signal's expression (ABL) */ -struct bddnode *bdd_expr; /* signal's expression (BDD) */ - - { - struct beaux *ptaux; - - name = namealloc (name); - - ptaux = (struct beaux *) autallocblock (sizeof(struct beaux)); - ptaux->NAME = name; - ptaux->ABL = abl_expr; - ptaux->NODE = bdd_expr; - ptaux->NEXT = lastbeaux; - - return (ptaux); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_addbebus.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_addbebus */ -/* description : create a BEBUS structure at the top the list */ -/* called func. : namealloc, autallocblock */ -/* ###--------------------------------------------------------------### */ - -struct bebus *beh_addbebus (lastbebus, name, biabl, binode, type) - -struct bebus *lastbebus; /* pointer on the last bebus structure */ -char *name; /* port's name */ -struct biabl *biabl; /* port's drivers (ABL) */ -struct binode *binode; /* port's drivers (BDD) */ -char type; /* port type mark (M or W) */ - - { - struct bebus *ptbus; - - name = namealloc (name); - - ptbus = (struct bebus *) autallocblock (sizeof(struct bebus)); - ptbus->NAME = name; - ptbus->BIABL = biabl; - ptbus->BINODE = binode; - ptbus->TYPE = type; - ptbus->NEXT = lastbebus; - - return (ptbus); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_addbebux.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_addbebux */ -/* description : create a BEBUX structure at the top the list */ -/* called func. : namealloc, autallocblock */ -/* ###--------------------------------------------------------------### */ - -struct bebux *beh_addbebux (lastbebux, name, biabl, binode, type) - -struct bebux *lastbebux; /* pointer on the last bebux structure */ -char *name; /* signal's name */ -struct biabl *biabl; /* signal's expression (ABL) */ -struct binode *binode; /* signal's expression (BDD) */ -char type; /* signal's type mark (M or W) */ - - { - struct bebux *ptbux; - - name = namealloc (name); - - ptbux = (struct bebux *) autallocblock (sizeof(struct bebux)); - ptbux->NAME = name; - ptbux->BIABL = biabl; - ptbux->BINODE = binode; - ptbux->TYPE = type; - ptbux->NEXT = lastbebux; - - return (ptbux); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_addbefig.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_addbefig */ -/* description : create an empty BEFIG structure at the top of the list*/ -/* The ABE_HEDFIG list is not modified. */ -/* called func. : namealloc, autallocblock */ -/* ###--------------------------------------------------------------### */ - -struct befig *beh_addbefig (lastbefig, name) - -struct befig *lastbefig; /* pointer on the last befig structure */ -char *name; /* figure's name */ - - { - struct befig *ptfig; - - name = namealloc (name); - - ptfig = (struct befig *) autallocblock (sizeof(struct befig)); - ptfig->NAME = name; - ptfig->BEREG = NULL; - ptfig->BEMSG = NULL; - ptfig->BERIN = NULL; - ptfig->BEOUT = NULL; - ptfig->BEBUS = NULL; - ptfig->BEAUX = NULL; - ptfig->BEDLY = NULL; - ptfig->BEBUX = NULL; - ptfig->BEPOR = NULL; - ptfig->CIRCUI = NULL; - ptfig->USER = NULL; - ptfig->BEGEN = NULL; - ptfig->BEPGM = NULL; - ptfig->ERRFLG = 0; - ptfig->TYPE = 0; - ptfig->NEXT = lastbefig; - - return (ptfig); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_addbegen.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_addbegen */ -/* description : create a BEGEN structure at the top the list */ -/* called func. : namealloc, autallocblock */ -/* ###--------------------------------------------------------------### */ - -struct begen *beh_addbegen (lastbegen, name, type, value) - -struct begen *lastbegen; /* pointer on the last begen structure */ -char *name; /* generic's name */ -char *type; /* generic's type mark */ -void *value; /* generic's value */ - - { - - struct begen *ptgen; - - name = namealloc (name); - type = namealloc (type); - - ptgen = (struct begen *) autallocblock (sizeof(struct begen)); - ptgen->NAME = name; - ptgen->TYPE = type; - ptgen->VALUE = value; - ptgen->NEXT = lastbegen; - - return (ptgen); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_addbemsg.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_addbemsg */ -/* description : create BEMSG structure at the top the list */ -/* called func. : autallocblock, namealloc */ -/* ###--------------------------------------------------------------### */ - -struct bemsg *beh_addbemsg (lastbemsg,label,level,message,abl_expr,bdd_expr) - -struct bemsg *lastbemsg; /* pointer on the last bemsg structure */ -char *label; /* assert's label */ -char level; /* severity level (E or W) */ -char *message; /* reported message */ -struct chain *abl_expr; /* assert's condition (ABL) */ -struct bddnode *bdd_expr; /* assert's condition (BDD) */ - - { - - struct bemsg *ptmsg; - - label = namealloc (label); - - ptmsg = (struct bemsg *) autallocblock (sizeof(struct bemsg)); - ptmsg->LABEL = label; - ptmsg->LEVEL = level; - ptmsg->MESSAGE = message; - ptmsg->ABL = abl_expr; - ptmsg->NODE = bdd_expr; - ptmsg->NEXT = lastbemsg; - - return (ptmsg); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_addbeout.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_addbeout */ -/* description : create a BEOUT structure at the top the list */ -/* called func. : namealloc, autallocblock */ -/* ###--------------------------------------------------------------### */ - -struct beout *beh_addbeout (lastbeout, name, abl_expr, bdd_expr) - -struct beout *lastbeout; /* pointer on the last beout structure */ -char *name; /* port's name */ -struct chain *abl_expr; /* port's expression (ABL) */ -struct bddnode *bdd_expr; /* port's expression (BDD) */ - - { - struct beout *ptout; - - name = namealloc (name); - - ptout = (struct beout *) autallocblock (sizeof(struct beout)); - ptout->NAME = name; - ptout->ABL = abl_expr; - ptout->NODE = bdd_expr; - ptout->NEXT = lastbeout; - - return (ptout); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_addbepgm.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_addbepgm */ -/* description : add an BEPGM structure at the top of a list */ -/* called func. : namealloc, autallocblock */ -/* ###--------------------------------------------------------------### */ - -struct bepgm *beh_addbepgm (lastbepgm, type , name , value) -struct bepgm *lastbepgm; /* pointer on the last bepgm */ -char *type; /* pragma's type */ -char *name; /* pragma's name */ -void *value; /* pragma's content */ - { - struct bepgm *ptbepgm; - - if(type) - type = namealloc (type); - if(name) - name = namealloc (name); - - ptbepgm = (struct bepgm *) autallocblock (sizeof(struct bepgm)); - - ptbepgm->TYPE = type; - ptbepgm->NAME = name; - ptbepgm->VALUE = value; - - ptbepgm->NEXT = lastbepgm; - - return (ptbepgm); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_addbepor.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_addbepor */ -/* description : create a BEPOR structure at the top the list */ -/* called func. : namealloc, autallocblock */ -/* ###--------------------------------------------------------------### */ - -struct bepor *beh_addbepor (lastbepor, name, dir, type) - -struct bepor *lastbepor; /* pointer on the last bepor structure */ -char *name; /* signal's name */ -char dir; /* signal's mode (I, O, B, Z, or T) */ -char type; /* signal'type mark (M or W) */ - - { - struct bepor *ptbepor; - - name = namealloc (name); - - ptbepor = (struct bepor *) autallocblock (sizeof(struct bepor)); - ptbepor->NAME = name; - ptbepor->DIRECTION = dir; - ptbepor->TYPE = type; - ptbepor->NEXT = lastbepor; - - return (ptbepor); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_addbereg.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_addbereg */ -/* description : create a BEREG structure at the top the list */ -/* called func. : namealloc, autallocblock */ -/* ###--------------------------------------------------------------### */ - -struct bereg *beh_addbereg (lastbereg, name, biabl, binode) - -struct bereg *lastbereg; /* pointer on the last bereg structure */ -char *name; /* register's name */ -struct biabl *biabl; /* register's drivers (ABL) */ -struct binode *binode; /* register's drivers (BDD) */ - - { - struct bereg *ptreg; - - name = namealloc (name); - - ptreg = (struct bereg *) autallocblock (sizeof(struct bereg)); - ptreg->NAME = name; - ptreg->BIABL = biabl; - ptreg->BINODE = binode; - ptreg->NEXT = lastbereg; - - return (ptreg); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_addberin.c */ -/* date : Sep 20 1994 */ -/* version : v107 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_addberin */ -/* description : create a BERIN structure at the top the list */ -/* called func. : namealloc, autallocblock */ -/* ###--------------------------------------------------------------### */ - -struct berin *beh_addberin (lastberin, name) - -struct berin *lastberin; /* pointer on the last berin structure */ -char *name; /* signal's name */ - - { - struct berin *ptrin; - - name = namealloc (name); - - ptrin = (struct berin *) autallocblock (sizeof(struct berin)); - ptrin->NAME = name; - ptrin->NEXT = lastberin; - - ptrin->REG_REF = NULL; - ptrin->MSG_REF = NULL; - ptrin->AUX_REF = NULL; - ptrin->BUX_REF = NULL; - ptrin->BUS_REF = NULL; - ptrin->OUT_REF = NULL; - ptrin->DLY_REF = NULL; - - return (ptrin); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_addbiabl.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_addbiabl */ -/* description : create a BIABL structure at the top the list */ -/* called func. : namealloc, autallocblock */ -/* ###--------------------------------------------------------------### */ - -struct biabl *beh_addbiabl (lastbiabl, label, condition, value) - -char *label; /* block's label */ -struct biabl *lastbiabl; /* pointer on the last biabl structure */ -struct chain *condition; /* guard expression (ABL) */ -struct chain *value; /* value expression (ABL) */ - - { - struct biabl *ptbiabl; - - ptbiabl = (struct biabl *) autallocblock (sizeof(struct biabl)); - label = namealloc (label); - - ptbiabl->LABEL = label; - ptbiabl->CNDABL = condition; - ptbiabl->VALABL = value; - ptbiabl->USER = NULL; - ptbiabl->NEXT = lastbiabl; - - return (ptbiabl); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_addbinod.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_addbinode */ -/* description : create a BINODE structure at the top the list */ -/* called func. : autallocblock */ -/* ###--------------------------------------------------------------### */ - -struct binode *beh_addbinode (lastbinode, condition, value) - -struct binode *lastbinode; /* pointer on the last binode structure */ -struct bddnode *condition; /* guard expression (BDD) */ -struct bddnode *value; /* value expression (BDD) */ - - { - struct binode *ptbinode; - - ptbinode = (struct binode *) autallocblock (sizeof(struct binode)); - ptbinode->CNDNODE = condition; - ptbinode->VALNODE = value; - ptbinode->NEXT = lastbinode; - - return (ptbinode); - } diff --git a/alliance/src/abe/src/beh_del.c b/alliance/src/abe/src/beh_del.c deleted file mode 100644 index 0687357d..00000000 --- a/alliance/src/abe/src/beh_del.c +++ /dev/null @@ -1,866 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_delbeaux.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -#include -#include MUT_H -#include AUT_H -#include ABL_H -#include ABE_H - -/* ###--------------------------------------------------------------### */ -/* function : beh_delbeaux */ -/* description : delete a BEAUX structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock, freeablexpr */ -/* ###--------------------------------------------------------------### */ - -struct beaux *beh_delbeaux (listbeaux, ptbeaux, mode) - -struct beaux *listbeaux; /* list of beaux containing the object */ -struct beaux *ptbeaux; /* pointer of the BEAUX to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct beaux headaux; - struct beaux *ptlastaux; - - if ((listbeaux != NULL) && (ptbeaux != NULL)) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headaux.NEXT = listbeaux; - ptlastaux = &headaux; - while ((ptlastaux != NULL) && (ptlastaux->NEXT != ptbeaux)) - ptlastaux = ptlastaux->NEXT; - - if (ptlastaux != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if (ptbeaux->ABL != NULL) - (void) fprintf (stderr,"BEH_warning : beaux `%s` not empty\n", - ptbeaux->NAME); - } - else - freeablexpr (ptbeaux->ABL); - - ptlastaux->NEXT = ptbeaux->NEXT; - autfreeblock (ptbeaux); - } - - listbeaux = headaux.NEXT; - } - - return(listbeaux); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_delbebus.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_delbebus */ -/* description : delete a BEBUS structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock, beh_frebiabl, beh_frebinode */ -/* ###--------------------------------------------------------------### */ - -struct bebus *beh_delbebus (listbebus, ptbebus, mode) - -struct bebus *listbebus; /* list of bebus containing the object */ -struct bebus *ptbebus; /* pointer of the BEBUS to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct bebus headbus; - struct bebus *ptlastbus; - - if ((listbebus != NULL) && (ptbebus != NULL)) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headbus.NEXT = listbebus; - ptlastbus = &headbus; - while ((ptlastbus != NULL) && (ptlastbus->NEXT != ptbebus)) - ptlastbus = ptlastbus->NEXT; - - if (ptlastbus != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if ((ptbebus->BIABL != NULL) || (ptbebus->BINODE != NULL)) - (void) fprintf (stderr,"BEH_warning : bebus `%s` not empty\n", - ptbebus->NAME); - } - else - { - beh_frebiabl (ptbebus->BIABL); - beh_frebinode (ptbebus->BINODE); - } - - ptlastbus->NEXT = ptbebus->NEXT; - autfreeblock (ptbebus); - } - - listbebus = headbus.NEXT; - } - - return(listbebus); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_delbebux.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_delbebux */ -/* description : delete a BEBUX structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock, beh_frebiabl, beh_frebinode */ -/* ###--------------------------------------------------------------### */ - -struct bebux *beh_delbebux (listbebux, ptbebux, mode) - -struct bebux *listbebux; /* list of bebux containing the object */ -struct bebux *ptbebux; /* pointer of the BEBUX to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct bebux headbux; - struct bebux *ptlastbux; - - if ((listbebux != NULL) && (ptbebux != NULL)) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headbux.NEXT = listbebux; - ptlastbux = &headbux; - while ((ptlastbux != NULL) && (ptlastbux->NEXT != ptbebux)) - ptlastbux = ptlastbux->NEXT; - - if (ptlastbux != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if ((ptbebux->BIABL != NULL) || (ptbebux->BINODE != NULL)) - (void) fprintf (stderr,"BEH_warning : bebux `%s` not empty\n", - ptbebux->NAME); - } - else - { - beh_frebiabl (ptbebux->BIABL); - beh_frebinode (ptbebux->BINODE); - } - - ptlastbux->NEXT = ptbebux->NEXT; - autfreeblock (ptbebux); - } - - listbebux = headbux.NEXT; - } - - return(listbebux); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_delbefig.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_delbefig */ -/* description : delete a BEFIG structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N. */ -/* called func. : autfreeblock , beh_frebereg, beh_frebemsg, */ -/* beh_freberin, beh_frebeout, beh_frebebus, */ -/* beh_frebeaux, beh_frebebux, beh_frebepor, */ -/* beh_frebegen, getptype */ -/* ###--------------------------------------------------------------### */ - -struct befig *beh_delbefig (listbefig, ptbefig, mode) - -struct befig *listbefig; /* list of befig containing the object */ -struct befig *ptbefig; /* pointer of the BEFIG to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct befig headfig; - struct befig *ptlastfig; - struct ptype *ptptype; - - if ((listbefig != NULL) && (ptbefig != NULL)) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headfig.NEXT = listbefig; - ptlastfig = &headfig; - while ((ptlastfig != NULL) && (ptlastfig->NEXT != ptbefig)) - ptlastfig = ptlastfig->NEXT; - - if (ptlastfig != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if ((ptbefig->BEREG != NULL) || (ptbefig->BEMSG != NULL) || - (ptbefig->BERIN != NULL) || (ptbefig->BEOUT != NULL) || - (ptbefig->BEBUS != NULL) || (ptbefig->BEAUX != NULL) || - (ptbefig->BEBUX != NULL) || (ptbefig->BEDLY != NULL) || - (ptbefig->BEPOR != NULL) || (ptbefig->USER != NULL) || - (ptbefig->BEPGM != NULL)) - - (void) fprintf (stderr,"BEH_warning : befig `%s` not empty\n", - ptbefig->NAME); - } - else - { - beh_frebereg (ptbefig->BEREG); - beh_frebemsg (ptbefig->BEMSG); - beh_freberin (ptbefig->BERIN); - beh_frebeout (ptbefig->BEOUT); - beh_frebebus (ptbefig->BEBUS); - beh_frebeaux (ptbefig->BEAUX); - beh_frebeaux (ptbefig->BEDLY); - beh_frebebux (ptbefig->BEBUX); - beh_frebepor (ptbefig->BEPOR); - beh_frebepgm (ptbefig->BEPGM); - if ((ptptype = getptype (ptbefig->USER,BEH_GENERIC)) != NULL) - beh_frebegen (ptptype->DATA); - } - - ptlastfig->NEXT = ptbefig->NEXT; - autfreeblock (ptbefig); - } - - listbefig = headfig.NEXT; - } - - return(listbefig); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_delbegen.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_delbegen */ -/* description : delete a BEGEN structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -struct begen *beh_delbegen (listbegen, ptbegen, mode) - -struct begen *listbegen; /* list of begen containing the object */ -struct begen *ptbegen; /* pointer of the BEGEN to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct begen headgen; - struct begen *ptlastgen; - - if ((listbegen != NULL) && (ptbegen != NULL)) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headgen.NEXT = listbegen; - ptlastgen = &headgen; - while ((ptlastgen != NULL) && (ptlastgen->NEXT != ptbegen)) - ptlastgen = ptlastgen->NEXT; - - if (ptlastgen != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if (ptbegen->VALUE != NULL) - (void) fprintf (stderr,"BEH_warning : begen `%s` not empty\n", - ptbegen->NAME); - } - else - autfreeblock (ptbegen->VALUE); - - ptlastgen->NEXT = ptbegen->NEXT; - autfreeblock (ptbegen); - } - - listbegen = headgen.NEXT; - } - - return(listbegen); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_delbemsg.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_delbemsg */ -/* description : delete a BEMSG structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock, freeablexpr */ -/* ###--------------------------------------------------------------### */ - -struct bemsg *beh_delbemsg (listbemsg, ptbemsg, mode) - -struct bemsg *listbemsg; /* list of bemsg containing the object */ -struct bemsg *ptbemsg; /* pointer of the BEMSG to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct bemsg headmsg; - struct bemsg *ptlastmsg; - - if ((listbemsg != NULL) && (ptbemsg != NULL)) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headmsg.NEXT = listbemsg; - ptlastmsg = &headmsg; - while ((ptlastmsg != NULL) && (ptlastmsg->NEXT != ptbemsg)) - ptlastmsg = ptlastmsg->NEXT; - - if (ptlastmsg != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if (ptbemsg->ABL != NULL) - (void) fprintf (stderr,"BEH_warning : bemsg `%s` not empty\n", - ptbemsg->LABEL); - } - else - freeablexpr (ptbemsg->ABL); - - ptlastmsg->NEXT = ptbemsg->NEXT; - autfreeblock (ptbemsg); - } - - listbemsg = headmsg.NEXT; - } - - return(listbemsg); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_delbeout.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_delbeout */ -/* description : delete a BEOUT structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock, freeablexpr */ -/* ###--------------------------------------------------------------### */ - -struct beout *beh_delbeout (listbeout, ptbeout, mode) - -struct beout *listbeout; /* list of beout containing the object */ -struct beout *ptbeout; /* pointer of the BEOUT to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct beout headout; - struct beout *ptlastout; - - if ((listbeout != NULL) && (ptbeout != NULL)) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headout.NEXT = listbeout; - ptlastout = &headout; - while ((ptlastout != NULL) && (ptlastout->NEXT != ptbeout)) - ptlastout = ptlastout->NEXT; - - if (ptlastout != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if (ptbeout->ABL != NULL) - (void) fprintf (stderr,"BEH_warning : beout `%s` not empty\n", - ptbeout->NAME); - } - else - freeablexpr (ptbeout->ABL); - - ptlastout->NEXT = ptbeout->NEXT; - autfreeblock (ptbeout); - } - - listbeout = headout.NEXT; - } - - return(listbeout); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_delbepor.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_delbepor */ -/* description : delete a BEPOR structure and return the pointer of */ -/* the next object. */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -struct bepor *beh_delbepor (listbepor, ptbepor) - -struct bepor *listbepor; /* list of bepor containing the object */ -struct bepor *ptbepor; /* pointer of the BEPOR to be deleted */ - - { - struct bepor headpor; - struct bepor *ptlastpor; - - if ((listbepor != NULL) && (ptbepor != NULL)) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headpor.NEXT = listbepor; - ptlastpor = &headpor; - while ((ptlastpor != NULL) && (ptlastpor->NEXT != ptbepor)) - ptlastpor = ptlastpor->NEXT; - - if (ptlastpor != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* ###------------------------------------------------------### */ - - ptlastpor->NEXT = ptbepor->NEXT; - autfreeblock (ptbepor); - } - - listbepor = headpor.NEXT; - } - - return(listbepor); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_delbereg.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_delbereg */ -/* description : delete a BEREG structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock, beh_frebiabl, beh_frebinode */ -/* ###--------------------------------------------------------------### */ - -struct bereg *beh_delbereg (listbereg, ptbereg, mode) - -struct bereg *listbereg; /* list of bereg containing the object */ -struct bereg *ptbereg; /* pointer of the BEREG to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct bereg headreg; - struct bereg *ptlastreg; - - if ((listbereg != NULL) && (ptbereg != NULL)) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headreg.NEXT = listbereg; - ptlastreg = &headreg; - while ((ptlastreg != NULL) && (ptlastreg->NEXT != ptbereg)) - ptlastreg = ptlastreg->NEXT; - - if (ptlastreg != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if ((ptbereg->BIABL != NULL) || (ptbereg->BINODE != NULL)) - (void) fprintf (stderr,"BEH_warning : bereg `%s` not empty\n", - ptbereg->NAME); - } - else - { - beh_frebiabl (ptbereg->BIABL); - beh_frebinode (ptbereg->BINODE); - } - - ptlastreg->NEXT = ptbereg->NEXT; - autfreeblock (ptbereg); - } - - listbereg = headreg.NEXT; - } - - return(listbereg); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_delberin.c */ -/* date : Sep 20 1994 */ -/* version : v107 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_delberin */ -/* description : delete a BERIN structure and return the pointer of */ -/* the next object. */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -struct berin *beh_delberin (listberin, ptberin) - -struct berin *listberin; /* list of berin containing the object */ -struct berin *ptberin; /* pointer of the BERIN to be deleted */ - - { - struct berin headrin; - struct berin *ptlastrin; - - if ((listberin != NULL) && (ptberin != NULL)) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headrin.NEXT = listberin; - ptlastrin = &headrin; - while ((ptlastrin != NULL) && (ptlastrin->NEXT != ptberin)) - ptlastrin = ptlastrin->NEXT; - - if (ptlastrin != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* ###------------------------------------------------------### */ - - ptlastrin->NEXT = ptberin->NEXT; - autfreeblock (ptberin); - } - - listberin = headrin.NEXT; - } - - return(listberin); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_delbiabl.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_delbiabl */ -/* description : delete a BIABL structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock, freeablexpr */ -/* ###--------------------------------------------------------------### */ - -struct biabl *beh_delbiabl (listbiabl, ptbiabl, mode) - -struct biabl *listbiabl; /* list of biabl containing the object */ -struct biabl *ptbiabl; /* pointer of the BIABL to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct biabl headabl; - struct biabl *ptlastabl; - - if ((listbiabl != NULL) && (ptbiabl != NULL)) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headabl.NEXT = listbiabl; - ptlastabl = &headabl; - while ((ptlastabl != NULL) && (ptlastabl->NEXT != ptbiabl)) - ptlastabl = ptlastabl->NEXT; - - if (ptlastabl != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if ((ptbiabl->VALABL != NULL) || (ptbiabl->CNDABL != NULL)) - (void) fprintf (stderr,"BEH_warning : biabl not empty\n"); - } - else - { - freeablexpr (ptbiabl->VALABL); - freeablexpr (ptbiabl->CNDABL); - freeptype(ptbiabl->USER); - } - - ptlastabl->NEXT = ptbiabl->NEXT; - autfreeblock (ptbiabl); - } - - listbiabl = headabl.NEXT; - } - - return(listbiabl); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_delbinod.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_delbinode */ -/* description : delete a BINODE structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -struct binode *beh_delbinode (listbinode, ptbinode, mode) - -struct binode *listbinode; /* list of binode containing the object */ -struct binode *ptbinode; /* pointer of the BINODE to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct binode headnode; - struct binode *ptlastnode; - - if ((listbinode != NULL) && (ptbinode != NULL)) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headnode.NEXT = listbinode; - ptlastnode = &headnode; - while ((ptlastnode != NULL) && (ptlastnode->NEXT != ptbinode)) - ptlastnode = ptlastnode->NEXT; - - if (ptlastnode != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if ((ptbinode->VALNODE != NULL) || (ptbinode->CNDNODE != NULL)) - (void) fprintf (stderr,"BEH_warning : binode not empty\n"); - } - - ptlastnode->NEXT = ptbinode->NEXT; - autfreeblock (ptbinode); - } - - listbinode = headnode.NEXT; - } - - return(listbinode); - } diff --git a/alliance/src/abe/src/beh_dict.c b/alliance/src/abe/src/beh_dict.c deleted file mode 100644 index 2cd9b7a0..00000000 --- a/alliance/src/abe/src/beh_dict.c +++ /dev/null @@ -1,347 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_dict.c */ -/* date : Jun 15 1994 */ -/* version : v107 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -#include -#include MUT_H -#include AUT_H -#include ABL_H -#include ABE_H - -#define BEH_ALODFN 64 -#define ABE_HSZDFN 97 - -static struct beden *BEH_DCEHED = NULL; /* free entries list */ -static struct bedrd *BEH_DCRHED = NULL; /* free records list */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_addent */ -/* description : add a new entry point to the dictionary */ -/* called func. : mbkalloc */ -/* ###--------------------------------------------------------------### */ - -static struct beden *beh_addent (head, key) - -struct beden *head; -char *key; - - { - struct beden *entry; - int i ; - - if (BEH_DCEHED == NULL) - { - BEH_DCEHED = (struct beden *) - mbkalloc (sizeof (struct beden) * BEH_ALODFN); - - entry = BEH_DCEHED; - for (i=1 ; iNEXT = entry + 1; - entry++; - } - entry->NEXT = NULL; - } - - entry = BEH_DCEHED; - BEH_DCEHED = BEH_DCEHED->NEXT; - - entry->NEXT = head; - entry->DATA = NULL; - entry->KEY = key; - - return (entry); - } - -/* ###--------------------------------------------------------------### */ -/* function : beh_addrcd */ -/* description : add a new record to the dictionary */ -/* called func. : mbkalloc */ -/* ###--------------------------------------------------------------### */ - -static struct bedrd *beh_addrcd (head, key) - -struct bedrd *head; -char *key; - - { - struct bedrd *recrd; - int i ; - - if (BEH_DCRHED == NULL) - { - BEH_DCRHED = (struct bedrd *) - mbkalloc (sizeof (struct bedrd) * BEH_ALODFN); - - recrd = BEH_DCRHED; - for (i=1 ; iNEXT = recrd + 1; - recrd++; - } - recrd->NEXT = NULL; - } - - recrd = BEH_DCRHED; - BEH_DCRHED = BEH_DCRHED->NEXT; - - recrd->NEXT = head; - recrd->FD0_VAL = 0; - recrd->FD1_VAL = 0; - recrd->FD2_VAL = 0; - recrd->FD3_VAL = 0; - recrd->FD4_VAL = 0; - recrd->FD5_VAL = 0; - recrd->FD6_VAL = 0; - recrd->PNT_VAL = 0; - recrd->KEY = key; - - return (recrd); - } - -/* ###--------------------------------------------------------------### */ -/* function : beh_initab */ -/* description : create a new dictionary */ -/* called func. : mbkalloc */ -/* ###--------------------------------------------------------------### */ - -struct beden **beh_initab () - - { - struct beden **head; - int i; - - head = (struct beden **) - mbkalloc (sizeof(struct beden *) * ABE_HSZDFN); - - for (i=0 ; iKEY == key_str) - { - found = 1; - break; - } - entry_pnt = entry_pnt->NEXT; - } - - if (found == 0) - { - head[index] = beh_addent (head[index],key_str); - entry_pnt = head[index]; - } - - found = 0; - recrd_pnt = entry_pnt->DATA; - while (recrd_pnt != NULL) - { - if (recrd_pnt->KEY == ctx_str) - { - found = 1; - break; - } - recrd_pnt = recrd_pnt->NEXT; - } - - if (found == 0) - { - entry_pnt->DATA = beh_addrcd (entry_pnt->DATA,ctx_str); - recrd_pnt = entry_pnt->DATA ; - } - - switch (field) - { - case 0 : - recrd_pnt->FD0_VAL = valu; break; - case 1 : - recrd_pnt->FD1_VAL = valu; break; - case 2 : - recrd_pnt->FD2_VAL = valu; break; - case 3 : - recrd_pnt->FD3_VAL = valu; break; - case 4 : - recrd_pnt->FD4_VAL = valu; break; - case 5 : - recrd_pnt->FD5_VAL = valu; break; - case 6 : - recrd_pnt->FD6_VAL = valu; break; - case 7 : - recrd_pnt->PNT_VAL = valu; break; - } - - } - -/* ###--------------------------------------------------------------### */ -/* function : beh_chktab */ -/* description : extract a data from a dictionary */ -/* called func. : none */ -/* ###--------------------------------------------------------------### */ - -long beh_chktab (head, key_str, ctx_str, field) - -struct beden **head; -char *key_str; -char *ctx_str; -int field; - - { - int found = 0; - long valu = 0; - struct beden *entry_pnt; - struct bedrd *recrd_pnt; - - entry_pnt = head [((unsigned long)key_str) % ABE_HSZDFN]; - - while (entry_pnt != NULL) - { - if (entry_pnt->KEY == key_str) - { - found = 1; - break; - } - entry_pnt = entry_pnt->NEXT; - } - - if (found == 1) - { - found = 0; - recrd_pnt = entry_pnt->DATA; - while (recrd_pnt != NULL) - { - if (recrd_pnt->KEY == ctx_str) - { - found = 1; - break; - } - recrd_pnt = recrd_pnt->NEXT; - } - if (found == 1) - { - switch (field) - { - case 0 : - valu = recrd_pnt->FD0_VAL; break; - case 1 : - valu = recrd_pnt->FD1_VAL; break; - case 2 : - valu = recrd_pnt->FD2_VAL; break; - case 3 : - valu = recrd_pnt->FD3_VAL; break; - case 4 : - valu = recrd_pnt->FD4_VAL; break; - case 5 : - valu = recrd_pnt->FD5_VAL; break; - case 6 : - valu = recrd_pnt->FD6_VAL; break; - case 7 : - valu = recrd_pnt->PNT_VAL; break; - } - } - } - - return (valu); - } - -/* ###--------------------------------------------------------------### */ -/* function : beh_fretab */ -/* description : release a dictionary */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_fretab (pt_hash) - -struct beden **pt_hash; - - { - struct beden *pt_entry; - struct beden *pt_nxtentry; - struct bedrd *pt_record; - int i; - - if (pt_hash != NULL) - { - for (i=0 ; iDATA; - - while (pt_record->NEXT != NULL) - pt_record = pt_record->NEXT; - - pt_record->NEXT = BEH_DCRHED; - BEH_DCRHED = pt_entry->DATA; - - pt_nxtentry = pt_entry->NEXT; - pt_entry->NEXT = BEH_DCEHED; - BEH_DCEHED = pt_entry; - pt_entry = pt_nxtentry; - } - } - } - autfreeblock (pt_hash); - } - } diff --git a/alliance/src/abe/src/beh_error.c b/alliance/src/abe/src/beh_error.c deleted file mode 100644 index f5b928ac..00000000 --- a/alliance/src/abe/src/beh_error.c +++ /dev/null @@ -1,95 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_error.c */ -/* date : Jun 13 1994 */ -/* version : v107 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -#include - -/* ###--------------------------------------------------------------### */ -/* function : beh_error */ -/* description : print an errorr message */ -/* called func. : none */ -/* ###--------------------------------------------------------------### */ - -int beh_error (code, str1) - -int code; -char *str1; - - { - (void) fprintf (stderr, "BEH : Error %d :", code); - - switch (code) - { - case 1: - (void) fprintf (stderr, "combinatory loop: `%s`\n", str1); - break; - case 2: - (void) fprintf (stderr, "cannot make bdd of empty expression\n"); - break; - case 3: - (void) fprintf (stderr, "cannot find terminal `%s`\n", str1); - break; - case 4: - (void) fprintf (stderr, "illegal use of STABLE attribute\n"); - break; - case 5: - (void) fprintf (stderr, "cannot simplify internal signals\n"); - break; - - case 40: - (void) fprintf (stderr,"signal `%s` never assigned\n",str1); - break; - case 68: - (void) fprintf (stderr,"port `%s` has unknwon type\n", str1); - break; - case 69: - (void) fprintf (stderr,"port `%s` has unknwon mode\n", str1); - break; - - case 100: - (void) fprintf (stderr,"cannot find `%s`\n",str1); - break; - case 107: - (void) fprintf (stderr,"cannot open result file\n"); - break; - - default: - (void) fprintf (stderr, "syntax error\n"); - break; - } - - return (1); - } diff --git a/alliance/src/abe/src/beh_fre.c b/alliance/src/abe/src/beh_fre.c deleted file mode 100644 index 2ff7fb3b..00000000 --- a/alliance/src/abe/src/beh_fre.c +++ /dev/null @@ -1,559 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_frebeaux.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -#include -#include MUT_H -#include AUT_H -#include ABL_H -#include ABE_H - -/* ###--------------------------------------------------------------### */ -/* function : beh_frebeaux */ -/* description : delete a list of BEAUX structures and all objects */ -/* pointed by any os BEAUXs in the list */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_frebeaux (listbeaux) - -struct beaux *listbeaux; /* list of beaux to be deleted */ - - { - struct beaux *ptbeaux; - - /* ###------------------------------------------------------### */ - /* for each object of the list, first delete pointed objects */ - /* then, delete the object itself */ - /* ###------------------------------------------------------### */ - - while (listbeaux != NULL) - { - freeablexpr (listbeaux->ABL); - - ptbeaux = listbeaux; - listbeaux = listbeaux->NEXT; - autfreeblock (ptbeaux); - } - - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_frebebus.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_frebebus */ -/* description : delete a list of BEBUS structures and all objects */ -/* pointed by any os BEBUSs in the list */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_frebebus (listbebus) - -struct bebus *listbebus; /* list of bebus to be deleted */ - - { - struct bebus *ptbebus; - - /* ###------------------------------------------------------### */ - /* for each object of the list, first delete pointed objects */ - /* then, delete the object itself */ - /* ###------------------------------------------------------### */ - - while (listbebus != NULL) - { - beh_frebiabl (listbebus->BIABL); - beh_frebinode (listbebus->BINODE); - - ptbebus = listbebus; - listbebus = listbebus->NEXT; - autfreeblock (ptbebus); - } - - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_frebebux.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_frebebux */ -/* description : delete a list of BEBUX structures and all objects */ -/* pointed by any os BEBUXs in the list */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_frebebux (listbebux) - -struct bebux *listbebux; /* list of bebux to be deleted */ - - { - struct bebux *ptbebux; - - /* ###------------------------------------------------------### */ - /* for each object of the list, first delete pointed objects */ - /* then, delete the object itself */ - /* ###------------------------------------------------------### */ - - while (listbebux != NULL) - { - beh_frebiabl (listbebux->BIABL); - beh_frebinode (listbebux->BINODE); - - ptbebux = listbebux; - listbebux = listbebux->NEXT; - autfreeblock (ptbebux); - } - - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_frebefig.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_frebefig */ -/* description : delete a list of BEFIG structures and all objects */ -/* pointed by any os BEFIGs in the list */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_frebefig (listbefig) - -struct befig *listbefig; /* list of befig to be deleted */ - - { - struct befig *ptbefig; - struct ptype *ptptype; - - /* ###------------------------------------------------------### */ - /* for each object of the list, first delete pointed objects */ - /* then, delete the object itself */ - /* ###------------------------------------------------------### */ - - while (listbefig != NULL) - { - beh_frebereg (listbefig->BEREG); - beh_frebemsg (listbefig->BEMSG); - beh_freberin (listbefig->BERIN); - beh_frebeout (listbefig->BEOUT); - beh_frebebus (listbefig->BEBUS); - beh_frebeaux (listbefig->BEAUX); - beh_frebeaux (listbefig->BEDLY); - beh_frebebux (listbefig->BEBUX); - beh_frebepor (listbefig->BEPOR); - beh_frebepgm (listbefig->BEPGM); - if ((ptptype = getptype (listbefig->USER,BEH_GENERIC)) != NULL) - beh_frebegen (ptptype->DATA); - - ptbefig = listbefig; - listbefig = listbefig->NEXT; - autfreeblock (ptbefig); - } - - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_frebegen.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_frebegen */ -/* description : delete a list of BEGEN structures and all objects */ -/* pointed by any os BEGENs in the list */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_frebegen (listbegen) - -struct begen *listbegen; /* list of begen to be deleted */ - - { - struct begen *ptbegen; - - /* ###------------------------------------------------------### */ - /* for each object of the list, first delete pointed objects */ - /* then, delete the object itself */ - /* ###------------------------------------------------------### */ - - while (listbegen != NULL) - { - autfreeblock (listbegen->VALUE); - - ptbegen = listbegen; - listbegen = listbegen->NEXT; - autfreeblock (ptbegen); - } - - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_frebemsg.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_frebemsg */ -/* description : delete a list of BEMSG structures and all objects */ -/* pointed by any os BEMSGs in the list */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_frebemsg (listbemsg) - -struct bemsg *listbemsg; /* list of bemsg to be deleted */ - - { - struct bemsg *ptbemsg; - - /* ###------------------------------------------------------### */ - /* for each object of the list, first delete pointed objects */ - /* then, delete the object itself */ - /* ###------------------------------------------------------### */ - - while (listbemsg != NULL) - { - freeablexpr (listbemsg->ABL); - - ptbemsg = listbemsg; - listbemsg = listbemsg->NEXT; - autfreeblock (ptbemsg); - } - - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_frebeout.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_frebeout */ -/* description : delete a list of BEOUT structures and all objects */ -/* pointed by any os BEOUTs in the list */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_frebeout (listbeout) - -struct beout *listbeout; /* list of beout to be deleted */ - - { - struct beout *ptbeout; - - /* ###------------------------------------------------------### */ - /* for each object of the list, first delete pointed objects */ - /* then, delete the object itself */ - /* ###------------------------------------------------------### */ - - while (listbeout != NULL) - { - freeablexpr (listbeout->ABL); - - ptbeout = listbeout; - listbeout = listbeout->NEXT; - autfreeblock (ptbeout); - } - - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_frebepgm.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_frebepgm */ -/* description : delete a list of BEMSG structures and all objects */ -/* pointed by any os BEMSGs in the list */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_frebepgm (listbepgm) - -struct bepgm *listbepgm; /* list of bepgm to be deleted */ - - { - struct bepgm *ptbepgm; - - /* ###------------------------------------------------------### */ - /* for each object of the list, first delete pointed objects */ - /* then, delete the object itself */ - /* ###------------------------------------------------------### */ - - while (listbepgm != NULL) - { - ptbepgm = listbepgm; - listbepgm = listbepgm->NEXT; - autfreeblock (ptbepgm); - } - - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_frebepor.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_frebepor */ -/* description : delete a list of BEAUX structures and all objects */ -/* pointed by any os BEAUXs in the list */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_frebepor (listbepor) - -struct bepor *listbepor; /* list of bepor to be deleted */ - - { - struct bepor *ptbepor; - - /* ###------------------------------------------------------### */ - /* for each object of the list, delete the object itself */ - /* ###------------------------------------------------------### */ - - while (listbepor != NULL) - { - ptbepor = listbepor; - listbepor = listbepor->NEXT; - autfreeblock (ptbepor); - } - - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_frebereg.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_frebereg */ -/* description : delete a list of BEAUX structures and all objects */ -/* pointed by any os BEAUXs in the list */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_frebereg (listbereg) - -struct bereg *listbereg; /* list of bereg to be deleted */ - - { - struct bereg *ptbereg; - - /* ###------------------------------------------------------### */ - /* for each object of the list, first delete pointed objects */ - /* then, delete the object itself */ - /* ###------------------------------------------------------### */ - - while (listbereg != NULL) - { - beh_frebiabl (listbereg->BIABL); - beh_frebinode (listbereg->BINODE); - - ptbereg = listbereg; - listbereg = listbereg->NEXT; - autfreeblock (ptbereg); - } - - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_freberin.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_freberin */ -/* description : delete a list of BEAUX structures and all objects */ -/* pointed by any os BEAUXs in the list */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_freberin (listberin) - -struct berin *listberin; /* list of berin to be deleted */ - - { - struct berin *ptberin; - - /* ###------------------------------------------------------### */ - /* for each object of the list delete the object itself */ - /* ###------------------------------------------------------### */ - - while (listberin != NULL) - { - ptberin = listberin; - listberin = listberin->NEXT; - autfreeblock (ptberin); - } - - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_frebiabl.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_frebiabl */ -/* description : delete a list of BIABL structures and all objects */ -/* pointed by any os BIABLs in the list */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_frebiabl (listbiabl) - -struct biabl *listbiabl; /* list of biabl to be deleted */ - - { - struct biabl *ptbiabl; - - /* ###------------------------------------------------------### */ - /* for each object of the list, first delete pointed objects */ - /* then, delete the object itself */ - /* ###------------------------------------------------------### */ - - while (listbiabl != NULL) - { - freeablexpr (listbiabl->VALABL); - freeablexpr (listbiabl->CNDABL); - freeptype(listbiabl->USER); - - ptbiabl = listbiabl; - listbiabl = listbiabl->NEXT; - autfreeblock (ptbiabl); - } - - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_frebinod.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_frebinode */ -/* description : delete a list of BINODE structures and all objects */ -/* pointed by any os BINODEs in the list */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -void beh_frebinode (listbinode) - -struct binode *listbinode; /* list of binode to be deleted */ - - { - struct binode *ptbinode; - - /* ###------------------------------------------------------### */ - /* for each object of the list, first delete pointed objects */ - /* then, delete the object itself */ - /* ###------------------------------------------------------### */ - - while (listbinode != NULL) - { - ptbinode = listbinode; - listbinode = listbinode->NEXT; - autfreeblock (ptbinode); - } - - } diff --git a/alliance/src/abe/src/beh_getgenva.c b/alliance/src/abe/src/beh_getgenva.c deleted file mode 100644 index b343a9b0..00000000 --- a/alliance/src/abe/src/beh_getgenva.c +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_getgenva.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -#include -#include MUT_H -#include AUT_H -#include ABL_H -#include ABE_H - -/* ###--------------------------------------------------------------### */ -/* function : beh_getgenval */ -/* description : Search an find a BEGEN structure (known from its name)*/ -/* then return its value field. If the BEGEN is not found*/ -/* a NULL pointer is returned */ -/* called func. : */ -/* ###--------------------------------------------------------------### */ - -void *beh_getgenval (listbegen, begenname) - -struct begen *listbegen; /* head of BEGEN list */ -char *begenname; /* name of the structure */ - - { - struct begen *ptbegen; - void *value = NULL; - - /* ###------------------------------------------------------### */ - /* searching the object */ - /* ###------------------------------------------------------### */ - - ptbegen = listbegen; - while ((ptbegen != NULL) && (ptbegen->NAME != begenname)) - ptbegen = ptbegen->NEXT; - - /* ###------------------------------------------------------### */ - /* if found return its value field */ - /* ###------------------------------------------------------### */ - - if (ptbegen != NULL) - value = ptbegen->VALUE; - - return (value); - } diff --git a/alliance/src/abe/src/beh_message.c b/alliance/src/abe/src/beh_message.c deleted file mode 100644 index 5820374a..00000000 --- a/alliance/src/abe/src/beh_message.c +++ /dev/null @@ -1,65 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_message.c */ -/* date : Jun 15 1994 */ -/* version : v107 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -#include - -/* ###--------------------------------------------------------------### */ -/* function : bvl_message */ -/* description : print a message on the standard output */ -/* called func. : none */ -/* ###--------------------------------------------------------------### */ - -void beh_message (code, str1) - -int code; -char *str1; - - { - (void) fprintf (stdout, "BEH : "); - - switch (code) - { - case 3: - (void) fprintf (stdout, "Compiling `%s` (Behaviour) ...\n", str1); - break; - case 13: - (void) fprintf (stdout, "Saving '%s' in a vhdl file (vbe)\n", str1); - break; - default: - (void) fprintf (stdout, "%s\n", str1); - } - } diff --git a/alliance/src/abe/src/beh_rmv.c b/alliance/src/abe/src/beh_rmv.c deleted file mode 100644 index 4ffac8fc..00000000 --- a/alliance/src/abe/src/beh_rmv.c +++ /dev/null @@ -1,811 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_rmvbeaux.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -#include -#include MUT_H -#include AUT_H -#include ABL_H -#include ABE_H - -/* ###--------------------------------------------------------------### */ -/* function : beh_rmvbeaux */ -/* description : delete a BEAUX structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock, freeablexpr */ -/* ###--------------------------------------------------------------### */ - -struct beaux *beh_rmvbeaux (listbeaux, beauxname, mode) - -struct beaux *listbeaux; /* list of beaux containing the object */ -char *beauxname; /* name of the BEAUX to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct beaux headaux; - struct beaux *ptlastaux; - struct beaux *ptbeaux; - - if (listbeaux != NULL) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headaux.NEXT = listbeaux; - headaux.NAME = NULL ; - headaux.ABL = NULL ; - ptbeaux = &headaux; - while ((ptbeaux != NULL) && (ptbeaux->NAME != beauxname)) - { - ptlastaux = ptbeaux; - ptbeaux = ptbeaux->NEXT; - } - - if (ptbeaux != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if (ptbeaux->ABL != NULL) - (void) fprintf (stderr,"BEH_warning : beaux `%s` not empty\n", - beauxname); - } - else - freeablexpr (ptbeaux->ABL); - - ptlastaux->NEXT = ptbeaux->NEXT; - autfreeblock (ptbeaux); - } - - listbeaux = headaux.NEXT; - } - - return(listbeaux); - } -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_rmvbebus.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_rmvbebus */ -/* description : delete a BEBUS structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock, beh_frebiabl, beh_frebinode */ -/* ###--------------------------------------------------------------### */ - -struct bebus *beh_rmvbebus (listbebus, bebusname, mode) - -struct bebus *listbebus; /* list of bebus containing the object */ -char *bebusname; /* name of the BEBUS to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct bebus headbus; - struct bebus *ptlastbus; - struct bebus *ptbebus; - - if (listbebus != NULL) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headbus.NEXT = listbebus; - headbus.NAME = NULL ; - headbus.BIABL = NULL ; - headbus.BINODE = NULL ; - ptbebus = &headbus; - while ((ptbebus != NULL) && (ptbebus->NAME != bebusname)) - { - ptlastbus = ptbebus; - ptbebus = ptbebus->NEXT; - } - - if (ptbebus != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if ((ptbebus->BIABL != NULL) || (ptbebus->BINODE != NULL)) - (void) fprintf (stderr,"BEH_warning : bebus `%s` not empty\n", - bebusname); - } - else - { - beh_frebiabl (ptbebus->BIABL); - beh_frebinode (ptbebus->BINODE); - } - - ptlastbus->NEXT = ptbebus->NEXT; - autfreeblock (ptbebus); - } - - listbebus = headbus.NEXT; - } - - return(listbebus); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_rmvbebux.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_rmvbebux */ -/* description : delete a BEBUX structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock, beh_frebiabl, beh_frebinode */ -/* ###--------------------------------------------------------------### */ - -struct bebux *beh_rmvbebux (listbebux, bebuxname, mode) - -struct bebux *listbebux; /* list of bebux containing the object */ -char *bebuxname; /* name of the BEBUX to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct bebux headbux; - struct bebux *ptlastbux; - struct bebux *ptbebux; - - if (listbebux != NULL) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headbux.NEXT = listbebux; - headbux.NAME = NULL ; - headbux.BIABL = NULL ; - headbux.BINODE = NULL ; - ptbebux = &headbux; - while ((ptbebux != NULL) && (ptbebux->NAME != bebuxname)) - { - ptlastbux = ptbebux; - ptbebux = ptbebux->NEXT; - } - - if (ptbebux != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if ((ptbebux->BIABL != NULL) || (ptbebux->BINODE != NULL)) - (void) fprintf (stderr,"BEH_warning : bebux `%s` not empty\n", - bebuxname); - } - else - { - beh_frebiabl (ptbebux->BIABL); - beh_frebinode (ptbebux->BINODE); - } - - ptlastbux->NEXT = ptbebux->NEXT; - autfreeblock (ptbebux); - } - - listbebux = headbux.NEXT; - } - - return(listbebux); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_rmvbefig.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_rmvbefig */ -/* description : delete a BEFIG structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N. */ -/* called func. : autfreeblock , beh_frebereg, beh_frebemsg, */ -/* beh_freberin, beh_frebeout, beh_frebebus, */ -/* beh_frebeaux, beh_frebebux, beh_frebepor, */ -/* beh_frebegen, getptype */ -/* ###--------------------------------------------------------------### */ - -struct befig *beh_rmvbefig (listbefig, befigname, mode) - -struct befig *listbefig; /* list of befig containing the object */ -char *befigname; /* name of the BEFIG to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct befig headfig; - struct befig *ptlastfig; - struct befig *ptbefig; - struct ptype *ptptype; - - if (listbefig != NULL) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headfig.NEXT = listbefig; - headfig.NAME = NULL ; - headfig.BEREG = NULL ; - headfig.BEMSG = NULL ; - headfig.BERIN = NULL ; - headfig.BEAUX = NULL ; - headfig.BEBUX = NULL ; - headfig.BEDLY = NULL ; - headfig.BEPOR = NULL ; - headfig.BEPGM = NULL ; - headfig.USER = NULL ; - ptbefig = &headfig; - while ((ptbefig != NULL) && (ptbefig->NAME != befigname)) - { - ptlastfig = ptbefig; - ptbefig = ptbefig->NEXT; - } - - if (ptbefig != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if ((ptbefig->BEREG != NULL) || (ptbefig->BEMSG != NULL) || - (ptbefig->BERIN != NULL) || (ptbefig->BEOUT != NULL) || - (ptbefig->BEBUS != NULL) || (ptbefig->BEAUX != NULL) || - (ptbefig->BEBUX != NULL) || (ptbefig->BEDLY != NULL) || - (ptbefig->BEPOR != NULL) || (ptbefig->USER != NULL) || - (ptbefig->BEPGM != NULL)) - - (void) fprintf (stderr,"BEH_warning : befig `%s` not empty\n", - befigname); - } - else - { - beh_frebereg (ptbefig->BEREG); - beh_frebemsg (ptbefig->BEMSG); - beh_freberin (ptbefig->BERIN); - beh_frebeout (ptbefig->BEOUT); - beh_frebebus (ptbefig->BEBUS); - beh_frebeaux (ptbefig->BEAUX); - beh_frebeaux (ptbefig->BEDLY); - beh_frebebux (ptbefig->BEBUX); - beh_frebepor (ptbefig->BEPOR); - beh_frebepgm (ptbefig->BEPGM); - if ((ptptype = getptype (ptbefig->USER,BEH_GENERIC)) != NULL) - beh_frebegen (ptptype->DATA); - } - - ptlastfig->NEXT = ptbefig->NEXT; - autfreeblock (ptbefig); - } - - listbefig = headfig.NEXT; - } - - return(listbefig); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_rmvbegen.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_rmvbegen */ -/* description : delete a BEGEN structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -struct begen *beh_rmvbegen (listbegen, begenname, mode) - -struct begen *listbegen; /* list of begen containing the object */ -char *begenname; /* name of the BEGEN to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct begen headgen; - struct begen *ptlastgen; - struct begen *ptbegen; - - if (listbegen != NULL) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headgen.NEXT = listbegen; - headgen.NAME = NULL ; - headgen.VALUE = NULL ; - ptbegen = &headgen; - while ((ptbegen != NULL) && (ptbegen->NAME != begenname)) - { - ptlastgen = ptbegen; - ptbegen = ptbegen->NEXT; - } - - if (ptbegen != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if (ptbegen->VALUE != NULL) - (void) fprintf (stderr,"BEH_warning : begen `%s` not empty\n", - begenname); - } - else - autfreeblock (ptbegen->VALUE); - - ptlastgen->NEXT = ptbegen->NEXT; - autfreeblock (ptbegen); - } - - listbegen = headgen.NEXT; - } - - return(listbegen); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_rmvbemsg.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_rmvbemsg */ -/* description : delete a BEMSG structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock, freeablexpr */ -/* ###--------------------------------------------------------------### */ - -struct bemsg *beh_rmvbemsg (listbemsg, bemsglabl, mode) - -struct bemsg *listbemsg; /* list of bemsg containing the object */ -char *bemsglabl; /* label of the BEMSG to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct bemsg headmsg; - struct bemsg *ptlastmsg; - struct bemsg *ptbemsg; - - if (listbemsg != NULL) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headmsg.NEXT = listbemsg; - headmsg.LABEL = NULL ; - headmsg.ABL = NULL ; - ptbemsg = &headmsg; - while ((ptbemsg != NULL) && (ptbemsg->LABEL != bemsglabl)) - { - ptlastmsg = ptbemsg; - ptbemsg = ptbemsg->NEXT; - } - - if (ptbemsg != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if (ptbemsg->ABL != NULL) - (void) fprintf (stderr,"BEH_warning : bemsg `%s` not empty\n", - bemsglabl); - } - else - freeablexpr (ptbemsg->ABL); - - ptlastmsg->NEXT = ptbemsg->NEXT; - autfreeblock (ptbemsg); - } - - listbemsg = headmsg.NEXT; - } - - return(listbemsg); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_rmvbeout.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_rmvbeout */ -/* description : delete a BEOUT structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock, freeablexpr */ -/* ###--------------------------------------------------------------### */ - -struct beout *beh_rmvbeout (listbeout, beoutname, mode) - -struct beout *listbeout; /* list of beout containing the object */ -char *beoutname; /* name of the BEOUT to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct beout headout; - struct beout *ptlastout; - struct beout *ptbeout; - - if (listbeout != NULL) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headout.NEXT = listbeout; - headout.NAME = NULL ; - headout.ABL = NULL ; - ptbeout = &headout; - while ((ptbeout != NULL) && (ptbeout->NAME != beoutname)) - { - ptlastout = ptbeout; - ptbeout = ptbeout->NEXT; - } - - if (ptbeout != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if (ptbeout->ABL != NULL) - (void) fprintf (stderr,"BEH_warning : beout `%s` not empty\n", - beoutname); - } - else - freeablexpr (ptbeout->ABL); - - ptlastout->NEXT = ptbeout->NEXT; - autfreeblock (ptbeout); - } - - listbeout = headout.NEXT; - } - - return(listbeout); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_rmvbepor.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_rmvbepor */ -/* description : delete a BEPOR structure and return the pointer of */ -/* the next object. */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -struct bepor *beh_rmvbepor (listbepor, beporname) - -struct bepor *listbepor; /* list of bepor containing the object */ -char *beporname; /* name of the BEPOR to be deleted */ - - { - struct bepor headpor; - struct bepor *ptlastpor; - struct bepor *ptbepor; - - if (listbepor != NULL) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headpor.NEXT = listbepor; - headpor.NAME = NULL ; - ptbepor = &headpor; - while ((ptbepor != NULL) && (ptbepor->NAME != beporname)) - { - ptlastpor = ptbepor; - ptbepor = ptbepor->NEXT; - } - - if (ptbepor != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* ###------------------------------------------------------### */ - - ptlastpor->NEXT = ptbepor->NEXT; - autfreeblock (ptbepor); - } - - listbepor = headpor.NEXT; - } - - return(listbepor); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_rmvbereg.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_rmvbereg */ -/* description : delete a BEREG structure and return the pointer of */ -/* the next object. A warning is printed out if the */ -/* object to be deleted is not empty when the mode is N */ -/* called func. : autfreeblock, beh_frebiabl, beh_frebinode */ -/* ###--------------------------------------------------------------### */ - -struct bereg *beh_rmvbereg (listbereg, beregname, mode) - -struct bereg *listbereg; /* list of bereg containing the object */ -char *beregname; /* name of the BEREG to be deleted */ -char mode; /* recursive delete or not (Y or N) */ - - { - struct bereg headreg; - struct bereg *ptlastreg; - struct bereg *ptbereg; - - if (listbereg != NULL) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headreg.NEXT = listbereg; - headreg.NAME = NULL ; - headreg.BIABL = NULL ; - headreg.BINODE = NULL ; - ptbereg = &headreg; - while ((ptbereg != NULL) && (ptbereg->NAME != beregname)) - { - ptlastreg = ptbereg; - ptbereg = ptbereg->NEXT; - } - - if (ptbereg != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* If the object has been found check the mode and, if asked */ - /* delete pointed objects recursively. */ - /* ###------------------------------------------------------### */ - - if (mode == 'N') - { - if ((ptbereg->BIABL != NULL) || (ptbereg->BINODE != NULL)) - (void) fprintf (stderr,"BEH_warning : bereg `%s` not empty\n", - beregname); - } - else - { - beh_frebiabl (ptbereg->BIABL); - beh_frebinode (ptbereg->BINODE); - } - - ptlastreg->NEXT = ptbereg->NEXT; - autfreeblock (ptbereg); - } - - listbereg = headreg.NEXT; - } - - return(listbereg); - } - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_rmvberin.c */ -/* date : Sep 20 1994 */ -/* version : v107 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -/* ###--------------------------------------------------------------### */ -/* function : beh_rmvberin */ -/* description : delete a BERIN structure and return the pointer of */ -/* the next object. */ -/* called func. : autfreeblock */ -/* ###--------------------------------------------------------------### */ - -struct berin *beh_rmvberin (listberin, berinname) - -struct berin *listberin; /* list of berin containing the object */ -char *berinname; /* name of the BERIN to be deleted */ - - { - struct berin headrin; - struct berin *ptlastrin; - struct berin *ptberin; - - if (listberin != NULL) - { - - /* ###------------------------------------------------------### */ - /* Search the object to be deleted */ - /* ###------------------------------------------------------### */ - - headrin.NEXT = listberin; - headrin.NAME = NULL; - headrin.OUT_REF = NULL; - headrin.MSG_REF = NULL; - headrin.AUX_REF = NULL; - headrin.BUX_REF = NULL; - headrin.BUS_REF = NULL; - headrin.REG_REF = NULL; - headrin.DLY_REF = NULL; - ptberin = &headrin; - while ((ptberin != NULL) && (ptberin->NAME != berinname)) - { - ptlastrin = ptberin; - ptberin = ptberin->NEXT; - } - - if (ptberin != NULL) - { - - /* ###------------------------------------------------------### */ - /* If the object doesn't exist return the list without */ - /* modification. */ - /* ###------------------------------------------------------### */ - - freechain (ptberin->OUT_REF); - freechain (ptberin->MSG_REF); - freechain (ptberin->AUX_REF); - freechain (ptberin->BUX_REF); - freechain (ptberin->BUS_REF); - freechain (ptberin->REG_REF); - freechain (ptberin->DLY_REF); - - ptlastrin->NEXT = ptberin->NEXT; - autfreeblock (ptberin); - } - - listberin = headrin.NEXT; - } - - return(listberin); - } diff --git a/alliance/src/abe/src/beh_toolbug.c b/alliance/src/abe/src/beh_toolbug.c deleted file mode 100644 index 03af068b..00000000 --- a/alliance/src/abe/src/beh_toolbug.c +++ /dev/null @@ -1,105 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_toolbug.c */ -/* date : Sep 3 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* content : low-level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -#include -#include MUT_H -#include AUT_H - -/* ###--------------------------------------------------------------### */ -/* function : beh_toolbug */ -/* description : print an error message on the standard error output */ -/* called func. : none */ -/* ###--------------------------------------------------------------### */ - -void beh_toolbug (code, str1, str2, nbr1) - -int code; -char *str1; -char *str2; -int nbr1; - - { - fprintf (stderr,"Fatal error %d executing `%s`: ", code, str1); - switch (code) - { - case 1: - fprintf (stderr,"unknown operator\n"); - break; - case 2: - fprintf (stderr,"cannot create empty atom\n"); - break; - case 3: - fprintf (stderr,"cannot build NOT of empty expression\n"); - break; - case 4: - fprintf (stderr,"cannot combine empty expressions\n"); - break; - case 5: - fprintf (stderr,"cannot find terminal\n"); - break; - case 10: - fprintf (stderr,"decompiler called on empty figure\n"); - break; - case 15 : - fprintf (stderr,"illegal bit string value : `%c`\n",nbr1); - break; - case 16 : - fprintf (stderr,"the same expression cannot be used twice\n"); - break; - case 19: - fprintf (stderr,"empty guard expression: `%s`\n",str2); - break; - case 20: - fprintf (stderr,"empty waveform expression: `%s`\n",str2); - break; - case 100 : - fprintf (stderr, "illegal use of attribute STABLE\n"); - break; - case 101 : - fprintf (stderr, "unknown terminal operand `%s`\n", str2); - break; - case 102 : - fprintf (stderr, "unknown operator `%d`\n", nbr1); - break; - case 103 : - fprintf (stderr, "empty expression\n"); - break; - default: - fprintf (stderr, "BUG\n"); - } - autexit(1); - } diff --git a/alliance/src/abe/src/beh_view.c b/alliance/src/abe/src/beh_view.c deleted file mode 100644 index a526ab4d..00000000 --- a/alliance/src/abe/src/beh_view.c +++ /dev/null @@ -1,263 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : FBH | -| | -| File : beh_view.c | -| | -| Author : Jacomme Ludovic | -| | -| Date : 09.11.99 | -| | -\------------------------------------------------------------*/ - -#include MUT_H -#include AUT_H -#include ABL_H -#include ABE_H - -static void loc_beh_viewablexprln( Expr ) - - ablexpr *Expr; -{ - if ( Expr == (ablexpr *)0 ) - { - fprintf( stdout, "NULL\n" ); - } - else - { - viewablexprln( Expr, ABL_VIEW_VHDL ); - } -} - -void beh_viewbiabl( BiAbl ) - - biabl_list *BiAbl; -{ - if ( BiAbl == (biabl_list *)0 ) - { - fprintf( stdout, "NULL\n" ); - } - else - { - while ( BiAbl != (biabl_list *)0 ) - { - fprintf( stdout, "--> biabl_list\n" ); - fprintf( stdout, " LABEL : %s\n", BiAbl->LABEL ); - fprintf( stdout, " CNDABL : " ); - loc_beh_viewablexprln( BiAbl->CNDABL ); - fprintf( stdout, " VALABL : " ); - loc_beh_viewablexprln( BiAbl->VALABL ); - fprintf( stdout, "<-- biabl_list\n" ); - - BiAbl = BiAbl->NEXT; - } - } -} - -void beh_viewberin( ScanRin ) - - berin_list *ScanRin; -{ - if ( ScanRin != (berin_list *)0 ) - { - fprintf( stdout, "--> berin_list\n" ); - fprintf( stdout, " NAME : %s\n", ScanRin->NAME ); - fprintf( stdout, "<-- berin_list\n" ); - } -} - -void beh_viewbereg( ScanReg ) - - bereg_list *ScanReg; -{ - if ( ScanReg != (bereg_list *)0 ) - { - fprintf( stdout, "--> bereg_list\n" ); - fprintf( stdout, " NAME : %s\n", ScanReg->NAME ); - fprintf( stdout, " BIABL :\n" ); - beh_viewbiabl( ScanReg->BIABL ); - fprintf( stdout, "<-- bereg_list\n" ); - } -} - -void beh_viewbebux( ScanBux ) - - bebux_list *ScanBux; -{ - if ( ScanBux != (bebux_list *)0 ) - { - fprintf( stdout, "--> bebux_list\n" ); - fprintf( stdout, " NAME : %s\n", ScanBux->NAME ); - fprintf( stdout, " TYPE : %c\n", (int)ScanBux->TYPE ); - fprintf( stdout, " BIABL :\n" ); - beh_viewbiabl( ScanBux->BIABL ); - fprintf( stdout, "<-- bebux_list\n" ); - } -} - -void beh_viewbebus( ScanBus ) - - bebus_list *ScanBus; -{ - if ( ScanBus != (bebus_list *)0 ) - { - fprintf( stdout, "--> bebus_list\n" ); - fprintf( stdout, " NAME : %s\n", ScanBus->NAME ); - fprintf( stdout, " TYPE : %c\n", (int)ScanBus->TYPE ); - fprintf( stdout, " BIABL :\n" ); - beh_viewbiabl( ScanBus->BIABL ); - fprintf( stdout, "<-- bebus_list\n" ); - } -} - -void beh_viewbeaux( ScanAux ) - - beaux_list *ScanAux; -{ - if ( ScanAux != (beaux_list *)0 ) - { - fprintf( stdout, "--> beaux_list\n" ); - fprintf( stdout, " NAME : %s\n", ScanAux->NAME ); - fprintf( stdout, " ABL :" ); - loc_beh_viewablexprln( ScanAux->ABL, ABL_VIEW_VHDL ); - fprintf( stdout, "<-- beaux_list\n" ); - } -} - -void beh_viewbeout( ScanOut ) - - beout_list *ScanOut; -{ - if ( ScanOut != (beout_list *)0 ) - { - fprintf( stdout, "--> beout_list\n" ); - fprintf( stdout, " NAME : %s\n", ScanOut->NAME ); - fprintf( stdout, " ABL :" ); - loc_beh_viewablexprln( ScanOut->ABL ); - fprintf( stdout, "<-- beout_list\n" ); - } -} - -void beh_viewbepor( ScanPort ) - - bepor_list *ScanPort; -{ - if ( ScanPort != (bepor_list *)0 ) - { - fprintf( stdout, "--> bepor_list\n" ); - fprintf( stdout, " NAME : %s\n", ScanPort->NAME ); - fprintf( stdout, " DIR : %c\n", ScanPort->DIRECTION ); - fprintf( stdout, " TYPE : %c\n", (int)ScanPort->TYPE ); - fprintf( stdout, "<-- bepor_list\n" ); - } -} - -void beh_viewbefig( ScanFigure ) - - befig_list *ScanFigure; -{ - bepor_list *ScanPort; - beaux_list *ScanAux; - bebus_list *ScanBus; - bebux_list *ScanBux; - bereg_list *ScanReg; - beout_list *ScanOut; - berin_list *ScanRin; - - if ( ScanFigure != (befig_list *)0 ) - { - fprintf( stdout, "--> befig_list\n" ); - fprintf( stdout, " NAME : %s\n", ScanFigure->NAME ); - - fprintf( stdout, " BEPOR:\n" ); - - for ( ScanPort = ScanFigure->BEPOR; - ScanPort != (bepor_list *)0; - ScanPort = ScanPort->NEXT ) - { - beh_viewbepor( ScanPort ); - } - - fprintf( stdout, " BERIN:\n" ); - - for ( ScanRin = ScanFigure->BERIN; - ScanRin != (berin_list *)0; - ScanRin = ScanRin->NEXT ) - { - beh_viewberin( ScanRin ); - } - - fprintf( stdout, " BEAUX:\n" ); - - for ( ScanAux = ScanFigure->BEAUX; - ScanAux != (beaux_list *)0; - ScanAux = ScanAux->NEXT ) - { - beh_viewbeaux( ScanAux ); - } - - fprintf( stdout, " BEBUS:\n" ); - - for ( ScanBus = ScanFigure->BEBUS; - ScanBus != (bebus_list *)0; - ScanBus = ScanBus->NEXT ) - { - beh_viewbebus( ScanBus ); - } - - fprintf( stdout, " BEBUX:\n" ); - - for ( ScanBux = ScanFigure->BEBUX; - ScanBux != (bebux_list *)0; - ScanBux = ScanBux->NEXT ) - { - beh_viewbebux( ScanBux ); - } - - fprintf( stdout, " BEREG:\n" ); - - for ( ScanReg = ScanFigure->BEREG; - ScanReg != (bereg_list *)0; - ScanReg = ScanReg->NEXT ) - { - beh_viewbereg( ScanReg ); - } - - fprintf( stdout, " BEOUT:\n" ); - - for ( ScanOut = ScanFigure->BEOUT; - ScanOut != (beout_list *)0; - ScanOut = ScanOut->NEXT ) - { - beh_viewbeout( ScanOut ); - } - - fprintf( stdout, "<-- befig_list\n" ); - } -} diff --git a/alliance/src/abe/src/main.c b/alliance/src/abe/src/main.c deleted file mode 100644 index b7b48ee0..00000000 --- a/alliance/src/abe/src/main.c +++ /dev/null @@ -1,230 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Beh | -| | -| File : main.c | -| | -| Date : 08.02.95 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include -# include - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H -# include ABE_H -# include ABV_H -# include ABT_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Usage | -| | -\------------------------------------------------------------*/ - -void BehUsage() -{ - fprintf( stderr, "\t\tabetest [Options] Input_name [Output_name]\n\n" ); - fprintf( stdout, "\t\tOptions : -V Sets Verbose mode on\n" ); - fprintf( stdout, "\t\tOptions : -E Erases auxialiry signals\n" ); - fprintf( stdout, "\t\tOptions : -D Displays beh figure\n" ); - fprintf( stdout, "\t\tOptions : -B Makes BDD nodes\n" ); - fprintf( stdout, "\t\tOptions : -S Saves beh figure \n" ); - fprintf( stdout, "\n" ); - - exit( 1 ); -} - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| main | -| | -\------------------------------------------------------------*/ - -int main( argc, argv ) - - int argc; - char *argv[]; -{ - befig_list *BehFigure; - char *InputFileName; - char *OutputFileName; - int Number; - int Index; - char Option; - - int FlagVerbose = 0; - int FlagSave = 0; - int FlagDisplay = 0; - int FlagErase = 0; - int FlagBdd = 0; - - mbkenv(); - autenv(); - ablenv(); - bddenv(); - - InputFileName = (char *)0; - OutputFileName = (char *)0; - - if ( argc < 2 ) BehUsage(); - - for ( Number = 1; Number < argc; Number++ ) - { - if ( argv[ Number ][ 0 ] == '-' ) - { - for ( Index = 1; argv[ Number ][ Index ] != '\0'; Index++ ) - { - Option = argv[ Number ][ Index ]; - - switch ( Option ) - { - case 'E' : FlagErase = 1; - break; - case 'B' : FlagBdd = 1; - break; - case 'D' : FlagDisplay = 1; - break; - case 'V' : FlagVerbose = 1; - break; - case 'S' : FlagSave = 1; - break; - default : BehUsage(); - } - } - } - else - if ( InputFileName == (char *)0 ) InputFileName = argv[ Number ]; - else - if ( OutputFileName == (char *)0 ) OutputFileName = argv[ Number ]; - else - BehUsage(); - } - - if ( InputFileName == (char *)0 ) BehUsage(); - if ( OutputFileName == (char *)0 ) OutputFileName = InputFileName; - - if ( FlagVerbose ) - { - fprintf( stdout, "vhdlloadbefig %s\n", InputFileName ); - } - - BehFigure = vhdlloadbefig( (befig_list *)0, InputFileName, 3 ); - - if ( FlagVerbose ) - { - fprintf( stdout, "Figure %s loaded\n", BehFigure->NAME ); - } - -/*\ - if ( FlagBdd ) - { - BddSystem = createbddsystem( 100, 1000, 100, 5000000 ); - reorderbddsystemdynamic( BddSystem, reorderbddsystemsimple, 100000, 100 ); - - if ( FlagVerbose ) - { - fprintf( stdout, "Makes BDD for %s\n", BehFigure->NAME ); - } - - BehFigure->BEDLY = (beaux_list *)0; - beh_makbdd( BehFigure, ! FlagErase, 0 ); - - testbddcircuit( (bddcircuit *)0 ); - - destroybddcircuit( BehFigure->CIRCUI ); - destroybddsystem( BddSystem ); - } - else - if ( FlagErase ) - { - if ( FlagVerbose ) - { - fprintf( stdout, "Erases auxialiary signals in %s\n", BehFigure->NAME ); - } - - beh_delauxabl( BehFigure ); - } -\*/ - - if ( FlagSave ) - { - BehFigure->NAME = namealloc( OutputFileName ); - - if ( FlagVerbose ) - { - fprintf( stdout, "vhdlsavebefig %s\n", BehFigure->NAME ); - } - vhdlsavebefig ( BehFigure, 0 ); - - if ( FlagVerbose ) - { - fprintf( stdout, "Figure %s saved\n", BehFigure->NAME ); - } - } - - if ( FlagDisplay ) - { - beh_viewbefig( BehFigure ); - } - - beh_frebefig( BehFigure ); - - return( 0 ); -} diff --git a/alliance/src/abt/Makefile.am b/alliance/src/abt/Makefile.am deleted file mode 100644 index af437a64..00000000 --- a/alliance/src/abt/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = src diff --git a/alliance/src/abt/configure.in b/alliance/src/abt/configure.in deleted file mode 100644 index da86d5ad..00000000 --- a/alliance/src/abt/configure.in +++ /dev/null @@ -1,45 +0,0 @@ -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 -dnl $Id: configure.in,v 1.1 2002/03/20 14:05:32 ludo Exp $ -dnl -dnl -AC_INIT(src/abt.h) -AM_INIT_AUTOMAKE(abt, 2.1) -AC_PROG_INSTALL -AC_PROG_CC -AC_HEADER_STDC -AC_C_CONST -AC_PROG_RANLIB - -AM_ALLIANCE - -AC_OUTPUT([ -Makefile -src/Makefile -]) diff --git a/alliance/src/abt/src/Makefile.am b/alliance/src/abt/src/Makefile.am deleted file mode 100644 index fd9ce4fb..00000000 --- a/alliance/src/abt/src/Makefile.am +++ /dev/null @@ -1,8 +0,0 @@ -CFLAGS = @CFLAGS@ \ - -DALLIANCE_TOP=\"${ALLIANCE_TOP}\" -lib_LIBRARIES = libAbt.a -include_HEADERS = abt.h -libAbt_a_SOURCES = \ -abt.h bhl_depend.c bhl_freabl.c bhl_makgex.c \ -bhl_delaux.c bhl_error.c bhl_makbdd.c bhl_orderbdd.c \ -bhl_delaux.h bhl_error.h bhl_makbdd.h bhl_orderbdd.h diff --git a/alliance/src/abt/src/abt.h b/alliance/src/abt/src/abt.h deleted file mode 100644 index 81041bd7..00000000 --- a/alliance/src/abt/src/abt.h +++ /dev/null @@ -1,60 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : bhl200.h */ -/* date : Feb 15 1995 */ -/* version : v200 */ -/* author : Pirouz BAZARGAN SABET */ -/* contents : defines and structure definitions used in BHL library */ -/* */ -/* ###--------------------------------------------------------------### */ - -#ifndef ABT_BHLDEF -#define ABT_BHLDEF - - /* ###------------------------------------------------------### */ - /* defines */ - /* ###------------------------------------------------------### */ - - /* ###------------------------------------------------------### */ - /* structure definitions */ - /* ###------------------------------------------------------### */ - - /* ###------------------------------------------------------### */ - /* functions */ - /* ###------------------------------------------------------### */ - -extern void beh_debug (); -extern void beh_makbdd (); -extern void beh_makgex (); -extern void beh_freabl (); -extern struct chain *beh_depend (); -extern void beh_delauxabl (); - -#endif diff --git a/alliance/src/abt/src/bhl_delaux.c b/alliance/src/abt/src/bhl_delaux.c deleted file mode 100644 index fc553090..00000000 --- a/alliance/src/abt/src/bhl_delaux.c +++ /dev/null @@ -1,404 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bhl | -| | -| File : bhl_delaux.c | -| | -| Date : 01.02.95 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "abl.h" -# include "abe.h" -# include "abt.h" - -# include -# include "bhl_error.h" -# include "bhl_delaux.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static chain_list *BhlHeadName = (chain_list *)0; - static befig_list *BhlBehFigure = (befig_list *)0; - static char *BhlDelayedName = (char *)0; - static authtable *BhlHashTableInput = (authtable *)0; - static authtable *BhlHashTableAux = (authtable *)0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bhl DelAux Expr | -| | -\------------------------------------------------------------*/ - -static chain_list *bhl_delauxexpr( Expr ) - - chain_list *Expr; -{ - char *AtomValue; - chain_list *FirstExpr; - beaux_list *ScanAux; - chain_list *ScanChain; - authelem *Element; - long Oper; - - FirstExpr = Expr; - - if ( Expr == (chain_list *)0 ) - { - bhlerror( BHL_EXPR_NULL_ERROR, (char *)0 ); - } - - if ( ABL_ATOM( Expr ) ) - { - AtomValue = ABL_ATOM_VALUE( Expr ); - - if ( ( AtomValue == ABL_ATOM_NAME_ONE ) || - ( AtomValue == ABL_ATOM_NAME_ZERO ) || - ( AtomValue == ABL_ATOM_NAME_DC ) ) - { - return( FirstExpr ); - } - - Element = searchauthelem( BhlHashTableInput, AtomValue ); - - if ( Element != (authelem *)0 ) - { - return( FirstExpr ); - } - - for ( ScanAux = BhlBehFigure->BEAUX; - ScanAux != (beaux_list *)0; - ScanAux = ScanAux->NEXT ) - { - if ( ScanAux->NAME == AtomValue ) break; - } - - if ( ScanAux == (beaux_list *)0 ) - { - bhlerror( BHL_UNKNOWN_ATOM_ERROR, AtomValue ); - } - - for ( ScanChain = BhlHeadName; - ScanChain != (chain_list *)0; - ScanChain = ScanChain->NEXT ) - { - if ( ScanChain->DATA == AtomValue ) - { - bhlerror( BHL_EXPR_LOOP_ERROR, AtomValue ); - } - } - - Element = searchauthelem( BhlHashTableAux, AtomValue ); - - if ( Element == (authelem *)0 ) - { - BhlHeadName = addchain( BhlHeadName, AtomValue ); - ScanAux->ABL = bhl_delauxexpr( ScanAux->ABL ); - BhlHeadName = delchain( BhlHeadName, BhlHeadName ); - - addauthelem( BhlHashTableAux, AtomValue, (long)ScanAux->ABL ); - } - - freeablexpr( FirstExpr ); - return( dupablexpr( ScanAux->ABL ) ); - } - - Oper = ABL_OPER( Expr ); - Expr = ABL_CDR( Expr ); - - if ( Oper == ABL_NOT ) - { - if ( ABL_CDR( Expr ) != (chain_list *)0 ) - { - bhlerror( BHL_OPERATOR_ERROR, Oper ); - } - - ABL_CAR( Expr ) = bhl_delauxexpr( ABL_CAR( Expr ) ); - - return( FirstExpr ); - } - - if ( Oper == ABL_STABLE ) - { - Expr = ABL_CAR( Expr ); - - if ( ! ABL_ATOM( Expr ) ) - { - bhlerror( BHL_ILLEGAL_STABLE_ERROR, (char *)0 ); - } - - AtomValue = ABL_ATOM_VALUE( Expr ); - Element = searchauthelem( BhlHashTableInput, AtomValue ); - - if ( Element == (authelem *)0 ) - { - bhlerror( BHL_UNKNOWN_ATOM_ERROR, AtomValue ); - } - - BhlDelayedName = autresizeblock( BhlDelayedName, 0, strlen( AtomValue ) + 9 ); - sprintf( BhlDelayedName, "%s'delayed", AtomValue ); - AtomValue = namealloc( BhlDelayedName ); - - Element = searchauthelem( BhlHashTableInput, AtomValue ); - - if ( Element == (authelem *)0 ) - { - bhlerror( BHL_UNKNOWN_ATOM_ERROR, AtomValue ); - } - - return( FirstExpr ); - } - - if ( ( isablunaryoper( Oper ) ) || - ( ABL_CDR( Expr ) == (chain_list *)0 ) ) - { - bhlerror( BHL_OPERATOR_ERROR, Oper ); - } - - ABL_CAR( Expr ) = bhl_delauxexpr( ABL_CAR( Expr ) ); - - while ( ( Expr = ABL_CDR( Expr ) ) != (chain_list *)0 ) - { - ABL_CAR( Expr ) = bhl_delauxexpr( ABL_CAR( Expr ) ); - } - - return( FirstExpr ); -} - -/*------------------------------------------------------------\ -| | -| Beh DelAux Bdd | -| | -\------------------------------------------------------------*/ - -static chain_list *bhl_delauxabl( Name, Expr ) - - char *Name; - chain_list *Expr; -{ - if ( Name != (char *)0 ) - { - BhlHeadName = addchain( BhlHeadName, Name ); - } - - Expr = bhl_delauxexpr( Expr ); - - if ( Name != (char *)0 ) - { - BhlHeadName = delchain( BhlHeadName, BhlHeadName ); - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Beh Del Aux Abl | -| | -\------------------------------------------------------------*/ - -void beh_delauxabl( BehFigure ) - - befig_list *BehFigure; -{ - struct berin *BehRin; - struct beaux *BehAux; - struct beaux *BehDly; - struct bemsg *BehMsg; - struct beout *BehOut; - struct bebus *BehBus; - struct bebux *BehBux; - struct bereg *BehReg; - struct biabl *BiAbl; - authelem *Element; - long NumberIn; - long NumberAux; - - BhlBehFigure = BehFigure; - BhlHeadName = (chain_list *)0; - NumberIn = 1; - NumberAux = 1; - - BehAux = BehFigure->BEAUX; - - while ( BehAux != NULL ) - { - BehFigure->BERIN = beh_rmvberin( BehFigure->BERIN, BehAux->NAME ); - - NumberAux = NumberAux + 1; - BehAux = BehAux->NEXT; - } - - BehRin = BehFigure->BERIN; - - while ( BehRin != NULL ) - { - NumberIn = NumberIn + 1; - BehRin = BehRin->NEXT; - } - - BhlHashTableInput = createauthtable( NumberIn << 1 ); - BhlHashTableAux = createauthtable( NumberAux << 1 ); - - BehRin = BehFigure->BERIN; - - while ( BehRin != NULL ) - { - addauthelem( BhlHashTableInput, BehRin->NAME, 0 ); - - BehRin = BehRin->NEXT; - } - - BehAux = BehFigure->BEAUX; - - while ( BehAux != NULL ) - { - Element = searchauthelem( BhlHashTableAux, BehAux->NAME ); - - if ( Element == (authelem *)0 ) - { - BehAux->ABL = bhl_delauxabl( BehAux->NAME, BehAux->ABL ); - addauthelem( BhlHashTableAux, BehAux->NAME, (long)BehAux->ABL ); - } - - BehAux = BehAux->NEXT; - } - - BehDly = BehFigure->BEDLY; - - while ( BehDly != NULL ) - { - BehDly->ABL = bhl_delauxabl( BehDly->NAME, BehDly->ABL ); - - BehDly = BehDly->NEXT; - } - - BehMsg = BehFigure->BEMSG; - - while ( BehMsg != NULL ) - { - BehMsg->ABL = bhl_delauxabl( (char *)0, BehMsg->ABL ); - - BehMsg = BehMsg->NEXT; - } - - BehOut = BehFigure->BEOUT; - - while ( BehOut != NULL ) - { - BehOut->ABL = bhl_delauxabl( BehOut->NAME, BehOut->ABL ); - - BehOut = BehOut->NEXT; - } - - BehBus = BehFigure->BEBUS; - - while ( BehBus != NULL ) - { - BiAbl = BehBus->BIABL; - - while ( BiAbl != NULL ) - { - BiAbl->CNDABL = bhl_delauxabl( (char *)0 , BiAbl->CNDABL ); - BiAbl->VALABL = bhl_delauxabl( BehBus->NAME, BiAbl->VALABL ); - - BiAbl = BiAbl->NEXT; - } - - BehBus = BehBus->NEXT; - } - - BehBux = BehFigure->BEBUX; - - while ( BehBux != NULL ) - { - BiAbl = BehBux->BIABL; - - while (BiAbl != NULL) - { - BiAbl->CNDABL = bhl_delauxabl( (char *)0, BiAbl->CNDABL ); - BiAbl->VALABL = bhl_delauxabl( (char *)0, BiAbl->VALABL ); - - BiAbl = BiAbl->NEXT; - } - - BehBux = BehBux->NEXT; - } - - BehReg = BehFigure->BEREG; - - while ( BehReg != NULL ) - { - BiAbl = BehReg->BIABL; - - while (BiAbl != NULL) - { - BiAbl->CNDABL = bhl_delauxabl( (char *)0, BiAbl->CNDABL ); - BiAbl->VALABL = bhl_delauxabl( (char *)0, BiAbl->VALABL ); - - BiAbl = BiAbl->NEXT; - } - - BehReg = BehReg->NEXT; - } - - destroyauthtable( BhlHashTableInput ); - destroyauthtable( BhlHashTableAux ); - - beh_frebeaux( BehFigure->BEAUX ); - BehFigure->BEAUX = (beaux_list *)NULL; -} diff --git a/alliance/src/abt/src/bhl_delaux.h b/alliance/src/abt/src/bhl_delaux.h deleted file mode 100644 index 4e5419a2..00000000 --- a/alliance/src/abt/src/bhl_delaux.h +++ /dev/null @@ -1,67 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bhl | -| | -| File : bhl_makbdd.h | -| | -| Date : 01.02.95 | -| | -| Author : Pirouz Bazargan Sabet | -| | -| Modified by Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BHL_MAKBDD_H -# define BHL_MAKBDD_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - - extern void beh_delauxabl(); - -# endif diff --git a/alliance/src/abt/src/bhl_depend.c b/alliance/src/abt/src/bhl_depend.c deleted file mode 100644 index ebe0ac76..00000000 --- a/alliance/src/abt/src/bhl_depend.c +++ /dev/null @@ -1,399 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_depend.c */ -/* date : Apr 15 1995 */ -/* version : v108 */ -/* authors : Pirouz BAZARGAN SABET */ -/* description : high level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -#include -#include "mut.h" -#include "aut.h" -#include "abl.h" -#include "bdd.h" -#include "abe.h" - -static ht *rin_list = NULL; - -/* ###--------------------------------------------------------------### */ -/* function : beh_terminals */ -/* description : find the list of terminals for an expression */ -/* called func. : beh_terminals, namealloc, addchain */ -/* ###--------------------------------------------------------------### */ - -static struct chain *beh_terminals (pt_exp) - -struct chain *pt_exp; - - { - struct chain *res_chain = NULL; - struct chain *tmp_chain = NULL; - struct chain *pt_opr ; - char *name ; - char buffer [128]; - static char *str_z = NULL; - static char *str_o = NULL; - static char *str_d = NULL; - - if (str_z == NULL) - { - str_z = namealloc ("'0'"); - str_o = namealloc ("'1'"); - str_d = namealloc ("'d'"); - } - - if (pt_exp->NEXT != NULL) - { - if (((int) ((struct chain *) pt_exp->DATA)->DATA) == ABL_STABLE) - { - name = ((struct chain *) pt_exp->NEXT->DATA)->DATA; - res_chain = addchain (NULL, name); - sprintf (buffer, "%s'delayed", name); - name = namealloc (buffer); - res_chain = addchain (res_chain, name); - } - else - { - pt_opr = pt_exp->NEXT; - while (pt_opr != NULL) - { - tmp_chain = beh_terminals (pt_opr->DATA); - res_chain = append (res_chain, tmp_chain); - pt_opr = pt_opr->NEXT; - } - } - } - else - { - if ((pt_exp->DATA != str_z) && (pt_exp->DATA != str_o) && - (pt_exp->DATA != str_d)) - { - res_chain = addchain (NULL, pt_exp->DATA); - } - } - - return (res_chain); - } - -/* ###--------------------------------------------------------------### */ -/* function : beh_expdepend */ -/* description : find dependencies for an expression */ -/* called func. : beh_terminals, gethtitem */ -/* ###--------------------------------------------------------------### */ - -static struct chain *beh_expdepend (pt_fig, pt_exp) - -struct befig *pt_fig; -struct chain *pt_exp; - - { - struct chain *res_chain = NULL; - int value ; - - if (pt_fig->ERRFLG == 0) - { - /* ###------------------------------------------------------### */ - /* if there is no error in the current figure, find the list */ - /* of terminals for the expression */ - /* ###------------------------------------------------------### */ - - res_chain = beh_terminals (pt_exp); - - /* ###------------------------------------------------------### */ - /* scan the list of terminals to replace terminal names by */ - /* pointer on the corresponding primary input (berin). */ - /* ###------------------------------------------------------### */ - - while (res_chain != NULL) - { - value = gethtitem (rin_list, res_chain->DATA); - - if (value == EMPTYHT) - beh_error (3, res_chain->DATA); - else - res_chain->DATA = (void *) value ; - res_chain = res_chain->NEXT; - } - - } - - return (res_chain); - } - -/* ###--------------------------------------------------------------### */ -/* function : beh_depend */ -/* description : find dependencies between signals for a behavioural */ -/* description. */ -/* called func. : beh_expdepend, addht, addhtitem, addchain, freechain, */ -/* append, delhtitem */ -/* ###--------------------------------------------------------------### */ - -void beh_depend (pt_fig) - -struct befig *pt_fig; - - { - struct chain *res_chain = NULL; - struct beaux *pt_aux; - struct beaux *pt_dly; - struct bebux *pt_bux; - struct bereg *pt_reg; - struct bemsg *pt_msg; - struct berin *pt_rin; - struct beout *pt_out; - struct bebus *pt_bus; - struct biabl *pt_biabl; - unsigned int count = 0; - - /* ###------------------------------------------------------### */ - /* if there is no error in the current figure ... */ - /* ###------------------------------------------------------### */ - - if ((pt_fig != NULL) && (pt_fig->ERRFLG == 0)) - { - /* ###------------------------------------------------------### */ - /* initialize a hash table with inputs */ - /* ###------------------------------------------------------### */ - - pt_rin = pt_fig->BERIN; - while (pt_rin != NULL) - { - count++; - pt_rin = pt_rin->NEXT; - } - - pt_rin = pt_fig->BERIN; - - if (pt_rin != NULL) - rin_list = addht (count); - - while (pt_rin != NULL) - { - addhtitem (rin_list, pt_rin->NAME, (long)pt_rin); - pt_rin = pt_rin->NEXT; - } - - /* ###------------------------------------------------------### */ - /* process simple internal signals. */ - /* check that the signal does not already belong to the */ - /* dependency list before adding it to the list */ - /* ###------------------------------------------------------### */ - - pt_aux = pt_fig->BEAUX; - while (pt_aux != NULL) - { - res_chain = beh_expdepend (pt_fig, pt_aux->ABL); - while (res_chain != NULL) - { - pt_rin = (struct berin *) res_chain->DATA; - - if ((pt_rin->AUX_REF == NULL) || (pt_rin->AUX_REF->DATA != pt_aux)) - pt_rin->AUX_REF = addchain (pt_rin->AUX_REF, pt_aux); - - res_chain = res_chain->NEXT; - } - freechain (res_chain); - pt_aux = pt_aux->NEXT; - } - - /* ###------------------------------------------------------### */ - /* process delayed internal signals */ - /* check that the signal does not already belong to the */ - /* dependency list before adding it to the list */ - /* ###------------------------------------------------------### */ - - pt_dly = pt_fig->BEDLY; - while (pt_dly != NULL) - { - res_chain = beh_expdepend (pt_fig, pt_dly->ABL); - while (res_chain != NULL) - { - pt_rin = (struct berin *) res_chain->DATA; - - if ((pt_rin->DLY_REF == NULL) || (pt_rin->DLY_REF->DATA != pt_dly)) - pt_rin->DLY_REF = addchain (pt_rin->DLY_REF, pt_dly); - - res_chain = res_chain->NEXT; - } - freechain (res_chain); - pt_dly = pt_dly->NEXT; - } - - /* ###------------------------------------------------------### */ - /* process simple ouputs. */ - /* check that the signal does not already belong to the */ - /* dependency list before adding it to the list */ - /* ###------------------------------------------------------### */ - - pt_out = pt_fig->BEOUT; - while (pt_out != NULL) - { - res_chain = beh_expdepend (pt_fig, pt_out->ABL); - while (res_chain != NULL) - { - pt_rin = (struct berin *) res_chain->DATA; - - if ((pt_rin->OUT_REF == NULL) || (pt_rin->OUT_REF->DATA != pt_out)) - pt_rin->OUT_REF = addchain (pt_rin->OUT_REF, pt_out); - - res_chain = res_chain->NEXT; - } - freechain (res_chain); - pt_out = pt_out->NEXT; - } - - /* ###------------------------------------------------------### */ - /* process bussed ouputs. */ - /* check that the signal does not already belong to the */ - /* dependency list before adding it to the list */ - /* ###------------------------------------------------------### */ - - res_chain = NULL; - pt_bus = pt_fig->BEBUS; - while (pt_bus != NULL) - { - pt_biabl = pt_bus->BIABL; - while (pt_biabl != NULL) - { - res_chain = append (res_chain, beh_expdepend (pt_fig,pt_biabl->VALABL)); - res_chain = append (res_chain, beh_expdepend (pt_fig,pt_biabl->CNDABL)); - pt_biabl = pt_biabl->NEXT; - } - - while (res_chain != NULL) - { - pt_rin = (struct berin *) res_chain->DATA; - - if ((pt_rin->BUS_REF == NULL) || (pt_rin->BUS_REF->DATA != pt_bus)) - pt_rin->BUS_REF = addchain (pt_rin->BUS_REF, pt_bus); - - res_chain = res_chain->NEXT; - } - freechain (res_chain); - pt_bus = pt_bus->NEXT; - } - - /* ###------------------------------------------------------### */ - /* process bussed internal signals. */ - /* check that the signal does not already belong to the */ - /* dependency list before adding it to the list */ - /* ###------------------------------------------------------### */ - - res_chain = NULL; - pt_bux = pt_fig->BEBUX; - while (pt_bux != NULL) - { - pt_biabl = pt_bux->BIABL; - while (pt_biabl != NULL) - { - res_chain = append (res_chain, beh_expdepend (pt_fig,pt_biabl->VALABL)); - res_chain = append (res_chain, beh_expdepend (pt_fig,pt_biabl->CNDABL)); - pt_biabl = pt_biabl->NEXT; - } - - while (res_chain != NULL) - { - pt_rin = (struct berin *) res_chain->DATA; - - if ((pt_rin->BUX_REF == NULL) || (pt_rin->BUX_REF->DATA != pt_bux)) - pt_rin->BUX_REF = addchain (pt_rin->BUX_REF, pt_bux); - - res_chain = res_chain->NEXT; - } - freechain (res_chain); - pt_bux = pt_bux->NEXT; - } - - /* ###------------------------------------------------------### */ - /* process internal registers. */ - /* check that the signal does not already belong to the */ - /* dependency list before adding it to the list */ - /* ###------------------------------------------------------### */ - - res_chain = NULL; - pt_reg = pt_fig->BEREG; - while (pt_reg != NULL) - { - pt_biabl = pt_reg->BIABL; - while (pt_biabl != NULL) - { - res_chain = append (res_chain, beh_expdepend (pt_fig,pt_biabl->VALABL)); - res_chain = append (res_chain, beh_expdepend (pt_fig,pt_biabl->CNDABL)); - pt_biabl = pt_biabl->NEXT; - } - - while (res_chain != NULL) - { - pt_rin = (struct berin *) res_chain->DATA; - - if ((pt_rin->REG_REF == NULL) || (pt_rin->REG_REF->DATA != pt_reg)) - pt_rin->REG_REF = addchain (pt_rin->REG_REF, pt_reg); - - res_chain = res_chain->NEXT; - } - freechain (res_chain); - pt_reg = pt_reg->NEXT; - } - - /* ###------------------------------------------------------### */ - /* process assert statements. */ - /* check that the statement does not already belong to the */ - /* dependency list before adding it to the list */ - /* ###------------------------------------------------------### */ - - res_chain = NULL; - pt_msg = pt_fig->BEMSG; - while (pt_msg != NULL) - { - res_chain = beh_expdepend (pt_fig, pt_msg->ABL); - while (res_chain != NULL) - { - pt_rin = (struct berin *) res_chain->DATA; - - if ((pt_rin->MSG_REF == NULL) || (pt_rin->MSG_REF->DATA != pt_msg)) - pt_rin->MSG_REF = addchain (pt_rin->MSG_REF, pt_msg); - - res_chain = res_chain->NEXT; - } - freechain (res_chain); - pt_msg = pt_msg->NEXT; - } - - /* ###------------------------------------------------------### */ - /* release hash tables and lists that they contain */ - /* ###------------------------------------------------------### */ - - if (pt_fig->BERIN != NULL) - delht(rin_list); - - } - } diff --git a/alliance/src/abt/src/bhl_error.c b/alliance/src/abt/src/bhl_error.c deleted file mode 100644 index fad4553e..00000000 --- a/alliance/src/abt/src/bhl_error.c +++ /dev/null @@ -1,131 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bhl | -| | -| File : Bhl Errors | -| | -| Authors : Jacomme Ludovic | -| | -| Date : 01.02.95 | -| | -\------------------------------------------------------------*/ - -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include -# include -# include "mut.h" -# include "aut.h" -# include "abl.h" -# include "bhl_error.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -void bhl_error( Error, Text, File, Line ) - - int Error; - char *Text; - char *File; - int Line; -{ - char *Name; - - Name = strdup( File ); - Name[ strlen( File ) - 1 ] = '\0'; - - fprintf( stderr, "%s%d ", Name, Line ); - - switch( Error ) - { - case BHL_EXPR_NULL_ERROR : - - fprintf( stderr, "null expression !\n" ); - - break; - - case BHL_EXPR_LOOP_ERROR : - - fprintf( stderr, "combinatory loop on %s !\n", Text ); - - break; - - case BHL_UNKNOWN_ATOM_ERROR : - - fprintf( stderr, "unknown atom %s !\n", Text ); - - break; - - case BHL_SIMPLIFY_ERROR : - - fprintf( stderr, "cannot simplify internal signals\n" ); - - break; - - case BHL_ILLEGAL_STABLE_ERROR : - - fprintf( stderr, "illegal use of STABLE operator\n" ); - - break; - - case BHL_OPERATOR_ERROR : - - fprintf( stderr, "illegal use of operator %ld\n", (long)Text ); - - break; - - default : - - fprintf( stderr, "unknown internal error %d !\n", Error ); - } - - autexit( 1 ); -} diff --git a/alliance/src/abt/src/bhl_error.h b/alliance/src/abt/src/bhl_error.h deleted file mode 100644 index 2403e6f4..00000000 --- a/alliance/src/abt/src/bhl_error.h +++ /dev/null @@ -1,81 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bhl | -| | -| File : Bhl Errors | -| | -| Authors : Jacomme Ludovic | -| | -| Date : 01.02.95 | -| | -\------------------------------------------------------------*/ - -# ifndef BHL_ERROR_H -# define BHL_ERROR_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# define BHL_EXPR_NULL_ERROR 0 -# define BHL_EXPR_LOOP_ERROR 1 -# define BHL_UNKNOWN_ATOM_ERROR 2 -# define BHL_SIMPLIFY_ERROR 3 -# define BHL_ILLEGAL_STABLE_ERROR 4 -# define BHL_OPERATOR_ERROR 5 - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macros | -| | -\------------------------------------------------------------*/ - -# define bhlerror( E, V ) (bhl_error( (E), (V), __FILE__, __LINE__ )) - -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - - extern void bhl_error(); - -# endif diff --git a/alliance/src/abt/src/bhl_freabl.c b/alliance/src/abt/src/bhl_freabl.c deleted file mode 100644 index 48c897c2..00000000 --- a/alliance/src/abt/src/bhl_freabl.c +++ /dev/null @@ -1,205 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_freabl.c */ -/* date : Sep 9 1993 */ -/* version : v106 */ -/* authors : Pirouz BAZARGAN SABET */ -/* description : high level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -#include -#include "mut.h" -#include "aut.h" -#include "abl.h" -#include "bdd.h" -#include "abe.h" - -/* ###--------------------------------------------------------------### */ -/* function : beh_freabl */ -/* description : free all ABLs in BEFIG structure */ -/* called func. : freeablexpr */ -/* ###--------------------------------------------------------------### */ - -void beh_freabl (ptr_befig) - -struct befig *ptr_befig; /* pointer on current BEFIG */ - { - struct beaux *ptr_beaux; - struct bemsg *ptr_bemsg; - struct beout *ptr_beout; - struct bebus *ptr_bebus; - struct biabl *ptr_biabl; - struct bebux *ptr_bebux; - struct bereg *ptr_bereg; - - /* ###------------------------------------------------------### */ - /* check that the unit exists */ - /* ###------------------------------------------------------### */ - - if (ptr_befig != NULL) - { - /* ###------------------------------------------------------### */ - /* release expression in simple internal signals' list */ - /* ###------------------------------------------------------### */ - - ptr_beaux = ptr_befig->BEAUX; - while (ptr_beaux != NULL) - { - if (ptr_beaux->ABL != NULL) - { - freeablexpr (ptr_beaux->ABL); - ptr_beaux->ABL = NULL; - } - ptr_beaux = ptr_beaux->NEXT; - } - - /* ###------------------------------------------------------### */ - /* release expression in delayed signals' list */ - /* ###------------------------------------------------------### */ - - ptr_beaux = ptr_befig->BEDLY; - while (ptr_beaux != NULL) - { - if (ptr_beaux->ABL != NULL) - { - freeablexpr (ptr_beaux->ABL); - ptr_beaux->ABL = NULL; - } - ptr_beaux = ptr_beaux->NEXT; - } - - /* ###------------------------------------------------------### */ - /* release expression in assertions' list */ - /* ###------------------------------------------------------### */ - - ptr_bemsg = ptr_befig->BEMSG; - while (ptr_bemsg != NULL) - { - if (ptr_bemsg->ABL != NULL) - { - freeablexpr (ptr_bemsg->ABL); - ptr_bemsg->ABL = NULL; - } - ptr_bemsg = ptr_bemsg->NEXT; - } - - /* ###------------------------------------------------------### */ - /* release expression in simple output ports' list */ - /* ###------------------------------------------------------### */ - - ptr_beout = ptr_befig->BEOUT; - while (ptr_beout != NULL) - { - if (ptr_beout->ABL != NULL) - { - freeablexpr (ptr_beout->ABL); - ptr_beout->ABL = NULL; - } - ptr_beout = ptr_beout->NEXT; - } - - /* ###------------------------------------------------------### */ - /* release expression in bussed output ports' list */ - /* ###------------------------------------------------------### */ - - ptr_bebus = ptr_befig->BEBUS; - while (ptr_bebus != NULL) - { - ptr_biabl = ptr_bebus->BIABL; - while (ptr_biabl != NULL) - { - if (ptr_biabl->CNDABL != NULL) - { - freeablexpr(ptr_biabl->CNDABL); - ptr_biabl->CNDABL = NULL; - } - if (ptr_biabl->VALABL != NULL) - { - freeablexpr(ptr_biabl->VALABL); - ptr_biabl->VALABL = NULL; - } - ptr_biabl = ptr_biabl->NEXT; - } - ptr_bebus = ptr_bebus->NEXT; - } - - /* ###------------------------------------------------------### */ - /* release expression in bussed internal signals' list */ - /* ###------------------------------------------------------### */ - - ptr_bebux = ptr_befig->BEBUX; - while (ptr_bebux != NULL) - { - ptr_biabl = ptr_bebux->BIABL; - while (ptr_biabl != NULL) - { - if (ptr_biabl->CNDABL != NULL) - { - freeablexpr (ptr_biabl->CNDABL); - ptr_biabl->CNDABL = NULL; - } - if (ptr_biabl->VALABL != NULL) - { - freeablexpr (ptr_biabl->VALABL); - ptr_biabl->VALABL = NULL; - } - - ptr_biabl = ptr_biabl->NEXT; - } - ptr_bebux = ptr_bebux->NEXT; - } - - /* ###------------------------------------------------------### */ - /* release expression in internal registers' list */ - /* ###------------------------------------------------------### */ - - ptr_bereg = ptr_befig->BEREG; - while (ptr_bereg != NULL) - { - ptr_biabl = ptr_bereg->BIABL; - while (ptr_biabl != NULL) - { - if ( ptr_biabl->CNDABL != NULL ) - { - freeablexpr(ptr_biabl->CNDABL); - ptr_biabl->CNDABL = NULL; - } - if ( ptr_biabl->VALABL != NULL ) - { - freeablexpr(ptr_biabl->VALABL); - ptr_biabl->VALABL = NULL; - } - ptr_biabl = ptr_biabl->NEXT; - } - ptr_bereg = ptr_bereg->NEXT; - } - } - } diff --git a/alliance/src/abt/src/bhl_makbdd.c b/alliance/src/abt/src/bhl_makbdd.c deleted file mode 100644 index 5cb133ff..00000000 --- a/alliance/src/abt/src/bhl_makbdd.c +++ /dev/null @@ -1,494 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bhl | -| | -| File : bhl_makbdd.c | -| | -| Date : 01.02.95 | -| | -| Author : Pirouz Bazargan Sabet | -| | -| Modified by Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "abl.h" -# include "bdd.h" -# include "abe.h" -# include "abt.h" - -# include -# include "bhl_error.h" -# include "bhl_makbdd.h" -# include "bhl_orderbdd.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static chain_list *BhlHeadName = (chain_list *)0; - static befig_list *BhlBehFigure = (befig_list *)0; - static char *BhlDelayedName = (char *)0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bhl Abl 2 Bdd | -| | -\------------------------------------------------------------*/ - -static bddnode *bhl_expr2bdd( Expr ) - - chain_list *Expr; -{ - bddnode *BddNode; - bddnode *BddFirst; - char *AtomValue; - beaux_list *ScanAux; - chain_list *ScanChain; - long Oper; - int Negative; - - if ( Expr == (chain_list *)0 ) - { - bhlerror( BHL_EXPR_NULL_ERROR, (char *)0 ); - } - - if ( ABL_ATOM( Expr ) ) - { - AtomValue = ABL_ATOM_VALUE( Expr ); - - if ( AtomValue == ABL_ATOM_NAME_ONE ) - { - return( BddLocalSystem->ONE ); - } - - if ( ( AtomValue == ABL_ATOM_NAME_ZERO ) || - ( AtomValue == ABL_ATOM_NAME_DC ) ) - { - return( BddLocalSystem->ZERO ); - } - - BddNode = searchbddcircuitin( (bddcircuit *)0, AtomValue ); - - if ( BddNode != (bddnode *)0 ) - { - return( incbddrefext( BddNode ) ); - } - - for ( ScanAux = BhlBehFigure->BEAUX; - ScanAux != (beaux_list *)0; - ScanAux = ScanAux->NEXT ) - { - if ( ScanAux->NAME == AtomValue ) break; - } - - if ( ScanAux == (beaux_list *)0 ) - { - bhlerror( BHL_UNKNOWN_ATOM_ERROR, AtomValue ); - } - - for ( ScanChain = BhlHeadName; - ScanChain != (chain_list *)0; - ScanChain = ScanChain->NEXT ) - { - if ( ScanChain->DATA == AtomValue ) - { - bhlerror( BHL_EXPR_LOOP_ERROR, AtomValue ); - } - } - - if ( ScanAux->NODE == (void *)0 ) - { - BhlHeadName = addchain( BhlHeadName, AtomValue ); - ScanAux->NODE = bhl_expr2bdd( ScanAux->ABL ); - BhlHeadName = delchain( BhlHeadName, BhlHeadName ); - } - - return( incbddrefext( ScanAux->NODE ) ); - } - - Oper = ABL_OPER( Expr ); - Expr = ABL_CDR( Expr ); - - if ( Oper == ABL_NOT ) - { - if ( ABL_CDR( Expr ) != (chain_list *)0 ) - { - bhlerror( BHL_OPERATOR_ERROR, Oper ); - } - - BddFirst = bhl_expr2bdd( ABL_CAR( Expr ) ); - BddNode = applybddnodenot( (bddsystem *)0, decbddrefext( BddFirst ) ); - - return( BddNode ); - } - - if ( Oper == ABL_STABLE ) - { - Expr = ABL_CAR( Expr ); - - if ( ! ABL_ATOM( Expr ) ) - { - bhlerror( BHL_ILLEGAL_STABLE_ERROR, (char *)0 ); - } - - AtomValue = ABL_ATOM_VALUE( Expr ); - BddFirst = searchbddcircuitin( (bddcircuit *)0, AtomValue ); - - if ( BddFirst == (bddnode *)0 ) - { - bhlerror( BHL_UNKNOWN_ATOM_ERROR, AtomValue ); - } - - BhlDelayedName = autresizeblock( BhlDelayedName, 0, strlen( AtomValue ) + 9 ); - sprintf( BhlDelayedName, "%s'delayed", AtomValue ); - AtomValue = namealloc( BhlDelayedName ); - - BddNode = searchbddcircuitin( (bddcircuit *)0, AtomValue ); - - if ( BddNode == (bddnode *)0 ) - { - bhlerror( BHL_UNKNOWN_ATOM_ERROR, AtomValue ); - } - - BddNode = applybddnode( (bddsystem *)0, ABL_NXOR, BddNode, BddFirst ); - - return( BddNode ); - } - - if ( ( isablunaryoper( Oper ) ) || - ( ABL_CDR( Expr ) == (chain_list *)0 ) ) - { - bhlerror( BHL_OPERATOR_ERROR, Oper ); - } - - if ( ( getabloperpolar( Oper ) == ABL_POLAR_POSITIVE ) || - ( ABL_CDDR( Expr ) == (chain_list *)0 ) ) - { - Negative = 0; - } - else - { - Negative = 1; - Oper = getablopernot( Oper ); - } - - BddFirst = bhl_expr2bdd( ABL_CAR( Expr ) ); - - while ( ( Expr = ABL_CDR( Expr ) ) != (chain_list *)0 ) - { - BddNode = bhl_expr2bdd( ABL_CAR( Expr ) ); - BddFirst = applybddnode( (bddsystem *)0, Oper, - decbddrefext( BddFirst ), - decbddrefext( BddNode ) ); - } - - if ( Negative ) - { - BddFirst = applybddnodenot( (bddsystem *)0, - decbddrefext( BddFirst ) ); - } - - return( BddFirst ); -} - -/*------------------------------------------------------------\ -| | -| Beh Abl 2 Bdd | -| | -\------------------------------------------------------------*/ - -static bddnode *bhl_abl2bdd( Name, Expr ) - - char *Name; - chain_list *Expr; -{ - bddnode *BddNode; - - if ( Name != (char *)0 ) - { - BhlHeadName = addchain( BhlHeadName, Name ); - } - - BddNode = bhl_expr2bdd( Expr ); - - if ( Name != (char *)0 ) - { - BhlHeadName = delchain( BhlHeadName, BhlHeadName ); - - BddNode = addbddcircuitout( (bddcircuit *)0, Name, BddNode ); - } - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Beh Make Bdd Total | -| | -\------------------------------------------------------------*/ - -void bhl_mbddtot( BehFigure ) - - befig_list *BehFigure; -{ - struct beaux *BehAux; - struct beaux *BehDly; - struct bemsg *BehMsg; - struct beout *BehOut; - struct bebus *BehBus; - struct bebux *BehBux; - struct bereg *BehReg; - struct biabl *BiAbl; - struct binode *BiNode; - - BhlBehFigure = BehFigure; - BhlHeadName = (chain_list *)0; - - BehAux = BehFigure->BEAUX; - - while ( BehAux != NULL ) - { - if ( BehAux->NODE == NULL ) - { - BehAux->NODE = bhl_abl2bdd( BehAux->NAME, BehAux->ABL ); - } - BehAux = BehAux->NEXT; - } - - BehDly = BehFigure->BEDLY; - - while ( BehDly != NULL ) - { - if ( BehDly->NODE == NULL ) - { - BehDly->NODE = bhl_abl2bdd( BehDly->NAME, BehDly->ABL ); - } - BehDly = BehDly->NEXT; - } - - BehMsg = BehFigure->BEMSG; - - while ( BehMsg != NULL ) - { - if ( BehMsg->NODE == NULL ) - { - BehMsg->NODE = bhl_abl2bdd( (char *)0, BehMsg->ABL ); - } - BehMsg = BehMsg->NEXT; - } - - BehOut = BehFigure->BEOUT; - - while ( BehOut != NULL ) - { - if ( BehOut->NODE == NULL ) - { - BehOut->NODE = bhl_abl2bdd( BehOut->NAME, BehOut->ABL ); - } - - BehOut = BehOut->NEXT; - } - - BehBus = BehFigure->BEBUS; - - while ( BehBus != NULL ) - { - BiAbl = BehBus->BIABL; - BiNode = BehBus->BINODE; - - while (BiAbl != NULL) - { - BiNode->CNDNODE = bhl_abl2bdd( (char *)0, BiAbl->CNDABL ); - BiNode->VALNODE = bhl_abl2bdd( BehBus->NAME, BiAbl->VALABL ); - - BiAbl = BiAbl->NEXT; - BiNode = BiNode->NEXT; - } - - BehBus = BehBus->NEXT; - } - - BehBux = BehFigure->BEBUX; - - while ( BehBux != NULL ) - { - BiAbl = BehBux->BIABL; - BiNode = BehBux->BINODE; - - while ( BiAbl != NULL ) - { - BiNode->CNDNODE = bhl_abl2bdd( (char *)0 , BiAbl->CNDABL ); - BiNode->VALNODE = bhl_abl2bdd( BehBux->NAME, BiAbl->VALABL ); - - BiAbl = BiAbl->NEXT; - BiNode = BiNode->NEXT; - } - - BehBux = BehBux->NEXT; - } - - BehReg = BehFigure->BEREG; - - while ( BehReg != NULL ) - { - BiAbl = BehReg->BIABL; - BiNode = BehReg->BINODE; - - while ( BiAbl != NULL ) - { - BiNode->CNDNODE = bhl_abl2bdd( (char *)0 , BiAbl->CNDABL ); - BiNode->VALNODE = bhl_abl2bdd( BehReg->NAME, BiAbl->VALABL ); - - BiAbl = BiAbl->NEXT; - BiNode = BiNode->NEXT; - } - - BehReg = BehReg->NEXT; - } -} - -/*------------------------------------------------------------\ -| | -| Beh Make Bdd | -| | -\------------------------------------------------------------*/ - -void beh_makbdd( ptr_befig, aux_flag, order_flag ) - - befig_list *ptr_befig; - char aux_flag; - char order_flag; -{ - berin_list *ptr_rin; - beaux_list *ptr_aux; - beout_list *ptr_out; - bebus_list *ptr_bus; - - long count_rin = 1; - long count_out = 1; - - if ( ! aux_flag ) - { - if ( ptr_befig->BEDLY == NULL ) - { - ptr_aux = ptr_befig->BEAUX; - while ( ptr_aux != NULL ) - { - ptr_befig->BERIN = beh_rmvberin( ptr_befig->BERIN, ptr_aux->NAME ); - ptr_aux = ptr_aux->NEXT; - count_out++; - } - } - else - { - bhlerror( BHL_SIMPLIFY_ERROR, (char *)0 ); - } - } - else - { - ptr_aux = ptr_befig->BEAUX; - while ( ptr_aux != NULL ) - { - ptr_aux = ptr_aux->NEXT; - count_out++; - } - } - - ptr_rin = ptr_befig->BERIN; - while (ptr_rin != NULL) - { - ptr_rin = ptr_rin->NEXT; - count_rin++; - } - - ptr_out = ptr_befig->BEOUT; - while (ptr_out != NULL) - { - ptr_out = ptr_out->NEXT; - count_out++; - } - - ptr_bus = ptr_befig->BEBUS; - while (ptr_bus != NULL) - { - ptr_bus = ptr_bus->NEXT; - count_out++; - } - - ptr_befig->CIRCUI = createbddcircuit( ptr_befig->NAME, - count_rin, count_out, (bddsystem *)0 ); - - bhl_orderbdd( ptr_befig, aux_flag, order_flag ); - - bhl_mbddtot( ptr_befig ); - - if ( ! aux_flag ) - { - ptr_aux = ptr_befig->BEAUX; - while ( ptr_aux != NULL ) - { - if ( ptr_aux->NODE != (void *)0 ) - { - decbddrefext( ptr_aux->NODE ); - delbddcircuitout( (bddcircuit *)0, ptr_aux->NAME ); - } - ptr_aux = ptr_aux->NEXT; - } - - beh_frebeaux( ptr_befig->BEAUX ); - ptr_befig->BEAUX = NULL; - } - - sweepbddsystem( (bddsystem *)0 ); -} diff --git a/alliance/src/abt/src/bhl_makbdd.h b/alliance/src/abt/src/bhl_makbdd.h deleted file mode 100644 index 4e14687f..00000000 --- a/alliance/src/abt/src/bhl_makbdd.h +++ /dev/null @@ -1,65 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bhl | -| | -| File : bhl_makbdd.h | -| | -| Date : 01.02.95 | -| | -| Author : Pirouz Bazargan Sabet | -| | -| Modified by Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BHL_MAKBDD_H -# define BHL_MAKBDD_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/abt/src/bhl_makgex.c b/alliance/src/abt/src/bhl_makgex.c deleted file mode 100644 index 413958b2..00000000 --- a/alliance/src/abt/src/bhl_makgex.c +++ /dev/null @@ -1,758 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ - -/* ###--------------------------------------------------------------### */ -/* */ -/* file : beh_makgex.c */ -/* date : Mar 20 1994 */ -/* version : v108 */ -/* authors : Xavier Picat */ -/* description : high level function */ -/* */ -/* ###--------------------------------------------------------------### */ - -#include -#include "mut.h" -#include "aut.h" -#include "abl.h" -#include "bdd.h" -#include "abe.h" - -#define BEH_GEXBLK 256 - -static struct begex *BEH_GEXHED = NULL; -static ht *HashTable = NULL; - -/* ###--------------------------------------------------------------### */ -/* function : beh_addgexex */ -/* description : create a GEX expression */ -/* called func. : mbkalloc */ -/* ###--------------------------------------------------------------### */ - -static struct begex *beh_addgexex (oper, type) - -unsigned int oper; -unsigned short type; - - { - struct begex *ptgex; - int i; - - if (BEH_GEXHED == NULL) - { - /* ###------------------------------------------------------### */ - /* if there is no more structure allocate a new block */ - /* (use OPERAND field to chain structures in a list) */ - /* ###------------------------------------------------------### */ - - BEH_GEXHED = mbkalloc (sizeof (struct begex) * BEH_GEXBLK); - - ptgex = BEH_GEXHED; - for (i=1 ; iOPERAND = (struct chain *) (ptgex + 1); - ptgex++; - } - ptgex->OPERAND = NULL; - } - - ptgex = BEH_GEXHED; - BEH_GEXHED = (struct begex *) BEH_GEXHED->OPERAND; - - ptgex->TERM = oper; - ptgex->TYPE = type; - ptgex->OPERAND = NULL; - - return (ptgex); - } - -/* ###--------------------------------------------------------------### */ -/* function : beh_addterm */ -/* description : create a GEX for a terminal. For each terminal there */ -/* is a unique GEX */ -/* called func. : beh_addgexex, mbkalloc, addchain */ -/* ###--------------------------------------------------------------### */ - -static struct begex *beh_addterm (oper) - -unsigned int oper; - - { - static struct chain *term_tab = NULL; - static unsigned int bank_nbr = 0; - struct chain *tmp_chn = NULL; - struct begex *locl_tab; - unsigned int bank; - struct begex *resgex; - int i; - int j; - - bank = oper / 64; - if (bank >= bank_nbr) - { - for (i=bank_nbr ; i<=bank ; i++) - { - locl_tab = (struct begex *) mbkalloc (64 * sizeof (struct begex)); - - for (j=0 ; j<64 ; j++) - { - (locl_tab [j]).TERM = j + (i * 64); - (locl_tab [j]).TYPE = 0; - (locl_tab [j]).OPERAND = NULL; - } - - if (term_tab == NULL) - term_tab = addchain (NULL, locl_tab); - else - { - tmp_chn = term_tab; - while (tmp_chn->NEXT != NULL) - tmp_chn = tmp_chn->NEXT; - tmp_chn->NEXT = addchain (NULL, locl_tab); - } - } - - bank_nbr = bank + 1; - } - - tmp_chn = term_tab; - for (i=0 ; iNEXT; - - locl_tab = (struct begex *) tmp_chn->DATA; - - resgex = & (locl_tab [oper % 64]); - - return (resgex); - } - -/* ###--------------------------------------------------------------### */ -/* function : mad_fregex */ -/* description : release a GEX expression (excluding terminals) */ -/* called func. : none */ -/* ###--------------------------------------------------------------### */ - -void mad_fregex (ptgex, mode) - -struct begex *ptgex; -char mode ; - - { - struct chain *tmpchn; - - if (ptgex != NULL) - { - if ((tmpchn = ptgex->OPERAND) != NULL) - { - if (mode == 'a') - { - while (tmpchn != NULL) - { - mad_fregex ((struct begex *) tmpchn->DATA, 'a'); - tmpchn = tmpchn->NEXT; - } - freechain (ptgex->OPERAND); - } - - ptgex->OPERAND = (struct chain *) BEH_GEXHED; - BEH_GEXHED = ptgex; - } - } - - } - -/* ###--------------------------------------------------------------### */ -/* function : flatgex */ -/* description : flatten the top level of a complex expression */ -/* called func. : mbkalloc */ -/* ###--------------------------------------------------------------### */ - -static struct begex *flatgex (gexpnt) - -struct begex *gexpnt; - - { - int top_operator; - int operator; - struct chain *tmp_chn; - struct chain *cur_oper; - struct chain *oper_list = NULL; - struct begex *operand; - struct begex *resgex = gexpnt; - char flatflag = 0; - - if ((gexpnt != NULL) && (gexpnt->OPERAND != NULL)) - { - cur_oper = gexpnt->OPERAND; - - while (cur_oper != NULL) - { - flatflag = 0; - top_operator = gexpnt->TERM; - operand = (struct begex *) cur_oper->DATA; - - if (operand->OPERAND != NULL) - { - operator = operand->TERM; - switch (operator) - { - case ABL_OR : - if (top_operator == ABL_NOT) - { - gexpnt->TERM = ABL_NOR; - flatflag = 1; - } - else - { - if ((top_operator == ABL_OR) || (top_operator == ABL_NOR)) - flatflag = 1; - } - break; - - case ABL_AND : - if (top_operator == ABL_NOT) - { - gexpnt->TERM = ABL_NAND; - flatflag = 1; - } - else - { - if ((top_operator == ABL_AND) || (top_operator == ABL_NAND)) - flatflag = 1; - } - break; - - case ABL_XOR : - if (top_operator == ABL_NOT) - { - gexpnt->TERM = ABL_NXOR; - flatflag = 1; - } - else - { - if ((top_operator == ABL_XOR) || (top_operator == ABL_NXOR)) - flatflag = 1; - } - break; - - case ABL_NXOR : - if (top_operator == ABL_XOR) - { - gexpnt->TERM = ABL_NXOR; - flatflag = 1; - } - else - { - if ((top_operator == ABL_NXOR) || (top_operator == ABL_NOT)) - { - gexpnt->TERM = ABL_XOR; - flatflag = 1; - } - } - break; - } - } - - if (flatflag == 1) - { - tmp_chn = operand->OPERAND; - while (tmp_chn->NEXT != NULL) - tmp_chn = tmp_chn->NEXT; - - tmp_chn->NEXT = oper_list; - oper_list = operand->OPERAND; - mad_fregex (operand, 'p'); - } - else - oper_list = addchain (oper_list, operand); - - cur_oper = cur_oper->NEXT; - } - - freechain (gexpnt->OPERAND); - - gexpnt->OPERAND = oper_list; - resgex = gexpnt; - } - - return (resgex); - } - -/* ###--------------------------------------------------------------### */ -/* function : rmvconst */ -/* description : remove constantes that appear at the top level of a */ -/* espression */ -/* called func. : addchain, freechain, mad_fregex */ -/* ###--------------------------------------------------------------### */ - -static struct begex *rmvconst (gexpnt) - -struct begex *gexpnt; - - { - struct begex *resgex; - struct begex *operand; - struct begex *gex_zero; - struct begex *gex_one ; - struct chain *new_oper = NULL; - struct chain *cur_oper; - struct chain *tmp_chn = NULL; - int operator; - char freflag = 0; - - resgex = gexpnt; - gex_zero = beh_addterm (0); - gex_one = beh_addterm (1); - - if (gexpnt != NULL) - { - if (gexpnt->OPERAND != NULL) - { - cur_oper = gexpnt->OPERAND; - - while (cur_oper != NULL) - { - operator = gexpnt->TERM; - operand = (struct begex *) cur_oper->DATA; - freflag = 0; - - if (operand == gex_zero) - { - switch (operator) - { - case ABL_AND : - freflag = 2; resgex = gex_zero; break; - case ABL_NAND : - case ABL_NOT : - freflag = 2; resgex = gex_one ; break; - case ABL_OR : - case ABL_XOR : - case ABL_NOR : - case ABL_NXOR : - freflag = 1; break; - break; - } - } - - if (operand == gex_one) - { - switch (operator) - { - case ABL_OR : - freflag = 2; resgex = gex_one ; break; - case ABL_NOR : - case ABL_NOT : - freflag = 2; resgex = gex_zero; break; - case ABL_NAND : - case ABL_AND : - freflag = 1; break; - break; - case ABL_XOR : - gexpnt->TERM = ABL_NXOR; freflag = 1; break; - break; - case ABL_NXOR : - gexpnt->TERM = ABL_XOR ; freflag = 1; break; - break; - } - } - - if (freflag == 2) - { - mad_fregex (gexpnt); - freechain (new_oper); - gexpnt = NULL; - new_oper = NULL; - break; - } - else - { - if (freflag == 0) - new_oper = addchain (new_oper, cur_oper->DATA); - cur_oper = cur_oper->NEXT; - } - } - if (gexpnt != NULL) - { - operator = gexpnt->TERM; - if (new_oper == NULL) - { - switch (operator) - { - case ABL_AND : - case ABL_NOR : - case ABL_NXOR : - resgex = gex_one ; - break; - case ABL_OR : - case ABL_XOR : - case ABL_NAND : - resgex = gex_zero; - break; - } - mad_fregex (gexpnt); - gexpnt = NULL; - } - else - { - if (new_oper->NEXT == NULL) - { - switch (operator) - { - case ABL_AND : - case ABL_OR : - case ABL_XOR : - resgex = (struct begex *) new_oper->DATA; - freechain (new_oper); - gexpnt = NULL; - new_oper = NULL; - break; - case ABL_NOR : - case ABL_NXOR : - case ABL_NAND : - case ABL_NOT : - tmp_chn = gexpnt->OPERAND; - gexpnt->OPERAND = new_oper; - gexpnt->TERM = ABL_NOT; - freechain (tmp_chn); - tmp_chn = NULL; - resgex = gexpnt; - break; - } - } - } - } - } - } - - return (resgex); - } - -/* ###--------------------------------------------------------------### */ -/* function : beh_abl2gex */ -/* description : transform recursively abl in gex */ -/* called func. : beh_toolbug, beh_abl2gex, gethtitem beh_addgexex, */ -/* namealloc , addchain */ -/* ###--------------------------------------------------------------### */ - -static struct begex *beh_abl2gex (ptr_befig, expr) - -struct befig *ptr_befig; -struct chain *expr; - - { - char delayed [128]; - static char *str_zero = NULL; - static char *str_dc = NULL; - static char *str_one = NULL; - struct begex *resgex ; - struct begex *gex_elt ; - struct chain *oper_list ; - struct chain *operand ; - char *term ; - long term_idx ; - long operator ; - - if (expr == NULL) - beh_toolbug (103, "beh_abl2gex", NULL, 0); - - if (str_zero == NULL) - { - str_zero = namealloc ("'0'"); - str_dc = namealloc ("'d'"); - str_one = namealloc ("'1'"); - } - - if (expr->NEXT != NULL) - { - /* ###------------------------------------------------------### */ - /* if the expression is not a terminal ... */ - /* ###------------------------------------------------------### */ - - operator = (long) ((struct chain *)expr->DATA)->DATA; - switch (operator) - { - case ABL_STABLE: - - /* ###------------------------------------------------------### */ - /* translate signal'stable into a logical expression. */ - /* notice : */ - /* signal'stable = not (signal xor signal'delayed) */ - /* ###------------------------------------------------------### */ - - resgex = beh_addgexex (ABL_NXOR, 0); - - operand = (struct chain *) expr->NEXT->DATA; - - if (operand->NEXT != NULL) - beh_toolbug (100, "beh_abl2gex", NULL, 0); - else - { - term = (char *) operand->DATA; - term_idx = gethtitem (HashTable, term); - - if (term_idx == EMPTYHT) - beh_toolbug (101, "beh_abl2gex", term, 0); - else - { - gex_elt = beh_addterm (term_idx); - - resgex->OPERAND = addchain (NULL, gex_elt); - - sprintf (delayed, "%s'delayed", term); - term = namealloc (delayed); - term_idx = gethtitem (HashTable, term); - - if (term_idx == EMPTYHT) - beh_toolbug (101, "beh_abl2gex", term, 0); - else - { - gex_elt = beh_addterm (term_idx); - resgex->OPERAND->NEXT = addchain (NULL, gex_elt); - } - } - } - break; - - case ABL_OR: - case ABL_AND: - case ABL_XOR: - case ABL_NOR: - case ABL_NAND: - case ABL_NXOR: - case ABL_NOT: - - /* ###------------------------------------------------------### */ - /* for other operator make the top level, then, translate */ - /* each operand */ - /* ###------------------------------------------------------### */ - - resgex = beh_addgexex (operator, 0); - oper_list = expr->NEXT; - while (oper_list != NULL) - { - gex_elt = beh_abl2gex (ptr_befig, oper_list->DATA); - resgex->OPERAND = addchain (resgex->OPERAND, gex_elt); - oper_list = oper_list->NEXT; - } - break; - - default: - beh_toolbug (102, "beh_abl2gex", NULL, operator); - } - - resgex = rmvconst (resgex); - resgex = flatgex (resgex); - } - - else - { - /* ###------------------------------------------------------### */ - /* if the expression is a terminal create a terminal gex */ - /* with the index correspnding to the terminal */ - /* ###------------------------------------------------------### */ - - term = (char *) expr->DATA; - term_idx = gethtitem (HashTable, term); - if (term_idx == EMPTYHT) - { - if (expr->DATA == str_one) - resgex = beh_addterm (1); - else - { - if ((expr->DATA == str_zero) || (expr->DATA == str_dc)) - resgex = beh_addterm (0); - else - beh_toolbug (101, "beh_abl2gex", term, 0); - } - } - else - resgex = beh_addterm (term_idx); - - } - - return (resgex); - } - -/* ###--------------------------------------------------------------### */ -/* function : beh_makgex */ -/* description : make gex for each signal of a befig structure */ -/* called func. : beh_abl2gex, addht, addhtitem, delht */ -/* ###--------------------------------------------------------------### */ - -void beh_makgex (ptr_befig, aux_flg, trace_flg) - -struct befig *ptr_befig; /* befig containing expressions */ -char aux_flg ; /* ignored */ -char trace_flg; /* ignored */ - - { - struct beaux *ptr_beaux; - struct beaux *ptr_bedly; - struct bemsg *ptr_bemsg; - struct beout *ptr_beout; - struct bebus *ptr_bebus; - struct bebux *ptr_bebux; - struct bereg *ptr_bereg; - struct biabl *ptr_biabl; - struct binode *ptr_binode; - struct berin *ptr_rin; - int i; - - /* ###------------------------------------------------------### */ - /* initialize hash table */ - /* ###------------------------------------------------------### */ - - i = 1; - ptr_rin = ptr_befig->BERIN; - - while (ptr_rin != NULL) - { - i++; - ptr_rin = ptr_rin->NEXT; - } - - HashTable = addht (i); - - i = 2; - ptr_rin = ptr_befig->BERIN; - - while (ptr_rin != NULL) - { - addhtitem (HashTable, ptr_rin->NAME, i); - i++; - ptr_rin = ptr_rin->NEXT; - } - - /* ###------------------------------------------------------### */ - /* make a gex for each simple internal signal */ - /* ###------------------------------------------------------### */ - - ptr_beaux = ptr_befig->BEAUX; - while (ptr_beaux != NULL) - { - ptr_beaux->NODE = (bddnode *) beh_abl2gex (ptr_befig, ptr_beaux->ABL); - ptr_beaux = ptr_beaux->NEXT; - } - - /* ###------------------------------------------------------### */ - /* make a gex for each delayed internal signal */ - /* ###------------------------------------------------------### */ - - ptr_bedly = ptr_befig->BEDLY; - while (ptr_bedly != NULL) - { - ptr_bedly->NODE = (bddnode *) beh_abl2gex (ptr_befig, ptr_bedly->ABL); - ptr_bedly = ptr_bedly->NEXT; - } - - /* ###------------------------------------------------------### */ - /* make a gex for each assertion */ - /* ###------------------------------------------------------### */ - - ptr_bemsg = ptr_befig->BEMSG; - while (ptr_bemsg != NULL) - { - ptr_bemsg->NODE = (bddnode *) beh_abl2gex (ptr_befig, ptr_bemsg->ABL); - ptr_bemsg = ptr_bemsg->NEXT; - } - - /* ###------------------------------------------------------### */ - /* make a gex for each simple output */ - /* ###------------------------------------------------------### */ - - ptr_beout = ptr_befig->BEOUT; - while (ptr_beout != NULL) - { - ptr_beout->NODE = (bddnode *) beh_abl2gex (ptr_befig, ptr_beout->ABL); - ptr_beout = ptr_beout->NEXT; - } - - /* ###------------------------------------------------------### */ - /* make a gex for each bussed output */ - /* ###------------------------------------------------------### */ - - ptr_bebus = ptr_befig->BEBUS; - while (ptr_bebus != NULL) - { - ptr_biabl = ptr_bebus->BIABL; - ptr_binode = ptr_bebus->BINODE; - - while (ptr_biabl != NULL) - { - ptr_binode->CNDNODE = (bddnode *) beh_abl2gex (ptr_befig, ptr_biabl->CNDABL); - ptr_binode->VALNODE = (bddnode *) beh_abl2gex (ptr_befig, ptr_biabl->VALABL); - - ptr_biabl = ptr_biabl->NEXT; - ptr_binode = ptr_binode->NEXT; - } - ptr_bebus = ptr_bebus->NEXT; - } - - /* ###------------------------------------------------------### */ - /* make a gex for each bussed internal signal */ - /* ###------------------------------------------------------### */ - - ptr_bebux = ptr_befig->BEBUX; - while (ptr_bebux != NULL) - { - ptr_biabl = ptr_bebux->BIABL; - ptr_binode = ptr_bebux->BINODE; - - while (ptr_biabl != NULL) - { - ptr_binode->CNDNODE = (bddnode *) beh_abl2gex (ptr_befig, ptr_biabl->CNDABL); - ptr_binode->VALNODE = (bddnode *) beh_abl2gex (ptr_befig, ptr_biabl->VALABL); - - ptr_biabl = ptr_biabl->NEXT; - ptr_binode = ptr_binode->NEXT; - } - ptr_bebux = ptr_bebux->NEXT; - } - - /* ###------------------------------------------------------### */ - /* make a gex for each internal register */ - /* ###------------------------------------------------------### */ - - ptr_bereg = ptr_befig->BEREG; - while (ptr_bereg != NULL) - { - ptr_biabl = ptr_bereg->BIABL; - ptr_binode = ptr_bereg->BINODE; - - while (ptr_biabl != NULL) - { - ptr_binode->CNDNODE = (bddnode *) beh_abl2gex (ptr_befig, ptr_biabl->CNDABL); - ptr_binode->VALNODE = (bddnode *) beh_abl2gex (ptr_befig, ptr_biabl->VALABL); - - ptr_biabl = ptr_biabl->NEXT; - ptr_binode = ptr_binode->NEXT; - } - ptr_bereg = ptr_bereg->NEXT; - } - - delht (HashTable); - } diff --git a/alliance/src/abt/src/bhl_orderbdd.c b/alliance/src/abt/src/bhl_orderbdd.c deleted file mode 100644 index fe5c26d6..00000000 --- a/alliance/src/abt/src/bhl_orderbdd.c +++ /dev/null @@ -1,437 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bhl | -| | -| File : bhl_orderbdd.c | -| | -| Date : 01.02.95 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "abl.h" -# include "bdd.h" -# include "abe.h" -# include "abt.h" - -# include -# include "bhl_error.h" -# include "bhl_orderbdd.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static chain_list *BhlHeadName = (chain_list *)0; - static befig_list *BhlBehFigure = (befig_list *)0; - static char *BhlDelayedName = (char *)0; - static authtable *BhlHashTableOrder = (authtable *)0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bhl Order Expr Bdd | -| | -\------------------------------------------------------------*/ - -static void bhl_orderexprbdd( Expr ) - - chain_list *Expr; -{ - char *AtomValue; - beaux_list *ScanAux; - chain_list *ScanChain; - authelem *Element; - long Oper; - - if ( Expr == (chain_list *)0 ) - { - bhlerror( BHL_EXPR_NULL_ERROR, (char *)0 ); - } - - if ( ABL_ATOM( Expr ) ) - { - AtomValue = ABL_ATOM_VALUE( Expr ); - - if ( ( AtomValue == ABL_ATOM_NAME_ONE ) || - ( AtomValue == ABL_ATOM_NAME_ZERO ) || - ( AtomValue == ABL_ATOM_NAME_DC ) ) - { - return; - } - - Element = searchauthelem( BhlHashTableOrder, AtomValue ); - - if ( Element != (authelem *)0 ) - { - Element->VALUE++; - - return; - } - - for ( ScanAux = BhlBehFigure->BEAUX; - ScanAux != (beaux_list *)0; - ScanAux = ScanAux->NEXT ) - { - if ( ScanAux->NAME == AtomValue ) break; - } - - if ( ScanAux == (beaux_list *)0 ) - { - bhlerror( BHL_UNKNOWN_ATOM_ERROR, AtomValue ); - } - - for ( ScanChain = BhlHeadName; - ScanChain != (chain_list *)0; - ScanChain = ScanChain->NEXT ) - { - if ( ScanChain->DATA == AtomValue ) - { - bhlerror( BHL_EXPR_LOOP_ERROR, AtomValue ); - } - } - - BhlHeadName = addchain( BhlHeadName, AtomValue ); - bhl_orderexprbdd( ScanAux->ABL ); - BhlHeadName = delchain( BhlHeadName, BhlHeadName ); - - return; - } - - Oper = ABL_OPER( Expr ); - Expr = ABL_CDR( Expr ); - - if ( Oper == ABL_NOT ) - { - if ( ABL_CDR( Expr ) != (chain_list *)0 ) - { - bhlerror( BHL_OPERATOR_ERROR, Oper ); - } - - bhl_orderexprbdd( ABL_CAR( Expr ) ); - - return; - } - - if ( Oper == ABL_STABLE ) - { - Expr = ABL_CAR( Expr ); - - if ( ! ABL_ATOM( Expr ) ) - { - bhlerror( BHL_ILLEGAL_STABLE_ERROR, (char *)0 ); - } - - AtomValue = ABL_ATOM_VALUE( Expr ); - Element = searchauthelem( BhlHashTableOrder, AtomValue ); - - if ( Element == (authelem *)0 ) - { - bhlerror( BHL_UNKNOWN_ATOM_ERROR, AtomValue ); - } - - BhlDelayedName = autresizeblock( BhlDelayedName, 0, strlen( AtomValue ) + 9 ); - sprintf( BhlDelayedName, "%s'delayed", AtomValue ); - AtomValue = namealloc( BhlDelayedName ); - - Element = searchauthelem( BhlHashTableOrder, AtomValue ); - - if ( Element == (authelem *)0 ) - { - bhlerror( BHL_UNKNOWN_ATOM_ERROR, AtomValue ); - } - - return; - } - - if ( ( isablunaryoper( Oper ) ) || - ( ABL_CDR( Expr ) == (chain_list *)0 ) ) - { - bhlerror( BHL_OPERATOR_ERROR, Oper ); - } - - bhl_orderexprbdd( ABL_CAR( Expr ) ); - - while ( ( Expr = ABL_CDR( Expr ) ) != (chain_list *)0 ) - { - bhl_orderexprbdd( ABL_CAR( Expr ) ); - } -} - -/*------------------------------------------------------------\ -| | -| Beh Order Bdd | -| | -\------------------------------------------------------------*/ - -static void bhl_orderablbdd( Name, Expr ) - - char *Name; - chain_list *Expr; -{ - if ( Name != (char *)0 ) - { - BhlHeadName = addchain( BhlHeadName, Name ); - } - - bhl_orderexprbdd( Expr ); - - if ( Name != (char *)0 ) - { - BhlHeadName = delchain( BhlHeadName, BhlHeadName ); - } -} - -/*------------------------------------------------------------\ -| | -| Beh Sort Compare | -| | -\------------------------------------------------------------*/ - -static long bhl_sortcompare( ValueArray, Index1, Index2 ) - - authelem *ValueArray; - long Index1; - long Index2; -{ - return( ValueArray[ Index1 ].VALUE - - ValueArray[ Index2 ].VALUE ); -} - -/*------------------------------------------------------------\ -| | -| Beh Order Bdd Total | -| | -\------------------------------------------------------------*/ - -void bhl_orderbdd( BehFigure, AuxFlag, OrderFlag ) - - befig_list *BehFigure; - int AuxFlag; - int OrderFlag; -{ - struct berin *BehRin; - struct beaux *BehAux; - struct beaux *BehDly; - struct bemsg *BehMsg; - struct beout *BehOut; - struct bebus *BehBus; - struct bebux *BehBux; - struct bereg *BehReg; - struct biabl *BiAbl; - authelem *Element; - authelem *ValueArray; - long *IndexArray; - long SizeArray; - long Index; - long NumberIn; - bddindex BddIndex; - - BhlBehFigure = BehFigure; - BhlHeadName = (chain_list *)0; - NumberIn = BehFigure->CIRCUI->NAME_IN_SIZE; - - BehFigure->BERIN = (berin_list *)reverse( (chain_list*)BehFigure->BERIN ); - BehRin = BehFigure->BERIN; - - if ( ! OrderFlag ) - { - while ( BehRin != NULL ) - { - BddIndex = BddLocalCircuit->NUMBER_NAME_IN + BDD_INDEX_MIN; - - addbddcircuitin( (bddcircuit *)0, BehRin->NAME, BddIndex, - BDD_IN_MODE_IMPOSE | BDD_IN_MODE_LAST ); - - BehRin = BehRin->NEXT; - } - - BehFigure->BERIN = (berin_list *)reverse( (chain_list*)BehFigure->BERIN ); - - return; - } - - BhlHashTableOrder = createauthtable( NumberIn << 1 ); - - while ( BehRin != NULL ) - { - addauthelem( BhlHashTableOrder, BehRin->NAME, 0 ); - - BehRin = BehRin->NEXT; - } - - if ( AuxFlag ) - { - BehAux = BehFigure->BEAUX; - - while ( BehAux != NULL ) - { - bhl_orderablbdd( BehAux->NAME, BehAux->ABL ); - - BehAux = BehAux->NEXT; - } - } - - BehDly = BehFigure->BEDLY; - - while ( BehDly != NULL ) - { - bhl_orderablbdd( BehDly->NAME, BehDly->ABL ); - - BehDly = BehDly->NEXT; - } - - BehMsg = BehFigure->BEMSG; - - while ( BehMsg != NULL ) - { - bhl_orderablbdd( (char *)0, BehMsg->ABL ); - - BehMsg = BehMsg->NEXT; - } - - BehOut = BehFigure->BEOUT; - - while ( BehOut != NULL ) - { - bhl_orderablbdd( BehOut->NAME, BehOut->ABL ); - - BehOut = BehOut->NEXT; - } - - BehBus = BehFigure->BEBUS; - - while ( BehBus != NULL ) - { - BiAbl = BehBus->BIABL; - - while ( BiAbl != NULL ) - { - bhl_orderablbdd( (char *)0 , BiAbl->CNDABL ); - bhl_orderablbdd( BehBus->NAME, BiAbl->VALABL ); - - BiAbl = BiAbl->NEXT; - } - - BehBus = BehBus->NEXT; - } - - BehBux = BehFigure->BEBUX; - - while ( BehBux != NULL ) - { - BiAbl = BehBux->BIABL; - - while (BiAbl != NULL) - { - bhl_orderablbdd( (char *)0, BiAbl->CNDABL ); - bhl_orderablbdd( (char *)0, BiAbl->VALABL ); - - BiAbl = BiAbl->NEXT; - } - - BehBux = BehBux->NEXT; - } - - BehReg = BehFigure->BEREG; - - while ( BehReg != NULL ) - { - BiAbl = BehReg->BIABL; - - while (BiAbl != NULL) - { - bhl_orderablbdd( (char *)0, BiAbl->CNDABL ); - bhl_orderablbdd( (char *)0, BiAbl->VALABL ); - - BiAbl = BiAbl->NEXT; - } - - BehReg = BehReg->NEXT; - } - - BehRin = BehFigure->BERIN; - -# ifdef BHL_ORDER_DEBUG - viewauthtable( BhlHashTableOrder, viewauthelem ); -# endif - - SizeArray = BhlHashTableOrder->TABLE_SIZE; - ValueArray = BhlHashTableOrder->TABLE; - IndexArray = (long *)autallocblock( sizeof( long ) * SizeArray ); - - sortautarray( ValueArray, IndexArray, SizeArray, bhl_sortcompare ); - - for ( Index = 0; Index < SizeArray; Index++ ) - { - Element = &ValueArray[ IndexArray[ Index ] ]; - - if ( Element->KEY != AUT_HASH_KEY_EMPTY ) - { - BddIndex = BddLocalCircuit->NUMBER_NAME_IN + BDD_INDEX_MIN; - - addbddcircuitin( (bddcircuit *)0, Element->KEY, BddIndex, - BDD_IN_MODE_IMPOSE | BDD_IN_MODE_LAST ); - -# ifdef BHL_ORDER_DEBUG - fprintf( stdout, "Var: %s Order: %d\n", - Element->KEY, Element->VALUE ); -# endif - } - } - - autfreeblock( IndexArray ); - destroyauthtable( BhlHashTableOrder ); - - BehFigure->BERIN = (berin_list *)reverse( (chain_list*)BehFigure->BERIN ); -} diff --git a/alliance/src/abt/src/bhl_orderbdd.h b/alliance/src/abt/src/bhl_orderbdd.h deleted file mode 100644 index 41ba9e33..00000000 --- a/alliance/src/abt/src/bhl_orderbdd.h +++ /dev/null @@ -1,67 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bhl | -| | -| File : bhl_makbdd.h | -| | -| Date : 01.02.95 | -| | -| Author : Pirouz Bazargan Sabet | -| | -| Modified by Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BHL_ORDERBDD_H -# define BHL_ORDERBDD_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - - extern void bhl_orderbdd(); - -# endif diff --git a/alliance/src/abv/Makefile.am b/alliance/src/abv/Makefile.am deleted file mode 100644 index b120b78f..00000000 --- a/alliance/src/abv/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -lib_LIBRARIES = libAbv.a -libAbv_a_SOURCES = bvl_bcomp.y bvl_bcomp.l \ -abv.h bvl_bspec.c bvl_drive.c bvl_parse.h bvl_util.h \ -bvl_bedef.h bvl_bspec.h bvl_drive.h bvl_utdef.h bvl_utype.h \ -bvl_blex.h bvl_byacc.h bvl_parse.c bvl_util.c -CLEANFILES = bvl_bcompyac.c bvl_bcompyac.h bvl_bcomplex.c - -bvl_bcompyac.c bvl_bcompyac.h : $(srcdir)/bvl_bcomp.y - $(YACC) -d $(YFLAGS) $(srcdir)/bvl_bcomp.y && sed -e "s/yy/bvl_y_/g" -e "s/YY/BVL_Y_/g" y.tab.c > bvl_bcompyac.c && sed -e "s/yy/bvl_y_/g" -e "s/YY/BVL_Y_/g" y.tab.h > bvl_bcompyac.h -bvl_bcomplex.c : $(srcdir)/bvl_bcomp.l bvl_bcompyac.h - $(LEX) -t $(srcdir)/bvl_bcomp.l | sed -e "s/yy/bvl_y_/g" -e "s/YY/BVL_Y_/g" > bvl_bcomplex.c diff --git a/alliance/src/bdd/man1/Makefile.am b/alliance/src/bdd/man1/Makefile.am deleted file mode 100644 index 14b25bb4..00000000 --- a/alliance/src/bdd/man1/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -man_MANS = bdd.1 diff --git a/alliance/src/bdd/man1/bdd.1 b/alliance/src/bdd/man1/bdd.1 deleted file mode 100644 index 3906a8d5..00000000 --- a/alliance/src/bdd/man1/bdd.1 +++ /dev/null @@ -1,479 +0,0 @@ -.\" $Id: bdd.1,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)bdd.1 1.01 96/02/07 UPMC; Author : Jacomme Ludovic -.TH BDD101 1 "October 1, 1997" "ASIM/LIP6" "ALLIANCE BDD LIBRARY" -.SH NAME -bdd \- Mutli Reduced Ordered Binary Decision Diagrams -.so man1/alc_origin.1 -.SH DESCRIPTION -\fBbdd\fP is a library that enables to represent a boolean expression -as a Multi Reduced Ordered Binary Decision Diagrams. -.TP 20 -.br -\fBviewbddallocinfo\fP -\- displays memory informations. -.TP -\fBapplybddnodenot\fP -\- complements a \fBbdd\fP. -.TP -\fBapplybddnodeterm\fP -\- applies an operator on two \fBbdd\fP nodes. -.TP -\fBapplybddnode\fP -\- applies an operator on two \fBbdd\fP nodes. -.TP -\fBapplybddnodeite\fP -\- computes the IF-THEN-ELSE logical operation. -.TP -\fBapplybddnodelist\fP -\- applies an opertor to a \fBbdd\fP nodes list. -.TP -\fBaddbddassoc\fP -\- creates a new association variables. -.TP -\fBaddbddnodeassoc\fP -\- adds a \fBbdd\fP node in a variable association. -.TP -\fBdelbddassoc\fP -\- deletes a variable association. -.TP -\fBdelbddnodeassoc\fP -\- deletes a \fBbdd\fP node in a variable association. -.TP -\fBdestroybddassoc\fP -\- frees all the variable associations. -.TP -\fBviewbddassoc\fP -\- displays variable associations. -.TP -\fBcheckbddvar\fP -\- checks the coherence of a variable. -.TP -\fBcheckbddindex\fP -\- checks the coherence of a \fBbdd\fP index. -.TP -\fBcheckbddoper\fP -\- ckecks the coherence of an operator. -.TP -\fBcheckbddassoc\fP -\- checks a variable association. -.TP -\fBcheckbddmaxnode\fP -\- checks if the max node reached. -.TP -\fBcreatebddcircuit\fP -\- creates a \fBbdd\fP circuit. -.TP -\fBresetbddcircuit\fP -\- resets a \fBbdd\fP circuit. -.TP -\fBdestroybddcircuit\fP -\- frees a \fBbdd\fP circuit. -.TP -\fBsearchbddcircuitin\fP -\- searches a specified input in a circuit. -.TP -\fBaddbddcircuitin\fP -\- adds a new input in a circuit. -.TP -\fBaddbddcircuitaux\fP -\- adds an auxialiary variable in a circuit. -.TP -\fBsearchbddcircuitout\fP -\- searches a specified output in a circuit. -.TP -\fBaddbddcircuitout\fP -\- adds a new output in a circuit. -.TP -\fBdelbddcircuitout\fP -\- deletes a specified output in a circuit. -.TP -\fBaddbddcircuitabl\fP -\- converts an \fBabl\fP to a \fBbdd\fP node. -.TP -\fBconvertbddcircuitabl\fP -\- converts a \fBbdd\fP node to an \fBabl\fP. -.TP -\fBconvertbddcircuitsumabl\fP -\- converts a \fBbdd\fP node to an \fBabl\fP. -.TP -\fBviewbddcircuit\fP -\- displays a \fBbdd\fP circuit. -.TP -\fBcofactorbddnode\fP -\- computes the generalized cofactor. -.TP -\fBrestrictbddnode\fP -\- substitutes a variable by zero or one. -.TP -\fBcomposebddnode\fP -\- substitutes a variable by a \fBbdd\fP node. -.TP -\fBconvertbddindexabl\fP -\- converts a \fBbdd\fP index to an atomic \fBabl\fP. -.TP -\fBconvertbddmuxabl\fP -\- converts a \fBbdd\fP node to a multiplexor. -.TP -\fBconvertbddnodeabl\fP -\- converts a \fBbdd\fP node to an \fBabl\fP. -.TP -\fBconvertbddnodesumabl\fP -\- converts a \fBbdd\fP node to an \fBabl\fP. -.TP -\fBexistbddnodeassocon\fP -\- computes an existantial quantification. -.TP -\fBexistbddnodeassocoff\fP -\- computes an existantial quantification. -.TP -\fBgarbagebddsystem\fP -\- forces a \fBbdd\fP garbage collection. -.TP -\fBimplybddnode\fP -\- computes a \fBbdd\fP that implies a conjonction. -.TP -\fBintersectbddnode\fP -\- tests for an intersection. -.TP -\fBmarkbddnode\fP -\- marks a \fBbdd\fP node. -.TP -\fBunmarkbddnode\fP -\- clears a marked \fBbdd\fP node. -.TP -\fBgetbddnodenum\fP -\- gets the number of nodes in a \fBbdd\fP. -.TP -\fBgetbddnodesize\fP -\- gets the number of nodes in a \fBbdd\fP. -.TP -\fBaddbddnode\fP -\- adds a new \fBbdd\fP node. -.TP -\fBaddbddnodelist\fP -\- adds a node in a \fIchain_list\fP. -.TP -\fBdelbddnode\fP -\- deletes a \fBbdd\fP node. -.TP -\fBdelbddnodelist\fP -\- deletes a list of \fBbdd\fP nodes. -.TP -\fBviewbddnode\fP -\- displays a \fBbdd\fP node. -.TP -\fBincbddrefext\fP -\- increments the number of external reference. -.TP -\fBincbddrefint\fP -\- increments the number of internal reference. -.TP -\fBdecbddrefext\fP -\- decrements the number of external reference. -.TP -\fBdecbddrefint\fP -\- decrements the number of internal reference. -.TP -\fBsetbddrefext\fP -\- sets a node visible from outside. -.TP -\fBunsetbddrefext\fP -\- sets a node invisible from outside. -.TP -\fBclearbddsystemrefint\fP -\- clears all the internal references. -.TP -\fBclearbddsystemrefext\fP -\- clears all the external references. -.TP -\fBclearbddsystemref\fP -\- clears all the references. -.TP -\fBrelprodbddnodeassoc\fP -\- computes a relation product. -.TP -\fBreorderbddsystemsimple\fP -\- reorders the \fBbdd\fP nodes. -.TP -\fBreorderbddsystemwindow\fP -\- reorders the \fBbdd\fP nodes. -.TP -\fBreorderbddsystemtop\fP -\- reorders the \fBbdd\fP nodes. -.TP -\fBreorderbddsystemdynamic\fP -\- sets the dynamic reorder parameters. -.TP -\fBsatisfybddnode\fP -\- finds a satisfying path for a \fBbdd\fP. -.TP -\fBsimpbddnodedcon\fP -\- simplifies a \fBbdd\fP with don't cares on its on-set. -.TP -\fBsimpbddnodedcoff\fP -\- simplifies a \fBbdd\fP with don't cares on its off-set -.TP -\fBsubstbddnodeassoc\fP -\- substitutes variables with \fBbdd\fP nodes. -.TP -\fBgetbddnodesupport\fP -\- gives the support of a \fBbdd\fP node. -.TP -\fBisbddvarinsupport\fP -\- checks if a variable appears in a \fBbdd\fP node. -.TP -\fBcreatebddsystem\fP -\- creates a \fBbdd\fP system. -.TP -\fBresetbddsystem\fP -\- resets a \fBbdd\fP system. -.TP -\fBdestroybddsystem\fP -\- frees a \fBbdd\fP system. -.TP -\fBviewbddsystem\fP -\- displays a \fBbdd\fP system. -.TP -\fBviewbddsysteminfo\fP -\- displays statisticals informations. -.TP -\fBtestbddcircuit\fP -\- debbugs a \fBbdd\fP circuit. -.TP -\fBaddbddvar\fP -\- creates a new variable. -.TP -\fBaddbddvarlast\fP -\- creates a new variable. -.TP -\fBaddbddvarfirst\fP -\- creates a new variable. -.TP -\fBaddbddvarbefore\fP -\- creates a new variable. -.TP -\fBaddbddvarafter\fP -\- creates a new variable. -.TP -\fBsweepbddvar\fP -\- sweeps all the unused nodes for a variable. -.TP -\fBswapbddvar\fP -\- swaps two contigous variables. -.TP -\fBgetbddvarbyindex\fP -\- converts \fBbdd\fP index to a variable number. -.TP -\fBgetbddvarindex\fP -\- converts a variable number in a \fBbdd\fP index. -.TP -\fBgetbddvarnode\fP -\- gives the \fBbdd\fP node of a variable. -.TP -\fBgetbddvarnodebyindex\fP -\- gives the \fBbdd\fP node of a variable. -.TP -\fBaddbddvarauxsingle\fP -\- creates an auxiliary variable. -.TP -\fBaddbddvarauxglobal\fP -\- creates an auxiliary variable. - -.TP 0 -libBdd101.a : - -\fBallocbdduserfunc\fP, -\fBallocbddheath\fP, -\fBallocbddhnode\fP, -\fBallocbddhoper\fP, -\fBallocbddhnodetable\fP, -\fBallocbddhopertable\fP, -\fBallocbddblock\fP, -\fBallocbddnodeblock\fP, -\fBallocbddvartree\fP, -\fBallocbddvarchild\fP, -\fBallocbddvarnode\fP, -\fBallocbddindexnode\fP, -\fBallocbddvar\fP, -\fBallocbddindex\fP, -\fBallocbddassoc\fP, -\fBallocbddassocnode\fP, -\fBallocbddnamein\fP, -\fBallocbddindexin\fP, -\fBallocbddsystem\fP, -\fBallocbddcircuit\fP, -\fBviewbddallocinfo\fP, -\fBapplybddnodenot\fP, -\fBapplybddnodeterm\fP, -\fBapplybddnode\fP, -\fBapplybddnodeite\fP, -\fBapplybddnodelist\fP, -\fBaddbddassoc\fP, -\fBaddbddnodeassoc\fP, -\fBdelbddassoc\fP, -\fBdelbddnodeassoc\fP, -\fBdestroybddassoc\fP, -\fBviewbddassoc\fP, -\fBaddbddblock\fP, -\fBcreatebddblock\fP, -\fBresetbddblock\fP, -\fBdestroybddblock\fP, -\fBviewbddblock\fP, -\fBcheckbddvar\fP, -\fBcheckbddindex\fP, -\fBcheckbddoper\fP, -\fBcheckbddassoc\fP, -\fBcheckbddmaxnode\fP, -\fBcreatebddcircuit\fP, -\fBresetbddcircuit\fP, -\fBdestroybddcircuit\fP, -\fBsearchbddcircuitin\fP, -\fBaddbddcircuitin\fP, -\fBaddbddcircuitaux\fP, -\fBsearchbddcircuitout\fP, -\fBaddbddcircuitout\fP, -\fBdelbddcircuitout\fP, -\fBaddbddcircuitabl\fP, -\fBconvertbddcircuitabl\fP, -\fBconvertbddcircuitsumabl\fP, -\fBviewbddcircuit\fP, -\fBcofactorbddnode\fP, -\fBrestrictbddnode\fP, -\fBcomposebddnode\fP, -\fBconvertbddindexabl\fP, -\fBconvertbddmuxabl\fP, -\fBconvertbddnodeabl\fP, -\fBconvertbddnodesumabl\fP, -\fBexistbddnodeassocon\fP, -\fBexistbddnodeassocoff\fP, -\fBfreebdduserfunc\fP, -\fBfreebddheath\fP, -\fBfreebddhnode\fP, -\fBfreebddhoper\fP, -\fBfreebddhnodetable\fP, -\fBfreebddhopertable\fP, -\fBfreebddblock\fP, -\fBfreebddnodeblock\fP, -\fBfreebddvartree\fP, -\fBfreebddvarchild\fP, -\fBfreebddvarnode\fP, -\fBfreebddindexnode\fP, -\fBfreebddvar\fP, -\fBfreebddindex\fP, -\fBfreebddassoc\fP, -\fBfreebddassocnode\fP, -\fBfreebddnamein\fP, -\fBfreebddindexin\fP, -\fBfreebddsystem\fP, -\fBfreebddcircuit\fP, -\fBgarbagebddsystem\fP, -\fBgetbddheathvar\fP, -\fBgetbddheath\fP, -\fBdelbddheath\fP, -\fBsetbddhnodefunc\fP, -\fBgetbddhnodesize\fP, -\fBgetbddhnodekey\fP, -\fBgetbddhnodeindex\fP, -\fBcheckbddhnode\fP, -\fBcreatebddhnodetable\fP, -\fBdestroybddhnodetable\fP, -\fBresetbddhnodetable\fP, -\fBresizebddhnodetable\fP, -\fBstretchbddhnodetable\fP, -\fBaddbddhnode\fP, -\fBdelbddhnode\fP, -\fBviewbddhnode\fP, -\fBviewbddhnodetable\fP, -\fBviewbddindexnode\fP, -\fBviewbddvarnode\fP, -\fBsetbddhoperfunc\fP, -\fBgetbddhopersize\fP, -\fBgetbddhoperkey\fP, -\fBcreatebddhopertable\fP, -\fBdestroybddhopertable\fP, -\fBresetbddhopertable\fP, -\fBaddbddhoper\fP, -\fBsearchbddhoper\fP, -\fBviewbddhoper\fP, -\fBviewbddhopertable\fP, -\fBimplybddnode\fP, -\fBintersectbddnode\fP, -\fBmarkbddnode\fP, -\fBunmarkbddnode\fP, -\fBgetbddnodenum\fP, -\fBgetbddnodesize\fP, -\fBaddbddnode\fP, -\fBaddbddnodelist\fP, -\fBdelbddnode\fP, -\fBdelbddnodelist\fP, -\fBviewbddnode\fP, -\fBincbddrefext\fP, -\fBincbddrefint\fP, -\fBdecbddrefext\fP, -\fBdecbddrefint\fP, -\fBsetbddrefext\fP, -\fBunsetbddrefext\fP, -\fBclearbddsystemrefint\fP, -\fBclearbddsystemrefext\fP, -\fBclearbddsystemref\fP, -\fBrelprodbddnodeassoc\fP, -\fBreorderbddvartreewindow2\fP, -\fBreorderbddvartreewindow3\fP, -\fBreorderbddsystemsimple\fP, -\fBreorderbddsystemwindow\fP, -\fBreorderbddsystemtop\fP, -\fBreorderbddsystemdynamic\fP, -\fBresizebddvarchild\fP, -\fBresizebddvarnode\fP, -\fBresizebddvar\fP, -\fBresizebddindexnode\fP, -\fBresizebddindex\fP, -\fBresizebddassocnode\fP, -\fBresizebddnamein\fP, -\fBresizebddindexin\fP, -\fBsatisfybddnode\fP, -\fBsimpbddnodedcon\fP, -\fBsimpbddnodedcoff\fP, -\fBsubstbddnodeassoc\fP, -\fBgetbddnodesupport\fP, -\fBisbddvarinsupport\fP, -\fBcreatebddsystem\fP, -\fBresetbddsystem\fP, -\fBdestroybddsystem\fP, -\fBviewbddsystem\fP, -\fBviewbddsysteminfo\fP, -\fBtestbddcircuit\fP, -\fBaddbdduserfunc\fP, -\fBdelbdduserfunc\fP, -\fBexecbdduserfunc\fP, -\fBdestroybdduserfunc\fP, -\fBnewbddvar\fP, -\fBaddbddvar\fP, -\fBaddbddvarlast\fP, -\fBaddbddvarfirst\fP, -\fBaddbddvarbefore\fP, -\fBaddbddvarafter\fP, -\fBsweepbddvar\fP, -\fBswapbddvar\fP, -\fBgetbddvarbyindex\fP, -\fBgetbddvarindex\fP, -\fBgetbddvarnode\fP, -\fBgetbddvarnodebyindex\fP, -\fBaddbddvarauxsingle\fP, -\fBaddbddvarauxglobal\fP, -\fBsearchbddvartree\fP, -\fBdeltabddvartree\fP, -\fBshiftbddvartree\fP, -\fBaddbddvartree\fP, -\fBswapbddvartree\fP, -\fBcreatebddvartree\fP, -\fBresetbddvartree\fP, -\fBdestroybddvartree\fP, -\fBviewbddvartree\fP. - -.SH SEE ALSO -.BR \fBaut\fP(1), \fBabl\fP(1). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/Makefile.am b/alliance/src/bdd/man3/Makefile.am deleted file mode 100644 index 8ca28858..00000000 --- a/alliance/src/bdd/man3/Makefile.am +++ /dev/null @@ -1,79 +0,0 @@ -man_MANS = addbddassoc.3 \ -addbddcircuitabl.3 \ -addbddcircuitin.3 \ -addbddcircuitout.3 \ -addbddnode.3 \ -addbddnodeassoc.3 \ -addbddnodelist.3 \ -addbddvar.3 \ -addbddvarafter.3 \ -addbddvarbefore.3 \ -addbddvarfirst.3 \ -addbddvarlast.3 \ -applybddnode.3 \ -applybddnodeite.3 \ -applybddnodelist.3 \ -applybddnodenot.3 \ -applybddnodeterm.3 \ -clearbddsystemref.3 \ -clearbddsystemrefext.3 \ -clearbddsystemrefint.3 \ -cofactorbddnode.3 \ -composebddnode.3 \ -convertbddcircuitabl.3 \ -convertbddcircuitsumabl.3 \ -convertbddindexabl.3 \ -convertbddmuxabl.3 \ -convertbddnodeabl.3 \ -convertbddnodesumabl.3 \ -createbddcircuit.3 \ -createbddsystem.3 \ -decbddrefext.3 \ -decbddrefint.3 \ -delbddassoc.3 \ -delbddcircuitout.3 \ -delbddnode.3 \ -delbddnodeassoc.3 \ -delbddnodelist.3 \ -destroybddassoc.3 \ -destroybddcircuit.3 \ -destroybddsystem.3 \ -existbddnodeassocoff.3 \ -existbddnodeassocon.3 \ -garbagebddsystem.3 \ -getbddnodenum.3 \ -getbddnodesize.3 \ -getbddnodesupport.3 \ -getbddvarbyindex.3 \ -getbddvarindex.3 \ -getbddvarnode.3 \ -getbddvarnodebyindex.3 \ -implybddnode.3 \ -incbddrefext.3 \ -incbddrefint.3 \ -intersectbddnode.3 \ -isbddvarinsupport.3 \ -markbddnode.3 \ -relprodbddnodeassoc.3 \ -reorderbddsystemdynamic.3 \ -reorderbddsystemsimple.3 \ -reorderbddsystemtop.3 \ -reorderbddsystemwindow.3 \ -resetbddcircuit.3 \ -resetbddsystem.3 \ -restrictbddnode.3 \ -satisfybddnode.3 \ -searchbddcircuitin.3 \ -searchbddcircuitout.3 \ -setbddrefext.3 \ -simpbddnodedcoff.3 \ -simpbddnodedcon.3 \ -substbddnodeassoc.3 \ -swapbddvar.3 \ -testbddcircuit.3 \ -unmarkbddnode.3 \ -unsetbddrefext.3 \ -viewbddcircuit.3 \ -viewbddnode.3 \ -viewbddsystem.3 \ -viewbddsysteminfo.3 diff --git a/alliance/src/bdd/man3/addbddassoc.3 b/alliance/src/bdd/man3/addbddassoc.3 deleted file mode 100644 index 6c761fb8..00000000 --- a/alliance/src/bdd/man3/addbddassoc.3 +++ /dev/null @@ -1,86 +0,0 @@ -.\" $Id: addbddassoc.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)addbddassoc.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH ADDBDDASSOC 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -addbddassoc \- creates a new association variables. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddassoc \(**addbddassoc( BddSystem ) - bddsystem \(**BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.SH DESCRIPTION -\fBaddbddassoc\fP creates a new association variables in the \fBbdd\fP system -\fIBddSystem\fP. If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBaddbddassoc\fP returns a pointer to the new variable association. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"no more variable association, error !" -.ft R -.RS -There is no variable association number left. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - bddnode \(**BddSubst; - bddnode \(**BddVariable; - bddassoc \(**Assoc; - chain_list \(**Expr; - bddvar Variable; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i2" ), - createablatom( "i3" ) ); - BddSubst = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddVariable = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - Variable = getbddvarbyindex( (bddsystem \(**)0, BddVariable->INDEX ); - Assoc = addbddassoc( (bddsystem \(**)0 ); - addbddnodeassoc( (bddsystem \(**)0, Assoc, Variable, BddSubst ); - BddNode = substbddnodeassoc( (bddsystem \(**)0, BddSubst, Assoc ); - delbddassoc( (bddsystem \(**)0, Assoc ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays ((i3 or i2) and i1) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddassoc( (bddsystem \(**)0 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/addbddcircuitabl.3 b/alliance/src/bdd/man3/addbddcircuitabl.3 deleted file mode 100644 index fab0f9d1..00000000 --- a/alliance/src/bdd/man3/addbddcircuitabl.3 +++ /dev/null @@ -1,82 +0,0 @@ -.\" $Id: addbddcircuitabl.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)addbddcircuitabl.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH ADDBDDCIRCUITABL 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -addbddcircuitabl \- converts an \fBabl\fP expression to a \fBbdd\fP node. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**addbddcircuitabl( BddCircuit, Expr ) - bddcircuit \(**BddCircuit; - chain_list \(**Expr; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddCircuit\fP -The \fBbdd\fP circuit. -.TP -\fIExpr\fP -The expression to convert. -.SH DESCRIPTION -\fBaddbddcircuitabl\fP converts the \fBabl\fP expression \fIExpr\fP -to a \fBbdd\fP node. The \fIBddCircuit\fP is used to translate -the atomic expressions into variable nodes. -If a null pointer is given, the default \fBbdd\fP circuit is used. -If an atomic expression doesn't appear in the \fIBddCircuit\fP -input names hash table or output names hash table, -then \fIaddbddcircuitabl\fP adds a new input by calling the function -\fIaddbddcircuitin\fP with the BDD_IN_MODE_LAST mode. -.br -.SH RETURN VALUE -\fBaddbddcircuitabl\fP returns a pointer to the \fBbdd\fP node translated. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"bad operator xxx error !" -.ft R -.RS -The \fIExpr\fP parameter must be a well defined \fBabl\fP expression. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays (i0 and i1) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1), -.BR abl (1), -.BR convertbddcircuitabl(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/addbddcircuitin.3 b/alliance/src/bdd/man3/addbddcircuitin.3 deleted file mode 100644 index 1fe8ce51..00000000 --- a/alliance/src/bdd/man3/addbddcircuitin.3 +++ /dev/null @@ -1,96 +0,0 @@ -.\" $Id: addbddcircuitin.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)addbddcircuitin.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH ADDBDDCIRCUITIN 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -addbddcircuitin \- adds an input in a \fBbdd\fP circuit. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**addbddcircuitin( BddCircuit, InputName, Index, Mode ) - bddcircuit \(**BddCircuit; - char \(**InputName; - bddindex Index; - long Mode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddCircuit\fP -The \fBbdd\fP circuit. -.TP -\fIInputName\fP -The name of the input. -.TP -\fIIndex\fP -The \fBbdd\fP index of the input. -.TP -\fIMode\fP -The mode. -.SH DESCRIPTION -\fBaddbddcircuitin\fP adds an input \fIInputName\fP in the \fBbdd\fP circuit -\fIBddCircuit\fP. If a null pointer is given, the default \fBbdd\fP circuit is used. -If the input \fIInputName\fP exists already, its node pointer is returned. -The \fIMode\fP parameter specifies how to create the new variable associated -to the name \fIInputName\fP. The \fIIndex\fP parameter is used with the -BDD_IN_MODE_BEFORE and BDD_IN_MODE_AFTER mode. -The \fIMode\fP parameter can takes the following values : -.TP 20 -BDD_IN_MODE_FIRST -adds a variable before all others. -.TP -BDD_IN_MODE_LAST -adds a variable after all others. -.TP -BDD_IN_MODE_BEFORE -adds a variable before the one specified by \fIIndex\fP. -.TP -BDD_IN_MODE_AFTER -adds a variable after the one specified by \fIIndex\fP. -.TP -BDD_IN_MODE_IMPOSE -if this flag is set, only the variables found in the \fIBddCircuit\fP -are taken into account. It permits to merge variables from different -circuit working on the same \fBbdd\fP system. -.br -.SH RETURN VALUE -\fBaddbddcircuitin\fP returns a pointer to the new created node. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"unknwon in mode xxx error !" -.ft R -.RS -The \fIMode\fP parameter must be defined. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - addbddcircuitin ( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - ... - BddNode = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/addbddcircuitout.3 b/alliance/src/bdd/man3/addbddcircuitout.3 deleted file mode 100644 index 50861b6a..00000000 --- a/alliance/src/bdd/man3/addbddcircuitout.3 +++ /dev/null @@ -1,66 +0,0 @@ -.\" $Id: addbddcircuitout.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)addbddcircuitout.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH ADDBDDCIRCUITOUT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -addbddcircuitout \- adds an output in a \fBbdd\fP circuit. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**addbddcircuitout( BddCircuit, OutputName, BddNode ) - bddcircuit \(**BddCircuit; - char \(**OutputName; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddCircuit\fP -The \fBbdd\fP circuit. -.TP -\fIOutputName\fP -The name of the output. -.TP -\fIBddNode\fP -The \fBbdd\fP node of the output. -.SH DESCRIPTION -\fBaddbddcircuitout\fP adds \fIBddNode\fP as an output \fIOutputName\fP in the \fBbdd\fP circuit -\fIBddCircuit\fP. If a null pointer is given, the default \fBbdd\fP circuit is used. -If the output \fIOutputName\fP exists already, the number of external reference of the old node -is decremented, and the output node is replaced by the new one. -.br -.SH RETURN VALUE -\fBaddbddcircuitout\fP returns the node \fIBddNode\fP with its number of external -reference incremented. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - ... - addbddcircuitout( (bddcircuit \(**)0, "Out0", BddNode ); - ... - BddNode = searchbddcircuitout( (bddcircuit \(**)0, "Out0" ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) -.BR searchbddcircuitout(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/addbddnode.3 b/alliance/src/bdd/man3/addbddnode.3 deleted file mode 100644 index abc88a75..00000000 --- a/alliance/src/bdd/man3/addbddnode.3 +++ /dev/null @@ -1,83 +0,0 @@ -.\" $Id: addbddnode.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)addbddnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH ADDBDDNODE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -addbddnode \- adds a new \fBbdd\fP node in the \fBbdd\fP system. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**addbddnode( BddSystem, Index, High, Low ) - bddsystem \(**BddSystem; - bddindex Index; - bddnode \(**High; - bddnode \(**Low; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIIndex\fP -The \fBbdd\fP index. -.TP -\fIHigh\fP -The \fBbdd\fP high pointer. -.TP -\fILow\fP -The \fBbdd\fP low pointer. -.SH DESCRIPTION -\fBaddbddnode\fP adds a new node with the index \fIIndex\fP, -\fIHigh\fP as HIGH pointer, and \fILow\fP as LOW pointer -in the \fBbdd\fP system \fIBddSystem\fP. If the \fBbdd\fP node exist -already \fBaddbddnode\fP return its pointer. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBaddbddnode\fP returns a pointer to the resulting \fBbdd\fP node -with its number of external reference incremented. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"index xxx out of range" -.ft R -.RS -The \fIIndex\fP parameter must be a valid index. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - BddNode = addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - BddNode = addbddnode( (bddsystem \(**)0, BddNode->INDEX, BddNode->LOW, BddNode->HIGH ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - /* displays (not i0) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/addbddnodeassoc.3 b/alliance/src/bdd/man3/addbddnodeassoc.3 deleted file mode 100644 index 61c93996..00000000 --- a/alliance/src/bdd/man3/addbddnodeassoc.3 +++ /dev/null @@ -1,101 +0,0 @@ -.\" $Id: addbddnodeassoc.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)addbddnodeassoc.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH ADDBDDNODEASSOC 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -addbddnodeassoc \- adds a \fBbdd\fP node in a variable association. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddassoc \(**addbddnodeassoc( BddSystem, BddAssoc, Variable, BddNode ) - bddsystem \(**BddSystem; - bddassoc \(**BddAssoc; - bddvar Variable; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddAssoc\fP -The variable association. -.TP -\fIVariable\fP -The variable number. -.TP -\fIBddNode\fP -The \fBbdd\fP node to add. -.SH DESCRIPTION -\fBaddbddnodeassoc\fP adds the \fBbdd\fP node \fIBddNode\fP, associated to the -variable number \fIVariable\fP, in the variable association \fIBddAssoc\fP, -in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -The number of external reference of \fIBddNode\fP is incremented. -.br -.SH RETURN VALUE -\fBaddbddnodeassoc\fP returns a pointer to the variable association. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"variable xxx out of range, error !" -.ft R -.RS -The \fIVariable\fP parameter must be less or equal to -the \fIBddSystem->NUMBER_VAR\fP field. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - bddnode \(**BddSubst; - bddnode \(**BddVariable; - bddassoc \(**Assoc; - chain_list \(**Expr; - bddvar Variable; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i2" ), - createablatom( "i3" ) ); - BddSubst = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddVariable = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - Variable = getbddvarbyindex( (bddsystem \(**)0, BddVariable->INDEX ); - Assoc = addbddassoc( (bddsystem \(**)0 ); - addbddnodeassoc( (bddsystem \(**)0, Assoc, Variable, BddSubst ); - BddNode = substbddnodeassoc( (bddsystem \(**)0, BddSubst, Assoc ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays ((i3 or i2) and i1) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddassoc( (bddsystem \(**)0 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/addbddnodelist.3 b/alliance/src/bdd/man3/addbddnodelist.3 deleted file mode 100644 index c510795d..00000000 --- a/alliance/src/bdd/man3/addbddnodelist.3 +++ /dev/null @@ -1,78 +0,0 @@ -.\" $Id: addbddnodelist.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)addbddnodelist.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH ADDBDDNODELIST 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -addbddnodelist \- adds a node in a \fIchain_list\fP. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -chain_list \(**addbddnodelist( BddSystem, HeadList, BddNode ) - bddsystem \(**BddSystem; - chain_list \(**HeadList; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIHeadList\fP -The head of the \fIchain_list\fP. -.TP -\fIBddNode\fP -The \fBbdd\fP node to add. -.SH DESCRIPTION -\fBaddbddnodelist\fP adds the node \fIBddNode\fP in the ordered list -\fIHeadList\fP, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -The number of external reference of \fIBddNode\fP is incremented. -.br -.SH RETURN VALUE -\fBaddbddnodelist\fP returns the new head of the list. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**BddList; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - BddList = (chain_list \(**)0; - BddList = addbddnodelist( (bddsystem \(**)0, BddList, - addbddcircuitin( (bddcircuit \(**)0, - "i0", 0, BDD_IN_MODE_FIRST ) ); - BddList = addbddnodelist( (bddsystem \(**)0, BddList, - addbddcircuitin( (bddcircuit \(**)0, - "i1", 0, BDD_IN_MODE_FIRST ); - BddList = addbddnodelist( (bddsystem \(**)0, BddList, - addbddcircuitin( (bddcircuit \(**)0, - "i2", 0, BDD_IN_MODE_FIRST ); - BddNode = applybddnodelist( (bddsystem \(**)0, ABL_AND, BddList ); - delbddnodelist( (bddsystem \(**)0, BddList ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - /* displays (i0 and i1 and i2) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/addbddvar.3 b/alliance/src/bdd/man3/addbddvar.3 deleted file mode 100644 index 325b52c5..00000000 --- a/alliance/src/bdd/man3/addbddvar.3 +++ /dev/null @@ -1,73 +0,0 @@ -.\" $Id: addbddvar.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)addbddvar.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH ADDBDDVAR 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -addbddvar \- adds a new variable in the \fBbdd\fP system. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**addbddvar( BddSystem, Variable ) - bddsystem \(**BddSystem; - bddvar Variable; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIVariable\fP -The variable number. -.SH DESCRIPTION -\fBaddbddvar\fP creates a new variable, with the number \fIVariable\fP, -in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBaddbddvar\fP returns a pointer to the \fBbdd\fP node of the new variable. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"no more variables, error !" -.ft R -.RS -There is no variable number left. -.RE -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"variable xxx out of range, error !" -.ft R -.RS -The \fIVariable\fP parameter must be less or equal to -the \fIBddSystem->NUMBER_VAR\fP field. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddNode = addbddvar( (bddsystem \(**)0, 0 ); - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/addbddvarafter.3 b/alliance/src/bdd/man3/addbddvarafter.3 deleted file mode 100644 index c3dfaba1..00000000 --- a/alliance/src/bdd/man3/addbddvarafter.3 +++ /dev/null @@ -1,75 +0,0 @@ -.\" $Id: addbddvarafter.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)addbddvarafter.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH ADDBDDVARAFTER 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -addbddvarafter \- adds a new variable, after an existing one. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**addbddvarafter( BddSystem ) - bddsystem \(**BddSystem; - bddindex Index; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIIndex\fP -The \fBbdd\fP index of an existing variable. -.SH DESCRIPTION -\fBaddbddvarafter\fP creates a new variable, with the number -\fIBddSystem\fP->INDEX_TO_VAR[ \fIIndex\fP ] + 1 -in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBaddbddvarafter\fP returns a pointer to the \fBbdd\fP node of the new variable. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"no more variables, error !" -.ft R -.RS -There is no variable number left. -.RE -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"index xxx out of range, error !" -.ft R -.RS -The \fIIndex\fP parameter must be a valid index. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode1; - bddnode \(**BddNode2; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddNode1 = addbddvarfirst( (bddsystem \(**)0 ); - BddNode2 = addbddvarafter( (bddsystem \(**)0, BddNode1->INDEX ); - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/addbddvarbefore.3 b/alliance/src/bdd/man3/addbddvarbefore.3 deleted file mode 100644 index 2a85f351..00000000 --- a/alliance/src/bdd/man3/addbddvarbefore.3 +++ /dev/null @@ -1,75 +0,0 @@ -.\" $Id: addbddvarbefore.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)addbddvarbefore.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH ADDBDDVARBEFORE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -addbddvarbefore \- adds a new variable, before an existing one. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**addbddvarbefore( BddSystem ) - bddsystem \(**BddSystem; - bddindex Index; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIIndex\fP -The \fBbdd\fP index of an existing variable. -.SH DESCRIPTION -\fBaddbddvarbefore\fP creates a new variable, with the number -\fIBddSystem\fP->INDEX_TO_VAR[ \fIIndex\fP ] -in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBaddbddvarbefore\fP returns a pointer to the \fBbdd\fP node of the new variable. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"no more variables, error !" -.ft R -.RS -There is no variable number left. -.RE -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"index xxx out of range, error !" -.ft R -.RS -The \fIIndex\fP parameter must be a valid index. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode1; - bddnode \(**BddNode2; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddNode1 = addbddvarfirst( (bddsystem \(**)0 ); - BddNode2 = addbddvarbefore( (bddsystem \(**)0, BddNode1->INDEX ); - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/addbddvarfirst.3 b/alliance/src/bdd/man3/addbddvarfirst.3 deleted file mode 100644 index 80c09c38..00000000 --- a/alliance/src/bdd/man3/addbddvarfirst.3 +++ /dev/null @@ -1,59 +0,0 @@ -.\" $Id: addbddvarfirst.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)addbddvarfirst.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH ADDBDDVARFIRST 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -addbddvarfirst \- adds a new variable, before all others. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**addbddvarfirst( BddSystem ) - bddsystem \(**BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.SH DESCRIPTION -\fBaddbddvarfirst\fP creates a new variable, with the number 0, -in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBaddbddvarfirst\fP returns a pointer to the \fBbdd\fP node of the new variable. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"no more variables, error !" -.ft R -.RS -There is no variable number left. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddNode = addbddvarfirst( (bddsystem \(**)0 ); - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/addbddvarlast.3 b/alliance/src/bdd/man3/addbddvarlast.3 deleted file mode 100644 index e8b4c98c..00000000 --- a/alliance/src/bdd/man3/addbddvarlast.3 +++ /dev/null @@ -1,59 +0,0 @@ -.\" $Id: addbddvarlast.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)addbddvarlast.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH ADDBDDVARLAST 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -addbddvarlast \- adds a new variable, after all others. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**addbddvarlast( BddSystem ) - bddsystem \(**BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.SH DESCRIPTION -\fBaddbddvarlast\fP creates a new variable, with the number -\fIBddLocalSystem->NUMBER_VAR\fP in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBaddbddvarlast\fP returns a pointer to the \fBbdd\fP node of the new variable. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"no more variables, error !" -.ft R -.RS -There is no variable number left. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddNode = addbddvarlast( (bddsystem \(**)0 ); - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/applybddnode.3 b/alliance/src/bdd/man3/applybddnode.3 deleted file mode 100644 index 25250f2a..00000000 --- a/alliance/src/bdd/man3/applybddnode.3 +++ /dev/null @@ -1,85 +0,0 @@ -.\" $Id: applybddnode.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)applybddnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH APPLYBDDNODE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -applybddnode \- applies an operator on two \fBbdd\fP nodes. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**applybddnode( BddSystem, Oper, BddNode1, BddNode2 ) - bddsystem \(**BddSystem; - long Oper; - bddnode \(**BddNode1; - bddnode \(**BddNode2; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIOper\fP -The binary operator. -.TP -\fIBddNode1\fP -The first \fBbdd\fP node. -.TP -\fIBddNode2\fP -The second \fBbdd\fP node. -.SH DESCRIPTION -\fBapplybddnode\fP computes the boolean function \fIBddNode1\fP -\fIOper\fP \fIBddNode2\fP in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBapplybddnode\fP returns a pointer to the resulting \fBbdd\fP node -with its number of external reference incremented. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"bad operator xxx error !" -.ft R -.RS -The \fIOper\fP parameter must be a valid binary operator. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - addbddcircuitin( (bddcircuit \(**)0, "i1", 0, BDD_IN_MODE_FIRST ); - BddNode = applybddnode( (bddsystem \(**)0, - ABL_AND, - searchbddcircuitin( (bddcircuit \(**)0, "i0" ), - searchbddcircuitin( (bddcircuit \(**)0, "i1" ) ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - /* displays (i0 and i1) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/applybddnodeite.3 b/alliance/src/bdd/man3/applybddnodeite.3 deleted file mode 100644 index 51de266c..00000000 --- a/alliance/src/bdd/man3/applybddnodeite.3 +++ /dev/null @@ -1,78 +0,0 @@ -.\" $Id: applybddnodeite.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)applybddnodeite.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH APPLYBDDNODEITE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -applybddnodeite \- computes the IF-THEN-ELSE logical operation. - -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**applybddnodeite( BddSystem, BddIf, BddThen, BddElse ) - bddnode \(**BddSystem; - bddnode \(**BddIf; - bddnode \(**BddThen; - bddnode \(**BddElse; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddIf\fP -The IF \fBbdd\fP node. -.TP -\fIBddThen\fP -The THEN \fBbdd\fP node. -.TP -\fIBddElse\fP -The ELSE \fBbdd\fP node. -.SH DESCRIPTION -\fBapplybddnodeite\fP computes the following logical function -(\fIBddIf\fP AND \fIBddThen\fP) OR ((NOT \fIBddIf\fP) AND \fIBddElse\fP) -in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBapplybddnodeite\fP returns a pointer to the resulting \fBbdd\fP node -with its number of external reference incremented. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - addbddcircuitin( (bddcircuit \(**)0, "i1", 0, BDD_IN_MODE_FIRST ); - addbddcircuitin( (bddcircuit \(**)0, "i2", 0, BDD_IN_MODE_FIRST ); - BddNode = applybddnodeite( (bddsystem \(**)0, - searchbddcircuitin( (bddcircuit \(**)0, "i0" ), - searchbddcircuitin( (bddcircuit \(**)0, "i1" ), - searchbddcircuitin( (bddcircuit \(**)0, "i2" ) ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - /* displays ((i0 and i1) or ((not i0) and i2) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/applybddnodelist.3 b/alliance/src/bdd/man3/applybddnodelist.3 deleted file mode 100644 index 7dc21262..00000000 --- a/alliance/src/bdd/man3/applybddnodelist.3 +++ /dev/null @@ -1,96 +0,0 @@ -.\" $Id: applybddnodelist.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)applybddnodelist.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH APPLYBDDNODELIST 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -applybddnodelist \- applies an opertor to a \fBbdd\fP nodes list. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**applybddnodelist( BddSystem, Oper, BddList ) - bddsystem \(**BddSystem; - long Oper; - chain_list \(**BddList; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIOper\fP -The operator. -.TP -\fIBddList\fP -The \fBbdd\fP nodes list. -.SH DESCRIPTION -\fBapplybddnodelist\fP applies the boolean operator \fIOper\fP to the -\fBbdd\fP nodes list \fIBddList\fP in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBapplybddnodelist\fP returns a pointer to the resulting \fBbdd\fP node -with its number of external reference incremented. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"bad operator xxx error !" -.ft R -.RS -The \fIOper\fP parameter must be a valid binary operator. -.RE -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"bad list !" -.ft R -.RS -The \fIBddList\fP parameter must be a valid list. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**BddList; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - BddList = (chain_list \(**)0; - BddList = addbddnodelist( (bddsystem \(**)0, BddList, - addbddcircuitin( (bddcircuit \(**)0, - "i0", 0, BDD_IN_MODE_FIRST ) ); - BddList = addbddnodelist( (bddsystem \(**)0, BddList, - addbddcircuitin( (bddcircuit \(**)0, - "i1", 0, BDD_IN_MODE_FIRST ); - BddList = addbddnodelist( (bddsystem \(**)0, BddList, - addbddcircuitin( (bddcircuit \(**)0, - "i2", 0, BDD_IN_MODE_FIRST ); - BddNode = applybddnodelist( (bddsystem \(**)0, ABL_AND, BddList ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - /* displays (i0 and i1 and i2) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/applybddnodenot.3 b/alliance/src/bdd/man3/applybddnodenot.3 deleted file mode 100644 index f4e26a74..00000000 --- a/alliance/src/bdd/man3/applybddnodenot.3 +++ /dev/null @@ -1,68 +0,0 @@ -.\" $Id: applybddnodenot.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)applybddnodenot.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH APPLYBDDNODENOT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -applybddnodenot \- complements a \fBbdd\fP. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**applybddnodenot( BddSystem, BddNode ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node to complement. -.SH DESCRIPTION -\fBapplybddnodenot\fP complements \fIBddNode\fP in the \fBbdd\fP -system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBapplybddnodenot\fP returns a pointer to the resulting \fBbdd\fP node -with its number of external reference incremented. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - addbddcircuitin( (bddcircuit \(**)0, "i1", 0, BDD_IN_MODE_FIRST ); - BddNode = applybddnode( (bddsystem \(**)0, - ABL_AND, - searchbddcircuitin( (bddcircuit \(**)0, "i0" ), - searchbddcircuitin( (bddcircuit \(**)0, "i1" ) ); - BddNode = applybddnodenot( (bddsystem \(**)0, decbddrefext( BddNode ) ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - /* displays (i0 nand i1) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/applybddnodeterm.3 b/alliance/src/bdd/man3/applybddnodeterm.3 deleted file mode 100644 index c9bace57..00000000 --- a/alliance/src/bdd/man3/applybddnodeterm.3 +++ /dev/null @@ -1,85 +0,0 @@ -.\" $Id: applybddnodeterm.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)applybddnodeterm.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH APPLYBDDNODETERM 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -applybddnodeterm \- applies an operator on two \fBbdd\fP nodes. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**applybddnodeterm( BddSystem, Oper, Index, BddNode ) - bddsystem \(**BddSystem; - long Oper; - bddindex Index; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIOper\fP -The binary operator. -.TP -\fIIndex\fP -The index of the terminal \fBbdd\fP node. -.TP -\fIBddNode\fP -The \fBbdd\fP node. -.SH DESCRIPTION -\fBapplybddnodeterm\fP computes the boolean function \fIBddNode\fP -\fIOper\fP and the terminal node corresponding to \fIIndex\fP -in the \fBbdd\fP system \fIBddSystem\fP. The \fIIndex\fP parameter -can take only the two following values BDD_INDEX_ONE and BDD_INDEX_ZERO. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBapplybddnodeterm\fP returns a pointer to the resulting \fBbdd\fP node -with its number of external reference incremented. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"bad operator xxx error !" -.ft R -.RS -The \fIOper\fP parameter must be a valid binary operator. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - BddNode = applybddnodeterm( (bddsystem \(**)0, - ABL_XOR, BDD_INDEX_ONE, - searchbddcircuitin( (bddcircuit \(**)0, "i0" ) ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - /* displays (not i0) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/clearbddsystemref.3 b/alliance/src/bdd/man3/clearbddsystemref.3 deleted file mode 100644 index e8cca16f..00000000 --- a/alliance/src/bdd/man3/clearbddsystemref.3 +++ /dev/null @@ -1,52 +0,0 @@ -.\" $Id: clearbddsystemref.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)clearbddsystemref.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH CLEARBDDSYSTEMREF 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -clearbddsystemref \- clears the references for all \fBbdd\fP nodes. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void clearbddsystemref( BddSystem ) - bddsystem \(*BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.SH DESCRIPTION -\fBclearbddsystemref\fP clears the internal and external references -of all the \fBbdd\fP nodes in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBclearbddsystemref\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - ... - clearbddsystemref( (bddsystem \(**)0 ); - ... - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1), -.BR clearbddsystemrefint(3), -.BR clearbddsystemrefext(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/clearbddsystemrefext.3 b/alliance/src/bdd/man3/clearbddsystemrefext.3 deleted file mode 100644 index 472812a3..00000000 --- a/alliance/src/bdd/man3/clearbddsystemrefext.3 +++ /dev/null @@ -1,52 +0,0 @@ -.\" $Id: clearbddsystemrefext.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)clearbddsystemrefext.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH CLEARBDDSYSTEMREFEXT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -clearbddsystemrefext \- clears the external references for all \fBbdd\fP nodes. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void clearbddsystemrefext( BddSystem ) - bddsystem \(*BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.SH DESCRIPTION -\fBclearbddsystemrefext\fP clears the external references -of all the \fBbdd\fP nodes in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBclearbddsystemrefext\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - ... - clearbddsystemrefext( (bddsystem \(**)0 ); - ... - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1), -.BR clearbddsystemref(3), -.BR clearbddsystemrefint(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/clearbddsystemrefint.3 b/alliance/src/bdd/man3/clearbddsystemrefint.3 deleted file mode 100644 index 4346d562..00000000 --- a/alliance/src/bdd/man3/clearbddsystemrefint.3 +++ /dev/null @@ -1,52 +0,0 @@ -.\" $Id: clearbddsystemrefint.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)clearbddsystemrefint.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH CLEARBDDSYSTEMREFINT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -clearbddsystemrefint \- clears the internal references for all \fBbdd\fP nodes. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void clearbddsystemrefint( BddSystem ) - bddsystem \(*BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.SH DESCRIPTION -\fBclearbddsystemrefint\fP clears the internal references -of all the \fBbdd\fP nodes in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBclearbddsystemrefint\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - ... - clearbddsystemrefint( (bddsystem \(**)0 ); - ... - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1), -.BR clearbddsystemref(3), -.BR clearbddsystemrefext(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/cofactorbddnode.3 b/alliance/src/bdd/man3/cofactorbddnode.3 deleted file mode 100644 index 7ee0c5b7..00000000 --- a/alliance/src/bdd/man3/cofactorbddnode.3 +++ /dev/null @@ -1,88 +0,0 @@ -.\" $Id: cofactorbddnode.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)cofactorbddnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH COFACTORBDDNODE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -cofactorbddnode \- computes the generalized cofactor. - -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**cofactorbddnode( BddSystem, BddNode1, BddNode2 ) - bddsystem \(**BddSystem; - bddnode \(**BddNode1; - bddnode \(**BddNode2; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode1\fP -The first \fBbdd\fP node. -.TP -\fIBddNode2\fP -The second \fBbdd\fP node. -.SH DESCRIPTION -\fBcofactorbddnode\fP computes the generalized cofactor of -\fIBddNode1\fP by \fIBddNode2\fP, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBcofactorbddnode\fP returns the resulting \fBbdd\fP node. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"index xxx out of range" -.ft R -.RS -The \fIBddNode2\fP parameter must be different to the zero \fBbdd\fP node. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode1; - bddnode \(**BddNode2; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode1 = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode2 = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddNode = cofactorbddnode( (bddsystem \(**)0, BddNode1, BddNode2 ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays '1' */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/composebddnode.3 b/alliance/src/bdd/man3/composebddnode.3 deleted file mode 100644 index f42eea05..00000000 --- a/alliance/src/bdd/man3/composebddnode.3 +++ /dev/null @@ -1,97 +0,0 @@ -.\" $Id: composebddnode.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)composebddnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH COMPOSEBDDNODE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -composebddnode \- substitutes a variable by a \fBbdd\fP in another \fBbdd\fP. - -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**composebddnode( BddSystem, BddNode, Variable, BddSubst ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; - bddvar Variable; - bddnode \(**BddSubst; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node. -.TP -\fIVariable\fP -The variable to find. -.TP -\fIBddSubst\fP -The \fBbdd\fP to substitute with. -.SH DESCRIPTION -\fBcomposebddnode\fP substitutes all the occurency of the variable \fIVariable\fP -in the \fBbdd\fP node \fIBddNode\fP by the \fBbdd\fP node \fIBddSubst\fP, in the -\fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBcomposebddnode\fP returns the resulting \fBbdd\fP node. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"variable xxx out of range, error !" -.ft R -.RS -The \fIVariable\fP parameter must be less or equal to -the \fIBddSystem->NUMBER_VAR\fP field. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddVariable; - bddnode \(**BddNode; - bddnode \(**BddSubst; - chain_list \(**Expr; - bddvar Variable; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i2" ), - createablatom( "i3" ) ); - BddSubst = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddVariable = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - Variable = getbddvarbyindex( (bddsystem \(**)0, BddVariable->INDEX ); - BddNode = composebddnode( (bddsystem \(**)0, BddNode, Variable, BddSubst ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays (i1 and (i2 or i3)) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/convertbddcircuitabl.3 b/alliance/src/bdd/man3/convertbddcircuitabl.3 deleted file mode 100644 index e2f1e828..00000000 --- a/alliance/src/bdd/man3/convertbddcircuitabl.3 +++ /dev/null @@ -1,69 +0,0 @@ -.\" $Id: convertbddcircuitabl.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)convertbddcircuitabl.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH CONVERTBDDCIRCUITABL 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -convertbddcircuitabl \- converts a \fBbdd\fP node to an \fBabl\fP expression. - -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -chain_list \(**convertbddcircuitabl( BddCircuit, BddNode ) - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddCircuit\fP -The \fBbdd\fP circuit. -.TP -\fIBddNode\fP -The \fBbdd\fP node to convert. -.SH DESCRIPTION -\fBconvertbddcircuitabl\fP converts the \fBbdd\fP node -to an \fBabl\fP expression. The \fIBddCircuit\fP is used to translate -the variable nodes into atomic expressions. -If a null pointer is given, the default \fBbdd\fP circuit is used. -.br -.SH RETURN VALUE -\fBconvertbddcircuitabl\fP returns a pointer to the \fBabl\fP expression translated. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays (i0 and i1) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1), -.BR abl (1), -.BR addbddcircuitabl(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/convertbddcircuitsumabl.3 b/alliance/src/bdd/man3/convertbddcircuitsumabl.3 deleted file mode 100644 index f3e9901d..00000000 --- a/alliance/src/bdd/man3/convertbddcircuitsumabl.3 +++ /dev/null @@ -1,69 +0,0 @@ -.\" $Id: convertbddcircuitsumabl.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)convertbddcircuitsumabl.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH CONVERTBDDCIRCUITSUMABL 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -convertbddcircuitsumabl \- converts a \fBbdd\fP node to an \fBabl\fP expression. - -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -chain_list \(**convertbddcircuitsumabl( BddCircuit, BddNode ) - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddCircuit\fP -The \fBbdd\fP circuit. -.TP -\fIBddNode\fP -The \fBbdd\fP node to convert. -.SH DESCRIPTION -\fBconvertbddcircuitsumabl\fP converts the \fBbdd\fP node -to a non optimal \fBabl\fP expression. The \fIBddCircuit\fP is used to translate -the variable nodes into atomic expressions. -If a null pointer is given, the default \fBbdd\fP circuit is used. -.br -.SH RETURN VALUE -\fBconvertbddcircuitsumabl\fP returns a pointer to the \fBabl\fP expression translated. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitsumabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = convertbddcircuitsumabl( BddCircuit, BddNode ); - /* displays (i0 and i1) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1), -.BR abl (1), -.BR addbddcircuitabl(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/convertbddindexabl.3 b/alliance/src/bdd/man3/convertbddindexabl.3 deleted file mode 100644 index c964a840..00000000 --- a/alliance/src/bdd/man3/convertbddindexabl.3 +++ /dev/null @@ -1,76 +0,0 @@ -.\" $Id: convertbddindexabl.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)convertbddindexabl.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH CONVERTBDDINDEXABL 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -convertbddindexabl \- converts a \fBbdd\fP index to an \fBabl\fP expression. - -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -chain_list *convertbddnodeabl( BddSystem, NameArray, IndexArray, BddNode ) - bddsystem \(**BddSystem; - char \(**\(**NameArray; - bddindex \(**IndexArray; - bddindex Index; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fINameArray\fP -The array of names. -.TP -\fIIndexArray\fP -The array of indexes. -.TP -\fIIndex\fP -The \fBbdd\fP index to convert. -.SH DESCRIPTION -\fBconvertbddindexabl\fP converts the \fBbdd\fP index \fIIndex\fP -to an \fBabl\fP expression in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -The \fINameArray\fP, and \fIIndexArray\fP parameters are used -to translate the variable nodes into atomic expressions. -The array \fINameArray\fP is list of names. -The array \fIIndexArray\fP does the correspondence between a \fBbdd\fP index -and a slot in the \fINameArray\fP. If the \fIIndexArray\fP parameter -is a null pointer, then the name of the \fBbdd\fP index BDD_INDEX_MIN is assumed -to be the first slot of the \fINameArray\fP, and so on. -.br -.SH RETURN VALUE -\fBconvertbddindexabl\fP returns a pointer to the \fBabl\fP expression translated. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode; - chain_list \(**Expr; - char \(**NameArray[ 1 ]; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddNode = addbddvarlast( BddSystem ); - NameArray[ 0 ] = namealloc( "i0" ); - Expr = convertbddindexabl( BddSystem, NameArray, (bddindex \(**)0, BddNode->INDEX ); - /* displays i0 */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/convertbddmuxabl.3 b/alliance/src/bdd/man3/convertbddmuxabl.3 deleted file mode 100644 index 5a5426d7..00000000 --- a/alliance/src/bdd/man3/convertbddmuxabl.3 +++ /dev/null @@ -1,90 +0,0 @@ -.\" $Id: convertbddmuxabl.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)convertbddmuxabl.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH CONVERTBDDMUXABL 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -convertbddmuxabl \- converts two \fBbdd\fP nodes to an \fBabl\fP multiplexor expression. - -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -chain_list *convertbddmuxabl( BddSystem, NameArray, IndexArray, Equation, BddHigh, BddLow ) - bddsystem \(*BddSystem; - char \(*\(*NameArray; - bddindex \(*IndexArray; - chain_list \(*Equation; - bddnode \(*BddHigh; - bddnode \(*BddLow; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fINameArray\fP -The array of names. -.TP -\fIIndexArray\fP -The array of indexes. -.TP -\fIEquation\fP -The multiplexor command. -.TP -\fIBddHigh\fP -The first \fBbdd\fP node. -.TP -\fIBddLow\fP -The second \fBbdd\fP node. -.SH DESCRIPTION -\fBconvertbddmuxabl\fP creates the following \fBabl\fP expression -( \fIBddHigh\fP AND \fIEquation\fP ) OR ( \fIBddLow\fP AND (NOT \fIEquation\fP ) ) -in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -The \fINameArray\fP, and \fIIndexArray\fP parameters are used -to translate the variable nodes into atomic expressions. -The array \fINameArray\fP is list of names. -The array \fIIndexArray\fP does the correspondence between a \fBbdd\fP node -index and a slot in the \fINameArray\fP. If the \fIIndexArray\fP parameter -is a null pointer, then the name of the \fBbdd\fP index BDD_INDEX_MIN is assumed -to be the first slot of the \fINameArray\fP, and so on. -.br -.SH RETURN VALUE -\fBconvertbddmuxabl\fP returns a pointer to the \fBabl\fP expression translated. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode1; - bddnode \(**BddNode2; - chain_list \(**Expr; - char \(**NameArray[ 2 ]; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddNode1 = addbddvarlast( BddSystem ); - BddNode2 = addbddvarlast( BddSystem ); - NameArray[ 0 ] = namealloc( "i0" ); - NameArray[ 1 ] = namealloc( "i1" ); - Expr = convertbddmuxabl( BddSystem, NameArray, (bddindex \(**)0, - createablatom( "C" ), BddNode1, BddNode2 ); - /* displays (i0 and C) or (i1 and (not C)) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1), -.BR abl (1). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/convertbddnodeabl.3 b/alliance/src/bdd/man3/convertbddnodeabl.3 deleted file mode 100644 index c375cb96..00000000 --- a/alliance/src/bdd/man3/convertbddnodeabl.3 +++ /dev/null @@ -1,77 +0,0 @@ -.\" $Id: convertbddnodeabl.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)convertbddnodeabl.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH CONVERTBDDNODEABL 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -convertbddnodeabl \- converts a \fBbdd\fP node to an \fBabl\fP expression. - -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -chain_list *convertbddnodeabl( BddSystem, NameArray, IndexArray, BddNode ) - bddsystem \(**BddSystem; - char \(**\(**NameArray; - bddindex \(**IndexArray; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fINameArray\fP -The array of names. -.TP -\fIIndexArray\fP -The array of indexes. -.TP -\fIBddNode\fP -The \fBbdd\fP node to convert. -.SH DESCRIPTION -\fBconvertbddnodeabl\fP converts the \fBbdd\fP node \fIBddNode\fP -to an \fBabl\fP expression in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -The \fINameArray\fP, and \fIIndexArray\fP parameters are used -to translate the variable nodes into atomic expressions. -The array \fINameArray\fP is list of names. -The array \fIIndexArray\fP does the correspondence between a \fBbdd\fP node -index and a slot in the \fINameArray\fP. If the \fIIndexArray\fP parameter -is a null pointer, then the name of the \fBbdd\fP index BDD_INDEX_MIN is assumed -to be the first slot of the \fINameArray\fP, and so on. -.br -.SH RETURN VALUE -\fBconvertbddnodeabl\fP returns a pointer to the \fBabl\fP expression translated. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode; - chain_list \(**Expr; - char \(**NameArray[ 1 ]; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddNode = addbddvarlast( BddSystem ); - NameArray[ 0 ] = namealloc( "i0" ); - Expr = convertbddnodeabl( BddSystem, NameArray, (bddindex \(**)0, BddNode ); - /* displays i0 */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1), -.BR abl (1). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/convertbddnodesumabl.3 b/alliance/src/bdd/man3/convertbddnodesumabl.3 deleted file mode 100644 index de9403f1..00000000 --- a/alliance/src/bdd/man3/convertbddnodesumabl.3 +++ /dev/null @@ -1,77 +0,0 @@ -.\" $Id: convertbddnodesumabl.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)convertbddnodesumabl.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH CONVERTBDDNODESUMABL 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -convertbddnodesumabl \- converts a \fBbdd\fP node to an \fBabl\fP expression. - -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -chain_list *convertbddnodesumabl( BddSystem, NameArray, IndexArray, BddNode ) - bddsystem \(**BddSystem; - char \(**\(**NameArray; - bddindex \(**IndexArray; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fINameArray\fP -The array of names. -.TP -\fIIndexArray\fP -The array of indexes. -.TP -\fIBddNode\fP -The \fBbdd\fP node to convert. -.SH DESCRIPTION -\fBconvertbddnodesumabl\fP converts the \fBbdd\fP node -to a non optimal \fBabl\fP expression in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -The \fINameArray\fP, and \fIIndexArray\fP parameters are used -to translate the variable nodes into atomic expressions. -The array \fINameArray\fP is list of names. -The array \fIIndexArray\fP does the correspondence between a \fBbdd\fP node -index and a slot in the \fINameArray\fP. If the \fIIndexArray\fP parameter -is a null pointer, then the name of the \fBbdd\fP index BDD_INDEX_MIN is assumed -to be the first slot of the \fINameArray\fP, and so on. -.br -.SH RETURN VALUE -\fBconvertbddnodesumabl\fP returns a pointer to the \fBabl\fP expression translated. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode; - chain_list \(**Expr; - char \(**NameArray[ 1 ]; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddNode = addbddvarlast( BddSystem ); - NameArray[ 0 ] = namealloc( "i0" ); - Expr = convertbddnodesumabl( BddSystem, NameArray, (bddindex \(**)0, BddNode ); - /* displays i0 */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1), -.BR abl (1). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/createbddcircuit.3 b/alliance/src/bdd/man3/createbddcircuit.3 deleted file mode 100644 index 6c7599d1..00000000 --- a/alliance/src/bdd/man3/createbddcircuit.3 +++ /dev/null @@ -1,66 +0,0 @@ -.\" $Id: createbddcircuit.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)createbddcircuit.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH CREATEBDDCIRCUIT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -createbddcircuit \- creates a \fBbdd\fP circuit. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddcircuit \(**createbddcircuit( Name, NumberIn, NumberOut, BddSystem ) - char \(**Name; - long NumberIn; - long NumberOut; - bddsystem \(**BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIName\fP -Name of the \fBbdd\fP circuit. -.TP -\fINumberIn\fP -Number of inputs. -.TP -\fINumberOut\fP -Number of outputs. -.TP -\fIBddSystem\fP -The \fBbdd\fP system to work on. -.SH DESCRIPTION -\fBcreatebddcircuit\fP creates a \fBbdd\fP circuit with the name \fIName\fP, -with \fINumberIn\fP inputs, and \fINumberOut\fP outputs. -This \fBbdd\fP circuit will use the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBcreatebddcircuit\fP returns a pointer to the \fBbdd\fP circuit created. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - ... - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1), -.BR resetbddcircuit(3), -.BR destroybddcircuit(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/createbddsystem.3 b/alliance/src/bdd/man3/createbddsystem.3 deleted file mode 100644 index d13b71b2..00000000 --- a/alliance/src/bdd/man3/createbddsystem.3 +++ /dev/null @@ -1,89 +0,0 @@ -.\" $Id: createbddsystem.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)createbddsystem.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH CREATEBDDSYSTEM 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -createbddsystem \- creates a \fBbdd\fP system. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddsystem \(**createbddsystem( ModelVar, ModelOper, MaxVar, MaxNode ) - long ModelVar; - long ModelOper; - long MaxVar; - long MaxNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIModelVar\fP -Initial size of the hash table uses for a variable. -.TP -\fIModelOper\fP -Size of the hash table uses as a cache. -.TP -\fIMaxVar\fP -Initial maximum number of variables. -.TP -\fIMaxNode\fP -Maximum nodes allowed. -.SH DESCRIPTION -\fBcreatebddsystem\fP creates and initializes a \fBbdd\fP system. -.br -.SH RETURN VALUE -\fBcreatebddsystem\fP returns a pointer to the \fBbdd\fP system created. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"system model variable xxx error !" -.ft R -.RS -The \fIModelVar\fP parameter must be a positive value. -.RE -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"system model oper xxx error !" -.ft R -.RS -The \fIModelOper\fP parameter must be a positive value. -.RE -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"variable xxx out of range error !" -.ft R -.RS -The \fIMaxVar\fP parameter must be less than \fIBDD_MAX_VAR\fP. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - ... - destroybddsystem( BddSystem ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) -.BR resetbddsytem(3), -.BR destroybddsytem(3). -. - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/decbddrefext.3 b/alliance/src/bdd/man3/decbddrefext.3 deleted file mode 100644 index f5dd396d..00000000 --- a/alliance/src/bdd/man3/decbddrefext.3 +++ /dev/null @@ -1,70 +0,0 @@ -.\" $Id: decbddrefext.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)decbddrefext.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH DECBDDREFEXT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -decbddrefext \- decrements the external reference of a \fBbdd\fP node. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**decbddrefext( BddNode ) - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddNode\fP -The \fBbdd\fP node. -.SH DESCRIPTION -\fBdecbddrefext\fP decrements the number of external reference -of the \fBbdd\fP node \fIBddNode\fP. -.br -.SH RETURN VALUE -\fBdecbddrefext\fP returns the \fIBddNode\fP pointer. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"negative reference, index xxx error !" -.ft R -.RS -The \fIBddNode\fP must have a postive number of external reference. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - BddNode = addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - BddNode = addbddnode( (bddsystem \(**)0, BddNode->INDEX, BddNode->LOW, BddNode->HIGH ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - decbddrefext( BddNode ); - /* displays Node VAR: 0 INDEX: 2 MARK: 0 REF_EXT: 0 REF_INT: 0 */ - viewbddnode( (bddsystem \(**)0, BddNode ); - /* displays (not i0) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/decbddrefint.3 b/alliance/src/bdd/man3/decbddrefint.3 deleted file mode 100644 index 46e3eff4..00000000 --- a/alliance/src/bdd/man3/decbddrefint.3 +++ /dev/null @@ -1,71 +0,0 @@ -.\" $Id: decbddrefint.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)decbddrefint.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH DECBDDREFINT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -decbddrefint \- decrements the internal reference of a \fBbdd\fP node. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**decbddrefint( BddNode ) - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddNode\fP -The \fBbdd\fP node. -.SH DESCRIPTION -\fBdecbddrefint\fP decrements the number of internal reference -of the \fBbdd\fP node \fIBddNode\fP. -.br -.SH RETURN VALUE -\fBdecbddrefint\fP returns the \fIBddNode\fP pointer. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"negative reference, index xxx error !" -.ft R -.RS -The \fIBddNode\fP must have a postive number of internal reference. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - BddNode = addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - BddNode = addbddnode( (bddsystem \(**)0, BddNode->INDEX, BddNode->LOW, BddNode->HIGH ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - incbddrefint( BddNode ); - decbddrefint( BddNode ); - /* displays Node VAR: 0 INDEX: 2 MARK: 0 REF_EXT: 1 REF_INT: 0 */ - viewbddnode( (bddsystem \(**)0, BddNode ); - /* displays (not i0) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/delbddassoc.3 b/alliance/src/bdd/man3/delbddassoc.3 deleted file mode 100644 index 43abf93f..00000000 --- a/alliance/src/bdd/man3/delbddassoc.3 +++ /dev/null @@ -1,82 +0,0 @@ -.\" $Id: delbddassoc.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)delbddassoc.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH DELBDDASSOC 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -delbddassoc \- deletes a variable association. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -int delbddassoc( BddSystem, BddAssoc ) - bddsystem \(**BddSystem; - bddassoc \(**BddAssoc; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddAssoc\fP -The variable association to delete. -.SH DESCRIPTION -\fBdelbddassoc\fP deletes the variable association \fIBddAssoc\fP in the \fBbdd\fP system -\fIBddSystem\fP. If a null pointer is given, the default \fBbdd\fP system is used. -For all the \fBbdd\fP nodes of the variable association -\fIBddAssoc\fP, the number of external reference is decremented. -.br -.SH RETURN VALUE -\fBdelbddassoc\fP returns 1 if the variable association is found, 0 otherwise. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - bddnode \(**BddSubst; - bddnode \(**BddVariable; - bddassoc \(**Assoc; - chain_list \(**Expr; - bddvar Variable; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i2" ), - createablatom( "i3" ) ); - BddSubst = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddVariable = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - Variable = getbddvarbyindex( (bddsystem \(**)0, BddVariable->INDEX ); - Assoc = delbddassoc( (bddsystem \(**)0 ); - addbddnodeassoc( (bddsystem \(**)0, Assoc, Variable, BddSubst ); - BddNode = substbddnodeassoc( (bddsystem \(**)0, BddSubst, Assoc ); - delbddassoc( (bddsystem \(**)0, Assoc ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays ((i3 or i2) and i1) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddassoc( (bddsystem \(**)0 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/delbddcircuitout.3 b/alliance/src/bdd/man3/delbddcircuitout.3 deleted file mode 100644 index a49a3791..00000000 --- a/alliance/src/bdd/man3/delbddcircuitout.3 +++ /dev/null @@ -1,63 +0,0 @@ -.\" $Id: delbddcircuitout.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)delbddcircuitout.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH DELBDDCIRCUITOUT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -delbddcircuitout \- deletes an output in a \fBbdd\fP circuit. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -int delbddcircuitout( BddCircuit, OutputName ) - bddcircuit \(**BddCircuit; - char \(**OutputName; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddCircuit\fP -The \fBbdd\fP circuit. -.TP -\fIOutputName\fP -The name of the output to delete. -.SH DESCRIPTION -\fBdelbddcircuitout\fP deletes the output \fIOutputName\fP -in the \fBbdd\fP circuit \fIBddCircuit\fP. If a null pointer is given, -the default \fBbdd\fP circuit is used. If the output \fIOutputName\fP exists, -the number of external reference of the output node -is decremented. -.br -.SH RETURN VALUE -\fBdelbddcircuitout\fP returns 1 if the output \fIOutputName\fP exist, 0 otherwise. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - ... - addbddcircuitout( (bddcircuit \(**)0, "Out0", BddNode ); - ... - delbddcircuitout( (bddcircuit \(**)0, "Out0" ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) -.BR searchbddcircuitout(3), -.BR addbddcircuitout(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/delbddnode.3 b/alliance/src/bdd/man3/delbddnode.3 deleted file mode 100644 index 4a64770d..00000000 --- a/alliance/src/bdd/man3/delbddnode.3 +++ /dev/null @@ -1,66 +0,0 @@ -.\" $Id: delbddnode.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)delbddnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH DELBDDNODE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -delbddnode \- deletes an unused \fBbdd\fP node. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void delbddnode( BddSystem, BddNode ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node. -.SH DESCRIPTION -\fBdelbddnode\fP tries to delete the \fBbdd\fP node \fIBddNode\fP and its -children, if they have not external reference, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. The use of this -function is not recommended because, it takes time. -It is better to call the \fIdecbddrefext\fP function, and do a garbage collection -with the \fIgarbagebddsystem\fP function. -.br -.SH RETURN VALUE -\fBdelbddnode\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - BddNode = addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - BddNode = addbddnode( (bddsystem \(**)0, BddNode->INDEX, BddNode->LOW, BddNode->HIGH ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - delbddnode( (bddsystem \(**)0, decbddrefext( BddNode ) ); - /* displays (not i0) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/delbddnodeassoc.3 b/alliance/src/bdd/man3/delbddnodeassoc.3 deleted file mode 100644 index 668ac88b..00000000 --- a/alliance/src/bdd/man3/delbddnodeassoc.3 +++ /dev/null @@ -1,98 +0,0 @@ -.\" $Id: delbddnodeassoc.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)delbddnodeassoc.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH DELBDDNODEASSOC 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -delbddnodeassoc \- deletes a \fBbdd\fP node in a variable association. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -int delbddnodeassoc( BddSystem, BddAssoc, Variable ) - bddsystem \(**BddSystem; - bddassoc \(**BddAssoc; - bddvar Variable; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddAssoc\fP -The variable association. -.TP -\fIVariable\fP -The variable number. -.SH DESCRIPTION -\fBdelbddnodeassoc\fP deletes the \fBbdd\fP node associated to the -variable number \fIVariable\fP, in the variable association \fIBddAssoc\fP, -in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -The number of external reference of the associated \fBbdd\fP node is incremented. -.br -.SH RETURN VALUE -\fBdelbddnodeassoc\fP returns 1 if the variable is found, 0 otherwise. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"variable xxx out of range, error !" -.ft R -.RS -The \fIVariable\fP parameter must be less or equal to -the \fIBddSystem->NUMBER_VAR\fP field. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - bddnode \(**BddSubst; - bddnode \(**BddVariable; - bddassoc \(**Assoc; - chain_list \(**Expr; - bddvar Variable; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i2" ), - createablatom( "i3" ) ); - BddSubst = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddVariable = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - Variable = getbddvarbyindex( (bddsystem \(**)0, BddVariable->INDEX ); - Assoc = addbddassoc( (bddsystem \(**)0 ); - addbddnodeassoc( (bddsystem \(**)0, Assoc, Variable, BddSubst ); - BddNode = substbddnodeassoc( (bddsystem \(**)0, BddSubst, Assoc ); - delbddnodeassoc( (bddsystem \(**)0, Assoc, Variable ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays ((i3 or i2) and i1) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddassoc( (bddsystem \(**)0 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/delbddnodelist.3 b/alliance/src/bdd/man3/delbddnodelist.3 deleted file mode 100644 index 045fa237..00000000 --- a/alliance/src/bdd/man3/delbddnodelist.3 +++ /dev/null @@ -1,74 +0,0 @@ -.\" $Id: delbddnodelist.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)delbddnodelist.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH DELBDDNODELIST 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -delbddnodelist \- deletes a list of \fBbdd\fP nodes. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void delbddnodelist( BddSystem, HeadList ) - bddsystem \(**BddSystem; - chain_list \(**HeadList; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIHeadList\fP -The head of the \fIchain_list\fP. -.SH DESCRIPTION -\fBdelbddnodelist\fP deletes all the \fBbdd\fP nodes of the -list \fIHeadList\fP in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -All the nodes have their external references decremented. -.br -.SH RETURN VALUE -\fBdelbddnodelist\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**BddList; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - BddList = (chain_list \(**)0; - BddList = addbddnodelist( (bddsystem \(**)0, BddList, - addbddcircuitin( (bddcircuit \(**)0, - "i0", 0, BDD_IN_MODE_FIRST ) ); - BddList = addbddnodelist( (bddsystem \(**)0, BddList, - addbddcircuitin( (bddcircuit \(**)0, - "i1", 0, BDD_IN_MODE_FIRST ); - BddList = addbddnodelist( (bddsystem \(**)0, BddList, - addbddcircuitin( (bddcircuit \(**)0, - "i2", 0, BDD_IN_MODE_FIRST ); - BddNode = applybddnodelist( (bddsystem \(**)0, ABL_AND, BddList ); - delbddnodelist( (bddsystem \(**)0, BddList ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - /* displays (i0 and i1 and i2) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/destroybddassoc.3 b/alliance/src/bdd/man3/destroybddassoc.3 deleted file mode 100644 index 395b0137..00000000 --- a/alliance/src/bdd/man3/destroybddassoc.3 +++ /dev/null @@ -1,77 +0,0 @@ -.\" $Id: destroybddassoc.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)destroybddassoc.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH DESTROYBDDASSOC 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -destroybddassoc \- frees all the variable associations. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddassoc \(**destroybddassoc( BddSystem ) - bddsystem \(**BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.SH DESCRIPTION -\fBdestroybddassoc\fP frees all the variable associations in the \fBbdd\fP system -\fIBddSystem\fP. If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBdestroybddassoc\fP returns nothing. -.SH ERRORS -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - bddnode \(**BddSubst; - bddnode \(**BddVariable; - bddassoc \(**Assoc; - chain_list \(**Expr; - bddvar Variable; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i2" ), - createablatom( "i3" ) ); - BddSubst = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddVariable = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - Variable = getbddvarbyindex( (bddsystem \(**)0, BddVariable->INDEX ); - Assoc = addbddassoc( (bddsystem \(**)0 ); - addbddnodeassoc( (bddsystem \(**)0, Assoc, Variable, BddSubst ); - BddNode = substbddnodeassoc( (bddsystem \(**)0, BddSubst, Assoc ); - delbddassoc( (bddsystem \(**)0, Assoc ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays ((i3 or i2) and i1) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddassoc( (bddsystem \(**)0 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/destroybddcircuit.3 b/alliance/src/bdd/man3/destroybddcircuit.3 deleted file mode 100644 index 1757ffd4..00000000 --- a/alliance/src/bdd/man3/destroybddcircuit.3 +++ /dev/null @@ -1,50 +0,0 @@ -.\" $Id: destroybddcircuit.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)destroybddcircuit.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH DESTROYBDDCIRCUIT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -destroybddcircuit \- destroys a \fBbdd\fP circuit. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - void destroybddcircuit( BddCircuit ) - bddcircuit \(**BddCircuit; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddCircuit\fP -The \fBbdd\fP circuit to destroy. -.SH DESCRIPTION -\fBdestroybddcircuit\fP destroys the \fBbdd\fP circuit \fIBddCircuit\fP. -If a null pointer is given, the default \fBbdd\fP circuit is used. -.br -.SH RETURN VALUE -\fBdestroybddcircuit\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - ... - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/destroybddsystem.3 b/alliance/src/bdd/man3/destroybddsystem.3 deleted file mode 100644 index 0c908988..00000000 --- a/alliance/src/bdd/man3/destroybddsystem.3 +++ /dev/null @@ -1,47 +0,0 @@ -.\" $Id: destroybddsystem.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)destroybddsystem.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH DESTROYBDDSYSTEM 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -destroybddsystem \- destroys a \fBbdd\fP system. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - void destroybddsystem( BddSystem ) - bddsystem \(**BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system to destroy. -.SH DESCRIPTION -\fBdestroybddsystem\fP destroys the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBdestroybddsystem\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - ... - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/existbddnodeassocoff.3 b/alliance/src/bdd/man3/existbddnodeassocoff.3 deleted file mode 100644 index 8b3ce679..00000000 --- a/alliance/src/bdd/man3/existbddnodeassocoff.3 +++ /dev/null @@ -1,90 +0,0 @@ -.\" $Id: existbddnodeassocoff.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)existbddnodeassocoff.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH EXISTBDDNODEASSOCOFF 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -existbddnodeassocoff \- computes an existantial quantification. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**existbddnodeassocoff( BddSystem, BddNode, BddAssoc ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; - bddassoc \(**BddAssoc; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node to treat. -.TP -\fIBddAssoc\fP -The variable association. -.SH DESCRIPTION -\fBexistbddnodeassocoff\fP suppress in the \fBbdd\fP node \fIBddNode\fP complemented, -all the variables associated with something in the variable association -\fIBddAssoc\fP, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBexistbddnodeassocoff\fP returns the computed \fBbdd\fP node. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"bad variable association xxx, error !" -.ft R -.RS -The \fIBddAssoc\fP parameter must a valid variable association. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - bddnode \(**BddSubst; - bddnode \(**BddVariable; - bddassoc \(**Assoc; - chain_list \(**Expr; - bddvar Variable; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_NAND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddVariable = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - Variable = getbddvarbyindex( (bddsystem \(**)0, BddVariable->INDEX ); - Assoc = addbddassoc( (bddsystem \(**)0 ); - addbddnodeassoc( (bddsystem \(**)0, Assoc, Variable, BddSystem->ONE ); - BddNode = existbddnodeassocoff( (bddsystem \(**)0, BddNode, Assoc ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays (not i1) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddassoc( (bddsystem \(**)0 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/existbddnodeassocon.3 b/alliance/src/bdd/man3/existbddnodeassocon.3 deleted file mode 100644 index 86c40f66..00000000 --- a/alliance/src/bdd/man3/existbddnodeassocon.3 +++ /dev/null @@ -1,90 +0,0 @@ -.\" $Id: existbddnodeassocon.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)existbddnodeassocon.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH EXISTBDDNODEASSOCON 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -existbddnodeassocon \- computes an existantial quantification. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**existbddnodeassocon( BddSystem, BddNode, BddAssoc ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; - bddassoc \(**BddAssoc; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node to treat. -.TP -\fIBddAssoc\fP -The variable association. -.SH DESCRIPTION -\fBexistbddnodeassocon\fP suppress in \fIBddNode\fP, -all the variables associated with something in the variable association -\fIBddAssoc\fP, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBexistbddnodeassocon\fP returns the computed \fBbdd\fP node. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"bad variable association xxx, error !" -.ft R -.RS -The \fIBddAssoc\fP parameter must a valid variable association. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - bddnode \(**BddSubst; - bddnode \(**BddVariable; - bddassoc \(**Assoc; - chain_list \(**Expr; - bddvar Variable; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddVariable = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - Variable = getbddvarbyindex( (bddsystem \(**)0, BddVariable->INDEX ); - Assoc = addbddassoc( (bddsystem \(**)0 ); - addbddnodeassoc( (bddsystem \(**)0, Assoc, Variable, BddSystem->ONE ); - BddNode = existbddnodeassocon( (bddsystem \(**)0, BddNode, Assoc ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays i1 */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddassoc( (bddsystem \(**)0 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/garbagebddsystem.3 b/alliance/src/bdd/man3/garbagebddsystem.3 deleted file mode 100644 index 8dc239ea..00000000 --- a/alliance/src/bdd/man3/garbagebddsystem.3 +++ /dev/null @@ -1,62 +0,0 @@ -.\" $Id: garbagebddsystem.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)garbagebddsystem.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH GARBAGEBDDSYSTEM 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -garbagebddsystem \- Forces a \fBbdd\fP garbage collection. - -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void garbagebddsystem( BddSystem ) - bddsystem \(**BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.SH DESCRIPTION -\fBgarbagebddsystem\fP frees all the unused \fBbdd\fP nodes in the -system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -A \fBbdd\fP node is unused if its number of reference is null. -.br -.SH RETURN VALUE -\fBgarbagebddsystem\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - addbddcircuitin( (bddcircuit \(**)0, "i1", 0, BDD_IN_MODE_FIRST ); - BddNode = applybddnode( (bddsystem \(**)0, - ABL_AND, - searchbddcircuitin( (bddcircuit \(**)0, "i0" ), - searchbddcircuitin( (bddcircuit \(**)0, "i1" ) ); - decbddrefext( BddNode ); - garbagebddsystem( (bddsystem \(**)0 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/getbddnodenum.3 b/alliance/src/bdd/man3/getbddnodenum.3 deleted file mode 100644 index 40d10749..00000000 --- a/alliance/src/bdd/man3/getbddnodenum.3 +++ /dev/null @@ -1,63 +0,0 @@ -.\" $Id: getbddnodenum.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)getbddnodenum.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH GETBDDNODENUM 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -getbddnodenum \- gets the number of nodes in a \fBbdd\fP. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -long getbddnodenum( BddSystem, BddNode ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node. -.SH DESCRIPTION -\fBgetbddnodenum\fP computes the number of different nodes in \fIBddNode\fP, -in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBgetbddnodenum\fP returns the number of the different nodes reached. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - printf( "Number nodes: %ld\n", - getbddnodenum( (bddsystem \(**)0, BddNode ) ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/getbddnodesize.3 b/alliance/src/bdd/man3/getbddnodesize.3 deleted file mode 100644 index c7257e08..00000000 --- a/alliance/src/bdd/man3/getbddnodesize.3 +++ /dev/null @@ -1,63 +0,0 @@ -.\" $Id: getbddnodesize.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)getbddnodesize.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH GETBDDNODESIZE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -getbddnodesize \- gets the number of nodes in a \fBbdd\fP. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -long getbddnodesize( BddSystem, BddNode ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node. -.SH DESCRIPTION -\fBgetbddnodesize\fP computes the total number of nodes in \fIBddNode\fP, -in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBgetbddnodesize\fP returns the number of nodes reached. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - printf( "Number nodes: %ld\n", - getbddnodesize( (bddsystem \(**)0, BddNode ) ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/getbddnodesupport.3 b/alliance/src/bdd/man3/getbddnodesupport.3 deleted file mode 100644 index 485fa26e..00000000 --- a/alliance/src/bdd/man3/getbddnodesupport.3 +++ /dev/null @@ -1,81 +0,0 @@ -.\" $Id: getbddnodesupport.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)getbddnodesupport.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH GETBDDNODESUPPORT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -getbddnodesupport \- gives the variable support of a \fBbdd\fP node. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void \(**getbddnodesupport( BddSystem, BddNode, Mode ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; - int Mode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node. -.TP -\fIMode\fP -The type of support. -.SH DESCRIPTION -\fBgetbddnodesupport\fP gives the support of the \fBbdd\fP node \fIBddNode\fP -in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -If \fIMode\fP is BDD_SUPPORT_CHAIN the support is returned using -\fIchain_list\fP else it is returned using \fIptype_list\fP. -The support must be freed using the \fIfreechain\fP or \fIfreeptype\fP functions. -.br -.SH RETURN VALUE -\fBgetablexprsupport\fP returns a pointer to a \fIchain_list\fP or -a \fIptype_list\fP. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - chain_list \(**Support; - chain_list \(**ScanSupport; - bddindex Index; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Support = getablbddnodesupport( (bddsystem \(**0), BddNode, BDD_SUPPORT_CHAIN ); - for ( ScanSupport = Support; - ScanSupport != (chain_list \(**)0; - ScanSupport = ScanSupport->NEXT ) - { - Index = (bddnode \(**)ScanSupport->INDEX; - printf( "%s ", BddCircuit->NAME_IN[ Index - BDD_INDEX_MIN ] ); - } - freechain( Support ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/getbddvarbyindex.3 b/alliance/src/bdd/man3/getbddvarbyindex.3 deleted file mode 100644 index c3d813e0..00000000 --- a/alliance/src/bdd/man3/getbddvarbyindex.3 +++ /dev/null @@ -1,66 +0,0 @@ -.\" $Id: getbddvarbyindex.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)getbddvarbyindex.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH GETBDDVARBYINDEX 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -getbddvarbyindex \- converts \fBbdd\fP index to a variable number. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddindex getbddvarbyindex( BddSystem, Index ) - bddsystem \(**BddSystem; - bddindex Index; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIIndex\fP -The \fBbdd\fP index to convert. -.SH DESCRIPTION -\fBgetbddvarbyindex\fP converts the \fBbdd\fP index \fIIndex -to a variable number, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -The function uses simply the translation table \fIBddSystem\fP->INDEX_TO_VAR. -.br -.SH RETURN VALUE -\fBgetbddvarbyindex\fP returns the variable number of the \fBbdd\fP index \fIIndex\fP. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"index xxx out of range, error !" -.ft R -.RS -The \fIIndex parameter must be a valid index. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddNode = addbddvar( (bddsystem \(**)0, 0 ); - /* displays 0 */ - printf( "%d", getbddvarbyindex( (bddsystem \(**)0, BddNode->INDEX ) ); - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/getbddvarindex.3 b/alliance/src/bdd/man3/getbddvarindex.3 deleted file mode 100644 index f04089ac..00000000 --- a/alliance/src/bdd/man3/getbddvarindex.3 +++ /dev/null @@ -1,67 +0,0 @@ -.\" $Id: getbddvarindex.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)getbddvarindex.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH GETBDDVARINDEX 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -getbddvarindex \- converts a variable number in a \fBbdd\fP index. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddindex getbddvarindex( BddSystem, Variable ) - bddsystem \(**BddSystem; - bddvar Variable; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIVariable\fP -The variable number to convert. -.SH DESCRIPTION -\fBgetbddvarindex\fP converts the variable number \fIVariable\fP -to a \fBbdd\fP index, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -The function uses simply the translation table \fIBddSystem\fP->VAR_TO_INDEX. -.br -.SH RETURN VALUE -\fBgetbddvarindex\fP returns the \fBbdd\fP index of \fIVariable\fP. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"variable xxx out of range, error !" -.ft R -.RS -The \fIVariable\fP parameter must be less or equal to -the \fIBddSystem->NUMBER_VAR\fP field. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddNode = addbddvar( (bddsystem \(**)0, 0 ); - /* displays 2 */ - printf( "%d", getbddvarindex( (bddsystem \(**)0, 0 ) ); - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/getbddvarnode.3 b/alliance/src/bdd/man3/getbddvarnode.3 deleted file mode 100644 index ada31773..00000000 --- a/alliance/src/bdd/man3/getbddvarnode.3 +++ /dev/null @@ -1,66 +0,0 @@ -.\" $Id: getbddvarnode.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)getbddvarnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH GETBDDVARNODE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -getbddvarnode \- gives the \fBbdd\fP node of a variable. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**getbddvarnode( BddSystem, Variable ) - bddsystem \(**BddSystem; - bddvar Variable; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIVariable\fP -The variable number. -.SH DESCRIPTION -\fBgetbddvarnode\fP gives the \fBbdd\fP node of the variable number -\fIVariable\fP, in the \fBbdd\fP system BddSystem. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBgetbddvarnode\fP returns a pointer to the variable \fBbdd\fP node. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"variable xxx out of range, error !" -.ft R -.RS -The \fIVariable\fP parameter must be less or equal to -the \fIBddSystem->NUMBER_VAR\fP field. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - addbddvar( (bddsystem \(**)0, 0 ); - BddNode = getbddvarnode( (bddsystem \(**)0, 0 ); - ... - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/getbddvarnodebyindex.3 b/alliance/src/bdd/man3/getbddvarnodebyindex.3 deleted file mode 100644 index 1d5c941d..00000000 --- a/alliance/src/bdd/man3/getbddvarnodebyindex.3 +++ /dev/null @@ -1,66 +0,0 @@ -.\" $Id: getbddvarnodebyindex.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)getbddvarnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH GETBDDVARNODEBYINDEX 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -getbddvarnode \- gives the \fBbdd\fP node of a variable. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**getbddvarnodebyindex( BddSystem, Index ) - bddsystem \(**BddSystem; - bddindex Index; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIIndex\fP -The \fBbdd\fP index. -.SH DESCRIPTION -\fBgetbddvarnode\fP gives the \fBbdd\fP node of the \fBbdd\fP index -\fIIndex\fP, in the \fBbdd\fP system BddSystem. -If a null pointer is given, the default \fBbdd\fP system is used. -The function uses simply the table \fIBddSystem\fP->VAR_NODE. -.br -.SH RETURN VALUE -\fBgetbddvarnode\fP returns a pointer to the variable \fBbdd\fP node. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"index xxx out of range, error !" -.ft R -.RS -The \fIIndex\fP parameter must be a valid index. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - addbddvar( (bddsystem \(**)0, 0 ); - BddNode = getbddvarnodebyindex( (bddsystem \(**)0, 2 ); - ... - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/implybddnode.3 b/alliance/src/bdd/man3/implybddnode.3 deleted file mode 100644 index 1686cb13..00000000 --- a/alliance/src/bdd/man3/implybddnode.3 +++ /dev/null @@ -1,78 +0,0 @@ -.\" $Id: implybddnode.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)implybddnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH IMPLYBDDNODE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -implybddnode \- computes a \fBbdd\fP that implies a conjonction of two \fBbdd\fP nodes. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**implybddnode( BddSystem, BddNode1, BddNode2 ) - bddsystem \(**BddSystem; - bddnode \(**BddNode1; - bddnode \(**BddNode2; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode1\fP -The first \fBbdd\fP node. -.TP -\fIBddNode2\fP -The second \fBbdd\fP node. -.SH DESCRIPTION -\fBimplybddnode\fP tests if the intersection of \fIBddNode1\fP and not \fIBddNode2\fP, -exists, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBimplybddnode\fP returns the \fBbdd\fP node zero if there is no -intersection, and a computed \fBbdd\fP node otherwise. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode1; - bddnode \(**BddNode2; - bddnode \(**BddImply; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode1 = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode1 = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddImply = implybddnode( (bddsystem \(**)0, BddNode1, BddNode2 ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays (i0 and (not i1)) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/incbddrefext.3 b/alliance/src/bdd/man3/incbddrefext.3 deleted file mode 100644 index e70d22ba..00000000 --- a/alliance/src/bdd/man3/incbddrefext.3 +++ /dev/null @@ -1,60 +0,0 @@ -.\" $Id: incbddrefext.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)incbddrefext.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH INCBDDREFEXT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -incbddrefext \- increments the external reference of a \fBbdd\fP node. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**incbddrefext( BddNode ) - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddNode\fP -The \fBbdd\fP node. -.SH DESCRIPTION -\fBincbddrefext\fP increments the number of external reference -of the \fBbdd\fP node \fIBddNode\fP. -.br -.SH RETURN VALUE -\fBincbddrefext\fP returns the \fIBddNode\fP pointer. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - BddNode = addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - BddNode = addbddnode( (bddsystem \(**)0, BddNode->INDEX, BddNode->LOW, BddNode->HIGH ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - incbddrefext( BddNode ); - /* displays Node VAR: 0 INDEX: 2 MARK: 0 REF_EXT: 2 REF_INT: 0 */ - viewbddnode( (bddsystem \(**)0, BddNode ); - /* displays (not i0) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/incbddrefint.3 b/alliance/src/bdd/man3/incbddrefint.3 deleted file mode 100644 index a9c596d8..00000000 --- a/alliance/src/bdd/man3/incbddrefint.3 +++ /dev/null @@ -1,60 +0,0 @@ -.\" $Id: incbddrefint.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)incbddrefint.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH INCBDDREFINT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -incbddrefint \- increments the internal reference of a \fBbdd\fP node. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**incbddrefint( BddNode ) - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddNode\fP -The \fBbdd\fP node. -.SH DESCRIPTION -\fBincbddrefint\fP increments the number of internal reference -of the \fBbdd\fP node \fIBddNode\fP. -.br -.SH RETURN VALUE -\fBincbddrefint\fP returns the \fIBddNode\fP pointer. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - BddNode = addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - BddNode = addbddnode( (bddsystem \(**)0, BddNode->INDEX, BddNode->LOW, BddNode->HIGH ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - incbddrefint( BddNode ); - /* displays Node VAR: 0 INDEX: 2 MARK: 0 REF_EXT: 1 REF_INT: 1 */ - viewbddnode( (bddsystem \(**)0, BddNode ); - /* displays (not i0) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/intersectbddnode.3 b/alliance/src/bdd/man3/intersectbddnode.3 deleted file mode 100644 index a637348b..00000000 --- a/alliance/src/bdd/man3/intersectbddnode.3 +++ /dev/null @@ -1,78 +0,0 @@ -.\" $Id: intersectbddnode.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)intersectbddnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH INTERSECTBDDNODE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -intersectbddnode \- tests for an intersection between two \fBbdd\fP nodes. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**intersectbddnode( BddSystem, BddNode1, BddNode2 ) - bddsystem \(**BddSystem; - bddnode \(**BddNode1; - bddnode \(**BddNode2; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode1\fP -The first \fBbdd\fP node. -.TP -\fIBddNode2\fP -The second \fBbdd\fP node. -.SH DESCRIPTION -\fBintersectbddnode\fP tests if the intersection of \fIBddNode1\fP and \fIBddNode2\fP -exists, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBintersectbddnode\fP returns the \fBbdd\fP node zero if there is no -intersection, and a computed \fBbdd\fP node otherwise. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode1; - bddnode \(**BddNode2; - bddnode \(**BddImply; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode1 = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode1 = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddImply = intersectbddnode( (bddsystem \(**)0, BddNode1, BddNode2 ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays (i0 and i1)) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/isbddvarinsupport.3 b/alliance/src/bdd/man3/isbddvarinsupport.3 deleted file mode 100644 index f0aac9e8..00000000 --- a/alliance/src/bdd/man3/isbddvarinsupport.3 +++ /dev/null @@ -1,83 +0,0 @@ -.\" $Id: isbddvarinsupport.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)isbddvarinsupport.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH ISBDDVARINSUPPORT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -isbddvarinsupport \- tests if a variable appears in a \fBbdd\fP. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -int isbddvarinsupport( BddSystem, BddNode, Variable ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; - bddvar Variable; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node. -.TP -\fIVariable\fP -The variable number. -.SH DESCRIPTION -\fBisbddvarinsupport\fP tests if the variable number \fIVariable\fP -appears in the support of the \fBbdd\fP node \fIBddNode\fP, in the -\fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBisbddvarinsupport\fP returns 1 if \fIVariable\fP appears, 0 otherwise. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"variable xxx out of range, error !" -.ft R -.RS -The \fIVariable\fP parameter must be less or equal to -the \fIBddSystem->NUMBER_VAR\fP field. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - bddnode \(**BddVariable; - chain_list \(**Expr; - bddvar Variable; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddVariable = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - Variable = getbddvarbyindex( (bddsystem \(** 0), BddVariable->INDEX ) ); - /* displays 1 */ - printf( "%d", isbddvarinsupport( (bddsystem \(**)0, BddNode, Variable ) ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/markbddnode.3 b/alliance/src/bdd/man3/markbddnode.3 deleted file mode 100644 index babc4697..00000000 --- a/alliance/src/bdd/man3/markbddnode.3 +++ /dev/null @@ -1,70 +0,0 @@ -.\" $Id: markbddnode.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)markbddnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH MARKBDDNODE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -markbddnode \- marks \fBbdd\fP node with a specified mask. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -long markbddnode( BddSystem, BddNode, Mark ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; - bddmark Mark; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node to mark. -.TP -\fIMark\fP -The bit mask. -.SH DESCRIPTION -\fBmarkbddnode\fP marks the \fBbdd\fP node \fIBddNode\fP -with the bit mask \fIMark\fP, in the \fBbdd\fP system BddSystem. -If a null pointer is given, the default \fBbdd\fP system is used. -This function does a OR with the field MARK of the \fBbdd\fP node \fIBddNode\fP, -and the bit mask \fIMark\fP. -.br -.SH RETURN VALUE -\fBmarkbddnode\fP returns the number of the differents marked nodes. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - printf( "Number nodes: %ld\n", - markbddnode( (bddsystem \(**)0, BddNode, 0x0001 ) ); - unmarkbddnode( (bddsystem \(**)0, BddNode, 0x0001 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/relprodbddnodeassoc.3 b/alliance/src/bdd/man3/relprodbddnodeassoc.3 deleted file mode 100644 index c923c574..00000000 --- a/alliance/src/bdd/man3/relprodbddnodeassoc.3 +++ /dev/null @@ -1,100 +0,0 @@ -.\" $Id: relprodbddnodeassoc.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)relprodbddnodeassoc.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH RELPRODBDDNODEASSOC 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -relprodbddnodeassoc \- computes a relational product. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**relprodbddnodeassoc( BddSystem, BddNode1, BddNode2, BddAssoc ) - bddsystem \(**BddSystem; - bddnode \(**BddNode1; - bddnode \(**BddNode2; - bddassoc \(**BddAssoc; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode1\fP -The first \fBbdd\fP node. -.TP -\fIBddNode2\fP -The second \fBbdd\fP node. -.TP -\fIBddAssoc\fP -The variable association. -.SH DESCRIPTION -\fBrelprodbddnodeassoc\fP computes \fIBddNode1\fP AND \fIBddNode2\fP, -and suppress the variables associated with something in the variable association -\fIBddAssoc\fP, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBrelprodbddnodeassoc\fP returns the computed \fBbdd\fP node. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"bad variable association xxx, error !" -.ft R -.RS -The \fIBddAssoc\fP parameter must a valid variable association. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - bddnode \(**BddNode1; - bddnode \(**BddNode2; - bddnode \(**BddVariable; - bddassoc \(**Assoc; - chain_list \(**Expr; - bddvar Variable; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode1 = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode2 = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddVariable = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - Variable = getbddvarbyindex( (bddsystem \(**)0, BddVariable->INDEX ); - Assoc = addbddassoc( (bddsystem \(**)0 ); - addbddnodeassoc( (bddsystem \(**)0, Assoc, Variable, BddSystem->ONE ); - BddNode = relprodbddnodeassoc( (bddsystem \(**)0, BddNode1, BddNode2, Assoc ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays i1 */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddassoc( (bddsystem \(**)0 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/reorderbddsystemdynamic.3 b/alliance/src/bdd/man3/reorderbddsystemdynamic.3 deleted file mode 100644 index f2631cae..00000000 --- a/alliance/src/bdd/man3/reorderbddsystemdynamic.3 +++ /dev/null @@ -1,67 +0,0 @@ -.\" $Id: reorderbddsystemdynamic.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)reorderbddsystemdynamic.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH REORDERBDDSYSTEMDYNAMIC 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -reorderbddsystemdynamic \- specifies the dynamic \fBbdd\fP reorder parameters. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void reorderbddsystemdynamic( BddSystem, ReorderFunc, ReorderLow, ReorderRatio ) - bddsystem \(**BddSystem; - void (\(**ReorderFunc)(); - long ReorderLow; - long ReorderRatio; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIReorderFunc\fP -The dynamic reorder method. -.TP -\fIReorderLow\fP -The minimum number of \fBbdd\fP nodes. -.TP -\fIReorderRatio\fP -The reorder ratio in percent. -.SH DESCRIPTION -\fBreorderbddsystemdynamic\fP specifies to parameters for the dynamic reorder -in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -If the number of \fBbdd\fP nodes is greater than \fIReorderLow\fP, then -the dynamic reorder function \fIReorderFunc\fP is called. The new -reorder limit is computed as the product of the number of \fBbdd\fP nodes -and the \fIReorderRatio\fP value plus 100. If this limit is less than \fIReorderLow\fP -then the new limit is fixed to \fIReorderLow\fP. If the function \fIReorderFunc\fP is a null -pointer, then the dynamic reorder process is skipped. -.br -.SH RETURN VALUE -\fBreorderbddsystemdynamic\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - reorderbddsystemdynamic( BddSystem, reorderbddsystemwindow, 1000, 50 ); - ... - destroybddsystem( BddSystem ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/reorderbddsystemsimple.3 b/alliance/src/bdd/man3/reorderbddsystemsimple.3 deleted file mode 100644 index 8501e43d..00000000 --- a/alliance/src/bdd/man3/reorderbddsystemsimple.3 +++ /dev/null @@ -1,51 +0,0 @@ -.\" $Id: reorderbddsystemsimple.3,v 1.1 2002/03/18 11:26:50 ludo Exp $ -.\" @(#)reorderbddsystemsimple.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH REORDERBDDSYSTEMSIMPLE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -reorderbddsystemsimple \- reorders the \fBbdd\fP nodes of a \fBbdd\fP system. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void reorderbddsystemsimple( BddSystem ) - bddsystem \(**BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.SH DESCRIPTION -\fBreorderbddsystemsimple\fP reorders all the \fBbdd\fP nodes of the -\fBbdd\fP system \fIBddSystem\fP, in order to minimize the total -number of \fBbdd\fP nodes. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBreorderbddsystemsimple\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - ... - reorderbddsystemsimple( BddSystem ); - ... - destroybddsystem( BddSystem ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/reorderbddsystemtop.3 b/alliance/src/bdd/man3/reorderbddsystemtop.3 deleted file mode 100644 index 389b1ee5..00000000 --- a/alliance/src/bdd/man3/reorderbddsystemtop.3 +++ /dev/null @@ -1,51 +0,0 @@ -.\" $Id: reorderbddsystemtop.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)reorderbddsystemtop.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH REORDERBDDSYSTEMTOP 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -reorderbddsystemtop \- reorders the \fBbdd\fP nodes of a \fBbdd\fP system. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void reorderbddsystemtop( BddSystem ) - bddsystem \(**BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.SH DESCRIPTION -\fBreorderbddsystemtop\fP reorders all the \fBbdd\fP nodes of the -\fBbdd\fP system \fIBddSystem\fP, in order to minimize the total -number of \fBbdd\fP nodes. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBreorderbddsystemtop\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - ... - reorderbddsystemtop( BddSystem ); - ... - destroybddsystem( BddSystem ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/reorderbddsystemwindow.3 b/alliance/src/bdd/man3/reorderbddsystemwindow.3 deleted file mode 100644 index 0accbe88..00000000 --- a/alliance/src/bdd/man3/reorderbddsystemwindow.3 +++ /dev/null @@ -1,51 +0,0 @@ -.\" $Id: reorderbddsystemwindow.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)reorderbddsystemwindow.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH REORDERBDDSYSTEMWINDOW 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -reorderbddsystemwindow \- reorders the \fBbdd\fP nodes of a \fBbdd\fP system. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void reorderbddsystemwindow( BddSystem ) - bddsystem \(**BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.SH DESCRIPTION -\fBreorderbddsystemwindow\fP reorders all the \fBbdd\fP nodes of the -\fBbdd\fP system \fIBddSystem\fP, in order to minimize the total -number of \fBbdd\fP nodes. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBreorderbddsystemwindow\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - ... - reorderbddsystemwindow( BddSystem ); - ... - destroybddsystem( BddSystem ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/resetbddcircuit.3 b/alliance/src/bdd/man3/resetbddcircuit.3 deleted file mode 100644 index f7a2340f..00000000 --- a/alliance/src/bdd/man3/resetbddcircuit.3 +++ /dev/null @@ -1,53 +0,0 @@ -.\" $Id: resetbddcircuit.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)resetbddcircuit.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH RESETBDDCIRCUIT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -resetbddcircuit \- resets a \fBbdd\fP circuit. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void resetbddcircuit( BddCircuit ) - bddcircuit \(**BddCircuit; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddCircuit\fP -The \fBbdd\fP circuit to reset. -.SH DESCRIPTION -\fBresetbddcircuit\fP resets the \fBbdd\fP circuit \fIBddCircuit\fP. -If a null pointer is given, the default \fBbdd\fP circuit is used. -.br -.SH RETURN VALUE -\fBresetbddcircuit\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - ... - resetbddcircuit( (bddcircuit \(**)0 ); - ... - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1), -.BR createbddcircuit(3), -.BR destroybddcircuit(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/resetbddsystem.3 b/alliance/src/bdd/man3/resetbddsystem.3 deleted file mode 100644 index 9f0a1daf..00000000 --- a/alliance/src/bdd/man3/resetbddsystem.3 +++ /dev/null @@ -1,50 +0,0 @@ -.\" $Id: resetbddsystem.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)resetbddsystem.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH RESETBDDSYSTEM 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -resetbddsystem \- resets a \fBbdd\fP system. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void resetbddsystem( BddSystem ) - bddsystem \(**BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system to reset. -.SH DESCRIPTION -\fBresetbddsystem\fP resets the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBresetbddsystem\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - ... - resetbddsystem( (bddsystem \(**)0 ); - destroybddsystem( BddSystem ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) -.BR createbddsytem(3), -.BR destroybddsytem(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/restrictbddnode.3 b/alliance/src/bdd/man3/restrictbddnode.3 deleted file mode 100644 index 77fc0abb..00000000 --- a/alliance/src/bdd/man3/restrictbddnode.3 +++ /dev/null @@ -1,103 +0,0 @@ -.\" $Id: restrictbddnode.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)restrictbddnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH RESTRICTBDDNODE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -restrictbddnode \- substitutes a variable by a zero or one, in a \fBbdd\fP. - -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**restrictbddnode( BddSystem, BddNode, Variable, BddSubst ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; - bddvar Variable; - bddnode \(**BddSubst; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node. -.TP -\fIVariable\fP -The variable to find. -.TP -\fIBddSubst\fP -The \fBbdd\fP to substitute with. -.SH DESCRIPTION -\fBrestrictbddnode\fP substitutes all the occurency of the variable \fIVariable\fP -in the \fBbdd\fP node \fIBddNode\fP by the \fBbdd\fP node \fIBddSubst\fP, in the -\fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -The \fIBddSubst\fP must be a the node \fIBddSystem\fP->ONE or \fIBddSystem\fP->ZERO. -.br -.SH RETURN VALUE -\fBrestrictbddnode\fP returns the resulting \fBbdd\fP node. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"variable xxx out of range, error !" -.ft R -.RS -The \fIVariable\fP parameter must be less or equal to -the \fIBddSystem->NUMBER_VAR\fP field. -.RE -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"index xxx out of range, error !" -.ft R -.RS -The \fIBddSubst\fP parameter must have its index less than BDD_INDEX_MIN. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddVariable; - bddnode \(**BddNode; - bddnode \(**BddSubst; - chain_list \(**Expr; - bddvar Variable; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddSubst = BddSystem->ONE; - BddVariable = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - Variable = getbddvarbyindex( (bddsystem \(**)0, BddVariable->INDEX ); - BddNode = restrictbddnode( (bddsystem \(**)0, BddNode, Variable, BddSubst ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays '1' */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/satisfybddnode.3 b/alliance/src/bdd/man3/satisfybddnode.3 deleted file mode 100644 index 2c8e0aa5..00000000 --- a/alliance/src/bdd/man3/satisfybddnode.3 +++ /dev/null @@ -1,76 +0,0 @@ -.\" $Id: satisfybddnode.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)satisfybddnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH SATISFYBDDNODE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -satisfybddnode \- finds a satisfying path for a \fBbdd\fP node. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**satisfybddnode( BddSystem, BddNode ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node. -.SH DESCRIPTION -\fBsatisfybddnode\fP finds a simple path throw the \fBbdd\fP \fIBddNode\fP -that reaches the constant \fBbdd\fP node one, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBsatisfybddnode\fP returns a \fBbdd\fP node that satisfies \fIBddNode\fP. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"index xxx out of range, error !" -.ft R -.RS -The \fIBddNode\fP parameter must be different from the \fBbdd\fP node zero. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddNode = satisfybddnode( (bddsystem \(**)0, BddNode ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays i0 */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/searchbddcircuitin.3 b/alliance/src/bdd/man3/searchbddcircuitin.3 deleted file mode 100644 index 185350e8..00000000 --- a/alliance/src/bdd/man3/searchbddcircuitin.3 +++ /dev/null @@ -1,60 +0,0 @@ -.\" $Id: searchbddcircuitin.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)searchbddcircuitin.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH SEARCHBDDCIRCUITIN 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -searchbddcircuitin \- searchs an input in a \fBbdd\fP circuit. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddnode \(**searchbddcircuitin( BddCircuit, InputName ) - bddcircuit \(**BddCircuit; - char \(**InputName; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddCircuit\fP -The \fBbdd\fP circuit. -.TP -\fIInputName\fP -The name of the input to look for. -.SH DESCRIPTION -\fBsearchbddcircuitin\fP searchs the input \fIInputName\fP in the \fBbdd\fP -circuit \fIBddCircuit\fP. -If a null pointer is given, the default \fBbdd\fP circuit is used. -.br -.SH RETURN VALUE -\fBsearchbddcircuitin\fP returns the node corresponding to the input \fIInputName\fP -or a null pointer if no such input is found. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - addbddcircuitin ( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - ... - BddNode = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1), -.BR addbddcircuitin(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/searchbddcircuitout.3 b/alliance/src/bdd/man3/searchbddcircuitout.3 deleted file mode 100644 index de4379fb..00000000 --- a/alliance/src/bdd/man3/searchbddcircuitout.3 +++ /dev/null @@ -1,61 +0,0 @@ -.\" $Id: searchbddcircuitout.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)searchbddcircuitout.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH SEARCHBDDCIRCUITOUT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -searchbddcircuitout \- searchs an output in a \fBbdd\fP circuit. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddnode \(**searchbddcircuitout( BddCircuit, OutputName ) - bddcircuit \(**BddCircuit; - char \(**OutputName; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddCircuit\fP -The \fBbdd\fP circuit. -.TP -\fIOutputName\fP -The name of the output to look for. -.SH DESCRIPTION -\fBsearchbddcircuitout\fP searchs the output \fIOutputName\fP in the \fBbdd\fP -circuit \fIBddCircuit\fP. -If a null pointer is given, the default \fBbdd\fP circuit is used. -.br -.SH RETURN VALUE -\fBsearchbddcircuitout\fP returns the node corresponding to -the output \fIOutputName\fP or a null pointer if no such output is found. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - ... - addbddcircuitout( (bddcircuit \(**)0, "Out0", BddNode ); - ... - BddNode = searchbddcircuitout( (bddcircuit \(**)0, "Out0" ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1), -.BR addbddcircuitout(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/setbddrefext.3 b/alliance/src/bdd/man3/setbddrefext.3 deleted file mode 100644 index d264ea8b..00000000 --- a/alliance/src/bdd/man3/setbddrefext.3 +++ /dev/null @@ -1,73 +0,0 @@ -.\" $Id: setbddrefext.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)setbddrefext.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH SETBDDREFEXT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -setbddrefext \- increments the external reference, -and decrements the internal reference of a \fBbdd\fP node. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**setbddrefext( BddNode ) - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddNode\fP -The \fBbdd\fP node. -.SH DESCRIPTION -\fBsetbddrefext\fP increments the number of external reference -of the \fBbdd\fP node \fIBddNode\fP and decrements its number of -internal reference. -.br -.SH RETURN VALUE -\fBsetbddrefext\fP returns the \fIBddNode\fP pointer. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"negative reference, index xxx error !" -.ft R -.RS -The \fIBddNode\fP must have a postive number of internal reference. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - BddNode = addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - BddNode = addbddnode( (bddsystem \(**)0, BddNode->INDEX, BddNode->LOW, BddNode->HIGH ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - incbddrefint( BddNode ); - setbddrefext( BddNode ); - /* displays Node VAR: 0 INDEX: 2 MARK: 0 REF_EXT: 1 REF_INT: 0 */ - viewbddnode( (bddsystem \(**)0, BddNode ); - /* displays (not i0) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/simpbddnodedcoff.3 b/alliance/src/bdd/man3/simpbddnodedcoff.3 deleted file mode 100644 index 9489c803..00000000 --- a/alliance/src/bdd/man3/simpbddnodedcoff.3 +++ /dev/null @@ -1,80 +0,0 @@ -.\" $Id: simpbddnodedcoff.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)simpbddnodedcoff.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH SIMPBDDNODEDCOFF 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -simpbddnodedcoff \- simplifies a \fBbdd\fP with don't cares on its off-set part. - -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**simpbddnodedcoff( BddSystem, BddOff, BddDc ) - bddsystem \(**BddSystem; - bddnode \(**BddOff; - bddnode \(**BddDc; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddOff\fP -The first \fBbdd\fP node. -.TP -\fIBddDc\fP -The second \fBbdd\fP node. -.SH DESCRIPTION -\fBsimpbddnodedcoff\fP simplifies the \fBbdd\fP node \fIBddOff\fP with -\fIBddDc\fP, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -The \fBbdd\fP node \fIBddDc\fP must be included imperatively -in the off-set part of the \fBbdd\fP node \fIBddOff\fP. -.br -.SH RETURN VALUE -\fBsimpbddnodedcoff\fP returns the simplified \fBbdd\fP node. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddOff; - bddnode \(**BddDc; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddOff = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = createablbinexpr( ABL_NOR, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddDc = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddNode = simpbddnodedcoff( (bddsystem \(**)0, BddOff, BddDc ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays '1' */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/simpbddnodedcon.3 b/alliance/src/bdd/man3/simpbddnodedcon.3 deleted file mode 100644 index a743f874..00000000 --- a/alliance/src/bdd/man3/simpbddnodedcon.3 +++ /dev/null @@ -1,80 +0,0 @@ -.\" $Id: simpbddnodedcon.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)simpbddnodedcon.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH SIMPBDDNODEDCON 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -simpbddnodedcon \- simplifies a \fBbdd\fP with don't cares on its on-set part. - -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**simpbddnodedcon( BddSystem, BddOn, BddDc ) - bddsystem \(**BddSystem; - bddnode \(**BddOn; - bddnode \(**BddDc; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddOn\fP -The first \fBbdd\fP node. -.TP -\fIBddDc\fP -The second \fBbdd\fP node. -.SH DESCRIPTION -\fBsimpbddnodedcon\fP simplifies the \fBbdd\fP node \fIBddOn\fP with -\fIBddDc\fP, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -The \fBbdd\fP node \fIBddDc\fP must be included imperatively -in the on-set part of the \fBbdd\fP node \fIBddOn\fP. -.br -.SH RETURN VALUE -\fBsimpbddnodedcon\fP returns the simplified \fBbdd\fP node. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddOn; - bddnode \(**BddDc; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddOn = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = createablbinexpr( ABL_NOR, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddDc = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddNode = simpbddnodedcon( (bddsystem \(**)0, BddOn, BddDc ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays '1' */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/substbddnodeassoc.3 b/alliance/src/bdd/man3/substbddnodeassoc.3 deleted file mode 100644 index 788316b8..00000000 --- a/alliance/src/bdd/man3/substbddnodeassoc.3 +++ /dev/null @@ -1,106 +0,0 @@ -.\" $Id: substbddnodeassoc.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)substbddnodeassoc.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH SUBSTBDDNODEASSOC 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -substbddnodeassoc \- substitutes a set of variables with a set of \fBbdd\fP node. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**substbddnodeassoc( BddSystem, BddNode, BddAssoc ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; - bddassoc \(**BddAssoc; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node to treat. -.TP -\fIBddAssoc\fP -The variable association. -.SH DESCRIPTION -\fBsubstbddnodeassoc\fP substitutes in the \fBbdd\fP node \fIBddNode\fP -all the variables associated to something in the variable association -\fIBddAssoc\fP, with the corresponding \fBbdd\fP node, -in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBsubstbddnodeassoc\fP returns the computed \fBbdd\fP node. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"variable xxx out of range, error !" -.ft R -.RS -The \fIVariable\fP parameter must be less or equal to -the \fIBddSystem->NUMBER_VAR\fP field. -.RE -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"bad variable association xxx, error !" -.ft R -.RS -The \fIBddAssoc\fP parameter must a valid variable association. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - bddnode \(**BddSubst; - bddnode \(**BddVariable; - bddassoc \(**Assoc; - chain_list \(**Expr; - bddvar Variable; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - Expr = createablbinexpr( ABL_OR, - createablatom( "i2" ), - createablatom( "i3" ) ); - BddSubst = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - BddVariable = searchbddcircuitin( (bddcircuit \(**)0, "i0" ); - Variable = getbddvarbyindex( (bddsystem \(**)0, BddVariable->INDEX ); - Assoc = addbddassoc( (bddsystem \(**)0 ); - addbddnodeassoc( (bddsystem \(**)0, Assoc, Variable, BddSubst ); - BddNode = substbddnodeassoc( (bddsystem \(**)0, BddSubst, Assoc ); - Expr = convertbddcircuitabl( BddCircuit, BddNode ); - /* displays ((i3 or i2) and i1) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddassoc( (bddsystem \(**)0 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/swapbddvar.3 b/alliance/src/bdd/man3/swapbddvar.3 deleted file mode 100644 index b50d1be5..00000000 --- a/alliance/src/bdd/man3/swapbddvar.3 +++ /dev/null @@ -1,67 +0,0 @@ -.\" $Id: swapbddvar.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)swapbddvar.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH SWAPBDDVAR 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -swapbddvar \- swaps two contiguous variables. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void swapbddvar( BddSystem, Variable ) - bddsystem \(**BddSystem; - bddvar Variable; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIVariable\fP -The variable to swap. -.SH DESCRIPTION -\fBswapbddvar\fP swaps the variable number \fIVariable\fP with -the variable number \fIVariable\fP + 1, in the \fBbdd\fP system \fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -This function is usefull for the \fBbdd\fP nodes reordering. -.br -.SH RETURN VALUE -\fBswapbddvar\fP returns nothing. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"variable xxx out of range, error !" -.ft R -.RS -The \fIVariable\fP and \fIVariable\fP + 1, must be valid variables number. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddnode \(**BddNode1; - bddnode \(**BddNode2; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddNode1 = addbddvar( (bddsystem \(**)0, 0 ); - BddNode2 = addbddvar( (bddsystem \(**)0, 0 ); - swapbddvar( (bddsystem \(**)0, 0 ); - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/testbddcircuit.3 b/alliance/src/bdd/man3/testbddcircuit.3 deleted file mode 100644 index c845f2c1..00000000 --- a/alliance/src/bdd/man3/testbddcircuit.3 +++ /dev/null @@ -1,54 +0,0 @@ -.\" $Id: testbddcircuit.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)testbddcircuit.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH TESTBDDCIRCUIT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -testbddcircuit \- debugs a \fBbdd\fP circuit. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -int testbddcircuit( BddCircuit ) - bddcircuit \(**BddCircuit; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddCircuit\fP -The \fBbdd\fP circuit to debug. -.SH DESCRIPTION -\fBtestbddcircuit\fP calls a debugger of \fIBddCircuit\fP. -If a null pointer is given, the default \fBbdd\fP circuit is used. -This function provides a multiple commands to debug all the -functions include in this \fBbdd\fP package. -.br -.SH RETURN VALUE -\fBtestbddcircuit\fP returns 0 if the debugger is interrupt by user, and 1 otherwise. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - ... - testbddcircuit( (bddcircuit \(**)0 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/unmarkbddnode.3 b/alliance/src/bdd/man3/unmarkbddnode.3 deleted file mode 100644 index 5ae405e4..00000000 --- a/alliance/src/bdd/man3/unmarkbddnode.3 +++ /dev/null @@ -1,70 +0,0 @@ -.\" $Id: unmarkbddnode.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)unmarkbddnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH UNMARKBDDNODE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -unmarkbddnode \- unmarks \fBbdd\fP node with a specified mask. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -long unmarkbddnode( BddSystem, BddNode, Mark ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; - bddunmark Mark; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node to unmark. -.TP -\fIMark\fP -The bit mask. -.SH DESCRIPTION -\fBunmarkbddnode\fP unmarks the \fBbdd\fP node \fIBddNode\fP -with the bit mask \fIMark\fP, in the \fBbdd\fP system BddSystem. -If a null pointer is given, the default \fBbdd\fP system is used. -This function does a AND with the field MARK of the \fBbdd\fP node \fIBddNode\fP, -and the complemented bit mask \fIMark\fP. -.br -.SH RETURN VALUE -\fBunmarkbddnode\fP returns the number of the differents unmarked nodes. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - Expr = createablbinexpr( ABL_AND, - createablatom( "i0" ), - createablatom( "i1" ) ); - BddNode = addbddcircuitabl( BddCircuit, Expr ); - freeablexpr( Expr ); - printf( "Number nodes: %ld\n", - markbddnode( (bddsystem \(**)0, BddNode, 0x0001 ) ); - unmarkbddnode( (bddsystem \(**)0, BddNode, 0x0001 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/unsetbddrefext.3 b/alliance/src/bdd/man3/unsetbddrefext.3 deleted file mode 100644 index ca455554..00000000 --- a/alliance/src/bdd/man3/unsetbddrefext.3 +++ /dev/null @@ -1,73 +0,0 @@ -.\" $Id: unsetbddrefext.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)unsetbddrefext.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH UNSETBDDREFEXT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -unsetbddrefext \- increments the internal reference, -and decrements the external reference of a \fBbdd\fP node. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -bddnode \(**unsetbddrefext( BddNode ) - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddNode\fP -The \fBbdd\fP node. -.SH DESCRIPTION -\fBunsetbddrefext\fP increments the number of internal reference -of the \fBbdd\fP node \fIBddNode\fP and decrements its number of -external reference. -.br -.SH RETURN VALUE -\fBunsetbddrefext\fP returns the \fIBddNode\fP pointer. -.SH ERRORS -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -"negative reference, index xxx error !" -.ft R -.RS -The \fIBddNode\fP must have a postive number of external reference. -.RE -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - BddNode = addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - BddNode = addbddnode( (bddsystem \(**)0, BddNode->INDEX, BddNode->LOW, BddNode->HIGH ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - incbddrefext( BddNode ); - unsetbddrefext( BddNode ); - /* displays Node VAR: 0 INDEX: 2 MARK: 0 REF_EXT: 0 REF_INT: 1 */ - viewbddnode( (bddsystem \(**)0, BddNode ); - /* displays (not i0) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/viewbddcircuit.3 b/alliance/src/bdd/man3/viewbddcircuit.3 deleted file mode 100644 index 8d7d7d2a..00000000 --- a/alliance/src/bdd/man3/viewbddcircuit.3 +++ /dev/null @@ -1,56 +0,0 @@ -.\" $Id: viewbddcircuit.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)viewbddcircuit.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH VIEWBDDCIRCUIT 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -viewbddcircuit \- displays a \fBbdd\fP circuit. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void viewbddcircuit( BddCircuit, ViewIndex ) - bddcircuit \(**BddCircuit; - char ViewName; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddCircuit\fP -The \fBbdd\fP circuit to display. -.TP -\fIViewName\fP -Flag to display more informations. -.SH DESCRIPTION -\fBviewbddcircuit\fP displays the \fBbdd\fP circuit \fIBddCircuit\fP. -If \fIViewName\fP is true, \fBviewbddcircuit\fP displays also the field \fINAME_IN\fP. -If a null pointer is given, the default \fBbdd\fP circuit is used. -.br -.SH RETURN VALUE -\fBviewbddcircuit\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - ... - viewbddcircuit( (bddcircuit \(**)0, 0 ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/viewbddnode.3 b/alliance/src/bdd/man3/viewbddnode.3 deleted file mode 100644 index fdb51bb1..00000000 --- a/alliance/src/bdd/man3/viewbddnode.3 +++ /dev/null @@ -1,68 +0,0 @@ -.\" $Id: viewbddnode.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)viewbddnode.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH VIEWBDDNODE 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -viewbddnode \- displays a \fBbdd\fP node. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void viewbddnode( BddSystem, BddNode ) - bddsystem \(**BddSystem; - bddnode \(**BddNode; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system. -.TP -\fIBddNode\fP -The \fBbdd\fP node to display. -.SH DESCRIPTION -\fBviewbddnode\fP displays the node \fIBddNode\fP, in the \fBbdd\fP system -\fIBddSystem\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBviewbddnode\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - bddcircuit \(**BddCircuit; - bddnode \(**BddNode; - chain_list \(**Expr; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - BddCircuit = createbddcircuit( "hello_world", 10, 10, BddSystem ); - addbddcircuitin( (bddcircuit \(**)0, "i0", 0, BDD_IN_MODE_FIRST ); - addbddcircuitin( (bddcircuit \(**)0, "i1", 0, BDD_IN_MODE_FIRST ); - BddNode = applybddnode( (bddsystem \(**)0, - ABL_AND, - searchbddcircuitin( (bddcircuit \(**)0, "i0" ), - searchbddcircuitin( (bddcircuit \(**)0, "i1" ) ); - Expr = convertbddcircuitabl( (bddcircuit \(**)0, BddNode ); - /* displays (i0 and i1) */ - viewablexpr( Expr, ABL_VIEW_VHDL ); - freeablexpr( Expr ); - /* displays Node VAR: 0 INDEX: 2 MARK: 0 REF_EXT: 1 REF_INT: 0 */ - viewbddnode( (bddsystem \(**)0, BddNode ); - destroybddsystem( (bddsystem \(**)0 ); - destroybddcircuit( (bddcircuit \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/viewbddsystem.3 b/alliance/src/bdd/man3/viewbddsystem.3 deleted file mode 100644 index 71e4e1e0..00000000 --- a/alliance/src/bdd/man3/viewbddsystem.3 +++ /dev/null @@ -1,54 +0,0 @@ -.\" $Id: viewbddsystem.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)viewbddsystem.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH VIEWBDDSYSTEM 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -viewbddsystem \- displays a \fBbdd\fP system. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void viewbddsystem( BddSystem, ViewIndex ) - bddsystem \(**BddSystem; - char ViewIndex; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system to display. -.TP -\fIViewIndex\fP -Flag to display more informations. -.SH DESCRIPTION -\fBviewbddsystem\fP displays the \fBbdd\fP system \fIBddSystem\fP. -If \fIViewIndex\fP is true, \fBviewbddsystem\fP displays also -the two fields \fIINDEX_TO_VAR\fP and \fIVAR_TO_INDEX\fP. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBviewbddsystem\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - ... - viewbddsystem( BddSystem, 0 ); - destroybddsystem( (bddsystem \(**)0 ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/man3/viewbddsysteminfo.3 b/alliance/src/bdd/man3/viewbddsysteminfo.3 deleted file mode 100644 index 609f74d5..00000000 --- a/alliance/src/bdd/man3/viewbddsysteminfo.3 +++ /dev/null @@ -1,51 +0,0 @@ -.\" $Id: viewbddsysteminfo.3,v 1.1 2002/03/18 11:26:51 ludo Exp $ -.\" @(#)viewbddsysteminfo.2 2.7 96/07/02 ; Labo masi cao-vlsi; Author : Jacomme Ludovic -.TH VIEWBDDSYSTEMINFO 3 "October 1, 1997" "ASIM/LIP6" "BDD FUNCTIONS" -.SH NAME -viewbddsysteminfo \- displays statistical informations. -.so man1/alc_origin.1 -.SH SYNOPSYS -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" -void viewbddsysteminfo( BddSystem ) - bddsystem \(**BddSystem; -.ft R -.fi -.SH PARAMETERS -.TP 20 -\fIBddSystem\fP -The \fBbdd\fP system to examines. -.SH DESCRIPTION -\fBviewbddsysteminfo\fP provides statistical informations -on the \fBbdd\fP system \fIBddSystem\fP, for example the -perfomance of the different caches. -If a null pointer is given, the default \fBbdd\fP system is used. -.br -.SH RETURN VALUE -\fBviewbddsysteminfo\fP returns nothing. -.SH EXAMPLE -.ta 3n 6n 9n 12n 15n 18n 21n -.nf -.if n \{\ -.ft B \} -.if t \{\ -.ft CR \} -#include "bdd101.h" - bddsystem \(**BddSystem; - BddSystem = createbddsystem( 100, 1000, 100, 50000 ); - ... - viewbddsysteminfo( BddSystem ); - destroybddsystem( BddSystem ); -.ft R -.fi -.SH SEE ALSO -.BR bdd (1) -.BR viewbddsystem(3). - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/bdd/src/Makefile.am b/alliance/src/bdd/src/Makefile.am deleted file mode 100644 index 3af861f2..00000000 --- a/alliance/src/bdd/src/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -CFLAGS = @CFLAGS@ \ - -DALLIANCE_TOP=\"${ALLIANCE_TOP}\" -lib_LIBRARIES = libBdd.a -include_HEADERS = bdd.h -libAbl_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 bddvartree.c \ -bdddump.h bddhoper.h bddsatisfy.h bddvartree.h \ -bddenv.c bddimply.c bddsimpdc.c diff --git a/alliance/src/bdd/src/bdd.h b/alliance/src/bdd/src/bdd.h deleted file mode 100644 index c53dd493..00000000 --- a/alliance/src/bdd/src/bdd.h +++ /dev/null @@ -1,1111 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------\ -| | -| Title : Structures and fonctions for BDD | -| | -| Date : 19.06.2000 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------*/ - -# ifndef BDD_105_H -# define BDD_105_H - -/*------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------*/ -/*------------------------------------------------------\ -| | -| Hash Oper Constants | -| | -\------------------------------------------------------*/ - -# define BDD_OPER_RESTRICT ((long)0x00010000) -# define BDD_OPER_COMPOSE ((long)0x00020000) -# define BDD_OPER_SIMP_DC_ON ((long)0x00040000) -# define BDD_OPER_SIMP_DC_OFF ((long)0x00080000) -# define BDD_OPER_INTERSECT ((long)0x00100000) -# define BDD_OPER_COFACTOR ((long)0x00200000) -# define BDD_OPER_SUBSTITUTE ((long)0x00400000) -# define BDD_OPER_EXIST ((long)0x00800000) -# define BDD_OPER_EXIST_MISS ((long)0x01000000) -# define BDD_OPER_REDUCE ((long)0x02000000) -# define BDD_OPER_REL_PROD ((long)0x04000000) - -# define BDD_OPER_MASK ((long)0x03FF0000) - -/*------------------------------------------------------\ -| | -| Bdd Hash Node | -| | -\------------------------------------------------------*/ - -# define BDD_HASH_NODE_EMPTY ((bddhnode)0) -# define BDD_HASH_NODE_DELETED ((bddhnode)1) - -/*------------------------------------------------------\ -| | -| Bdd Index | -| | -\------------------------------------------------------*/ - -# define BDD_INDEX_ZERO ((bddindex) 0) -# define BDD_INDEX_ONE ((bddindex) 1) -# define BDD_INDEX_MIN ((bddindex) 2) - -# define BDD_MAX_INDEX ((bddindex)-1) - -/*------------------------------------------------------\ -| | -| Bdd Short | -| | -\------------------------------------------------------*/ - -# define BDD_MAX_SHORT ((bddshort)-1) - -/*------------------------------------------------------\ -| | -| Bdd Variable | -| | -\------------------------------------------------------*/ - -# define BDD_MAX_VAR ( ((bddvar)-1) - BDD_INDEX_MIN ) -# define BDD_MIN_VAR ((bddvar)-1) - -/*------------------------------------------------------\ -| | -| Bdd Reference | -| | -\------------------------------------------------------*/ - -# define BDD_MAX_REF ((bddref)-1) - -/*------------------------------------------------------\ -| | -| Bdd Flag | -| | -\------------------------------------------------------*/ - -# define BDD_FLAG_NUM_MASK (bddflag)( 0x0001 ) -# define BDD_MAX_FLAG (bddflag)( -1 ) - -/*------------------------------------------------------\ -| | -| Support Type | -| | -\------------------------------------------------------*/ - -# define BDD_SUPPORT_CHAIN 0 -# define BDD_SUPPORT_PTYPE 1 - -/*------------------------------------------------------\ -| | -| Add Input Mode | -| | -\------------------------------------------------------*/ - -# define BDD_IN_MODE_FIRST 0x00 -# define BDD_IN_MODE_LAST 0x01 -# define BDD_IN_MODE_BEFORE 0x02 -# define BDD_IN_MODE_AFTER 0x03 -# define BDD_IN_MODE_IMPOSE 0x04 - -/*------------------------------------------------------\ -| | -| Add Auxiliar Mode | -| | -\------------------------------------------------------*/ - -# define BDD_AUX_MODE_SINGLE 0x00 -# define BDD_AUX_MODE_GLOBAL 0x01 - -/*------------------------------------------------------\ -| | -| User Function Type | -| | -\------------------------------------------------------*/ - -# define BDD_FUNC_RESET_HASH_OPER 0 - -/*------------------------------------------------------\ -| | -| Bdd System Flags | -| | -\------------------------------------------------------*/ - -# define BDD_SYSTEM_REORDER_ON_MASK 0x0001 -# define BDD_SYSTEM_REORDER_MASK 0x0002 -# define BDD_SYSTEM_EXPLOSION_ON_MASK 0x0004 -# define BDD_SYSTEM_EXPLOSION_MASK 0x0008 -# define BDD_SYSTEM_SWAP_VAR_MASK 0x0010 -# define BDD_SYSTEM_NO_WARNING_MASK 0x0020 - -/*------------------------------------------------------\ -| | -| Macros | -| | -\------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------\ -| | -| Bdd System Mask | -| | -\------------------------------------------------------*/ - -# define SetBddSystemReorderOn( S ) ( (S)->FLAGS |= BDD_SYSTEM_REORDER_ON_MASK ) -# define IsBddSystemReorderOn( S ) ( (S)->FLAGS & BDD_SYSTEM_REORDER_ON_MASK ) -# define ClearBddSystemReorderOn( S ) ( (S)->FLAGS &= ~BDD_SYSTEM_REORDER_ON_MASK) - -# define SetBddSystemReorder( S ) ( (S)->FLAGS |= BDD_SYSTEM_REORDER_MASK ) -# define IsBddSystemReorder( S ) ( (S)->FLAGS & BDD_SYSTEM_REORDER_MASK ) -# define ClearBddSystemReorder( S ) ( (S)->FLAGS &= ~BDD_SYSTEM_REORDER_MASK) - -# define SetBddSystemExplosionOn( S ) ( (S)->FLAGS |= BDD_SYSTEM_EXPLOSION_ON_MASK ) -# define IsBddSystemExplosionOn( S ) ( (S)->FLAGS & BDD_SYSTEM_EXPLOSION_ON_MASK ) -# define ClearBddSystemExplosionOn( S ) ( (S)->FLAGS &= ~BDD_SYSTEM_EXPLOSION_ON_MASK) - -# define SetBddSystemExplosion( S ) ( (S)->FLAGS |= BDD_SYSTEM_EXPLOSION_MASK ) -# define IsBddSystemExplosion( S ) ( (S)->FLAGS & BDD_SYSTEM_EXPLOSION_MASK ) -# define ClearBddSystemExplosion( S ) ((S)->FLAGS &= ~BDD_SYSTEM_EXPLOSION_MASK) - -# define SetBddSystemSwapVar( S ) ( (S)->FLAGS |= BDD_SYSTEM_SWAP_VAR_MASK ) -# define IsBddSystemSwapVar( S ) ( (S)->FLAGS & BDD_SYSTEM_SWAP_VAR_MASK ) -# define ClearBddSystemSwapVar( S ) ( (S)->FLAGS &= ~BDD_SYSTEM_SWAP_VAR_MASK) - -# define SetBddSystemNoWarning( S ) ( (S)->FLAGS |= BDD_SYSTEM_NO_WARNING_MASK ) -# define IsBddSystemNoWarning( S ) ( (S)->FLAGS & BDD_SYSTEM_NO_WARNING_MASK ) -# define ClearBddSystemNoWarning( S ) ( (S)->FLAGS &= ~BDD_SYSTEM_NO_WARNING_MASK) - -/*------------------------------------------------------\ -| | -| Bdd Local System | -| | -\------------------------------------------------------*/ - -# define setbddlocalsystem( S ) \ - \ - do { if ( (S) ) BddLocalSystem = (S); } while (0) - -/*------------------------------------------------------\ -| | -| Bdd Local Circuit | -| | -\------------------------------------------------------*/ - -# define setbddlocalcircuit( C ) \ - \ - do { if ( (C) ) { BddLocalCircuit = (C); \ - BddLocalSystem = (C)->BDD_SYSTEM; } } while (0) - -/*------------------------------------------------------\ -| | -| Bdd Support | -| | -\------------------------------------------------------*/ - -# define getbddnodesupportchain( S, N ) \ - \ - ((chain_list *)getbddnodesupport( (S), (N), BDD_SUPPORT_CHAIN )) - -# define getbddnodesupportptype( S, N ) \ - \ - ((ptype_list *)getbddnodesupport( (S), (N), BDD_SUPPORT_PTYPE )) - -/*------------------------------------------------------\ -| | -| Type | -| | -\------------------------------------------------------*/ -/*------------------------------------------------------\ -| | -| Index Ref Mark and Var | -| | -\------------------------------------------------------*/ - - typedef unsigned short bddindex; - typedef unsigned short bddref; - typedef unsigned char bddmark; - typedef unsigned char bddflag; - typedef unsigned short bddvar; - typedef unsigned short bddshort; - -/*------------------------------------------------------\ -| | -| Bdd Alloc Info | -| | -\------------------------------------------------------*/ - - typedef struct bddallocinfo - { - long CIRCUIT; - long SYSTEM; - long BLOCK; - long NODE_BLOCK; - long HASH_NODE_TABLE; - long HASH_NODE; - long HASH_OPER_TABLE; - long HASH_OPER; - long VAR_TREE; - long VAR_CHILD; - long VAR; - long VAR_NODE; - long INDEX_NODE; - long INDEX; - long ASSOC; - long ASSOC_NODE; - long NAME_IN; - long INDEX_IN; - long HEATH; - long USER_FUNC; - - } bddallocinfo; - -/*------------------------------------------------------\ -| | -| Bdd User Function | -| | -\------------------------------------------------------*/ - - typedef struct bdduserfunc - { - struct bdduserfunc *NEXT; - void (*FUNC)(); - void *DATA; - long TYPE; - - } bdduserfunc; - -/*------------------------------------------------------\ -| | -| Bdd Node | -| | -\------------------------------------------------------*/ - - typedef struct bddnode - { - struct bddnode *HIGH; - struct bddnode *LOW; - bddindex INDEX; - bddmark MARK; - bddflag FLAG; - bddref REF_EXT; - bddref REF_INT; - - } bddnode; - -/*------------------------------------------------------\ -| | -| Bdd Hash Node | -| | -\------------------------------------------------------*/ - - typedef bddnode *bddhnode; - -/*------------------------------------------------------\ -| | -| Bdd Block | -| | -\------------------------------------------------------*/ - - typedef struct bddblock - { - struct bddblock *NEXT; - struct bddnode *NODE; - long NODE_FREE; - - } bddblock; - -/*------------------------------------------------------\ -| | -| Bdd Hash Node Table | -| | -\------------------------------------------------------*/ - - typedef struct bddhnodetable - { - bddhnode *TABLE; - long TABLE_SIZE; - long NUMBER_NODE; - long NUMBER_ADD; - long NUMBER_SCAN; - long NUMBER_STRETCH; - long NUMBER_RESIZE; - - } bddhnodetable; - -/*------------------------------------------------------\ -| | -| Bdd Hash Oper | -| | -\------------------------------------------------------*/ - - typedef struct bddhoper - { - bddnode *LEFT; - bddnode *RIGHT; - bddnode *FATHER; - long OPERATOR; - - } bddhoper; - -/*------------------------------------------------------\ -| | -| Bdd Hash Oper Table | -| | -\------------------------------------------------------*/ - - typedef struct bddhopertable - { - bddhoper *TABLE; - long TABLE_SIZE; - long TABLE_FREEZE; - long NUMBER_OPER; - long NUMBER_ADD; - long NUMBER_HIT; - long NUMBER_MISS; - long NUMBER_RESET; - - } bddhopertable; - -/*------------------------------------------------------\ -| | -| Bdd Variable Node | -| | -\------------------------------------------------------*/ - - typedef bddnode *bddvarnode; - -/*------------------------------------------------------\ -| | -| Bdd Index Node | -| | -\------------------------------------------------------*/ - - typedef bddhnodetable *bddindexnode; - -/*------------------------------------------------------\ -| | -| Bdd Assoc Node | -| | -\------------------------------------------------------*/ - - typedef bddnode *bddassocnode; - -/*------------------------------------------------------\ -| | -| Bdd Assoc | -| | -\------------------------------------------------------*/ - - typedef struct bddassoc - { - struct bddassoc *NEXT; - bddassocnode *ASSOC_NODE; - bddvar FIRST; - bddvar LAST; - bddshort IDENT; - bddshort CACHE; - - } bddassoc; - -/*------------------------------------------------------\ -| | -| Bdd System | -| | -\------------------------------------------------------*/ - - typedef struct bddsystem - { - bddblock *BLOCK; - bddnode *NODE_FREE; - long NUMBER_FREE; - - bddindexnode *INDEX_NODE; - bddvarnode *VAR_NODE; - bddindex *VAR_TO_INDEX; - bddvar *INDEX_TO_VAR; - - - long NUMBER_NODE; - long MAX_NODE; - long TOP_NODE; - - long NUMBER_VAR; - long MAX_VAR; - - long NUMBER_INDEX; - long MAX_INDEX; - - bddassoc *ASSOC; - unsigned char ASSOC_RESET; - - bddhopertable *HASH_OPER; - - bddnode *ONE; - bddnode *ZERO; - - bddmark MARK; - long FLAGS; - - void (*REORDER_FUNC)(); - long REORDER_LOW; - long REORDER_LIMIT; - long REORDER_RATIO; - - bdduserfunc *USER_FUNC; - - long VAR_MODEL; - long OPER_MODEL; - - void (*EXPLOSION_FUNC)(); - long EXPLOSION_LIMIT; - - } bddsystem; - -/*------------------------------------------------------\ -| | -| Bdd Name Input | -| | -\------------------------------------------------------*/ - - typedef char *bddnamein; - -/*------------------------------------------------------\ -| | -| Bdd Circuit | -| | -\------------------------------------------------------*/ - - typedef struct bddcircuit - { - char *NAME; - - authtable *HASH_IN; - authtable *HASH_OUT; - - bddnamein *NAME_IN; - long NAME_IN_SIZE; - - bddindex *INDEX_IN; - long INDEX_IN_SIZE; - - long NUMBER_NAME_IN; - long NUMBER_NAME_OUT; - - bddsystem *BDD_SYSTEM; - - } bddcircuit; - -/*------------------------------------------------------\ -| | -| Bdd Heath | -| | -\------------------------------------------------------*/ - - typedef struct bddheath - { - struct bddheath *NEXT; - struct bddnode *VAR; - struct bddnode *MINUS; - struct bddnode *PLUS; - - } bddheath; - -/*------------------------------------------------------\ -| | -| Global Variables | -| | -\------------------------------------------------------*/ - - extern long BDD_HNODE_STRETCH_FACTOR; - extern long BDD_HNODE_RESIZE_FACTOR; - extern long BDD_HNODE_MIN_FILL_FACTOR; - extern long BDD_HNODE_MAX_SCAN; - - extern bddsystem *BddLocalSystem; - extern bddcircuit *BddLocalCircuit; - extern bddallocinfo BddAllocInfo; - -/*------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------*/ -/*------------------------------------------------------\ -| | -| Env Functions | -| | -\------------------------------------------------------*/ - - extern void bddenv __P(()); - -/*------------------------------------------------------\ -| | -| Alloc Functions | -| | -\------------------------------------------------------*/ - - extern bddcircuit * allocbddcircuit __P(()); - extern bddsystem * allocbddsystem __P(()); - - extern bddblock * allocbddblock __P(()); - extern bddnode * allocbddnodeblock __P((long Number)); - extern bddhnodetable * allocbddhnodetable __P(()); - extern bddhnode * allocbddhnode __P((long Number)); - extern bddhopertable * allocbddhopertable __P(()); - extern bddhoper * allocbddhoper __P((long Number)); - - extern bddvar * allocbddvar __P((long Number)); - extern bddvarnode * allocbddvarnode __P((long Number)); - extern bddindexnode * allocbddindexnode __P((long Number)); - extern bddindex * allocbddindex __P((long Number)); - extern bddnamein * allocbddnamein __P((long Number)); - extern bddindex * allocbddindexin __P((long Number)); - - extern bddassoc * allocbddassoc __P(()); - extern bddassocnode * allocbddassocnode __P((long Number)); - - extern bddheath * allocbddheath __P(()); - extern bdduserfunc * allocbdduserfunc __P(()); - - extern void viewbddallocinfo __P(()); - -/*------------------------------------------------------\ -| | -| Resize Functions | -| | -\------------------------------------------------------*/ - - extern bddvar * resizebddvar __P((bddvar *BddVar, long OldNum, long NewNum)); - extern bddvarnode * resizebddvarnode __P((bddvarnode *BddVarNode, long OldNum, long NewNum)); - extern bddindexnode * resizebddindexnode __P((bddindexnode *BddIndexNode, long OldNum, long NewNum)); - extern bddindex * resizebddindex __P((bddindex *BddIndex, long OldNum, long NewNum)); - extern bddassocnode * resizebddassocnode __P((bddassocnode *BddAssocNode, long OldNum, long NewNum)); - extern bddnamein * resizebddnamein __P((bddnamein *NameIn, long OldNum, long NewNum)); - extern bddindex * resizebddindexin __P((bddindex *IndexIn, long OldNum, long NewNum)); - -/*------------------------------------------------------\ -| | -| Free Functions | -| | -\------------------------------------------------------*/ - - extern void freebddcircuit __P((bddcircuit *BddCircuit)); - extern void freebddsystem __P((bddsystem *BddSystem)); - extern void freebddblock __P((bddblock *BddBlock)); - extern void freebddnodeblock __P((bddnode *BddNode)); - extern void freebddhnodetable __P((bddhnodetable *HashTable)); - extern void freebddhnode __P((bddhnode *HashNode)); - extern void freebddhopertable __P((bddhopertable *HashTable)); - extern void freebddhoper __P((bddhoper *HashOper)); - extern void freebddvar __P((bddvar *BddVariable)); - extern void freebddvarnode __P((bddvarnode *BddVariableNode)); - extern void freebddindex __P((bddindex *BddIndex)); - extern void freebddindexnode __P((bddindexnode *BddIndexNode)); - extern void freebddnamein __P((bddnamein *NameIn)); - extern void freebddindexin __P((bddindex *IndexIn)); - extern void freebddassoc __P((bddassoc *BddAssoc)); - extern void freebddassocnode __P((bddassocnode *BddAssocNode)); - extern void freebddheath __P((bddheath *BddHeath)); - extern void freebdduserfunc __P((bdduserfunc *BddUserFunc)); - -/*------------------------------------------------------\ -| | -| Circuit Functions | -| | -\------------------------------------------------------*/ - - extern bddcircuit * createbddcircuit __P((char *Name, long NumberIn, long NumberOut, bddsystem *BddSystem)); - extern void resetbddcircuit __P((bddcircuit *BddCircuit)); - extern void destroybddcircuit __P((bddcircuit *BddCircuit)); - extern void viewbddcircuit __P((bddcircuit *BddCircuit, char ViewName)); - - extern bddnode * searchbddcircuitin __P((bddcircuit *BddCircuit, char *InputName)); - extern bddnode * addbddcircuitin __P((bddcircuit *BddCircuit, char *InputName, bddindex Index, long Mode)); - extern char * getbddcircuitinname __P((bddcircuit *BddCircuit, bddindex Index )); - extern bddnode * addbddcircuitaux __P((bddcircuit *BddCircuit, char *InputName, bddnode *BddAux, int (*UserFunc)(), long Mode)); - extern bddnode * renamebddcircuitin __P((bddcircuit *BddCircuit, char *InputName, char *NewName)); - - extern bddnode * searchbddcircuitout __P((bddcircuit *BddCircuit, char *OutputName)); - extern bddnode * addbddcircuitout __P((bddcircuit *BddCircuit, char *OutputName, bddnode *BddNode)); - extern int delbddcircuitout __P((bddcircuit *BddCircuit, char *OutputName)); - - extern bddnode * addbddcircuitabl __P((bddcircuit *BddCircuit, ablexpr *Expr)); - extern ablexpr * convertbddcircuitabl __P((bddcircuit *BddCircuit, bddnode *BddNode)); - extern ablexpr * convertbddcircuitsumabl __P((bddcircuit *BddCircuit, bddnode *BddNode)); - - extern long getbddcircuitnumnode __P(( bddcircuit *BddCircuit )); - extern long getbddcircuitsize __P(( bddcircuit *BddCircuit )); - extern void optimizebddcircuit __P(( bddcircuit *BddCircuit, long (*CostFunc)(), float MaxSizeFactor )); - -/*------------------------------------------------------\ -| | -| System Functions | -| | -\------------------------------------------------------*/ - - extern bddsystem * createbddsystem __P((long ModelVar, long ModelOper, long MaxVar, long MaxNode)); - extern void resetbddsystem __P((bddsystem *BddSystem)); - extern void destroybddsystem __P((bddsystem *BddSystem)); - extern void viewbddsystem __P((bddsystem *BddSystem, char ViewIndex)); - extern void viewbddsysteminfo __P((bddsystem *BddSystem)); - -/*------------------------------------------------------\ -| | -| Block Functions | -| | -\------------------------------------------------------*/ - - extern bddblock * createbddblock __P((bddsystem *BddSystem)); - extern void resetbddblock __P((bddsystem *BddSystem)); - extern void destroybddblock __P((bddsystem *BddSystem)); - extern void viewbddblock __P((bddsystem *BddSystem, void (*FuncView)())); - - extern bddblock * addbddblock __P((bddsystem *BddSystem)); - -/*------------------------------------------------------\ -| | -| User Functions | -| | -\------------------------------------------------------*/ - - extern bdduserfunc * addbdduserfunc __P((bddsystem *BddSystem, long Type, void (*Func)(), void *Data)); - extern void execbdduserfunc __P((bddsystem *BddSystem, long Type)); - extern int delbdduserfunc __P((bddsystem *BddSystem, bdduserfunc *BddUserFunc)); - extern void destroybdduserfunc __P((bddsystem *BddSystem)); - -/*------------------------------------------------------\ -| | -| Variable Functions | -| | -\------------------------------------------------------*/ - - extern bddindex newbddvar __P((bddsystem *BddSystem, bddvar Variable)); - extern bddnode * addbddvar __P((bddsystem *BddSystem, bddvar Variable)); - extern bddnode * addbddvarfirst __P((bddsystem *BddSystem)); - extern bddnode * addbddvarlast __P((bddsystem *BddSystem)); - extern bddnode * addbddvarbefore __P((bddsystem *BddSystem, bddindex Index)); - extern bddnode * addbddvarafter __P((bddsystem *BddSystem, bddindex Index)); - - extern int swapbddvar __P((bddsystem *BddSystem, bddvar Variable)); - extern void sweepbddvar __P((bddsystem *BddSystem, bddvar Variable, int SweepRef)); - - extern bddindex getbddvarindex __P((bddsystem *BddSystem, bddvar Variable)); - extern bddvar getbddvarbyindex __P((bddsystem *BddSystem, bddindex Index)); - extern bddnode * getbddvarnode __P((bddsystem *BddSystem, bddvar Variable)); - extern bddnode * getbddvarnodebyindex __P((bddsystem *BddSystem, bddindex Index)); - -/*------------------------------------------------------\ -| | -| Auxiliary Variable Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * addbddvarauxsingle __P((bddsystem *BddSystem, bddnode *BddAux)); - extern bddnode * addbddvarauxglobal __P((bddsystem *BddSystem, bddnode *BddAux, int (*UserFunc)())); - extern bddnode *addbddvarauxuser(); - -/*------------------------------------------------------\ -| | -| Node Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * addbddnode __P((bddsystem *BddSystem, bddindex Index, bddnode *High, bddnode *Low)); - extern void delbddnode __P((bddsystem *BddSystem, bddnode *BddNode)); - extern void viewbddnode __P((bddsystem *BddSystem, bddnode *BddNode)); - - extern chain_list * addbddnodelist __P((bddsystem *BddSystem, chain_list *HeadList, bddnode *BddNode)); - extern void delbddnodelist __P((bddsystem *BddSystem, chain_list *HeadList)); - -/*------------------------------------------------------\ -| | -| Reference Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * incbddrefext __P((bddnode *BddNode)); - extern bddnode * decbddrefext __P((bddnode *BddNode)); - extern bddnode * incbddrefint __P((bddnode *BddNode)); - extern bddnode * decbddrefint __P((bddnode *BddNode)); - - extern bddnode * setbddrefext __P((bddnode *BddNode)); - extern bddnode * unsetbddrefext __P((bddnode *BddNode)); - - extern void updatebddref __P((bddnode *BddNode)); - - extern void clearbddsystemrefext __P((bddsystem *BddSystem)); - extern void clearbddsystemrefint __P((bddsystem *BddSystem)); - extern void clearbddsystemref __P((bddsystem *BddSystem)); - -/*------------------------------------------------------\ -| | -| Association Functions | -| | -\------------------------------------------------------*/ - - extern bddassoc * addbddassoc __P((bddsystem *BddSystem)); - extern int delbddassoc __P((bddsystem *BddSystem, bddassoc *BddAssoc)); - extern void viewbddassoc __P((bddsystem *BddSystem, bddassoc *BddAssoc, void (*FuncView)())); - - extern void resetbddassoc __P((bddsystem *BddSystem, bddassoc *BddAssoc)); - extern void destroybddassoc __P((bddsystem *BddSystem)); - - extern bddassoc * addbddnodeassoc __P((bddsystem *BddSystem, bddassoc *BddAssoc, bddvar Variable, bddnode *BddNode)); - extern int delbddnodeassoc __P((bddsystem *BddSystem, bddassoc *BddAssoc, bddvar Variable)); - -/*------------------------------------------------------\ -| | -| Mark Functions | -| | -\------------------------------------------------------*/ - - extern void newbddsystemmark __P(( bddsystem *BddSystem )); - extern void setbddnodemark __P(( bddsystem *BddSystem, bddnode *BddNode )); - extern int testbddnodemark __P(( bddsystem *BddSystem, bddnode *BddNode )); - - extern long getbddnodenum __P((bddsystem *BddSystem, bddnode *BddNode)); - extern long getbddnodesize __P((bddsystem *BddSystem, bddnode *BddNode)); - -/*------------------------------------------------------\ -| | -| Flag Functions | -| | -\------------------------------------------------------*/ - - extern long flagbddnode __P((bddsystem *BddSystem, bddnode *BddNode, bddflag Flag)); - extern long unflagbddnode __P((bddsystem *BddSystem, bddnode *BddNode, bddflag Flag)); - -/*------------------------------------------------------\ -| | -| Check Functions | -| | -\------------------------------------------------------*/ - - extern int checkbddindex __P((bddsystem *BddSystem, bddindex Index, int Severity)); - extern int checkbddvar __P((bddsystem *BddSystem, bddvar Variable, int Severity)); - extern int checkbddoper __P((bddsystem *BddSystem, long Oper, int Severity)); - extern int checkbddassoc __P((bddsystem *BddSystem, bddassoc *BddAssoc, int Severity)); - extern int checkbddmaxnode __P((bddsystem *BddSystem, int Severity)); - -/*------------------------------------------------------\ -| | -| Get Hash Functions | -| | -\------------------------------------------------------*/ - - extern long getbddhnodesize __P((long Size)); - extern long getbddhnodekey __P((bddhnodetable *Table, bddnode *BddNode)); - extern long getbddhnodeindex __P((bddhnodetable *Table, bddnode *BddNode, long Index)); - - extern long getbddhopersize __P((long Size)); - extern long getbddhoperkey __P((bddhopertable *Table, long Oper, bddnode *BddLeft, bddnode *BddRight)); - -/*------------------------------------------------------\ -| | -| Check Hash Functions | -| | -\------------------------------------------------------*/ - - extern int checkbddhnode __P((bddnode *HashNode, int Severity)); - -/*------------------------------------------------------\ -| | -| Set Hash Functions | -| | -\------------------------------------------------------*/ - - extern void setbddhnodefunc __P((long (*FuncSize)(), long (*FuncKey)(), long (*FuncIndex)())); - extern void setbddhoperfunc __P((long (*FuncSize)(), long (*FuncKey)())); - -/*------------------------------------------------------\ -| | -| Hash Table Functions | -| | -\------------------------------------------------------*/ - - extern bddhnodetable * createbddhnodetable __P((long Length)); - extern void stretchbddhnodetable __P((bddhnodetable *HashTable)); - extern void destroybddhnodetable __P((bddhnodetable *HashTable)); - extern void resetbddhnodetable __P((bddhnodetable *HashTable)); - extern void viewbddhnodetable __P((bddhnodetable *HashTable, void (*FuncView)())); - - extern bddhopertable * createbddhopertable __P((long Length)); - extern void destroybddhopertable __P((bddhopertable *HashTable)); - extern void resetbddhopertable __P((bddhopertable *HashTable)); - extern void viewbddhopertable __P((bddhopertable *HashTable, void (*FuncView)())); - -/*------------------------------------------------------\ -| | -| Hash Node Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * addbddhnode __P((bddhnodetable *HashTable, bddnode *BddNode)); - extern int delbddhnode __P((bddhnodetable *HashTable, bddnode *BddNode)); - extern void viewbddhnode __P((bddnode *HashNode)); - -/*------------------------------------------------------\ -| | -| Hash Oper Functions | -| | -\------------------------------------------------------*/ - - extern bddhoper * addbddhoper __P((bddhopertable *HashTable, long Oper, bddnode *BddLeft, bddnode *BddRight, bddnode *BddFather)); - extern bddhoper * searchbddhoper __P((bddhopertable *HashTable, long Oper, bddnode *BddLeft, bddnode *BddRight)); - extern void viewbddhoper __P((bddhoper *HashOper)); - -/*------------------------------------------------------\ -| | -| View Index and Variable Nodes | -| | -\------------------------------------------------------*/ - - extern void viewbddindexnode __P((bddsystem *BddSystem, void (*FuncView)())); - extern void viewbddvarnode __P((bddsystem *BddSystem, void (*FuncView)())); - -/*------------------------------------------------------\ -| | -| Apply Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * applybddnode __P((bddsystem *BddSystem, long Oper, bddnode *BddNode1, bddnode *BddNode2)); - extern bddnode * applybddnodenot __P((bddsystem *BddSystem, bddnode *BddNode)); - extern bddnode * applybddnodeite __P((bddsystem *BddSystem, bddnode *BddIf, bddnode *BddThen, bddnode *BddElse)); - extern bddnode * applybddnodeterm __P((bddsystem *BddSystem, long Oper, bddindex Index, bddnode *BddNode)); - extern bddnode * applybddnodelist __P((bddsystem *BddSystem, long Oper, chain_list *BddList)); - -/*------------------------------------------------------\ -| | -| Support Functions | -| | -\------------------------------------------------------*/ - - extern void * getbddnodesupport __P((bddsystem *BddSystem, bddnode *BddNode, int Mode)); - extern int isbddvarinsupport __P((bddsystem *BddSystem, bddnode *BddNode, bddvar Variable)); - -/*------------------------------------------------------\ -| | -| Compose Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * restrictbddnode __P((bddsystem *BddSystem, bddnode *BddNode, bddvar Variable, bddnode *BddSubst)); - extern bddnode * composebddnode __P((bddsystem *BddSystem, bddnode *BddNode, bddvar Variable, bddnode *BddSubst)); - -/*------------------------------------------------------\ -| | -| Substitute Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * substbddnodeassoc __P((bddsystem *BddSystem, bddnode *BddNode, bddassoc *BddAssoc)); - -/*------------------------------------------------------\ -| | -| Existential Quantification Functions | -| | -\------------------------------------------------------*/ - - extern bddnode *forallbddnodeassoc __P((bddsystem *BddSystem, bddnode *BddNode, bddassoc *BddAssoc)); - extern bddnode *forallbddnodemissassoc __P((bddsystem *BddSystem, bddnode *BddNode, bddassoc *BddAssoc)); - extern bddnode *existbddnodeassoc __P((bddsystem *BddSystem, bddnode *BddNode, bddassoc *BddAssoc)); - extern bddnode *existbddnodemissassoc __P((bddsystem *BddSystem, bddnode *BddNode, bddassoc *BddAssoc)); - -/*------------------------------------------------------\ -| | -| Relational Product Functions | -| | -\------------------------------------------------------*/ - - extern bddnode *relprodbddnodeassoc __P((bddsystem *BddSystem, bddnode *BddNode1, bddnode *BddNode2, bddassoc *BddAssoc)); - -/*------------------------------------------------------\ -| | -| Intersect & Imply Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * implybddnode __P((bddsystem *BddSystem, bddnode *BddNode1, bddnode *BddNode2)); - extern bddnode * intersectbddnode __P((bddsystem *BddSystem, bddnode *BddNode1, bddnode *BddNode2)); - -/*------------------------------------------------------\ -| | -| Fraction Functions | -| | -\------------------------------------------------------*/ - - extern double fractionbddnode __P((bddsystem *BddSystem, bddnode *BddNode)); - -/*------------------------------------------------------\ -| | -| Satisfy Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * satisfybddnode __P((bddsystem *BddSystem, bddnode *BddNode)); - extern bddnode * satisfybddnodeassoc __P((bddsystem *BddSystem, bddnode *BddNode, bddassoc *BddAssoc)); - -/*------------------------------------------------------\ -| | -| Cofactor Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * cofactorbddnode __P((bddsystem *BddSystem, bddnode *BddNode1, bddnode *BddNode2)); - -/*------------------------------------------------------\ -| | -| Reduce Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * reducebddnode __P((bddsystem *BddSystem, bddnode *BddNode1, bddnode *BddNode2)); - -/*------------------------------------------------------\ -| | -| Heath Functions | -| | -\------------------------------------------------------*/ - - extern bddheath * getbddheath __P((bddsystem *BddSystem, bddnode *BddNode)); - extern bddheath * getbddheathvar __P((bddsystem *BddSystem, bddnode *BddNode, bddvar Variable)); - extern void delbddheath __P((bddsystem *BddSystem, bddheath *BddHeath)); - -/*------------------------------------------------------\ -| | -| Simplify Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * simpbddnodedcon __P((bddsystem *BddSystem, bddnode *BddOn, bddnode *BddDc)); - extern bddnode * simpbddnodedcoff __P((bddsystem *BddSystem, bddnode *BddOff, bddnode *BddDc)); - -/*------------------------------------------------------\ -| | -| Conversion Functions | -| | -\------------------------------------------------------*/ - - extern chain_list * convertbddnodeabl __P((bddsystem *BddSystem, char **NameArray, bddindex *IndexArray, bddnode *BddNode)); - extern ablexpr *convertbddnodemuxabl(); - extern chain_list * convertbddnodesumabl __P((bddsystem *BddSystem, char **NameArray, bddindex *IndexArray, bddnode *BddNode)); - extern chain_list * convertbddindexabl __P((bddsystem *BddSystem, char **NameArray, bddindex *IndexArray, bddindex Index)); - -/*------------------------------------------------------\ -| | -| Garbage Collect Functions | -| | -\------------------------------------------------------*/ - - extern void garbagebddsystem __P((bddsystem *BddSystem)); - extern void sweepbddsystem __P((bddsystem *BddSystem)); - -/*------------------------------------------------------\ -| | -| Reorder Functions | -| | -\------------------------------------------------------*/ - - extern void reorderbddsystemsimple __P((bddsystem *BddSystem)); - extern void reorderbddsystemwindow __P((bddsystem *BddSystem)); - extern void reorderbddsystemtop __P((bddsystem *BddSystem)); - - extern void reorderbddsystemdynamic __P((bddsystem *BddSystem, void (*ReorderFunc)(), long ReorderLow, long ReorderRatio)); - -/*------------------------------------------------------\ -| | -| Explosion Functions | -| | -\------------------------------------------------------*/ - - extern void explosionbddsystemdynamic __P((bddsystem *BddSystem, void (*ExplosionFunc)(), long ExplosionLimit)); - extern void explosionbddsystemrestart __P((bddsystem *BddSystem)); - -/*------------------------------------------------------\ -| | -| Test Functions | -| | -\------------------------------------------------------*/ - - extern int testbddcircuit __P((bddcircuit *BddCircuit)); - -/*------------------------------------------------------\ -| | -| Dump Functions | -| | -\------------------------------------------------------*/ - - extern bddcircuit * undumpbddcircuit __P((bddsystem *BddSystem, char *FileName)); - extern void dumpbddcircuit __P((bddcircuit *BddCircuit, char *FileName)); - -/*------------------------------------------------------\ -| | -| Name Functions | -| | -\------------------------------------------------------*/ - - extern char * isbddstablename __P((char *StableName)); - extern char * getbddstablename __P((char *Name)); - -/*------------------------------------------------------\ -| | -| Log Compatibility Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * getlogbddnodeone __P(()); - extern bddnode * getlogbddnodezero __P(()); - extern bddnode * getlogbddnodeterm __P((bddindex Index)); - extern bddnode * getlogbddnodenot __P((bddnode *BddNode)); - extern bddnode * applylogbddnode __P((long Oper, bddnode *BddNode1, bddnode *BddNode2)); - extern ablexpr * convertlogbddnode __P((bddcircuit *BddCircuit, bddnode *BddNode)); - extern short addlogbddcircuitin __P((bddcircuit *BddCircuit, char *Name)); - -/*------------------------------------------------------\ -| | -| Bdd Transfert Functions | -| | -\------------------------------------------------------*/ - - extern bddnode * transfertbdd __P(( bddsystem *SystemSrc, bddsystem *SystemDst, bddnode *Node )); - - -# endif diff --git a/alliance/src/bdd/src/bddalloc.c b/alliance/src/bdd/src/bddalloc.c deleted file mode 100644 index d0834c94..00000000 --- a/alliance/src/bdd/src/bddalloc.c +++ /dev/null @@ -1,398 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddalloc.c | -| | -| Date : 03.12.96 | -| | -| Bddhor : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddalloc.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - bddallocinfo BddAllocInfo = - - { - 0, /* CIRCUIT */ - 0, /* SYSTEM */ - 0, /* BLOCK */ - 0, /* NODE_BLOCK */ - 0, /* HASH_NODE_TABLE */ - 0, /* HASH_NODE */ - 0, /* HASH_OPER_TABLE */ - 0, /* HASH_OPER */ - 0, /* VAR */ - 0, /* VAR_NODE */ - 0, /* INDEX_NODE */ - 0, /* INDEX */ - 0, /* ASSOC */ - 0, /* ASSOC_NODE */ - 0, /* NAME_IN */ - 0, /* INDEX_IN */ - 0, /* HEATH */ - 0 /* USER_FUNC */ - }; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Alloc User Func | -| | -\------------------------------------------------------------*/ - -bdduserfunc *allocbdduserfunc() -{ - BddAllocInfo.USER_FUNC++; - - return( (bdduserfunc *)autallocheap( sizeof( bdduserfunc ) ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Heath | -| | -\------------------------------------------------------------*/ - -bddheath *allocbddheath() -{ - BddAllocInfo.HEATH++; - - return( (bddheath *)autallocheap( sizeof( bddheath ) ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Hash Node | -| | -\------------------------------------------------------------*/ - -bddhnode *allocbddhnode( Number ) - - long Number; -{ - BddAllocInfo.HASH_NODE += Number; - - return( (bddhnode *)autallocblock( sizeof( bddhnode ) * Number ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Hash Oper | -| | -\------------------------------------------------------------*/ - -bddhoper *allocbddhoper( Number ) - - long Number; -{ - BddAllocInfo.HASH_OPER += Number; - - return( (bddhoper *)autallocblock( sizeof( bddhoper ) * Number ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Hash Node Table | -| | -\------------------------------------------------------------*/ - -bddhnodetable *allocbddhnodetable() -{ - BddAllocInfo.HASH_NODE_TABLE++; - - return( (bddhnodetable *)autallocheap( sizeof( bddhnodetable ) ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Hash Oper Table | -| | -\------------------------------------------------------------*/ - -bddhopertable *allocbddhopertable() -{ - BddAllocInfo.HASH_OPER_TABLE++; - - return( (bddhopertable *)autallocblock( sizeof( bddhopertable ) ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Block | -| | -\------------------------------------------------------------*/ - -bddblock *allocbddblock() -{ - BddAllocInfo.BLOCK++; - - return( (bddblock *)autallocheap( sizeof( bddblock ) ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Node Block | -| | -\------------------------------------------------------------*/ - -bddnode *allocbddnodeblock( Number ) - - long Number; -{ - BddAllocInfo.NODE_BLOCK += Number; - - return( (bddnode *)autallocblock( sizeof( bddnode ) * Number ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Variable Node | -| | -\------------------------------------------------------------*/ - -bddvarnode *allocbddvarnode( Number ) - - long Number; -{ - BddAllocInfo.VAR_NODE += Number; - - return( (bddvarnode *)autallocblock( sizeof( bddvarnode ) * Number ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Index Node | -| | -\------------------------------------------------------------*/ - -bddindexnode *allocbddindexnode( Number ) - - long Number; -{ - BddAllocInfo.INDEX_NODE += Number; - - return( (bddindexnode *)autallocblock( sizeof( bddindexnode ) * Number ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Variable | -| | -\------------------------------------------------------------*/ - -bddvar *allocbddvar( Number ) - - long Number; -{ - BddAllocInfo.VAR += Number; - - return( (bddvar *)autallocblock( sizeof( bddvar ) * Number ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Index | -| | -\------------------------------------------------------------*/ - -bddindex *allocbddindex( Number ) - - long Number; -{ - BddAllocInfo.INDEX += Number; - - return( (bddindex *)autallocblock( sizeof( bddindex ) * Number ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Assoc | -| | -\------------------------------------------------------------*/ - -bddassoc *allocbddassoc() -{ - BddAllocInfo.ASSOC++; - - return( (bddassoc *)autallocheap( sizeof( bddassoc ) ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Assoc Node | -| | -\------------------------------------------------------------*/ - -bddassocnode *allocbddassocnode( Number ) - - long Number; -{ - BddAllocInfo.ASSOC_NODE += Number; - - return( (bddassocnode *)autallocblock( sizeof( bddassocnode ) * Number ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Name Input | -| | -\------------------------------------------------------------*/ - -bddnamein *allocbddnamein( Number ) - - long Number; -{ - BddAllocInfo.NAME_IN += Number; - - return( (bddnamein *)autallocblock( sizeof( bddnamein ) * Number ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Index Input | -| | -\------------------------------------------------------------*/ - -bddindex *allocbddindexin( Number ) - - long Number; -{ - BddAllocInfo.INDEX_IN += Number; - - return( (bddindex *)autallocblock( sizeof( bddindex ) * Number ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc System | -| | -\------------------------------------------------------------*/ - -bddsystem *allocbddsystem() -{ - BddAllocInfo.SYSTEM++; - - return( (bddsystem *)autallocblock( sizeof( bddsystem ) ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Circuit | -| | -\------------------------------------------------------------*/ - -bddcircuit *allocbddcircuit() -{ - BddAllocInfo.CIRCUIT++; - - return( (bddcircuit *)autallocblock( sizeof( bddcircuit ) ) ); -} - -/*------------------------------------------------------------\ -| | -| View Bdd Alloc Info | -| | -\------------------------------------------------------------*/ - -void viewbddallocinfo() -{ - fprintf( stdout, "--> BddAllocInfo\n" ); - fprintf( stdout, " CIRCUIT : %ld bytes\n", - BddAllocInfo.CIRCUIT * sizeof( bddcircuit ) ); - fprintf( stdout, " SYSTEM : %ld bytes\n", - BddAllocInfo.SYSTEM * sizeof( bddsystem ) ); - fprintf( stdout, " BLOCK : %ld bytes\n", - BddAllocInfo.BLOCK * sizeof( bddblock ) ); - fprintf( stdout, " NODE_BLOCK : %ld bytes\n", - BddAllocInfo.NODE_BLOCK * sizeof( bddnode ) ); - fprintf( stdout, " HASH_NODE_TABLE : %ld bytes\n", - BddAllocInfo.HASH_NODE_TABLE * sizeof( bddhnodetable ) ); - fprintf( stdout, " HASH_NODE : %ld bytes\n", - BddAllocInfo.HASH_NODE * sizeof( bddhnode ) ); - fprintf( stdout, " HASH_OPER_TABLE : %ld bytes\n", - BddAllocInfo.HASH_OPER_TABLE * sizeof( bddhopertable ) ); - fprintf( stdout, " HASH_OPER : %ld bytes\n", - BddAllocInfo.HASH_OPER * sizeof( bddhoper ) ); - fprintf( stdout, " VAR : %ld bytes\n", - BddAllocInfo.VAR * sizeof( bddvar ) ); - fprintf( stdout, " VAR_NODE : %ld bytes\n", - BddAllocInfo.VAR_NODE * sizeof( bddvarnode ) ); - fprintf( stdout, " INDEX_NODE : %ld bytes\n", - BddAllocInfo.INDEX_NODE * sizeof( bddindexnode ) ); - fprintf( stdout, " INDEX : %ld bytes\n", - BddAllocInfo.INDEX * sizeof( bddindex ) ); - fprintf( stdout, " ASSOC : %ld bytes\n", - BddAllocInfo.ASSOC * sizeof( bddassoc ) ); - fprintf( stdout, " ASSOC_NODE : %ld bytes\n", - BddAllocInfo.ASSOC_NODE * sizeof( bddassocnode ) ); - fprintf( stdout, " NAME_IN : %ld bytes\n", - BddAllocInfo.NAME_IN * sizeof( bddnamein ) ); - fprintf( stdout, " INDEX_IN : %ld bytes\n", - BddAllocInfo.INDEX_IN * sizeof( bddindex ) ); - fprintf( stdout, " HEATH : %ld bytes\n", - BddAllocInfo.HEATH * sizeof( bddheath ) ); - fprintf( stdout, " USER_FUNC : %ld bytes\n", - BddAllocInfo.USER_FUNC * sizeof( bdduserfunc ) ); - fprintf( stdout, "<-- BddAllocInfo\n" ); - -} diff --git a/alliance/src/bdd/src/bddalloc.h b/alliance/src/bdd/src/bddalloc.h deleted file mode 100644 index 13dff02a..00000000 --- a/alliance/src/bdd/src/bddalloc.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddalloc.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_ALLOC_H -# define BDD_ALLOC_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddapply.c b/alliance/src/bdd/src/bddapply.c deleted file mode 100644 index a56bca2b..00000000 --- a/alliance/src/bdd/src/bddapply.c +++ /dev/null @@ -1,499 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddapply.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddapply.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Apply Bdd Node Not | -| | -\------------------------------------------------------------*/ - -bddnode *loc_applybddnot( BddNode ) - - bddnode *BddNode; -{ - bddhoper *HashOper; - bddnode *BddNot; - - if ( BddNode == BddLocalSystem->ONE ) - { - return( BddLocalSystem->ZERO ); - } - - if ( BddNode == BddLocalSystem->ZERO ) - { - return( BddLocalSystem->ONE ); - } - - HashOper = searchbddhoper( BddLocalSystem->HASH_OPER, - ABL_NOT, BddNode, BddNode ); - - if ( HashOper != (bddhoper *)0 ) - { - return( incbddrefext( HashOper->FATHER ) ); - } - - BddNot = addbddnode( (bddsystem *)0, BddNode->INDEX, - decbddrefext( loc_applybddnot( BddNode->HIGH ) ), - decbddrefext( loc_applybddnot( BddNode->LOW ) ) ); - - addbddhoper( BddLocalSystem->HASH_OPER, - ABL_NOT, BddNode, BddNode, BddNot ); - - return( BddNot ); -} - -/*------------------------------------------------------------\ -| | -| Apply Bdd Not Node | -| | -\------------------------------------------------------------*/ - -bddnode *applybddnodenot( BddSystem, BddNode ) - - bddsystem *BddSystem; - bddnode *BddNode; -{ - setbddlocalsystem( BddSystem ); - - BddNode = loc_applybddnot( BddNode ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Local Apply Terminal Node | -| | -\------------------------------------------------------------*/ - -bddnode *loc_applybddterm( Oper, Index, BddNode ) - - long Oper; - bddindex Index; - bddnode *BddNode; -{ - if ( Index == BDD_INDEX_ONE ) - { - if ( Oper == ABL_OR ) - { - return( BddLocalSystem->ONE ); - } - - if ( ( Oper == ABL_NAND ) || - ( Oper == ABL_XOR ) ) - { - return( loc_applybddnot( BddNode ) ); - } - - if ( ( Oper == ABL_AND ) || - ( Oper == ABL_NXOR ) ) - { - return( incbddrefext( BddNode ) ); - } - - return( BddLocalSystem->ZERO ); - } - - if ( Oper == ABL_AND ) - { - return( BddLocalSystem->ZERO ); - } - - if ( ( Oper == ABL_NOR ) || - ( Oper == ABL_NXOR ) ) - { - return( loc_applybddnot( BddNode ) ); - } - - if ( ( Oper == ABL_OR ) || - ( Oper == ABL_XOR ) ) - { - return( incbddrefext( BddNode ) ); - } - - return( BddLocalSystem->ONE ); -} - -/*------------------------------------------------------------\ -| | -| Apply Bdd Terminal Node | -| | -\------------------------------------------------------------*/ - -bddnode *applybddnodeterm( BddSystem, Oper, Index, BddNode ) - - bddsystem *BddSystem; - long Oper; - bddindex Index; - bddnode *BddNode; -{ - checkbddoper( BddSystem, Oper, 1 ); - - BddNode = loc_applybddterm( Oper, Index, BddNode ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Local Apply Bdd Node | -| | -\------------------------------------------------------------*/ - -bddnode *loc_applybdd( Oper, BddNode1, BddNode2 ) - - long Oper; - bddnode *BddNode1; - bddnode *BddNode2; -{ - bddhoper *HashOper; - bddnode *BddNode; - bddnode *BddHigh; - bddnode *BddLow; - bddindex Index1; - bddindex Index2; - - Index1 = BddNode1->INDEX; - Index2 = BddNode2->INDEX; - - if ( ( Index1 < BDD_INDEX_MIN ) || - ( Index2 < BDD_INDEX_MIN ) ) - { - if ( ( Index1 < BDD_INDEX_MIN ) && - ( Index2 < BDD_INDEX_MIN ) ) - { - if ( Index1 != Index2 ) - { - if ( ( Oper == ABL_NAND ) || - ( Oper == ABL_OR ) || - ( Oper == ABL_XOR ) ) - { - return( BddLocalSystem->ONE ); - } - - return( BddLocalSystem->ZERO ); - } - - if ( Index1 == BDD_INDEX_ZERO ) - { - if ( ( Oper == ABL_NAND ) || - ( Oper == ABL_NOR ) || - ( Oper == ABL_NXOR ) ) - { - return( BddLocalSystem->ONE ); - } - - return( BddLocalSystem->ZERO ); - } - - if ( ( Oper == ABL_OR ) || - ( Oper == ABL_AND ) || - ( Oper == ABL_NXOR ) ) - { - return( BddLocalSystem->ONE ); - } - - return( BddLocalSystem->ZERO ); - } - - if ( Index1 < BDD_INDEX_MIN ) - { - return( loc_applybddterm( Oper, Index1, BddNode2 ) ); - } - - return( loc_applybddterm( Oper, Index2, BddNode1 ) ); - } - - HashOper = searchbddhoper( BddLocalSystem->HASH_OPER, - Oper, BddNode1, BddNode2 ); - - if ( HashOper != (bddhoper *)0 ) - { - return( incbddrefext( HashOper->FATHER ) ); - } - - if ( Index1 == Index2 ) - { - if ( BddNode1 == BddNode2 ) - { - if ( ( Oper == ABL_OR ) || - ( Oper == ABL_AND ) ) - { - return( incbddrefext( BddNode1 ) ); - } - - if ( ( Oper == ABL_NOR ) || - ( Oper == ABL_NAND ) ) - { - return( loc_applybddnot( BddNode1 ) ); - } - - if ( Oper == ABL_XOR ) - { - return( BddLocalSystem->ZERO ); - } - - return( BddLocalSystem->ONE ); - } - - BddHigh = loc_applybdd( Oper, BddNode1->HIGH, BddNode2->HIGH ); - BddLow = loc_applybdd( Oper, BddNode1->LOW , BddNode2->LOW ); - } - else - if ( BddLocalSystem->INDEX_TO_VAR[ Index1 ] > - BddLocalSystem->INDEX_TO_VAR[ Index2 ] ) - { - Index1 = Index2; - BddHigh = loc_applybdd( Oper, BddNode1, BddNode2->HIGH ); - BddLow = loc_applybdd( Oper, BddNode1, BddNode2->LOW ); - } - else - { - BddHigh = loc_applybdd( Oper, BddNode1->HIGH, BddNode2 ); - BddLow = loc_applybdd( Oper, BddNode1->LOW, BddNode2 ); - } - - BddNode = addbddnode( (bddsystem *)0, Index1, - decbddrefext( BddHigh ), - decbddrefext( BddLow ) ); - - addbddhoper( BddLocalSystem->HASH_OPER, - Oper, BddNode1, BddNode2, BddNode ); - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Apply Bdd Node | -| | -\------------------------------------------------------------*/ - -bddnode *applybddnode( BddSystem, Oper, BddNode1, BddNode2 ) - - bddsystem *BddSystem; - long Oper; - bddnode *BddNode1; - bddnode *BddNode2; -{ - setbddlocalsystem( BddSystem ); - - if ( isablunaryoper( Oper ) ) - { - bdderror( BDD_OPERATOR_ERROR, Oper ); - } - - BddNode1 = loc_applybdd( Oper, BddNode1, BddNode2 ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddNode1 ); -} - -/*------------------------------------------------------------\ -| | -| Local Apply Bdd Ite Node | -| | -\------------------------------------------------------------*/ - -bddnode *loc_applybddite( BddIf, BddThen, BddElse ) - - bddnode *BddIf; - bddnode *BddThen; - bddnode *BddElse; -{ - BddThen = loc_applybdd( ABL_AND, BddIf, BddThen ); - BddIf = loc_applybddnot( BddIf ); - BddElse = loc_applybdd( ABL_AND, - decbddrefext( BddIf ), BddElse ); - BddIf = loc_applybdd( ABL_OR , - decbddrefext( BddThen ), - decbddrefext( BddElse ) ); - return( BddIf ); -} - -/*------------------------------------------------------------\ -| | -| Apply Bdd Ite Node | -| | -\------------------------------------------------------------*/ - -bddnode *applybddnodeite( BddSystem, BddIf, BddThen, BddElse ) - - bddsystem *BddSystem; - bddnode *BddIf; - bddnode *BddThen; - bddnode *BddElse; -{ - setbddlocalsystem( BddSystem ); - - BddThen = loc_applybdd( ABL_AND, BddIf, BddThen ); - checkbddmaxnode( (bddsystem *)0, 1 ); - BddIf = loc_applybddnot( BddIf ); - checkbddmaxnode( (bddsystem *)0, 1 ); - BddElse = loc_applybdd( ABL_AND, - decbddrefext( BddIf ), - decbddrefext( BddElse ) ); - checkbddmaxnode( (bddsystem *)0, 1 ); - BddIf = loc_applybdd( ABL_OR , - decbddrefext( BddThen ), - decbddrefext( BddElse ) ); - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddIf ); -} - -/*------------------------------------------------------------\ -| | -| Apply List Node | -| | -\------------------------------------------------------------*/ - -bddnode *loc_applybddlist( Oper, BddList ) - - long Oper; - chain_list *BddList; -{ - bddnode *BddNode1; - bddnode *BddNode2; - - BddNode1 = (bddnode *)( BddList->DATA ); - BddNode2 = (bddnode *)( BddList->NEXT->DATA ); - - if ( BddList->NEXT->NEXT != (chain_list *)0 ) - { - BddNode2 = decbddrefext( loc_applybddlist( Oper, BddNode2 ) ); - } - - return( loc_applybdd( Oper, BddNode1, BddNode2 ) ); -} - -/*------------------------------------------------------------\ -| | -| Apply Bdd List Node | -| | -\------------------------------------------------------------*/ - -bddnode *applybddnodelist( BddSystem, Oper, BddList ) - - bddsystem *BddSystem; - long Oper; - chain_list *BddList; -{ - bddnode *BddNode; - - setbddlocalsystem( BddSystem ); - - if ( BddList == (chain_list *)0 ) - { - bdderror( BDD_BAD_LIST_ERROR, 0 ); - } - - if ( Oper == ABL_NOT ) - { - if ( BddList->NEXT != (chain_list *)0 ) - { - bdderror( BDD_OPERATOR_ERROR, Oper ); - } - - BddNode = (bddnode *)( BddList->DATA ); - BddNode = loc_applybddnot( BddNode ); - } - else - { - if ( ( isablunaryoper( Oper ) ) || - ( BddList->NEXT == (chain_list *)0 ) ) - { - bdderror( BDD_OPERATOR_ERROR, Oper ); - } - - if ( ( getabloperpolar( Oper ) == ABL_POLAR_POSITIVE ) || - ( BddList->NEXT->NEXT == (chain_list *)0 ) ) - { - BddNode = loc_applybddlist( Oper, BddList ); - } - else - { - Oper = getablopernot( Oper ); - BddNode = loc_applybddlist( Oper, BddList ); - BddNode = loc_applybddnot( decbddrefext( BddNode ) ); - } - } - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddNode ); -} diff --git a/alliance/src/bdd/src/bddapply.h b/alliance/src/bdd/src/bddapply.h deleted file mode 100644 index f02ef14e..00000000 --- a/alliance/src/bdd/src/bddapply.h +++ /dev/null @@ -1,82 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddapply.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_APPLY_H -# define BDD_APPLY_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - - extern bddnode * loc_applybdd __P((long Oper, bddnode *BddNode1, bddnode *BddNode2)); - extern bddnode * loc_applybddterm __P((long Oper, bddindex Index, bddnode *BddNode)); - extern bddnode * loc_applybddnot __P((bddnode *BddNode)); - extern bddnode * loc_applybddite __P((bddnode *BddIf, bddnode *BddThen, bddnode *BddElse)); - -# endif diff --git a/alliance/src/bdd/src/bddassoc.c b/alliance/src/bdd/src/bddassoc.c deleted file mode 100644 index 551c283b..00000000 --- a/alliance/src/bdd/src/bddassoc.c +++ /dev/null @@ -1,442 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddassoc.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddassoc.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - bddassoc *BddLocalAssoc = (bddassoc *)0; - bddassocnode *BddLocalAssocNode = (bddassocnode *)0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Add Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Add Bdd Association | -| | -\------------------------------------------------------------*/ - -bddassoc *addbddassoc( BddSystem ) - - bddsystem *BddSystem; -{ - bddassoc **PrevAssoc; - bddassoc *ScanAssoc; - bddassoc *BddAssoc; - bddshort AssocIdent; - - setbddlocalsystem( BddSystem ); - - ScanAssoc = BddLocalSystem->ASSOC; - PrevAssoc = &BddLocalSystem->ASSOC; - AssocIdent = 0; - - while ( ( ScanAssoc != (bddassoc *)0 ) && - ( ScanAssoc->IDENT > AssocIdent ) ) - { - if ( AssocIdent == BDD_MAX_SHORT ) - { - bdderror( BDD_NO_MORE_ASSOC_ERROR, 0 ); - } - - AssocIdent = AssocIdent + 1; - PrevAssoc = &ScanAssoc->NEXT; - ScanAssoc = ScanAssoc->NEXT; - } - - BddAssoc = allocbddassoc(); - - BddAssoc->ASSOC_NODE = allocbddassocnode( BddLocalSystem->MAX_VAR ); - BddAssoc->FIRST = BDD_MAX_VAR; - BddAssoc->LAST = BDD_MAX_VAR; - BddAssoc->IDENT = AssocIdent; - - BddAssoc->NEXT = ScanAssoc; - *PrevAssoc = BddAssoc; - - return( BddAssoc ); -} - -/*------------------------------------------------------------\ -| | -| Add Bdd Node In Association | -| | -\------------------------------------------------------------*/ - -bddassoc *addbddnodeassoc( BddSystem, BddAssoc, Variable, BddNode ) - - bddsystem *BddSystem; - bddassoc *BddAssoc; - bddvar Variable; - bddnode *BddNode; -{ - bddassocnode *BddAssocNode; - - checkbddvar( BddSystem, Variable, 1 ); - - BddAssocNode = BddAssoc->ASSOC_NODE; - - if ( BddAssocNode[ Variable ] != (bddnode *)0 ) - { - decbddrefext( BddAssocNode[ Variable ] ); - } - else - { - if ( ( BddAssoc->FIRST == BDD_MAX_VAR ) || - ( Variable < BddAssoc->FIRST ) ) BddAssoc->FIRST = Variable; - - if ( ( BddAssoc->LAST == BDD_MAX_VAR ) || - ( Variable > BddAssoc->LAST ) ) BddAssoc->LAST = Variable; - } - - BddAssocNode[ Variable ] = incbddrefext( BddNode ); - - if ( BddAssoc->CACHE ) - { - BddLocalSystem->ASSOC_RESET = 1; - } - - return( BddAssoc ); -} - -/*------------------------------------------------------------\ -| | -| Del Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Del Bdd Association | -| | -\------------------------------------------------------------*/ - -int delbddassoc( BddSystem, BddAssoc ) - - bddsystem *BddSystem; - bddassoc *BddAssoc; -{ - bddassoc **PrevAssoc; - bddassoc *ScanAssoc; - bddassocnode *BddAssocNode; - bddvar Variable; - - setbddlocalsystem( BddSystem ); - - PrevAssoc = &BddLocalSystem->ASSOC; - ScanAssoc = BddLocalSystem->ASSOC; - - while ( ScanAssoc != (bddassoc *)0 ) - { - if ( ScanAssoc == BddAssoc ) - { - *PrevAssoc = ScanAssoc->NEXT; - - BddAssocNode = BddAssoc->ASSOC_NODE; - - if ( BddAssoc->FIRST != BDD_MAX_VAR ) - { - for ( Variable = BddAssoc->FIRST; - Variable <= BddAssoc->LAST; - Variable++ ) - { - if ( BddAssocNode[ Variable ] != (bddnode *)0 ) - { - decbddrefext( BddAssocNode[ Variable ] ); - } - } - } - - if ( BddAssoc->CACHE ) - { - BddLocalSystem->ASSOC_RESET = 1; - } - - freebddassocnode( BddAssocNode ); - freebddassoc( BddAssoc ); - - return( 1 ); - } - - PrevAssoc = &ScanAssoc->NEXT; - ScanAssoc = ScanAssoc->NEXT; - } - - return( 0 ); -} - -/*------------------------------------------------------------\ -| | -| Reset Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Reset Bdd Association | -| | -\------------------------------------------------------------*/ - -void resetbddassoc( BddSystem, BddAssoc ) - - bddsystem *BddSystem; - bddassoc *BddAssoc; -{ - bddassocnode *BddAssocNode; - bddvar Variable; - - setbddlocalsystem( BddSystem ); - - BddAssocNode = BddAssoc->ASSOC_NODE; - - if ( BddAssoc->FIRST != BDD_MAX_VAR ) - { - for ( Variable = BddAssoc->FIRST; - Variable <= BddAssoc->LAST; - Variable++ ) - { - if ( BddAssocNode[ Variable ] != (bddnode *)0 ) - { - decbddrefext( BddAssocNode[ Variable ] ); - BddAssocNode[ Variable ] = (bddnode *)0; - } - } - - BddAssoc->FIRST = BDD_MAX_VAR; - BddAssoc->LAST = BDD_MAX_VAR; - - if ( BddAssoc->CACHE ) - { - BddLocalSystem->ASSOC_RESET = 1; - } - } -} - -/*------------------------------------------------------------\ -| | -| Del Bdd Node In Association | -| | -\------------------------------------------------------------*/ - -int delbddnodeassoc( BddSystem, BddAssoc, Variable ) - - bddsystem *BddSystem; - bddassoc *BddAssoc; - bddvar Variable; -{ - bddassocnode *BddAssocNode; - - checkbddvar( BddSystem, Variable, 1 ); - - BddAssocNode = BddAssoc->ASSOC_NODE; - - if ( BddAssocNode[ Variable ] != (bddnode *)0 ) - { - decbddrefext( BddAssocNode[ Variable ] ); - BddAssocNode[ Variable ] = (bddnode *)0; - - if ( BddAssoc->CACHE ) - { - BddLocalSystem->ASSOC_RESET = 1; - } - - if ( ( Variable == BddAssoc->FIRST ) && - ( Variable == BddAssoc->LAST ) ) - { - BddAssoc->FIRST = BDD_MAX_VAR; - BddAssoc->LAST = BDD_MAX_VAR; - - return( 1 ); - } - - if ( Variable == BddAssoc->FIRST ) - { - do - { - Variable = Variable + 1; - } - while ( BddAssocNode[ Variable ] == (bddnode *)0 ); - - BddAssoc->FIRST = Variable; - - return( 1 ); - } - - if ( Variable == BddAssoc->LAST ) - { - do - { - Variable = Variable - 1; - } - while ( BddAssocNode[ Variable ] == (bddnode *)0 ); - - BddAssoc->LAST = Variable; - - return( 1 ); - } - - return( 1 ); - } - - return( 0 ); -} - -/*------------------------------------------------------------\ -| | -| Destroy Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Destroy Bdd Association | -| | -\------------------------------------------------------------*/ - -void destroybddassoc( BddSystem ) - - bddsystem *BddSystem; -{ - bddassoc *BddAssoc; - bddassoc *DelAssoc; - - setbddlocalsystem( BddSystem ); - - BddAssoc = BddLocalSystem->ASSOC; - BddLocalSystem->ASSOC = (bddassoc *)0; - - while ( BddAssoc != (bddassoc *)0 ) - { - DelAssoc = BddAssoc; - BddAssoc = BddAssoc->NEXT; - - freebddassocnode( DelAssoc->ASSOC_NODE ); - freebddassoc( DelAssoc ); - } - - BddLocalSystem->ASSOC_RESET = 0; -} - -/*------------------------------------------------------------\ -| | -| View Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| View Bdd Association | -| | -\------------------------------------------------------------*/ - -void viewbddassoc( BddSystem, BddAssoc, FuncView ) - - bddsystem *BddSystem; - bddassoc *BddAssoc; - void (*FuncView)(); -{ - bddassocnode *BddAssocNode; - bddvar Variable; - - if ( BddSystem == (bddsystem *)0 ) - { - BddSystem = BddLocalSystem; - } - - fprintf( stdout, "--> BddAssoc\n" ); - fprintf( stdout, " FIRST : %ld\n", (long)BddAssoc->FIRST ); - fprintf( stdout, " LAST : %ld\n", (long)BddAssoc->LAST ); - fprintf( stdout, " IDENT : %ld\n", (long)BddAssoc->IDENT ); - fprintf( stdout, " CACHE : %ld\n", (long)BddAssoc->CACHE ); - - if ( BddAssoc->FIRST != BDD_MAX_VAR ) - { - BddAssocNode = BddAssoc->ASSOC_NODE; - - for ( Variable = BddAssoc->FIRST; - Variable <= BddAssoc->LAST; - Variable = Variable + 1 ) - { - if ( BddAssocNode[ Variable ] != (bddnode *)0 ) - { - fprintf( stdout, " ASSOC_NODE[ %ld ] : ", (long)Variable ); - - if ( FuncView ) - { - (*FuncView)( Variable, BddAssocNode[ Variable ] ); - } - else - { - fprintf( stdout, "\n" ); - } - } - } - } - - fprintf( stdout, "<-- BddAssoc\n" ); -} diff --git a/alliance/src/bdd/src/bddassoc.h b/alliance/src/bdd/src/bddassoc.h deleted file mode 100644 index fd00b7cc..00000000 --- a/alliance/src/bdd/src/bddassoc.h +++ /dev/null @@ -1,81 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddassoc.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_ASSOC_H -# define BDD_ASSOC_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - extern bddassoc *BddLocalAssoc; - extern bddassocnode *BddLocalAssocNode; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddblock.c b/alliance/src/bdd/src/bddblock.c deleted file mode 100644 index 64d2190a..00000000 --- a/alliance/src/bdd/src/bddblock.c +++ /dev/null @@ -1,246 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddblock.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include -# include -# include - -# include "bddblock.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Add Block | -| | -\------------------------------------------------------------*/ - -bddblock *addbddblock( BddSystem ) - - bddsystem *BddSystem; -{ - bddblock *BddBlock; - - setbddlocalsystem( BddSystem ); - - BddBlock = allocbddblock(); - BddBlock->NEXT = BddLocalSystem->BLOCK; - BddLocalSystem->BLOCK = BddBlock; - - BddBlock->NODE = allocbddnodeblock( BDD_NODE_BLOCK_SIZE ); - BddBlock->NODE_FREE = BDD_NODE_BLOCK_SIZE; - - return( BddBlock ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Create Block | -| | -\------------------------------------------------------------*/ - -bddblock *createbddblock( BddSystem ) - - bddsystem *BddSystem; -{ - return( addbddblock( BddSystem ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Reset Block | -| | -\------------------------------------------------------------*/ - -void resetbddblock( BddSystem ) - - bddsystem *BddSystem; -{ - bddblock *BddBlock; - bddnode **PrevNode; - bddnode *ScanNode; - long Counter; - - setbddlocalsystem( BddSystem ); - - BddBlock = BddLocalSystem->BLOCK; - PrevNode = &BddLocalSystem->NODE_FREE; - - for ( BddBlock = BddLocalSystem->BLOCK; - BddBlock != (bddblock *)0; - BddBlock = BddBlock->NEXT ) - { - ScanNode = BddBlock->NODE; - - memset( (void *)ScanNode, 0, - (size_t)BDD_NODE_BLOCK_SIZE * sizeof( bddnode ) ); - - for ( Counter = 0; Counter < BDD_NODE_BLOCK_SIZE; Counter++ ) - { - *PrevNode = ScanNode; - PrevNode = &ScanNode->HIGH; - ScanNode = ScanNode + 1; - } - - BddBlock->NODE_FREE = 0; - BddLocalSystem->NUMBER_FREE += BDD_NODE_BLOCK_SIZE; - } - - *PrevNode = (bddnode *)0; - - BddLocalSystem->NUMBER_NODE = 0; -} - -/*------------------------------------------------------------\ -| | -| Bdd Destroy Block | -| | -\------------------------------------------------------------*/ - -void destroybddblock( BddSystem ) - - bddsystem *BddSystem; -{ - bddblock *BddBlock; - bddblock *DelBddBlock; - - setbddlocalsystem( BddSystem ); - - BddBlock = BddLocalSystem->BLOCK; - - while ( BddBlock != (bddblock *)0 ) - { - DelBddBlock = BddBlock; - BddBlock = BddBlock->NEXT; - - freebddnodeblock( DelBddBlock->NODE ); - freebddblock( DelBddBlock ); - } - - BddLocalSystem->BLOCK = (bddblock *)0; - BddLocalSystem->NODE_FREE = (bddnode *)0; - BddLocalSystem->NUMBER_FREE = 0; - BddLocalSystem->NUMBER_NODE = 0; -} - -/*------------------------------------------------------------\ -| | -| Bdd View Block | -| | -\------------------------------------------------------------*/ - -void viewbddblock( BddSystem, FuncView ) - - bddsystem *BddSystem; - void (*FuncView)(); -{ - bddblock *BddBlock; - bddnode *ScanNode; - long Counter; - long NumberBlock; - long NumberNode; - - if ( BddSystem == (bddsystem *)0 ) - { - BddSystem = BddLocalSystem; - } - - fprintf( stdout, "--> BlockNodeTable\n" ); - - fprintf( stdout, " NUMBER_FREE : %ld\n", BddSystem->NUMBER_FREE ); - - NumberBlock = 0; - - for ( BddBlock = BddLocalSystem->BLOCK; - BddBlock != (bddblock *)0; - BddBlock = BddBlock->NEXT ) - { - fprintf( stdout, "--> BLOCK_NODE[ %ld ]\n", NumberBlock ); - - ScanNode = BddBlock->NODE; - NumberNode = 0; - - for ( Counter = 0; Counter < BDD_NODE_BLOCK_SIZE; Counter++ ) - { - if ( ScanNode[ Counter ].LOW != (bddnode *)0 ) - { - NumberNode = NumberNode + 1; - - if ( FuncView ) (*FuncView)( ScanNode[ Counter ] ); - } - } - - fprintf( stdout, " NUMBER_NODE : %ld\n", NumberNode ); - fprintf( stdout, "<-- BLOCK_NODE[ %ld ]\n", NumberBlock ); - - NumberBlock = NumberBlock + 1; - } - - fprintf( stdout, " NUMBER_BLOCK : %ld\n", NumberBlock ); - fprintf( stdout, "<-- BlockNodeTable\n" ); -} diff --git a/alliance/src/bdd/src/bddblock.h b/alliance/src/bdd/src/bddblock.h deleted file mode 100644 index 11fc42cd..00000000 --- a/alliance/src/bdd/src/bddblock.h +++ /dev/null @@ -1,79 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddblock.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_BLOCK_H -# define BDD_BLOCK_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -# define BDD_NODE_BLOCK_SIZE 1024 - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddcheck.c b/alliance/src/bdd/src/bddcheck.c deleted file mode 100644 index 81083586..00000000 --- a/alliance/src/bdd/src/bddcheck.c +++ /dev/null @@ -1,262 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddcheck.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddcheck.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Check Bdd Variable | -| | -\------------------------------------------------------------*/ - -int checkbddvar( BddSystem, Variable, Severity ) - - bddsystem *BddSystem; - bddvar Variable; - int Severity; -{ - setbddlocalsystem( BddSystem ); - - if ( Variable >= BddLocalSystem->NUMBER_VAR ) - { - if ( Severity ) - { - bdderror( BDD_BAD_VAR_ERROR, Variable ); - } - - return( 0 ); - } - - return( 1 ); -} - -/*------------------------------------------------------------\ -| | -| Check Bdd Index | -| | -\------------------------------------------------------------*/ - -int checkbddindex( BddSystem, Index, Severity ) - - bddsystem *BddSystem; - bddindex Index; - int Severity; -{ - setbddlocalsystem( BddSystem ); - - if ( ( Index < BDD_INDEX_MIN ) || - ( Index >= BddLocalSystem->NUMBER_INDEX ) ) - { - if ( Severity ) - { - bdderror( BDD_BAD_INDEX_ERROR, Index ); - } - - return( 0 ); - } - - return( 1 ); -} - -/*------------------------------------------------------------\ -| | -| Check Bdd Operator | -| | -\------------------------------------------------------------*/ - -int checkbddoper( BddSystem, Oper, Severity ) - - bddsystem *BddSystem; - long Oper; - int Severity; -{ - setbddlocalsystem( BddSystem ); - - if ( ( Oper < 0 ) || - ( Oper >= ABL_NXOR ) ) - { - if ( Severity ) - { - bdderror( BDD_OPERATOR_ERROR, Oper ); - } - - return( 0 ); - } - - return( 1 ); -} - -/*------------------------------------------------------------\ -| | -| Check Bdd Assoc | -| | -\------------------------------------------------------------*/ - -int checkbddassoc( BddSystem, BddAssoc, Severity ) - - bddsystem *BddSystem; - bddassoc *BddAssoc; - int Severity; -{ - setbddlocalsystem( BddSystem ); - - if ( BddLocalSystem->ASSOC_RESET ) - { - resetbddhopertable( BddLocalSystem->HASH_OPER ); - } - - if ( ( BddAssoc->FIRST == BDD_MAX_VAR ) && - ( BddAssoc->LAST == BDD_MAX_VAR ) ) - { - return( 2 ); - } - - if ( BddAssoc->FIRST >= BDD_MAX_VAR ) - { - if ( Severity ) - { - bdderror( BDD_BAD_ASSOC_ERROR, BddAssoc->FIRST ); - } - - return( 0 ); - } - - if ( BddAssoc->LAST >= BDD_MAX_VAR ) - { - if ( Severity ) - { - bdderror( BDD_BAD_ASSOC_ERROR, BddAssoc->LAST ); - } - - return( 0 ); - } - - return( 1 ); -} - -/*------------------------------------------------------------\ -| | -| Check Bdd Max Node | -| | -\------------------------------------------------------------*/ - -int checkbddmaxnode( BddSystem, Severity ) - - bddsystem *BddSystem; - int Severity; -{ - long ReorderLimit; - long FirstNumberNode; - - setbddlocalsystem( BddSystem ); - - if ( IsBddSystemReorderOn( BddLocalSystem ) ) - { - if ( ( BddLocalSystem->NUMBER_NODE > BddLocalSystem->MAX_NODE ) || - ( BddLocalSystem->NUMBER_NODE > BddLocalSystem->REORDER_LIMIT ) ) - { - FirstNumberNode = BddLocalSystem->NUMBER_NODE; - - SetBddSystemReorder( BddLocalSystem ); - - BddLocalSystem->REORDER_FUNC( (bddsystem *)0 ); - - if ( ! IsBddSystemNoWarning( BddLocalSystem ) ) - { - bddwarning( BDD_DYNAMIC_REORDER_WARNING, - FirstNumberNode, BddLocalSystem->NUMBER_NODE ); - } - - ReorderLimit = ( BddLocalSystem->NUMBER_NODE * - BddLocalSystem->REORDER_RATIO ) / 100; - - if ( ReorderLimit < BddLocalSystem->REORDER_LOW ) - { - BddLocalSystem->REORDER_LIMIT = BddLocalSystem->REORDER_LOW; - } - else - { - BddLocalSystem->REORDER_LIMIT = ReorderLimit; - } - } - } - - if ( BddLocalSystem->NUMBER_NODE > BddLocalSystem->MAX_NODE ) - { - if ( Severity ) - { - bdderror( BDD_MAX_NODE_ERROR, BddLocalSystem->NUMBER_NODE ); - } - - return( 0 ); - } - - return( 1 ); -} diff --git a/alliance/src/bdd/src/bddcheck.h b/alliance/src/bdd/src/bddcheck.h deleted file mode 100644 index 6cc71901..00000000 --- a/alliance/src/bdd/src/bddcheck.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddcheck.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_CHECK_H -# define BDD_CHECK_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddcircuit.c b/alliance/src/bdd/src/bddcircuit.c deleted file mode 100644 index 46ee96f7..00000000 --- a/alliance/src/bdd/src/bddcircuit.c +++ /dev/null @@ -1,983 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddcircuit.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include -# include "bddcircuit.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - bddcircuit *BddLocalCircuit = (bddcircuit *)0; - -/*------------------------------------------------------------\ -| | -| Private Variables | -| | -\------------------------------------------------------------*/ - - static char BddStableName[ 512 ]; - static authtable *BddHashStable = (authtable *)0; - static authtable *BddHashInvStable = (authtable *)0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Get Bdd Stable Name | -| | -\------------------------------------------------------------*/ - -char *loc_getbddstablename( Name ) - - char *Name; -{ - authelem *Element; - char *StableName; - - if ( BddHashStable == (authtable *)0 ) - { - BddHashStable = createauthtable( 100 ); - BddHashInvStable = createauthtable( 100 ); - } - - Element = searchauthelem( BddHashStable, Name ); - - if ( Element == (authelem *)0 ) - { - sprintf( BddStableName, "%s'stable", Name ); - StableName = namealloc( BddStableName ); - - Element = addauthelem( BddHashInvStable, StableName, (long)Name ); - Element = addauthelem( BddHashStable , Name, (long)StableName ); - } - - return( (char *)( Element->VALUE ) ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Stable Name | -| | -\------------------------------------------------------------*/ - -char *getbddstablename( Name ) - - char *Name; -{ - return( loc_getbddstablename( namealloc( Name ) ) ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Input Name | -| | -\------------------------------------------------------------*/ - -char *getbddcircuitinname( BddCircuit, BddIndex ) - - bddcircuit *BddCircuit; - bddindex BddIndex; -{ - char *Name; - int Index; - - setbddlocalcircuit( BddCircuit ); - - checkbddindex( BddLocalSystem, BddIndex, 1 ); - - Index = BddLocalCircuit->INDEX_IN[ BddIndex - BDD_INDEX_MIN ]; - Name = BddLocalCircuit->NAME_IN[ Index ]; - - return( Name ); -} - -/*------------------------------------------------------------\ -| | -| Local Bdd Is Stable Name | -| | -\------------------------------------------------------------*/ - -char *loc_isbddstablename( StableName ) - - char *StableName; -{ - authelem *Element; - - if ( BddHashStable == (authtable *)0 ) - { - return( (char *)0 ); - } - - Element = searchauthelem( BddHashInvStable, StableName ); - - if ( Element == (authelem *)0 ) - { - return( (char *)0 ); - } - - return( (char *)( Element->VALUE ) ); -} - -/*------------------------------------------------------------\ -| | -| Is Bdd Stable Name | -| | -\------------------------------------------------------------*/ - -char *isbddstablename( StableName ) - - char *StableName; -{ - return( loc_isbddstablename( namealloc( StableName ) ) ); -} - - -/*------------------------------------------------------------\ -| | -| Bdd Create Circuit | -| | -\------------------------------------------------------------*/ - -bddcircuit *createbddcircuit( Name, NumberIn, NumberOut, BddSystem ) - - char *Name; - long NumberIn; - long NumberOut; - bddsystem *BddSystem; -{ - bddcircuit *BddCircuit; - - setbddlocalsystem( BddSystem ); - - BddCircuit = allocbddcircuit(); - - BddCircuit->NAME = namealloc( Name ); - BddCircuit->HASH_IN = createauthtable( NumberIn << 1 ); - BddCircuit->HASH_OUT = createauthtable( NumberOut << 1 ); - BddCircuit->NAME_IN = allocbddnamein( NumberIn ); - BddCircuit->NAME_IN_SIZE = NumberIn; - BddCircuit->INDEX_IN = allocbddindexin( NumberIn ); - BddCircuit->INDEX_IN_SIZE = NumberIn; - BddCircuit->BDD_SYSTEM = BddLocalSystem; - - BddLocalCircuit = BddCircuit; - - return( BddCircuit ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Reset Circuit | -| | -\------------------------------------------------------------*/ - -void resetbddcircuit( BddCircuit ) - - bddcircuit *BddCircuit; -{ - setbddlocalcircuit( BddCircuit ); - - resetauthtable( BddLocalCircuit->HASH_IN ); - resetauthtable( BddLocalCircuit->HASH_OUT ); - - memset( (void *)BddLocalCircuit->NAME_IN, 0, - (size_t)BddLocalCircuit->NAME_IN_SIZE * sizeof( bddnamein ) ); - - memset( (void *)BddLocalCircuit->INDEX_IN, 0, - (size_t)BddLocalCircuit->INDEX_IN_SIZE * sizeof( bddindex ) ); - - BddLocalCircuit->NUMBER_NAME_IN = 0; - BddLocalCircuit->NUMBER_NAME_OUT = 0; -} - -/*------------------------------------------------------------\ -| | -| Bdd Destroy Circuit | -| | -\------------------------------------------------------------*/ - -void destroybddcircuit( BddCircuit ) - - bddcircuit *BddCircuit; -{ - setbddlocalcircuit( BddCircuit ); - - destroyauthtable( BddLocalCircuit->HASH_IN ); - destroyauthtable( BddLocalCircuit->HASH_OUT ); - - freebddnamein( BddLocalCircuit->NAME_IN ); - freebddindexin( BddLocalCircuit->INDEX_IN ); - - freebddcircuit( BddLocalCircuit ); - - BddLocalCircuit = (bddcircuit *)0; -} - -/*------------------------------------------------------------\ -| | -| Bdd Input Circuit | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Search Input Circuit | -| | -\------------------------------------------------------------*/ - -bddnode *searchbddcircuitin( BddCircuit, InputName ) - - bddcircuit *BddCircuit; - char *InputName; -{ - authelem *Element; - - setbddlocalcircuit( BddCircuit ); - - if ( InputName != (char *)0 ) - { - InputName = namealloc( InputName ); - Element = searchauthelem( BddLocalCircuit->HASH_IN, InputName ); - - if ( Element != (authelem *)0 ) - { - return( (bddnode *)Element->VALUE ); - } - } - - return( (bddnode *)0 ); -} - -/*------------------------------------------------------------\ -| | -| Add Circuit Input | -| | -\------------------------------------------------------------*/ - -bddnode *addbddcircuitin( BddCircuit, InputName, Index, Mode ) - - bddcircuit *BddCircuit; - char *InputName; - bddindex Index; - long Mode; -{ - char **NameIn; - bddindex *IndexIn; - authelem *Element; - bddnode *BddNode; - long NameInSize; - long NumberNameIn; - long IndexInSize; - - setbddlocalcircuit( BddCircuit ); - setbddlocalsystem( BddLocalCircuit->BDD_SYSTEM ); - - BddNode = (bddnode *)0; - InputName = namealloc( InputName ); - Element = searchauthelem( BddLocalCircuit->HASH_IN, InputName ); - - if ( Element != (authelem *)0 ) - { - return( (bddnode *)Element->VALUE ); - } - - if ( Mode & BDD_IN_MODE_IMPOSE ) - { - if ( checkbddindex( (bddsystem *)0, Index, 0 ) ) - { - BddNode = getbddvarnodebyindex( (bddsystem *)0, Index ); - } - else - { - Mode &= ~BDD_IN_MODE_IMPOSE; - } - } - - if ( ! ( Mode & BDD_IN_MODE_IMPOSE ) ) - { - switch ( Mode ) - { - case BDD_IN_MODE_FIRST : BddNode = addbddvarfirst( (bddsystem *)0 ); - break; - - case BDD_IN_MODE_LAST : BddNode = addbddvarlast( (bddsystem *)0 ); - break; - - case BDD_IN_MODE_BEFORE : BddNode = addbddvarbefore( (bddsystem *)0, Index ); - break; - - case BDD_IN_MODE_AFTER : BddNode = addbddvarafter( (bddsystem *)0, Index ); - break; - - default : bdderror( BDD_UNKNOWN_IN_MODE_ERROR, Mode ); - } - } - - addauthelem( BddLocalCircuit->HASH_IN, InputName, (long)BddNode ); - - NumberNameIn = BddLocalCircuit->NUMBER_NAME_IN; - NameIn = BddLocalCircuit->NAME_IN; - NameInSize = BddLocalCircuit->NAME_IN_SIZE; - - if ( NumberNameIn >= NameInSize ) - { - NameIn = resizebddnamein( NameIn, NameInSize, ( NameInSize << 1 ) ); - - BddLocalCircuit->NAME_IN = NameIn; - BddLocalCircuit->NAME_IN_SIZE = NameInSize << 1; - } - - NameIn[ NumberNameIn ] = InputName; - BddLocalCircuit->NUMBER_NAME_IN++; - - IndexIn = BddLocalCircuit->INDEX_IN; - IndexInSize = BddLocalCircuit->INDEX_IN_SIZE; - Index = BddNode->INDEX - BDD_INDEX_MIN; - - if ( Index >= IndexInSize ) - { - IndexIn = resizebddindexin( IndexIn, IndexInSize, (long)( Index ) << 1 ); - - BddLocalCircuit->INDEX_IN = IndexIn; - BddLocalCircuit->INDEX_IN_SIZE = (long)( Index ) << 1; - } - - IndexIn[ Index ] = (bddindex)NumberNameIn; - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Rename Input Circuit | -| | -\------------------------------------------------------------*/ - -bddnode *renamebddcircuitin( BddCircuit, InputName, NewName ) - - bddcircuit *BddCircuit; - char *InputName; - char *NewName; -{ - authelem *Element1; - authelem *Element2; - bddnode *BddNode; - char **NameIn; - bddindex *IndexIn; - bddindex Index; - - setbddlocalcircuit( BddCircuit ); - - InputName = namealloc( InputName ); - NewName = namealloc( NewName ); - - Element1 = searchauthelem( BddLocalCircuit->HASH_IN, InputName ); - Element2 = searchauthelem( BddLocalCircuit->HASH_IN, NewName ); - - if ( ( Element1 != (authelem *)0 ) && - ( Element2 == (authelem *)0 ) ) - { - BddNode = (bddnode *)Element1->VALUE; - - delauthelem( BddLocalCircuit->HASH_IN, InputName ); - addauthelem( BddLocalCircuit->HASH_IN, NewName, (long)BddNode ); - - NameIn = BddLocalCircuit->NAME_IN; - IndexIn = BddLocalCircuit->INDEX_IN; - Index = BddNode->INDEX - BDD_INDEX_MIN; - - NameIn[ IndexIn[ Index ] ] = NewName; - - return( BddNode ); - } - - return( (bddnode *)0 ); -} - -/*------------------------------------------------------------\ -| | -| Add Circuit Auxiliary Signal | -| | -\------------------------------------------------------------*/ - -bddnode *addbddcircuitaux( BddCircuit, InputName, BddAux, UserFunc, Mode ) - - bddcircuit *BddCircuit; - char *InputName; - bddnode *BddAux; - int (*UserFunc)(); - long Mode; -{ - char **NameIn; - bddindex *IndexIn; - bddindex Index; - authelem *Element; - bddnode *BddNode; - long NameInSize; - long NumberNameIn; - long IndexInSize; - - setbddlocalcircuit( BddCircuit ); - - BddNode = (bddnode *)0; - InputName = namealloc( InputName ); - Element = searchauthelem( BddLocalCircuit->HASH_IN, InputName ); - - if ( Element != (authelem *)0 ) - { - bdderror( BDD_BAD_IN_ERROR, InputName ); - } - - switch ( Mode ) - { - case BDD_AUX_MODE_SINGLE : - - BddNode = addbddvarauxsingle( (bddsystem *)0, BddAux ); - - break; - - case BDD_AUX_MODE_GLOBAL : - - BddNode = addbddvarauxglobal( (bddsystem *)0, BddAux, UserFunc ); - - break; - - default : bdderror( BDD_UNKNOWN_AUX_MODE_ERROR, Mode ); - } - - addbddcircuitout( (bddcircuit *)0, InputName, BddNode ); - addauthelem( BddLocalCircuit->HASH_IN, InputName, (long)BddAux ); - - NumberNameIn = BddLocalCircuit->NUMBER_NAME_IN; - NameIn = BddLocalCircuit->NAME_IN; - NameInSize = BddLocalCircuit->NAME_IN_SIZE; - - if ( NumberNameIn >= NameInSize ) - { - NameIn = resizebddnamein( NameIn, NameInSize, ( NameInSize << 1 ) ); - - BddLocalCircuit->NAME_IN = NameIn; - BddLocalCircuit->NAME_IN_SIZE = NameInSize << 1; - } - - NameIn[ NumberNameIn ] = InputName; - BddLocalCircuit->NUMBER_NAME_IN++; - - IndexIn = BddLocalCircuit->INDEX_IN; - IndexInSize = BddLocalCircuit->INDEX_IN_SIZE; - Index = BddAux->INDEX - BDD_INDEX_MIN; - - if ( Index >= IndexInSize ) - { - IndexIn = resizebddindexin( IndexIn, IndexInSize, (long)( Index ) << 1 ); - - BddLocalCircuit->INDEX_IN = IndexIn; - BddLocalCircuit->INDEX_IN_SIZE = (long)( Index ) << 1; - } - - IndexIn[ Index ] = (bddindex)NumberNameIn; - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Output Circuit | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Search Output Circuit | -| | -\------------------------------------------------------------*/ - -bddnode *searchbddcircuitout( BddCircuit, OutputName ) - - bddcircuit *BddCircuit; - char *OutputName; -{ - authelem *Element; - - setbddlocalcircuit( BddCircuit ); - - OutputName = namealloc( OutputName ); - Element = searchauthelem( BddLocalCircuit->HASH_OUT, OutputName ); - - if ( Element != (authelem *)0 ) - { - return( (bddnode *)Element->VALUE ); - } - - return( (bddnode *)0 ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Add Output Circuit | -| | -\------------------------------------------------------------*/ - -bddnode *addbddcircuitout( BddCircuit, OutputName, BddNode ) - - bddcircuit *BddCircuit; - char *OutputName; - bddnode *BddNode; -{ - authelem *Element; - - setbddlocalcircuit( BddCircuit ); - - OutputName = namealloc( OutputName ); - Element = searchauthelem( BddLocalCircuit->HASH_OUT, OutputName ); - - if ( Element != (authelem *)0 ) - { - decbddrefext( (bddnode *)Element->VALUE ); - Element->VALUE = (long)( BddNode ); - } - else - { - BddLocalCircuit->NUMBER_NAME_OUT++; - Element = addauthelem( BddLocalCircuit->HASH_OUT, OutputName, (long)BddNode ); - } - - return( incbddrefext( BddNode ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Del Output Circuit | -| | -\------------------------------------------------------------*/ - -int delbddcircuitout( BddCircuit, OutputName ) - - bddcircuit *BddCircuit; - char *OutputName; -{ - authelem *Element; - - setbddlocalcircuit( BddCircuit ); - - OutputName = namealloc( OutputName ); - Element = searchauthelem( BddLocalCircuit->HASH_OUT, OutputName ); - - if ( Element != (authelem *)0 ) - { - decbddrefext( (bddnode *)Element->VALUE ); - - BddLocalCircuit->NUMBER_NAME_OUT--; - - return( delauthelem( BddLocalCircuit->HASH_OUT, OutputName ) ); - } - - return( 0 ); -} - -/*------------------------------------------------------------\ -| | -| Local Add Circuit Abl | -| | -\------------------------------------------------------------*/ - -static bddnode *loc_addbddcircuitabl( Expr ) - - ablexpr *Expr; -{ - bddnode *BddNode; - bddnode *BddFirst; - char *AtomValue; - long Oper; - int Negative; - - if ( ABL_ATOM( Expr ) ) - { - AtomValue = ABL_ATOM_VALUE( Expr ); - - if ( AtomValue == ABL_ATOM_NAME_ONE ) - { - return( BddLocalSystem->ONE ); - } - - if ( AtomValue == ABL_ATOM_NAME_ZERO ) - { - return( BddLocalSystem->ZERO ); - } - - BddNode = searchbddcircuitin( (bddcircuit *)0, AtomValue ); - - if ( BddNode == (bddnode *)0 ) - { - BddNode = searchbddcircuitout( (bddcircuit *)0, AtomValue ); - - if ( BddNode == (bddnode *)0 ) - { - if ( AtomValue == ABL_ATOM_NAME_DC ) - { - return( BddLocalSystem->ZERO ); - } - else - { - BddNode = addbddcircuitin( (bddcircuit *)0, AtomValue, - (bddindex )0, BDD_IN_MODE_LAST ); - } - } - } - - return( incbddrefext( BddNode ) ); - } - - Oper = ABL_OPER( Expr ); - Expr = ABL_CDR( Expr ); - - if ( Oper == ABL_NOT ) - { - if ( ABL_CDR( Expr ) != (ablexpr *)0 ) - { - bdderror( BDD_OPERATOR_ERROR, Oper ); - } - - BddFirst = loc_addbddcircuitabl( ABL_CAR( Expr ) ); - BddNode = applybddnodenot( (bddsystem *)0, decbddrefext( BddFirst ) ); - - return( BddNode ); - } - - if ( Oper == ABL_STABLE ) - { - Expr = ABL_CAR( Expr ); - - if ( ! ABL_ATOM( Expr ) ) - { - bdderror( BDD_OPERATOR_ERROR, Oper ); - } - - AtomValue = ABL_ATOM_VALUE( Expr ); - BddFirst = searchbddcircuitin( (bddcircuit *)0, AtomValue ); - - if ( BddFirst == (bddnode *)0 ) - { - BddFirst = addbddcircuitin( (bddcircuit *)0, AtomValue, - (bddindex )0, BDD_IN_MODE_LAST ); - } - - AtomValue = loc_getbddstablename( AtomValue ); - BddNode = searchbddcircuitin( (bddcircuit *)0, AtomValue ); - - if ( BddNode == (bddnode *)0 ) - { - BddNode = addbddcircuitin( (bddcircuit *)0, AtomValue, - (bddindex )0, BDD_IN_MODE_LAST ); - } - - return( BddNode ); - } - - if ( ( isablunaryoper( Oper ) ) || - ( ABL_CDR( Expr ) == (ablexpr *)0 ) ) - { - bdderror( BDD_OPERATOR_ERROR, Oper ); - } - - if ( ( getabloperpolar( Oper ) == ABL_POLAR_POSITIVE ) || - ( ABL_CDDR( Expr ) == (ablexpr *)0 ) ) - { - Negative = 0; - } - else - { - Negative = 1; - Oper = getablopernot( Oper ); - } - - BddFirst = loc_addbddcircuitabl( ABL_CAR( Expr ) ); - - while ( ( Expr = ABL_CDR( Expr ) ) != (ablexpr *)0 ) - { - BddNode = loc_addbddcircuitabl( ABL_CAR( Expr ) ); - BddFirst = applybddnode( (bddsystem *)0, Oper, - decbddrefext( BddFirst ), - decbddrefext( BddNode ) ); - } - - if ( Negative ) - { - BddFirst = applybddnodenot( (bddsystem *)0, - decbddrefext( BddFirst ) ); - } - - return( BddFirst ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Add Abl Circuit | -| | -\------------------------------------------------------------*/ - -bddnode *addbddcircuitabl( BddCircuit, Expr ) - - bddcircuit *BddCircuit; - ablexpr *Expr; -{ - bddnode *BddNode; - - setbddlocalcircuit( BddCircuit ); - - BddNode = loc_addbddcircuitabl( Expr ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Stable Circuit Abl | -| | -\------------------------------------------------------------*/ - -void loc_stablebddcircuitabl( Expr ) - - ablexpr *Expr; -{ - char *Name; - - if ( ABL_ATOM( Expr ) ) - { - Name = loc_isbddstablename( ABL_ATOM_VALUE( Expr ) ); - - if ( Name != (char *)0 ) - { - ABL_CAR( Expr ) = addchain( (chain_list *)0, (void *)ABL_STABLE ); - addablhexpr( Expr, createablatom( Name ) ); - } - } - else - { - while ( ( Expr = ABL_CDR( Expr ) ) != (ablexpr *)0 ) - { - loc_stablebddcircuitabl( ABL_CAR( Expr ) ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Bdd Convert Circuit Abl | -| | -\------------------------------------------------------------*/ - -ablexpr *convertbddcircuitabl( BddCircuit, BddNode ) - - bddcircuit *BddCircuit; - bddnode *BddNode; -{ - ablexpr *Expr; - - setbddlocalcircuit( BddCircuit ); - - Expr = convertbddnodeabl( (bddsystem *)0, - BddLocalCircuit->NAME_IN, - BddLocalCircuit->INDEX_IN, BddNode ); - - loc_stablebddcircuitabl( Expr ); - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Convert Circuit Sum Abl | -| | -\------------------------------------------------------------*/ - -ablexpr *convertbddcircuitsumabl( BddCircuit, BddNode ) - - bddcircuit *BddCircuit; - bddnode *BddNode; -{ - ablexpr *Expr; - - setbddlocalcircuit( BddCircuit ); - - Expr = convertbddnodesumabl( (bddsystem *)0, - BddLocalCircuit->NAME_IN, - BddLocalCircuit->INDEX_IN, BddNode ); - - loc_stablebddcircuitabl( Expr ); - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Bdd View Circuit | -| | -\------------------------------------------------------------*/ - -void viewbddcircuit( BddCircuit, ViewName ) - - bddcircuit *BddCircuit; - char ViewName; -{ - bddnamein *NameIn; - long ScanName; - long NumberName; - - if ( BddCircuit == (bddcircuit *)0 ) - { - BddCircuit = BddLocalCircuit; - } - - fprintf( stdout, "--> BddCircuit\n" ); - - fprintf( stdout, " NAME : %s \n", BddCircuit->NAME ); - fprintf( stdout, " NAME_IN_SIZE : %ld\n", BddCircuit->NAME_IN_SIZE ); - fprintf( stdout, " NUMBER_NAME_IN : %ld\n", BddCircuit->NUMBER_NAME_IN ); - fprintf( stdout, " NUMBER_NAME_OUT : %ld\n", BddCircuit->NUMBER_NAME_OUT ); - - if ( ViewName ) - { - NameIn = BddCircuit->NAME_IN; - NumberName = BddCircuit->NUMBER_NAME_IN; - - for ( ScanName = 0; ScanName < NumberName; ScanName++ ) - { - fprintf( stdout," NAME_IN[ %ld ] = %s\n", ScanName, NameIn[ ScanName ] ); - } - } - - fprintf( stdout, " HASH_IN :\n" ); - viewauthtable( BddCircuit->HASH_IN, (void *)0 ); - fprintf( stdout, " HASH_OUT :\n" ); - viewauthtable( BddCircuit->HASH_OUT, (void *)0 ); - - fprintf( stdout, "<-- BddCircuit\n" ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Circuit Node Num | -| | -\------------------------------------------------------------*/ - -long getbddcircuitnumnode( BddCircuit ) - - bddcircuit *BddCircuit; -{ - authelem *Element; - long HashIndex; - bddnode *BddNode; - long NumNode; - - setbddlocalcircuit( BddCircuit ); - - NumNode = 0; - - for ( HashIndex = 0; HashIndex < BddLocalCircuit->HASH_OUT->TABLE_SIZE; HashIndex++ ) - { - Element = &BddLocalCircuit->HASH_OUT->TABLE[ HashIndex ]; - - if ( checkauthkey( Element->KEY, 0 ) ) - { - BddNode = (bddnode *)Element->VALUE; - NumNode += getbddnodenum( (bddsystem *)0, BddNode ); - } - } - return( NumNode ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Node Size | -| | -\------------------------------------------------------------*/ - -long getbddcircuitsize( BddCircuit ) - - bddcircuit *BddCircuit; -{ - authelem *Element; - long HashIndex; - bddnode *BddNode; - long SizeNode; - - setbddlocalcircuit( BddCircuit ); - - SizeNode = 0; - - for ( HashIndex = 0; HashIndex < BddLocalCircuit->HASH_OUT->TABLE_SIZE; HashIndex++ ) - { - Element = &BddLocalCircuit->HASH_OUT->TABLE[ HashIndex ]; - - if ( checkauthkey( Element->KEY, 0 ) ) - { - BddNode = (bddnode *)Element->VALUE; - SizeNode += getbddnodenum( (bddsystem *)0, BddNode ); - } - } - return( SizeNode ); -} diff --git a/alliance/src/bdd/src/bddcircuit.h b/alliance/src/bdd/src/bddcircuit.h deleted file mode 100644 index b3a07f32..00000000 --- a/alliance/src/bdd/src/bddcircuit.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddcircuit.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_CIRCUIT_H -# define BDD_CIRCUIT_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddcofactor.c b/alliance/src/bdd/src/bddcofactor.c deleted file mode 100644 index db698da5..00000000 --- a/alliance/src/bdd/src/bddcofactor.c +++ /dev/null @@ -1,175 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddcofactor.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddcofactor.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Cofactor Bdd Node | -| | -\------------------------------------------------------------*/ - -bddnode *loc_cofactorbdd( BddNode1, BddNode2 ) - - bddnode *BddNode1; - bddnode *BddNode2; -{ - bddhoper *HashOper; - bddnode *BddNode; - bddnode *BddHigh; - bddnode *BddLow; - bddindex Index1; - bddindex Index2; - - Index1 = BddNode1->INDEX; - Index2 = BddNode2->INDEX; - - if ( Index2 < BDD_INDEX_MIN ) - { - if ( Index2 == BDD_INDEX_ZERO ) - { - return( (bddnode *)0 ); - } - - return( incbddrefext( BddNode1 ) ); - } - - if ( Index1 < BDD_INDEX_MIN ) - { - return( BddNode1 ); - } - - HashOper = searchbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_COFACTOR, BddNode1, BddNode2 ); - - if ( HashOper != (bddhoper *)0 ) - { - return( incbddrefext( HashOper->FATHER ) ); - } - - if ( Index1 == Index2 ) - { - BddHigh = loc_cofactorbdd( BddNode1->HIGH, BddNode2->HIGH ); - BddLow = loc_cofactorbdd( BddNode1->LOW , BddNode2->LOW ); - } - else - if ( BddLocalSystem->INDEX_TO_VAR[ Index1 ] > - BddLocalSystem->INDEX_TO_VAR[ Index2 ] ) - { - Index1 = Index2; - BddHigh = loc_cofactorbdd( BddNode1, BddNode2->HIGH ); - BddLow = loc_cofactorbdd( BddNode1, BddNode2->LOW ); - } - else - { - BddHigh = loc_cofactorbdd( BddNode1->HIGH, BddNode2 ); - BddLow = loc_cofactorbdd( BddNode1->LOW , BddNode2 ); - } - - if ( BddHigh == (bddnode *)0 ) BddNode = BddLow; - else - if ( BddLow == (bddnode *)0 ) BddNode = BddHigh; - else - BddNode = addbddnode( (bddsystem *)0, Index1, - decbddrefext( BddHigh ), - decbddrefext( BddLow ) ); - - addbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_COFACTOR, - BddNode1, BddNode2, BddNode ); - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Cofact Bdd Node | -| | -\------------------------------------------------------------*/ - -bddnode *cofactorbddnode( BddSystem, BddNode1, BddNode2 ) - - bddsystem *BddSystem; - bddnode *BddNode1; - bddnode *BddNode2; -{ - setbddlocalsystem( BddSystem ); - - if ( BddNode2 == BddLocalSystem->ZERO ) - { - bdderror( BDD_BAD_INDEX_ERROR, BDD_INDEX_ZERO ); - } - - BddNode1 = loc_cofactorbdd( BddNode1, BddNode2 ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddNode1 ); -} diff --git a/alliance/src/bdd/src/bddcofactor.h b/alliance/src/bdd/src/bddcofactor.h deleted file mode 100644 index 2e22f65a..00000000 --- a/alliance/src/bdd/src/bddcofactor.h +++ /dev/null @@ -1,79 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddcofactor.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_COFACTOR_H -# define BDD_COFACTOR_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - - extern bddnode *loc_cofactorbdd(); - -# endif diff --git a/alliance/src/bdd/src/bddcompose.c b/alliance/src/bdd/src/bddcompose.c deleted file mode 100644 index c24df25e..00000000 --- a/alliance/src/bdd/src/bddcompose.c +++ /dev/null @@ -1,262 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddcompose.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddcompose.h" -# include "bddapply.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static bddvar BddLocalVariable = (bddvar )0; - static bddindex BddLocalIndex = (bddindex )0; - static bddnode *BddLocalNode = (bddnode *)0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Restrict Bdd Node | -| | -\------------------------------------------------------------*/ - -static bddnode *loc_restrictbdd( BddNode ) - - bddnode *BddNode; -{ - bddhoper *HashOper; - bddnode *BddRestrict; - bddvar Variable; - - Variable = BddLocalSystem->INDEX_TO_VAR[ BddNode->INDEX ]; - - if ( BddLocalVariable < Variable ) - { - return( incbddrefext( BddNode ) ); - } - - if ( BddLocalVariable == Variable ) - { - if ( BddLocalNode->INDEX == BDD_INDEX_ZERO ) - { - return( incbddrefext( BddNode->LOW ) ); - } - else - { - return( incbddrefext( BddNode->HIGH ) ); - } - } - - HashOper = searchbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_RESTRICT + BddLocalIndex, - BddNode, BddLocalNode ); - - if ( HashOper != (bddhoper *)0 ) - { - return( incbddrefext( HashOper->FATHER ) ); - } - - BddRestrict = addbddnode( (bddsystem *)0, BddNode->INDEX, - decbddrefext( loc_restrictbdd( BddNode->HIGH ) ), - decbddrefext( loc_restrictbdd( BddNode->LOW ) ) ); - - addbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_RESTRICT + BddLocalIndex, - BddNode, BddLocalNode, BddRestrict ); - - return( BddRestrict ); -} - -/*------------------------------------------------------------\ -| | -| Restrict Bdd Node | -| | -\------------------------------------------------------------*/ - -bddnode *restrictbddnode( BddSystem, BddNode, Variable, BddSubst ) - - bddsystem *BddSystem; - bddnode *BddNode; - bddvar Variable; - bddnode *BddSubst; -{ - checkbddvar( BddSystem, Variable, 1 ); - - if ( BddSubst->INDEX >= BDD_INDEX_MIN ) - { - bdderror( BDD_BAD_INDEX_ERROR, BddSubst->INDEX ); - } - - BddLocalIndex = BddLocalSystem->VAR_TO_INDEX[ Variable ]; - BddLocalVariable = Variable; - BddLocalNode = BddSubst; - - BddNode = loc_restrictbdd( BddNode ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Local Compose Bdd Node | -| | -\------------------------------------------------------------*/ - -static bddnode *loc_composebdd( BddNode, BddSubst ) - - bddnode *BddNode; - bddnode *BddSubst; -{ - bddhoper *HashOper; - bddnode *BddCompose; - bddnode *BddHigh; - bddnode *BddLow; - bddvar Variable; - bddindex IndexNode; - bddindex IndexSubst; - - if ( BddSubst->INDEX < BDD_INDEX_MIN ) - { - BddLocalNode = BddSubst; - - return( loc_restrictbdd( BddNode ) ); - } - - Variable = BddLocalSystem->INDEX_TO_VAR[ BddNode->INDEX ]; - - if ( BddLocalVariable < Variable ) - { - return( incbddrefext( BddNode ) ); - } - - HashOper = searchbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_COMPOSE + BddLocalIndex, - BddNode, BddSubst ); - - if ( HashOper != (bddhoper *)0 ) - { - return( incbddrefext( HashOper->FATHER ) ); - } - - if ( BddLocalVariable == Variable ) - { - BddCompose = loc_applybddite( BddSubst, BddNode->HIGH , BddNode->LOW ); - - return( BddCompose ); - } - - IndexNode = BddNode->INDEX; - IndexSubst = BddSubst->INDEX; - - if ( BddLocalSystem->INDEX_TO_VAR[ IndexNode ] > - BddLocalSystem->INDEX_TO_VAR[ IndexSubst ] ) - { - IndexNode = IndexSubst; - BddHigh = loc_composebdd( BddNode, BddSubst->HIGH ); - BddLow = loc_composebdd( BddNode, BddSubst->LOW ); - } - else - { - BddHigh = loc_composebdd( BddNode->HIGH, BddSubst ); - BddLow = loc_composebdd( BddNode->LOW, BddSubst ); - } - - BddCompose = addbddnode( (bddsystem *)0, IndexNode, - decbddrefext( BddHigh ), - decbddrefext( BddLow ) ); - - addbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_RESTRICT + BddLocalIndex, - BddNode, BddSubst, BddCompose ); - - return( BddCompose ); -} - -/*------------------------------------------------------------\ -| | -| Compose Bdd Node | -| | -\------------------------------------------------------------*/ - -bddnode *composebddnode( BddSystem, BddNode, Variable, BddSubst ) - - bddsystem *BddSystem; - bddnode *BddNode; - bddvar Variable; - bddnode *BddSubst; -{ - checkbddvar( BddSystem, Variable, 1 ); - - BddLocalVariable = Variable; - BddLocalIndex = BddLocalSystem->VAR_TO_INDEX[ Variable ]; - - BddNode = loc_composebdd( BddNode, BddSubst ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddNode ); -} diff --git a/alliance/src/bdd/src/bddcompose.h b/alliance/src/bdd/src/bddcompose.h deleted file mode 100644 index d2181abd..00000000 --- a/alliance/src/bdd/src/bddcompose.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddcompose.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_COMPOSE_H -# define BDD_COMPOSE_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddconvert.c b/alliance/src/bdd/src/bddconvert.c deleted file mode 100644 index 0b397e2f..00000000 --- a/alliance/src/bdd/src/bddconvert.c +++ /dev/null @@ -1,561 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddconvert.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddconvert.h" -# include "bddapply.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static char **BddConvertNameArray = (char **)0; - static bddindex *BddConvertIndexArray = (bddindex *)0; - static chain_list *BddConvertSumProd = (chain_list *)0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Convert Bdd Index Abl | -| | -\------------------------------------------------------------*/ - -static chain_list *loc_convertbddindex( Index ) - - bddindex Index; -{ - if ( Index < BDD_INDEX_MIN ) - { - if ( Index == BDD_INDEX_ZERO ) - { - return( createablatomzero() ); - } - - return( createablatomone() ); - } - - Index = Index - BDD_INDEX_MIN; - - if ( BddConvertIndexArray != (bddindex *)0 ) - { - Index = BddConvertIndexArray[ Index ]; - } - - return( createablatom( BddConvertNameArray[ Index ] ) ); -} - -/*------------------------------------------------------------\ -| | -| Convert Bdd Index Abl | -| | -\------------------------------------------------------------*/ - -chain_list *convertbddindexabl( BddSystem, NameArray, IndexArray, Index ) - - bddsystem *BddSystem; - char **NameArray; - bddindex *IndexArray; - bddindex Index; -{ - setbddlocalsystem( BddSystem ); - - BddConvertNameArray = NameArray; - BddConvertIndexArray = IndexArray; - - return( loc_convertbddindex( Index ) ); -} - -/*------------------------------------------------------------\ -| | -| Local Convert Bdd Mux Abl | -| | -\------------------------------------------------------------*/ - -static chain_list *loc_convertbddmux( Equation, BddHigh, BddLow ) - - chain_list *Equation; - bddnode *BddHigh; - bddnode *BddLow; -{ - bddnode *NodeAnd; - bddnode *NodeOr; - chain_list *EquationHigh; - chain_list *EquationLow; - bddindex IndexHigh; - bddindex IndexLow; - - IndexHigh = BddHigh->INDEX; - IndexLow = BddLow->INDEX; - - if ( ( IndexLow < BDD_INDEX_MIN ) || - ( IndexHigh < BDD_INDEX_MIN ) ) - { - if ( ( IndexLow < BDD_INDEX_MIN ) && - ( IndexHigh < BDD_INDEX_MIN ) ) - { - if ( IndexLow == BDD_INDEX_ONE ) - { - Equation = optimablnotexpr( Equation ); - } - - return( Equation ); - } - - if ( IndexLow == BDD_INDEX_ONE ) - { - Equation = optimablbinexpr( ABL_OR, - loc_convertbddnode( BddHigh ), - optimablnotexpr( Equation ) ); - } - else - if ( IndexLow == BDD_INDEX_ZERO ) - { - Equation = optimablbinexpr( ABL_AND, - loc_convertbddnode( BddHigh ), - Equation ); - } - else - if ( IndexHigh == BDD_INDEX_ONE ) - { - Equation = optimablbinexpr( ABL_OR, - loc_convertbddnode( BddLow ), - Equation ); - } - else - { - Equation = optimablbinexpr( ABL_AND, - loc_convertbddnode( BddLow ), - optimablnotexpr( Equation ) ); - } - - return( Equation ); - } - - NodeAnd = decbddrefext( loc_applybdd( ABL_AND, BddHigh, BddLow ) ); - - if ( NodeAnd->INDEX == BDD_INDEX_ZERO ) - { - NodeOr = decbddrefext( loc_applybdd( ABL_OR, BddHigh, BddLow ) ); - - if ( NodeOr->INDEX == BDD_INDEX_ONE ) - { - Equation = optimablbinexpr( ABL_XOR, - loc_convertbddnode( BddLow ), - Equation ); - return( Equation ); - } - } - - if ( NodeAnd == BddHigh ) - { - EquationLow = optimablbinexpr( ABL_AND, - loc_convertbddnode( BddLow ), - optimablnotexpr( Equation ) ); - - EquationHigh = loc_convertbddnode( BddHigh ); - } - else - if ( NodeAnd == BddLow ) - { - EquationLow = optimablbinexpr( ABL_AND, - loc_convertbddnode( BddHigh ), - Equation ); - - EquationHigh = loc_convertbddnode( BddLow ); - } - else - { - EquationLow = optimablbinexpr( ABL_AND, - loc_convertbddnode( BddLow ), - optimablnotexpr( dupablexpr( Equation ) ) ); - - EquationHigh = optimablbinexpr( ABL_AND, - loc_convertbddnode( BddHigh ), - Equation ); - } - - Equation = optimablbinexpr( ABL_OR, EquationLow, EquationHigh ); - - return( Equation ); -} - -/*------------------------------------------------------------\ -| | -| Convert Bdd Mux Abl | -| | -\------------------------------------------------------------*/ - -chain_list *convertbddmuxabl( BddSystem, NameArray, IndexArray, Equation, BddHigh, BddLow ) - - bddsystem *BddSystem; - char **NameArray; - bddindex *IndexArray; - chain_list *Equation; - bddnode *BddHigh; - bddnode *BddLow; -{ - setbddlocalsystem( BddSystem ); - - BddConvertNameArray = NameArray; - BddConvertIndexArray = IndexArray; - - return( loc_convertbddmux( Equation, BddHigh, BddLow ) ); -} - -/*------------------------------------------------------------\ -| | -| Convert Node In Abl | -| | -\------------------------------------------------------------*/ - -chain_list *loc_convertbddnode( BddNode ) - - bddnode *BddNode; -{ - chain_list *Equation; - chain_list *Atom; - bddnode *ScanNode; - bddindex IndexLow; - bddindex IndexHigh; - - if ( BddNode->INDEX == BDD_INDEX_ONE ) - { - return( createablatomone() ); - } - - if ( BddNode->INDEX == BDD_INDEX_ZERO ) - { - return( createablatomzero() ); - } - - IndexLow = BddNode->LOW->INDEX; - IndexHigh = BddNode->HIGH->INDEX; - - if ( ( IndexLow < BDD_INDEX_MIN ) || - ( IndexHigh < BDD_INDEX_MIN ) ) - { - Atom = loc_convertbddindex( BddNode->INDEX ); - - if ( ( IndexLow < BDD_INDEX_MIN ) && - ( IndexHigh < BDD_INDEX_MIN ) ) - { - if ( IndexLow == BDD_INDEX_ONE ) - { - Atom = optimablnotexpr( Atom ); - } - - return( Atom ); - } - - if ( IndexLow == BDD_INDEX_ONE ) - { - Equation = optimablbinexpr( ABL_OR, - loc_convertbddnode( BddNode->HIGH ), - optimablnotexpr( Atom ) ); - } - else - if ( IndexLow == BDD_INDEX_ZERO ) - { - Equation = optimablbinexpr( ABL_AND, - loc_convertbddnode( BddNode->HIGH ), - Atom ); - } - else - if ( IndexHigh == BDD_INDEX_ONE ) - { - Equation = optimablbinexpr( ABL_OR, - loc_convertbddnode( BddNode->LOW ), - Atom ); - } - else - { - Equation = optimablbinexpr( ABL_AND, - loc_convertbddnode( BddNode->LOW ), - optimablnotexpr( Atom ) ); - } - - return( Equation ); - } - - if ( ( BddNode->HIGH == BddNode->LOW->HIGH ) || - ( BddNode->HIGH == BddNode->LOW->LOW ) ) - { - Equation = createabloper( ABL_OR ); - - Atom = loc_convertbddindex( BddNode->INDEX ); - addablhexpr( Equation, Atom ); - - ScanNode = BddNode->LOW; - - do - { - Atom = loc_convertbddindex( ScanNode->INDEX ); - - if ( ScanNode->HIGH == BddNode->HIGH ) - { - ScanNode = ScanNode->LOW; - } - else - { - ScanNode = ScanNode->HIGH; - Atom = optimablnotexpr( Atom ); - } - - addablhexpr( Equation, Atom ); - } - while ( ( ScanNode->HIGH == BddNode->HIGH ) || - ( ScanNode->LOW == BddNode->HIGH ) ); - - Equation = loc_convertbddmux( Equation, BddNode->HIGH, ScanNode ); - - return( Equation ); - } - - if ( ( BddNode->LOW == BddNode->HIGH->HIGH ) || - ( BddNode->LOW == BddNode->HIGH->LOW ) ) - { - Equation = createabloper( ABL_AND ); - - Atom = loc_convertbddindex( BddNode->INDEX ); - addablhexpr( Equation, Atom ); - - ScanNode = BddNode->HIGH; - - do - { - Atom = loc_convertbddindex( ScanNode->INDEX ); - - if ( ScanNode->LOW == BddNode->LOW ) - { - ScanNode = ScanNode->HIGH; - } - else - { - ScanNode = ScanNode->LOW; - Atom = optimablnotexpr( Atom ); - } - - addablhexpr( Equation, Atom ); - } - while ( ( ScanNode->HIGH == BddNode->LOW ) || - ( ScanNode->LOW == BddNode->LOW ) ); - - Equation = loc_convertbddmux( Equation, ScanNode, BddNode->LOW ); - - return( Equation ); - } - - if ( ( IndexLow == IndexHigh ) && - ( BddNode->HIGH->HIGH == BddNode->LOW->LOW ) && - ( BddNode->HIGH->LOW == BddNode->LOW->HIGH ) ) - { - Equation = optimablbinexpr( ABL_XOR, - loc_convertbddindex( BddNode->INDEX ), - loc_convertbddindex( BddNode->LOW->INDEX ) ); - - Equation = loc_convertbddmux( Equation, BddNode->LOW->HIGH, BddNode->LOW->LOW ); - - return( Equation ); - } - - Atom = loc_convertbddindex( BddNode->INDEX ); - - Equation = loc_convertbddmux( Atom, BddNode->HIGH, BddNode->LOW ); - - return( Equation ); -} - -/*------------------------------------------------------------\ -| | -| Convert Bdd Node Abl | -| | -\------------------------------------------------------------*/ - -chain_list *convertbddnodeabl( BddSystem, NameArray, IndexArray, BddNode ) - - bddsystem *BddSystem; - char **NameArray; - bddindex *IndexArray; - bddnode *BddNode; -{ - setbddlocalsystem( BddSystem ); - - BddConvertNameArray = NameArray; - BddConvertIndexArray = IndexArray; - - return( loc_convertbddnode( BddNode ) ); -} - -/*------------------------------------------------------------\ -| | -| Local Convert Node In Sum of Product Abl | -| | -\------------------------------------------------------------*/ - -void loc_convertbddnodesum( BddNode, SumProd ) - - bddnode *BddNode; - chain_list *SumProd; -{ - chain_list *Equation; - bddindex IndexLow; - bddindex IndexHigh; - - IndexLow = BddNode->LOW->INDEX; - IndexHigh = BddNode->HIGH->INDEX; - - if ( ( IndexHigh == BDD_INDEX_ONE ) || - ( IndexLow == BDD_INDEX_ONE ) ) - { - Equation = loc_convertbddindex( BddNode->INDEX ); - - if ( IndexLow == BDD_INDEX_ONE ) - { - Equation = optimablnotexpr( Equation ); - } - - if ( SumProd != (chain_list *)0 ) - { - Equation = optimablbinexpr( ABL_AND, dupablexpr( SumProd ), Equation ); - } - - addablhexpr( BddConvertSumProd, Equation ); - } - - if ( IndexHigh >= BDD_INDEX_MIN ) - { - Equation = loc_convertbddindex( BddNode->INDEX ); - - if ( SumProd != (chain_list *)0 ) - { - Equation = optimablbinexpr( ABL_AND, dupablexpr( SumProd ), Equation ); - } - - loc_convertbddnodesum( BddNode->HIGH, Equation ); - - delablexpr( Equation ); - } - - if ( IndexLow >= BDD_INDEX_MIN ) - { - Equation = loc_convertbddindex( BddNode->INDEX ); - Equation = optimablnotexpr( Equation ); - - if ( SumProd != (chain_list *)0 ) - { - Equation = optimablbinexpr( ABL_AND, dupablexpr( SumProd ), Equation ); - } - - loc_convertbddnodesum( BddNode->LOW, Equation ); - - delablexpr( Equation ); - } -} - -/*------------------------------------------------------------\ -| | -| Convert Bdd Sum of Product Abl | -| | -\------------------------------------------------------------*/ - -chain_list *convertbddnodesumabl( BddSystem, NameArray, IndexArray, BddNode ) - - bddsystem *BddSystem; - char **NameArray; - bddindex *IndexArray; - bddnode *BddNode; -{ - chain_list *SumProd; - - setbddlocalsystem( BddSystem ); - - BddConvertNameArray = NameArray; - BddConvertIndexArray = IndexArray; - - if ( BddNode->INDEX == BDD_INDEX_ONE ) - { - return( createablatomone() ); - } - - if ( BddNode->INDEX == BDD_INDEX_ZERO ) - { - return( createablatomzero() ); - } - - BddConvertSumProd = createabloper( ABL_OR ); - - loc_convertbddnodesum( BddNode, (chain_list *)0 ); - - if ( ABL_CDDR( BddConvertSumProd ) == (chain_list *)0 ) - { - SumProd = ABL_CADR( BddConvertSumProd ); - ABL_CADR( BddConvertSumProd ) = (chain_list *)0; - - freeablexpr( BddConvertSumProd ); - BddConvertSumProd = SumProd; - } - - return( BddConvertSumProd ); -} diff --git a/alliance/src/bdd/src/bddconvert.h b/alliance/src/bdd/src/bddconvert.h deleted file mode 100644 index 6e3671e1..00000000 --- a/alliance/src/bdd/src/bddconvert.h +++ /dev/null @@ -1,79 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddconvert.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_CONVERT_H -# define BDD_CONVERT_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - - extern chain_list * loc_convertbddnode __P((bddnode *BddNode)); - -# endif diff --git a/alliance/src/bdd/src/bdddump.c b/alliance/src/bdd/src/bdddump.c deleted file mode 100644 index c01eb392..00000000 --- a/alliance/src/bdd/src/bdddump.c +++ /dev/null @@ -1,413 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bdddump.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include -# include -# include "bdddump.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static FILE *BddDumpFile = (FILE *)0; - static char BddDumpBuffer[ BDD_UNDUMP_BUFFER_SIZE ]; - static long BddDumpLine = 0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -static long loc_undumpbddhkey( Table, Key ) - - authtable *Table; - char *Key; -{ - return( ( (unsigned long)Key ) % Table->TABLE_SIZE ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Undump Get Line | -| | -\------------------------------------------------------------*/ - -static void loc_undumpbddgetline() -{ - char *Scan; - - while( fgets( BddDumpBuffer, BDD_UNDUMP_BUFFER_SIZE, BddDumpFile ) ) - { - Scan = strchr( BddDumpBuffer, '\n' ); - if ( Scan != (char *)0 ) - { - *Scan = '\0'; BddDumpLine++; - } - - if ( ( BddDumpBuffer[ 0 ] != '#' ) && - ( BddDumpBuffer[ 0 ] != '\0' ) ) - { - return; - } - } - - bdderror( BDD_UNDUMP_LINE_ERROR, BddDumpLine ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Undump Circuit | -| | -\------------------------------------------------------------*/ - -bddcircuit *undumpbddcircuit( BddSystem, FileName ) - - bddsystem *BddSystem; - char *FileName; -{ - bddcircuit *BddCircuit; - authtable *HashInput; - authtable *HashNode; - authelem *Element; - bddnode *BddNode; - bddnode *BddHigh; - bddnode *BddLow; - char *Name; - char *Scan; - int Value; - long Index; - long NumberIn; - long NumberOut; - long NumberNode; - long BddVar; - long ZeroAddr; - long OneAddr; - long NodeAddr; - long HighAddr; - long LowAddr; - - FileName = autbasename( FileName, "bdd" ); - BddDumpFile = mbkfopen( FileName, "bdd", "r" ); - BddDumpLine = 0; - - if ( BddDumpFile == (FILE *)0 ) - { - bdderror( BDD_UNDUMP_FILE_ERROR, FileName ); - } - - mbkfree( FileName ); - - loc_undumpbddgetline(); - Name = BddDumpBuffer + 9; - - loc_undumpbddgetline(); - Value = sscanf( BddDumpBuffer, ".port %ld %ld", &NumberIn, &NumberOut ); - if ( Value != 2 ) bdderror( BDD_UNDUMP_LINE_ERROR, BddDumpLine ); - - loc_undumpbddgetline(); - - BddCircuit = createbddcircuit( Name, NumberIn, NumberOut, BddSystem ); - HashInput = createauthtable( NumberIn + 1 ); - setauthfunc( HashInput, 0, loc_undumpbddhkey, 0 ); - - for ( Index = 0; Index < NumberIn; Index++ ) - { - loc_undumpbddgetline(); - - Value = 0; - Scan = strchr( BddDumpBuffer, ' ' ); - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - Value = sscanf( BddDumpBuffer, "%ld", &BddVar ); - Name = namealloc( Scan + 1 ); - } - - if ( Value != 1 ) bdderror( BDD_UNDUMP_LINE_ERROR, BddDumpLine ); - - BddNode = addbddcircuitin( (bddcircuit *)0, Name, 0, BDD_IN_MODE_LAST ); - - addauthelem( HashInput, (char *)BddVar + 2, (long)BddNode->INDEX ); - } - - loc_undumpbddgetline(); - Value = sscanf( BddDumpBuffer, ".node %ld %lX %lX", - &NumberNode, &ZeroAddr, &OneAddr ); - if ( Value != 3 ) bdderror( BDD_UNDUMP_LINE_ERROR, BddDumpLine ); - - HashNode = createauthtable( NumberNode + 1 ); - setauthfunc( HashNode, 0, loc_undumpbddhkey, 0 ); - - addauthelem( HashNode, (char *)ZeroAddr, (long)BddLocalSystem->ZERO ); - addauthelem( HashNode, (char *)OneAddr , (long)BddLocalSystem->ONE ); - - loc_undumpbddgetline(); - - while ( BddDumpBuffer[ 0 ] != '.' ) - { - Value = sscanf( BddDumpBuffer, "%lX %ld %lX %lX", - &NodeAddr, &BddVar, &HighAddr, &LowAddr ); - if ( Value != 4 ) bdderror( BDD_UNDUMP_LINE_ERROR, BddDumpLine ); - - Element = searchauthelem( HashNode, (char *)HighAddr ); - if ( Element == (authelem *)0 ) bdderror( BDD_UNDUMP_LINE_ERROR, BddDumpLine ); - BddHigh = (bddnode *)( Element->VALUE ); - - Element = searchauthelem( HashNode, (char *)LowAddr ); - if ( Element == (authelem *)0 ) bdderror( BDD_UNDUMP_LINE_ERROR, BddDumpLine ); - BddLow = (bddnode *)( Element->VALUE ); - - Element = searchauthelem( HashInput, (char *)( BddVar + 2 ) ); - if ( Element == (authelem *)0 ) bdderror( BDD_UNDUMP_LINE_ERROR, BddDumpLine ); - BddNode = addbddnode( (bddsystem *)0, Element->VALUE, BddHigh, BddLow ); - - addauthelem( HashNode, (char *)NodeAddr, (long)decbddrefext( BddNode ) ); - loc_undumpbddgetline(); - } - - for ( Index = 0; Index < NumberOut; Index++ ) - { - loc_undumpbddgetline(); - - Value = 0; - Scan = strchr( BddDumpBuffer, ' ' ); - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - Value = sscanf( BddDumpBuffer, "%lX", &NodeAddr ); - Name = namealloc( Scan + 1 ); - } - - if ( Value != 1 ) bdderror( BDD_UNDUMP_LINE_ERROR, BddDumpLine ); - - Element = searchauthelem( HashNode, (char *)NodeAddr ); - if ( Element == (authelem *)0 ) bdderror( BDD_UNDUMP_LINE_ERROR, BddDumpLine ); - BddNode = (bddnode *)( Element->VALUE ); - - addbddcircuitout( (bddcircuit *)0, Name, BddNode ); - } - - fclose( BddDumpFile ); - - return( BddCircuit ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Dump Circuit Output | -| | -\------------------------------------------------------------*/ - -static void loc_dumpbddcircuitout( BddNode ) - - bddnode *BddNode; -{ - if ( BddNode->INDEX >= BDD_INDEX_MIN ) - { - if ( ! ( BddNode->FLAG & BDD_FLAG_NUM_MASK ) ) - { - loc_dumpbddcircuitout( BddNode->HIGH ); - loc_dumpbddcircuitout( BddNode->LOW ); - - BddNode->FLAG |= BDD_FLAG_NUM_MASK; - - fprintf( BddDumpFile, "%lX %d %lX %lX\n", - (long)BddNode, - BddLocalSystem->INDEX_TO_VAR[ BddNode->INDEX ], - (long)BddNode->HIGH, - (long)BddNode->LOW ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Bdd Dump Circuit | -| | -\------------------------------------------------------------*/ - -static long loc_dumpbddcompare( ValueArray, Index1, Index2 ) - - authelem *ValueArray; - long Index1; - long Index2; -{ - return( ValueArray[ Index2 ].VALUE - ValueArray[ Index1 ].VALUE ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Dump Circuit | -| | -\------------------------------------------------------------*/ - -void dumpbddcircuit( BddCircuit, FileName ) - - bddcircuit *BddCircuit; - char *FileName; -{ - authelem *HashTable; - authelem *HashElement; - authelem *ValueArray; - long *IndexArray; - long Index; - long HashSize; - long HashIndex; - long NumberIn; - long NumberOut; - bddindex BddIndex; - - setbddlocalcircuit( BddCircuit ); - - FileName = autbasename( FileName, "bdd" ); - BddDumpFile = mbkfopen( FileName, "bdd", "w" ); - - if ( BddDumpFile == (FILE *)0 ) - { - bdderror( BDD_DUMP_FILE_ERROR, FileName ); - } - - mbkfree( FileName ); - fprintf( BddDumpFile, ".circuit %s\n", BddLocalCircuit->NAME ); - - NumberIn = BddLocalCircuit->HASH_IN->NUMBER_ELEM; - NumberOut = BddLocalCircuit->HASH_OUT->NUMBER_ELEM; - - HashTable = BddLocalCircuit->HASH_IN->TABLE; - HashSize = BddLocalCircuit->HASH_IN->TABLE_SIZE; - - fprintf( BddDumpFile, ".port %ld %ld\n", NumberIn, NumberOut ); - - fprintf( BddDumpFile, ".in\n" ); - - IndexArray = (long *)autallocblock( sizeof( long ) * ( NumberIn + 1 )); - ValueArray = (authelem *)autallocblock( sizeof( authelem ) * ( NumberIn + 1 )); - Index = 0; - - for ( HashIndex = 0; HashIndex < HashSize; HashIndex++ ) - { - HashElement = &HashTable[ HashIndex ]; - - if ( checkauthkey( HashElement->KEY, 0 ) ) - { - BddIndex = ((bddnode *) HashElement->VALUE )->INDEX; - - ValueArray[ Index ].KEY = HashElement->KEY; - ValueArray[ Index ].VALUE = BddLocalSystem->INDEX_TO_VAR[ BddIndex ]; - - Index++; - } - } - - sortautarray( ValueArray, IndexArray, NumberIn, loc_dumpbddcompare ); - - for ( HashIndex = 0; HashIndex < NumberIn; HashIndex++ ) - { - Index = IndexArray[ HashIndex ]; - - fprintf( BddDumpFile, "%ld %s\n", - ValueArray[ Index ].VALUE, ValueArray[ Index ].KEY ); - } - - autfreeblock( IndexArray ); - autfreeblock( ValueArray ); - - HashTable = BddLocalCircuit->HASH_OUT->TABLE; - HashSize = BddLocalCircuit->HASH_OUT->TABLE_SIZE; - - fprintf( BddDumpFile, ".node %ld %lX %lX\n", - BddLocalSystem->NUMBER_NODE, - (long)BddLocalSystem->ZERO, - (long)BddLocalSystem->ONE ); - - for ( HashIndex = 0; HashIndex < HashSize; HashIndex++ ) - { - HashElement = &HashTable[ HashIndex ]; - - if ( checkauthkey( HashElement->KEY, 0 ) ) - { - loc_dumpbddcircuitout( (bddnode *)( HashElement->VALUE ) ); - } - } - - fprintf( BddDumpFile, ".out\n" ); - - for ( HashIndex = 0; HashIndex < HashSize; HashIndex++ ) - { - HashElement = &HashTable[ HashIndex ]; - - if ( checkauthkey( HashElement->KEY, 0 ) ) - { - fprintf( BddDumpFile, "%lX %s\n", - (long)HashElement->VALUE, HashElement->KEY ); - - unflagbddnode( (bddsystem *)0, - (bddnode *)( HashElement->VALUE ), - BDD_FLAG_NUM_MASK ); - } - } - - fclose( BddDumpFile ); -} diff --git a/alliance/src/bdd/src/bdddump.h b/alliance/src/bdd/src/bdddump.h deleted file mode 100644 index 6f75673e..00000000 --- a/alliance/src/bdd/src/bdddump.h +++ /dev/null @@ -1,80 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bdddump.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_DUMP_H -# define BDD_DUMP_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# define BDD_UNDUMP_BUFFER_SIZE 128 - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddenv.c b/alliance/src/bdd/src/bddenv.c deleted file mode 100644 index 70d3a98b..00000000 --- a/alliance/src/bdd/src/bddenv.c +++ /dev/null @@ -1,82 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddenv.c | -| | -| Date : 03.12.96 | -| | -| Bddhor : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddenv.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Env | -| | -\------------------------------------------------------------*/ - -void bddenv() -{ - return; -} diff --git a/alliance/src/bdd/src/bddenv.h b/alliance/src/bdd/src/bddenv.h deleted file mode 100644 index 7798209a..00000000 --- a/alliance/src/bdd/src/bddenv.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddenv.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_ENV_H -# define BDD_ENV_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bdderror.c b/alliance/src/bdd/src/bdderror.c deleted file mode 100644 index 800a9ecb..00000000 --- a/alliance/src/bdd/src/bdderror.c +++ /dev/null @@ -1,291 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : Bdd Errors | -| | -| Authors : Jacomme Ludovic | -| | -| Date : 03.12.96 | -| | -\------------------------------------------------------------*/ - -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include -# include -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -void bdd_error( Error, Value, File, Line ) - - int Error; - long Value; - char *File; - long Line; -{ - char *Name; - - Name = mbkstrdup( File ); - Name[ strlen( File ) - 1 ] = '\0'; - - fprintf( stderr, "%s%ld ", Name, Line ); - - switch( Error ) - { - case BDD_MODEL_VAR_ERROR : - - fprintf( stderr, "system model variable %ld", Value ); - - break; - - case BDD_MODEL_OPER_ERROR : - - fprintf( stderr, "system model oper %ld", Value ); - - break; - - case BDD_HNODE_SIZE_ERROR : - - fprintf( stderr, "hash node table size %ld", Value ); - - break; - - case BDD_HNODE_KEY_ERROR : - - fprintf( stderr, "hash node key 0" ); - - break; - - case BDD_HOPER_SIZE_ERROR : - - fprintf( stderr, "hash oper table size %ld", Value ); - - break; - - case BDD_HOPER_KEY_ERROR : - - fprintf( stderr, "hash oper key 0" ); - - break; - - case BDD_BAD_INDEX_ERROR : - - fprintf( stderr, "index %ld out of range", Value ); - - break; - - case BDD_BAD_VAR_ERROR : - - fprintf( stderr, "variable %ld out of range", Value ); - - break; - - case BDD_BAD_CHILD_ERROR : - - fprintf( stderr, "child %ld out of range", Value ); - - break; - - case BDD_BAD_IN_ERROR : - - fprintf( stderr, "input %s exist already", (char *)Value ); - - break; - - case BDD_OPERATOR_ERROR : - - fprintf( stderr, "bad operator %ld", Value ); - - break; - - case BDD_BAD_LIST_ERROR : - - fprintf( stderr, "bad list" ); - - break; - - case BDD_NO_MORE_VAR_ERROR : - - fprintf( stderr, "no more variables" ); - - break; - - case BDD_NEGATIVE_REF_INT_ERROR : - - fprintf( stderr, "negative internal reference, index %ld", Value ); - - break; - - case BDD_NEGATIVE_REF_EXT_ERROR : - - fprintf( stderr, "negative external reference, index %ld", Value ); - - break; - - case BDD_UNKNOWN_IN_MODE_ERROR : - - fprintf( stderr, "unknwon in mode %ld", Value ); - - break; - - case BDD_MAX_NODE_ERROR : - - fprintf( stderr, "node limit reached %ld", Value ); - - break; - - case BDD_BAD_ASSOC_ERROR : - - fprintf( stderr, "bad variable association %ld", Value ); - - break; - - case BDD_NO_MORE_ASSOC_ERROR : - - fprintf( stderr, "no more variable association" ); - - break; - - case BDD_UNKNOWN_AUX_MODE_ERROR : - - fprintf( stderr, "unknwon aux mode %ld", Value ); - - break; - - case BDD_DUMP_FILE_ERROR : - - fprintf( stderr, "bad dump file %s", (char *)Value ); - - break; - - case BDD_UNDUMP_FILE_ERROR : - - fprintf( stderr, "undump file name %s", (char *)Value ); - - break; - - case BDD_UNDUMP_LINE_ERROR : - - fprintf( stderr, "undump line %ld syntax", Value ); - - break; - - default : - - fprintf( stderr, "unknown internal %d", Error ); - } - - fprintf( stderr, " error !\n" ); - - autexit( 1 ); -} - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -void bdd_warning( Warning, Value1, Value2, File, Line ) - - int Warning; - long Value1; - long Value2; - char *File; - long Line; -{ - char *Name; - - Name = mbkstrdup( File ); - Name[ strlen( File ) - 1 ] = '\0'; - - fprintf( stderr, "%s%ld ", Name, Line ); - - switch( Warning ) - { - case BDD_DYNAMIC_REORDER_WARNING : - - fprintf( stderr, "dynamic reorder %ld -> %ld", Value1, Value2 ); - - break; - - case BDD_DYNAMIC_EXPLOSION_WARNING : - - fprintf( stderr, "dynamic explosion %ld -> %ld", Value1, Value2 ); - - break; - - case BDD_OVERFLOW_REF_INT_WARNING : - - fprintf( stderr, "internal reference overflow, index %ld", Value1 ); - - break; - - case BDD_OVERFLOW_REF_EXT_WARNING : - - fprintf( stderr, "external reference overflow, index %ld", Value1 ); - - break; - - default : - - fprintf( stderr, "unknown internal %d", Warning ); - } - - fprintf( stderr, " warning !\n" ); -} diff --git a/alliance/src/bdd/src/bdderror.h b/alliance/src/bdd/src/bdderror.h deleted file mode 100644 index 863295f7..00000000 --- a/alliance/src/bdd/src/bdderror.h +++ /dev/null @@ -1,125 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : Bdd Errors | -| | -| Authors : Jacomme Ludovic | -| | -| Date : 03.12.96 | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_ERROR_H -# define BDD_ERROR_H - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Error | -| | -\------------------------------------------------------------*/ - -# define BDD_MODEL_VAR_ERROR 0 -# define BDD_MODEL_OPER_ERROR 1 -# define BDD_HNODE_SIZE_ERROR 2 -# define BDD_HNODE_KEY_ERROR 3 -# define BDD_HOPER_SIZE_ERROR 4 -# define BDD_HOPER_KEY_ERROR 5 -# define BDD_BAD_INDEX_ERROR 6 -# define BDD_BAD_VAR_ERROR 7 -# define BDD_BAD_CHILD_ERROR 8 -# define BDD_BAD_IN_ERROR 9 -# define BDD_OPERATOR_ERROR 10 -# define BDD_BAD_LIST_ERROR 11 -# define BDD_NO_MORE_VAR_ERROR 12 -# define BDD_NEGATIVE_REF_INT_ERROR 13 -# define BDD_NEGATIVE_REF_EXT_ERROR 14 -# define BDD_UNKNOWN_IN_MODE_ERROR 15 -# define BDD_MAX_NODE_ERROR 16 -# define BDD_BAD_ASSOC_ERROR 17 -# define BDD_NO_MORE_ASSOC_ERROR 18 -# define BDD_UNKNOWN_AUX_MODE_ERROR 19 -# define BDD_DUMP_FILE_ERROR 20 -# define BDD_UNDUMP_FILE_ERROR 21 -# define BDD_UNDUMP_LINE_ERROR 22 - -/*------------------------------------------------------------\ -| | -| Warning | -| | -\------------------------------------------------------------*/ - -# define BDD_DYNAMIC_REORDER_WARNING 0 -# define BDD_OVERFLOW_REF_INT_WARNING 1 -# define BDD_OVERFLOW_REF_EXT_WARNING 2 -# define BDD_DYNAMIC_EXPLOSION_WARNING 3 - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macros | -| | -\------------------------------------------------------------*/ - -# define bdderror( E, V ) (bdd_error( (int)(E), (long)(V), __FILE__, __LINE__ )) -# define bddwarning( W, V1, V2 ) (bdd_warning( (int)(W), (long)(V1), \ - (long)(V2), __FILE__, __LINE__ )) - -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - - extern void bdd_error __P((int Error, long Value, char *File, long Line)); - extern void bdd_warning __P((int Warning, long Value1, long Value2, char *File, long Line)); - -# endif diff --git a/alliance/src/bdd/src/bddexist.c b/alliance/src/bdd/src/bddexist.c deleted file mode 100644 index d9450fba..00000000 --- a/alliance/src/bdd/src/bddexist.c +++ /dev/null @@ -1,330 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddexist.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddassoc.h" -# include "bddapply.h" -# include "bddexist.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Exist Node With Association | -| | -\------------------------------------------------------------*/ - -bddnode *loc_existbddnode( BddNode ) - - bddnode *BddNode; -{ - bddhoper *HashOper; - bddnode *BddExist; - bddnode *BddHigh; - bddnode *BddLow; - bddvar NodeVar; - - NodeVar = BddLocalSystem->INDEX_TO_VAR[ BddNode->INDEX ]; - - if ( BddLocalAssoc->LAST < NodeVar ) - { - return( incbddrefext( BddNode ) ); - } - - HashOper = searchbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_EXIST + BddLocalAssoc->IDENT, - BddNode, BddNode ); - - if ( HashOper != (bddhoper *)0 ) - { - return( incbddrefext( HashOper->FATHER ) ); - } - - BddExist = BddLocalAssocNode[ NodeVar ]; - BddHigh = loc_existbddnode( BddNode->HIGH ); - - if ( ( BddExist != (bddnode *)0 ) && - ( BddHigh->INDEX == BDD_INDEX_ONE ) ) - { - BddExist = BddHigh; - } - else - { - BddLow = decbddrefext( loc_existbddnode( BddNode->LOW ) ); - BddHigh = decbddrefext( BddHigh ); - - if ( BddExist != (bddnode *)0 ) - { - BddExist = loc_applybdd( ABL_OR, BddHigh, BddLow ); - } - else - { - BddExist = addbddnode( (bddsystem *)0, BddNode->INDEX, BddHigh, BddLow ); - } - } - - addbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_EXIST + BddLocalAssoc->IDENT, - BddNode, BddNode, BddExist ); - - BddLocalAssoc->CACHE = 1; - - return( BddExist ); -} - -/*------------------------------------------------------------\ -| | -| Exist Bdd Node With Association | -| | -\------------------------------------------------------------*/ - -bddnode *existbddnodeassoc( BddSystem, BddNode, BddAssoc ) - - bddsystem *BddSystem; - bddnode *BddNode; - bddassoc *BddAssoc; -{ - bddnode *BddExist; - - if ( checkbddassoc( BddSystem, BddAssoc, 1 ) == 2 ) - { - return( incbddrefext( BddNode ) ); - } - - BddLocalAssoc = BddAssoc; - BddLocalAssocNode = BddAssoc->ASSOC_NODE; - - BddExist = loc_existbddnode( BddNode ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddExist ); -} - -/*------------------------------------------------------------\ -| | -| Forall Bdd Node With Association | -| | -\------------------------------------------------------------*/ - -bddnode *forallbddnodeassoc( BddSystem, BddNode, BddAssoc ) - - bddsystem *BddSystem; - bddnode *BddNode; - bddassoc *BddAssoc; -{ - bddnode *BddForall; - - if ( checkbddassoc( BddSystem, BddAssoc, 1 ) == 2 ) - { - return( incbddrefext( BddNode ) ); - } - - BddLocalAssoc = BddAssoc; - BddLocalAssocNode = BddAssoc->ASSOC_NODE; - - BddNode = decbddrefext( loc_applybddnot( BddNode ) ); - BddForall = decbddrefext( loc_existbddnode( BddNode ) ); - BddForall = loc_applybddnot( BddForall ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddForall ); -} - -/*------------------------------------------------------------\ -| | -| Local Exist Node With Missing Association | -| | -\------------------------------------------------------------*/ - -bddnode *loc_existbddnodemiss( BddNode ) - - bddnode *BddNode; -{ - bddhoper *HashOper; - bddnode *BddExist; - bddnode *BddHigh; - bddnode *BddLow; - bddvar NodeVar; - short Exist; - - if ( BddNode->INDEX < BDD_INDEX_MIN ) - { - return( BddNode ); - } - - NodeVar = BddLocalSystem->INDEX_TO_VAR[ BddNode->INDEX ]; - - if ( BddLocalAssoc->LAST < NodeVar ) - { - Exist = 1; - } - else - { - Exist = ( BddLocalAssocNode[ NodeVar ] == (bddnode *)0 ); - } - - HashOper = searchbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_EXIST_MISS + BddLocalAssoc->IDENT, - BddNode, BddNode ); - - if ( HashOper != (bddhoper *)0 ) - { - return( incbddrefext( HashOper->FATHER ) ); - } - - BddHigh = loc_existbddnodemiss( BddNode->HIGH ); - - if ( ( Exist ) && - ( BddHigh->INDEX == BDD_INDEX_ONE ) ) - { - BddExist = BddHigh; - } - else - { - BddLow = decbddrefext( loc_existbddnodemiss( BddNode->LOW ) ); - BddHigh = decbddrefext( BddHigh ); - - if ( Exist ) - { - BddExist = loc_applybdd( ABL_OR, BddHigh, BddLow ); - } - else - { - BddExist = addbddnode( (bddsystem *)0, BddNode->INDEX, BddHigh, BddLow ); - } - } - - addbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_EXIST_MISS + BddLocalAssoc->IDENT, - BddNode, BddNode, BddExist ); - - BddLocalAssoc->CACHE = 1; - - return( BddExist ); -} - -/*------------------------------------------------------------\ -| | -| Exist Bdd Node Missing Association | -| | -\------------------------------------------------------------*/ - -bddnode *existbddnodemissassoc( BddSystem, BddNode, BddAssoc ) - - bddsystem *BddSystem; - bddnode *BddNode; - bddassoc *BddAssoc; -{ - bddnode *BddExist; - - if ( checkbddassoc( BddSystem, BddAssoc, 1 ) == 2 ) - { - return( incbddrefext( BddNode ) ); - } - - BddLocalAssoc = BddAssoc; - BddLocalAssocNode = BddAssoc->ASSOC_NODE; - - BddExist = loc_existbddnodemiss( BddNode ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddExist ); -} - -/*------------------------------------------------------------\ -| | -| Forall Bdd Node With Missing Association | -| | -\------------------------------------------------------------*/ - -bddnode *forallbddnodemissassoc( BddSystem, BddNode, BddAssoc ) - - bddsystem *BddSystem; - bddnode *BddNode; - bddassoc *BddAssoc; -{ - bddnode *BddMiss; - - if ( checkbddassoc( BddSystem, BddAssoc, 1 ) == 2 ) - { - return( incbddrefext( BddNode ) ); - } - - BddLocalAssoc = BddAssoc; - BddLocalAssocNode = BddAssoc->ASSOC_NODE; - - BddNode = decbddrefext( loc_applybddnot( BddNode ) ); - BddMiss = decbddrefext( loc_existbddnodemiss( BddNode ) ); - BddMiss = loc_applybddnot( BddMiss ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddMiss ); -} diff --git a/alliance/src/bdd/src/bddexist.h b/alliance/src/bdd/src/bddexist.h deleted file mode 100644 index 9839a4f0..00000000 --- a/alliance/src/bdd/src/bddexist.h +++ /dev/null @@ -1,79 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddexist.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_EXIST_H -# define BDD_EXIST_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - - extern bddnode * loc_existbddnode __P((bddnode *BddNode)); - -# endif diff --git a/alliance/src/bdd/src/bddexplosion.c b/alliance/src/bdd/src/bddexplosion.c deleted file mode 100644 index 2d2aa78d..00000000 --- a/alliance/src/bdd/src/bddexplosion.c +++ /dev/null @@ -1,118 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddexplosion.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| Modif : Arnaud Caron - 16 Oct 1998 | -| Suppression des bddvartrees. | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddexplosion.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| explosion Bdd System Restart | -| | -\------------------------------------------------------------*/ - -void explosionbddsystemrestart( BddSystem ) - - bddsystem *BddSystem; -{ - setbddlocalsystem( BddSystem ); - - BddLocalSystem->HASH_OPER->TABLE_FREEZE = 0; - ClearBddSystemExplosion( BddLocalSystem ); -} - -/*------------------------------------------------------------\ -| | -| explosion Bdd System Dynamic | -| | -\------------------------------------------------------------*/ - -void explosionbddsystemdynamic( BddSystem, ExplosionFunc, ExplosionLimit ) - - bddsystem *BddSystem; - void (*ExplosionFunc)(); - long ExplosionLimit; -{ - setbddlocalsystem( BddSystem ); - - if ( ExplosionLimit <= 0 ) - { - ClearBddSystemExplosionOn( BddLocalSystem ); - } - else - { - SetBddSystemExplosionOn( BddLocalSystem ); - - BddLocalSystem->EXPLOSION_FUNC = ExplosionFunc; - BddLocalSystem->EXPLOSION_LIMIT = ExplosionLimit; - } - - ClearBddSystemExplosion( BddLocalSystem ); -} diff --git a/alliance/src/bdd/src/bddexplosion.h b/alliance/src/bdd/src/bddexplosion.h deleted file mode 100644 index c53a205c..00000000 --- a/alliance/src/bdd/src/bddexplosion.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddexplosion.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_EXPLOSION_H -# define BDD_EXPLOSION_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddflag.c b/alliance/src/bdd/src/bddflag.c deleted file mode 100644 index 50098ffc..00000000 --- a/alliance/src/bdd/src/bddflag.c +++ /dev/null @@ -1,223 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddflag.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddflag.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static bddflag BddFlagMask = 0; - static long BddFlagNumberNode = 0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Flag Bdd Node | -| | -\------------------------------------------------------------*/ - -static void loc_flagbdd( BddNode ) - - bddnode *BddNode; -{ - if ( BddNode->INDEX >= BDD_INDEX_MIN ) - { - if ( ! ( BddNode->FLAG & BddFlagMask ) ) - { - BddNode->FLAG |= BddFlagMask; - BddFlagNumberNode++; - - loc_flagbdd( BddNode->LOW ); - loc_flagbdd( BddNode->HIGH ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Bdd Unflag Node | -| | -\------------------------------------------------------------*/ - -static void loc_unflagbdd( BddNode ) - - bddnode *BddNode; -{ - if ( BddNode->INDEX >= BDD_INDEX_MIN ) - { - if ( BddNode->FLAG & BddFlagMask ) - { - BddNode->FLAG &= ~BddFlagMask; - BddFlagNumberNode++; - - loc_unflagbdd( BddNode->LOW ); - loc_unflagbdd( BddNode->HIGH ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Bdd Flag Node | -| | -\------------------------------------------------------------*/ - -long flagbddnode( BddSystem, BddNode, Flag ) - - bddsystem *BddSystem; - bddnode *BddNode; - bddflag Flag; -{ - setbddlocalsystem( BddSystem ); - - BddFlagMask = Flag; - BddFlagNumberNode = 0; - - loc_flagbdd( BddNode ); - - return( BddFlagNumberNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Flag Node | -| | -\------------------------------------------------------------*/ - -long unflagbddnode( BddSystem, BddNode, Flag ) - - bddsystem *BddSystem; - bddnode *BddNode; - bddflag Flag; -{ - setbddlocalsystem( BddSystem ); - - BddFlagMask = Flag; - BddFlagNumberNode = 0; - - loc_unflagbdd( BddNode ); - - return( BddFlagNumberNode ); -} - -/*------------------------------------------------------------\ -| | -| Get Node Size | -| | -\------------------------------------------------------------*/ - -static void loc_getbddsize( BddNode ) - - bddnode *BddNode; -{ - if ( BddNode->INDEX >= BDD_INDEX_MIN ) - { - BddFlagNumberNode++; - - loc_getbddsize( BddNode->LOW ); - loc_getbddsize( BddNode->HIGH ); - } -} - - -/*------------------------------------------------------------\ -| | -| Get Bdd Node Num | -| | -\------------------------------------------------------------*/ - -long getbddnodenum( BddSystem, BddNode ) - - bddsystem *BddSystem; - bddnode *BddNode; -{ - long NumberNode; - - NumberNode = flagbddnode( BddSystem, BddNode, BDD_FLAG_NUM_MASK ); - unflagbddnode( BddSystem, BddNode, BDD_FLAG_NUM_MASK ); - - return( NumberNode ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Node Size | -| | -\------------------------------------------------------------*/ - -long getbddnodesize( BddSystem, BddNode ) - - bddsystem *BddSystem; - bddnode *BddNode; -{ - setbddlocalsystem( BddSystem ); - - BddFlagNumberNode = 0; - loc_getbddsize( BddNode ); - - return( BddFlagNumberNode ); -} diff --git a/alliance/src/bdd/src/bddflag.h b/alliance/src/bdd/src/bddflag.h deleted file mode 100644 index f84b8ddd..00000000 --- a/alliance/src/bdd/src/bddflag.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Bdd | -| | -| File : bddflag.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_FLAG_H -# define BDD_FLAG_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddfraction.c b/alliance/src/bdd/src/bddfraction.c deleted file mode 100644 index be588c17..00000000 --- a/alliance/src/bdd/src/bddfraction.c +++ /dev/null @@ -1,113 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddfraction.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddfraction.h" -# include "bddassoc.h" -# include "bddapply.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Fraction Bdd Node | -| | -\------------------------------------------------------------*/ - -static double loc_fractionbdd( BddNode ) - - bddnode *BddNode; -{ - if ( BddNode->INDEX < BDD_INDEX_MIN ) - { - if ( BddNode->INDEX == BDD_INDEX_ZERO ) - { - return( 0.0 ); - } - - return( 1.0 ); - } - - return( (double)( 0.5 * ( loc_fractionbdd( BddNode->HIGH ) + - loc_fractionbdd( BddNode->LOW ) ) ) ); -} - -/*------------------------------------------------------------\ -| | -| Fraction Bdd Node | -| | -\------------------------------------------------------------*/ - -double fractionbddnode( BddSystem, BddNode ) - - bddsystem *BddSystem; - bddnode *BddNode; -{ - setbddlocalsystem( BddSystem ); - - return( loc_fractionbdd( BddNode ) ); -} diff --git a/alliance/src/bdd/src/bddfraction.h b/alliance/src/bdd/src/bddfraction.h deleted file mode 100644 index 6c47c0fc..00000000 --- a/alliance/src/bdd/src/bddfraction.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddfraction.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_FRACTION_H -# define BDD_FRACTION_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddfree.c b/alliance/src/bdd/src/bddfree.c deleted file mode 100644 index 1b0852da..00000000 --- a/alliance/src/bdd/src/bddfree.c +++ /dev/null @@ -1,305 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddfree.c | -| | -| Date : 03.12.96 | -| | -| Bddhor : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddfree.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Free User Func | -| | -\------------------------------------------------------------*/ - -void freebdduserfunc( BddUserFunc ) - - bdduserfunc *BddUserFunc; -{ - autfreeheap( (char *)BddUserFunc, sizeof( bdduserfunc ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Heath | -| | -\------------------------------------------------------------*/ - -void freebddheath( BddHeath ) - - bddheath *BddHeath; -{ - autfreeheap( (char *)BddHeath, sizeof( bddheath ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Hash Node | -| | -\------------------------------------------------------------*/ - -void freebddhnode( HashNode ) - - bddhnode *HashNode; -{ - autfreeblock( (char *)HashNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Hash Oper | -| | -\------------------------------------------------------------*/ - -void freebddhoper( HashOper ) - - bddhoper *HashOper; -{ - autfreeblock( (char *)HashOper ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Hash Node Table | -| | -\------------------------------------------------------------*/ - -void freebddhnodetable( HashTable ) - - bddhnodetable *HashTable; -{ - autfreeheap( (char *)HashTable, sizeof( bddhnodetable ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Hash Oper Table | -| | -\------------------------------------------------------------*/ - -void freebddhopertable( HashTable ) - - bddhopertable *HashTable; -{ - autfreeblock( (char *)HashTable ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free BLock | -| | -\------------------------------------------------------------*/ - -void freebddblock( BddBlock ) - - bddblock *BddBlock; -{ - autfreeheap( (char *)BddBlock, sizeof( bddblock ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Node Block | -| | -\------------------------------------------------------------*/ - -void freebddnodeblock( BddNode ) - - bddnode *BddNode; -{ - autfreeblock( (char *)BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Variable Node | -| | -\------------------------------------------------------------*/ - -void freebddvarnode( BddVariableNode ) - - bddvarnode *BddVariableNode; -{ - autfreeblock( (char *)BddVariableNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Hash Variable Node | -| | -\------------------------------------------------------------*/ - -void freebddindexnode( BddIndexNode ) - - bddindexnode *BddIndexNode; -{ - autfreeblock( (char *)BddIndexNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Variable | -| | -\------------------------------------------------------------*/ - -void freebddvar( BddVariable ) - - bddvar *BddVariable; -{ - autfreeblock( (char *)BddVariable ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Index | -| | -\------------------------------------------------------------*/ - -void freebddindex( BddIndex ) - - bddindex *BddIndex; -{ - autfreeblock( (char *)BddIndex ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Assoc | -| | -\------------------------------------------------------------*/ - -void freebddassoc( BddAssoc ) - - bddassoc *BddAssoc; -{ - autfreeheap( (char *)BddAssoc, sizeof( bddassoc ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Assoc Node | -| | -\------------------------------------------------------------*/ - -void freebddassocnode( BddAssocNode ) - - bddassocnode *BddAssocNode; -{ - autfreeblock( (char *)BddAssocNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Name Input | -| | -\------------------------------------------------------------*/ - -void freebddnamein( NameIn ) - - bddnamein *NameIn; -{ - autfreeblock( (char *)NameIn ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Index Input | -| | -\------------------------------------------------------------*/ - -void freebddindexin( IndexIn ) - - bddindex *IndexIn; -{ - autfreeblock( (char *)IndexIn ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free System | -| | -\------------------------------------------------------------*/ - -void freebddsystem( BddSystem ) - - bddsystem *BddSystem; -{ - autfreeblock( (char *)BddSystem ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Circuit | -| | -\------------------------------------------------------------*/ - -void freebddcircuit( BddCircuit ) - - bddcircuit *BddCircuit; -{ - autfreeblock( (char *)BddCircuit ); -} diff --git a/alliance/src/bdd/src/bddfree.h b/alliance/src/bdd/src/bddfree.h deleted file mode 100644 index 2f626e78..00000000 --- a/alliance/src/bdd/src/bddfree.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddfree.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_FREE_H -# define BDD_FREE_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddgarbage.c b/alliance/src/bdd/src/bddgarbage.c deleted file mode 100644 index bdcd8211..00000000 --- a/alliance/src/bdd/src/bddgarbage.c +++ /dev/null @@ -1,140 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddgarbage.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddgarbage.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Garbage Collect System | -| | -\------------------------------------------------------------*/ - -void garbagebddsystem( BddSystem ) - - bddsystem *BddSystem; -{ - bddindexnode *IndexNode; - bddhnodetable *HashTable; - bddnode *HashNode; - bddindex *VarToIndex; - bddvar NumberVar; - bddvar Variable; - long HashIndex; - - setbddlocalsystem( BddSystem ); - - resetbddhopertable( BddLocalSystem->HASH_OPER ); - - NumberVar = BddLocalSystem->NUMBER_VAR; - IndexNode = BddLocalSystem->INDEX_NODE; - VarToIndex = BddLocalSystem->VAR_TO_INDEX; - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - HashTable = IndexNode[ VarToIndex[ Variable ] ]; - - for ( HashIndex = 0; HashIndex < HashTable->TABLE_SIZE; HashIndex++ ) - { - HashNode = HashTable->TABLE[ HashIndex ]; - - if ( ( HashNode != BDD_HASH_NODE_EMPTY ) && - ( HashNode != BDD_HASH_NODE_DELETED ) ) - { - HashNode->REF_INT = 0; - } - } - } - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - HashTable = IndexNode[ VarToIndex[ Variable ] ]; - - for ( HashIndex = 0; HashIndex < HashTable->TABLE_SIZE; HashIndex++ ) - { - HashNode = HashTable->TABLE[ HashIndex ]; - - if ( ( HashNode != BDD_HASH_NODE_EMPTY ) && - ( HashNode != BDD_HASH_NODE_DELETED ) ) - { - if ( ( HashNode->REF_INT ) || - ( HashNode->REF_EXT ) ) - { - incbddrefint( HashNode->HIGH ); - incbddrefint( HashNode->LOW ); - } - } - } - } - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - sweepbddvar( (bddsystem *)0, Variable, 0 ); - } -} diff --git a/alliance/src/bdd/src/bddgarbage.h b/alliance/src/bdd/src/bddgarbage.h deleted file mode 100644 index 859f4835..00000000 --- a/alliance/src/bdd/src/bddgarbage.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddgarbage.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_GARBAGE_H -# define BDD_GARBAGE_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddheath.c b/alliance/src/bdd/src/bddheath.c deleted file mode 100644 index d20bd3f7..00000000 --- a/alliance/src/bdd/src/bddheath.c +++ /dev/null @@ -1,170 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddheath.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddheath.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variable | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Get Bdd Var Heath | -| | -\------------------------------------------------------------*/ - -bddheath *getbddheathvar( BddSystem, BddNode, Variable ) - - bddsystem *BddSystem; - bddnode *BddNode; - bddvar Variable; -{ - bddheath *BddHeath; - bddnode *BddVarNode; - bddindex Index; - - checkbddvar( BddSystem, Variable, 1 ); - - Index = BddLocalSystem->VAR_TO_INDEX[ Variable ]; - BddVarNode = BddLocalSystem->VAR_NODE[ Index ]; - - BddHeath = allocbddheath(); - BddHeath->VAR = BddVarNode; - - BddHeath->PLUS = restrictbddnode( (bddsystem *)0, BddNode, Variable, BddLocalSystem->ONE ); - BddHeath->MINUS = restrictbddnode( (bddsystem *)0, BddNode, Variable, BddLocalSystem->ZERO ); - - return( BddHeath ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Heath | -| | -\------------------------------------------------------------*/ - -bddheath *getbddheath( BddSystem, BddNode ) - - bddsystem *BddSystem; - bddnode *BddNode; -{ - chain_list *Support; - chain_list *ScanSupport; - bddheath *HeadHeath; - bddheath *BddHeath; - bddvar BddVar; - - setbddlocalsystem( BddSystem ); - - Support = getbddnodesupport( (bddsystem *)0, BddNode, BDD_SUPPORT_CHAIN ); - HeadHeath = (bddheath *)0; - - for ( ScanSupport = Support; - ScanSupport != (chain_list *)0; - ScanSupport = ScanSupport->NEXT ) - { - BddHeath = allocbddheath(); - BddHeath->NEXT = HeadHeath; - BddHeath->VAR = (bddnode *)( ScanSupport->DATA ); - - BddVar = BddLocalSystem->INDEX_TO_VAR[ BddHeath->VAR->INDEX ]; - BddHeath->PLUS = restrictbddnode( (bddsystem *)0, BddNode, BddVar, BddLocalSystem->ONE ); - BddHeath->MINUS = restrictbddnode( (bddsystem *)0, BddNode, BddVar, BddLocalSystem->ZERO ); - - HeadHeath = BddHeath; - } - - freechain( Support ); - - return( HeadHeath ); -} - -/*------------------------------------------------------------\ -| | -| Del Bdd Heath | -| | -\------------------------------------------------------------*/ - -void delbddheath( BddSystem, BddHeath ) - - bddsystem *BddSystem; - bddheath *BddHeath; -{ - bddheath *DelHeath; - - setbddlocalsystem( BddSystem ); - - while ( BddHeath != (bddheath *)0 ) - { - DelHeath = BddHeath; - BddHeath = BddHeath->NEXT; - - decbddrefext( DelHeath->PLUS ); - decbddrefext( DelHeath->MINUS ); - - freebddheath( DelHeath ); - } -} diff --git a/alliance/src/bdd/src/bddheath.h b/alliance/src/bdd/src/bddheath.h deleted file mode 100644 index b10acb56..00000000 --- a/alliance/src/bdd/src/bddheath.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddheath.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_HEATH_H -# define BDD_HEATH_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddhnode.c b/alliance/src/bdd/src/bddhnode.c deleted file mode 100644 index b9fca894..00000000 --- a/alliance/src/bdd/src/bddhnode.c +++ /dev/null @@ -1,662 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddhnode.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include -# include -# include "bddhnode.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static long (*funcbddhnodesize )() = getbddhnodesize; - static long (*funcbddhnodekey )() = getbddhnodekey; - static long (*funcbddhnodeindex)() = getbddhnodeindex; - - long BDD_HNODE_STRETCH_FACTOR = HNODE_STRETCH_FACTOR; - long BDD_HNODE_RESIZE_FACTOR = HNODE_RESIZE_FACTOR; - long BDD_HNODE_MIN_FILL_FACTOR = HNODE_MIN_FILL_FACTOR; - long BDD_HNODE_MAX_SCAN = HNODE_MAX_SCAN; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Set Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Set Hash Size Function | -| | -\------------------------------------------------------------*/ - -void setbddhnodefunc( FuncSize, FuncKey, FuncIndex ) - - long (*FuncSize)(); - long (*FuncKey)(); - long (*FuncIndex)(); -{ - if ( FuncSize != 0 ) funcbddhnodesize = FuncSize; - else funcbddhnodesize = getbddhnodesize; - - if ( FuncKey != 0 ) funcbddhnodekey = FuncKey; - else funcbddhnodekey = getbddhnodekey; - - if ( FuncIndex != 0 ) funcbddhnodeindex = FuncIndex; - else funcbddhnodeindex = getbddhnodeindex; -} - -/*------------------------------------------------------------\ -| | -| Get Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Get Hash Size | -| | -\------------------------------------------------------------*/ - -long getbddhnodesize( Size ) - - long Size; -{ - int Index; - - for ( Index = 0; Index < AUT_MAX_PRIME_NUMBER; Index++ ) - { - if ( AUT_HASH_PRIME_NUMBER[ Index ] > Size ) - { - return( AUT_HASH_PRIME_NUMBER[ Index ] ); - } - } - - if ( ( Size & 1 ) == 0 ) Size++; - - return( Size ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Get Hash Key | -| | -\------------------------------------------------------------*/ - -long getbddhnodekey( Table, BddNode ) - - bddhnodetable *Table; - bddnode *BddNode; -{ - return( ( ((unsigned long)BddNode->HIGH >> 2 ) + - ((unsigned long)BddNode->LOW << 1 ) ) % Table->TABLE_SIZE ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Get Hash Index | -| | -\------------------------------------------------------------*/ - -long getbddhnodeindex( Table, BddNode, Index ) - - bddhnodetable *Table; - bddnode *BddNode; - long Index; -{ - return( ( ((unsigned long)Index ) + - ((unsigned long)Index << 2 ) + - ((unsigned long)BddNode->HIGH ) + - ((unsigned long)BddNode->LOW << 1 ) ) % Table->TABLE_SIZE ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Check Hash Node | -| | -\------------------------------------------------------------*/ - -int checkbddhnode( HashNode, Severity ) - - bddnode *HashNode; - int Severity; -{ - if ( ( HashNode == BDD_HASH_NODE_EMPTY ) || - ( HashNode == BDD_HASH_NODE_DELETED ) ) - { - if ( Severity ) - { - bdderror( BDD_HNODE_KEY_ERROR, HashNode ); - } - - return( 0 ); - } - - return( 1 ); -} - -/*------------------------------------------------------------\ -| | -| Create Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Create Hash Table | -| | -\------------------------------------------------------------*/ - -bddhnodetable *createbddhnodetable( Length ) - - long Length; -{ - bddhnodetable *HashTable; - bddhnode *Table; - - if ( Length < 0 ) - { - bdderror( BDD_HNODE_SIZE_ERROR, Length ); - } - - Length = (*funcbddhnodesize)( Length ); - - HashTable = allocbddhnodetable(); - Table = allocbddhnode( Length ); - - HashTable->TABLE = Table; - HashTable->TABLE_SIZE = Length; - - return( HashTable ); -} - -/*------------------------------------------------------------\ -| | -| Destroy Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Destroy Hash Table | -| | -\------------------------------------------------------------*/ - -void destroybddhnodetable( HashTable ) - - bddhnodetable *HashTable; -{ - freebddhnode( HashTable->TABLE ); - freebddhnodetable( HashTable ); -} - -/*------------------------------------------------------------\ -| | -| Reset Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Reset Hash Table | -| | -\------------------------------------------------------------*/ - -void resetbddhnodetable( HashTable ) - - bddhnodetable *HashTable; -{ - if ( HashTable->NUMBER_NODE > 0 ) - { - memset( (void *)HashTable->TABLE, 0, - (size_t)HashTable->TABLE_SIZE * sizeof( bddhnode ) ); - - HashTable->NUMBER_NODE = 0; - } - - HashTable->NUMBER_ADD = 0; - HashTable->NUMBER_SCAN = 0; - HashTable->NUMBER_STRETCH = 0; -} - -/*------------------------------------------------------------\ -| | -| Stretch Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Resize Hash Table | -| | -\------------------------------------------------------------*/ - -void resizebddhnodetable( HashTable ) - - bddhnodetable *HashTable; -{ - bddhnode *NewTable; - bddhnode *Table; - long NewLength; - long Length; - long NumberNode; - - Length = HashTable->TABLE_SIZE; - NumberNode = HashTable->NUMBER_NODE; - - if ( NumberNode >= ( Length * BDD_HNODE_MIN_FILL_FACTOR ) / 100 ) - { - return; - } - - Table = HashTable->TABLE; - NewLength = (*funcbddhnodesize)( NumberNode * BDD_HNODE_RESIZE_FACTOR / 100 ); - NewTable = allocbddhnode( NewLength ); - - HashTable->TABLE = NewTable; - HashTable->TABLE_SIZE = NewLength; - HashTable->NUMBER_NODE = 0; - HashTable->NUMBER_RESIZE += 1; - - while ( Length > 0 ) - { - Length = Length - 1; - - if ( ( Table[ Length ] != BDD_HASH_NODE_EMPTY ) && - ( Table[ Length ] != BDD_HASH_NODE_DELETED ) ) - { - addbddhnode( HashTable, Table[ Length ] ); - } - } - - freebddhnode( Table ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Stretch Hash Table | -| | -\------------------------------------------------------------*/ - -void stretchbddhnodetable( HashTable ) - - bddhnodetable *HashTable; -{ - bddhnode *NewTable; - bddhnode *Table; - long NewLength; - long Length; - - Length = HashTable->TABLE_SIZE; - Table = HashTable->TABLE; - NewLength = (*funcbddhnodesize)( Length * BDD_HNODE_STRETCH_FACTOR / 100 ); - NewTable = allocbddhnode( NewLength ); - - HashTable->TABLE = NewTable; - HashTable->TABLE_SIZE = NewLength; - HashTable->NUMBER_NODE = 0; - HashTable->NUMBER_STRETCH += 1; - - while ( Length > 0 ) - { - Length = Length - 1; - - if ( ( Table[ Length ] != BDD_HASH_NODE_EMPTY ) && - ( Table[ Length ] != BDD_HASH_NODE_DELETED ) ) - { - addbddhnode( HashTable, Table[ Length ] ); - } - } - - freebddhnode( Table ); -} - -/*------------------------------------------------------------\ -| | -| Add Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Add Hash Element | -| | -\------------------------------------------------------------*/ - -bddnode *addbddhnode( HashTable, BddNode ) - - bddhnodetable *HashTable; - bddnode *BddNode; -{ - bddnode *HashNode; - long HashIndex; - long Deleted; - long NumberScan; - char Stop; - - check_bddhnode( BddNode ); - - HashIndex = (*funcbddhnodekey)( HashTable, BddNode ); - Deleted = -1; - - NumberScan = 0; - Stop = 0; - - HashTable->NUMBER_ADD++; - - do - { - HashNode = HashTable->TABLE[ HashIndex ]; - - if ( HashNode == BDD_HASH_NODE_DELETED ) - { - if ( Deleted == -1 ) Deleted = HashIndex; - } - else - if ( ( HashNode == BDD_HASH_NODE_EMPTY ) || - ( ( HashNode->INDEX == BddNode->INDEX ) && - ( HashNode->HIGH == BddNode->HIGH ) && - ( HashNode->LOW == BddNode->LOW ) ) ) - { - if ( HashNode == BDD_HASH_NODE_EMPTY ) - { - HashTable->NUMBER_NODE++; - - if ( Deleted != -1 ) - { - HashIndex = Deleted; - } - - HashNode = BddNode; - } - else - if ( Deleted != -1 ) - { - HashTable->TABLE[ HashIndex ] = BDD_HASH_NODE_DELETED; - - HashIndex = Deleted; - } - - Stop = 1; - } - - NumberScan += 1; - - if ( Stop == 0 ) - { - if ( NumberScan > BDD_HNODE_MAX_SCAN ) - { - if ( Deleted != -1 ) - { - HashTable->TABLE[ Deleted ] = BDD_HASH_NODE_EMPTY; - HashIndex = Deleted; - Deleted = -1; - } - else - { - stretchbddhnodetable( HashTable ); - - HashIndex = (*funcbddhnodekey)( HashTable, BddNode ); - NumberScan = 0; - } - } - else - { - HashIndex = (*funcbddhnodeindex)( HashTable, BddNode, HashIndex ); - } - } - } - while ( Stop == 0 ); - - HashTable->NUMBER_SCAN += NumberScan; - - HashTable->TABLE[ HashIndex ] = HashNode; - - return( HashNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Del Hash Element | -| | -\------------------------------------------------------------*/ - -int delbddhnode( HashTable, BddNode ) - - bddhnodetable *HashTable; - bddnode *BddNode; -{ - bddnode *HashNode; - long HashIndex; - int NumberScan; - - check_bddhnode( BddNode ); - - HashIndex = (*funcbddhnodekey)( HashTable, BddNode ); - NumberScan = 0; - - do - { - HashNode = HashTable->TABLE[ HashIndex ]; - - if ( HashNode == BDD_HASH_NODE_EMPTY ) - { - return( 0 ); - } - - if ( ( HashNode != BDD_HASH_NODE_DELETED ) && - ( HashNode->INDEX == BddNode->INDEX ) && - ( HashNode->HIGH == BddNode->HIGH ) && - ( HashNode->LOW == BddNode->LOW ) ) - { - HashTable->NUMBER_NODE--; - - HashTable->TABLE[ HashIndex ] = BDD_HASH_NODE_DELETED; - - HashTable->NUMBER_SCAN += NumberScan + 1; - - return( 1 ); - } - - NumberScan += 1; - HashIndex = (*funcbddhnodeindex)( HashTable, BddNode, HashIndex ); - - } - while ( NumberScan <= BDD_HNODE_MAX_SCAN ); - - return( 0 ); -} - -/*------------------------------------------------------------\ -| | -| Bdd View Hash Node | -| | -\------------------------------------------------------------*/ - -void viewbddhnode( HashNode ) - - bddnode *HashNode; -{ - fprintf( stdout, "Node INDEX: %ld MARK: %ld REF_EXT: %ld REF_INT: %ld\n", - (long)( HashNode->INDEX ), - (long)( HashNode->MARK ), - (long)( HashNode->REF_EXT ), - (long)( HashNode->REF_INT ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd View Hash Table | -| | -\------------------------------------------------------------*/ - -void viewbddhnodetable( HashTable, FuncView ) - - bddhnodetable *HashTable; - void (*FuncView)(); -{ - bddnode *HashNode; - long HashIndex; - - fprintf( stdout, "--> HashNodeTable\n" ); - fprintf( stdout, " SIZE : %ld\n", HashTable->TABLE_SIZE ); - fprintf( stdout, " NODE : %ld\n", HashTable->NUMBER_NODE ); - fprintf( stdout, " STRETCH : %ld\n", HashTable->NUMBER_STRETCH ); - fprintf( stdout, " RESIZE : %ld\n", HashTable->NUMBER_RESIZE ); - fprintf( stdout, " SCAN : %ld\n", HashTable->NUMBER_SCAN ); - fprintf( stdout, " ADD : %ld\n", HashTable->NUMBER_ADD ); - - if ( FuncView ) - { - for ( HashIndex = 0; HashIndex < HashTable->TABLE_SIZE; HashIndex++ ) - { - HashNode = HashTable->TABLE[ HashIndex ]; - - if ( ( HashNode != BDD_HASH_NODE_EMPTY ) && - ( HashNode != BDD_HASH_NODE_DELETED ) ) - { - fprintf( stdout, " INDEX: %10ld ", HashIndex ); - - (*FuncView)( HashNode ); - } - } - } - - fprintf( stdout, "<-- HashNodeTable\n" ); -} - -/*------------------------------------------------------------\ -| | -| Bdd View Index Node | -| | -\------------------------------------------------------------*/ - -void viewbddindexnode( BddSystem, FuncView ) - - bddsystem *BddSystem; - void (*FuncView)(); -{ - bddindexnode *IndexNode; - bddindex Index; - bddindex NumberIndex; - - if ( BddSystem == (bddsystem *)0 ) - { - BddSystem = BddLocalSystem; - } - - IndexNode = BddSystem->INDEX_NODE; - NumberIndex = BddSystem->NUMBER_INDEX; - - fprintf( stdout, "--> BddIndexNode\n" ); - - for ( Index = 0; Index < NumberIndex; Index++ ) - { - fprintf( stdout, "--> INDEX_NODE[ %d ]\n", Index ); - - viewbddhnodetable( IndexNode[ Index ], FuncView ); - - fprintf( stdout, "<-- INDEX_NODE[ %d ]\n", Index ); - } - - fprintf( stdout, "<-- BddIndexNode\n" ); -} - -/*------------------------------------------------------------\ -| | -| Bdd View Variable Node | -| | -\------------------------------------------------------------*/ - -void viewbddvarnode( BddSystem, FuncView ) - - bddsystem *BddSystem; - void (*FuncView)(); -{ - bddvarnode *VarNode; - bddindex Index; - bddindex NumberIndex; - - if ( BddSystem == (bddsystem *)0 ) - { - BddSystem = BddLocalSystem; - } - - VarNode = BddSystem->VAR_NODE; - NumberIndex = BddSystem->NUMBER_INDEX; - - fprintf( stdout, "--> BddVarNode\n" ); - - for ( Index = 0; Index < NumberIndex; Index++ ) - { - fprintf( stdout, "--> VAR_NODE[ %d ] : ", Index ); - - if ( FuncView ) - { - (*FuncView)( VarNode[ Index ] ); - } - else - { - fprintf( stdout, "\n" ); - } - } - - fprintf( stdout, "<-- BddVarNode\n" ); -} diff --git a/alliance/src/bdd/src/bddhnode.h b/alliance/src/bdd/src/bddhnode.h deleted file mode 100644 index 13cc2215..00000000 --- a/alliance/src/bdd/src/bddhnode.h +++ /dev/null @@ -1,93 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Bdd | -| | -| File : bddhnode.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_HNODE_H -# define BDD_HNODE_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# define HNODE_STRETCH_FACTOR 150 -# define HNODE_RESIZE_FACTOR 175 -# define HNODE_MIN_FILL_FACTOR 20 -# define HNODE_MAX_SCAN 30 - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -# define check_bddhnode( N ) \ - \ - do { if ( ( (N) == BDD_HASH_NODE_EMPTY ) || \ - ( (N) == BDD_HASH_NODE_DELETED ) ) \ - { \ - bdderror( BDD_HNODE_KEY_ERROR, (N) ); \ - \ - } } while (0) - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - - extern void resizebddhnodetable __P((bddhnodetable *HashTable)); - -# endif diff --git a/alliance/src/bdd/src/bddhoper.c b/alliance/src/bdd/src/bddhoper.c deleted file mode 100644 index 19c94b32..00000000 --- a/alliance/src/bdd/src/bddhoper.c +++ /dev/null @@ -1,422 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddhoper.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include -# include -# include "bddhoper.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static long (*funcbddhopersize )() = getbddhopersize; - static long (*funcbddhoperkey )() = getbddhoperkey; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Set Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Set Hash Size Function | -| | -\------------------------------------------------------------*/ - -void setbddhoperfunc( FuncSize, FuncKey ) - - long (*FuncSize)(); - long (*FuncKey)(); -{ - if ( FuncSize != 0 ) funcbddhopersize = FuncSize; - else funcbddhopersize = getbddhopersize; - - if ( FuncKey != 0 ) funcbddhoperkey = FuncKey; - else funcbddhoperkey = getbddhoperkey; -} - -/*------------------------------------------------------------\ -| | -| Get Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Get Hash Size | -| | -\------------------------------------------------------------*/ - -long getbddhopersize( Size ) - - long Size; -{ - int Index; - - for ( Index = 0; Index < AUT_MAX_PRIME_NUMBER; Index++ ) - { - if ( AUT_HASH_PRIME_NUMBER[ Index ] > Size ) - { - return( AUT_HASH_PRIME_NUMBER[ Index ] ); - } - } - - if ( ( Size & 1 ) == 0 ) Size++; - - return( Size ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Get Hash Key | -| | -\------------------------------------------------------------*/ - -long getbddhoperkey( Table, Oper, BddLeft, BddRight ) - - bddhopertable *Table; - long Oper; - bddnode *BddLeft; - bddnode *BddRight; -{ - return( ( ((unsigned long)Oper ) + - ((unsigned long)BddLeft >> 1 ) + - ((unsigned long)BddRight << 5 ) ) % Table->TABLE_SIZE ); -} - -/*------------------------------------------------------------\ -| | -| Create Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Create Hash Oper Table | -| | -\------------------------------------------------------------*/ - -bddhopertable *createbddhopertable( Length ) - - long Length; -{ - bddhopertable *HashTable; - bddhoper *Table; - - if ( Length <= 0 ) - { - bdderror( BDD_HOPER_SIZE_ERROR, Length ); - } - - Length = (*funcbddhopersize)( Length ); - - HashTable = allocbddhopertable(); - Table = allocbddhoper( Length ); - - HashTable->TABLE = Table; - HashTable->TABLE_SIZE = Length; - - return( HashTable ); -} - -/*------------------------------------------------------------\ -| | -| Destroy Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Destroy Hash Oper Table | -| | -\------------------------------------------------------------*/ - -void destroybddhopertable( HashTable ) - - bddhopertable *HashTable; -{ - freebddhoper( HashTable->TABLE ); - freebddhopertable( HashTable ); -} - -/*------------------------------------------------------------\ -| | -| Reset Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Reset Hash Oper Table | -| | -\------------------------------------------------------------*/ - -void resetbddhopertable( HashTable ) - - bddhopertable *HashTable; -{ - bddassoc *ScanAssoc; - - if ( HashTable->NUMBER_OPER > 0 ) - { - memset( (void *)HashTable->TABLE, 0, - (size_t)HashTable->TABLE_SIZE * sizeof( bddhoper ) ); - - HashTable->NUMBER_OPER = 0; - HashTable->NUMBER_RESET++; - - if ( BddLocalSystem->ASSOC_RESET ) - { - BddLocalSystem->ASSOC_RESET = 0; - - for ( ScanAssoc = BddLocalSystem->ASSOC; - ScanAssoc != (bddassoc *)0; - ScanAssoc = ScanAssoc->NEXT ) - { - ScanAssoc->CACHE = 0; - } - } - - execbdduserfunc( BddLocalSystem, BDD_FUNC_RESET_HASH_OPER ); - } - - HashTable->NUMBER_ADD = 0; - HashTable->NUMBER_HIT = 0; - HashTable->NUMBER_MISS = 0; -} - -/*------------------------------------------------------------\ -| | -| Add Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Add Hash Element | -| | -\------------------------------------------------------------*/ - -bddhoper *addbddhoper( HashTable, Oper, BddLeft, BddRight, BddFather ) - - bddhopertable *HashTable; - long Oper; - bddnode *BddLeft; - bddnode *BddRight; - bddnode *BddFather; -{ - bddhoper *HashOper; - bddnode *BddSwap; - long HashIndex; - - if ( HashTable->TABLE_FREEZE ) return( (bddhoper *)0 ); - - if ( ( BddLeft == (bddnode *)0 ) || - ( BddRight == (bddnode *)0 ) ) - { - bdderror( BDD_HOPER_KEY_ERROR, 0 ); - } - - if ( ( BddLeft < BddRight ) && - ( ! ( Oper & BDD_OPER_MASK ) ) ) - { - BddSwap = BddRight; - BddRight = BddLeft; - BddLeft = BddSwap; - } - - HashIndex = (*funcbddhoperkey)( HashTable, Oper, BddLeft, BddRight ); - HashOper = &HashTable->TABLE[ HashIndex ]; - - HashTable->NUMBER_ADD++; - - if ( HashOper->LEFT == (bddnode *)0 ) - { - HashTable->NUMBER_OPER++; - } - - HashOper->LEFT = BddLeft; - HashOper->RIGHT = BddRight; - HashOper->OPERATOR = Oper; - HashOper->FATHER = BddFather; - - return( HashOper ); -} - -/*------------------------------------------------------------\ -| | -| Search Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Search Hash Element | -| | -\------------------------------------------------------------*/ - -bddhoper *searchbddhoper( HashTable, Oper, BddLeft, BddRight ) - - bddhopertable *HashTable; - long Oper; - bddnode *BddLeft; - bddnode *BddRight; -{ - bddhoper *HashOper; - bddnode *BddSwap; - long HashIndex; - - if ( HashTable->TABLE_FREEZE ) return( (bddhoper *)0 ); - - if ( ( BddLeft == (bddnode *)0 ) || - ( BddRight == (bddnode *)0 ) ) - { - bdderror( BDD_HOPER_KEY_ERROR, 0 ); - } - - if ( ( BddLeft < BddRight ) && - ( ! ( Oper & BDD_OPER_MASK ) ) ) - { - BddSwap = BddRight; - BddRight = BddLeft; - BddLeft = BddSwap; - } - - HashIndex = (*funcbddhoperkey)( HashTable, Oper, BddLeft, BddRight ); - HashOper = &HashTable->TABLE[ HashIndex ]; - - if ( ( HashOper->OPERATOR == Oper ) && - ( HashOper->LEFT == BddLeft ) && - ( HashOper->RIGHT == BddRight ) ) - { - HashTable->NUMBER_HIT++; - - return( HashOper ); - } - - HashTable->NUMBER_MISS++; - - return( (bddhoper *)0 ); -} - - -/*------------------------------------------------------------\ -| | -| View Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd View Hash Oper | -| | -\------------------------------------------------------------*/ - -void viewbddhoper( HashOper ) - - bddhoper *HashOper; -{ - fprintf( stdout, "OPERATOR: %lx LEFT : %lx RIGHT : %lx FATHER : %lx\n", - HashOper->OPERATOR, - (long)HashOper->LEFT, - (long)HashOper->RIGHT, - (long)HashOper->FATHER ); -} - -/*------------------------------------------------------------\ -| | -| Bdd View Hash Oper Table | -| | -\------------------------------------------------------------*/ - -void viewbddhopertable( HashTable, FuncView ) - - bddhopertable *HashTable; - void (*FuncView)(); -{ - bddhoper *HashOper; - long HashIndex; - - fprintf( stdout, "--> HashOperTable\n" ); - fprintf( stdout, " SIZE : %ld\n", HashTable->TABLE_SIZE ); - fprintf( stdout, " FREEZE : %ld\n", HashTable->TABLE_FREEZE ); - fprintf( stdout, " OPER : %ld\n", HashTable->NUMBER_OPER ); - fprintf( stdout, " ADD : %ld\n", HashTable->NUMBER_ADD ); - fprintf( stdout, " HIT : %ld\n", HashTable->NUMBER_HIT ); - fprintf( stdout, " MISS : %ld\n", HashTable->NUMBER_MISS ); - fprintf( stdout, " RESET : %ld\n", HashTable->NUMBER_RESET ); - - if ( FuncView ) - { - for ( HashIndex = 0; HashIndex < HashTable->TABLE_SIZE; HashIndex++ ) - { - HashOper = &HashTable->TABLE[ HashIndex ]; - - if ( HashOper->LEFT != (bddnode *)0 ) - { - fprintf( stdout, " INDEX: %10ld ", HashIndex ); - - (*FuncView)( HashOper ); - } - } - } - - fprintf( stdout, "<-- HashOperTable\n" ); -} diff --git a/alliance/src/bdd/src/bddhoper.h b/alliance/src/bdd/src/bddhoper.h deleted file mode 100644 index c7e3c223..00000000 --- a/alliance/src/bdd/src/bddhoper.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddhoper.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_HOPER_H -# define BDD_HOPER_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddimply.c b/alliance/src/bdd/src/bddimply.c deleted file mode 100644 index a9edaf87..00000000 --- a/alliance/src/bdd/src/bddimply.c +++ /dev/null @@ -1,229 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddimply.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include - -# include "bddapply.h" -# include "bddimply.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Intersect Bdd Node | -| | -\------------------------------------------------------------*/ - -static bddnode *loc_intersectbdd( BddNode1, BddNode2 ) - - bddnode *BddNode1; - bddnode *BddNode2; -{ - bddhoper *HashOper; - bddnode *BddNode; - bddindex Index1; - bddindex Index2; - - Index1 = BddNode1->INDEX; - Index2 = BddNode2->INDEX; - - if ( Index1 < BDD_INDEX_MIN ) - { - if ( Index1 == BDD_INDEX_ZERO ) - { - return( BddLocalSystem->ZERO ); - } - - return( incbddrefext( BddNode2 ) ); - } - - if ( Index2 < BDD_INDEX_MIN ) - { - if ( Index2 == BDD_INDEX_ZERO ) - { - return( BddLocalSystem->ZERO ); - } - - return( incbddrefext( BddNode1 ) ); - } - - if ( BddNode1 == BddNode2 ) - { - return( incbddrefext( BddNode1 ) ); - } - - HashOper = searchbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_INTERSECT, BddNode1, BddNode2 ); - - if ( HashOper != (bddhoper *)0 ) - { - return( incbddrefext( HashOper->FATHER ) ); - } - - if ( Index1 == Index2 ) - { - BddNode = decbddrefext( loc_intersectbdd( BddNode1->HIGH, BddNode2->HIGH ) ); - - if ( BddNode != BddLocalSystem->ZERO ) - { - BddNode = addbddnode( (bddsystem *)0, Index1, - BddNode, BddLocalSystem->ZERO ); - } - else - { - BddNode = decbddrefext( loc_intersectbdd( BddNode1->LOW, BddNode2->LOW ) ); - - BddNode = addbddnode( (bddsystem *)0, Index1, - BddLocalSystem->ZERO, BddNode ); - } - } - else - if ( BddLocalSystem->INDEX_TO_VAR[ Index1 ] > - BddLocalSystem->INDEX_TO_VAR[ Index2 ] ) - { - BddNode = decbddrefext( loc_intersectbdd( BddNode1, BddNode2->HIGH ) ); - - if ( BddNode != BddLocalSystem->ZERO ) - { - BddNode = addbddnode( (bddsystem *)0, Index2, - BddNode, BddLocalSystem->ZERO ); - } - else - { - BddNode = decbddrefext( loc_intersectbdd( BddNode1, BddNode2->LOW ) ); - - BddNode = addbddnode( (bddsystem *)0, Index2, - BddLocalSystem->ZERO, BddNode ); - } - } - else - { - BddNode = decbddrefext( loc_intersectbdd( BddNode1->HIGH, BddNode2 ) ); - - if ( BddNode != BddLocalSystem->ZERO ) - { - BddNode = addbddnode( (bddsystem *)0, Index1, - BddNode, BddLocalSystem->ZERO ); - } - else - { - BddNode = decbddrefext( loc_intersectbdd( BddNode1->LOW, BddNode2 ) ); - - BddNode = addbddnode( (bddsystem *)0, Index1, - BddLocalSystem->ZERO, BddNode ); - } - } - - addbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_INTERSECT, - BddNode, BddNode1, BddNode2 ); - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Imply Bdd Node | -| | -\------------------------------------------------------------*/ - -bddnode *implybddnode( BddSystem, BddNode1, BddNode2 ) - - bddsystem *BddSystem; - bddnode *BddNode1; - bddnode *BddNode2; -{ - setbddlocalsystem( BddSystem ); - - BddNode2 = decbddrefext( loc_applybddnot( BddNode2 ) ); - BddNode1 = loc_intersectbdd( BddNode1, BddNode2 ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddNode1 ); -} - -/*------------------------------------------------------------\ -| | -| Intersect Bdd Node | -| | -\------------------------------------------------------------*/ - -bddnode *intersectbddnode( BddSystem, BddNode1, BddNode2 ) - - bddsystem *BddSystem; - bddnode *BddNode1; - bddnode *BddNode2; -{ - setbddlocalsystem( BddSystem ); - - BddNode1 = loc_intersectbdd( BddNode1, BddNode2 ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddNode1 ); -} diff --git a/alliance/src/bdd/src/bddimply.h b/alliance/src/bdd/src/bddimply.h deleted file mode 100644 index 112736a0..00000000 --- a/alliance/src/bdd/src/bddimply.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddimply.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_IMPLY_H -# define BDD_IMPLY_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddlog.c b/alliance/src/bdd/src/bddlog.c deleted file mode 100644 index 9e5a31f2..00000000 --- a/alliance/src/bdd/src/bddlog.c +++ /dev/null @@ -1,184 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddlog.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include -# include "bddlog.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Get Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Get Bdd Node One | -| | -\------------------------------------------------------------*/ - -bddnode *getlogbddnodeone() -{ - return( BddLocalSystem->ONE ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Node Zero | -| | -\------------------------------------------------------------*/ - -bddnode *getlogbddnodezero() -{ - return( BddLocalSystem->ZERO ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Node Term | -| | -\------------------------------------------------------------*/ - -bddnode *getlogbddnodeterm( Index ) - - bddindex Index; -{ - if ( Index < BddLocalSystem->NUMBER_INDEX ) - { - return( getbddvarnodebyindex( (bddsystem *)0, Index ) ); - } - - return( addbddvarfirst( (bddsystem *)0 ) ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Node Not | -| | -\------------------------------------------------------------*/ - -bddnode *getlogbddnodenot( BddNode ) - - bddnode *BddNode; -{ - return( applybddnodenot( (bddsystem *)0, BddNode ) ); -} - -/*------------------------------------------------------------\ -| | -| Apply Bdd Node | -| | -\------------------------------------------------------------*/ - -bddnode *applylogbddnode( Oper, BddNode1, BddNode2 ) - - long Oper; - bddnode *BddNode1; - bddnode *BddNode2; -{ - return( applybddnode( (bddsystem *)0, Oper, BddNode1, BddNode2 ) ); -} - -/*------------------------------------------------------------\ -| | -| Convert Bdd Node | -| | -\------------------------------------------------------------*/ - -ablexpr *convertlogbddnode( BddCircuit, BddNode ) - - bddcircuit *BddCircuit; - bddnode *BddNode; -{ - return( convertbddnodeabl( (bddsystem *)0, BddCircuit->NAME_IN, - (bddindex *)0, BddNode ) ); -} - -/*------------------------------------------------------------\ -| | -| Add Bdd Circuit Input | -| | -\------------------------------------------------------------*/ - -short addlogbddcircuitin( BddCircuit, Name ) - - bddcircuit *BddCircuit; - char *Name; -{ - bddnode *BddNode; - - BddNode = addbddcircuitin( BddCircuit, Name, 0, BDD_IN_MODE_LAST ); - - if ( BddNode == (bddnode *)0 ) - { - return( 0 ); - } - - return( BddNode->INDEX ); -} - diff --git a/alliance/src/bdd/src/bddlog.h b/alliance/src/bdd/src/bddlog.h deleted file mode 100644 index 71dd0b06..00000000 --- a/alliance/src/bdd/src/bddlog.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddlog.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_LOG_H -# define BDD_LOG_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddmark.c b/alliance/src/bdd/src/bddmark.c deleted file mode 100644 index 94efbbea..00000000 --- a/alliance/src/bdd/src/bddmark.c +++ /dev/null @@ -1,116 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddmark.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddmark.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static long BddMarkNumberNode = 0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -void -#ifndef __STDC__ -newbddsystemmark( bddsystem *BddSystem ) -#else -newbddsystemmark( BddSystem ) - - bddsystem *BddSystem; -#endif -{ - setbddlocalsystem( BddSystem ); - BddLocalSystem->MARK += 1; -} - -void -#ifndef __STDC__ -setbddnodemark( bddsystem *BddSystem, bddnode *BddNode ) -#else -setbddnodemark( BddSystem, BddNode ) - - bddsystem *BddSystem; - bddnode *BddNode; -#endif -{ - setbddlocalsystem( BddSystem ); - BddNode->MARK = BddLocalSystem->MARK; -} - -int -#ifndef __STDC__ -testbddnodemark( bddsystem *BddSystem, bddnode *BddNode ) -#else -testbddnodemark( BddSystem, BddNode ) - - bddsystem *BddSystem; - bddnode *BddNode; -#endif -{ - setbddlocalsystem( BddSystem ); - return BddNode->MARK == BddLocalSystem->MARK; -} - diff --git a/alliance/src/bdd/src/bddmark.h b/alliance/src/bdd/src/bddmark.h deleted file mode 100644 index e8d7ae5b..00000000 --- a/alliance/src/bdd/src/bddmark.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddmark.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_MARK_H -# define BDD_MARK_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddnode.c b/alliance/src/bdd/src/bddnode.c deleted file mode 100644 index c250c8df..00000000 --- a/alliance/src/bdd/src/bddnode.c +++ /dev/null @@ -1,386 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddnode.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include -# include -# include "bddnode.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static bddnode BddTerminalHighNode = - { - (bddnode *)0, /* HIGH */ - (bddnode *)0, /* LOW */ - BDD_MAX_INDEX, /* INDEX */ - (bddmark)0, /* MARK */ - (bddflag)0, /* FLAG */ - BDD_MAX_REF, /* REF_EXT */ - BDD_MAX_REF /* REF_INT */ - }; - - static bddnode BddTerminalLowNode = - { - (bddnode *)0, /* HIGH */ - (bddnode *)0, /* LOW */ - BDD_MAX_INDEX, /* INDEX */ - (bddmark)0, /* MARK */ - (bddflag)0, /* FLAG */ - BDD_MAX_REF, /* REF_EXT */ - BDD_MAX_REF /* REF_INT */ - }; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Get Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Add Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Add Bdd Node | -| | -\------------------------------------------------------------*/ - -bddnode *addbddnode( BddSystem, Index, High, Low ) - - bddsystem *BddSystem; - bddindex Index; - bddnode *High; - bddnode *Low; -{ - bddblock *BddBlock; - bddnode *BddNode; - bddnode *NewBddNode; - - setbddlocalsystem( BddSystem ); - - if ( Index >= BddLocalSystem->NUMBER_INDEX ) - { - bdderror( BDD_BAD_INDEX_ERROR, Index ); - } - - if ( ( ! IsBddSystemSwapVar( BddLocalSystem ) ) && - ( IsBddSystemExplosionOn( BddLocalSystem ) ) && - ( BddLocalSystem->EXPLOSION_LIMIT <= BddLocalSystem->NUMBER_NODE ) ) - { - if ( ! IsBddSystemExplosion( BddLocalSystem ) ) - { - BddLocalSystem->HASH_OPER->TABLE_FREEZE; - - if ( BddLocalSystem->EXPLOSION_FUNC != NULL ) - { - BddLocalSystem->EXPLOSION_FUNC( BddLocalSystem ); - } - else - { - if ( ! IsBddSystemNoWarning( BddLocalSystem ) ) - { - bddwarning( BDD_DYNAMIC_EXPLOSION_WARNING, - BddLocalSystem->NUMBER_NODE, BddLocalSystem->EXPLOSION_LIMIT ); - } - } - - SetBddSystemExplosion( BddLocalSystem ); - } - - return( BddLocalSystem->ZERO ); - } - - if ( High == (bddnode *)0 ) High = &BddTerminalHighNode; - if ( Low == (bddnode *)0 ) Low = &BddTerminalLowNode; - - if ( High == Low ) - { - return( incbddrefext( High ) ); - } - - BddBlock = BddLocalSystem->BLOCK; - - if ( BddLocalSystem->NODE_FREE == (bddnode *)0 ) - { - if ( ( BddBlock == (bddblock *)0 ) || - ( BddBlock->NODE_FREE == 0 ) ) - { - BddBlock = addbddblock( (bddsystem *)0 ); - } - - BddBlock->NODE_FREE--; - BddNode = &BddBlock->NODE[ BddBlock->NODE_FREE ]; - } - else - { - BddNode = BddLocalSystem->NODE_FREE; - BddLocalSystem->NODE_FREE = BddNode->HIGH; - - BddLocalSystem->NUMBER_FREE--; - } - - BddNode->HIGH = High; - BddNode->LOW = Low; - BddNode->INDEX = Index; - - NewBddNode = addbddhnode( BddLocalSystem->INDEX_NODE[ Index ], BddNode ); - - if ( NewBddNode == BddNode ) - { - incbddrefint( High ); - incbddrefint( Low ); - BddNode->MARK = 0; - BddNode->FLAG = 0; - - BddLocalSystem->NUMBER_NODE++; - - if ( BddLocalSystem->NUMBER_NODE > BddLocalSystem->TOP_NODE ) - { - BddLocalSystem->TOP_NODE = BddLocalSystem->NUMBER_NODE; - } - } - else - { - BddNode->LOW = (bddnode *)0; - BddNode->INDEX = 0; - - BddNode->HIGH = BddLocalSystem->NODE_FREE; - BddLocalSystem->NODE_FREE = BddNode; - - BddLocalSystem->NUMBER_FREE++; - } - - return( incbddrefext( NewBddNode ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Add List Node | -| | -\------------------------------------------------------------*/ - -chain_list *addbddnodelist( BddSystem, HeadList, BddNode ) - - bddsystem *BddSystem; - chain_list *HeadList; - bddnode *BddNode; -{ - chain_list **PrevList; - chain_list *ScanList; - chain_list *NewList; - bddvar *IndexToVar; - bddvar Variable; - bddvar ScanVar; - - setbddlocalsystem( BddSystem ); - - NewList = addchain( (chain_list *)0, (void *)incbddrefext( BddNode ) ); - - if ( HeadList == (chain_list *)0 ) - { - return( NewList ); - } - - IndexToVar = BddLocalSystem->INDEX_TO_VAR; - - PrevList = &HeadList; - ScanList = HeadList; - Variable = IndexToVar[ BddNode->INDEX ]; - - while ( ScanList != (chain_list *)0 ) - { - ScanVar = IndexToVar[ ((bddnode *)ScanList->DATA)->INDEX ]; - - if ( Variable <= ScanVar ) break; - - PrevList = &ScanList->NEXT; - ScanList = ScanList->NEXT; - } - - NewList->NEXT = ScanList; - *PrevList = NewList; - - return( HeadList ); -} - -/*------------------------------------------------------------\ -| | -| Del Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Bdd Del Node | -| | -\------------------------------------------------------------*/ - -static void loc_delbdd( BddNode ) - - bddnode *BddNode; -{ - if ( ( BddNode->REF_INT == 0 ) && - ( BddNode->REF_EXT == 0 ) ) - { - decbddrefint( BddNode->HIGH ); - decbddrefint( BddNode->LOW ); - - loc_delbdd( BddNode->HIGH ); - loc_delbdd( BddNode->LOW ); - - delbddhnode( BddLocalSystem->INDEX_NODE[ BddNode->INDEX ], BddNode ); - - memset( (void *)BddNode, 0, sizeof( bddnode ) ); - - BddNode->HIGH = BddLocalSystem->NODE_FREE; - BddLocalSystem->NODE_FREE = BddNode; - BddLocalSystem->NUMBER_NODE--; - BddLocalSystem->NUMBER_FREE++; - } -} - -/*------------------------------------------------------------\ -| | -| Bdd Del Node | -| | -\------------------------------------------------------------*/ - -void delbddnode( BddSystem, BddNode ) - - bddsystem *BddSystem; - bddnode *BddNode; -{ - long NumberNode; - - setbddlocalsystem( BddSystem ); - - NumberNode = BddLocalSystem->NUMBER_NODE; - - loc_delbdd( BddNode ); - - if ( BddLocalSystem->NUMBER_NODE < NumberNode ) - { - resetbddhopertable( BddLocalSystem->HASH_OPER ); - } -} - -/*------------------------------------------------------------\ -| | -| Bdd Del List Node | -| | -\------------------------------------------------------------*/ - -void delbddnodelist( BddSystem, HeadList ) - - bddsystem *BddSystem; - chain_list *HeadList; -{ - chain_list *ScanList; - - setbddlocalsystem( BddSystem ); - - for ( ScanList = HeadList; - ScanList != (chain_list *)0; - ScanList = ScanList->NEXT ) - { - decbddrefext( (bddnode *)ScanList->DATA ); - } - - freechain( HeadList ); -} - -/*------------------------------------------------------------\ -| | -| View Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd View Node | -| | -\------------------------------------------------------------*/ - -void viewbddnode( BddSystem, BddNode ) - - bddsystem *BddSystem; - bddnode *BddNode; -{ - if ( BddSystem == (bddsystem *)0 ) - { - BddSystem = BddLocalSystem; - } - - fprintf( stdout, - "Node VAR: %ld INDEX: %ld MARK: %ld FLAG: %ld REF_EXT: %ld REF_INT: %ld\n", - (long)( BddSystem->INDEX_TO_VAR[ BddNode->INDEX ] ), - (long)( BddNode->INDEX ), - (long)( BddNode->MARK ), - (long)( BddNode->FLAG ), - (long)( BddNode->REF_EXT ), - (long)( BddNode->REF_INT ) ); -} diff --git a/alliance/src/bdd/src/bddnode.h b/alliance/src/bdd/src/bddnode.h deleted file mode 100644 index 25aa1b84..00000000 --- a/alliance/src/bdd/src/bddnode.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddnode.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_NODE_H -# define BDD_NODE_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddoptimize.c b/alliance/src/bdd/src/bddoptimize.c deleted file mode 100644 index 54c0a2a4..00000000 --- a/alliance/src/bdd/src/bddoptimize.c +++ /dev/null @@ -1,175 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ -/* Includes */ -/*----------------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddoptimize.h" -# include "bdderror.h" - -/*----------------------------------------------------------------------*/ -/* Constant declarations */ -/*----------------------------------------------------------------------*/ - -/* # define DEBUG */ - -/*----------------------------------------------------------------------*/ -/* Type declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Stucture declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Variable declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Macro declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Static function prototypes */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Definition of static functions */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Definition of exported functions */ -/*----------------------------------------------------------------------*/ - -void optimizebddcircuit( BddCircuit, CostFunc, MaxSizeFactor ) - bddcircuit *BddCircuit; - long (*CostFunc)(); - float MaxSizeFactor; -{ - long CurrSize; - long MaxSize; - bddvar StartPos; - bddvar CurrPos; - bddvar BestPos; - long CurrCost; - long BestCost; - bddindex BddIndex; - bddindex NumberIndex; - bddvar NumberVar; - - setbddlocalcircuit( BddCircuit ); - -# ifndef DEBUG - printf( " - optimizing: " ); -# endif - garbagebddsystem( BddLocalSystem ); - - NumberIndex = BddLocalSystem->NUMBER_INDEX; - NumberVar = BddLocalSystem->NUMBER_VAR; - - for ( BddIndex = BDD_INDEX_MIN; BddIndex < NumberIndex; BddIndex++ ) { - -# ifndef DEBUG - putchar( '.' ); fflush( stdout ); -# endif - StartPos = BddLocalSystem->INDEX_TO_VAR[ BddIndex ]; - CurrPos = StartPos; - BestPos = StartPos; - CurrCost = CostFunc( BddLocalCircuit ); - BestCost = CurrCost; - - CurrSize = BddLocalSystem->NUMBER_NODE; - MaxSize = MaxSizeFactor * CurrSize; - - if ( BddLocalSystem->MAX_NODE != 0 && MaxSize > BddLocalSystem->MAX_NODE ) - MaxSize = BddLocalSystem->MAX_NODE; - -# ifdef DEBUG - printf( " swapping index %d [ bddvar = %d ]\n", BddIndex, StartPos ); - printf( " initial cost = %ld\n", CurrCost ); -# endif - - while ( CurrPos < NumberVar - 1 && CurrSize < MaxSize ) { - swapbddvar( BddLocalSystem, CurrPos ); - CurrPos += 1; - CurrSize = BddLocalSystem->NUMBER_NODE; - CurrCost = CostFunc( BddLocalCircuit ); - if ( CurrCost < BestCost ) { -# ifdef DEBUG - printf( " --> BestCost = %ld\n", CurrCost ); -# endif - BestPos = CurrPos; - BestCost = CurrCost; - } - } -# ifdef DEBUG - if ( ! ( CurrSize < MaxSize ) ) - printf( " --> Max Size Limit Reached (%ld)!!!\n", MaxSize ); -# endif - - while ( CurrPos != StartPos ) { - CurrPos -= 1; - swapbddvar( BddLocalSystem, CurrPos ); - } - - CurrSize = BddLocalSystem->NUMBER_NODE; - while ( CurrPos != 0 && CurrSize < MaxSize ) { - CurrPos -= 1; - swapbddvar( BddLocalSystem, CurrPos ); - CurrSize = BddLocalSystem->NUMBER_NODE; - CurrCost = CostFunc( BddLocalCircuit ); - if ( CurrCost < BestCost ) { -# ifdef DEBUG - printf( " --> BestCost = %ld\n", CurrCost ); -# endif - BestPos = CurrPos; - BestCost = CurrCost; - } - } - -# ifdef DEBUG - if ( ! ( CurrSize < MaxSize ) ) - printf( " --> Max Size Limit Reached (%ld)!!!\n", MaxSize ); -# endif - - while ( CurrPos != BestPos) { - swapbddvar( BddLocalSystem, CurrPos ); - CurrPos += 1; - } - } - - garbagebddsystem( BddLocalSystem ); -# ifndef DEBUG - putchar( '\n' ); -# endif -} diff --git a/alliance/src/bdd/src/bddoptimize.h b/alliance/src/bdd/src/bddoptimize.h deleted file mode 100644 index 88755121..00000000 --- a/alliance/src/bdd/src/bddoptimize.h +++ /dev/null @@ -1,66 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __bddoptimize_h -#define __bddoptimize_h - -/*----------------------------------------------------------------------*/ -/* Nested includes */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Constant declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Macro declarations */ -/*----------------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(args) args -# else -# define __P(args) () -# endif -#endif - -/*----------------------------------------------------------------------*/ -/* Type declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Stucture declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Variable declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Function prototypes */ -/*----------------------------------------------------------------------*/ - -#endif /* __bddoptimize_h */ diff --git a/alliance/src/bdd/src/bddreduce.c b/alliance/src/bdd/src/bddreduce.c deleted file mode 100644 index c6b826ff..00000000 --- a/alliance/src/bdd/src/bddreduce.c +++ /dev/null @@ -1,181 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddreduce.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddassoc.h" -# include "bddreduce.h" -# include "bddapply.h" -# include "bddexist.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Reduce Bdd Node | -| | -\------------------------------------------------------------*/ - -static bddnode *loc_reducebdd( BddNode1, BddNode2 ) - - bddnode *BddNode1; - bddnode *BddNode2; -{ - bddhoper *HashOper; - bddnode *BddNode; - bddnode *BddHigh; - bddnode *BddLow; - bddindex Index1; - bddindex Index2; - - Index1 = BddNode1->INDEX; - Index2 = BddNode2->INDEX; - - if ( Index2 < BDD_INDEX_MIN ) - { - if ( Index2 == BDD_INDEX_ZERO ) - { - return( (bddnode *)0 ); - } - - return( incbddrefext( BddNode1 ) ); - } - - if ( Index1 < BDD_INDEX_MIN ) - { - return( BddNode1 ); - } - - HashOper = searchbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_REDUCE, BddNode1, BddNode2 ); - - if ( HashOper != (bddhoper *)0 ) - { - return( incbddrefext( HashOper->FATHER ) ); - } - - if ( BddLocalSystem->INDEX_TO_VAR[ Index1 ] > - BddLocalSystem->INDEX_TO_VAR[ Index2 ] ) - { - BddHigh = loc_applybdd( ABL_OR, BddNode2->HIGH, BddNode2->LOW ); - BddNode = loc_reducebdd( BddNode1, BddHigh ); - decbddrefext( BddHigh ); - } - else - { - if ( Index1 == Index2 ) - { - BddHigh = loc_reducebdd( BddNode1->HIGH, BddNode2->HIGH ); - BddLow = loc_reducebdd( BddNode1->LOW , BddNode2->LOW ); - } - else - { - BddHigh = loc_reducebdd( BddNode1->HIGH, BddNode2 ); - BddLow = loc_reducebdd( BddNode1->LOW , BddNode2 ); - } - - if ( BddHigh == (bddnode *)0 ) BddNode = BddLow; - else - if ( BddLow == (bddnode *)0 ) BddNode = BddHigh; - else - BddNode = addbddnode( (bddsystem *)0, Index1, - decbddrefext( BddHigh ), - decbddrefext( BddLow ) ); - } - - addbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_REDUCE, - BddNode1, BddNode2, BddNode ); - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Reduce Bdd Node | -| | -\------------------------------------------------------------*/ - -bddnode *reducebddnode( BddSystem, BddNode1, BddNode2 ) - - bddsystem *BddSystem; - bddnode *BddNode1; - bddnode *BddNode2; -{ - setbddlocalsystem( BddSystem ); - - BddNode1 = loc_reducebdd( BddNode1, BddNode2 ); - - if ( BddNode1 == (bddnode *)0 ) - { - BddNode1 = BddLocalSystem->ZERO; - } - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddNode1 ); -} - diff --git a/alliance/src/bdd/src/bddreduce.h b/alliance/src/bdd/src/bddreduce.h deleted file mode 100644 index 162d1d15..00000000 --- a/alliance/src/bdd/src/bddreduce.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddreduce.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_REDUCE_H -# define BDD_REDUCE_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddref.c b/alliance/src/bdd/src/bddref.c deleted file mode 100644 index 7dbed8a4..00000000 --- a/alliance/src/bdd/src/bddref.c +++ /dev/null @@ -1,417 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddref.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddref.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Update Reference | -| | -\------------------------------------------------------------*/ - -void updatebddref( BddNode ) - - bddnode *BddNode; -{ - if ( ( BddNode->REF_INT == 0 ) && - ( BddNode->REF_EXT == 0 ) ) - { - decbddrefint( BddNode->HIGH ); - decbddrefint( BddNode->LOW ); - - updatebddref( BddNode->HIGH ); - updatebddref( BddNode->LOW ); - } -} - -/*------------------------------------------------------------\ -| | -| Bdd Inc External Reference | -| | -\------------------------------------------------------------*/ - -bddnode *incbddrefext( BddNode ) - - bddnode *BddNode; -{ - if ( ( BddNode->INDEX >= BDD_INDEX_MIN ) && - ( BddNode->REF_EXT < BDD_MAX_REF ) ) - { - BddNode->REF_EXT++; - - if ( BddNode->REF_EXT == BDD_MAX_REF ) - { - if ( ! IsBddSystemNoWarning( BddLocalSystem ) ) - { - bddwarning( BDD_OVERFLOW_REF_EXT_WARNING, BddNode->INDEX, 0 ); - } - } - } - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Inc Internal Reference | -| | -\------------------------------------------------------------*/ - -bddnode *incbddrefint( BddNode ) - - bddnode *BddNode; -{ - if ( ( BddNode->INDEX >= BDD_INDEX_MIN ) && - ( BddNode->REF_INT < BDD_MAX_REF ) ) - { - BddNode->REF_INT++; - - if ( BddNode->REF_INT == BDD_MAX_REF ) - { - if ( ! IsBddSystemNoWarning( BddLocalSystem ) ) - { - bddwarning( BDD_OVERFLOW_REF_INT_WARNING, BddNode->INDEX, 0 ); - } - } - } - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Dec External Reference | -| | -\------------------------------------------------------------*/ - -bddnode *decbddrefext( BddNode ) - - bddnode *BddNode; -{ - if ( BddNode->INDEX >= BDD_INDEX_MIN ) - { - if ( BddNode->REF_EXT > 0 ) - { - if ( BddNode->REF_EXT < BDD_MAX_REF ) - { - BddNode->REF_EXT--; - } - } - else - { - bdderror( BDD_NEGATIVE_REF_EXT_ERROR, BddNode->INDEX ); - } - } - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Dec Internal Reference | -| | -\------------------------------------------------------------*/ - -bddnode *decbddrefint( BddNode ) - - bddnode *BddNode; -{ - if ( ( BddNode->INDEX >= BDD_INDEX_MIN ) && - ( BddNode->REF_INT > 0 ) && - ( BddNode->REF_INT < BDD_MAX_REF ) ) - { - BddNode->REF_INT--; - } - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Set External Reference | -| | -\------------------------------------------------------------*/ - -bddnode *setbddrefext( BddNode ) - - bddnode *BddNode; -{ - if ( BddNode->INDEX >= BDD_INDEX_MIN ) - { - if ( BddNode->REF_INT > 0 ) - { - if ( BddNode->REF_INT < BDD_MAX_REF ) - { - BddNode->REF_INT--; - } - } - else - { - bdderror( BDD_NEGATIVE_REF_INT_ERROR, BddNode->INDEX ); - } - - if ( BddNode->REF_EXT < BDD_MAX_REF ) - { - BddNode->REF_EXT++; - - if ( BddNode->REF_EXT == BDD_MAX_REF ) - { - if ( ! IsBddSystemNoWarning( BddLocalSystem ) ) - { - bddwarning( BDD_OVERFLOW_REF_EXT_WARNING, BddNode->INDEX, 0 ); - } - } - } - } - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd UnSet External Reference | -| | -\------------------------------------------------------------*/ - -bddnode *unsetbddrefext( BddNode ) - - bddnode *BddNode; -{ - if ( BddNode->INDEX >= BDD_INDEX_MIN ) - { - if ( BddNode->REF_EXT > 0 ) - { - if ( BddNode->REF_EXT < BDD_MAX_REF ) - { - BddNode->REF_EXT--; - } - } - else - { - bdderror( BDD_NEGATIVE_REF_EXT_ERROR, BddNode->INDEX ); - } - - if ( BddNode->REF_INT < BDD_MAX_REF ) - { - BddNode->REF_INT++; - - if ( BddNode->REF_INT == BDD_MAX_REF ) - { - if ( ! IsBddSystemNoWarning( BddLocalSystem ) ) - { - bddwarning( BDD_OVERFLOW_REF_INT_WARNING, BddNode->INDEX, 0 ); - } - } - } - } - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Clear Internal Reference | -| | -\------------------------------------------------------------*/ - -void clearbddsystemrefint( BddSystem ) - - bddsystem *BddSystem; -{ - bddindexnode *IndexNode; - bddhnodetable *HashTable; - bddnode *HashNode; - bddindex *VarToIndex; - bddvar NumberVar; - bddvar Variable; - long HashIndex; - - setbddlocalsystem( BddSystem ); - - NumberVar = BddLocalSystem->NUMBER_VAR; - IndexNode = BddLocalSystem->INDEX_NODE; - VarToIndex = BddLocalSystem->VAR_TO_INDEX; - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - HashTable = IndexNode[ VarToIndex[ Variable ] ]; - - for ( HashIndex = 0; HashIndex < HashTable->TABLE_SIZE; HashIndex++ ) - { - HashNode = HashTable->TABLE[ HashIndex ]; - - if ( ( HashNode != BDD_HASH_NODE_EMPTY ) && - ( HashNode != BDD_HASH_NODE_DELETED ) ) - { - HashNode->REF_INT = 0; - } - } - } -} - -/*------------------------------------------------------------\ -| | -| Bdd Clear External Reference | -| | -\------------------------------------------------------------*/ - -void clearbddsystemrefext( BddSystem ) - - bddsystem *BddSystem; -{ - bddindexnode *IndexNode; - bddhnodetable *HashTable; - bddnode *HashNode; - bddnode *BddNode; - bddindex *VarToIndex; - bddvarnode *VarNode; - bddvar NumberVar; - bddvar Variable; - bddindex Index; - long HashIndex; - - setbddlocalsystem( BddSystem ); - - NumberVar = BddLocalSystem->NUMBER_VAR; - IndexNode = BddLocalSystem->INDEX_NODE; - VarToIndex = BddLocalSystem->VAR_TO_INDEX; - VarNode = BddLocalSystem->VAR_NODE; - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - Index = VarToIndex[ Variable ]; - BddNode = VarNode [ Index ]; - HashTable = IndexNode [ Index ]; - - for ( HashIndex = 0; HashIndex < HashTable->TABLE_SIZE; HashIndex++ ) - { - HashNode = HashTable->TABLE[ HashIndex ]; - - if ( ( HashNode != BDD_HASH_NODE_EMPTY ) && - ( HashNode != BDD_HASH_NODE_DELETED ) && - ( HashNode != BddNode ) ) - { - HashNode->REF_EXT = 0; - } - } - } -} - -/*------------------------------------------------------------\ -| | -| Bdd Clear Reference | -| | -\------------------------------------------------------------*/ - -void clearbddsystemref( BddSystem ) - - bddsystem *BddSystem; -{ - bddindexnode *IndexNode; - bddhnodetable *HashTable; - bddnode *HashNode; - bddnode *BddNode; - bddindex *VarToIndex; - bddvarnode *VarNode; - bddvar NumberVar; - bddvar Variable; - bddindex Index; - long HashIndex; - - setbddlocalsystem( BddSystem ); - - NumberVar = BddLocalSystem->NUMBER_VAR; - IndexNode = BddLocalSystem->INDEX_NODE; - VarToIndex = BddLocalSystem->VAR_TO_INDEX; - VarNode = BddLocalSystem->VAR_NODE; - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - Index = VarToIndex[ Variable ]; - BddNode = VarNode [ Index ]; - HashTable = IndexNode [ Index ]; - - for ( HashIndex = 0; HashIndex < HashTable->TABLE_SIZE; HashIndex++ ) - { - HashNode = HashTable->TABLE[ HashIndex ]; - - if ( ( HashNode != BDD_HASH_NODE_EMPTY ) && - ( HashNode != BDD_HASH_NODE_DELETED ) ) - { - if ( HashNode != BddNode ) - { - HashNode->REF_EXT = 0; - } - - HashNode->REF_INT = 0; - } - } - } -} diff --git a/alliance/src/bdd/src/bddref.h b/alliance/src/bdd/src/bddref.h deleted file mode 100644 index a5a5c826..00000000 --- a/alliance/src/bdd/src/bddref.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddref.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_REF_H -# define BDD_REF_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddrelprod.c b/alliance/src/bdd/src/bddrelprod.c deleted file mode 100644 index 902e1661..00000000 --- a/alliance/src/bdd/src/bddrelprod.c +++ /dev/null @@ -1,228 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddrelprod.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddassoc.h" -# include "bddrelprod.h" -# include "bddapply.h" -# include "bddexist.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Relation Product With Association | -| | -\------------------------------------------------------------*/ - -static bddnode *loc_relprodbddnode( BddNode1, BddNode2 ) - - bddnode *BddNode1; - bddnode *BddNode2; -{ - bddhoper *HashOper; - bddnode *BddRelProd; - bddnode *BddHigh; - bddnode *BddLow; - bddvar NodeVar1; - bddvar NodeVar2; - - if ( ( BddNode1->INDEX < BDD_INDEX_MIN ) || - ( BddNode2->INDEX < BDD_INDEX_MIN ) ) - { - if ( ( BddNode1->INDEX == BDD_INDEX_ZERO ) || - ( BddNode2->INDEX == BDD_INDEX_ZERO ) ) - { - return( BddLocalSystem->ZERO ); - } - - if ( ( BddNode1->INDEX == BDD_INDEX_ONE ) && - ( BddNode2->INDEX == BDD_INDEX_ONE ) ) - { - return( BddLocalSystem->ONE ); - } - - if ( BddNode1->INDEX == BDD_INDEX_ONE ) - { - return( loc_existbddnode( BddNode2 ) ); - } - - return( loc_existbddnode( BddNode1 ) ); - } - - NodeVar1 = BddLocalSystem->INDEX_TO_VAR[ BddNode1->INDEX ]; - NodeVar2 = BddLocalSystem->INDEX_TO_VAR[ BddNode2->INDEX ]; - - if ( ( BddLocalAssoc->LAST < NodeVar1 ) && - ( BddLocalAssoc->LAST < NodeVar2 ) ) - { - return( loc_applybdd( ABL_AND, BddNode1, BddNode2 ) ); - } - - HashOper = searchbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_REL_PROD + BddLocalAssoc->IDENT, - BddNode1, BddNode2 ); - - if ( HashOper != (bddhoper *)0 ) - { - return( incbddrefext( HashOper->FATHER ) ); - } - - if ( NodeVar2 == NodeVar1 ) - { - BddHigh = loc_relprodbddnode( BddNode1->HIGH, BddNode2->HIGH ); - BddRelProd = BddLocalAssocNode[ NodeVar1 ]; - } - else - if ( NodeVar2 > NodeVar1 ) - { - BddHigh = loc_relprodbddnode( BddNode1->HIGH, BddNode2 ); - BddRelProd = BddLocalAssocNode[ NodeVar1 ]; - } - else - { - BddHigh = loc_relprodbddnode( BddNode2->HIGH, BddNode1 ); - BddRelProd = BddLocalAssocNode[ NodeVar2 ]; - } - - if ( ( BddRelProd != (bddnode *)0 ) && - ( BddHigh->INDEX == BDD_INDEX_ONE ) ) - { - BddRelProd = BddHigh; - } - else - { - if ( NodeVar2 == NodeVar1 ) - { - BddLow = loc_relprodbddnode( BddNode1->LOW, BddNode2->LOW ); - } - else - if ( NodeVar2 > NodeVar1 ) - { - BddLow = loc_relprodbddnode( BddNode1->LOW, BddNode2 ); - } - else - { - BddLow = loc_relprodbddnode( BddNode2->LOW, BddNode1 ); - } - - BddHigh = decbddrefext( BddHigh ); - BddLow = decbddrefext( BddLow ); - - if ( BddRelProd != (bddnode *)0 ) - { - BddRelProd = loc_applybdd( ABL_OR, BddHigh, BddLow ); - } - else - if ( NodeVar2 >= NodeVar1 ) - { - BddRelProd = addbddnode( (bddsystem *)0, BddNode1->INDEX, BddHigh, BddLow ); - } - else - { - BddRelProd = addbddnode( (bddsystem *)0, BddNode2->INDEX, BddHigh, BddLow ); - } - } - - addbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_REL_PROD + BddLocalAssoc->IDENT, - BddNode1, BddNode2, BddRelProd ); - - BddLocalAssoc->CACHE = 1; - - return( BddRelProd ); -} - -/*------------------------------------------------------------\ -| | -| Relational Product Bdd Node With Association | -| | -\------------------------------------------------------------*/ - -bddnode *relprodbddnodeassoc( BddSystem, BddNode1, BddNode2, BddAssoc ) - - bddsystem *BddSystem; - bddnode *BddNode1; - bddnode *BddNode2; - bddassoc *BddAssoc; -{ - bddnode *BddRelProd; - - if ( checkbddassoc( BddSystem, BddAssoc, 1 ) == 2 ) - { - return( loc_applybdd( ABL_AND, BddNode1, BddNode2 ) ); - } - - BddLocalAssoc = BddAssoc; - BddLocalAssocNode = BddAssoc->ASSOC_NODE; - - BddRelProd = loc_relprodbddnode( BddNode1, BddNode2 ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddRelProd ); -} diff --git a/alliance/src/bdd/src/bddrelprod.h b/alliance/src/bdd/src/bddrelprod.h deleted file mode 100644 index 29dbc2a3..00000000 --- a/alliance/src/bdd/src/bddrelprod.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddrelprod.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_REL_PROD_H -# define BDD_REL_PROD_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddreorder.c b/alliance/src/bdd/src/bddreorder.c deleted file mode 100644 index beb6d365..00000000 --- a/alliance/src/bdd/src/bddreorder.c +++ /dev/null @@ -1,462 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddorder.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| Modif : Arnaud Caron - 16 Oct 1998 | -| Suppression des bddvartrees. | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddreorder.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Reorder Bdd Variable Window 2 | -| | -\------------------------------------------------------------*/ - -int -#ifdef __STDC__ -reorderbddvarwindow2( bddsystem *BddSystem, bddvar BddVar ) -#else -reorderbddvarwindow2( BddSystem, BddVar ) - - bddsystem *BddSystem; - bddvar BddVar; -#endif -{ - long NumberNode; - - setbddlocalsystem( BddSystem ); - - NumberNode = BddLocalSystem->NUMBER_NODE; - - swapbddvar( BddLocalSystem, BddVar ); - - if ( BddLocalSystem->NUMBER_NODE < NumberNode ) - { - return( 1 ); - } - - swapbddvar( BddLocalSystem, BddVar ); - - return( 0 ); -} - -/*------------------------------------------------------------\ -| | -| Reorder Bdd Variable Window 3 | -| | -\------------------------------------------------------------*/ - -int -#ifdef __STDC__ -reorderbddvarwindow3( bddsystem *BddSystem, bddvar BddVar ) -#else -reorderbddvarwindow3( BddSystem, BddVar ) - - bddsystem *BddSystem; - bddvar BddVar; -#endif -{ - long NumberNode; - char BestOrder; - - setbddlocalsystem( BddSystem ); - - BestOrder = BDD_REORDER_123; - NumberNode = BddLocalSystem->NUMBER_NODE; - - swapbddvar( BddLocalSystem, BddVar ); - - if ( BddLocalSystem->NUMBER_NODE < NumberNode ) - { - NumberNode = BddLocalSystem->NUMBER_NODE; - BestOrder = BDD_REORDER_213; - } - - swapbddvar( BddLocalSystem, BddVar ); - - if ( BddLocalSystem->NUMBER_NODE < NumberNode ) - { - NumberNode = BddLocalSystem->NUMBER_NODE; - BestOrder = BDD_REORDER_231; - } - - swapbddvar( BddLocalSystem, BddVar ); - - if ( BddLocalSystem->NUMBER_NODE < NumberNode ) - { - NumberNode = BddLocalSystem->NUMBER_NODE; - BestOrder = BDD_REORDER_321; - } - - swapbddvar( BddLocalSystem, BddVar ); - - if ( BddLocalSystem->NUMBER_NODE < NumberNode ) - { - NumberNode = BddLocalSystem->NUMBER_NODE; - BestOrder = BDD_REORDER_312; - } - - swapbddvar( BddLocalSystem, BddVar ); - - if ( BddLocalSystem->NUMBER_NODE < NumberNode ) - { - NumberNode = BddLocalSystem->NUMBER_NODE; - BestOrder = BDD_REORDER_132; - } - - switch ( BestOrder ) - { - case BDD_REORDER_123 : swapbddvar( BddLocalSystem, BddVar ); - break; - - case BDD_REORDER_213 : swapbddvar( BddLocalSystem, BddVar ); - swapbddvar( BddLocalSystem, BddVar ); - break; - - case BDD_REORDER_231 : swapbddvar( BddLocalSystem, BddVar ); - swapbddvar( BddLocalSystem, BddVar ); - swapbddvar( BddLocalSystem, BddVar ); - break; - - case BDD_REORDER_321 : swapbddvar( BddLocalSystem, BddVar ); - swapbddvar( BddLocalSystem, BddVar ); - break; - - case BDD_REORDER_312 : swapbddvar( BddLocalSystem, BddVar ); - break; - } - - return( BestOrder != BDD_REORDER_123 ); -} - - -/*------------------------------------------------------------\ -| | -| Reorder Bdd System Simple | -| | -\------------------------------------------------------------*/ - -void -#ifdef __STDC__ -reorderbddsystemsimple( bddsystem *BddSystem ) -#else -reorderbddsystemsimple( BddSystem ) - - bddsystem *BddSystem; -#endif -{ - bddvar BddVar; - - setbddlocalsystem( BddSystem ); - - garbagebddsystem( BddLocalSystem ); - - for ( BddVar = 0; BddVar < BddLocalSystem->NUMBER_VAR - 1; BddVar++ ) - { - if ( BddVar < BddLocalSystem->NUMBER_VAR - 2 ) - { - reorderbddvarwindow3( BddLocalSystem, BddVar ); - } - else - { - reorderbddvarwindow2( BddLocalSystem, BddVar ); - } - } - garbagebddsystem( BddLocalSystem ); -} - -/*------------------------------------------------------------\ -| | -| Reorder Bdd System Window | -| | -\------------------------------------------------------------*/ - -void -#ifdef __STDC__ -reorderbddsystemwindow( bddsystem *BddSystem ) -#else -reorderbddsystemwindow( BddSystem ) - - bddsystem *BddSystem; -#endif -{ - bddvar NumberVar; - bddvar BddVar; - char Moved; - char AnySwap; - char *BddReorderLevel; - - setbddlocalsystem( BddSystem ); - - BddReorderLevel = autallocblock( BddLocalSystem->NUMBER_VAR + 1 ); - - garbagebddsystem( BddLocalSystem ); - - NumberVar = BddLocalSystem->NUMBER_VAR; - - for ( BddVar = 0; BddVar < NumberVar - 1; BddVar++ ) - { - BddReorderLevel[ BddVar ] = 1; - } - - do - { - AnySwap = 0; - - for ( BddVar = 0; BddVar < NumberVar - 1; BddVar++ ) - { - if ( BddReorderLevel[ BddVar ] ) - { - if ( BddVar < NumberVar - 2 ) - { - Moved = reorderbddvarwindow3( BddLocalSystem, BddVar ); - } - else - { - Moved = reorderbddvarwindow2( BddLocalSystem, BddVar ); - } - - if ( Moved ) - { - AnySwap = 1; - - if ( BddVar > 0 ) BddReorderLevel[ BddVar - 1 ] = 1; - if ( BddVar > 1 ) BddReorderLevel[ BddVar - 2 ] = 1; - - BddReorderLevel[ BddVar + 1 ] = 1; - - if ( BddVar < NumberVar - 2 ) BddReorderLevel[ BddVar + 2 ] = 1; - if ( BddVar < NumberVar - 3 ) BddReorderLevel[ BddVar + 3 ] = 1; - if ( BddVar < NumberVar - 4 ) BddReorderLevel[ BddVar + 4 ] = 1; - } - else - { - BddReorderLevel[ BddVar ] = 0; - } - } - } - } - while ( AnySwap ); - - autfreeblock( BddReorderLevel ); - - garbagebddsystem( BddLocalSystem ); -} - -/*------------------------------------------------------------\ -| | -| Reorder Bdd System Top | -| | -\------------------------------------------------------------*/ - -void -#ifdef __STDC__ -reorderbddsystemtop( bddsystem *BddSystem ) -#else -reorderbddsystemtop( BddSystem ) - - bddsystem *BddSystem; -#endif -{ - long NumberNode; - bddvar NumberVar; - bddvar BestVar; - bddvar VarCount; - bddvar VarTo; - bddvar VarFrom; - char SwapReorder; - char *BddReorderLevel; - - setbddlocalsystem( BddSystem ); - - BddReorderLevel = autallocblock( BddLocalSystem->NUMBER_VAR + 1 ); - - garbagebddsystem( BddLocalSystem ); - - NumberVar = BddLocalSystem->NUMBER_VAR; - - for ( VarFrom = 0; VarFrom < ( NumberVar - 1 ); VarFrom++ ) - { - BddReorderLevel[ VarFrom ] = 1; - } - - NumberNode = BddLocalSystem->NUMBER_NODE; - VarCount = NumberVar - 1; - VarFrom = 0; - - while ( VarCount > 0 ) - { -# ifdef BDD_DEBUG - fprintf( stdout, "-> VarFrom %d\n", VarFrom ); -# endif - - BddReorderLevel[ VarFrom ] = 0; - - BestVar = VarFrom; - - for ( VarTo = VarFrom; VarTo < NumberVar - 1; VarTo++ ) - { -# ifdef BDD_DEBUG - fprintf( stdout, "-> Swap %d and %d\n", VarTo, VarTo + 1 ); -# endif - - swapbddvar( BddLocalSystem, VarTo ); - - SwapReorder = BddReorderLevel[ VarTo ]; - BddReorderLevel[ VarTo ] = BddReorderLevel[ VarTo + 1 ]; - BddReorderLevel[ VarTo + 1 ] = SwapReorder; - - if ( BddLocalSystem->NUMBER_NODE < NumberNode ) - { - BestVar = VarTo + 1; NumberNode = BddLocalSystem->NUMBER_NODE; - } - } - -# ifdef BDD_DEBUG - fprintf( stdout, "--> Best one %d\n", BestVar ); - fprintf( stdout, "--> Number nodes %d\n", NumberNode ); -# endif - - for ( VarTo = NumberVar - 1; VarTo > BestVar; VarTo-- ) - { -# ifdef BDD_DEBUG - fprintf( stdout, "-> UnSwap %d and %d\n", VarTo - 1, VarTo ); -# endif - - SwapReorder = BddReorderLevel[ VarTo - 1 ]; - BddReorderLevel[ VarTo - 1 ] = BddReorderLevel[ VarTo ]; - BddReorderLevel[ VarTo ] = SwapReorder; - - swapbddvar( BddLocalSystem, VarTo - 1 ); - } - - while ( ! BddReorderLevel[ VarFrom ] ) - { - VarFrom = VarFrom + 1; - } - - VarCount = VarCount - 1; - } - - autfreeblock( BddReorderLevel ); - - garbagebddsystem( BddLocalSystem ); -} - -/*----------------------------------------------------------------------*/ -/* Reorder Bdd System Sift */ -/*----------------------------------------------------------------------*/ - -void -#ifdef __STDC__ -reorderbddsystemsift( bddsystem *BddSystem ) -#else -reorderbddsystemsift( BddSystem ) - - bddsystem *BddSystem; -#endif -{ - setbddlocalsystem( BddSystem ); - - garbagebddsystem( BddLocalSystem ); - - fprintf( stderr, "reorderbddsystemsift: not implemented\n" ); - - garbagebddsystem( BddLocalSystem ); -} - -/*------------------------------------------------------------\ -| | -| Reorder Bdd System Dynamic | -| | -\------------------------------------------------------------*/ - -void reorderbddsystemdynamic( BddSystem, ReorderFunc, ReorderLow, ReorderRatio ) - - bddsystem *BddSystem; - void (*ReorderFunc)(); - long ReorderLow; - long ReorderRatio; -{ - setbddlocalsystem( BddSystem ); - - if ( ReorderFunc != (void *)0 ) - { - SetBddSystemReorderOn( BddLocalSystem ); - } - else - { - ClearBddSystemReorderOn( BddLocalSystem ); - } - - BddLocalSystem->REORDER_FUNC = ReorderFunc; - BddLocalSystem->REORDER_LOW = ReorderLow; - BddLocalSystem->REORDER_LIMIT = ReorderLow; - BddLocalSystem->REORDER_RATIO = ReorderRatio + 100; -} diff --git a/alliance/src/bdd/src/bddreorder.h b/alliance/src/bdd/src/bddreorder.h deleted file mode 100644 index 7c05f180..00000000 --- a/alliance/src/bdd/src/bddreorder.h +++ /dev/null @@ -1,85 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddreorder.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_REORDER_H -# define BDD_REORDER_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# define BDD_REORDER_123 0 -# define BDD_REORDER_213 1 -# define BDD_REORDER_231 2 -# define BDD_REORDER_321 3 -# define BDD_REORDER_312 4 -# define BDD_REORDER_132 5 - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddresize.c b/alliance/src/bdd/src/bddresize.c deleted file mode 100644 index 747606f6..00000000 --- a/alliance/src/bdd/src/bddresize.c +++ /dev/null @@ -1,205 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddresize.c | -| | -| Date : 03.12.96 | -| | -| Bddhor : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddresize.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -/*------------------------------------------------------------\ -| | -| Bdd Resize Variable Node | -| | -\------------------------------------------------------------*/ - -bddvarnode *resizebddvarnode( BddVarNode, OldNum, NewNum ) - - bddvarnode *BddVarNode; - long OldNum; - long NewNum; -{ - BddAllocInfo.VAR_NODE += NewNum - OldNum; - - return( (bddvarnode *)autresizeblock( (char *)BddVarNode, - sizeof( bddvarnode ) * OldNum, - sizeof( bddvarnode ) * NewNum ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Resize Variable | -| | -\------------------------------------------------------------*/ - -bddvar *resizebddvar( BddVar, OldNum, NewNum ) - - bddvar *BddVar; - long OldNum; - long NewNum; -{ - BddAllocInfo.VAR += NewNum - OldNum; - - return( (bddvar *)autresizeblock( (char *)BddVar, - sizeof( bddvar ) * OldNum, - sizeof( bddvar ) * NewNum ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Resize Index Node | -| | -\------------------------------------------------------------*/ - -bddindexnode *resizebddindexnode( BddIndexNode, OldNum, NewNum ) - - bddindexnode *BddIndexNode; - long OldNum; - long NewNum; -{ - BddAllocInfo.INDEX_NODE += NewNum - OldNum; - - return( (bddindexnode *)autresizeblock( (char *)BddIndexNode, - sizeof( bddindexnode ) * OldNum, - sizeof( bddindexnode ) * NewNum ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Resize Index | -| | -\------------------------------------------------------------*/ - -bddindex *resizebddindex( BddIndex, OldNum, NewNum ) - - bddindex *BddIndex; - long OldNum; - long NewNum; -{ - BddAllocInfo.INDEX += NewNum - OldNum; - - return( (bddindex *)autresizeblock( (char *)BddIndex, - sizeof( bddindex ) * OldNum, - sizeof( bddindex ) * NewNum ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Resize Assoc Node | -| | -\------------------------------------------------------------*/ - -bddassocnode *resizebddassocnode( BddAssocNode, OldNum, NewNum ) - - bddassocnode *BddAssocNode; - long OldNum; - long NewNum; -{ - BddAllocInfo.ASSOC_NODE += NewNum - OldNum; - - return( (bddassocnode *)autresizeblock( (char *)BddAssocNode, - sizeof( bddassocnode ) * OldNum, - sizeof( bddassocnode ) * NewNum ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Resize Name Input | -| | -\------------------------------------------------------------*/ - -bddnamein *resizebddnamein( NameIn, OldNum, NewNum ) - - bddnamein *NameIn; - long OldNum; - long NewNum; -{ - BddAllocInfo.NAME_IN += NewNum - OldNum; - - return( (bddnamein *)autresizeblock( (char *)NameIn, - sizeof( bddnamein ) * OldNum, - sizeof( bddnamein ) * NewNum ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Resize Index Input | -| | -\------------------------------------------------------------*/ - -bddindex *resizebddindexin( IndexIn, OldNum, NewNum ) - - bddindex *IndexIn; - long OldNum; - long NewNum; -{ - BddAllocInfo.INDEX_IN += NewNum - OldNum; - - return( (bddindex *)autresizeblock( (char *)IndexIn, - sizeof( bddindex ) * OldNum, - sizeof( bddindex ) * NewNum ) ); -} diff --git a/alliance/src/bdd/src/bddresize.h b/alliance/src/bdd/src/bddresize.h deleted file mode 100644 index a4ce7dbf..00000000 --- a/alliance/src/bdd/src/bddresize.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddresize.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_RESIZE_H -# define BDD_RESIZE_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddsatisfy.c b/alliance/src/bdd/src/bddsatisfy.c deleted file mode 100644 index ddd1625d..00000000 --- a/alliance/src/bdd/src/bddsatisfy.c +++ /dev/null @@ -1,233 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddsatisfy.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddsatisfy.h" -# include "bddassoc.h" -# include "bddapply.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Satisfy Bdd Node | -| | -\------------------------------------------------------------*/ - -static bddnode *loc_satisfybdd( BddNode ) - - bddnode *BddNode; -{ - if ( BddNode->INDEX >= BDD_INDEX_MIN ) - { - if ( BddNode->HIGH == BddLocalSystem->ZERO ) - { - BddNode = addbddnode( (bddsystem *)0, BddNode->INDEX, - BddLocalSystem->ZERO, - decbddrefext( loc_satisfybdd( BddNode->LOW ) ) ); - } - else - { - BddNode = addbddnode( (bddsystem *)0, BddNode->INDEX, - decbddrefext( loc_satisfybdd( BddNode->HIGH ) ), - BddLocalSystem->ZERO ); - } - } - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Satisfy Bdd Node | -| | -\------------------------------------------------------------*/ - -bddnode *satisfybddnode( BddSystem, BddNode ) - - bddsystem *BddSystem; - bddnode *BddNode; -{ - setbddlocalsystem( BddSystem ); - - if ( BddNode->INDEX == BDD_INDEX_ZERO ) - { - bdderror( BDD_BAD_INDEX_ERROR, BDD_INDEX_ZERO ); - } - - BddNode = loc_satisfybdd( BddNode ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Local Satisfy Bdd Node Assoc | -| | -\------------------------------------------------------------*/ - -static bddnode *loc_satisfybddassoc( BddNode ) - - bddnode *BddNode; -{ - bddnode *NodeVar; - bddvar Variable; - - if ( BddNode->INDEX >= BDD_INDEX_MIN ) - { - if ( BddNode->HIGH == BddLocalSystem->ZERO ) - { - BddNode = addbddnode( (bddsystem *)0, BddNode->INDEX, - BddLocalSystem->ZERO, - decbddrefext( loc_satisfybddassoc( BddNode->LOW ) ) ); - } - else - { - BddNode = addbddnode( (bddsystem *)0, BddNode->INDEX, - decbddrefext( loc_satisfybddassoc( BddNode->HIGH ) ), - BddLocalSystem->ZERO ); - } - - if ( BddNode->INDEX >= BDD_INDEX_MIN ) - { - Variable = BddLocalSystem->INDEX_TO_VAR[ BddNode->INDEX ]; - - if ( ( Variable >= BddLocalAssoc->FIRST ) && - ( Variable <= BddLocalAssoc->LAST ) ) - { - NodeVar = BddLocalSystem->VAR_NODE[ BddNode->INDEX ]; - NodeVar->FLAG |= BDD_FLAG_NUM_MASK; - } - } - } - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Satisfy Bdd Node | -| | -\------------------------------------------------------------*/ - -bddnode *satisfybddnodeassoc( BddSystem, BddNode, BddAssoc ) - - bddsystem *BddSystem; - bddnode *BddNode; - bddassoc *BddAssoc; -{ - bddnode *BddMore; - bddnode *NodeVar; - long Variable; - bddindex Index; - - if ( BddNode->INDEX == BDD_INDEX_ZERO ) - { - bdderror( BDD_BAD_INDEX_ERROR, BDD_INDEX_ZERO ); - } - - if ( checkbddassoc( BddSystem, BddAssoc, 1 ) == 2 ) - { - return( incbddrefext( BddNode ) ); - } - - BddLocalAssoc = BddAssoc; - BddLocalAssocNode = BddAssoc->ASSOC_NODE; - - BddNode = loc_satisfybddassoc( BddNode ); - BddMore = BddLocalSystem->ONE; - - for ( Variable = (long)BddLocalAssoc->LAST; - Variable >= (long)BddLocalAssoc->FIRST; - Variable = Variable - 1 ) - { - if ( BddLocalAssocNode[ Variable ] != (bddnode *)0 ) - { - Index = BddLocalSystem->VAR_TO_INDEX[ Variable ]; - NodeVar = BddLocalSystem->VAR_NODE[ Index ]; - - if ( NodeVar->FLAG & BDD_FLAG_NUM_MASK ) - { - NodeVar->FLAG &= ~BDD_FLAG_NUM_MASK; - } - else - { - BddMore = loc_applybdd( ABL_AND, decbddrefext( BddMore ), NodeVar ); - } - } - } - - BddNode = loc_applybdd( ABL_AND, - decbddrefext( BddNode ), - decbddrefext( BddMore ) ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddNode ); -} diff --git a/alliance/src/bdd/src/bddsatisfy.h b/alliance/src/bdd/src/bddsatisfy.h deleted file mode 100644 index 958576d2..00000000 --- a/alliance/src/bdd/src/bddsatisfy.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddsatisfy.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_SATISFY_H -# define BDD_SATISFY_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddsimpdc.c b/alliance/src/bdd/src/bddsimpdc.c deleted file mode 100644 index f9ef67e2..00000000 --- a/alliance/src/bdd/src/bddsimpdc.c +++ /dev/null @@ -1,325 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddsimpdc.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddapply.h" -# include "bddsimpdc.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Simplify Node Dc On | -| | -\------------------------------------------------------------*/ - -bddnode *loc_simpbdddcon( BddOn, BddDc ) - - bddnode *BddOn; - bddnode *BddDc; -{ - bddhoper *HashOper; - bddnode *BddNode; - bddnode *BddNode1; - - if ( BddDc == BddLocalSystem->ZERO ) - { - return( incbddrefext( BddOn ) ); - } - - if ( BddOn == BddDc ) - { - return( BddLocalSystem->ZERO ); - } - - if ( BddOn->INDEX < BDD_INDEX_MIN ) - { - return( BddOn ); - } - - HashOper = searchbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_SIMP_DC_ON, BddOn, BddDc ); - - if ( HashOper != (bddhoper *)0 ) - { - return( incbddrefext( HashOper->FATHER ) ); - } - - if ( BddOn->INDEX == BddDc->INDEX ) - { - if ( BddDc->HIGH == BddLocalSystem->ONE ) - { - return( loc_simpbdddcon( BddOn->LOW, BddDc->LOW ) ); - } - - if ( BddDc->LOW == BddLocalSystem->ONE ) - { - return( loc_simpbdddcon( BddOn->HIGH, BddDc->HIGH ) ); - } - - if ( BddOn->HIGH == BddLocalSystem->ONE ) - { - BddNode = decbddrefext( loc_applybddnot( BddDc->HIGH ) ); - BddNode1 = decbddrefext( loc_applybdd( ABL_AND, BddOn->LOW, BddNode ) ); - - if ( BddNode1 == BddNode ) - { - BddNode = decbddrefext( loc_applybdd( ABL_AND, BddDc->HIGH, BddDc->LOW ) ); - - return( loc_simpbdddcon( BddOn->LOW, BddNode ) ); - } - } - - if ( BddOn->LOW == BddLocalSystem->ONE ) - { - BddNode = decbddrefext( loc_applybddnot( BddDc->LOW ) ); - BddNode1 = decbddrefext( loc_applybdd( ABL_AND, BddOn->HIGH, BddNode ) ); - - if ( BddNode1 == BddNode ) - { - BddNode = decbddrefext( loc_applybdd( ABL_AND, BddDc->HIGH, BddDc->LOW ) ); - - return( loc_simpbdddcon( BddOn->HIGH, BddNode ) ); - } - } - - BddNode1 = decbddrefext( loc_simpbdddcon( BddOn->HIGH, BddDc->HIGH ) ); - BddNode = decbddrefext( loc_simpbdddcon( BddOn->LOW , BddDc->LOW ) ); - BddNode = addbddnode( (bddsystem *)0, BddOn->INDEX, BddNode1, BddNode ); - } - else - if ( BddLocalSystem->INDEX_TO_VAR[ BddOn->INDEX ] < - BddLocalSystem->INDEX_TO_VAR[ BddDc->INDEX ] ) - { - BddNode1 = decbddrefext( loc_simpbdddcon( BddOn->HIGH, BddDc ) ); - BddNode = decbddrefext( loc_simpbdddcon( BddOn->LOW , BddDc ) ); - BddNode = addbddnode( (bddsystem *)0, BddOn->INDEX, BddNode1, BddNode ); - } - else - { - BddNode1 = decbddrefext( loc_applybdd( ABL_AND, BddDc->HIGH, BddDc->LOW ) ); - BddNode = loc_simpbdddcon( BddOn, BddNode1 ); - } - - addbddhoper( BddLocalSystem->HASH_OPER, BDD_OPER_SIMP_DC_ON, - BddOn, BddDc, BddNode ); - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Bdd Node Dc On | -| | -\------------------------------------------------------------*/ - -bddnode *simpbddnodedcon( BddSystem, BddOn, BddDc ) - - bddsystem *BddSystem; - bddnode *BddOn; - bddnode *BddDc; -{ - bddnode *BddDcOn; - - setbddlocalsystem( BddSystem ); - - BddDcOn = loc_simpbdddcon( BddOn, BddDc ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddDcOn ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Node Dc Off | -| | -\------------------------------------------------------------*/ - -bddnode *loc_simpbdddcoff( BddOff, BddDc ) - - bddnode *BddOff; - bddnode *BddDc; -{ - bddhoper *HashOper; - bddnode *BddNode; - bddnode *BddNode1; - - if ( BddDc == BddLocalSystem->ZERO ) - { - return( incbddrefext( BddOff ) ); - } - - if ( BddOff->INDEX < BDD_INDEX_MIN ) - { - return( BddOff ); - } - - HashOper = searchbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_SIMP_DC_OFF, BddOff, BddDc ); - - if ( HashOper != (bddhoper *)0 ) - { - return( incbddrefext( HashOper->FATHER ) ); - } - - if ( BddOff->INDEX == BddDc->INDEX ) - { - if ( BddDc->HIGH == BddLocalSystem->ONE ) - { - return( loc_simpbdddcoff( BddOff->LOW, BddDc->LOW ) ); - } - - if ( BddDc->LOW == BddLocalSystem->ONE ) - { - return( loc_simpbdddcoff( BddOff->HIGH, BddDc->HIGH ) ); - } - - if ( BddOff->HIGH == BddLocalSystem->ZERO ) - { - BddNode1 = loc_applybdd( ABL_AND, BddOff->LOW, BddDc->HIGH ); - - if ( BddNode1 == BddOff->LOW ) - { - return( BddNode1 ); - } - - decbddrefext( BddNode1 ); - } - - if ( BddOff->LOW == BddLocalSystem->ZERO ) - { - BddNode1 = loc_applybdd( ABL_AND, BddOff->HIGH, BddDc->LOW ); - - if ( BddNode1 == BddOff->HIGH ) - { - return( BddNode1 ); - } - - decbddrefext( BddNode1 ); - } -/*\ - BddOrH = decbddrefext( loc_applybdd( ABL_OR , BddOff->LOW , BddDc->LOW ) ); - BddOrL = decbddrefext( loc_applybdd( ABL_OR , BddOff->HIGH, BddDc->HIGH ) ); - BddAndH = decbddrefext( loc_applybdd( ABL_AND, BddOff->HIGH, BddOrL ) ); - BddAndL = decbddrefext( loc_applybdd( ABL_AND, BddOff->LOW , BddOrH ) ); - - if ( ( BddAndH == BddOff->HIGH ) && - ( BddAndL == BddOff->LOW ) ) - { - BddOrL = decbddrefext( loc_applybdd( ABL_OR , BddOff->LOW, BddOff->HIGH ) ); - BddAndL = decbddrefext( loc_applybdd( ABL_AND, BddDc->LOW , BddDc->HIGH ) ); - BddNode = loc_simpbdddcoff( BddOrL, BddAndL ); - } - else -\*/ - BddNode1 = decbddrefext( loc_simpbdddcoff( BddOff->HIGH, BddDc->HIGH ) ); - BddNode = decbddrefext( loc_simpbdddcoff( BddOff->LOW , BddDc->LOW ) ); - BddNode = addbddnode( (bddsystem *)0, BddOff->INDEX, BddNode1, BddNode ); - } - else - if ( BddLocalSystem->INDEX_TO_VAR[ BddOff->INDEX ] < - BddLocalSystem->INDEX_TO_VAR[ BddDc->INDEX ] ) - { - BddNode1 = decbddrefext( loc_simpbdddcoff( BddOff->HIGH, BddDc ) ); - BddNode = decbddrefext( loc_simpbdddcoff( BddOff->LOW , BddDc ) ); - BddNode = addbddnode( (bddsystem *)0, BddOff->INDEX, BddNode1, BddNode ); - } - else - { - BddNode1 = decbddrefext( loc_applybdd( ABL_AND, BddDc->HIGH, BddDc->LOW ) ); - BddNode = loc_simpbdddcoff( BddOff, BddNode1 ); - } - - addbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_SIMP_DC_OFF, BddOff, BddDc, BddNode ); - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Bdd Node Dc On | -| | -\------------------------------------------------------------*/ - -bddnode *simpbddnodedcoff( BddSystem, BddOff, BddDc ) - - bddsystem *BddSystem; - bddnode *BddOff; - bddnode *BddDc; -{ - bddnode *BddDcOff; - - setbddlocalsystem( BddSystem ); - - BddDcOff = loc_simpbdddcoff( BddOff, BddDc ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddDcOff ); -} diff --git a/alliance/src/bdd/src/bddsimpdc.h b/alliance/src/bdd/src/bddsimpdc.h deleted file mode 100644 index fced84dc..00000000 --- a/alliance/src/bdd/src/bddsimpdc.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddsimpdc.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_SIMP_DC_H -# define BDD_SIMP_DC_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddsubst.c b/alliance/src/bdd/src/bddsubst.c deleted file mode 100644 index 0b543e0e..00000000 --- a/alliance/src/bdd/src/bddsubst.c +++ /dev/null @@ -1,178 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddsubst.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddassoc.h" -# include "bddapply.h" -# include "bddsubst.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Substitute Node With Association | -| | -\------------------------------------------------------------*/ - -static bddnode *loc_substbddnode( BddNode ) - - bddnode *BddNode; -{ - bddhoper *HashOper; - bddnode *BddSubst; - bddnode *BddHigh; - bddnode *BddLow; - bddvar NodeVar; - - NodeVar = BddLocalSystem->INDEX_TO_VAR[ BddNode->INDEX ]; - - if ( BddLocalAssoc->LAST < NodeVar ) - { - return( incbddrefext( BddNode ) ); - } - - HashOper = searchbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_SUBSTITUTE + BddLocalAssoc->IDENT, - BddNode, BddNode ); - - if ( HashOper != (bddhoper *)0 ) - { - return( incbddrefext( HashOper->FATHER ) ); - } - - BddSubst = BddLocalAssocNode[ NodeVar ]; - - if ( BddSubst == (bddnode *)0 ) - { - BddSubst = BddNode; - } - - if ( BddSubst->INDEX < BDD_INDEX_MIN ) - { - if ( BddSubst->INDEX == BDD_INDEX_ONE ) - { - BddSubst = loc_substbddnode( BddNode->HIGH ); - } - else - { - BddSubst = loc_substbddnode( BddNode->LOW ); - } - } - else - { - BddHigh = decbddrefext( loc_substbddnode( BddNode->HIGH ) ); - BddLow = decbddrefext( loc_substbddnode( BddNode->LOW ) ); - - if ( ( BddSubst->INDEX == BddNode->INDEX ) && - ( NodeVar < BddLocalSystem->INDEX_TO_VAR[ BddHigh->INDEX ] ) && - ( NodeVar < BddLocalSystem->INDEX_TO_VAR[ BddLow->INDEX ] ) ) - { - BddSubst = addbddnode( (bddsystem *)0, BddNode->INDEX, BddHigh, BddLow ); - } - else - { - BddSubst = loc_applybddite( BddSubst, BddHigh, BddLow ); - } - } - - addbddhoper( BddLocalSystem->HASH_OPER, - BDD_OPER_SUBSTITUTE + BddLocalAssoc->IDENT, - BddNode, BddNode, BddSubst ); - - BddLocalAssoc->CACHE = 1; - - return( BddSubst ); -} - -/*------------------------------------------------------------\ -| | -| Substitute Bdd Node With Association | -| | -\------------------------------------------------------------*/ - -bddnode *substbddnodeassoc( BddSystem, BddNode, BddAssoc ) - - bddsystem *BddSystem; - bddnode *BddNode; - bddassoc *BddAssoc; -{ - bddnode *BddSubst; - - if ( checkbddassoc( BddSystem, BddAssoc, 1 ) == 2 ) - { - return( incbddrefext( BddNode ) ); - } - - BddLocalAssoc = BddAssoc; - BddLocalAssocNode = BddAssoc->ASSOC_NODE; - - BddSubst = loc_substbddnode( BddNode ); - - checkbddmaxnode( (bddsystem *)0, 1 ); - - return( BddSubst ); -} diff --git a/alliance/src/bdd/src/bddsubst.h b/alliance/src/bdd/src/bddsubst.h deleted file mode 100644 index 17abc04f..00000000 --- a/alliance/src/bdd/src/bddsubst.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddsubst.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_SUBST_H -# define BDD_SUBST_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddsupport.c b/alliance/src/bdd/src/bddsupport.c deleted file mode 100644 index d8fea219..00000000 --- a/alliance/src/bdd/src/bddsupport.c +++ /dev/null @@ -1,292 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddsupport.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddsupport.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static chain_list *BddGetHeadChain = (chain_list *)0; - static ptype_list *BddGetHeadPType = (ptype_list *)0; - static bddvar BddLocalVariable = (bddvar)0; - static long BddGetSupportSize = 0L; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Get Bdd Node Support PType | -| | -\------------------------------------------------------------*/ - -static void loc_getbddsupportptype( BddNode ) - - bddnode *BddNode; -{ - bddnode *BddVarNode; - - if ( ( BddNode->INDEX >= BDD_INDEX_MIN ) && - ( ! testbddnodemark( BddLocalSystem, BddNode ) ) ) - { - BddVarNode = BddLocalSystem->VAR_NODE[ BddNode->INDEX ]; - - if ( ! testbddnodemark( BddLocalSystem, BddVarNode ) ) - { - setbddnodemark( BddLocalSystem, BddVarNode ); - - BddGetHeadPType = addptype( BddGetHeadPType, 0, (void *)BddVarNode ); - } - - setbddnodemark( BddLocalSystem, BddNode ); - - loc_getbddsupportptype( BddNode->HIGH ); - loc_getbddsupportptype( BddNode->LOW ); - } -} - -/*------------------------------------------------------------\ -| | -| Local Get Bdd Node Support Chain | -| | -\------------------------------------------------------------*/ - -static void loc_getbddsupportchain( BddNode ) - - bddnode *BddNode; -{ - bddnode *BddVarNode; - - if ( ( BddNode->INDEX >= BDD_INDEX_MIN ) && - ( ! testbddnodemark( BddLocalSystem, BddNode ) ) ) - { - BddVarNode = BddLocalSystem->VAR_NODE[ BddNode->INDEX ]; - - if ( ! testbddnodemark( BddLocalSystem, BddVarNode ) ) - { - setbddnodemark( BddLocalSystem, BddVarNode ); - - BddGetHeadChain = addchain( BddGetHeadChain, (void *)BddVarNode ); - } - - setbddnodemark( BddLocalSystem, BddNode ); - - loc_getbddsupportchain( BddNode->HIGH ); - loc_getbddsupportchain( BddNode->LOW ); - } -} - -/*------------------------------------------------------------\ -| | -| Bdd Get Node Support | -| | -\------------------------------------------------------------*/ - -void * -#ifdef __STDC__ -getbddnodesupport( bddsystem *BddSystem, bddnode *BddNode, int Mode ) -#else -getbddnodesupport( BddSystem, BddNode, Mode ) - - bddsystem *BddSystem; - bddnode *BddNode; - int Mode; -#endif -{ - setbddlocalsystem( BddSystem ); - newbddsystemmark( BddLocalSystem ); - - if ( Mode == BDD_SUPPORT_CHAIN ) - { - BddGetHeadChain = (chain_list *)0; - loc_getbddsupportchain( BddNode ); - return (void *)BddGetHeadChain; - } - else - { - BddGetHeadPType = (ptype_list *)0; - loc_getbddsupportptype( BddNode ); - return (void *)BddGetHeadPType; - } -} - -/*------------------------------------------------------------\ -| | -| Local Mark Bdd Variable In Support | -| | -\------------------------------------------------------------*/ - -static int -#ifdef __STDC__ -loc_isbddvarinsupport( bddnode *BddNode ) -#else -loc_isbddvarinsupport( BddNode ) - - bddnode *BddNode; -#endif -{ - bddvar Variable; - - Variable = BddLocalSystem->INDEX_TO_VAR[ BddNode->INDEX ]; - - if ( ( BddLocalVariable < Variable ) || - ( testbddnodemark( BddLocalSystem, BddNode ) ) ) - { - return( 0 ); - } - - if ( BddLocalVariable == Variable ) - { - return( 1 ); - } - - setbddnodemark( BddLocalSystem, BddNode ); - - if ( loc_isbddvarinsupport( BddNode->HIGH ) ) - { - return( 1 ); - } - - return loc_isbddvarinsupport( BddNode->LOW ); -} - -/*------------------------------------------------------------\ -| | -| Is Bdd Variable In Support | -| | -\------------------------------------------------------------*/ - -int -#ifdef __STDC__ -isbddvarinsupport( bddsystem *BddSystem, bddnode *BddNode, bddvar Variable ) -#else -isbddvarinsupport( BddSystem, BddNode, Variable ) - - bddsystem *BddSystem; - bddnode *BddNode; - bddvar Variable; -#endif -{ - checkbddvar( BddSystem, Variable, 1 ); - - newbddsystemmark( BddLocalSystem ); - BddLocalVariable = Variable; - - return loc_isbddvarinsupport( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Node Support Size | -| | -\------------------------------------------------------------*/ - -static void -#ifdef __STDC__ -loc_getbddsupportsize( bddnode *BddNode ) -#else -loc_getbddsupportsize( BddNode ) - - bddnode *BddNode; -#endif -{ - bddnode *BddVarNode; - - if ( ( BddNode->INDEX >= BDD_INDEX_MIN ) && - ( ! testbddnodemark( BddLocalSystem, BddNode ) ) ) - { - BddVarNode = BddLocalSystem->VAR_NODE[ BddNode->INDEX ]; - - if ( ! testbddnodemark( BddLocalSystem, BddVarNode ) ) - { - setbddnodemark( BddLocalSystem, BddVarNode ); - - BddGetSupportSize += 1; - } - - setbddnodemark( BddLocalSystem, BddNode ); - - loc_getbddsupportsize( BddNode->HIGH ); - loc_getbddsupportsize( BddNode->LOW ); - } -} - -long -#ifdef __STDC__ -getbddnodesupportsize( bddsystem *BddSystem, bddnode *BddNode ) -#else -getbddnodesupportsize( BddSystem, BddNode ) - - bddsystem *BddSystem; - bddnode *BddNode; -#endif -{ - setbddlocalsystem( BddSystem ); - newbddsystemmark( BddLocalSystem ); - - BddGetSupportSize = 0L; - loc_getbddsupportsize( BddNode ); - return BddGetSupportSize; -} diff --git a/alliance/src/bdd/src/bddsupport.h b/alliance/src/bdd/src/bddsupport.h deleted file mode 100644 index df2e1958..00000000 --- a/alliance/src/bdd/src/bddsupport.h +++ /dev/null @@ -1,80 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddsupport.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_SUPPORT_H -# define BDD_SUPPORT_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# define BDD_MARK_SUPPORT_MASK BDD_MARK_NUM_MASK - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddsweep.c b/alliance/src/bdd/src/bddsweep.c deleted file mode 100644 index a9528155..00000000 --- a/alliance/src/bdd/src/bddsweep.c +++ /dev/null @@ -1,96 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddsweep.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddsweep.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Sweep System | -| | -\------------------------------------------------------------*/ - -void sweepbddsystem( BddSystem ) - - bddsystem *BddSystem; -{ - bddvar NumberVar; - bddvar Variable; - - setbddlocalsystem( BddSystem ); - - resetbddhopertable( BddLocalSystem->HASH_OPER ); - - NumberVar = BddLocalSystem->NUMBER_VAR; - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - sweepbddvar( (bddsystem *)0, Variable, 1 ); - } -} diff --git a/alliance/src/bdd/src/bddsweep.h b/alliance/src/bdd/src/bddsweep.h deleted file mode 100644 index 859f4835..00000000 --- a/alliance/src/bdd/src/bddsweep.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddgarbage.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_GARBAGE_H -# define BDD_GARBAGE_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddsystem.c b/alliance/src/bdd/src/bddsystem.c deleted file mode 100644 index 443bd122..00000000 --- a/alliance/src/bdd/src/bddsystem.c +++ /dev/null @@ -1,406 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddsystem.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddsystem.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - bddsystem *BddLocalSystem = (bddsystem *)0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Create System | -| | -\------------------------------------------------------------*/ - -bddsystem *createbddsystem( ModelVar, ModelOper, MaxVar, MaxNode ) - - long ModelVar; - long ModelOper; - long MaxVar; - long MaxNode; -{ - bddsystem *BddSystem; - bddnode *BddOne; - bddnode *BddZero; - long MaxIndex; - - MaxIndex = BDD_INDEX_MIN + MaxVar; - - if ( ModelVar <= 0 ) - { - bdderror( BDD_MODEL_VAR_ERROR, ModelVar ); - } - - if ( MaxVar >= BDD_MAX_VAR ) - { - bdderror( BDD_BAD_VAR_ERROR, MaxVar ); - } - - if ( ModelOper <= 0 ) - { - bdderror( BDD_MODEL_OPER_ERROR, ModelOper ); - } - - BddSystem = allocbddsystem(); - - BddSystem->HASH_OPER = createbddhopertable( ModelOper ); - BddSystem->OPER_MODEL = ModelOper; - - BddSystem->MAX_VAR = MaxVar; - BddSystem->MAX_INDEX = MaxIndex; - BddSystem->MAX_NODE = MaxNode; - BddSystem->VAR_NODE = allocbddvarnode( MaxIndex ); - BddSystem->VAR_MODEL = ModelVar; - - BddSystem->INDEX_NODE = allocbddindexnode( MaxIndex ); - BddSystem->INDEX_NODE[ BDD_INDEX_ZERO ] = createbddhnodetable( ModelVar ); - BddSystem->INDEX_NODE[ BDD_INDEX_ONE ] = BddSystem->INDEX_NODE[ BDD_INDEX_ZERO ]; - - BddSystem->VAR_TO_INDEX = allocbddindex( MaxVar ); - BddSystem->INDEX_TO_VAR = allocbddvar( MaxIndex ); - BddSystem->INDEX_TO_VAR[ BDD_INDEX_ZERO ] = BDD_MAX_VAR; - BddSystem->INDEX_TO_VAR[ BDD_INDEX_ONE ] = BDD_MAX_VAR; - - BddSystem->NUMBER_VAR = 0; - BddSystem->NUMBER_INDEX = BDD_INDEX_MIN; - - setbddlocalsystem( BddSystem ); - - createbddblock( (bddsystem *)0 ); - - BddOne = addbddnode( (bddsystem *)0, BDD_INDEX_ONE , (bddnode *)0, (bddnode *)0 ); - BddZero = addbddnode( (bddsystem *)0, BDD_INDEX_ZERO, (bddnode *)0, (bddnode *)0 ); - - BddOne->REF_EXT = BDD_MAX_REF; - BddOne->REF_INT = BDD_MAX_REF; - BddZero->REF_EXT = BDD_MAX_REF; - BddZero->REF_INT = BDD_MAX_REF; - - BddSystem->ONE = BddOne; - BddSystem->ZERO = BddZero; - - BddSystem->VAR_NODE[ BDD_INDEX_ZERO ] = BddZero; - BddSystem->VAR_NODE[ BDD_INDEX_ONE ] = BddOne; - - return( BddSystem ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Reset System | -| | -\------------------------------------------------------------*/ - -void resetbddsystem( BddSystem ) - - bddsystem *BddSystem; -{ - bddindexnode *IndexNode; - bddnode *BddOne; - bddnode *BddZero; - bddindex NumberIndex; - bddindex Index; - - setbddlocalsystem( BddSystem ); - - resetbddblock( (bddsystem *)0 ); - destroybddassoc( (bddsystem *)0 ); - - resetbddhopertable( BddLocalSystem->HASH_OPER ); - - NumberIndex = BddLocalSystem->NUMBER_INDEX; - IndexNode = BddLocalSystem->INDEX_NODE; - - resetbddhnodetable( IndexNode[ BDD_INDEX_ZERO ] ); - - for ( Index = BDD_INDEX_MIN; Index < NumberIndex; Index++ ) - { - resetbddhnodetable( IndexNode[ Index ] ); - } - - BddLocalSystem->NUMBER_VAR = 0; - BddLocalSystem->NUMBER_INDEX = BDD_INDEX_MIN; - BddLocalSystem->FLAGS = 0; - BddLocalSystem->MARK = 0; - - BddOne = addbddnode( (bddsystem *)0, BDD_INDEX_ONE , (bddnode *)0, (bddnode *)0 ); - BddZero = addbddnode( (bddsystem *)0, BDD_INDEX_ZERO, (bddnode *)0, (bddnode *)0 ); - - BddOne->REF_EXT = BDD_MAX_REF; - BddOne->REF_INT = BDD_MAX_REF; - BddZero->REF_EXT = BDD_MAX_REF; - BddZero->REF_INT = BDD_MAX_REF; - - BddLocalSystem->ONE = BddOne; - BddLocalSystem->ZERO = BddZero; - - BddLocalSystem->VAR_NODE[ BDD_INDEX_ZERO ] = BddZero; - BddLocalSystem->VAR_NODE[ BDD_INDEX_ONE ] = BddOne; - - BddLocalSystem->REORDER_LIMIT = BddLocalSystem->REORDER_LOW; -} - -/*------------------------------------------------------------\ -| | -| Bdd Destroy System | -| | -\------------------------------------------------------------*/ - -void destroybddsystem( BddSystem ) - - bddsystem *BddSystem; -{ - bddindexnode *IndexNode; - bddindex NumberIndex; - bddindex Index; - - setbddlocalsystem( BddSystem ); - - destroybddblock( (bddsystem *)0 ); - destroybddassoc( (bddsystem *)0 ); - destroybdduserfunc( (bddsystem *)0 ); - - destroybddhopertable( BddLocalSystem->HASH_OPER ); - - NumberIndex = BddLocalSystem->NUMBER_INDEX; - IndexNode = BddLocalSystem->INDEX_NODE; - - destroybddhnodetable( IndexNode[ BDD_INDEX_ZERO ] ); - - for ( Index = BDD_INDEX_MIN; Index < NumberIndex; Index++ ) - { - destroybddhnodetable( IndexNode[ Index ] ); - } - - freebddvar( BddLocalSystem->INDEX_TO_VAR ); - freebddindex( BddLocalSystem->VAR_TO_INDEX ); - - freebddindexnode( BddLocalSystem->INDEX_NODE ); - freebddvarnode( BddLocalSystem->VAR_NODE ); - - freebddsystem( BddLocalSystem ); - - BddLocalSystem = (bddsystem *)0; -} - -/*------------------------------------------------------------\ -| | -| View Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd View System | -| | -\------------------------------------------------------------*/ - -void viewbddsystem( BddSystem, ViewIndex ) - - bddsystem *BddSystem; - char ViewIndex; -{ - bddvar *IndexToVar; - bddindex *VarToIndex; - bddvar Variable; - bddindex Index; - - if ( BddSystem == (bddsystem *)0 ) - { - BddSystem = BddLocalSystem; - } - - fprintf( stdout, "--> BddSystem\n" ); - - fprintf( stdout, " NUMBER_NODE : %ld\n", BddSystem->NUMBER_NODE ); - fprintf( stdout, " NUMBER_FREE : %ld\n", BddSystem->NUMBER_FREE ); - fprintf( stdout, " MAX_NODE : %ld\n", BddSystem->MAX_NODE ); - fprintf( stdout, " TOP_NODE : %ld\n", BddSystem->TOP_NODE ); - fprintf( stdout, " NUMBER_VAR : %ld\n", BddSystem->NUMBER_VAR ); - fprintf( stdout, " MAX_VAR : %ld\n", BddSystem->MAX_VAR ); - fprintf( stdout, " NUMBER_INDEX : %ld\n", BddSystem->NUMBER_INDEX ); - fprintf( stdout, " MAX_INDEX : %ld\n", BddSystem->MAX_INDEX ); - fprintf( stdout, " ASSOC_RESET : %d\n" , BddSystem->ASSOC_RESET ); - fprintf( stdout, " FLAGS : %lx\n", BddSystem->FLAGS ); - fprintf( stdout, " REORDER_LOW : %ld\n", BddSystem->REORDER_LOW ); - fprintf( stdout, " REORDER_LIMIT : %ld\n", BddSystem->REORDER_LIMIT ); - fprintf( stdout, " REORDER_RATIO : %ld\n", BddSystem->REORDER_RATIO ); - fprintf( stdout, " EXPLOSION_LIMIT : %ld\n", BddSystem->EXPLOSION_LIMIT ); - fprintf( stdout, " VAR_MODEL : %ld\n", BddSystem->VAR_MODEL ); - fprintf( stdout, " OPER_MODEL : %ld\n", BddSystem->OPER_MODEL ); - - if ( ViewIndex ) - { - IndexToVar = BddSystem->INDEX_TO_VAR; - VarToIndex = BddSystem->VAR_TO_INDEX; - - for ( Index = 0; Index < BddSystem->NUMBER_INDEX; Index++ ) - { - fprintf( stdout, " INDEX_TO_VAR[ %d ] = %d\n", - Index, IndexToVar[ Index ] ); - } - - for ( Variable = 0; Variable < BddSystem->NUMBER_VAR; Variable++ ) - { - fprintf( stdout, " VAR_TO_INDEX[ %d ] = %d\n", - Variable, VarToIndex[ Variable ] ); - } - } - - fprintf( stdout, "<-- BddSystem\n" ); -} - -/*------------------------------------------------------------\ -| | -| Bdd View System Info | -| | -\------------------------------------------------------------*/ - -void viewbddsysteminfo( BddSystem ) - - bddsystem *BddSystem; -{ - bddhopertable *HashOper; - bddindexnode *IndexNode; - bddhnodetable *HashTable; - long NumberIndex; - long Index; - long Sum; - long Slot; - long Fill; - long Hit; - long Miss; - long Stretch; - long Resize; - long Scan; - - if ( BddSystem == (bddsystem *)0 ) - { - BddSystem = BddLocalSystem; - } - - HashOper = BddSystem->HASH_OPER; - IndexNode = BddSystem->INDEX_NODE; - - fprintf( stdout, "--> BddSystem Info\n" ); - - Slot = HashOper->TABLE_SIZE; - Fill = ( HashOper->NUMBER_OPER * 100 ) / Slot; - Sum = HashOper->NUMBER_HIT + HashOper->NUMBER_MISS; - - if ( Sum != 0 ) - { - Hit = ( 100 * HashOper->NUMBER_HIT ) / Sum; - Miss = ( 100 * HashOper->NUMBER_MISS ) / Sum; - } - else - { - Hit = Miss = -1; - } - - fprintf( stdout, " HASH_OPER SLOTS : %ld \n", Slot ); - fprintf( stdout, " HASH_OPER FILL RATE : %ld %%\n", Fill ); - fprintf( stdout, " HASH_OPER HIT RATE : %ld %%\n", Hit ); - fprintf( stdout, " HASH_OPER MISS RATE : %ld %%\n", Miss ); - - Slot = 0; - Fill = 0; - Scan = 0; - Stretch = 0; - Resize = 0; - - NumberIndex = BddLocalSystem->NUMBER_INDEX; - - for ( Index = BDD_INDEX_MIN; Index < NumberIndex; Index++ ) - { - HashTable = IndexNode[ Index ]; - - Slot += HashTable->TABLE_SIZE; - Fill += ( HashTable->NUMBER_NODE * 100 ) / HashTable->TABLE_SIZE; - Scan += HashTable->NUMBER_SCAN; - Stretch += HashTable->NUMBER_STRETCH; - Resize += HashTable->NUMBER_RESIZE; - } - - NumberIndex -= BDD_INDEX_MIN; - - Slot /= NumberIndex; - Fill /= NumberIndex; - Scan /= NumberIndex; - Stretch /= NumberIndex; - Resize /= NumberIndex; - - fprintf( stdout, " HASH_NODE SLOTS AVERAGE : %ld \n", Slot ); - fprintf( stdout, " HASH_NODE FILL RATE : %ld %%\n", Fill ); - fprintf( stdout, " HASH_NODE SCAN AVERAGE : %ld \n", Scan ); - fprintf( stdout, " HASH_OPER STRETCH AVERAGE : %ld \n", Stretch ); - fprintf( stdout, " HASH_OPER RESIZE AVERAGE : %ld \n", Resize ); - - fprintf( stdout, "<-- BddSystem Info\n" ); -} diff --git a/alliance/src/bdd/src/bddsystem.h b/alliance/src/bdd/src/bddsystem.h deleted file mode 100644 index 3b2de033..00000000 --- a/alliance/src/bdd/src/bddsystem.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddsystem.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_SYSTEM_H -# define BDD_SYSTEM_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddtest.c b/alliance/src/bdd/src/bddtest.c deleted file mode 100644 index ab4bbfd6..00000000 --- a/alliance/src/bdd/src/bddtest.c +++ /dev/null @@ -1,1864 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddtest.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include -# include -# include - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include "bddtest.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static char TestBuffer[ BDD_TEST_BUFFER_SIZE ]; - static char TestExit = 0; - static char TestLogout = 0; - static char TestViewSumProd = 0; - - static command TestCommandDefine[ BDD_TEST_MAX_COMMAND ] = - { - { "addass" , TestCommandAddAssoc , "in out" }, - { "addaux" , TestCommandAddAuxiliar, "aux out [s|g]" }, - { "addin" , TestCommandAddInput , "in [f|l|b|a] [in]" }, - { "addout" , TestCommandAddOutput , "out" }, - { "cofact" , TestCommandCofactor , "out out" }, - { "compose" , TestCommandCompose , "out in out" }, - { "delass" , TestCommandDelAssoc , "[in]" }, - { "delout" , TestCommandDelOutput , "out" }, - { "dumpcir" , TestCommandDumpCircuit, "name" }, - { "exist" , TestCommandExist , "out [m]" }, - { "forall" , TestCommandForall , "out [m]" }, - { "fraction" , TestCommandFraction , "out" }, - { "garbage" , TestCommandGarbage , "none" }, - { "help" , TestCommandHelp , "[keyword]" }, - { "imply" , TestCommandImply , "out out" }, - { "inter" , TestCommandIntersect , "out out" }, - { "list" , TestCommandHelp , "[keyword]" }, - { "logout" , TestCommandLogout , "none" }, - { "optimize" , TestCommandOptimize , "[s|n]" }, - { "quit" , TestCommandExit , "none" }, - { "reduce" , TestCommandReduce , "out out" }, - { "relprod" , TestCommandRelProduct , "out out" }, - { "renin" , TestCommandRenInput , "in name" }, - { "reorder" , TestCommandReorder , "[s|w|t]" }, - { "restrict" , TestCommandRestrict , "out in 0|1" }, - { "satisfy" , TestCommandSatisfy , "out [a]" }, - { "simpoff" , TestCommandSimpOff , "out out" }, - { "simpon" , TestCommandSimpOn , "out out" }, - { "subst" , TestCommandSubstitute , "out" }, - { "support" , TestCommandSupport , "out" }, - { "swapvar" , TestCommandSwapVar , "variable" }, - { "sweep" , TestCommandSweep , "none" }, - { "viewass" , TestCommandViewAssoc , "none" }, - { "viewblo" , TestCommandViewBlock , "none" }, - { "viewcir" , TestCommandViewCircuit, "none" }, - { "viewhea" , TestCommandViewHeath , "out" }, - { "viewid" , TestCommandViewIndex , "[index]" }, - { "viewin" , TestCommandViewInput , "[in]" }, - { "viewop" , TestCommandViewOper , "none" }, - { "viewout" , TestCommandViewOutput , "[out]" }, - { "viewsum" , TestCommandViewSumProd, "none" }, - { "viewsys" , TestCommandViewSystem , "[i]" }, - }; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Test Get Name | -| | -\------------------------------------------------------------*/ - -static char *TestGetName( Name ) - - char *Name; -{ - char *Scan; - - Scan = strchr( Name, '(' ); - if ( Scan != (char *)0 ) *Scan = ' '; - - Scan = strchr( Name, ')' ); - if ( Scan != (char *)0 ) *Scan = '\0'; - - return( Name ); -} - -/*------------------------------------------------------------\ -| | -| Test Command Compare | -| | -\------------------------------------------------------------*/ - -static int TestCommandCompare( FirstKey, SecondKey ) - - command *FirstKey; - command *SecondKey; -{ - return( strcmp( FirstKey->NAME, SecondKey->NAME ) ); -} - -/*------------------------------------------------------------\ -| | -| Test Get Command Value | -| | -\------------------------------------------------------------*/ - -static command *TestGetCommand( String ) - - char *String; -{ - command Entry; - - Entry.NAME = String; - - return( (command *)bsearch( (char *)(&Entry), - (char *)TestCommandDefine, - BDD_TEST_MAX_COMMAND, - sizeof( command ), - TestCommandCompare ) ); -} - -/*------------------------------------------------------------\ -| | -| Test View Input Element | -| | -\------------------------------------------------------------*/ - -static void TestViewInput( Element ) - - authelem *Element; -{ - fprintf( stdout, "NAME: '%s' ", Element->KEY ); - - viewbddnode( (bddsystem *)0, (bddnode *)( Element->VALUE ) ); -} - -/*------------------------------------------------------------\ -| | -| Test View Node Expression | -| | -\------------------------------------------------------------*/ - -static void TestViewNodeExpr( BddNode ) - - bddnode *BddNode; -{ - chain_list *Expr; - - if ( TestViewSumProd != 2 ) - { - viewbddnode( (bddsystem *)0, BddNode ); - - if ( TestViewSumProd == 1 ) - { - Expr = convertbddcircuitsumabl( (bddcircuit *)0, BddNode ); - } - else - { - Expr = convertbddcircuitabl( (bddcircuit *)0, BddNode ); - } - - viewablexpr( Expr, ABL_VIEW_INFIX ); - delablexpr( Expr ); - } - - fprintf( stdout, "\n" ); - -} - -/*------------------------------------------------------------\ -| | -| Test View Assoc | -| | -\------------------------------------------------------------*/ - -static void TestViewAssoc( Variable, BddNode ) - - bddvar Variable; - bddnode *BddNode; -{ - char *NameIn; - bddindex BddIndex; - - BddIndex = getbddvarindex( BddLocalSystem, Variable ); - NameIn = getbddcircuitinname( BddLocalCircuit, BddIndex ); - - fprintf( stdout, "%s -> ", NameIn ); - TestViewNodeExpr( BddNode ); -} - - -/*------------------------------------------------------------\ -| | -| Test View Output Element | -| | -\------------------------------------------------------------*/ - -static void TestViewOutput( Element ) - - authelem *Element; -{ - fprintf( stdout, "NAME: '%s' ", Element->KEY ); - - TestViewNodeExpr( (bddnode *)( Element->VALUE ) ); -} - -/*------------------------------------------------------------\ -| | -| Command Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Test Command Exit | -| | -\------------------------------------------------------------*/ - -static void TestCommandExit( String ) - - char *String; -{ - fprintf( stdout, "--> exit\n" ); - TestExit = 1; -} - -/*------------------------------------------------------------\ -| | -| Test Command Logout | -| | -\------------------------------------------------------------*/ - -static void TestCommandLogout( String ) - - char *String; -{ - fprintf( stdout, "--> logout\n" ); - TestLogout = 1; -} - -/*------------------------------------------------------------\ -| | -| Test Command Optimize | -| | -\------------------------------------------------------------*/ - -static void TestCommandOptimize( String ) - - char *String; -{ - if ( ( String != (char *)0 ) && - ( String[ 0 ] == 'n' ) ) - { - fprintf( stdout, "--> optimize num nodes\n" ); - fprintf( stdout, "Number nodes before optimization%ld\n", getbddcircuitnumnode( (bddcircuit *)0 )); - - optimizebddcircuit( (bddcircuit *)0, getbddcircuitnumnode, 2.0 ); - - fprintf( stdout, "Number nodes after optimization%ld\n", getbddcircuitnumnode( (bddcircuit *)0 )); - } - - if ( ( String != (char *)0 ) && - ( String[ 0 ] == 's' ) ) - { - fprintf( stdout, "--> optimize size\n" ); - fprintf( stdout, "Size before optimization %ld\n", getbddcircuitsize( (bddcircuit *)0 )); - - optimizebddcircuit( (bddcircuit *)0, getbddcircuitsize, 2.0 ); - - fprintf( stdout, "Size after optimization %ld\n", getbddcircuitsize( (bddcircuit *)0 )); - } - -} - -/*------------------------------------------------------------\ -| | -| Test Command Help | -| | -\------------------------------------------------------------*/ - -static void TestCommandHelp( String ) - - char *String; -{ - command *Command; - int Counter; - - fprintf( stdout, "--> help" ); - - if ( String != (char *)0 ) - { - Command = TestGetCommand( String ); - - if ( Command != (command *)0 ) - { - fprintf( stdout, " %s %s\n", Command->NAME, Command->COMMENT ); - - return; - } - } - - for ( Counter = 0; Counter < BDD_TEST_MAX_COMMAND; Counter++ ) - { - if ( ( Counter & 0x3 ) == 0 ) - { - fprintf( stdout, "\n" ); - } - - fprintf( stdout, " %-8s", TestCommandDefine[ Counter ].NAME ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command View SumProd | -| | -\------------------------------------------------------------*/ - -static void TestCommandViewSumProd( String ) - - char *String; -{ - TestViewSumProd = ( TestViewSumProd + 1 ) % 3; - - fprintf( stdout, "--> viewsum %d\n", TestViewSumProd ); -} - -/*------------------------------------------------------------\ -| | -| Test Command Add Input | -| | -\------------------------------------------------------------*/ - -static void TestCommandAddInput( String ) - - char *String; -{ - bddnode *BddNode; - bddnode *BddNodeIn; - bddindex BddIndex; - char *Scan; - char *NameIn; - char *NameIn2; - long Mode; - - if ( String != (char *)0 ) - { - BddIndex = 0; - Mode = BDD_IN_MODE_LAST; - - Scan = strchr( String, ' ' ); - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - NameIn = TestGetName( String ); - - switch( Scan[ 1 ] ) - { - case 'f' : Mode = BDD_IN_MODE_FIRST; - break; - case 'l' : Mode = BDD_IN_MODE_LAST; - break; - case 'b' : Mode = BDD_IN_MODE_BEFORE; - break; - case 'a' : Mode = BDD_IN_MODE_AFTER; - break; - } - - if ( ( Mode == BDD_IN_MODE_AFTER ) || - ( Mode == BDD_IN_MODE_BEFORE ) ) - { - String = Scan + 2; - Scan = strchr( String, ' ' ); - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - NameIn2 = TestGetName( Scan + 1 ); - - BddNodeIn = searchbddcircuitin( (bddcircuit *)0, NameIn2 ); - - if ( BddNodeIn == (bddnode *)0 ) - { - Mode = BDD_IN_MODE_LAST; - } - else - { - BddIndex = BddNodeIn->INDEX; - String = NameIn2; - } - } - else - { - Mode = BDD_IN_MODE_LAST; - } - } - } - else - { - NameIn = TestGetName( String ); - } - - fprintf( stdout, "--> addin %s %ld %s\n", NameIn, Mode, String ); - BddNode = addbddcircuitin( (bddcircuit *)0, NameIn, BddIndex, Mode ); - - viewbddnode( (bddsystem *)0, BddNode ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Ren Input | -| | -\------------------------------------------------------------*/ - -static void TestCommandRenInput( String ) - - char *String; -{ - bddnode *BddNode; - char *Scan; - char *NameIn; - char *NameIn2; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - NameIn = TestGetName( String ); - NameIn2 = TestGetName( Scan + 1 ); - - fprintf( stdout, "--> renin %s %s\n", NameIn, NameIn2 ); - BddNode = renamebddcircuitin( (bddcircuit *)0, NameIn, NameIn2 ); - - if ( BddNode != (bddnode *)0 ) - { - viewbddnode( (bddsystem *)0, BddNode ); - } - } - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Add Auxiliar | -| | -\------------------------------------------------------------*/ - -static void TestCommandAddAuxiliar( String ) - - char *String; -{ - bddnode *BddNode; - bddnode *BddNodeOut; - char *Scan; - char *NameAux; - long Mode; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - - NameAux = TestGetName( String ); - String = Scan + 1; - - Scan = strchr( String, ' ' ); - Mode = BDD_AUX_MODE_SINGLE; - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - - switch( Scan[ 1 ] ) - { - case 's' : Mode = BDD_AUX_MODE_SINGLE; - break; - case 'g' : Mode = BDD_AUX_MODE_GLOBAL; - break; - } - } - - String = TestGetName( String ); - BddNodeOut = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNodeOut != (bddnode *)0 ) - { - fprintf( stdout, "--> addaux %s %s %ld\n", NameAux, String, Mode ); - BddNode = addbddcircuitaux( (bddcircuit *)0, NameAux, BddNodeOut, (void *)0, Mode ); - - viewbddnode( (bddsystem *)0, BddNode ); - } - } - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Add Assoc | -| | -\------------------------------------------------------------*/ - -static void TestCommandAddAssoc( String ) - - char *String; -{ - bddassoc *BddAssoc; - bddnode *BddNodeIn; - bddnode *BddNodeOut; - char *Scan; - char *NameIn; - bddvar Variable; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan == (char *)0 ) return; - - *Scan = '\0'; - NameIn = TestGetName( String ); - - BddNodeIn = searchbddcircuitin( (bddcircuit *)0, NameIn ); - - if ( BddNodeIn == (bddnode *)0 ) return; - - String = TestGetName( Scan + 1 ); - - BddNodeOut = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNodeOut == (bddnode *)0 ) - { - BddNodeOut = searchbddcircuitin( (bddcircuit *)0, String ); - - if ( BddNodeOut == (bddnode *)0 ) return; - } - - Variable = BddLocalSystem->INDEX_TO_VAR[ BddNodeIn->INDEX ]; - - fprintf( stdout, "--> addassoc %s %s\n", NameIn, String ); - - if ( BddLocalSystem->ASSOC == (bddassoc *)0 ) - { - BddAssoc = addbddassoc( (bddsystem *)0 ); - } - else - { - BddAssoc = BddLocalSystem->ASSOC; - } - - BddAssoc = addbddnodeassoc( (bddsystem *)0, BddAssoc, - Variable , BddNodeOut ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Del Assoc | -| | -\------------------------------------------------------------*/ - -static void TestCommandDelAssoc( String ) - - char *String; -{ - bddassoc *BddAssoc; - bddnode *BddNodeIn; - bddvar Variable; - - BddAssoc = BddLocalSystem->ASSOC; - - if ( BddAssoc != (bddassoc *)0 ) - { - if ( String != (char *)0 ) - { - String = TestGetName( String ); - BddNodeIn = searchbddcircuitin( (bddcircuit *)0, String ); - - if ( BddNodeIn == (bddnode *)0 ) return; - - Variable = BddLocalSystem->INDEX_TO_VAR[ BddNodeIn->INDEX ]; - - fprintf( stdout, "--> delassoc %s\n", String ); - - delbddnodeassoc( (bddsystem *)0, BddAssoc, Variable ); - } - else - { - fprintf( stdout, "--> delassoc\n" ); - - delbddassoc( (bddsystem *)0, BddAssoc ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Test Command View Assoc | -| | -\------------------------------------------------------------*/ - -static void TestCommandViewAssoc( String ) - - char *String; -{ - bddassoc *BddAssoc; - - BddAssoc = BddLocalSystem->ASSOC; - - if ( BddAssoc != (bddassoc *)0 ) - { - fprintf( stdout, "--> viewassoc\n" ); - - viewbddassoc( (bddsystem *)0, BddAssoc, TestViewAssoc ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command View Input | -| | -\------------------------------------------------------------*/ - -static void TestCommandViewInput( String ) - - char *String; -{ - bddnode *BddNode; - - if ( String != (char *)0 ) - { - String = TestGetName( String ); - fprintf( stdout, "--> viewin %s\n", String ); - BddNode = searchbddcircuitin( (bddcircuit *)0, String ); - - if ( BddNode != (bddnode *)0 ) - { - viewbddnode( (bddsystem *)0, BddNode ); - } - else - { - fprintf( stderr, "Input %s doesn't exist\n", String ); - } - } - else - { - viewauthtable( BddLocalCircuit->HASH_IN, TestViewInput ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Add Output | -| | -\------------------------------------------------------------*/ - -static void TestCommandAddOutput( String ) - - char *String; -{ - bddnode *BddNode; - char *Scan; - chain_list *Expr; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - String = TestGetName( String ); - - Expr = strablexpr( Scan + 1, ABL_VIEW_INFIX ); - - if ( Expr != (chain_list *)0 ) - { - BddNode = addbddcircuitabl( (bddcircuit *)0, Expr ); - decbddrefext( BddNode ); - - delablexpr( Expr ); - - fprintf( stdout, "--> addout %s\n", String ); - - BddNode = addbddcircuitout( (bddcircuit *)0, String, BddNode ); - - TestViewNodeExpr( BddNode ); - } - } - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Del Output | -| | -\------------------------------------------------------------*/ - -static void TestCommandDelOutput( String ) - - char *String; -{ - char *Scan; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - } - - String = TestGetName( String ); - - if ( delbddcircuitout( (bddcircuit *)0, String ) ) - { - fprintf( stdout, "--> delout %s\n", String ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Support Output | -| | -\------------------------------------------------------------*/ - -static void TestCommandSupport( String ) - - char *String; -{ - bddnode *BddNode; - chain_list *Support; - chain_list *ScanChain; - - if ( String != (char *)0 ) - { - String = TestGetName( String ); - fprintf( stdout, "--> support %s\n", String ); - BddNode = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNode != (bddnode *)0 ) - { - Support = getbddnodesupportchain( (bddsystem *)0, BddNode ); - - for ( ScanChain = Support; - ScanChain != (chain_list *)0; - ScanChain = ScanChain->NEXT ) - { - viewbddnode( (bddsystem *)0, ScanChain->DATA ); - } - - freechain( Support ); - } - else - { - fprintf( stderr, "Output %s doesn't exist\n", String ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Test Command View Output | -| | -\------------------------------------------------------------*/ - -static void TestCommandViewOutput( String ) - - char *String; -{ - bddnode *BddNode; - - if ( String != (char *)0 ) - { - String = TestGetName( String ); - fprintf( stdout, "--> viewout %s\n", String ); - BddNode = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNode != (bddnode *)0 ) - { - TestViewNodeExpr( BddNode ); - } - else - { - fprintf( stderr, "Output %s doesn't exist\n", String ); - } - } - else - { - viewauthtable( BddLocalCircuit->HASH_OUT, TestViewOutput ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command View Heath | -| | -\------------------------------------------------------------*/ - -static void TestCommandViewHeath( String ) - - char *String; -{ - bddnode *BddNode; - char *Scan; - bddheath *BddHeath; - bddheath *ScanHeath; - chain_list *Expr; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - } - - String = TestGetName( String ); - fprintf( stdout, "--> viewheath %s\n", String ); - BddNode = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNode != (bddnode *)0 ) - { - BddHeath = getbddheath( (bddsystem *)0, BddNode ); - - for ( ScanHeath = BddHeath; - ScanHeath != (bddheath *)0; - ScanHeath = ScanHeath->NEXT ) - { - fprintf( stdout, "Variable: " ); - Expr = convertbddcircuitabl( (bddcircuit *)0, ScanHeath->VAR ); - viewablexpr( Expr, ABL_VIEW_INFIX ); - delablexpr( Expr ); - fprintf( stdout, " Plus: " ); - Expr = convertbddcircuitabl( (bddcircuit *)0, ScanHeath->PLUS ); - viewablexpr( Expr, ABL_VIEW_INFIX ); - delablexpr( Expr ); - fprintf( stdout, " Minus: " ); - - Expr = convertbddcircuitabl( (bddcircuit *)0, ScanHeath->MINUS ); - viewablexpr( Expr, ABL_VIEW_INFIX ); - fprintf( stdout, "\n" ); - delablexpr( Expr ); - } - } - else - { - fprintf( stderr, "Output %s doesn't exist\n", String ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Test Command View Hash Oper | -| | -\------------------------------------------------------------*/ - -static void TestCommandViewOper( String ) - - char *String; -{ - fprintf( stdout, "--> viewop\n" ); - viewbddhopertable( BddLocalSystem->HASH_OPER, viewbddhoper ); -} - -/*------------------------------------------------------------\ -| | -| Test Command View Index Node | -| | -\------------------------------------------------------------*/ - -static void TestCommandViewIndex( String ) - - char *String; -{ - char *Scan; - long Index; - - fprintf( stdout, "--> viewid\n" ); - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - } - - Index = atol( String ); - - if ( checkbddindex( (bddsystem *)0, Index, 0 ) ) - { - viewbddhnodetable( BddLocalSystem->INDEX_NODE[ Index ], TestViewNodeExpr ); - - return; - } - } - - viewbddindexnode( (bddsystem *)0, viewbddhnode ); -} - -/*------------------------------------------------------------\ -| | -| Test Command View Block Node | -| | -\------------------------------------------------------------*/ - -static void TestCommandViewBlock( String ) - - char *String; -{ - fprintf( stdout, "--> viewblo\n" ); - viewbddblock( (bddsystem *)0, viewbddhnode ); -} - -/*------------------------------------------------------------\ -| | -| Test Command View System | -| | -\------------------------------------------------------------*/ - -static void TestCommandViewSystem( String ) - - char *String; -{ - fprintf( stdout, "--> viewsys\n" ); - - if ( ( String != (char *)0 ) && - ( String[ 0 ] == 'i' ) ) - { - viewbddsystem( (bddsystem *)0, 1 ); - } - else - { - viewbddsystem( (bddsystem *)0, 0 ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command View Circuit | -| | -\------------------------------------------------------------*/ - -static void TestCommandViewCircuit( String ) - - char *String; -{ - fprintf( stdout, "--> viewcir\n" ); - viewbddcircuit( (bddcircuit *)0, 1 ); -} - -/*------------------------------------------------------------\ -| | -| Test Command Dump Circuit | -| | -\------------------------------------------------------------*/ - -static void TestCommandDumpCircuit( String ) - - char *String; -{ - if ( String != (char *)0 ) - { - dumpbddcircuit( (bddcircuit *)0, String ); - fprintf( stdout, "--> dumpcir %s\n", String ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Swap Variable | -| | -\------------------------------------------------------------*/ - -static void TestCommandSwapVar( String ) - - char *String; -{ - long Variable; - - if ( String != (char *)0 ) - { - Variable = atol( String ); - - if ( ( checkbddvar( (bddsystem *)0, Variable , 0 ) ) && - ( checkbddvar( (bddsystem *)0, Variable + 1, 0 ) ) ) - { - fprintf( stdout, "--> swapvar %ld with %ld\n", Variable, Variable + 1 ); - - swapbddvar( (bddsystem *)0, Variable ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Sweep | -| | -\------------------------------------------------------------*/ - -static void TestCommandSweep( String ) - - char *String; -{ - fprintf( stdout, "--> sweep\n" ); - fprintf( stdout, "Number nodes before %ld\n", BddLocalSystem->NUMBER_NODE ); - sweepbddsystem( (bddsystem *)0 ); - fprintf( stdout, "Number nodes after %ld\n", BddLocalSystem->NUMBER_NODE ); -} - -/*------------------------------------------------------------\ -| | -| Test Command Garbage Collection | -| | -\------------------------------------------------------------*/ - -static void TestCommandGarbage( String ) - - char *String; -{ - fprintf( stdout, "--> garbage\n" ); - fprintf( stdout, "Number nodes before %ld\n", BddLocalSystem->NUMBER_NODE ); - garbagebddsystem( (bddsystem *)0 ); - fprintf( stdout, "Number nodes after %ld\n", BddLocalSystem->NUMBER_NODE ); -} - -/*------------------------------------------------------------\ -| | -| Test Command Reorder | -| | -\------------------------------------------------------------*/ - -static void TestCommandReorder( String ) - - char *String; -{ - if ( ( String != (char *)0 ) && - ( String[ 0 ] == 'w' ) ) - { - fprintf( stdout, "--> reorder window\n" ); - fprintf( stdout, "Number nodes before %ld\n", BddLocalSystem->NUMBER_NODE ); - - reorderbddsystemwindow( (bddsystem *)0 ); - } - - if ( ( String != (char *)0 ) && - ( String[ 0 ] == 's' ) ) - { - fprintf( stdout, "--> reorder simple\n" ); - fprintf( stdout, "Number nodes before %ld\n", BddLocalSystem->NUMBER_NODE ); - - reorderbddsystemsimple( (bddsystem *)0 ); - } - - if ( ( String != (char *)0 ) && - ( String[ 0 ] == 't' ) ) - { - fprintf( stdout, "--> reorder top\n" ); - fprintf( stdout, "Number nodes before %ld\n", BddLocalSystem->NUMBER_NODE ); - - reorderbddsystemtop( (bddsystem *)0 ); - } - - fprintf( stdout, "Number nodes after %ld\n", BddLocalSystem->NUMBER_NODE ); -} - -/*------------------------------------------------------------\ -| | -| Test Command Restrict | -| | -\------------------------------------------------------------*/ - -static void TestCommandRestrict( String ) - - char *String; -{ - bddnode *BddNodeOut; - bddnode *BddNodeIn; - bddnode *BddNodeOne; - char *Scan; - char *NameOut; - long Value; - bddvar Variable; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan == (char *)0 ) return; - - *Scan = '\0'; - NameOut = TestGetName( String ); - BddNodeOut = searchbddcircuitout( (bddcircuit *)0, NameOut ); - - if ( BddNodeOut == (bddnode *)0 ) return; - - String = Scan + 1; - Scan = strchr( String, ' ' ); - if ( Scan == (char *)0 ) return; - - *Scan = '\0'; - String = TestGetName( String ); - BddNodeIn = searchbddcircuitin( (bddcircuit *)0, String ); - - if ( BddNodeIn == (bddnode *)0 ) return; - - Variable = BddLocalSystem->INDEX_TO_VAR[ BddNodeIn->INDEX ]; - Value = atol( Scan + 1 ); - - if ( Value ) - { - BddNodeOne = BddLocalSystem->ONE; - } - else - { - BddNodeOne = BddLocalSystem->ZERO; - } - - fprintf( stdout, "--> restrict %s %s %ld\n", NameOut, String, Value ); - - BddNodeOut = restrictbddnode( (bddsystem *)0, - BddNodeOut, Variable, BddNodeOne ); - decbddrefext( BddNodeOut ); - - TestViewNodeExpr( BddNodeOut ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Compose | -| | -\------------------------------------------------------------*/ - -static void TestCommandCompose( String ) - - char *String; -{ - bddnode *BddNodeOut; - bddnode *BddNodeIn; - bddnode *BddNodeSubst; - char *Scan; - char *NameOut; - char *NameIn; - bddvar Variable; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan == (char *)0 ) return; - - *Scan = '\0'; - NameOut = TestGetName( String ); - BddNodeOut = searchbddcircuitout( (bddcircuit *)0, NameOut ); - - if ( BddNodeOut == (bddnode *)0 ) return; - - String = Scan + 1; - Scan = strchr( String, ' ' ); - if ( Scan == (char *)0 ) return; - - *Scan = '\0'; - NameIn = TestGetName( String ); - BddNodeIn = searchbddcircuitin( (bddcircuit *)0, NameIn ); - - if ( BddNodeIn == (bddnode *)0 ) return; - - Variable = BddLocalSystem->INDEX_TO_VAR[ BddNodeIn->INDEX ]; - - String = TestGetName( Scan + 1 ); - BddNodeSubst = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNodeSubst == (bddnode *)0 ) return; - - fprintf( stdout, "--> compose %s %s %s\n", NameOut, NameIn, String ); - - BddNodeOut = composebddnode( (bddsystem *)0, - BddNodeOut, Variable, BddNodeSubst ); - decbddrefext( BddNodeOut ); - addbddcircuitout( (bddcircuit *)0, NameOut, BddNodeOut ); - - TestViewNodeExpr( BddNodeOut ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Substitute | -| | -\------------------------------------------------------------*/ - -static void TestCommandSubstitute( String ) - - char *String; -{ - bddassoc *BddAssoc; - bddnode *BddNodeOut; - bddnode *BddNodeSubst; - - BddAssoc = BddLocalSystem->ASSOC; - - if ( BddAssoc != (bddassoc *)0 ) - { - if ( String != (char *)0 ) - { - String = TestGetName( String ); - BddNodeOut = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNodeOut == (bddnode *)0 ) return; - - fprintf( stdout, "--> subst %s\n", String ); - - BddNodeSubst = substbddnodeassoc( (bddsystem *)0, BddNodeOut, BddAssoc ); - decbddrefext( BddNodeSubst ); - - TestViewNodeExpr( BddNodeSubst ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Relational Product | -| | -\------------------------------------------------------------*/ - -static void TestCommandRelProduct( String ) - - char *String; -{ - bddassoc *BddAssoc; - bddnode *BddNodeOut1; - bddnode *BddNodeOut2; - bddnode *BddNodeRelProd; - char *NameOut; - char *Scan; - - BddAssoc = BddLocalSystem->ASSOC; - - if ( BddAssoc != (bddassoc *)0 ) - { - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan == (char *)0 ) return; - *Scan = '\0'; - - NameOut = TestGetName( String ); - BddNodeOut1 = searchbddcircuitout( (bddcircuit *)0, NameOut ); - - if ( BddNodeOut1 == (bddnode *)0 ) return; - - String = TestGetName( Scan + 1 ); - BddNodeOut2 = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNodeOut2 == (bddnode *)0 ) return; - - fprintf( stdout, "--> relprod %s %s\n", NameOut, String ); - - BddNodeRelProd = relprodbddnodeassoc( (bddsystem *)0, BddNodeOut1, - BddNodeOut2, BddAssoc ); - decbddrefext( BddNodeRelProd ); - - TestViewNodeExpr( BddNodeRelProd ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Forall | -| | -\------------------------------------------------------------*/ - -static void TestCommandForall( String ) - - char *String; -{ - bddassoc *BddAssoc; - bddnode *BddNodeOut; - bddnode *BddNodeForall; - char *Scan; - int Miss; - - BddAssoc = BddLocalSystem->ASSOC; - - if ( ( BddAssoc != (bddassoc *)0 ) && - ( BddAssoc->FIRST != BDD_MAX_VAR ) ) - { - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - Miss = 0; - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - if ( Scan[ 1 ] == 'm' ) Miss = 1; - } - - String = TestGetName( String ); - BddNodeOut = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNodeOut == (bddnode *)0 ) return; - - fprintf( stdout, "--> forall %s %d\n", String, Miss ); - - if ( Miss ) - { - BddNodeForall = forallbddnodemissassoc( (bddsystem *)0, BddNodeOut, BddAssoc ); - } - else - { - BddNodeForall = forallbddnodeassoc( (bddsystem *)0, BddNodeOut, BddAssoc ); - } - - decbddrefext( BddNodeForall ); - - TestViewNodeExpr( BddNodeForall ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Exist | -| | -\------------------------------------------------------------*/ - -static void TestCommandExist( String ) - - char *String; -{ - bddassoc *BddAssoc; - bddnode *BddNodeOut; - bddnode *BddNodeExist; - char *Scan; - int Miss; - - BddAssoc = BddLocalSystem->ASSOC; - - if ( ( BddAssoc != (bddassoc *)0 ) && - ( BddAssoc->FIRST != BDD_MAX_VAR ) ) - { - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - Miss = 0; - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - if ( Scan[ 1 ] == 'm' ) Miss = 1; - } - - String = TestGetName( String ); - BddNodeOut = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNodeOut == (bddnode *)0 ) return; - - fprintf( stdout, "--> exist %s %d\n", String, Miss ); - - if ( Miss ) - { - BddNodeExist = existbddnodemissassoc( (bddsystem *)0, BddNodeOut, BddAssoc ); - } - else - { - BddNodeExist = existbddnodeassoc( (bddsystem *)0, BddNodeOut, BddAssoc ); - } - - decbddrefext( BddNodeExist ); - - TestViewNodeExpr( BddNodeExist ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Simp Off | -| | -\------------------------------------------------------------*/ - -static void TestCommandSimpOff( String ) - - char *String; -{ - bddnode *BddNodeOut; - bddnode *BddNodeDc; - char *Scan; - char *NameOut; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan == (char *)0 ) return; - *Scan = '\0'; - - NameOut = TestGetName( String ); - BddNodeOut = searchbddcircuitout( (bddcircuit *)0, NameOut ); - - if ( BddNodeOut == (bddnode *)0 ) return; - - String = TestGetName( Scan + 1 ); - BddNodeDc = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNodeDc == (bddnode *)0 ) return; - - fprintf( stdout, "--> simp off %s with %s\n", NameOut, String ); - - BddNodeOut = simpbddnodedcoff( (bddsystem *)0, BddNodeOut, BddNodeDc ); - - decbddrefext( BddNodeOut ); - addbddcircuitout( (bddcircuit *)0, NameOut, BddNodeOut ); - - TestViewNodeExpr( BddNodeOut ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Simp On | -| | -\------------------------------------------------------------*/ - -static void TestCommandSimpOn( String ) - - char *String; -{ - bddnode *BddNodeOut; - bddnode *BddNodeDc; - char *Scan; - char *NameOut; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan == (char *)0 ) return; - *Scan = '\0'; - - NameOut = TestGetName( String ); - BddNodeOut = searchbddcircuitout( (bddcircuit *)0, NameOut ); - - if ( BddNodeOut == (bddnode *)0 ) return; - - String = TestGetName( Scan + 1 ); - BddNodeDc = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNodeDc == (bddnode *)0 ) return; - - fprintf( stdout, "--> simp on %s with %s\n", NameOut, String ); - - BddNodeOut = simpbddnodedcon( (bddsystem *)0, BddNodeOut, BddNodeDc ); - - decbddrefext( BddNodeOut ); - addbddcircuitout( (bddcircuit *)0, NameOut, BddNodeOut ); - - TestViewNodeExpr( BddNodeOut ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Imply | -| | -\------------------------------------------------------------*/ - -static void TestCommandImply( String ) - - char *String; -{ - bddnode *BddNodeOut1; - bddnode *BddNodeOut2; - char *Scan; - char *NameOut; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan == (char *)0 ) return; - *Scan = '\0'; - - NameOut = TestGetName( String ); - BddNodeOut1 = searchbddcircuitout( (bddcircuit *)0, NameOut ); - - if ( BddNodeOut1 == (bddnode *)0 ) return; - - String = TestGetName( Scan + 1 ); - BddNodeOut2 = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNodeOut2 == (bddnode *)0 ) return; - - fprintf( stdout, "--> imply %s and %s\n", NameOut, String ); - - BddNodeOut1 = implybddnode( (bddsystem *)0, BddNodeOut1, BddNodeOut2 ); - decbddrefext( BddNodeOut1 ); - - TestViewNodeExpr( BddNodeOut1 ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Intersect | -| | -\------------------------------------------------------------*/ - -static void TestCommandIntersect( String ) - - char *String; -{ - bddnode *BddNodeOut1; - bddnode *BddNodeOut2; - char *Scan; - char *NameOut; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan == (char *)0 ) return; - *Scan = '\0'; - - NameOut = TestGetName( String ); - BddNodeOut1 = searchbddcircuitout( (bddcircuit *)0, NameOut ); - - if ( BddNodeOut1 == (bddnode *)0 ) return; - - String = TestGetName( Scan + 1 ); - BddNodeOut2 = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNodeOut2 == (bddnode *)0 ) return; - - fprintf( stdout, "--> intersect %s and %s\n", NameOut, String ); - - BddNodeOut1 = intersectbddnode( (bddsystem *)0, BddNodeOut1, BddNodeOut2 ); - decbddrefext( BddNodeOut1 ); - - TestViewNodeExpr( BddNodeOut1 ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Cofactor | -| | -\------------------------------------------------------------*/ - -static void TestCommandCofactor( String ) - - char *String; -{ - bddnode *BddNodeOut1; - bddnode *BddNodeOut2; - char *Scan; - char *NameOut; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan == (char *)0 ) return; - *Scan = '\0'; - - NameOut = TestGetName( String ); - BddNodeOut1 = searchbddcircuitout( (bddcircuit *)0, NameOut ); - - if ( BddNodeOut1 == (bddnode *)0 ) return; - - String = TestGetName( Scan + 1 ); - BddNodeOut2 = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNodeOut2 == (bddnode *)0 ) return; - - fprintf( stdout, "--> cofactor %s by %s\n", NameOut, String ); - - BddNodeOut1 = cofactorbddnode( (bddsystem *)0, BddNodeOut1, BddNodeOut2 ); - decbddrefext( BddNodeOut1 ); - - TestViewNodeExpr( BddNodeOut1 ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Reduce | -| | -\------------------------------------------------------------*/ - -static void TestCommandReduce( String ) - - char *String; -{ - bddnode *BddNodeOut1; - bddnode *BddNodeOut2; - char *Scan; - char *NameOut; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan == (char *)0 ) return; - *Scan = '\0'; - - NameOut = TestGetName( String ); - BddNodeOut1 = searchbddcircuitout( (bddcircuit *)0, NameOut ); - - if ( BddNodeOut1 == (bddnode *)0 ) return; - - String = TestGetName( Scan + 1 ); - BddNodeOut2 = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNodeOut2 == (bddnode *)0 ) return; - - fprintf( stdout, "--> reduce %s by %s\n", NameOut, String ); - - BddNodeOut1 = reducebddnode( (bddsystem *)0, BddNodeOut1, BddNodeOut2 ); - decbddrefext( BddNodeOut1 ); - - TestViewNodeExpr( BddNodeOut1 ); - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Satisfy | -| | -\------------------------------------------------------------*/ - -static void TestCommandSatisfy( String ) - - char *String; -{ - bddnode *BddNode; - char *Scan; - bddnode *BddSatisfy; - int Assoc; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - Assoc = 0; - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - if ( Scan[ 1 ] == 'a' ) Assoc = 1; - } - - String = TestGetName( String ); - fprintf( stdout, "--> satisfy %s %d\n", String, Assoc ); - BddNode = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNode != (bddnode *)0 ) - { - if ( Assoc ) - { - if ( BddLocalSystem->ASSOC == (bddassoc *)0 ) return; - - BddSatisfy = satisfybddnodeassoc( (bddsystem *)0, BddNode, - BddLocalSystem->ASSOC ); - } - else - { - BddSatisfy = satisfybddnode( (bddsystem *)0, BddNode ); - } - - decbddrefext( BddSatisfy ); - - TestViewNodeExpr( BddSatisfy ); - } - else - { - fprintf( stderr, "Output %s doesn't exist\n", String ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Test Command Fraction | -| | -\------------------------------------------------------------*/ - -static void TestCommandFraction( String ) - - char *String; -{ - bddnode *BddNode; - char *Scan; - double Fraction; - - if ( String != (char *)0 ) - { - Scan = strchr( String, ' ' ); - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - } - - String = TestGetName( String ); - fprintf( stdout, "--> fraction %s\n", String ); - BddNode = searchbddcircuitout( (bddcircuit *)0, String ); - - if ( BddNode != (bddnode *)0 ) - { - Fraction = fractionbddnode( (bddsystem *)0, BddNode ); - fprintf( stdout, "%f\n", Fraction ); - } - else - { - fprintf( stderr, "Output %s doesn't exist\n", String ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Main Loop | -| | -\------------------------------------------------------------*/ - -static int TestMainLoop() -{ - command *Command; - char *Scan; - - TestCommandViewSystem( (char *)0 ); - - TestExit = 0; - - do - { - fprintf( stdout, "\ncommand > " ); - - if ( ! fgets( TestBuffer, BDD_TEST_BUFFER_SIZE, stdin ) ) - { - fprintf( stderr, "Interrupt by user\n" ); - - return( 0 ); - } - - Scan = strchr( TestBuffer, '\n' ); - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; - } - - Scan = strchr( TestBuffer, ' ' ); - - if ( Scan != (char *)0 ) - { - *Scan = '\0'; Scan = Scan + 1; - } - - Command = TestGetCommand( TestBuffer ); - - if ( Command != (command *)0 ) - { - (*Command->FUNCTION)( Scan ); - } - else - { - fprintf( stderr, "syntax error\n" ); - } - } - while ( ( TestExit == 0 ) && - ( TestLogout == 0 ) ); - - return( 1 ); -} - -/*------------------------------------------------------------\ -| | -| Test Bdd Circuit | -| | -\------------------------------------------------------------*/ - -int testbddcircuit( BddCircuit ) - - bddcircuit *BddCircuit; -{ - setbddlocalcircuit( BddCircuit ); - - if ( ! TestLogout ) - { - return( TestMainLoop() ); - } - - return( 0 ); -} diff --git a/alliance/src/bdd/src/bddtest.h b/alliance/src/bdd/src/bddtest.h deleted file mode 100644 index 72c46749..00000000 --- a/alliance/src/bdd/src/bddtest.h +++ /dev/null @@ -1,140 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddtest.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_TEST_H -# define BDD_TEST_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# define BDD_TEST_MAX_COMMAND 42 -# define BDD_TEST_BUFFER_SIZE 512 - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ - - typedef struct command - { - char *NAME; - void (*FUNCTION)(); - char *COMMENT; - - } command; - -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - - static void TestCommandExit(); - static void TestCommandLogout(); - static void TestCommandHelp(); - - static void TestCommandAddInput(); - static void TestCommandRenInput(); - static void TestCommandViewInput(); - static void TestCommandAddOutput(); - static void TestCommandDelOutput(); - static void TestCommandDelAssoc(); - static void TestCommandAddAuxiliar(); - static void TestCommandAddAssoc(); - - static void TestCommandViewSumProd(); - - static void TestCommandViewHeath(); - static void TestCommandViewOutput(); - static void TestCommandViewBlock(); - static void TestCommandViewOper(); - static void TestCommandViewIndex(); - static void TestCommandViewAssoc(); - static void TestCommandViewSystem(); - static void TestCommandViewCircuit(); - - static void TestCommandSwapVar(); - static void TestCommandGarbage(); - static void TestCommandSweep(); - static void TestCommandReorder(); - static void TestCommandOptimize(); - - static void TestCommandRestrict(); - static void TestCommandCompose(); - static void TestCommandSubstitute(); - static void TestCommandRelProduct(); - static void TestCommandExist(); - static void TestCommandForall(); - static void TestCommandSimpOff(); - static void TestCommandSimpOn(); - - static void TestCommandIntersect(); - static void TestCommandImply(); - static void TestCommandCofactor(); - static void TestCommandReduce(); - static void TestCommandSatisfy(); - static void TestCommandFraction(); - - static void TestCommandSupport(); - - static void TestCommandDumpCircuit(); - -# endif diff --git a/alliance/src/bdd/src/bddtransfert.c b/alliance/src/bdd/src/bddtransfert.c deleted file mode 100644 index dc1aa57d..00000000 --- a/alliance/src/bdd/src/bddtransfert.c +++ /dev/null @@ -1,129 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -/*----------------------------------------------------------------------*/ -/* Includes */ -/*----------------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddtransfert.h" - -/*----------------------------------------------------------------------*/ -/* Constant declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Type declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Stucture declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Variable declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Macro declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Static function prototypes */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Definition of static functions */ -/*----------------------------------------------------------------------*/ - -/* Performs the recursive step of bddtransfertrec - */ -static bddnode * -transfertbddrec( SystemSrc, SystemDst, Node, HashTable ) - - bddsystem *SystemSrc; - bddsystem *SystemDst; - bddnode *Node; - authtable *HashTable; -{ - authelem *Element; - bddindex Index; - bddnode *High; - bddnode *Low; - bddnode *Res; - - if ( Node == SystemSrc->ONE ) - { - return( SystemDst->ONE ); - } - - if ( Node == SystemSrc->ZERO ) - { - return( SystemDst->ZERO ); - } - - if( ( Element = searchauthelem( HashTable, (char *)Node ) ) != NULL ) - return( (bddnode *)( Element->VALUE ) ); - - Index = Node->INDEX; - - High = transfertbddrec( SystemSrc, SystemDst, Node->HIGH, HashTable ); - Low = transfertbddrec( SystemSrc, SystemDst, Node->LOW, HashTable ); - - Res = addbddnode( SystemDst, Index, High, Low ); - - addauthelem( HashTable, (char *)Node, (long)Res ); - return( Res ); -} - -/*----------------------------------------------------------------------*/ -/* Definition of exported functions */ -/*----------------------------------------------------------------------*/ - -/* Convert a BDD from a system to another one. - */ -bddnode * -transfertbdd( SystemSrc, SystemDst, Node ) - - bddsystem *SystemSrc; - bddsystem *SystemDst; - bddnode *Node; -{ - bddnode *Res; - authtable *HashTable; - - HashTable = createauthtable( 1000 ); - Res = transfertbddrec( SystemSrc, SystemDst, Node, HashTable ); - destroyauthtable( HashTable ); - return( Res ); - -} - diff --git a/alliance/src/bdd/src/bddtransfert.h b/alliance/src/bdd/src/bddtransfert.h deleted file mode 100644 index 46203787..00000000 --- a/alliance/src/bdd/src/bddtransfert.h +++ /dev/null @@ -1,67 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __bddtransfert_h -#define __bddtransfert_h - -/*----------------------------------------------------------------------*/ -/* Nested includes */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Constant declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Macro declarations */ -/*----------------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(args) args -# else -# define __P(args) () -# endif -#endif - -/*----------------------------------------------------------------------*/ -/* Type declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Stucture declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Variable declarations */ -/*----------------------------------------------------------------------*/ - -/*----------------------------------------------------------------------*/ -/* Function prototypes */ -/*----------------------------------------------------------------------*/ - -#endif /* __bddtransfert_h */ - diff --git a/alliance/src/bdd/src/bdduser.c b/alliance/src/bdd/src/bdduser.c deleted file mode 100644 index 2509236e..00000000 --- a/alliance/src/bdd/src/bdduser.c +++ /dev/null @@ -1,208 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bdduser.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bdduser.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Add Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Add User Function | -| | -\------------------------------------------------------------*/ - -bdduserfunc *addbdduserfunc( BddSystem, Type, Func, Data ) - - bddsystem *BddSystem; - long Type; - void (*Func)(); - void *Data; -{ - bdduserfunc *BddUserFunc; - - setbddlocalsystem( BddSystem ); - - BddUserFunc = allocbdduserfunc(); - BddUserFunc->NEXT = BddLocalSystem->USER_FUNC; - BddLocalSystem->USER_FUNC = BddUserFunc; - - BddUserFunc->FUNC = Func; - BddUserFunc->DATA = Data; - BddUserFunc->TYPE = Type; - - return( BddUserFunc ); -} - -/*------------------------------------------------------------\ -| | -| Del Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Del User Function | -| | -\------------------------------------------------------------*/ - -int delbdduserfunc( BddSystem, BddUserFunc ) - - bddsystem *BddSystem; - bdduserfunc *BddUserFunc; -{ - bdduserfunc *ScanUserFunc; - bdduserfunc **PrevUserFunc; - - setbddlocalsystem( BddSystem ); - - PrevUserFunc = &BddLocalSystem->USER_FUNC; - - for ( ScanUserFunc = BddLocalSystem->USER_FUNC; - ScanUserFunc != (bdduserfunc *)0; - ScanUserFunc = ScanUserFunc->NEXT ) - { - if ( ScanUserFunc == BddUserFunc ) - { - *PrevUserFunc = ScanUserFunc->NEXT; - freebdduserfunc( ScanUserFunc ); - - return( 1 ); - } - - PrevUserFunc = &ScanUserFunc->NEXT; - } - - return( 0 ); -} - -/*------------------------------------------------------------\ -| | -| Exec Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Exec User Function | -| | -\------------------------------------------------------------*/ - -void execbdduserfunc( BddSystem, Type ) - - bddsystem *BddSystem; - long Type; -{ - bdduserfunc *ScanUserFunc; - - setbddlocalsystem( BddSystem ); - - for ( ScanUserFunc = BddLocalSystem->USER_FUNC; - ScanUserFunc != (bdduserfunc *)0; - ScanUserFunc = ScanUserFunc->NEXT ) - { - if ( ScanUserFunc->TYPE == Type ) - { - (*ScanUserFunc->FUNC)( ScanUserFunc->DATA ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Destroy Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Bdd Destroy User Function | -| | -\------------------------------------------------------------*/ - -void destroybdduserfunc( BddSystem ) - - bddsystem *BddSystem; -{ - bdduserfunc *ScanUserFunc; - bdduserfunc *DelUserFunc; - - setbddlocalsystem( BddSystem ); - - ScanUserFunc = BddLocalSystem->USER_FUNC; - BddLocalSystem->USER_FUNC = (bdduserfunc *)0; - - while ( ScanUserFunc != (bdduserfunc *)0 ) - { - DelUserFunc = ScanUserFunc; - ScanUserFunc = ScanUserFunc->NEXT; - - freebdduserfunc( DelUserFunc ); - } -} diff --git a/alliance/src/bdd/src/bdduser.h b/alliance/src/bdd/src/bdduser.h deleted file mode 100644 index 210e103f..00000000 --- a/alliance/src/bdd/src/bdduser.h +++ /dev/null @@ -1,77 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bdduser.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_USER_H -# define BDD_USER_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddvar.c b/alliance/src/bdd/src/bddvar.c deleted file mode 100644 index a61e6416..00000000 --- a/alliance/src/bdd/src/bddvar.c +++ /dev/null @@ -1,613 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddvar.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include -# include - -# include "bddvar.h" -# include "bddhnode.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - long BDD_VAR_STRETCH_FACTOR = VAR_STRETCH_FACTOR; - - static bddhnode *BddSwapVarNodeArray = (bddhnode *)0; - static long BddSwapVarNodeSize = 0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| New Bdd Variable | -| | -\------------------------------------------------------------*/ - -bddindex newbddvar( BddSystem, Variable ) - - bddsystem *BddSystem; - bddvar Variable; -{ - bddvarnode *VarNode; - bddindexnode *IndexNode; - bddindex *IndexToVar; - bddvar *VarToIndex; - bddassoc *BddAssoc; - bddassocnode *BddAssocNode; - long MaxVar; - long MaxIndex; - long NumberVar; - long NumberIndex; - long Counter; - - setbddlocalsystem( BddSystem ); - - NumberVar = BddLocalSystem->NUMBER_VAR; - MaxVar = BddLocalSystem->MAX_VAR; - - if ( NumberVar >= BDD_MAX_VAR ) - { - bdderror( BDD_NO_MORE_VAR_ERROR, 0 ); - } - - if ( Variable > NumberVar ) - { - bdderror( BDD_BAD_VAR_ERROR, Variable ); - } - - if ( NumberVar == MaxVar ) - { - MaxVar = MaxVar * BDD_VAR_STRETCH_FACTOR; - - if ( MaxVar >= BDD_MAX_VAR ) - { - MaxVar = BDD_MAX_VAR - 1; - } - - MaxIndex = MaxVar + BDD_INDEX_MIN; - - VarNode = resizebddvarnode( BddLocalSystem->VAR_NODE, - BddLocalSystem->MAX_INDEX, MaxIndex ); - - IndexNode = resizebddindexnode( BddLocalSystem->INDEX_NODE, - BddLocalSystem->MAX_INDEX, MaxIndex ); - - IndexToVar = resizebddvar( BddLocalSystem->INDEX_TO_VAR, - BddLocalSystem->MAX_INDEX, MaxIndex ); - - VarToIndex = resizebddindex( BddLocalSystem->VAR_TO_INDEX, - BddLocalSystem->MAX_VAR, MaxVar ); - - for ( BddAssoc = BddLocalSystem->ASSOC; - BddAssoc != (bddassoc *)0; - BddAssoc = BddAssoc->NEXT ) - { - BddAssoc->ASSOC_NODE = - - resizebddassocnode( BddAssoc->ASSOC_NODE, - BddLocalSystem->MAX_VAR, MaxVar ); - } - - BddLocalSystem->MAX_VAR = MaxVar; - BddLocalSystem->MAX_INDEX = MaxIndex; - BddLocalSystem->VAR_NODE = VarNode; - BddLocalSystem->INDEX_NODE = IndexNode; - BddLocalSystem->INDEX_TO_VAR = IndexToVar; - BddLocalSystem->VAR_TO_INDEX = VarToIndex; - } - else - { - VarNode = BddLocalSystem->VAR_NODE; - IndexNode = BddLocalSystem->INDEX_NODE; - IndexToVar = BddLocalSystem->INDEX_TO_VAR; - VarToIndex = BddLocalSystem->VAR_TO_INDEX; - } - - NumberIndex = BddLocalSystem->NUMBER_INDEX; - - if ( Variable < NumberVar ) - { - for ( Counter = BDD_INDEX_MIN; Counter < NumberIndex; Counter++ ) - { - if ( IndexToVar[ Counter ] >= Variable ) - { - IndexToVar[ Counter ]++; - } - } - - for ( BddAssoc = BddLocalSystem->ASSOC; - BddAssoc != (bddassoc *)0; - BddAssoc = BddAssoc->NEXT ) - { - if ( ( BddAssoc->FIRST != BDD_MAX_VAR ) && - ( BddAssoc->LAST != BDD_MAX_VAR ) && - ( BddAssoc->LAST >= Variable ) ) - { - BddAssoc->LAST = BddAssoc->LAST + 1; - BddAssocNode = BddAssoc->ASSOC_NODE; - - for ( Counter = BddAssoc->LAST; Counter > Variable; Counter-- ) - { - if ( Counter == BddAssoc->FIRST ) break; - - BddAssocNode[ Counter ] = BddAssocNode[ Counter - 1 ]; - } - - if ( Counter == BddAssoc->FIRST ) - { - BddAssoc->FIRST = BddAssoc->FIRST + 1; - } - - BddAssocNode[ Counter ] = (bddnode *)0; - } - } - } - - IndexToVar[ NumberIndex ] = Variable; - - for ( Counter = NumberVar; Counter > Variable; Counter-- ) - { - VarToIndex[ Counter ] = VarToIndex[ Counter - 1 ]; - } - - VarToIndex[ Variable ] = NumberIndex; - - BddLocalSystem->NUMBER_VAR++; - BddLocalSystem->NUMBER_INDEX++; - - if ( IndexNode[ NumberIndex ] == (bddhnodetable *)0 ) - { - IndexNode[ NumberIndex ] = createbddhnodetable( BddLocalSystem->VAR_MODEL ); - } - - return( (bddindex)NumberIndex ); -} - -/*------------------------------------------------------------\ -| | -| Add Bdd Variable | -| | -\------------------------------------------------------------*/ - -bddnode *addbddvar( BddSystem, Variable ) - - bddsystem *BddSystem; - bddvar Variable; -{ - bddnode *BddNode; - bddindex Index; - - Index = newbddvar( BddSystem, Variable ); - - BddNode = addbddnode( (bddsystem *)0, Index, - BddLocalSystem->ONE, BddLocalSystem->ZERO ); - - BddNode->REF_EXT = BDD_MAX_REF; - - BddLocalSystem->VAR_NODE[ Index ] = BddNode; - - return( BddNode ); -} - -/*------------------------------------------------------------\ -| | -| Add Bdd Last Variable | -| | -\------------------------------------------------------------*/ - -bddnode *addbddvarlast( BddSystem ) - - bddsystem *BddSystem; -{ - setbddlocalsystem( BddSystem ); - - return( addbddvar( (bddsystem *)0, - BddLocalSystem->NUMBER_VAR ) ); -} - -/*------------------------------------------------------------\ -| | -| Add Bdd First Variable | -| | -\------------------------------------------------------------*/ - -bddnode *addbddvarfirst( BddSystem ) - - bddsystem *BddSystem; -{ - setbddlocalsystem( BddSystem ); - - return( addbddvar( (bddsystem *)0, 0 ) ); -} - -/*------------------------------------------------------------\ -| | -| Add Bdd Before Variable | -| | -\------------------------------------------------------------*/ - -bddnode *addbddvarbefore( BddSystem, Index ) - - bddsystem *BddSystem; - bddindex Index; -{ - bddvar Variable; - - checkbddindex( BddSystem, Index, 1 ); - - Variable = BddLocalSystem->INDEX_TO_VAR[ Index ]; - - return( addbddvar( (bddsystem *)0, Variable ) ); -} - -/*------------------------------------------------------------\ -| | -| Add Bdd After Variable | -| | -\------------------------------------------------------------*/ - -bddnode *addbddvarafter( BddSystem, Index ) - - bddsystem *BddSystem; - bddindex Index; -{ - bddvar Variable; - - checkbddindex( BddSystem, Index, 1 ); - - Variable = BddLocalSystem->INDEX_TO_VAR[ Index ] + 1; - - return( addbddvar( (bddsystem *)0, Variable ) ); -} - -/*------------------------------------------------------------\ -| | -| Sweep Bdd Variable | -| | -\------------------------------------------------------------*/ - -void sweepbddvar( BddSystem, Variable, SweepRef ) - - bddsystem *BddSystem; - bddvar Variable; - int SweepRef; -{ - bddindexnode *IndexNode; - bddhnodetable *HashTable; - bddnode *HashNode; - bddindex *VarToIndex; - long HashIndex; - - checkbddvar( BddSystem, Variable, 1 ); - - VarToIndex = BddLocalSystem->VAR_TO_INDEX; - IndexNode = BddLocalSystem->INDEX_NODE; - - HashTable = IndexNode[ VarToIndex[ Variable ] ]; - - for ( HashIndex = 0; HashIndex < HashTable->TABLE_SIZE; HashIndex++ ) - { - HashNode = HashTable->TABLE[ HashIndex ]; - - if ( ( HashNode != BDD_HASH_NODE_EMPTY ) && - ( HashNode != BDD_HASH_NODE_DELETED ) ) - { - if ( ( ! HashNode->REF_INT ) && - ( ! HashNode->REF_EXT ) ) - { - HashTable->NUMBER_NODE--; - HashTable->TABLE[ HashIndex ] = BDD_HASH_NODE_DELETED; - - if ( SweepRef ) - { - decbddrefint( HashNode->LOW ); - decbddrefint( HashNode->HIGH ); - } - - memset( (void *)HashNode, 0, sizeof( bddnode ) ); - - HashNode->HIGH = BddLocalSystem->NODE_FREE; - BddLocalSystem->NODE_FREE = HashNode; - BddLocalSystem->NUMBER_NODE--; - BddLocalSystem->NUMBER_FREE++; - } - } - } - - resizebddhnodetable( HashTable ); - resetbddhopertable( BddLocalSystem->HASH_OPER ); -} - -/*------------------------------------------------------------\ -| | -| Swap Bdd Variable | -| | -\------------------------------------------------------------*/ - -int swapbddvar( BddSystem, Variable ) - - bddsystem *BddSystem; - bddvar Variable; -{ - bddindexnode *IndexNode; - bddhnodetable *HashTable; - bddhnodetable *NextTable; - bddvar *VarToIndex; - bddindex *IndexToVar; - bddassoc *BddAssoc; - bddassocnode *BddAssocNode; - bddnode *HashNode; - bddnode *BddNodeLow; - bddnode *BddNodeHigh; - bddnode *BddNodeF11; - bddnode *BddNodeF01; - bddnode *BddNodeF10; - bddnode *BddNodeF00; - bddvar NextVar; - bddvar FirstVar; - bddvar LastVar; - bddindex Index; - bddindex NextIndex; - long HashIndex; - long SwapVarNodeIndex; - long NodeIndex; - - NextVar = Variable + 1; - - checkbddvar( BddSystem, NextVar, 1 ); - - SetBddSystemSwapVar( BddLocalSystem ); - - IndexNode = BddLocalSystem->INDEX_NODE; - VarToIndex = BddLocalSystem->VAR_TO_INDEX; - IndexToVar = BddLocalSystem->INDEX_TO_VAR; - - Index = VarToIndex[ Variable ]; - NextIndex = VarToIndex[ NextVar ]; - - HashTable = IndexNode[ Index ]; - NextTable = IndexNode[ NextIndex ]; - - if ( BddSwapVarNodeSize < HashTable->NUMBER_NODE ) - { - if ( BddSwapVarNodeArray != (bddhnode *)0 ) - { - freebddhnode( BddSwapVarNodeArray ); - } - - BddSwapVarNodeSize = HashTable->NUMBER_NODE << 1; - BddSwapVarNodeArray = allocbddhnode( BddSwapVarNodeSize ); - } - - SwapVarNodeIndex = 0; - - for ( HashIndex = 0; HashIndex < HashTable->TABLE_SIZE; HashIndex++ ) - { - HashNode = HashTable->TABLE[ HashIndex ]; - - if ( ( HashNode != BDD_HASH_NODE_EMPTY ) && - ( HashNode != BDD_HASH_NODE_DELETED ) ) - { - if ( ( HashNode->HIGH->INDEX == NextIndex ) || - ( HashNode->LOW->INDEX == NextIndex ) ) - { - HashTable->NUMBER_NODE--; - HashTable->TABLE[ HashIndex ] = BDD_HASH_NODE_DELETED; - - BddSwapVarNodeArray[ SwapVarNodeIndex ] = HashNode; - SwapVarNodeIndex = SwapVarNodeIndex + 1; - } - } - } - - for ( NodeIndex = 0; NodeIndex < SwapVarNodeIndex; NodeIndex++ ) - { - HashNode = BddSwapVarNodeArray[ NodeIndex ]; - - BddNodeLow = HashNode->LOW; - BddNodeHigh = HashNode->HIGH; - - if ( BddNodeHigh->INDEX == NextIndex ) - { - BddNodeF11 = BddNodeHigh->HIGH; - BddNodeF10 = BddNodeHigh->LOW; - } - else - { - BddNodeF11 = BddNodeHigh; - BddNodeF10 = BddNodeHigh; - } - - if ( BddNodeLow->INDEX == NextIndex ) - { - BddNodeF01 = BddNodeLow->HIGH; - BddNodeF00 = BddNodeLow->LOW; - } - else - { - BddNodeF01 = BddNodeLow; - BddNodeF00 = BddNodeLow; - } - - decbddrefint( BddNodeHigh ); - decbddrefint( BddNodeLow ); - - BddNodeHigh = unsetbddrefext( addbddnode( (bddsystem *)0, Index, - BddNodeF11, BddNodeF01 ) ); - BddNodeLow = unsetbddrefext( addbddnode( (bddsystem *)0, Index, - BddNodeF10, BddNodeF00 ) ); - HashNode->INDEX = NextIndex; - HashNode->HIGH = BddNodeHigh; - HashNode->LOW = BddNodeLow; - - addbddhnode( NextTable, HashNode ); - } - - VarToIndex[ NextVar ] = Index; - VarToIndex[ Variable ] = NextIndex; - - IndexToVar[ NextIndex ] = Variable; - IndexToVar[ Index ] = NextVar; - - for ( BddAssoc = BddLocalSystem->ASSOC; - BddAssoc != (bddassoc *)0; - BddAssoc = BddAssoc->NEXT ) - { - BddAssocNode = BddAssoc->ASSOC_NODE; - - BddNodeLow = BddAssocNode[ Variable ]; - BddNodeHigh = BddAssocNode[ NextVar ]; - - FirstVar = BddAssoc->FIRST; - LastVar = BddAssoc->LAST ; - - if ( ( Variable == FirstVar ) && - ( BddNodeHigh == (bddnode *)0 ) ) BddAssoc->FIRST++; - - if ( ( NextVar == LastVar ) && - ( BddNodeLow == (bddnode *)0 ) ) BddAssoc->LAST --; - - if ( NextVar == FirstVar ) BddAssoc->FIRST--; - if ( Variable == LastVar ) BddAssoc->LAST ++; - - BddAssocNode[ NextVar ] = BddNodeLow; - BddAssocNode[ Variable ] = BddNodeHigh; - } - - sweepbddvar( (bddsystem *)0, Variable, 1 ); - - ClearBddSystemSwapVar( BddLocalSystem ); - - return ( SwapVarNodeIndex != 0L ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Variable By Index | -| | -\------------------------------------------------------------*/ - -bddvar getbddvarbyindex( BddSystem, Index ) - - bddsystem *BddSystem; - bddindex Index; -{ - checkbddindex( BddSystem, Index, 1 ); - - return( BddLocalSystem->INDEX_TO_VAR[ Index ] ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Variable Index | -| | -\------------------------------------------------------------*/ - -bddindex getbddvarindex( BddSystem, Variable ) - - bddsystem *BddSystem; - bddvar Variable; -{ - checkbddvar( BddSystem, Variable, 1 ); - - return( BddLocalSystem->VAR_TO_INDEX[ Variable ] ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Variable Node | -| | -\------------------------------------------------------------*/ - -bddnode *getbddvarnode( BddSystem, Variable ) - - bddsystem *BddSystem; - bddvar Variable; -{ - bddindex Index; - - checkbddvar( BddSystem, Variable, 1 ); - - Index = BddLocalSystem->VAR_TO_INDEX[ Variable ]; - - return( BddLocalSystem->VAR_NODE[ Index ] ); -} - -/*------------------------------------------------------------\ -| | -| Get Bdd Variable Node By Index | -| | -\------------------------------------------------------------*/ - -bddnode *getbddvarnodebyindex( BddSystem, Index ) - - bddsystem *BddSystem; - bddindex Index; -{ - checkbddindex( BddSystem, Index, 1 ); - - return( BddLocalSystem->VAR_NODE[ Index ] ); -} diff --git a/alliance/src/bdd/src/bddvar.h b/alliance/src/bdd/src/bddvar.h deleted file mode 100644 index 51534715..00000000 --- a/alliance/src/bdd/src/bddvar.h +++ /dev/null @@ -1,80 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddvar.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_VAR_H -# define BDD_VAR_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# define VAR_STRETCH_FACTOR 2 - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/bddvaraux.c b/alliance/src/bdd/src/bddvaraux.c deleted file mode 100644 index a320f31c..00000000 --- a/alliance/src/bdd/src/bddvaraux.c +++ /dev/null @@ -1,260 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddvaraux.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -# include -# include "bddapply.h" -# include "bddcofactor.h" -# include "bdderror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static bddhnode *BddAuxVarNodeArray = (bddhnode *)0; - static long BddAuxVarNodeSize = 0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Add Bdd Single Auxiliary Variable | -| | -\------------------------------------------------------------*/ - -bddnode *addbddvarauxsingle( BddSystem, BddAux ) - - bddsystem *BddSystem; - bddnode *BddAux; -{ - bddindexnode *IndexNode; - bddnode *BddNotAux; - bddnode *BddNodeAux; - bddnode *BddNodeNotAux; - bddvar Variable; - bddindex AuxIndex; - bddindex Index; - - Index = BddAux->INDEX; - - checkbddindex( BddSystem, Index, 1 ); - - BddNotAux = decbddrefext( loc_applybddnot( BddAux ) ); - - Variable = BddLocalSystem->INDEX_TO_VAR[ Index ]; - AuxIndex = newbddvar( (bddsystem *)0, Variable ); - - IndexNode = BddLocalSystem->INDEX_NODE; - - delbddhnode( IndexNode[ Index ], BddNotAux ); - BddNodeNotAux = addbddnode( (bddsystem *)0, Index, BddNotAux->HIGH, BddNotAux->LOW ); - - BddNotAux->INDEX = AuxIndex; - BddNotAux->HIGH = BddLocalSystem->ZERO; - BddNotAux->LOW = BddLocalSystem->ONE; - - addbddhnode( IndexNode[ AuxIndex ], BddNotAux ); - - delbddhnode( IndexNode[ Index ], BddAux ); - BddNodeAux = addbddnode( (bddsystem *)0, Index, BddAux->HIGH, BddAux->LOW ); - - BddAux->INDEX = AuxIndex; - BddAux->HIGH = BddLocalSystem->ONE; - BddAux->LOW = BddLocalSystem->ZERO; - BddAux->REF_EXT = BDD_MAX_REF; - - addbddhnode( IndexNode[ AuxIndex ], BddAux ); - - BddLocalSystem->VAR_NODE[ AuxIndex ] = BddAux; - - resetbddhopertable( BddLocalSystem->HASH_OPER ); - - decbddrefext( BddNodeNotAux ); - - return( BddNodeAux ); -} - -/*------------------------------------------------------------\ -| | -| Add Bdd Global Auxiliary Variable | -| | -\------------------------------------------------------------*/ - -bddnode *addbddvarauxglobal( BddSystem, BddAux, UserFunc ) - - bddsystem *BddSystem; - bddnode *BddAux; - int (*UserFunc)(); -{ - bddindexnode *IndexNode; - bddhnodetable *HashTable; - bddnode *HashNode; - bddnode NewNode; - bddnode *BddNotAux; - bddnode *BddNodeAux; - bddnode *BddNodeNotAux; - long AuxVarNodeIndex; - long HashIndex; - bddvar Variable; - bddindex AuxIndex; - bddindex Index; - - Index = BddAux->INDEX; - - checkbddindex( BddSystem, Index, 1 ); - - BddNotAux = decbddrefext( loc_applybddnot( BddAux ) ); - - Variable = BddLocalSystem->INDEX_TO_VAR[ Index ]; - AuxIndex = newbddvar( (bddsystem *)0, Variable ); - - IndexNode = BddLocalSystem->INDEX_NODE; - HashTable = IndexNode[ Index ]; - - if ( BddAuxVarNodeSize < HashTable->NUMBER_NODE ) - { - freebddhnode( BddAuxVarNodeArray ); - BddAuxVarNodeSize = HashTable->NUMBER_NODE << 1; - BddAuxVarNodeArray = allocbddhnode( BddAuxVarNodeSize ); - } - - AuxVarNodeIndex = 0; - - for ( HashIndex = 0; HashIndex < HashTable->TABLE_SIZE; HashIndex++ ) - { - HashNode = HashTable->TABLE[ HashIndex ]; - - if ( ( HashNode != BDD_HASH_NODE_EMPTY ) && - ( HashNode != BDD_HASH_NODE_DELETED ) ) - { - if ( ( HashNode != BddAux ) && - ( HashNode != BddNotAux ) ) - { - BddAuxVarNodeArray[ AuxVarNodeIndex ] = HashNode; - AuxVarNodeIndex = AuxVarNodeIndex + 1; - } - } - } - - delbddhnode( IndexNode[ Index ], BddNotAux ); - BddNodeNotAux = addbddnode( (bddsystem *)0, Index, BddNotAux->HIGH, BddNotAux->LOW ); - - BddNotAux->INDEX = AuxIndex; - BddNotAux->HIGH = BddLocalSystem->ZERO; - BddNotAux->LOW = BddLocalSystem->ONE; - - addbddhnode( IndexNode[ AuxIndex ], BddNotAux ); - - delbddhnode( IndexNode[ Index ], BddAux ); - BddNodeAux = addbddnode( (bddsystem *)0, Index, BddAux->HIGH, BddAux->LOW ); - - BddAux->INDEX = AuxIndex; - BddAux->HIGH = BddLocalSystem->ONE; - BddAux->LOW = BddLocalSystem->ZERO; - BddAux->REF_EXT = BDD_MAX_REF; - - addbddhnode( IndexNode[ AuxIndex ], BddAux ); - - BddLocalSystem->VAR_NODE[ AuxIndex ] = BddAux; - - resetbddhopertable( BddLocalSystem->HASH_OPER ); - - BddLocalSystem->HASH_OPER->TABLE_FREEZE = 1; - - NewNode.INDEX = AuxIndex; - NewNode.REF_INT = 0; - NewNode.REF_EXT = 1; - NewNode.MARK = 0; - - while ( AuxVarNodeIndex > 0 ) - { - AuxVarNodeIndex = AuxVarNodeIndex - 1; - HashNode = BddAuxVarNodeArray[ AuxVarNodeIndex ]; - - NewNode.HIGH = decbddrefext( loc_cofactorbdd( HashNode, BddNodeAux ) ); - NewNode.LOW = decbddrefext( loc_cofactorbdd( HashNode, BddNodeNotAux ) ); - - if ( ( NewNode.HIGH != NewNode.LOW ) && - ( NewNode.HIGH != HashNode ) && - ( NewNode.LOW != HashNode ) ) - { - if ( UserFunc ) - { - if ( ! UserFunc( HashNode, &NewNode ) ) continue; - } - - delbddhnode( IndexNode[ Index ], HashNode ); - - HashNode->INDEX = AuxIndex; - HashNode->HIGH = incbddrefint( NewNode.HIGH ); - HashNode->LOW = incbddrefint( NewNode.LOW ); - - addbddhnode( IndexNode[ AuxIndex ], HashNode ); - } - } - - BddLocalSystem->HASH_OPER->TABLE_FREEZE = 0; - - decbddrefext( BddNodeNotAux ); - - return( BddNodeAux ); -} diff --git a/alliance/src/bdd/src/bddvaraux.h b/alliance/src/bdd/src/bddvaraux.h deleted file mode 100644 index c9574a10..00000000 --- a/alliance/src/bdd/src/bddvaraux.h +++ /dev/null @@ -1,80 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Bdd | -| | -| File : bddvaraux.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef BDD_VAR_AUX_H -# define BDD_VAR_AUX_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# define VAR_AUX_STRETCH_FACTOR 2 - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/bdd/src/main.c b/alliance/src/bdd/src/main.c deleted file mode 100644 index bf4ef820..00000000 --- a/alliance/src/bdd/src/main.c +++ /dev/null @@ -1,64 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -# include - -# include MUT_H -# include AUT_H -# include ABL_H -# include BDD_H - -int main( argc, argv ) - - int argc; - char **argv; -{ - bddcircuit *BddCircuit; - bddsystem *BddSystem; - - mbkenv(); - autenv(); - ablenv(); - bddenv(); - - BddSystem = createbddsystem( 10, 1000, 3, 100000 ); - - if ( argc > 1 ) - { - BddCircuit = (bddcircuit *)undumpbddcircuit( BddSystem, argv[1] ); - } - else - { - BddCircuit = createbddcircuit( "Hello", 3, 3, BddSystem ); - } - - testbddcircuit( BddCircuit ); - - destroybddcircuit( BddCircuit ); - destroybddsystem( BddSystem ); - - return( 0 ); -} diff --git a/alliance/src/btr/Makefile.am b/alliance/src/btr/Makefile.am deleted file mode 100644 index af437a64..00000000 --- a/alliance/src/btr/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = src diff --git a/alliance/src/btr/configure.in b/alliance/src/btr/configure.in deleted file mode 100644 index f6b9f2ff..00000000 --- a/alliance/src/btr/configure.in +++ /dev/null @@ -1,45 +0,0 @@ -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 -dnl $Id: configure.in,v 1.1 2002/03/20 10:24:57 ludo Exp $ -dnl -dnl -AC_INIT(src/btr.h) -AM_INIT_AUTOMAKE(btr, 1.3) -AC_PROG_INSTALL -AC_PROG_CC -AC_HEADER_STDC -AC_C_CONST -AC_PROG_RANLIB - -AM_ALLIANCE - -AC_OUTPUT([ -Makefile -src/Makefile -]) diff --git a/alliance/src/btr/src/btr.h b/alliance/src/btr/src/btr.h deleted file mode 100644 index 4bc63f0c..00000000 --- a/alliance/src/btr/src/btr.h +++ /dev/null @@ -1,211 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------\ -| | -| Title : Structures and fonctions for BTR | -| | -| Date : 14.02.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------*/ - -# ifndef BTR_102_H -# define BTR_102_H - -/*------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------*/ -/*------------------------------------------------------\ -| | -| Macros | -| | -\------------------------------------------------------*/ -/*------------------------------------------------------\ -| | -| Type | -| | -\------------------------------------------------------*/ -/*------------------------------------------------------\ -| | -| Bdd Transition Function | -| | -\------------------------------------------------------*/ - - typedef long btrvarorder; - - typedef struct btrvarfunc - { - bddnode *VAR; - bddnode *FUNC; - - } btrvarfunc; - - typedef struct btrtransfunc - { - btrvarfunc *VAR_FUNC; - btrvarorder *VAR_ORDER; - bddvar MAX_VAR; - bddvar NUMBER_VAR; - bddsystem *BDD_SYSTEM; - - } btrtransfunc; - -/*------------------------------------------------------\ -| | -| Bdd Transition Relation | -| | -\------------------------------------------------------*/ - - typedef struct btrvarrel - { - bddnode *VAR; - bddnode *PRIME; - bddnode *REL; - - } btrvarrel; - - typedef struct btrtransrel - { - btrvarrel *VAR_REL; - bddassoc *PRIME_ASSOC; - bddassoc *VAR_ASSOC; - bddvar MAX_VAR; - bddvar NUMBER_VAR; - bddsystem *BDD_SYSTEM; - - } btrtransrel; - -/*------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------*/ -/*------------------------------------------------------\ -| | -| Env Functions | -| | -\------------------------------------------------------*/ - - extern void btrenv __P(()); - -/*------------------------------------------------------\ -| | -| Allocation Functions | -| | -\------------------------------------------------------*/ - - extern btrtransfunc * allocbtrtransfunc __P(()); - extern btrvarfunc * allocbtrvarfunc __P((long Number)); - extern btrvarorder * allocbtrvarorder __P((long Number)); - - extern btrtransrel * allocbtrtransrel __P(()); - extern btrvarrel * allocbtrvarrel __P((long Number)); - -/*------------------------------------------------------\ -| | -| Free Functions | -| | -\------------------------------------------------------*/ - - extern void freebtrtransfunc __P((btrtransfunc *TransFunc)); - extern void freebtrvarfunc __P((btrvarfunc *VarFunc)); - extern void freebtrvarorder __P((btrvarorder *VarOrder)); - - extern void freebtrtransrel __P((btrtransrel *TransRel)); - extern void freebtrvarrel __P((btrvarrel *VarRel)); - -/*------------------------------------------------------\ -| | -| Resize Functions | -| | -\------------------------------------------------------*/ - - extern btrvarfunc * resizebtrvarfunc __P((btrvarfunc *VarFunc, long OldNum, long NewNum)); - extern btrvarorder * resizebtrvarorder __P((btrvarorder *VarOrder, long OldNum, long NewNum)); - - extern btrvarrel * resizebtrvarrel __P((btrvarrel *VarRel, long OldNum, long NewNum)); - -/*------------------------------------------------------\ -| | -| Transition Function Functions | -| | -\------------------------------------------------------*/ - - extern btrtransfunc * createbtrtransfunc __P((bddsystem *BddSystem, bddvar MaxVar)); - extern void resetbtrtransfunc __P((btrtransfunc *TransFunc)); - extern void destroybtrtransfunc __P((btrtransfunc *TransFunc)); - extern void viewbtrtransfunc __P((btrtransfunc *TransFunc, void (*FuncView)())); - extern void addbtrtransfunc __P((btrtransfunc *TransFunc, bddnode *VarNode, bddnode *FuncNode)); - -/*------------------------------------------------------\ -| | -| Image and PreImage Transition Function | -| | -\------------------------------------------------------*/ - - extern bddnode * imagebtrtransfunc __P((btrtransfunc *TransFunc, bddnode *StateSet)); - extern bddnode * preimagebtrtransfunc __P((btrtransfunc *TransFunc, bddnode *StateSet)); - -/*------------------------------------------------------\ -| | -| Reorder Transition Function | -| | -\------------------------------------------------------*/ - - extern void reorderbtrtransfunc __P((btrtransfunc *TransFunc)); - -/*------------------------------------------------------\ -| | -| Transition Relation Functions | -| | -\------------------------------------------------------*/ - - extern btrtransrel * createbtrtransrel __P((bddsystem *BddSystem, bddvar MaxVar)); - extern void resetbtrtransrel __P((btrtransrel *TransRel)); - extern void destroybtrtransrel __P((btrtransrel *TransRel)); - extern void viewbtrtransrel __P((btrtransrel *TransRel, void (*FuncView)())); - -/*------------------------------------------------------\ -| | -| Image and PreImage Transition Relation | -| | -\------------------------------------------------------*/ - - extern bddnode * imagebtrtransrel __P((btrtransrel *TransRel, bddnode *StateSet)); - bddnode *preimagebtrtransrel(); - -# endif diff --git a/alliance/src/btr/src/btralloc.c b/alliance/src/btr/src/btralloc.c deleted file mode 100644 index e79a06cb..00000000 --- a/alliance/src/btr/src/btralloc.c +++ /dev/null @@ -1,133 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Btr | -| | -| File : btralloc.c | -| | -| Date : 03.12.96 | -| | -| Btrhor : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "abl.h" -# include "bdd.h" -# include "btr.h" - -# include -# include "btralloc.h" -# include "btrerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Btr Alloc Function Transition | -| | -\------------------------------------------------------------*/ - -btrtransfunc *allocbtrtransfunc() -{ - return( (btrtransfunc *)autallocblock( sizeof( btrtransfunc ) ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Variable Function | -| | -\------------------------------------------------------------*/ - -btrvarfunc *allocbtrvarfunc( Number ) - - long Number; -{ - return( (btrvarfunc *)autallocblock( sizeof( btrvarfunc ) * Number ) ); -} - -/*------------------------------------------------------------\ -| | -| Btr Alloc Function Transition | -| | -\------------------------------------------------------------*/ - -btrvarorder *allocbtrvarorder( Number ) - - long Number; -{ - return( (btrvarorder *)autallocblock( sizeof( btrvarorder ) * Number ) ); -} - -/*------------------------------------------------------------\ -| | -| Btr Alloc Relation Transition | -| | -\------------------------------------------------------------*/ - -btrtransrel *allocbtrtransrel() -{ - return( (btrtransrel *)autallocblock( sizeof( btrtransrel ) ) ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Alloc Variable Relation | -| | -\------------------------------------------------------------*/ - -btrvarrel *allocbtrvarrel( Number ) - - long Number; -{ - return( (btrvarrel *)autallocblock( sizeof( btrvarrel ) * Number ) ); -} diff --git a/alliance/src/btr/src/btralloc.h b/alliance/src/btr/src/btralloc.h deleted file mode 100644 index e071952b..00000000 --- a/alliance/src/btr/src/btralloc.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Btr | -| | -| File : btralloc.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BTR_ALLOC_H -# define BTR_ALLOC_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/btr/src/btrenv.c b/alliance/src/btr/src/btrenv.c deleted file mode 100644 index 8a38708c..00000000 --- a/alliance/src/btr/src/btrenv.c +++ /dev/null @@ -1,82 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Btr | -| | -| File : btrenv.c | -| | -| Date : 03.12.96 | -| | -| Btrhor : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "abl.h" -# include "bdd.h" -# include "btr.h" - -# include -# include "btrenv.h" -# include "btrerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Btr Env | -| | -\------------------------------------------------------------*/ - -void btrenv() -{ -} diff --git a/alliance/src/btr/src/btrenv.h b/alliance/src/btr/src/btrenv.h deleted file mode 100644 index c2da63c6..00000000 --- a/alliance/src/btr/src/btrenv.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Btr | -| | -| File : btrenv.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BTR_ENV_H -# define BTR_ENV_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/btr/src/btrerror.c b/alliance/src/btr/src/btrerror.c deleted file mode 100644 index ed913976..00000000 --- a/alliance/src/btr/src/btrerror.c +++ /dev/null @@ -1,129 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Btr | -| | -| File : Btr Errors | -| | -| Authors : Jacomme Ludovic | -| | -| Date : 03.12.96 | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include -# include -# include "mut.h" -# include "aut.h" -# include "abl.h" -# include "bdd.h" -# include "btr.h" -# include "btrerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -void btr_error( Error, Value, File, Line ) - - char Error; - long Value; - char *File; - long Line; -{ - char *Name; - - Name = mbkstrdup( File ); - Name[ strlen( File ) - 1 ] = '\0'; - - fprintf( stderr, "%s%ld ", Name, Line ); - - switch( Error ) - { - default : - - fprintf( stderr, "unknown internal %d", Error ); - } - - fprintf( stderr, " error !\n" ); - - autexit( 1 ); -} - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -void btr_warning( Warning, Value1, Value2, File, Line ) - - char Warning; - long Value1; - long Value2; - char *File; - long Line; -{ - char *Name; - - Name = mbkstrdup( File ); - Name[ strlen( File ) - 1 ] = '\0'; - - fprintf( stderr, "%s%ld ", Name, Line ); - - switch( Warning ) - { - default : - - fprintf( stderr, "unknown internal %d", Warning ); - } - - fprintf( stderr, " warning !\n" ); -} diff --git a/alliance/src/btr/src/btrerror.h b/alliance/src/btr/src/btrerror.h deleted file mode 100644 index 55f854ff..00000000 --- a/alliance/src/btr/src/btrerror.h +++ /dev/null @@ -1,96 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Btr | -| | -| File : Btr Errors | -| | -| Authors : Jacomme Ludovic | -| | -| Date : 03.12.96 | -| | -\------------------------------------------------------------*/ - -# ifndef BTR_ERROR_H -# define BTR_ERROR_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# define BTR_BAD_VAR_ERROR 0 -# define BTR_NO_MORE_VAR_ERROR 1 - -/*------------------------------------------------------------\ -| | -| Error | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Warning | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macros | -| | -\------------------------------------------------------------*/ - -# define btrerror( E, V ) (btr_error( (E), (V), __FILE__, __LINE__ )) -# define btrwarning( W, V1, V2 ) (btr_warning( (W), (V1), (V2), __FILE__, __LINE__ )) - -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - - extern void btr_error __P((char Error, long Value, char *File, long Line)); - extern void btr_warning __P((char Warning, long Value1, long Value2, char *File, long Line)); - -# endif diff --git a/alliance/src/btr/src/btrfree.c b/alliance/src/btr/src/btrfree.c deleted file mode 100644 index 4e6875b5..00000000 --- a/alliance/src/btr/src/btrfree.c +++ /dev/null @@ -1,138 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Btr | -| | -| File : btrfree.c | -| | -| Date : 03.12.96 | -| | -| Btrhor : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "abl.h" -# include "bdd.h" -# include "btr.h" - -# include -# include "btrfree.h" -# include "btrerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Btr Free Function Transition | -| | -\------------------------------------------------------------*/ - -void freebtrtransfunc( TransFunc ) - - btrtransfunc *TransFunc; -{ - autfreeblock( (char *)TransFunc ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Variable Function | -| | -\------------------------------------------------------------*/ - -void freebtrvarfunc( VarFunc ) - - btrvarfunc *VarFunc; -{ - autfreeblock( (char *)VarFunc ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Variable Order | -| | -\------------------------------------------------------------*/ - -void freebtrvarorder( VarOrder ) - - btrvarorder *VarOrder; -{ - autfreeblock( (char *)VarOrder ); -} - -/*------------------------------------------------------------\ -| | -| Btr Free Relation Transition | -| | -\------------------------------------------------------------*/ - -void freebtrtransrel( TransRel ) - - btrtransrel *TransRel; -{ - autfreeblock( (char *)TransRel ); -} - -/*------------------------------------------------------------\ -| | -| Bdd Free Variable Relation | -| | -\------------------------------------------------------------*/ - -void freebtrvarrel( VarRel ) - - btrvarrel *VarRel; -{ - autfreeblock( (char *)VarRel ); -} - diff --git a/alliance/src/btr/src/btrfree.h b/alliance/src/btr/src/btrfree.h deleted file mode 100644 index a2cc8d0f..00000000 --- a/alliance/src/btr/src/btrfree.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Btr | -| | -| File : btrfree.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BTR_FREE_H -# define BTR_FREE_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/btr/src/btrfunc.c b/alliance/src/btr/src/btrfunc.c deleted file mode 100644 index 47195feb..00000000 --- a/alliance/src/btr/src/btrfunc.c +++ /dev/null @@ -1,606 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Btr | -| | -| File : Btr Transition Function | -| | -| Authors : Jacomme Ludovic | -| | -| Date : 03.12.96 | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include -# include -# include -# include "mut.h" -# include "aut.h" -# include "abl.h" -# include "bdd.h" -# include "btr.h" -# include "btrfunc.h" -# include "btrerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static btrvarfunc *BtrLocalVarFunc = (btrvarfunc *)0; - static btrvarorder *BtrLocalVarOrder = (btrvarorder *)0; - static long BtrLocalNumberVar = 0; - static long BtrLocalIndexVar = 0; - - static long *BtrLocalCostArray = (long *)0; - static long BtrLocalCostLength = 0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Local Btr PreImage Transition Function | -| | -\------------------------------------------------------------*/ - -bddnode *loc_preimagebtrtransfunc( StateSet ) - - bddnode *StateSet; -{ - btrvarfunc *VarFunc; - bddnode *BddSetIn; - bddnode *BddSetOut; - bddnode *BddResult; - bddnode *BddHigh; - bddnode *BddLow; - - if ( StateSet->INDEX < BDD_INDEX_MIN ) - { - return( StateSet ); - } - - VarFunc = &BtrLocalVarFunc[ BtrLocalVarOrder[ BtrLocalIndexVar ] ]; - - BddSetIn = decbddrefext( applybddnodenot( (bddsystem *)0, StateSet ) ); - BddSetIn = applybddnode( (bddsystem *)0, ABL_OR , VarFunc->VAR , BddSetIn ); - BddSetOut = applybddnode( (bddsystem *)0, ABL_NAND, VarFunc->VAR , StateSet ); - - BtrLocalIndexVar++; - - if ( BtrLocalIndexVar >= BtrLocalNumberVar ) - { -/* -** StateSet => Rn, Fn -*/ - if ( BddSetIn->INDEX == BDD_INDEX_ONE ) - { - BddResult = incbddrefext( VarFunc->FUNC ); - } - else -/* -** StateSet => ! Rn, ! Fn -*/ - if ( BddSetOut->INDEX == BDD_INDEX_ONE ) - { - BddResult = applybddnodenot( (bddsystem *)0, VarFunc->FUNC ); - } - else - { - BddResult = BddLocalSystem->ONE; - } - } - else - { -/* -** StateSet => Ri, Fi . Img( StateSet ) -*/ - if ( BddSetIn->INDEX == BDD_INDEX_ONE ) - { - BddResult = decbddrefext( loc_preimagebtrtransfunc( StateSet ) ); - BddResult = applybddnode( (bddsystem *)0, ABL_AND, VarFunc->FUNC, BddResult ); - } - else -/* -** StateSet => ! Ri, ! Fi . Img( StateSet ) -*/ - if ( BddSetOut->INDEX == BDD_INDEX_ONE ) - { - BddLow = loc_preimagebtrtransfunc( StateSet ); - BddHigh = applybddnodenot( (bddsystem *)0, VarFunc->FUNC ); - - BddResult = applybddnode( (bddsystem *)0, ABL_AND, - decbddrefext( BddHigh ), - decbddrefext( BddLow ) ); - } - else - { -/* -** Fi . Img( StateSet . Ri ) + ! Fi . Img( StateSet . ! Ri ) -*/ - BddSetOut = applybddnodenot( (bddsystem *)0, decbddrefext( BddSetOut ) ); - BddSetIn = applybddnodenot( (bddsystem *)0, decbddrefext( BddSetIn ) ); - - BddHigh = applybddnodenot( (bddsystem *)0, VarFunc->FUNC ); - BddLow = loc_preimagebtrtransfunc( BddSetIn ); - BddLow = applybddnode( (bddsystem *)0, ABL_AND, - decbddrefext( BddHigh ), - decbddrefext( BddLow ) ); - - BddHigh = decbddrefext( loc_preimagebtrtransfunc( BddSetOut ) ); - BddHigh = applybddnode( (bddsystem *)0, ABL_AND, VarFunc->FUNC, BddHigh ); - - BddResult = applybddnode( (bddsystem *)0, ABL_OR, - decbddrefext( BddHigh ), - decbddrefext( BddLow ) ); - } - } - - BtrLocalIndexVar--; - - decbddrefext( BddSetIn ); - decbddrefext( BddSetOut ); - - return( BddResult ); -} - -/*------------------------------------------------------------\ -| | -| Btr PreImage Transition Function | -| | -\------------------------------------------------------------*/ - -bddnode *preimagebtrtransfunc( TransFunc, StateSet ) - - btrtransfunc *TransFunc; - bddnode *StateSet; -{ - bddnode *BddResult; - - setbddlocalsystem( TransFunc->BDD_SYSTEM ); - - BtrLocalVarFunc = TransFunc->VAR_FUNC; - BtrLocalVarOrder = TransFunc->VAR_ORDER; - BtrLocalNumberVar = TransFunc->NUMBER_VAR; - BtrLocalIndexVar = 0; - - if ( BtrLocalNumberVar == 0 ) - { - btrerror( BTR_BAD_VAR_ERROR, BtrLocalNumberVar ); - } - - BddResult = loc_preimagebtrtransfunc( StateSet ); - - return( BddResult ); -} - -/*------------------------------------------------------------\ -| | -| Local Btr Image Transition Function | -| | -\------------------------------------------------------------*/ - -bddnode *loc_imagebtrtransfunc( StateSet ) - - bddnode *StateSet; -{ - btrvarfunc *VarFunc; - bddnode *BddSetIn; - bddnode *BddSetOut; - bddnode *BddResult; - bddnode *BddHigh; - bddnode *BddLow; - - if ( StateSet->INDEX == BDD_INDEX_ZERO ) - { - return( StateSet ); - } - - VarFunc = &BtrLocalVarFunc[ BtrLocalVarOrder[ BtrLocalIndexVar ] ]; - - BddSetIn = decbddrefext( applybddnodenot( (bddsystem *)0, StateSet ) ); - BddSetIn = applybddnode( (bddsystem *)0, ABL_OR , VarFunc->FUNC, BddSetIn ); - BddSetOut = applybddnode( (bddsystem *)0, ABL_NAND, VarFunc->FUNC, StateSet ); - - BtrLocalIndexVar++; - - if ( BtrLocalIndexVar >= BtrLocalNumberVar ) - { -/* -** StateSet => Fn, Rn -*/ - if ( BddSetIn->INDEX == BDD_INDEX_ONE ) - { - BddResult = incbddrefext( VarFunc->VAR ); - } - else -/* -** StateSet => ! Fn, ! Rn -*/ - if ( BddSetOut->INDEX == BDD_INDEX_ONE ) - { - BddResult = applybddnodenot( (bddsystem *)0, VarFunc->VAR ); - } - else - { - BddResult = BddLocalSystem->ONE; - } - } - else - { -/* -** StateSet => Fi, Ri . Img( StateSet ) -*/ - if ( BddSetIn->INDEX == BDD_INDEX_ONE ) - { - BddResult = decbddrefext( loc_imagebtrtransfunc( StateSet ) ); - BddResult = applybddnode( (bddsystem *)0, ABL_AND, VarFunc->VAR, BddResult ); - } - else -/* -** StateSet => ! Fi, ! Ri . Img( StateSet ) -*/ - if ( BddSetOut->INDEX == BDD_INDEX_ONE ) - { - BddLow = loc_imagebtrtransfunc( StateSet ); - BddHigh = applybddnodenot( (bddsystem *)0, VarFunc->VAR ); - - BddResult = applybddnode( (bddsystem *)0, ABL_AND, - decbddrefext( BddHigh ), - decbddrefext( BddLow ) ); - } - else - { -/* -** Ri . Img( StateSet . Fi ) + ! Ri . Img( StateSet . ! Fi ) -*/ - BddSetOut = applybddnodenot( (bddsystem *)0, decbddrefext( BddSetOut ) ); - BddSetIn = applybddnodenot( (bddsystem *)0, decbddrefext( BddSetIn ) ); - - BddHigh = applybddnodenot( (bddsystem *)0, VarFunc->VAR ); - BddLow = loc_imagebtrtransfunc( BddSetIn ); - BddLow = applybddnode( (bddsystem *)0, ABL_AND, - decbddrefext( BddHigh ), - decbddrefext( BddLow ) ); - - BddHigh = decbddrefext( loc_imagebtrtransfunc( BddSetOut ) ); - BddHigh = applybddnode( (bddsystem *)0, ABL_AND, VarFunc->VAR, BddHigh ); - - BddResult = applybddnode( (bddsystem *)0, ABL_OR, - decbddrefext( BddHigh ), - decbddrefext( BddLow ) ); - } - } - - BtrLocalIndexVar--; - - decbddrefext( BddSetIn ); - decbddrefext( BddSetOut ); - - return( BddResult ); -} - -/*------------------------------------------------------------\ -| | -| Btr Image Transition Function | -| | -\------------------------------------------------------------*/ - -bddnode *imagebtrtransfunc( TransFunc, StateSet ) - - btrtransfunc *TransFunc; - bddnode *StateSet; -{ - bddnode *BddResult; - - setbddlocalsystem( TransFunc->BDD_SYSTEM ); - - BtrLocalVarFunc = TransFunc->VAR_FUNC; - BtrLocalVarOrder = TransFunc->VAR_ORDER; - BtrLocalNumberVar = TransFunc->NUMBER_VAR; - BtrLocalIndexVar = 0; - - if ( BtrLocalNumberVar == 0 ) - { - btrerror( BTR_BAD_VAR_ERROR, BtrLocalNumberVar ); - } - - BddResult = loc_imagebtrtransfunc( StateSet ); - - return( BddResult ); -} - -/*------------------------------------------------------------\ -| | -| Btr Creates Transition Function | -| | -\------------------------------------------------------------*/ - -btrtransfunc *createbtrtransfunc( BddSystem, MaxVar ) - - bddsystem *BddSystem; - bddvar MaxVar; -{ - btrtransfunc *TransFunc; - - setbddlocalsystem( BddSystem ); - - if ( MaxVar >= BDD_MAX_VAR ) - { - btrerror( BTR_BAD_VAR_ERROR, MaxVar ); - } - - TransFunc = allocbtrtransfunc(); - - TransFunc->BDD_SYSTEM = BddLocalSystem; - - TransFunc->MAX_VAR = MaxVar; - TransFunc->VAR_FUNC = allocbtrvarfunc( MaxVar ); - TransFunc->VAR_ORDER = allocbtrvarorder( MaxVar ); - - return( TransFunc ); -} - -/*------------------------------------------------------------\ -| | -| Btr Add Transition Function | -| | -\------------------------------------------------------------*/ - -void addbtrtransfunc( TransFunc, VarNode, FuncNode ) - - btrtransfunc *TransFunc; - bddnode *VarNode; - bddnode *FuncNode; -{ - btrvarfunc *VarFunc; - btrvarorder *VarOrder; - long MaxVar; - long NumberVar; - - NumberVar = TransFunc->NUMBER_VAR; - MaxVar = TransFunc->MAX_VAR; - - if ( NumberVar >= BDD_MAX_VAR ) - { - btrerror( BTR_NO_MORE_VAR_ERROR, 0 ); - } - - if ( NumberVar == MaxVar ) - { - MaxVar = MaxVar * BTR_VAR_STRETCH_FACTOR; - - if ( MaxVar >= BDD_MAX_VAR ) - { - MaxVar = BDD_MAX_VAR - 1; - } - - VarFunc = resizebtrvarfunc( TransFunc->VAR_FUNC, - TransFunc->MAX_VAR, MaxVar ); - - VarOrder = resizebtrvarorder( TransFunc->VAR_ORDER, - TransFunc->MAX_VAR, MaxVar ); - - TransFunc->VAR_FUNC = VarFunc; - TransFunc->VAR_ORDER = VarOrder; - TransFunc->MAX_VAR = MaxVar; - } - else - { - VarFunc = TransFunc->VAR_FUNC; - VarOrder = TransFunc->VAR_ORDER; - } - - VarFunc [ NumberVar ].FUNC = incbddrefext( FuncNode ); - VarFunc [ NumberVar ].VAR = VarNode; - VarOrder[ NumberVar ] = NumberVar; - - TransFunc->NUMBER_VAR++; -} - -/*------------------------------------------------------------\ -| | -| Btr Reset Transition Function | -| | -\------------------------------------------------------------*/ - -void resetbtrtransfunc( TransFunc ) - - btrtransfunc *TransFunc; -{ - btrvarfunc *VarFunc; - btrvarorder *VarOrder; - long Variable; - long NumberVar; - - NumberVar = TransFunc->NUMBER_VAR; - VarFunc = TransFunc->VAR_FUNC; - VarOrder = TransFunc->VAR_ORDER; - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - decbddrefext( VarFunc[ Variable ].FUNC ); - } - - memset( (void *)VarFunc, 0, - (size_t)NumberVar * sizeof( btrvarfunc ) ); - - memset( (void *)VarOrder, 0, - (size_t)NumberVar * sizeof( btrvarorder ) ); - - TransFunc->NUMBER_VAR = 0; -} - -/*------------------------------------------------------------\ -| | -| Btr Destroys Transition Function | -| | -\------------------------------------------------------------*/ - -void destroybtrtransfunc( TransFunc ) - - btrtransfunc *TransFunc; -{ - btrvarfunc *VarFunc; - long Variable; - long NumberVar; - - NumberVar = TransFunc->NUMBER_VAR; - VarFunc = TransFunc->VAR_FUNC; - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - decbddrefext( VarFunc[ Variable ].FUNC ); - } - - freebtrvarfunc( TransFunc->VAR_FUNC ); - freebtrvarorder( TransFunc->VAR_ORDER ); - freebtrtransfunc( TransFunc ); -} - -/*------------------------------------------------------------\ -| | -| Btr View Transition Function | -| | -\------------------------------------------------------------*/ - -void viewbtrtransfunc( TransFunc, FuncView ) - - btrtransfunc *TransFunc; - void (*FuncView)(); -{ - btrvarfunc *VarFunc; - long Variable; - long NumberVar; - - fprintf( stdout, "--> BtrTransFunc\n" ); - - fprintf( stdout, " MAX_VAR : %ld\n", (long)TransFunc->MAX_VAR ); - fprintf( stdout, " NUMBER_VAR : %ld\n", (long)TransFunc->NUMBER_VAR ); - - NumberVar = TransFunc->NUMBER_VAR; - VarFunc = TransFunc->VAR_FUNC; - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - fprintf( stdout, " VAR_FUNC[ %ld ] : ", Variable ); - - if ( FuncView ) - { - (*FuncView)( &VarFunc[ Variable ] ); - } - else - { - fprintf( stdout, "\n" ); - } - } - - fprintf( stdout, "<-- BtrTransFunc\n" ); -} - -/*------------------------------------------------------------\ -| | -| Btr Local Reorder Compare | -| | -\------------------------------------------------------------*/ - -static long loc_ordercompare( ValueArray, Index1, Index2 ) - - long *ValueArray; - long Index1; - long Index2; -{ - return( ValueArray[ Index1 ] - ValueArray[ Index2 ] ); -} - -/*------------------------------------------------------------\ -| | -| Btr Reorder Transition Function | -| | -\------------------------------------------------------------*/ - -void reorderbtrtransfunc( TransFunc ) - - btrtransfunc *TransFunc; -{ - btrvarfunc *VarFunc; - btrvarorder *VarOrder; - long NumberVar; - long Variable; - bddnode *BddNode; - - NumberVar = TransFunc->NUMBER_VAR; - VarFunc = TransFunc->VAR_FUNC; - VarOrder = TransFunc->VAR_ORDER; - - setbddlocalsystem( TransFunc->BDD_SYSTEM ); - - if ( BtrLocalCostArray == (long *)0 ) - { - BtrLocalCostArray = (long *)autallocblock( sizeof(long) * NumberVar ); - BtrLocalCostLength = NumberVar; - } - else - if ( BtrLocalCostLength < NumberVar ) - { - BtrLocalCostArray = - - (long *)autresizeblock( (char *)BtrLocalCostArray, - sizeof( long ) * BtrLocalCostLength, - sizeof( long ) * NumberVar ); - - BtrLocalCostLength = NumberVar; - } - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - BddNode = VarFunc[ Variable ].FUNC; - BtrLocalCostArray[ Variable ] = getbddnodesize( (bddsystem *)0, BddNode ); - - } - - sortautarray( BtrLocalCostArray, VarOrder, NumberVar, loc_ordercompare ); -} diff --git a/alliance/src/btr/src/btrfunc.h b/alliance/src/btr/src/btrfunc.h deleted file mode 100644 index 7d26e768..00000000 --- a/alliance/src/btr/src/btrfunc.h +++ /dev/null @@ -1,88 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Btr | -| | -| File : Btr Transition Function | -| | -| Authors : Jacomme Ludovic | -| | -| Date : 03.12.96 | -| | -\------------------------------------------------------------*/ - -# ifndef BTR_FUNC_H -# define BTR_FUNC_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# define BTR_VAR_STRETCH_FACTOR 2 - -/*------------------------------------------------------------\ -| | -| Error | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Warning | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macros | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/btr/src/btrresize.c b/alliance/src/btr/src/btrresize.c deleted file mode 100644 index 0baf9058..00000000 --- a/alliance/src/btr/src/btrresize.c +++ /dev/null @@ -1,123 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Btr | -| | -| File : btrresize.c | -| | -| Date : 03.12.96 | -| | -| Btrhor : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "abl.h" -# include "bdd.h" -# include "btr.h" - -# include -# include "btrresize.h" -# include "btrerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Btr Resize Variable Function | -| | -\------------------------------------------------------------*/ - -btrvarfunc *resizebtrvarfunc( VarFunc, OldNum, NewNum ) - - btrvarfunc *VarFunc; - long OldNum; - long NewNum; -{ - return( (btrvarfunc *)autresizeblock( (char *)VarFunc, - sizeof( btrvarfunc ) * OldNum, - sizeof( btrvarfunc ) * NewNum ) ); -} - -/*------------------------------------------------------------\ -| | -| Btr Resize Variable Order | -| | -\------------------------------------------------------------*/ - -btrvarorder *resizebtrvarorder( VarOrder, OldNum, NewNum ) - - btrvarorder *VarOrder; - long OldNum; - long NewNum; -{ - return( (btrvarorder *)autresizeblock( (char *)VarOrder, - sizeof( btrvarorder ) * OldNum, - sizeof( btrvarorder ) * NewNum ) ); -} - -/*------------------------------------------------------------\ -| | -| Btr Resize Variable Relation | -| | -\------------------------------------------------------------*/ - -btrvarrel *resizebtrvarrel( VarRel, OldNum, NewNum ) - - btrvarrel *VarRel; - long OldNum; - long NewNum; -{ - return( (btrvarrel *)autresizeblock( (char *)VarRel, - sizeof( btrvarrel ) * OldNum, - sizeof( btrvarrel ) * NewNum ) ); -} diff --git a/alliance/src/btr/src/btrresize.h b/alliance/src/btr/src/btrresize.h deleted file mode 100644 index 021fce4f..00000000 --- a/alliance/src/btr/src/btrresize.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Btr | -| | -| File : btrresize.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef BTR_RESIZE_H -# define BTR_RESIZE_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/btr/src/btrtrans.c b/alliance/src/btr/src/btrtrans.c deleted file mode 100644 index ffe4aa99..00000000 --- a/alliance/src/btr/src/btrtrans.c +++ /dev/null @@ -1,319 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Btr | -| | -| File : Btr Transition Relation | -| | -| Authors : Jacomme Ludovic | -| | -| Date : 03.12.96 | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include -# include -# include -# include "mut.h" -# include "aut.h" -# include "abl.h" -# include "bdd.h" -# include "btr.h" -# include "btrtrans.h" -# include "btrerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Btr Image Transition Function | -| | -\------------------------------------------------------------*/ - -bddnode *imagebtrtransrel( TransRel, StateSet ) - - btrtransrel *TransRel; - bddnode *StateSet; -{ - bddnode *BddImage; - btrvarrel *VarRel; - long NumberVar; - long Variable; - - setbddlocalsystem( TransRel->BDD_SYSTEM ); - - NumberVar = TransRel->NUMBER_VAR; - - if ( NumberVar == 0 ) - { - btrerror( BTR_BAD_VAR_ERROR, NumberVar ); - } - - BddImage = BddLocalSystem->ONE; - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - VarRel = &TransRel->VAR_REL[ Variable ]; - BddImage = applybddnode( (bddsystem *)0, ABL_AND, - decbddrefext( BddImage ), VarRel->REL ); - } - - BddImage = relprodbddnodeassoc( (bddsystem *)0, - decbddrefext( BddImage ), StateSet, - TransRel->VAR_ASSOC ); - - BddImage = substbddnodeassoc( (bddsystem *)0, - decbddrefext( BddImage ), - TransRel->PRIME_ASSOC ); - return( BddImage ); -} - -/*------------------------------------------------------------\ -| | -| Btr Create Transition Relation | -| | -\------------------------------------------------------------*/ - -btrtransrel *createbtrtransrel( BddSystem, MaxVar ) - - bddsystem *BddSystem; - bddvar MaxVar; -{ - btrtransrel *TransRel; - - setbddlocalsystem( BddSystem ); - - if ( MaxVar >= BDD_MAX_VAR ) - { - btrerror( BTR_BAD_VAR_ERROR, MaxVar ); - } - - TransRel = allocbtrtransrel(); - - TransRel->BDD_SYSTEM = BddLocalSystem; - - TransRel->MAX_VAR = MaxVar; - TransRel->VAR_REL = allocbtrvarrel( MaxVar ); - - TransRel->PRIME_ASSOC = addbddassoc( (bddsystem *)0 ); - TransRel->VAR_ASSOC = addbddassoc( (bddsystem *)0 ); - - return( TransRel ); -} - -/*------------------------------------------------------------\ -| | -| Btr Add Transition Relation | -| | -\------------------------------------------------------------*/ - -void addbtrtransrel( TransRel, VarNode, PrimeNode, FuncNode ) - - btrtransrel *TransRel; - bddnode *VarNode; - bddnode *PrimeNode; - bddnode *FuncNode; -{ - btrvarrel *VarRel; - bddnode *RelNode; - bddvar VarPrime; - bddvar Variable; - long MaxVar; - long NumberVar; - - setbddlocalsystem( TransRel->BDD_SYSTEM ); - - NumberVar = TransRel->NUMBER_VAR; - MaxVar = TransRel->MAX_VAR; - - if ( NumberVar >= BDD_MAX_VAR ) - { - btrerror( BTR_NO_MORE_VAR_ERROR, 0 ); - } - - if ( NumberVar == MaxVar ) - { - MaxVar = MaxVar * BTR_VAR_STRETCH_FACTOR; - - if ( MaxVar >= BDD_MAX_VAR ) - { - MaxVar = BDD_MAX_VAR - 1; - } - - VarRel = resizebtrvarrel( TransRel->VAR_REL, - TransRel->MAX_VAR, MaxVar ); - - TransRel->VAR_REL = VarRel; - TransRel->MAX_VAR = MaxVar; - } - else - { - VarRel = TransRel->VAR_REL; - } - - VarPrime = BddLocalSystem->INDEX_TO_VAR[ PrimeNode->INDEX ]; - Variable = BddLocalSystem->INDEX_TO_VAR[ VarNode->INDEX ]; - - addbddnodeassoc( (bddsystem *)0, TransRel->PRIME_ASSOC, VarPrime, VarNode ); - addbddnodeassoc( (bddsystem *)0, TransRel->VAR_ASSOC , Variable, PrimeNode ); - - RelNode = applybddnode( (bddsystem *)0, ABL_NXOR, FuncNode, PrimeNode ); - - VarRel[ NumberVar ].REL = RelNode; - VarRel[ NumberVar ].VAR = VarNode; - VarRel[ NumberVar ].PRIME = PrimeNode; - - TransRel->NUMBER_VAR++; -} - -/*------------------------------------------------------------\ -| | -| Btr Reset Transition Relation | -| | -\------------------------------------------------------------*/ - -void resetbtrtransrel( TransRel ) - - btrtransrel *TransRel; -{ - btrvarrel *VarRel; - long Variable; - long NumberVar; - - setbddlocalsystem( TransRel->BDD_SYSTEM ); - - NumberVar = TransRel->NUMBER_VAR; - VarRel = TransRel->VAR_REL; - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - decbddrefext( VarRel[ Variable ].REL ); - } - - memset( (void *)VarRel, 0, - (size_t)NumberVar * sizeof( btrvarrel ) ); - - TransRel->NUMBER_VAR = 0; - - resetbddassoc( (bddsystem *)0, TransRel->PRIME_ASSOC ); - resetbddassoc( (bddsystem *)0, TransRel->VAR_ASSOC ); -} - -/*------------------------------------------------------------\ -| | -| Btr Destroy Transition Relation | -| | -\------------------------------------------------------------*/ - -void destroybtrtransrel( TransRel ) - - btrtransrel *TransRel; -{ - btrvarrel *VarRel; - long Variable; - long NumberVar; - - setbddlocalsystem( TransRel->BDD_SYSTEM ); - - NumberVar = TransRel->NUMBER_VAR; - VarRel = TransRel->VAR_REL; - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - decbddrefext( VarRel[ Variable ].REL ); - } - - freebtrvarrel( TransRel->VAR_REL ); - freebtrtransrel( TransRel ); - - delbddassoc( (bddsystem *)0, TransRel->PRIME_ASSOC ); - delbddassoc( (bddsystem *)0, TransRel->VAR_ASSOC ); -} - -/*------------------------------------------------------------\ -| | -| Btr View Transition Relation | -| | -\------------------------------------------------------------*/ - -void viewbtrtransrel( TransRel, FuncView ) - - btrtransrel *TransRel; - void (*FuncView)(); -{ - btrvarrel *VarRel; - long Variable; - long NumberVar; - - fprintf( stdout, "--> BtrTransRel\n" ); - - fprintf( stdout, " MAX_VAR : %ld\n", (long)TransRel->MAX_VAR ); - fprintf( stdout, " NUMBER_VAR : %ld\n", (long)TransRel->NUMBER_VAR ); - - NumberVar = TransRel->NUMBER_VAR; - VarRel = TransRel->VAR_REL; - - for ( Variable = 0; Variable < NumberVar; Variable++ ) - { - fprintf( stdout, " VAR_REL[ %ld ] : ", Variable ); - - if ( FuncView ) - { - (*FuncView)( &VarRel[ Variable ] ); - } - else - { - fprintf( stdout, "\n" ); - } - } - - fprintf( stdout, "<-- BtrTransRel\n" ); -} diff --git a/alliance/src/btr/src/btrtrans.h b/alliance/src/btr/src/btrtrans.h deleted file mode 100644 index abc38ce7..00000000 --- a/alliance/src/btr/src/btrtrans.h +++ /dev/null @@ -1,88 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Btr | -| | -| File : Btr Transition Function | -| | -| Authors : Jacomme Ludovic | -| | -| Date : 03.12.96 | -| | -\------------------------------------------------------------*/ - -# ifndef BTR_TRANS_H -# define BTR_TRANS_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# define BTR_VAR_STRETCH_FACTOR 2 - -/*------------------------------------------------------------\ -| | -| Error | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Warning | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macros | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/btr/src/main.c b/alliance/src/btr/src/main.c deleted file mode 100644 index a75f8c93..00000000 --- a/alliance/src/btr/src/main.c +++ /dev/null @@ -1,508 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Btr | -| | -| File : main.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include -# include - -# include "mut.h" -# include "aut.h" -# include "abl.h" -# include "log.h" -# include "beh.h" -# include "bvl.h" -# include "bhl.h" -# include "btr.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static char *BtrStateArray = (char *)0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Btr Usage | -| | -\------------------------------------------------------------*/ - -void BtrUsage() -{ - fprintf( stderr, "Usage: btrtest [-tfip] filename\n" ); - - exit( 1 ); -} - -/*------------------------------------------------------------\ -| | -| BtrViewBddState | -| | -\------------------------------------------------------------*/ - -void BtrViewBddState( BddNode ) - - bddnode *BddNode; -{ - bddindex BddIndex; - - if ( BddNode->INDEX < BDD_INDEX_MIN ) - { - if ( BddNode->INDEX == BDD_INDEX_ONE ) - { - fprintf( stdout, "%s\n", BtrStateArray ); - } - } - else - { - BddIndex = BddNode->INDEX - BDD_INDEX_MIN; - - BtrStateArray[ BddIndex ] = '1'; - BtrViewBddState( BddNode->HIGH ); - - BtrStateArray[ BddIndex ] = '0'; - BtrViewBddState( BddNode->LOW ); - - BtrStateArray[ BddIndex ] = '*'; - } -} - -/*------------------------------------------------------------\ -| | -| BtrViewBddNode | -| | -\------------------------------------------------------------*/ - -void BtrViewBddNode( BddNode ) - - bddnode *BddNode; -{ - chain_list *Expr; - - Expr = convertbddcircuitabl( (bddcircuit *)0, BddNode ); - viewablexpr( Expr, ABL_VIEW_VHDL ); - delablexpr( Expr ); - - fprintf( stdout, "\n" ); -} - -/*------------------------------------------------------------\ -| | -| BtrViewFunc | -| | -\------------------------------------------------------------*/ - -void BtrViewFunc( VarFunc ) - - btrvarfunc *VarFunc; -{ - fprintf( stdout, "\nVAR : " ); - BtrViewBddNode( VarFunc->VAR ); - fprintf( stdout, "FUNC: " ); - BtrViewBddNode( VarFunc->FUNC ); -} - -/*------------------------------------------------------------\ -| | -| BtrViewRel | -| | -\------------------------------------------------------------*/ - -void BtrViewRel( VarRel ) - - btrvarrel *VarRel; -{ - fprintf( stdout, "\nVAR : " ); - BtrViewBddNode( VarRel->VAR ); - fprintf( stdout, "PRIME: " ); - BtrViewBddNode( VarRel->PRIME ); - fprintf( stdout, "REL: " ); - BtrViewBddNode( VarRel->REL ); -} - -/*------------------------------------------------------------\ -| | -| PreImage | -| | -\------------------------------------------------------------*/ - -void BtrPreImageFunc( BtrTransFunc, BddInitial, BddAssoc ) - - btrtransfunc *BtrTransFunc; - bddnode *BddInitial; - bddassoc *BddAssoc; -{ - bddnode *BddCurrent; - bddnode *BddReached; - bddnode *BddNew; - bddnode *BddPreImage; - - BddCurrent = BddInitial; - - fprintf( stdout, "Initial:\n" ); -/*\ - BtrViewBddState( BddCurrent ); -\*/ - - BddReached = incbddrefext( BddCurrent ); - - do - { - BddPreImage = (bddnode *)preimagebtrtransfunc( BtrTransFunc, BddCurrent ); - decbddrefext( BddCurrent ); - - BddCurrent = missbddnodeassocon( (bddsystem *)0, BddPreImage, BddAssoc ); - decbddrefext( BddPreImage ); - - fprintf( stdout, "PreImage:\n" ); -/*\ - BtrViewBddState( BddCurrent ); -\*/ - BddNew = applybddnodenot( (bddsystem *)0, BddReached ); - BddNew = applybddnode( (bddsystem *)0, ABL_AND, BddCurrent, decbddrefext( BddNew ) ); - - BddReached = applybddnode( (bddsystem *)0, ABL_OR, - decbddrefext( BddReached ), - decbddrefext( BddCurrent ) ); - - BddCurrent = BddNew; - } - while ( BddNew != BddLocalSystem->ZERO ); - - decbddrefext( BddReached ); -} - -/*------------------------------------------------------------\ -| | -| Image | -| | -\------------------------------------------------------------*/ - -void BtrImageFunc( BtrTransFunc, BddInitial ) - - btrtransfunc *BtrTransFunc; - bddnode *BddInitial; -{ - bddnode *BddCurrent; - bddnode *BddReached; - bddnode *BddNew; - bddnode *BddImage; - - BddCurrent = BddInitial; - - fprintf( stdout, "Initial:\n" ); - BtrViewBddState( BddCurrent ); - - BddReached = incbddrefext( BddCurrent ); - - do - { - BddImage = (bddnode *)imagebtrtransfunc( BtrTransFunc, BddCurrent ); - - decbddrefext( BddCurrent ); - BddCurrent = BddImage; - - fprintf( stdout, "Image:\n" ); - BtrViewBddState( BddImage ); - - BddNew = applybddnodenot( (bddsystem *)0, BddReached ); - BddNew = applybddnode( (bddsystem *)0, ABL_AND, BddCurrent, decbddrefext( BddNew ) ); - - BddReached = applybddnode( (bddsystem *)0, ABL_OR, - decbddrefext( BddReached ), - decbddrefext( BddCurrent ) ); - - BddCurrent = BddNew; - } - while ( BddNew != BddLocalSystem->ZERO ); - - decbddrefext( BddReached ); -} - -/*------------------------------------------------------------\ -| | -| Image | -| | -\------------------------------------------------------------*/ - -void BtrImageRel( BtrTransRel, BddInitial, BddAssoc ) - - btrtransrel *BtrTransRel; - bddnode *BddInitial; - bddassoc *BddAssoc; -{ - bddnode *BddCurrent; - bddnode *BddReached; - bddnode *BddNew; - bddnode *BddImage; - - BddCurrent = BddInitial; - - fprintf( stdout, "Initial:\n" ); - BtrViewBddState( BddCurrent ); - - BddReached = incbddrefext( BddCurrent ); - - do - { - BddImage = (bddnode *)imagebtrtransrel( BtrTransRel, BddCurrent ); - BddImage = missbddnodeassocon( (bddsystem *)0, - decbddrefext( BddImage ), BddAssoc ); - - decbddrefext( BddCurrent ); - BddCurrent = BddImage; - - fprintf( stdout, "Image:\n" ); - BtrViewBddState( BddImage ); - - BddNew = applybddnodenot( (bddsystem *)0, BddReached ); - BddNew = applybddnode( (bddsystem *)0, ABL_AND, BddCurrent, decbddrefext( BddNew ) ); - - BddReached = applybddnode( (bddsystem *)0, ABL_OR, - decbddrefext( BddReached ), - decbddrefext( BddCurrent ) ); - - BddCurrent = BddNew; - } - while ( BddNew != BddLocalSystem->ZERO ); - - decbddrefext( BddReached ); -} - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -int main( argc, argv ) - - int argc; - char *argv[]; -{ - befig_list *BehFigure; - bereg_list *BehReg; - binode_list *BiNode; - bddnode *BddNode; - bddnode *BddPrime; - - bddassoc *BddAssoc; - - bddnode *BddInitial; - bddsystem *BddSystem; - bddcircuit *BddCircuit; - - long BtrNumReg; - - btrtransfunc *BtrTransFunc; - btrtransrel *BtrTransRel; - char Buffer[ 512 ]; - - char *InputFileName; - int FlagImage; - int FlagFunc; - int FlagDebug; - - int Number; - int Index; - char Option; - - mbkenv(); - - InputFileName = (char *)0; - FlagImage = 1; - FlagFunc = 1; - FlagDebug = 0; - - for ( Number = 1; Number < argc; Number++ ) - { - if ( argv[ Number ][ 0 ] == '-' ) - { - for ( Index = 1; argv[ Number ][ Index ] != '\0'; Index++ ) - { - Option = argv[ Number ][ Index ]; - - switch ( Option ) - { - case 'f' : FlagFunc = 1; - break; - case 't' : FlagFunc = 0; - break; - case 'i' : FlagImage = 1; - break; - case 'p' : FlagImage = 0; - break; - case 'd' : FlagDebug = 1; - break; - default : BtrUsage(); - } - } - } - else - { - InputFileName = argv[ Number ]; - } - } - - if ( ( argc < 2 ) || - ( InputFileName == (char *)0 ) ) - { - BtrUsage(); - } - - fprintf( stdout, "vhdlloadbefig %s\n", InputFileName ); - BehFigure = vhdlloadbefig( (befig_list *)0, InputFileName, 3 ); - fprintf( stdout, "file %s loaded\n", InputFileName ); - - BddSystem = createbddsystem( 100, 1000, 100, 500000 ); - reorderbddsystemdynamic( BddSystem, reorderbddsystemsimple, 30000, 100 ); - - BehFigure->BEDLY = (beaux_list *)0; - - fprintf( stdout, "beh_makbdd\n" ); - beh_makbdd( BehFigure, 0, 0 ); - - if ( FlagFunc ) - { - BtrTransFunc = createbtrtransfunc( (bddsystem *)0, 100 ); - } - else - { - BtrTransRel = createbtrtransrel( (bddsystem *)0, 100 ); - } - - BddAssoc = addbddassoc( (bddsystem *)0 ); - - BehReg = BehFigure->BEREG; - - while ( BehReg != (bereg_list *)0 ) - { - BiNode = BehReg->BINODE; - - BddNode = searchbddcircuitin( (bddcircuit *)0, BehReg->NAME ); - - if ( FlagFunc ) - { - addbtrtransfunc( BtrTransFunc, BddNode, BiNode->VALNODE ); - } - else - { - sprintf( Buffer, "'%s", BehReg->NAME ); - BddPrime = addbddcircuitin( (bddcircuit *)0, Buffer, - BddNode->INDEX, BDD_IN_MODE_AFTER ); - - addbtrtransrel( BtrTransRel, BddNode, BddPrime, BiNode->VALNODE ); - } - - addbddnodeassoc( (bddsystem *)0, BddAssoc, - getbddvarbyindex( (bddsystem *)0, BddNode->INDEX ), - BddLocalSystem->ONE ); - - BehReg = BehReg->NEXT; - } - - BtrStateArray = autallocblock( BddLocalCircuit->NUMBER_NAME_IN + 1 ); - memset( BtrStateArray, '*', BddLocalCircuit->NUMBER_NAME_IN ); - - fprintf( stdout, "Node: %ld\n", BddSystem->NUMBER_NODE ); - - testbddcircuit( (bddcircuit *)0 ); - - BddInitial = searchbddcircuitout( (bddcircuit *)0, "initial" ); - - if ( BddInitial == (bddnode *)0 ) - { - fprintf( stdout, "Missing output 'initial'\n" ); - EXIT( 1 ); - } - - if ( FlagFunc ) - { - if ( FlagDebug ) - { - viewbtrtransfunc( BtrTransFunc, BtrViewFunc ); - } - - if ( FlagImage ) BtrImageFunc ( BtrTransFunc, BddInitial ); - else BtrPreImageFunc( BtrTransFunc, BddInitial, BddAssoc ); - - destroybtrtransfunc( BtrTransFunc ); - } - else - { - if ( FlagDebug ) - { - viewbtrtransrel( BtrTransRel, BtrViewRel ); - } - - if ( FlagImage ) BtrImageRel( BtrTransRel, BddInitial, BddAssoc ); - - destroybtrtransrel( BtrTransRel ); - } - - delbddassoc( (bddsystem *)0, BddAssoc ); - - testbddcircuit( (bddcircuit *)0 ); - - destroybddcircuit( BehFigure->CIRCUI ); - destroybddsystem( BddSystem ); - - beh_frebefig( BehFigure ); - - return( 0 ); -} diff --git a/alliance/src/exp/Makefile.am b/alliance/src/exp/Makefile.am deleted file mode 100644 index ce9d1044..00000000 --- a/alliance/src/exp/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -## Process this file with automake to produce Makefile.in - -SUBDIRS = doc src diff --git a/alliance/src/exp/configure.in b/alliance/src/exp/configure.in deleted file mode 100644 index 444300cc..00000000 --- a/alliance/src/exp/configure.in +++ /dev/null @@ -1,35 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(src/expy.y) - -EXP_MAJOR_VERSION=1 -EXP_MINOR_VERSION=0 -EXP_VERSION=$EXP_MAJOR_VERSION.$EXP_MINOR_VERSION - -AC_SUBST(EXP_MAJOR_VERSION) -AC_SUBST(EXP_MINOR_VERSION) -AC_SUBST(EXP_VERSION) - -# For automake. -VERSION=$EXP_VERSION -PACKAGE=exp - -dnl Initialize automake stuff -AM_INIT_AUTOMAKE($PACKAGE, $VERSION) - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_RANLIB -AM_PROG_LEX -AC_PROG_YACC -AC_PROG_MAKE_SET - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST - -AM_ALLIANCE - -AC_OUTPUT([ -Makefile -doc/Makefile -src/Makefile -]) diff --git a/alliance/src/exp/doc/Makefile.am b/alliance/src/exp/doc/Makefile.am deleted file mode 100644 index c45911fc..00000000 --- a/alliance/src/exp/doc/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -## Process this file with automake to produce Makefile.in - -man_MANS = exp.1 -EXTRA_DIST = $(man_MANS) diff --git a/alliance/src/exp/doc/exp.1 b/alliance/src/exp/doc/exp.1 deleted file mode 100644 index 52932088..00000000 --- a/alliance/src/exp/doc/exp.1 +++ /dev/null @@ -1,328 +0,0 @@ -.\" --------------------------------------------------------------------------- -.TH EXP 1.0 "March 18, 2002" "UPMC/ASIM/LIP6" -.\" $Id: exp.1,v 1.1 2002/04/09 12:33:07 franck Exp $ -.\" @(#)02/02/18 UPMC/ASIM/LIP6; Author: Franck Wajsburt -.\" --------------------------------------------------------------------------- -.\" Main useful commands -.\" -------------------- -.\" .TH Head and Foot of page -.\" .SH at the line begining is a Section Header -.\" .SS at the line begining is a Sub-Section Header -.\" .TP allows to present a list of items, the nextline is the title, -.\" the following lines is the corpus shifted of chars. -.\" if is omited, the default value is 7 -.\" .so filename allows to include a filename (absolute or relative to MANPATH) -.\" \fB is for Bold font \fP is to return to Previous font -.\" \fI is to underlined or to change to Italic font -.\" .B .I can be used for Bold or Italic, if place a the line beginning -.\" .br at the line begining break the line, a blank line put a blank line -.\" .nf Begins a Non-Formatted zone where each line-break is put as-is -.\" .fi Returns to Formatted mode .nf/.fi is usefull for example to draw tables -.\" --------------------------------------------------------------------------- - -.SH EXP -.\" --------------------------------------------------------------------------- - -exp - a multiple expession calculator. - -.so man1/origin.1 - -.SH SYNOPSIS -.\" --------------------------------------------------------------------------- - -\fBexp\fP [\fB-v\fPn\fI0..4\fP] [\fB-o\fP \fIoutput-file\fP] [\fIinput-file\fP] - -.SH DESCRIPTION -.\" --------------------------------------------------------------------------- - -Input is an ascii format file including numeric expessions with variables. -Input file can includes other input files thanks to an inclusion directive. -\fBexp\fP reads the input files to write it as is in the output file, but the -numeric expessions are replaced by their value. - -.SH OPTIONS -.\" --------------------------------------------------------------------------- - -.TP -.B -v -verbose mode -.br -0 : quiet mode -.br -1 : messages \fImess(...)\fP are printed -.br -2 : few statistics -.br -3 : all expressions are decomposed -.br -4 : yacc messages -.TP -.B -o \fIoutput-file\fP -where \fBexp\fP writes (stdout by default). -.TP -.I input-file -where \fBexp\fP reads (stdin by default). - -.SH EXP FORMAT FILES -.\" --------------------------------------------------------------------------- - -Except the expessionsi and offline comments, the output file is identical to the -flattened view of the input files whatever they are. -The expession forms can be either \fI[expessions]\fP or \fI{expessions}\fP. -The first form is for floating point expessions, the second one is for -integer expessions. By default, the print format is respectively %7.3f -and %4d (cf. \fIsprintf(3)\fP). -Offline comments begins with // and ends at the beginning of the next line. - -.I Examples -.IP \(bu 3 -[ 3.0 + 12.1] \fIprint\fP 15.100 -.IP \(bu 3 -{ 3.0 + 12.1} \fIprint\fP 15 -.P - -It is possible to have more that one expession separated by \fI;\fP -(semi-column). All the expessions of a list are computed, but only the last -one is printed. If the last expession is empty, \fBexp\fP do not print -anything (see Examples section). - -.I Examples -.IP \(bu 3 -[ 6. *2.0; -.br - 3.0 + 12.1 ] \fIprint\fP 15.100 -.IP \(bu 3 -[ 6. *2.0; -.br - 3.0 + 12.1; ] \fIprint\fP nothing -.P - -It is possible to have comments in expessions. A comment begins with \fI#\fP -(diese) and ends to the carriage return. -Comment in expression is not copied to the output file. - -.I Example -.IP \(bu 3 -[ 3.0 + 12.1 # comment -.br -] \fIprint\fP 15.100 - -.SS Expessions -.\" ---------- - -Expession is a multi-level numeric expession using numbers, variables, -arithmetic operators and numeric functions. - -.I Examples -.IP \(bu 3 -[ i=3.0; i*12.1] \fIprint\fP 15.100 - -.IP \(bu 3 -{i=3} \fIprint\fP 3 -.br -{i++} \fIprint\fP 4 -.P - -.SS Arithmetic Operators -.\" -------------------- -The operators, in order of increasing priority, are - -.TP -.B + - -Addition and subtraction. -.TP -.B * / -Multiplication and division. -.TP -.B ++ -- -post-incrementation of 1, post-decrementation of 1. -.TP -.B ( ) -Grouping -.TP -.B = -Variable affectation. The return value is the one affected. - -.SS Boolean Operators -.\" ----------------- -.TP -.B > < -respectively greater than and lower than -.TP -.B def(variable) -True whenever variable is defined yet -.TP -.B ndef(variable) -True whenever variable is not defined yet - -.SS Variables -.\" --------- - -Expession values may be stored in simple variables. -.\" or one dimension arrays. -There are three forms of variable name. -First, they can begin with a letter followed by any number of letters, digits -and underscores; second, they can begin with \fI"\fP (double quote) followed -by any number of any char and ended by a \fI"\fP; Third they can begin with -\fI\'\fP (quote) then a regular expression (see \fIregex(7)\fP) ended -by \fI\'\fP. \fBexp\fP is case sensitive. -.\" Array index is put between \fI()\fP. - -.I Examples -.IP \(bu 3 -[ VAR_1=3.0; # first form -.br - "variable numero 2"=12.0; # second form -.br -] \fIprint\fP nothing -.IP \(bu 3 -[ VAR_1 * "variable numero 2" ] \fIprint\fP 15.100 -.P - -When a variable appears in the right member of an affectation, \fBexp\fP -uses its value. If it has never been defined, this causes a fatal error. -If it appears the left member, the first time it is automatically created -and its value is set, or its value is changed. - -.SS Special variables -.\" ----------------- - -\fBfloat_fmt\fP, \fBinteger_fmt\fP and \fBstring_fmt\fP special variables to -redefine print format of floats, integers and strings. Defaults are %7.3f, -%-8s and %4d. Those variables are the only variables with a non numerical -value. - -.I Examples -.IP \(bu 3 -[\fBfloat_fmt\fP = "%7.1f";] \fIprint\fP nothing -.IP \(bu 3 -[ 3.0 + 12.1] \fIprint\fP 15.1 -.P - -\fBverbose\fP is the variable passed in argument list, which can be modified -by the program itself. - -.I Examples \fP get details of expression calculation -.IP \(bu 3 -[tmp = \fBverbose\fP; \fBverbose\fP = 3; \fI..expressions..\fP; -.br -\fBverbose\fP = tmp;] -.P - -.SS Numeric functions -.\" ----------------- - -Few numeric functions are available. The form is \fIfun(args)\fP. -The arguments take the form of a list of expessions, separated with a \fI,\fP -(comma). The number of arguments depends on functions. -It is possible to make a list of arguments with a regular expession -(see \fIregex(7)\fP). -Then all matching variable names are part of the list. -.TP -.B min\fI(args)\fP max\fI(args)\fP -The minimum (resp. maximum) value of its arguments. - -.I Examples -.RS 7 -.IP \(bu 3 -[min(3.0,12.1)] \fIprint\fP 3.000 -.IP \(bu 3 -[min('RW_ALU.*')] \fIprint\fP min value of all variables begining by RW_ALU -.RE - -.TP -.B inf\fI(step,val)\fP sup\fI(step,val)\fP -Two arguments. \fPinf\fP (resp. \fPsup\fP) function rounds the second argument -(val) downwards (resp. upwards) to an integer number of the first argument -(step). - -.I Examples -.RS 7 -.IP \(bu 3 -[step=0.3;value=1.6;inf(step,value)] \fIprint\fP 1.500 -.RE - -.SS Special functions and directives -.\" -------------------------------- - -.TP -.B if\fI(condition, expr1, expr2, ...)\fP -Calculates the condition if it is true (means greater than zero), the following -expressions are all calculated. -.TP -.B sort\fI(args)\fP rsort\fI(args)\fP -\fBsort\fP (resp. reverse \fBrsort\fP) numerically all its arguments, each -argument must be a variable, not directly a numeric expession. The return -value is the sorted list of its arguments. -.TP -.B message\fI(args)\fP -writes its arguments to stdout using \fIfloat_fmt\fP, one argument per line. -The form is : -\fIvariable_name = value;\fP, -value is omitted if the variable has never been defined. -.br -.I Examples -.RS 7 -.IP \(bu 3 -[message('"'this is a message'"');] \fIprint\fP -.br -this is a message -.IP \(bu 3 -[a1b=0; a2b=1O; a3b=5; message(a*b);] \fIprint\fP -.br -a1b = 0.000 -.br -a2b = 1O.000 -.br -a3b = 5.000 -.IP \(bu 3 -[string_fmt=%6s; message(sort(a*b));] \fIprint\fP -.br - a1b = 0.000 -.br - a3b = 5.000 -.br - a2b = 1O.000 -.RE - -.TP -\fB#include "filename"\fP -Opens the file in argument then returns to the current file as soon as the new -one is empty. - -.SH EXAMPLES -.\" --------------------------------------------------------------------------- - -.TP -.B Input file -.nf -# this is a test file -[ # few variables - WITDH = 2; - LENGTH = 25 ; -] -this message is unchanged but all expresions are computed - length_div_2 = [LENGTH/2] - length_mul_2 = {LENGTH*2} - result = [max ('leng.*')] -.fi -.TP -.B Output file -.nf -# this is a test file - -this message is unchanged but all expresions are computed - length_div_2 = 12.500 - length_mul_2 = 50 - result = 12.500 -.fi - -.SH AUTHOR - -Written by Franck Wajsburt. - -.SH SEE ALSO - -Alliance .rds file uses \fBexp\fP to be generated. - -.so man1/bug_report.1 diff --git a/alliance/src/exp/src/Makefile.am b/alliance/src/exp/src/Makefile.am deleted file mode 100644 index 52c2442f..00000000 --- a/alliance/src/exp/src/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -## Process this file with automake to produce Makefile.in - -bin_PROGRAMS = exp - -YACC = @YACC@ -d -v --debug -CFLAGS = @CFLAGS@ @ALLIANCE_CFLAGS@ -exp_LDADD = -lm -lfl - -exp_SOURCES = exp.h expy.y expl.l ht.c ht.h main.c diff --git a/alliance/src/exp/src/exp.h b/alliance/src/exp/src/exp.h deleted file mode 100644 index 3197b792..00000000 --- a/alliance/src/exp/src/exp.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _RDS_H_ -#define _RDS_H_ - -#include "ht.h" - -extern int yydebug; -extern int yyparse(void); -extern FILE *yyin; -extern FILE *yyout; -extern ht_t * dico; -extern int verbose; -extern char * expfname ; - -#endif diff --git a/alliance/src/exp/src/expl.l b/alliance/src/exp/src/expl.l deleted file mode 100644 index 1a4721fd..00000000 --- a/alliance/src/exp/src/expl.l +++ /dev/null @@ -1,111 +0,0 @@ -%{ -#include -#include -#include -#include -#include "exp.h" -#include "expy.h" - -extern int lineno; -#define MAX_INCLUDE_DEPTH 10 -YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; -int lineno_stack[MAX_INCLUDE_DEPTH]; -char * fname_stack[MAX_INCLUDE_DEPTH]; -int include_stack_ptr = 0; - -%} -localcomment [ \t]*\/\/.*\n -comment ([ \t]*[#].*) -regex (\'[^'\n#]+\') -ident ([a-zA-Z][a-zA-Z0-9_]*)|(\"[^"\n#]+\") -number ([0-9]+|([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+))([eE][+\-]?[0-9]+)? -blank [ \t]+ -if [iI][fF] -min [mM][iI][nN] -max [mM][aA][xX] -inf [iI][nN][fF] -sup [sS][uU][pP] -sort [sS][oO][rR][tT] -rsort [rR][sS][oO][rR][tT] -def [Dd][Ee][Ff] -ndef [Nn][Dd][Ee][Ff] -include [Ii][Nn][Cc][Ll][Uu][Dd][Ee] -message [Mm][Ee][Ss][Ss][Aa][Gg][Ee] -%x EXP INC -%% -{localcomment} {lineno++;} -[\[\{] {BEGIN(EXP);return *yytext;} -[\]}] {BEGIN(INITIAL);return *yytext;} - -\n {lineno++;ECHO;} -{comment} {ECHO;} -{include} {BEGIN(INC);} -{ident} { /* got the include file name */ - char * filename = yytext; - if (include_stack_ptr >= MAX_INCLUDE_DEPTH) { - fprintf (stderr, " %-3d %s : Includes nested too deeply\n", lineno, expfname); - exit (1); - } - if (*filename == '"') { - *(filename+yyleng-1)='\0'; - filename +=1; - } - if ((yyin = fopen( filename, "r" )) == NULL) { - fprintf (stderr, " %-3d %s : %s cannot be opened\n", - lineno, expfname, filename); - exit (1); - } - include_stack[include_stack_ptr] = YY_CURRENT_BUFFER; - lineno_stack[include_stack_ptr] = lineno; - fname_stack[include_stack_ptr++] = expfname; - if ((expfname = strdup (filename)) == NULL) { - fprintf (stderr, " %-3d %s : not enough memory\n", lineno, expfname, filename); - exit (1); - } - lineno = 1; - yy_switch_to_buffer( yy_create_buffer( yyin, YY_BUF_SIZE ) ); - BEGIN(INITIAL); - } -<> { if ( --include_stack_ptr < 0 ) - yyterminate(); - else { - yy_delete_buffer (YY_CURRENT_BUFFER ); - yy_switch_to_buffer (include_stack[include_stack_ptr] ); - expfname = fname_stack[include_stack_ptr]; - lineno = lineno_stack[include_stack_ptr]; - } - } -\n {lineno++;} -{comment} {} -{if} {return IF;} -{min} {return MIN;} -{max} {return MAX;} -{inf} {return INF;} -{sup} {return SUP;} -{def} {return DEF;} -{ndef} {return NDEF;} -{sort} {return SORT;} -{rsort} {return RSORT;} -{message} {return MESS;} -{regex} { - *(yytext+yyleng-1)='\0'; - yylval.e=htsetre(dico,yytext+1); - return REGEX; - } -{ident} { if (dico==NULL) dico=htinit(10000); - if (*yytext == '"') { - *(yytext+yyleng-1)='\0'; - yylval.e=htset(dico,yytext+1); - } - else - yylval.e=htset(dico,yytext); - return IDENT; - } -{number} {yylval.f=atof(yytext); return NUMBER;} -"++" {return PP;} -"--" {return MM;} -{blank} {} -. {return *yytext;} -. {ECHO;} -%% - diff --git a/alliance/src/exp/src/expy.y b/alliance/src/exp/src/expy.y deleted file mode 100644 index 3b3c24b7..00000000 --- a/alliance/src/exp/src/expy.y +++ /dev/null @@ -1,192 +0,0 @@ -%{ -#include -#include -#include -#include "exp.h" -#include "ht.h" - -#define VERBOSE (int)((htget(dico, "verbose")->VAL.f+EPSILON)) -#define EPSILON 0.00001 -#define anint(x) floor((x) + 0.5) -#define test_init(i) if (((i)->TYPE==0) && ((pcond==0) || (cond[pcond]>0.))) {\ - printf(" %-3d %s : <%s> undefined\n", lineno, expfname, (i)->KEY);\ - exit (1);}\ - (i)->USED = 1 -#define pa(v,e) if (VERBOSE>2) printf("%7.3f -> %s\n",e,v->KEY) -#define pi(e) if (VERBOSE>2) printf("%7.3f <- %s\n",e->VAL.f,e->KEY) -#define pe(s,n) if (VERBOSE>2) printf("%7.3f %s\n",n,s) -#define PCONDMAX 16 /* profondeur de la pile de conditions */ - -int lineno=1; -char * expfname; -ht_t * dico; - -static int pcond=0; -static double cond[PCONDMAX]; /* pile de conditions : +1:vrai, -1:faux */ -static char * string_fmt = "%-65s"; -static char * float_fmt = "%7.3f"; -static char * integer_fmt = "%4d"; -static htelt_t * ele; - -double limit (int fun, htelt_t * args) -{ - htelt_t *ele; - double res; - for (ele = args; ele && ele->TYPE == 0; ele = ele->NEXT); - if (ele == NULL) - { - printf(" %-3d %s : none variable defined\n", lineno, expfname);\ - exit (1); - } - res = ele->VAL.f; - for (; ele; ele = ele->NEXT) - if ((ele->TYPE != 0) && (((fun == MAX) && (res < ele->VAL.f)) || ((fun == MIN) && (res > ele->VAL.f)))) - res = ele->VAL.f; - eltremove (args); - return res; -} - -htelt_t *bsort (int sens, htelt_t * args) -{ - htelt_t *ele; - int bubble = 1; - if (args->NEXT) /* au moins de 2 elements dans la liste */ - while (bubble) - { - bubble = 0; - for (ele = args; ele->NEXT; ele = ele->NEXT) - if (((sens == SORT) && (((ele->VAL.e)->VAL.f) > (((ele->NEXT)->VAL.e)->VAL.f))) - || ((sens == RSORT) && (((ele->VAL.e)->VAL.f) < (((ele->NEXT)->VAL.e)->VAL.f))) - || ((sens == MESS) && (strcmp((ele->VAL.e)->KEY,((ele->NEXT)->VAL.e)->KEY)>0))) - { - htelt_t *tmp = ele->VAL.e; - ele->VAL.e = (ele->NEXT)->VAL.e; - (ele->NEXT)->VAL.e = tmp; - bubble = 1; - } - } - return args; -} - -htelt_t *mess (int type, char *fmt, htelt_t * args) -{ - htelt_t *ele; - if (VERBOSE) - { - for (ele = args; ele; ele = ele->NEXT) - { - if ((type == MESS) || ((ele->VAL.e)->TYPE == HT_FLOAT)) - { - printf (string_fmt, (ele->VAL.e)->KEY); - if ((ele->VAL.e)->TYPE == HT_FLOAT) - { - printf (" = "); - printf (fmt, (ele->VAL.e)->VAL.f); - } - printf ("\n"); - } - } - } - eltremove (args); -} - -%} -%union -{ - htelt_t * e; - double f; -} -%token IF PP MM MAX MIN SUP INF SORT RSORT MESS DEF NDEF -%token NUMBER -%token IDENT REGEX -%type exp cond -%type args idents -%right '=' -%right '<' '>' -%left '+' '-' -%left '*' '/' -%% -blocs : /* rien */ { if (VERBOSE>1) htstat(dico); return 1;} - | bloc blocs - ; -bloc : '[' exps exp ']' { fprintf (yyout, float_fmt, $3);} - | '{' exps exp '}' { fprintf (yyout, integer_fmt, (int)$3);} - | '[' exp ']' { fprintf (yyout, float_fmt, $2);} - | '{' exp '}' { fprintf (yyout, integer_fmt, (int)$2);} - | '[' SORT '(' idents ')' ']' { mess(SORT,float_fmt, bsort (SORT, $4));} - | '{' SORT '(' idents ')' '}' { mess(SORT,integer_fmt, bsort (SORT, $4));} - | '[' RSORT '(' idents ')' ']' { mess(SORT,float_fmt, bsort (RSORT, $4));} - | '{' RSORT '(' idents ')' '}' { mess(SORT,integer_fmt, bsort (RSORT, $4));} - | '[' MESS '(' idents ')' ']' { mess(MESS,float_fmt, bsort (MESS, $4));} - | '{' MESS '(' idents ')' '}' { mess(MESS,integer_fmt, bsort (MESS, $4));} - | '[' exps ']' { } - | '{' exps '}' { } - ; -exps : exp ';' { } - | exps exp ';' { } - ; -exp : IDENT '=' exp { if ((pcond==0) || (cond[pcond]>0.)) { - $1->VAL.f=$3; $1->TYPE=HT_FLOAT; - $1->FNAME=expfname; $1->FLINE=lineno; - $$=$3; pa($1,$$); - } - } - | NUMBER { $$ = $1; pe(" ",$$);} - | IDENT { test_init($1); $$ = $1->VAL.f; pi($1);} - | IDENT PP { test_init($1); $$ = $1->VAL.f; $1->VAL.f += 1.0;} - | IDENT MM { test_init($1); $$ = $1->VAL.f; $1->VAL.f -= 1.0;} - | exp '<' exp { $$ = ($1 < $3) ? 1. : -1.; pe(" < ",$$);} - | exp '>' exp { $$ = ($1 > $3) ? 1. : -1.; pe(" > ",$$);} - | exp '+' exp { $$ = $1 + $3; pe(" + ",$$);} - | exp '-' exp { $$ = $1 - $3; pe(" - ",$$);} - | exp '*' exp { $$ = $1 * $3; pe(" * ",$$);} - | exp '/' exp { $$ = $1 / $3; pe(" / ",$$);} - | '(' exp ')' { $$ = $2;} - | '-' exp { $$ = -$2; pe(" - ",$$);} - | IF '(' cond ',' args ')' { for (ele = $5; ele->NEXT; ele = ele->NEXT); - $$ = ele->VAL.f; - pcond--; eltremove ($5); - } - | SUP '(' exp ',' exp ')' { $$ = anint(($5+($3/2)-EPSILON)/$3)*$3; pe(" sup ",$$);} - | INF '(' exp ',' exp ')' { $$ = ((int)(floor(($5+EPSILON)/$3)))*$3; pe(" inf ",$$);} - | MAX '(' args ')' { $$ = limit (MAX, $3); pe(" max ",$$);} - | MIN '(' args ')' { $$ = limit (MIN, $3); pe(" min ",$$);} - | DEF '(' IDENT ')' { $$ = ($3->TYPE==0) ? -1. : +1.; pe($3,$$);} - | NDEF '(' IDENT ')' { $$ = ($3->TYPE==0) ? +1. : -1.; pe($3,$$);} - ; -cond : exp { if (pcond < PCONDMAX) - cond[++pcond] = $1; - else - yyerror ("too much conditions") - } - ; -idents : IDENT { $$ = eltadd (NULL,NULL); $$->VAL.e=$1;} - | IDENT ',' idents { $$ = eltadd ($3,NULL); $$->VAL.e=$1;} - | REGEX { $$ = $1->NEXT; $1->NEXT=NULL;} - | REGEX ',' idents { $$ = $1->NEXT; $1->NEXT=$3;} - ; -args : exp { $$ = eltadd (NULL,NULL); $$->VAL.f=$1; $$->TYPE=HT_FLOAT;pe(" , ",$1);} - | exp ',' args { $$ = eltadd ($3,NULL); $$->VAL.f=$1; $$->TYPE=HT_FLOAT;pe(" , ",$3);} - | REGEX { $$ = $1->NEXT; $1->NEXT=NULL; - for (ele = $$; ele; ele = ele->NEXT) - { - ele->VAL.e->USED = 1; - ele->TYPE = (ele->VAL.e)->TYPE; - ele->VAL.f = (ele->VAL.e)->VAL.f; - } - } - | REGEX ',' args { $$ = $1->NEXT; $1->NEXT=$3; - for (ele = $1; ele; ele = ele->NEXT) - { - ele->VAL.e->USED = 1; - ele->TYPE = (ele->VAL.e)->TYPE; - ele->VAL.f = ele->VAL.e->VAL.f; - } - } - ; -%% -int yyerror(char *s) -{ - printf(" %-3d %s : %s\n", lineno, expfname, s); - exit (1); -} diff --git a/alliance/src/exp/src/ht.c b/alliance/src/exp/src/ht.c deleted file mode 100644 index ff8b557d..00000000 --- a/alliance/src/exp/src/ht.c +++ /dev/null @@ -1,244 +0,0 @@ -#include -#include -#include -#include -#include "ht.h" - -/* gestion des entrees du dictionnaire -** ============================================================================= -*/ -static htelt_t *free_htelt = NULL; - -/* ajoute une entree (initialisé ŕ 0) en tete de liste -** --------------------------------------------------- -*/ -htelt_t *eltadd (htelt_t * list, char *key) -{ - htelt_t *new_elt; - if (free_htelt) - { - new_elt = free_htelt; - free_htelt = free_htelt->NEXT; - } - else if ((new_elt = malloc (sizeof (htelt_t))) == NULL) - { - perror ("add elt in dictionnary"); - exit (1); - } - if (key) - if ((new_elt->KEY = strdup (key)) == NULL) - { - perror ("add elt in dictionnary"); - exit (1); - } - new_elt->NEXT = list; - new_elt->TYPE = 0; - new_elt->USED = 0; - new_elt->VAL.f = 0.; - return new_elt; -} - -/* replace une entree dans la liste des entrees libres -** rend le pointeur NEXT de l'entree effacée -** --------------------------------------------------- -*/ -htelt_t *eltdel (htelt_t * list) -{ - htelt_t *del_elt = NULL; - if (list) - { - del_elt = list->NEXT; - list->NEXT = free_htelt; - free_htelt = list; - } - return del_elt; -} - -/* efface une liste d'elements -** --------------------------- -*/ -void eltremove (htelt_t * list) -{ - htelt_t *elt; - for (elt = list; elt; elt = eltdel (elt)); -} - -/* efface le dictionnaire complet -** ------------------------------ -*/ -void htremove (ht_t * ht) -{ - int i; - for (i = 1; i < (int) ht[0]; i++) - eltremove (ht[i]); - free (ht); -} - -/* statistiques -** ------------ -*/ -void htstat (ht_t * ht) -{ - int i; - htelt_t *elt; - if (ht) - { - static int start=1; - for (i = 1; i < (int) ht[0]; i++) - for (elt = ht[i]; elt; elt = elt->NEXT) - if (elt->USED == 0) - { - if (start) - { - start=0; - printf ("Warning : following variables declared but never used :\n"); - } - printf (" %-3d %-20s : %s\n", elt->FLINE, elt->FNAME, elt->KEY); - } - printf ("\n"); - free (ht); - } -} - -/* entrees sorties du dictionnaire -** ============================================================================= -*/ - -static int primes[] = { - 101, 223, 311, 419, 547, 659, 727, 877, 967, - 1061, 2053, 3299, 4391, 5309, 6421, 7069, 8543, 9397, - 10337, 20143, 32423, 43151, 52223, 63179, 0 -}; - -/* creation d'un dictionnaire -** -------------------------- -*/ -ht_t *htinit (int size) -{ - int i; - ht_t *ht; - - /* prend le premier nombre premier au dela de size */ - for (i = 0; primes[i] && (size > primes[i]); i++); - if (primes[i] == 0) - { - fprintf (stderr, "Erreur : hash table trop grande (> %d)\n", primes[i - 1]); - exit (1); - } - size = primes[i]; - if ((ht = calloc (size + 1, sizeof (htelt_t *))) == NULL) - { - perror ("htinit"); - exit (1); - } - ht[0] = (htelt_t *) size; /* taille de la table dans premiere case */ - return ht; -} - -/* calcul de la valeur de hachage primaire -** --------------------------------------- -*/ -static int hash (ht_t * ht, char *key) -{ - int alveole = 0; - int length = strlen (key); - int segment; - int l; - - if (ht == NULL) - { - fprintf (stderr, "dictionnary not allocated\n"); - exit (1); - } - if ((key == NULL) || (length == 0)) - { - fprintf (stderr, "Error : hash (NULL)\n"); - exit (1); - } - for (l = 0; l < length; l += 2) - { - segment = 0xFFFF & ((key[l] << 8) | key[l + 1]); - alveole = alveole ^ ((segment << 1) | (segment >> 15)); - } - alveole %= (int) ht[0]; /* ht[0] == la taille de la table */ - return (alveole + 1); /* +1 car on ne doit rien mettre dans case 0 */ -} - -/* recherche d'une entree dans la table -** rend un pointeur sur l'element -** htget()->KEY pointe sur la cle key -** htget()->VAL.i contient la valeur int -** htget()->VAL.f contient la valeur double -** htget()->VAL.s contient la valeur char * -** ---------------------------------------- -*/ -htelt_t *htget (ht_t * ht, char *key) -{ - int alveole = hash (ht, key); - htelt_t *p; - - for (p = ht[alveole]; p && strcmp (p->KEY, key); p = p->NEXT); - return p; -} - -/* ajout d'une nouvelle entree dans la table -** NE VERIFIE PAS SI L'ELEMENT N'EST PAS DEJA PRESENT -** -------------------------------------------------- -*/ -htelt_t *htadd (ht_t * ht, char *key) -{ - int alveole = hash (ht, key); - - return ht[alveole] = eltadd (ht[alveole], key); -} - -/* recherche d'une entree dans la table et ajout si absente -** -------------------------------------------------------- -*/ -htelt_t *htset (ht_t * ht, char *key) -{ - int alveole = hash (ht, key); - htelt_t *p; - - for (p = ht[alveole]; p && strcmp (p->KEY, key); p = p->NEXT); - if (p) - return p; - return ht[alveole] = eltadd (ht[alveole], key); -} - -/* recherche d'une regexp dans la table et ajout si absente -** rend un pointeur sur la liste CIRCULAIRE d'element trouves -** NULL sinon -** -------------------------------------------------------- -*/ -htelt_t *htsetre (ht_t * ht, char *key) -{ - regex_t preg; - htelt_t *elt, *res = NULL; - int i; - - if (regcomp(&preg, key, REG_EXTENDED | REG_NOSUB) != 0) - return NULL; - if (ht) - for (i = 1; i < (int) ht[0]; i++) - for (elt = ht[i]; elt; elt = elt->NEXT) - if (regexec (&preg, elt->KEY, (size_t) 0, NULL, 0) == 0) - { - if (res) - { - htelt_t * new = eltadd (res->NEXT, NULL); - new->VAL.e = elt; - res->NEXT = new ; - res = new; - } - else - { - res = eltadd (NULL, NULL); - res->NEXT = res; - res->VAL.e = elt; - } - } - regfree (&preg); - return res; -} - diff --git a/alliance/src/exp/src/ht.h b/alliance/src/exp/src/ht.h deleted file mode 100644 index be5d0cf1..00000000 --- a/alliance/src/exp/src/ht.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef _HT_H_ -#define _HT_H_ - -/* declaration de types : -** 1) union de types pour la valeur d'une entree dans le dicionnaire -** 2) type d'une entree -** 3) type du dictionnaire -** ----------------------------------------------------------------- -*/ -typedef union -{ - struct htelt_st *e; - double f; - int i; - char *s; -} -elt_t; - -typedef struct htelt_st -{ - struct htelt_st * NEXT; - char *KEY; - int TYPE; - int USED; - int FLINE; - char * FNAME; - elt_t VAL; -} -htelt_t; - -typedef htelt_t * ht_t; - -enum htelt_e {HT_EMPTY, HT_INT, HT_STRING, HT_FLOAT}; - - -/* ajoute une entree (initialisé ŕ 0) en tete de liste -** --------------------------------------------------- -*/ -extern htelt_t *eltadd (htelt_t * list, char *key); - -/* replace une entree dans la liste des entrees libres -** rend le pointeur NEXT de l'entree effacée -** --------------------------------------------------- -*/ -extern htelt_t *eltdel (htelt_t * list); - -/* efface une liste d'elements -** --------------------------- -*/ -extern void eltremove (htelt_t * list); - -/* donne des info sur l'usage du dico -** ---------------------------------- -*/ -extern void htremove (ht_t * ht); - -/* efface le dictionnaire complet -** ------------------------------ -*/ -extern void htremove (ht_t * ht); - -/* creation du dictionnaire -** ------------------------ -*/ -extern ht_t *htinit (int size); - -/* recherche d'une entree dans la table -** rend un pointeur sur l'element -** htget()->KEY pointe sur la cle key -** htget()->VAL.i contient la valeur int -** htget()->VAL.f contient la valeur double -** htget()->VAL.s contient la valeur char * -** ---------------------------------------- -*/ -extern htelt_t *htget (ht_t * ht, char *key); - -/* ajout d'une nouvelle entree dans la table -** NE VERIFIE PAS SI L'ELEMENT N'EST PAS DEJA PRESENT -** -------------------------------------------------- -*/ -extern htelt_t *htadd (ht_t * ht, char *key); - -/* recherche d'une entree dans la table et ajout si absente -** -------------------------------------------------------- -*/ -htelt_t *htset (ht_t * ht, char *key); - -/* recherche d'une regexp dans la table et ajout si absente -** rend un pointeur sur la liste CIRCULAIRE d'elements trouves -** NULL sinon -** -------------------------------------------------------- -*/ -htelt_t *htsetre (ht_t * ht, char *key); - -#endif diff --git a/alliance/src/exp/src/main.c b/alliance/src/exp/src/main.c deleted file mode 100644 index 5a5c9d6d..00000000 --- a/alliance/src/exp/src/main.c +++ /dev/null @@ -1,88 +0,0 @@ -#include -#include -#include -#include -#include "exp.h" -#include "ht.h" - -void usage (char *av[]) -{ - printf ("Usage : %s [-h] [-v level] [-o outfile] [infile]\n\n", av[0]); - printf (" -h this help\n"); - printf (" -v verbose mode (level is 1:2:3:4)\n"); - printf (" -o define the output file (stdout by default)\n"); - printf (" infile define the input file (stdin by default)\n"); - printf ("\n"); - exit (1); -} - -void getoption (int ac, char *av[], FILE ** expout, FILE ** expin) -{ - char option; - int verbose; - *expin = stdin; - *expout = stdout; - yydebug = 0; - - dico=htinit(10000); - htset(dico,"verbose")->VAL.f = -1.0; - htget(dico,"verbose")->TYPE = HT_INT; - htget(dico,"verbose")->USED = 1; - - while ((option = getopt (ac, av, "hv:o:")) != EOF) - { - switch (option) - { - case 'v': - verbose = *optarg - '0'; - if ((verbose < 0)||(verbose > 9)) - usage (av); - yydebug = (verbose == 4) ? 1 : 0; - htset(dico,"verbose")->VAL.f = verbose; - break; - case 'o': - if ((*expout = fopen (optarg, "w")) == NULL) - usage (av); - break; - default: - usage (av); - } - } - if (optind < ac) - { - if ((*expin = fopen (av[optind], "r")) == NULL) - usage (av); - expfname = strdup (av[optind++]); - } - if (optind < ac) - usage (av); -} - -int main (int ac, char *av[]) -{ - getoption (ac, av, &yyout, &yyin); - if (htget(dico,"verbose")->VAL.f != 0) - { - puts(" "); - puts(" @@@@@ @@@@ @@@ @@@ @@@"); - puts(" @ @ @@ @ @@@ @@"); - puts(" @@ @@ @@ @ @@ @@"); - puts(" @@@@@@@@@ @@@ @@ @@"); - puts(" @@ @@@ @@ @@"); - puts(" @@ @ @ @@ @@ @@"); - puts(" @@ @@ @ @@ @@@ @@"); - puts(" @@@@ @@@ @@@@ @@ @@@"); - puts(" @@"); - puts(" @@@@"); - puts(" "); - puts(" multiple expressions calculator"); - puts(" "); - printf(" Alliance CAD System %-4s exp %-3s\n", - ALLIANCE_VERSION, VERSION); - puts(" Copyright (c) 2002, ASIM/LIP6/UPMC"); - puts(" E-mail support: alliance-support@asim.lip6.fr"); - puts(" "); - } - yyparse (); - return 0; -} diff --git a/alliance/src/genpat/Makefile.am b/alliance/src/genpat/Makefile.am deleted file mode 100644 index 39207806..00000000 --- a/alliance/src/genpat/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = src doc diff --git a/alliance/src/genpat/configure.in b/alliance/src/genpat/configure.in deleted file mode 100644 index ec3974ca..00000000 --- a/alliance/src/genpat/configure.in +++ /dev/null @@ -1,46 +0,0 @@ -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 -AC_INIT(src/genpat.sh) -AM_INIT_AUTOMAKE(genpat, 3.3) -AC_PROG_CC -AC_PROG_RANLIB -AC_CHECK_PROG(SED, sed, sed) -AM_PROG_LEX -AC_PROG_YACC -AC_PROG_MAKE_SET - -changequote(,)dnl -if test -z $SED ; then - echo "Cannot find sed here! Quiting, ..." - exit 1 -fi -changequote([,])dnl - -AM_ALLIANCE - -AC_OUTPUT([ -Makefile -src/Makefile -doc/Makefile -]) diff --git a/alliance/src/genpat/doc/Makefile.am b/alliance/src/genpat/doc/Makefile.am deleted file mode 100644 index 697da470..00000000 --- a/alliance/src/genpat/doc/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -## Process this file with automake to produce Makefile.in - -man_MANS = genpat.1 -EXTRA_DIST = $(man_MANS) diff --git a/alliance/src/genpat/src/AFFECT.c b/alliance/src/genpat/src/AFFECT.c deleted file mode 100644 index 1cfa9bc7..00000000 --- a/alliance/src/genpat/src/AFFECT.c +++ /dev/null @@ -1,192 +0,0 @@ -/* - * 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. - */ - -/***************************************************************/ -/* module : affect.c */ -/* date : 28/07/92 */ -/* auteurs : RENAUD & VENOT & PITON */ -/***************************************************************/ - -#ident "$Id: AFFECT.c,v 1.1 2002/05/30 13:28:15 xtof Exp $" - -#include -#include -#include -#include - - -#include "mut.h" -#include "pat.h" -#include "phl.h" -#include "libpat_l.h" - - -/* ###--------------------------------------------------------------### */ -/* function : AFFECT */ -/* description : set GNP_TAB_PAIOL_CREE to GNP_ACTIF if not done yet */ -/* create a PAEVT list according to value and connector */ -/* Create or set the good PAPAT structure */ -/* called func. : CheckPattern, pat_crtpaiol, Erreur, MajPatternCourant */ -/* SplitIdent, CheckIdent, TraiterChaine, CheckWidth, FindIdent */ -/* FormatValue, ExisteIdent, CreatePaevt, CreatePapat */ -/* ###--------------------------------------------------------------### */ - -void d_AFFECT (pat_numb,ident,val) -char *pat_numb; -char *ident; -char *val; -{ -char *valeur; -char field_ident [64]; -char buffer [80]; -char tmp_valeur [1024]; -char value [1024]; -int dim = 0,num_ident,sens,i,j; -struct alpha_num decomp; -struct paevt *tmp_paevt = NULL; - - /* namealloc must be performed after mbkenv() - Czo - */ - if (!CATA_LIB || !WORK_LIB) - mbkenv(); - - if (racine_paseq == NULL) - Erreur ("AFFECT must declare output file's name first\n"); - - - if ( GNP_TAB_PAIOL_CREE == GNP_INACTIF) - { - racine_paiol = (struct paiol *) reverse ((struct chain *)racine_paiol); - racine_paiol = pat_crtpaiol(racine_paiol); - GNP_TAB_PAIOL_CREE = GNP_ACTIF; - } - - if ( pat_numb == NULL) - Erreur ("AFFECT unvalid parameter"); - strcpy(buffer,pat_numb); - CheckPattern (buffer); - MajPatternCourant(buffer); - - if ( ident == NULL) - Erreur ("AFFECT unvalid parameter"); - strcpy (buffer,ident); - SplitIdent (buffer,field_ident); - CheckIdent (buffer); - if (strlen (field_ident) != 0) - { - TraiterChaine (field_ident,&decomp ); - CheckWidth (&decomp); - if (strlen (decomp.alpha) != 0) - Erreur ("AFFECT expected a group name or paiol name\n"); - if (strlen (decomp.gauche) != 0) - { - strcat(buffer," "); - strcat(buffer,decomp.gauche); - } - } - - if ( val == NULL) - Erreur ("AFFECT unvalid parameter"); - strcpy(tmp_valeur,val); - - num_ident = FindIdent (buffer,hash_paiol); - if ( num_ident != -1) - { - switch ( - ((struct paiol *)tab_ident[num_ident].pointeur)->MODE) - { - case 'R': case 'S': case 'O': - { - valeur = tmp_valeur; - if (tmp_valeur[0] == '?') - valeur++; - FormatValue (value,valeur,1,GNP_UP,1); - break; - } - case 'T': - { - valeur = tmp_valeur; - if (tmp_valeur[0] == '?') - { - valeur++; - FormatValue (value,valeur,1,GNP_UP,1); - } - else - FormatValue (value,tmp_valeur,1,GNP_UP,0); - break; - } - case 'I': - { - FormatValue (value,tmp_valeur,1,GNP_UP,0); - break; - } - default: - Erreur ("unconsistent internal structures\n"); - } - tmp_paevt = CreatePaevt (tmp_paevt,num_ident,value[0]); - } - else - { - num_ident = FindIdent (buffer,hash_pagrp); - if ( num_ident == -1) - Erreur ("AFFECT not yet declared identifier\n"); - else - { - sens = ExisteIdent(buffer,hash_pagrp)-> sens; - dim = ((struct pagrp *)tab_ident[num_ident].pointeur)->LENGTH; - switch ( - ((struct paiol *)tab_ident[num_ident -1].pointeur)->MODE) - { - case 'R': case 'S': case 'O': - { - valeur = tmp_valeur; - if (tmp_valeur[0] == '?') - valeur++; - FormatValue (value,valeur,dim,sens,1); - break; - } - case 'T': - { - valeur = tmp_valeur; - if (tmp_valeur[0] == '?') - { - valeur++; - FormatValue (value,valeur,dim,sens,1); - } - else - FormatValue (value,tmp_valeur,dim,sens,0); - break; - } - case 'I': - { - FormatValue (value,tmp_valeur,dim,sens,0); - break; - } - default: - Erreur ("unconsistent internal structures\n"); - } - for (j =0, i = dim; i > 0; i--, j++ ) - tmp_paevt = CreatePaevt (tmp_paevt,num_ident -i,value[j]); - } - } - CreatePapat (NULL,tmp_paevt,NULL); -} diff --git a/alliance/src/genpat/src/ARRAY.c b/alliance/src/genpat/src/ARRAY.c deleted file mode 100644 index 545e0c65..00000000 --- a/alliance/src/genpat/src/ARRAY.c +++ /dev/null @@ -1,197 +0,0 @@ -/* - * 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. - */ - -/***************************************************************/ -/* module : array.c */ -/* date : 28/07/92 */ -/* auteurs : RENAUD & VENOT & PITON */ -/***************************************************************/ - -#ident "$Id: ARRAY.c,v 1.1 2002/05/30 13:28:15 xtof Exp $" - -#include -#include -#include -#include -#include - -#include "mut.h" -#include "pat.h" -#include "libpat_l.h" - - -/* ###--------------------------------------------------------------### */ -/* function : ARRAY */ -/* description : Create a PAGRP structure and the referenced PAIOL */ -/* called func. : Erreur, SplitIdent, KillEsp, CheckIdent, TraiterChaine*/ -/* CheckWidth, FindIdent, EmpileParam, CheckSeparate, */ -/* CheckFormat, CheckType, DefileParam, DupPaiol, CreatePagrp */ -/* ###--------------------------------------------------------------### */ - - -void d_ARRAY (va_alist) -va_dcl -{ -va_list pa; -char *param; -char buffer [80]; -char buffer_anx [64]; -char name [64]; -char buffer_name [80]; -char blk; -char base; -char i_o; -char flg; -short dim; -int tmp_ind_paiol; -struct alpha_num decomp; - - - /* namealloc must be performed after mbkenv() - Czo - */ - if (!CATA_LIB || !WORK_LIB) - mbkenv(); - - if (racine_paseq == NULL) - Erreur ("ARRAY must declare output file's name first\n"); - - if (GNP_TAB_PAIOL_CREE == GNP_ACTIF) - Erreur ("ARRAY already in descriptive part\n"); - - va_start(pa); - - param = va_arg(pa, char *); - if (param == NULL) - Erreur ("ARRAY needs any parameters\n"); - strcpy (buffer,param); - KillEsp (buffer); - - if (*buffer == ':') - Erreur ("ARRAY must have an element at least\n"); - - sp_pile_param = 0; - while ( *buffer != ':') - { - strcpy (buffer,param); - SplitIdent (buffer,buffer_anx); - CheckIdent (buffer); - - if (strlen (buffer_anx) != 0) - { - TraiterChaine (buffer_anx, &decomp); - CheckWidth (&decomp); - if (strlen(decomp.alpha) ==0) - sprintf(buffer,"%s %s",buffer,decomp.gauche); - else - Erreur ("ARRAY must separate each element of a vector\n"); - } - else - if ( FindIdent (buffer,hash_pagrp) != -1) - Erreur ("ARRAY yet declared identifier as a pagrp\n"); - EmpileParam(param); - - - param = va_arg(pa, char *); - if (param == NULL) - Erreur ("ARRAY needs more parameters\n"); - strcpy (buffer,param); - KillEsp (buffer); - } - - blk = CheckSeparate(buffer); - - dim = sp_pile_param; - - param = va_arg(pa, char *); - if (param == NULL) - Erreur ("ARRAY needs more parameters\n"); - strcpy (buffer,param); - base = CheckFormat (buffer); - - param = va_arg(pa, char *); - if (param == NULL) - Erreur ("ARRAY needs more parameters\n"); - strcpy (buffer,param); - i_o = CheckType (buffer); - - param = va_arg(pa, char *); - if (param == NULL) - Erreur ("ARRAY needs more parameters\n"); - strcpy (buffer,param); - flg = CheckOption (buffer); - - param = va_arg(pa, char *); - if (param == NULL) - Erreur ("ARRAY needs group name\n"); - strcpy (name,param); - if ( FindIdent (name,hash_paiol) != -1) - Erreur ("ARRAY duplicate declared identifier\n"); - if ( FindIdent (name,hash_pagrp) != -1) - Erreur ("ARRAY yet declared identifier as a pagrp\n"); - - param = va_arg(pa, char *); - if (param != NULL) - Erreur ("ARRAY NULL parameter expected\n"); - - va_end (pa); - - sp_file_param = 0; - -/* test si les parametres sont de meme mode 'O', 'R', 'S' ou non declares */ - while (sp_file_param < sp_pile_param) - { - param = DefileParam(); - strcpy (buffer,param); - SplitIdent (buffer,buffer_anx); - if (strlen (buffer_anx) != 0) - { - sprintf (buffer, "%s %s", buffer, buffer_anx); - } - - sprintf (buffer_name, "%s %d", name, GNP_PARAM_COURANT); - - switch (i_o) - { - case 'I': case 'T' : - { - if ( FindIdent (buffer,hash_paiol) != -1) - Erreur ("ARRAY duplicate declared identifier\n"); - DupPaiol (-1,base,buffer,buffer_name,i_o,blk,flg); - break; - } - case 'O': case 'R': case 'S' : - { - tmp_ind_paiol = FindIdent (buffer,hash_paiol); - if ( tmp_ind_paiol == -1) - DupPaiol (-1,base,buffer,buffer_name,i_o,blk,flg); - else - { - if (((struct paiol*)tab_ident[tmp_ind_paiol].pointeur)->MODE != i_o) - Erreur ("ARRAY /port mode not matched\n"); - DupPaiol (tmp_ind_paiol,base,buffer,buffer_name,i_o,blk,flg); - break; - } - } - } - } - CreatePagrp (name,dim,-1,GNP_VECTEUR_VIRTUEL); -} diff --git a/alliance/src/genpat/src/CONV.c b/alliance/src/genpat/src/CONV.c deleted file mode 100644 index a48af547..00000000 --- a/alliance/src/genpat/src/CONV.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -/****************************************************************/ -/* module : conv.c */ -/* date : 02/09/93 */ -/* auteurs : RENAUD & VENOT */ -/****************************************************************/ - -#ident "$Id: CONV.c,v 1.1 2002/05/30 13:28:15 xtof Exp $" - -#include -#include "pat.h" -#include "mut.h" -#include "libpat_l.h" - -/* ###--------------------------------------------------------------### */ -/* function : CONV */ -/* description : convert an integer into a uns. decimal type string */ -/* called func. : none */ -/* ###--------------------------------------------------------------### */ - -char *d_CONV(entier) -int entier; -{ -char *str; - - str = (char *) mbkalloc (32 * sizeof (char)); - sprintf (str, "%d", entier); - - return (str); -} diff --git a/alliance/src/genpat/src/DECLAR.c b/alliance/src/genpat/src/DECLAR.c deleted file mode 100644 index c0f83841..00000000 --- a/alliance/src/genpat/src/DECLAR.c +++ /dev/null @@ -1,176 +0,0 @@ -/* - * 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. - */ - -/************************************************************************/ -/* module : declar.c */ -/* date : 02/09/93 */ -/* auteurs : RENAUD & VENOT & PITON */ -/************************************************************************/ - -#ident "$Id: DECLAR.c,v 1.1 2002/05/30 13:28:15 xtof Exp $" - -#include -#include -#include -#include - -#include "mut.h" -#include "pat.h" -#include "libpat_l.h" - -/* ###--------------------------------------------------------------### */ -/* function : DECLAR */ -/* description : create PAIOL or PAGRP structs according to parameter */ -/* called func. : Erreur, CreatePaiol, CreatePagrp, KillEsp, atoi */ -/* DefileParam, CheckIdent, TraiterChaine, CheckWidth, FindIdent */ -/* EmpileParam, CheckSeparate, CheckFormat */ -/* ###--------------------------------------------------------------### */ - - -void d_DECLAR (ident,space,format,mode,size,option) -char *ident; -char *space; -char *format; -char *mode; -char *size; -char *option; -{ -char buffer [80]; -char name [80]; -char blk,base,i_o,flg; -short dim=0; -int i = 0; -int borne_g = -1; -int borne_d = -1; -int sens = 0; -struct alpha_num decomp; - - /* namealloc must be performed after mbkenv() - Czo - */ - if (!CATA_LIB || !WORK_LIB) - mbkenv(); - - if (racine_paseq == NULL) - Erreur ("DECLAR must declare output file's name first\n"); - - if (GNP_TAB_PAIOL_CREE == GNP_ACTIF) - Erreur ("DECLAR already in descriptive part\n"); - - if (space == NULL) - Erreur ("DECLAR unvalid parameter\n"); - strcpy (buffer,space); - KillEsp (buffer); - blk = CheckSeparate(buffer); - - if (format == NULL) - Erreur ("DECLAR unvalid parameter\n"); - strcpy (buffer,format); - base = CheckFormat (buffer); - - if (mode == NULL) - Erreur ("DECLAR unvalid parameter\n"); - strcpy (buffer,mode); - i_o = CheckType (buffer); - - if (option == NULL) - Erreur ("DECLAR unvalid parameter\n"); - strcpy (buffer,option); - flg = CheckOption (buffer); - - if (ident == NULL) - Erreur ("DECLAR unvalid parameter\n"); - strcpy (name,ident); - KillEsp (name); - CheckIdent (name); - - if ( FindIdent (name,hash_paiol) != -1) - Erreur ("DECLAR duplicate declared identifier\n"); - if ( FindIdent (name,hash_pagrp) != -1) - Erreur ("DECLAR yet declared identifier as a pagrp\n"); - - if (size == NULL) - Erreur ("DECLAR unvalid parameter\n"); - strcpy (buffer,size); - TraiterChaine(buffer,&decomp); - CheckWidth (&decomp); - if (strlen (decomp.gauche) == 0) - dim = 0; - else - { - if (strlen(decomp.alpha) ==0) - dim = 1; - else - { - borne_g = atoi (decomp.gauche); - borne_d = atoi (decomp.droite); - if ( borne_g > borne_d ) - { - borne_d--; - sens = -1; - dim = borne_g - borne_d; - } - else - { - borne_d++; - sens = 1; - dim = borne_d - borne_g; - } - } - } - switch (dim) - { - case 0: - { - if ( base != 'B' ) - Erreur ("DECLAR illegal format for one bit identifier\n"); - CreatePaiol (base,name,i_o,blk,flg); - break; - } - case 1: - { - char x[80]; - sprintf(x," %s",decomp.gauche); - strcat(name,x); - if ( FindIdent (name,hash_paiol) != -1) - Erreur ("DECLAR duplicate declared identifier\n"); - if ( base != 'B' ) - Erreur ("DECLAR illegal format for one bit identifier\n"); - CreatePaiol (base,name,i_o,blk,flg); - break; - } - default: - { - for (i = borne_g; i != borne_d; i = i + sens) - { - char x[80]; - sprintf (x," %d", i); - strcpy(buffer,name); - strcat(buffer,x); - if ( FindIdent (buffer,hash_paiol) != -1) - Erreur ("DECLAR duplicate declared identifier\n"); - CreatePaiol (base,buffer,i_o,blk,flg); - } - } - } - if (dim > 1) - CreatePagrp (name,dim,sens,GNP_VECTEUR_EFFECTIF); -} diff --git a/alliance/src/genpat/src/DEF_GEN.c b/alliance/src/genpat/src/DEF_GEN.c deleted file mode 100644 index 3f907909..00000000 --- a/alliance/src/genpat/src/DEF_GEN.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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. - */ - -/************************************************************************/ -/* module : def_gen.c */ -/* date : 02/09/93 */ -/* auteurs : RENAUD & VENOT & PITON */ -/************************************************************************/ - -#ident "$Id: DEF_GEN.c,v 1.1 2002/05/30 13:28:15 xtof Exp $" - -#include -#include -#include -#include - -#include "mut.h" -#include "pat.h" -#include "libpat_l.h" - -/* ###--------------------------------------------------------------### */ -/* function : DEF_GENPAT */ -/* description : create PASEQ struct and initialization */ -/* called func. : pat_addpaseq, CreateLabel */ -/* ###--------------------------------------------------------------### */ - - -void d_DEF_GENPAT(chaine) -char *chaine; - { - - /* namealloc must be performed after mbkenv() - Czo - */ - if (!CATA_LIB || !WORK_LIB) - mbkenv(); - - racine_paseq = pat_addpaseq (racine_paseq); - racine_paseq->NAME = namealloc (chaine); - racine_paseq->FLAGS |= PAT_SEQ__IOLARRAY; /* Czo */ - - GNP_PATTERN_COURANT = 0; - GNP_PAIOL_INDEX = 0; - IOLNUMBER = 0; - - InitHash (hash_paiol); - InitHash (hash_pagrp); - } diff --git a/alliance/src/genpat/src/GETCPAT.c b/alliance/src/genpat/src/GETCPAT.c deleted file mode 100644 index 279267e2..00000000 --- a/alliance/src/genpat/src/GETCPAT.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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. - */ - -/************************************************************************/ -/* module : getcpat.c */ -/* date : 02/09/93 */ -/* auteurs : PITON */ -/************************************************************************/ - -#ident "$Id: GETCPAT.c,v 1.1 2002/05/30 13:28:15 xtof Exp $" - -#include -#include "mut.h" -#include "pat.h" -#include "libpat_l.h" - -/* ###--------------------------------------------------------------### */ -/* function : GETCPAT */ -/* description : return current pattern date */ -/* called func. : none */ -/* ###--------------------------------------------------------------### */ - - -unsigned long d_GETCPAT () -{ - - return (GNP_PATTERN_COURANT); - -} diff --git a/alliance/src/genpat/src/INIT.c b/alliance/src/genpat/src/INIT.c deleted file mode 100644 index e56f20d3..00000000 --- a/alliance/src/genpat/src/INIT.c +++ /dev/null @@ -1,161 +0,0 @@ -/* - * 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. - */ - -/************************************************************************/ -/* module : init.c */ -/* date : 07/09/93 */ -/* auteurs : RENAUD & VENOT & PITON */ -/************************************************************************/ - -#ident "$Id: INIT.c,v 1.1 2002/05/30 13:28:15 xtof Exp $" - -#include -#include -#include -#include - -#include "mut.h" -#include "pat.h" -#include "libpat_l.h" - -/* ###--------------------------------------------------------------### */ -/* function : INIT */ -/* description : add a PAINI list to the good PAPAT structure if it */ -/* does exist, else create PAPAT on the way */ -/* called func. : FormatValue, CheckPattern, MajPatternCourant, */ -/* SplitIdent,CheckIdent, checkWidth, atoi, pat_addpaini, */ -/* CreatePapat, CreateAction */ -/* ###--------------------------------------------------------------### */ - - -void d_INIT (pat_numb, ident, val) - -char *pat_numb; -char *ident; -char *val; - - { - char buffer [ 80]; - char buffer_anx [ 80]; - char tmp_valeur [1024]; - char value [1024]; - int dim, borne_g = -1, borne_d = -1, sens = 0, i, j; - struct alpha_num decomp; - struct paini *tmp_paini = NULL; - - /* namealloc must be performed after mbkenv() - Czo - */ - if (!CATA_LIB || !WORK_LIB) - mbkenv(); - - if (racine_paseq == NULL) - Erreur ("INIT must declare output file name first\n"); - - if (GNP_TAB_PAIOL_CREE == GNP_INACTIF) - { - racine_paiol = (struct paiol *) reverse ((struct chain *)racine_paiol); - racine_paiol = pat_crtpaiol (racine_paiol); - GNP_TAB_PAIOL_CREE = GNP_ACTIF; - } - - if (pat_numb == NULL) - Erreur ("INIT unvalid parameter"); - - strcpy (buffer, pat_numb); - CheckPattern (buffer); - MajPatternCourant (buffer); - - - if (ident == NULL) - Erreur ("INIT unvalid parameter"); - - strcpy (buffer, ident); - SplitIdent (buffer, buffer_anx); - CheckIdent (buffer); - - if (strlen (buffer_anx) == 0) - dim = 0; - else - { - TraiterChaine (buffer_anx, &decomp); - CheckWidth (&decomp); - if (strlen (decomp.gauche) == 0) - dim = 0; - else - { - if (strlen (decomp.alpha) == 0) - dim = 1; - else - { - borne_g = atoi (decomp.gauche); - borne_d = atoi (decomp.droite); - if (borne_g > borne_d) - { - borne_d--; - sens = -1; - dim = borne_g - borne_d; - } - else - { - borne_d++; - sens = 1; - dim = borne_d - borne_g; - } - } - } - } - - if (val == NULL) - Erreur ("INIT unvalid parameter"); - strcpy (tmp_valeur, val); - - switch (dim) - { - case 0: - { - FormatValue (value,tmp_valeur,1,GNP_UP,0); - tmp_paini = pat_addpaini (tmp_paini, buffer, *value); - break; - } - case 1: - { - strcat (buffer," "); - strcat (buffer,decomp.gauche); - FormatValue (value,tmp_valeur,1,GNP_UP,0); - tmp_paini = pat_addpaini (tmp_paini, buffer, *value); - break; - } - default: - { - FormatValue (value,tmp_valeur,dim,sens,0); - for (i=borne_g, j=0; i != borne_d; i = i + sens, j++) - { - sprintf (buffer_anx, "%s %d", buffer, i); - tmp_paini = pat_addpaini (tmp_paini, buffer_anx, value[j]); - } - tmp_paini = (struct paini *) reverse ((struct chain *)tmp_paini); - } - } - - CreatePapat (NULL, NULL, tmp_paini); - CreateAction ("I"); - } diff --git a/alliance/src/genpat/src/LABEL.c b/alliance/src/genpat/src/LABEL.c deleted file mode 100644 index dae86dbc..00000000 --- a/alliance/src/genpat/src/LABEL.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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. - */ - -/****************************************************************/ -/* module : label.c */ -/* date : 02/09/93 */ -/* auteurs : PITON */ -/****************************************************************/ - -#ident "$Id: LABEL.c,v 1.1 2002/05/30 13:28:15 xtof Exp $" - -#include -#include -#include - -#include "mut.h" -#include "pat.h" -#include "libpat_l.h" - -/* ###--------------------------------------------------------------### */ -/* function : LABEL */ -/* description : set current pattern label */ -/* called func. : none */ -/* ###--------------------------------------------------------------### */ - -void d_LABEL(ident) -char *ident; -{ -char buffer[20]; -int i = 1; - - /* namealloc must be performed after mbkenv() - Czo - */ - if (!CATA_LIB || !WORK_LIB) - mbkenv(); - - if (ident == NULL) - Erreur ("LABEL missing argument"); - strncpy(buffer,ident,19); - KillEsp(buffer); - - if( isalpha(buffer[0]) == 0 ) - Erreur ("IDENT error not an identifier"); - - while (buffer[i] != '\0') - { - if( (isalpha(buffer[i])==0) && (isalnum(buffer[i])==0) && (buffer[i] != '_')) - Erreur ("IDENT error not an identifier"); - i++; - } - CreatePapat (buffer, NULL,NULL); -} diff --git a/alliance/src/genpat/src/Makefile b/alliance/src/genpat/src/Makefile deleted file mode 100644 index 2c6cea1f..00000000 --- a/alliance/src/genpat/src/Makefile +++ /dev/null @@ -1,68 +0,0 @@ -# -# 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. -# - -include $(ALLIANCE_TOP)/etc/$(ALLIANCE_OS).mk -include $(ALLIANCE_TOP)/etc/libraries.mk - -LOCAL_TRGBIN = $(TARGET_BIN) -LOCAL_TRGLIB = $(TARGET_LIB) -LOCAL_TRGINC = $(TARGET_INCLUDE) - -LOCAL_INC = $(ALLIANCE_INCLUDE) - - -LOCAL_CFLAGS = $(CFLAGS) -Wall -I$(LOCAL_INC) -I$(ALLIANCE_INCLUDE) \ - -DPPT_H='"$(PPT_H)"' \ - -DPHL_H='"$(PHL_H)"' \ - -DPAT_H='"$(PAT_H)"' \ - -DMUT_H='"$(MUT_H)"' - -LOCAL_OBJECTS = ARRAY.o DECLAR.o DEF_GEN.o SAV_GEN.o INIT.o AFFECT.o \ - SAVE.o CONV.o libpat_l.o GETCPAT.o LABEL.o SETTUNIT.o - - -LOCAL_LIBLIST = -lPgn103 $(PPT_L) $(PAT_L) $(PHL_L) $(MUT_L) - - - -.c.o: - $(CC) -c $< $(LOCAL_CFLAGS) - -all $(LOCAL_TRGBIN)/genpat : $(LOCAL_TRGLIB)/libPgn103.a - $(CP) genpat $(LOCAL_TRGBIN)/genpat - $(CP) genpat.h $(LOCAL_TRGINC)/genpat.h - cd tests ; $(MAKE) - -$(LOCAL_TRGLIB)/libPgn103.a : $(LOCAL_OBJECTS) - $(AR) $(ARFLAGS) $(LOCAL_TRGLIB)/libPgn103.a $(LOCAL_OBJECTS) - $(RANLIB) $(LOCAL_TRGLIB)/libPgn103.a - - -clean : - -$(RM) -f $(LOCAL_OBJECTS) - -$(RM) -f *.bak .*.bak *~ .*~ core - -distclean realclean : clean - -$(RM) -f $(LOCAL_TRGBIN)/genpat $(LOCAL_TRGLIB)/libPgn103.a $(LOCAL_TRGINC)/genpat.h - - diff --git a/alliance/src/genpat/src/Makefile.am b/alliance/src/genpat/src/Makefile.am deleted file mode 100644 index 468136d1..00000000 --- a/alliance/src/genpat/src/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -AM_CFLAGS = @ALLIANCE_CFLAGS@ -lib_LIBRARIES = libPgn.a -include_HEADERS = genpat.h -libPgn_a_SOURCES = AFFECT.c ARRAY.c CONV.c DECLAR.c DEF_GEN.c GETCPAT.c \ - INIT.c LABEL.c SAVE.c SAV_GEN.c SETTUNIT.c \ - genpat.1 libpat_l.c libpat_l.h - -bin_SCRIPTS = genpat -CLEANFILES = genpat - -genpat : ${srcdir}/genpat.sh - ${SED} 's,__ALLIANCE_INSTALL_DIR__,$(ALLIANCE_INSTALL_DIR),' $< > $@ - chmod a+x $@ - -EXTRA_DIST = genpat.sh diff --git a/alliance/src/genpat/src/SAVE.c b/alliance/src/genpat/src/SAVE.c deleted file mode 100644 index b93634b4..00000000 --- a/alliance/src/genpat/src/SAVE.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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. - */ - -/************************************************************************/ -/* module : save.c */ -/* date : 02/09/93 */ -/* auteurs : RENAUD & VENOT & PITON */ -/************************************************************************/ - -#ident "$Id: SAVE.c,v 1.1 2002/05/30 13:28:15 xtof Exp $" - - -#include -#include "pat.h" -#include "libpat_l.h" - -/* ###--------------------------------------------------------------### */ -/* function : SAVE */ -/* description : modify Flag in PASEQ Structure */ -/* called func. : Erreur */ -/* ###--------------------------------------------------------------### */ - - -void SAVE () -{ - if (racine_paseq == NULL) - Erreur ("SAVE must declare output file's name first\n"); - racine_paseq->SAVFLG = 'Y'; -} diff --git a/alliance/src/genpat/src/SAV_GEN.c b/alliance/src/genpat/src/SAV_GEN.c deleted file mode 100644 index 1b1f7513..00000000 --- a/alliance/src/genpat/src/SAV_GEN.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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. - */ - -/***************************************************************/ -/* module : fnct_genpat */ -/* date : 28/03/92 */ -/* auteurs : RENAUD & VENOT & PITON */ -/***************************************************************/ - -#ident "$Id: SAV_GEN.c,v 1.1 2002/05/30 13:28:15 xtof Exp $" - -#include - -#include "mut.h" -#include "pat.h" -#include "phl.h" -#include "ppt.h" - -#include "libpat_l.h" - -/*--------------------------------------------------------------*/ -void d_SAV_GENPAT() - - { - struct paiol *tmp_paiol; - struct paevt *tmp_paevt; - int i = 0; - - /* namealloc must be performed after mbkenv() - Czo - */ - if (!CATA_LIB || !WORK_LIB) - mbkenv(); - - if (racine_pagrp != NULL) - racine_pagrp = (struct pagrp*) reverse ((void *)racine_pagrp); - - if (racine_papat == NULL) - Erreur("not all inputs initialized \n"); - else - racine_papat = (struct papat*) reverse ((void *)racine_papat); - - if ( racine_papat->PAEVT == NULL ) - Erreur("not all inputs initialized \n"); - - tmp_paiol = racine_paiol; - while (tmp_paiol != NULL) - { - if (tmp_paiol->MODE == 'I') - { - tmp_paevt = racine_papat->PAEVT; - while (tmp_paevt != NULL) - { - if (tmp_paevt->INDEX == i) - break; - tmp_paevt = tmp_paevt->NEXT; - } - - if (tmp_paevt == NULL) - Erreur ("not all inputs initialized at pattern zero \n"); - } - i++; - tmp_paiol = tmp_paiol->NEXT; - } - - racine_paseq->SUBSEQ = 1; - racine_paseq->ENDFLG = 'Y'; - racine_paseq->ERRFLG = 0; - -/*-------- -pat_debug (racine_paseq,"paseq"); ----------*/ - - pat_savpaseq (racine_paseq->NAME, racine_paseq, MAX_LABEL); - - if (racine_pagrp != NULL) - racine_pagrp = (struct pagrp*) reverse ((void *)racine_pagrp); - - } diff --git a/alliance/src/genpat/src/SETTUNIT.c b/alliance/src/genpat/src/SETTUNIT.c deleted file mode 100644 index e8addae3..00000000 --- a/alliance/src/genpat/src/SETTUNIT.c +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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. - */ - -/****************************************************************/ -/* module : settunit.c */ -/* date : 02/09/93 */ -/* auteurs : PITON */ -/****************************************************************/ - -#ident "$Id: SETTUNIT.c,v 1.1 2002/05/30 13:28:15 xtof Exp $" - -#include -#include -#include - -#include "mut.h" -#include "pat.h" -#include "libpat_l.h" - -/* ###--------------------------------------------------------------### */ -/* function : SETTUNIT */ -/* description : set pat time unit */ -/* called func. : none */ -/* ###--------------------------------------------------------------### */ - -/* Czo : 2000/09/04 */ -void d_SETTUNIT(ident) -char *ident; -{ - - /* namealloc must be performed after mbkenv() - Czo - */ - if (!CATA_LIB || !WORK_LIB) - mbkenv(); - - if (ident == NULL) - Erreur ("SETTUNIT missing argument"); - - if ((strlen (ident) == 0) || (namealloc(ident) == namealloc("vu"))) - { - PAT_TIMEUNIT = PAT_TU__VU ; - PAT_CNV_FS = 0.0 ; - PAT_CNV_PS = 0.0 ; - PAT_CNV_NS = 0.0 ; - PAT_CNV_US = 0.0 ; - PAT_CNV_MS = 0.0 ; - } - else if (namealloc(ident) == namealloc("fs")) - { - PAT_TIMEUNIT = PAT_TU__FS ; - PAT_CNV_FS = 1.0 ; - PAT_CNV_PS = 1.0E3 ; - PAT_CNV_NS = 1.0E6 ; - PAT_CNV_US = 1.0E9 ; - PAT_CNV_MS = 1.0E12 ; - } - else if (namealloc(ident) == namealloc("ps")) - { - PAT_TIMEUNIT = PAT_TU__PS ; - PAT_CNV_FS = 1.0E-3 ; - PAT_CNV_PS = 1.0 ; - PAT_CNV_NS = 1.0E3 ; - PAT_CNV_US = 1.0E6 ; - PAT_CNV_MS = 1.0E9 ; - } - else if (namealloc(ident) == namealloc("ns")) - { - PAT_TIMEUNIT = PAT_TU__NS ; - PAT_CNV_FS = 1.0E-6 ; - PAT_CNV_PS = 1.0E-3 ; - PAT_CNV_NS = 1.0 ; - PAT_CNV_US = 1.0E3 ; - PAT_CNV_MS = 1.0E6 ; - } - else if (namealloc(ident) == namealloc("us")) - { - PAT_TIMEUNIT = PAT_TU__US ; - PAT_CNV_FS = 1.0E-9 ; - PAT_CNV_PS = 1.0E-6 ; - PAT_CNV_NS = 1.0E-3 ; - PAT_CNV_US = 1.0 ; - PAT_CNV_MS = 1.0E3 ; - } - else if (namealloc(ident) == namealloc("ms")) - { - PAT_TIMEUNIT = PAT_TU__MS ; - PAT_CNV_FS = 1.0E-12 ; - PAT_CNV_PS = 1.0E-9 ; - PAT_CNV_NS = 1.0E-6 ; - PAT_CNV_US = 1.0E-3 ; - PAT_CNV_MS = 1.0 ; - } - else - { - Erreur ("SETTUNIT : illegal time unit"); - } - -if (racine_paseq != NULL) - racine_paseq->TIME_UNIT = PAT_TIMEUNIT; -} - diff --git a/alliance/src/genpat/src/genpat.h b/alliance/src/genpat/src/genpat.h deleted file mode 100644 index 42b91aca..00000000 --- a/alliance/src/genpat/src/genpat.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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. - */ - -/***************************************************************/ -/* module : libpat_h.h */ -/* date : 28/03/92 */ -/* auteurs : RENAUD & VENOT */ -/***************************************************************/ - -/* $Id: genpat.h,v 1.1 2002/05/30 13:28:15 xtof Exp $ */ - -#ifndef GENPAT_H -#define GENPAT_H - - -#define DEF_GENPAT GNP_LINE = __LINE__ , d_DEF_GENPAT -#define DECLAR GNP_LINE = __LINE__ , d_DECLAR -#define ARRAY GNP_LINE = __LINE__ , d_ARRAY -#define AFFECT GNP_LINE = __LINE__ , d_AFFECT -#define INIT GNP_LINE = __LINE__ , d_INIT -#define LABEL GNP_LINE = __LINE__ , d_LABEL -#define SETTUNIT GNP_LINE = __LINE__ , d_SETTUNIT -#define GETCPAT GNP_LINE = __LINE__ , d_GETCPAT -#define CONV GNP_LINE = __LINE__ , d_CONV -#define SAV_GENPAT GNP_LINE = __LINE__ , d_SAV_GENPAT - - -#define IN "I" -#define OUT "O" -#define INOUT "T" -#define REGISTER "R" -#define SIGNAL "S" - -#define SPY "S" - -extern unsigned int GNP_LINE; - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - - extern void d_DEF_GENPAT __P((char *chaine)); - extern void d_DECLAR __P((char *ident, char *space, char *format, char *mode, char *size, char *option)); - extern void d_ARRAY __P(()); - extern void d_AFFECT __P((char *pat_numb, char *ident, char *val)); - extern void d_INIT __P((char *pat_numb, char *ident, char *val)); - extern void d_LABEL __P((char *ident)); - extern void d_SETTUNIT __P((char *ident)); - extern unsigned long d_GETCPAT __P(()); - extern char * d_CONV __P((int entier)); - extern void d_SAV_GENPAT __P(()); - - -#endif diff --git a/alliance/src/genpat/src/genpat.sh b/alliance/src/genpat/src/genpat.sh deleted file mode 100755 index fa34d6d9..00000000 --- a/alliance/src/genpat/src/genpat.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/sh -# $Id: genpat.sh,v 1.1 2002/05/30 13:28:15 xtof Exp $ - -#set -v -#set -x - -help() { - echo "Syntax: `basename $0` [-vk] source-file (without extension)" - echo " -v : verbose mode" - echo " -k : keeps the executable (whith debugging" - echo " informations) along with the" - echo " compilation Makefile after completion" - exit 1 -} - - if [ $# -lt 1 -o $# -gt 4 ] ; then - help 1 2 - fi - - debug= - talk=0 - keep=0 - name="" - while [ $# -gt 0 ] - do - case $1 in - -v) talk=1;; - -k) keep=1;debug=-g;; - -vk) keep=1;debug=-g; talk=1;; - -kv) keep=1;debug=-g; talk=1;; - *) if [ -z "$name" ]; then - name=$1; - else - help - fi - esac - shift - done - trap "rm -f ./*.$$; exit 0" 1 2 3 6 - - alcbanner "GenPat" "3.1" "Procedural GENeration of test PATterns" "1991" - - if [ -z "$name" ] ; then - help - fi - if [ ! -f $name.c ] ; then - echo "There seems no to be a file called $name.c" - help - fi - - if [ $talk -eq 1 ]; then - echo "Generating the Makefile"; - fi - - makefile="Makefile.$$" - - -cat << EOF > $makefile - -ALLIANCE_LIBRARY = -L\$(ALLIANCE_TOP)/lib \\ - -lPgn \\ - -lPpt \\ - -lPhl \\ - -lPat \\ - -lMut \\ - -lRcn - - -ALLIANCE_INC = -I\$(ALLIANCE_TOP)/include - -$name : $name.c - \$(CC) $debug -o $name $name.c \$(ALLIANCE_INC) \$(ALLIANCE_LIBRARY) - -EOF - - if [ $talk -eq 1 ]; then - echo "Compiling, ..." - fi - - make -f $makefile > $name.grr 2>&1 - - if [ ! $? -eq 0 ]; then - echo "Compilation failed!" - cat $name.grr - exit 1 - fi - - if [ $talk -eq 1 ] ; then - echo "Current execution environment" - echo "MBK_CATA_LIB : ${MBK_CATA_LIB-no cell library specified}" - echo "MBK_WORK_LIB : ${MBK_WORK_LIB-:}" - echo "MBK_IN_LO : ${MBK_IN_LO-vst}" - echo "MBK_OUT_LO : ${MBK_OUT_LO-vst}" - echo "MBK_IN_PH : ${MBK_IN_PH-ap}" - echo "MBK_OUT_PH : ${MBK_OUT_PH-ap}" - echo "MBK_CATAL_NAME : ${MBK_CATAL_NAME-CATAL}" - fi - - if [ $talk -eq 1 ]; then - echo "Executing ..." - fi - ./$name - exit_code=$? - - if [ $talk -eq 1 ]; then - echo "Removing tmp files ..." - fi - - if [ $keep -eq 0 ] ; then - rm $name; - fi - - rm $name.o $name.grr $makefile > /dev/null 2>&1 - - exit $exit_code - diff --git a/alliance/src/genpat/src/libpat_l.c b/alliance/src/genpat/src/libpat_l.c deleted file mode 100644 index 44a46374..00000000 --- a/alliance/src/genpat/src/libpat_l.c +++ /dev/null @@ -1,1141 +0,0 @@ -/* - * 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. - */ - -/***************************************************************/ -/* module : libpat_l.c */ -/* date : 28/07/93 */ -/* auteurs : RENAUD & VENOT & PITON */ -/***************************************************************/ - -#ident "$Id: libpat_l.c,v 1.1 2002/05/30 13:28:15 xtof Exp $" - -#include -#include -#include -#include -#include - -#include "mut.h" -#include "pat.h" -#include "libpat_l.h" - -/*------------------------------------------------------------ - * Numero de ligne dans le fichier source - *------------------------------------------------------------*/ -unsigned int GNP_LINE = 1; - -/*------------------------------------------------------------ - * STRUCTURE PAT - *------------------------------------------------------------*/ -struct paseq *racine_paseq; - -/*------------------------------------------------------------ - * LABEL - *------------------------------------------------------------*/ -unsigned int MAX_LABEL = 7; - -/*------------------------------------------------------------ - * NUMERO DE PATTERN COURANT - *------------------------------------------------------------*/ -unsigned long GNP_PATTERN_COURANT; - -/*------------------------------------------------------------ - * TABLE DES PAIOLs - *------------------------------------------------------------*/ -struct paiol *tab_paiol[GNP_MAXTAB_PAIOL]; -int GNP_PAIOL_INDEX=0; -int GNP_TAB_PAIOL_CREE; - -/*------------------------------------------------------------ - * TABLE DES IDENTIFICATEURS - *------------------------------------------------------------*/ -Tptab_ident tab_ident[GNP_MAXTAB_IDENT]; -int ind_tab_ident; - -/*------------------------------------------------------------ - * GESTION DES PARAMETRES A NOMBRE INDETERMINE - *------------------------------------------------------------*/ -char *pile_param[GNP_MAXPILE_PARAM]; -int sp_pile_param ; -int sp_file_param ; - -/*-------------------------------------------------------------------*/ -/* TABLES DE HACHAGE */ -/*-------------------------------------------------------------------*/ -elt *hash_paiol[GNP_HASHSIZE]; -elt *hash_pagrp[GNP_HASHSIZE]; - -/* ###--------------------------------------------------------------### */ -/* function : Erreur */ -/* description : print error message & exit */ -/* called func. : none */ -/* ###--------------------------------------------------------------### */ - -void Erreur (chaine) -char *chaine; -{ - fprintf (stderr, "GENPAT : line %d : %s\n", GNP_LINE, chaine); - -#ifdef DEBUG - EXIT(1); -#else - exit(1); -#endif - -} - -/*-------------------------------------------------------------------*/ -static int Hash(nom) -char *nom; -{ -int code = 0; -char *p; - p = nom; - while (*p) - code = (code << 1) ^ *p++; - if ( code < 0) - code =- code; - code %= GNP_HASHSIZE; - return( code); -} -/*-------------------------------------------------------------------*/ -void InitHash(tab) -elt *tab[]; -{ -int i; - for (i=0;i< GNP_HASHSIZE ; i++) - tab[i] = NULL ; -} -/*------------------------------------------------------------------- - * retourne le pointeur sur la structure ELT - * le champ name est mis a jour - * le champs num_index n'est pas mis a jour - * il vaut -1 - */ -/*-------------------------------------------------------------------*/ -elt *SymbAlloc(ident,tab) -char *ident; -elt *tab[] ; -{ -int num_case; -elt *ptr_aux; -char *allocname; - allocname = (char *)namealloc (ident); - num_case = Hash(allocname); - ptr_aux = tab[num_case]; - while (ptr_aux != NULL) - if ( strcmp( ptr_aux->name , allocname ) == 0 ) - return(ptr_aux); - else - ptr_aux = ptr_aux->next; - ptr_aux = (elt*) mbkalloc ( sizeof (elt) ); - ptr_aux->name = allocname; - ptr_aux->num_index = -1; - ptr_aux->sens = 0; - ptr_aux->next = tab[num_case] ; - tab[num_case] = ptr_aux ; - return ( ptr_aux ); -} -/*-------------------------------------------------------------------*/ -elt *ExisteIdent(ident,tab) -char *ident; -elt *tab[] ; -{ -elt *ptr_aux; -char *allocname; - allocname = (char *)namealloc (ident); - for(ptr_aux = tab[Hash(allocname)]; - (ptr_aux==NULL) || ( strcmp( ptr_aux->name , allocname ) != 0 ); - ptr_aux = ptr_aux->next - ); - if ( ptr_aux == NULL) - Erreur ("identifier not found"); - return (ptr_aux); -} -/*------------------------------------------------------------------- - * retourne soit -1 si le nom n'existe pas - * soit le champ num_index si le nom est trouve dans la table - */ -int FindIdent(ident,tab) -char *ident; -elt *tab[] ; -{ -int num_case; -elt *ptr_aux; -char *allocname; - allocname = (char *)namealloc (ident); - num_case = Hash(allocname); - ptr_aux = tab[num_case] ; - while (ptr_aux != NULL) - if ( strcmp( ptr_aux->name , allocname ) == 0 ) - return (ptr_aux->num_index); - else - ptr_aux = ptr_aux->next; - return(-1); -} - -/* ###--------------------------------------------------------------### */ -/* function : namei */ -/* description : add a number to a name */ -/* called func. : none */ -/* ###--------------------------------------------------------------### */ - -char *namei(str,n) -char *str; -int n; -{ - char *p; - - if (str == NULL) - return (NULL); - p = (char *)malloc((strlen(str)+11) * sizeof(char)); - sprintf(p,"%s_%d",str,n); - return(p); -} - -/* ###--------------------------------------------------------------### */ -/* function : KillEsp */ -/* description : remove every space character of a string */ -/* called func. : isspace */ -/* ###--------------------------------------------------------------### */ - -void KillEsp (name) -char *name; -{ -int i = 0; -int j = 0; - - while (name [i] != '\0') - { - name [j] = name [i]; - if (isspace (name[i]) == 0) - j++; - i++; - } - name [j] = '\0'; -} - -/* ###--------------------------------------------------------------### */ -/* function : CheckIdent */ -/* description : Check if ident is of type IDENT */ -/* called func. : isspace, isalpha, isalnum, isupper, Erreur */ -/* ###--------------------------------------------------------------### */ - -void CheckIdent (ident) -char *ident; -{ -char *cpt; -int i; - cpt = ident; - while ( isspace (*cpt) != 0 ) - cpt ++; - if (isalpha(*cpt++) == 0) - Erreur ("IDENT error not an identifier"); - for (i = strlen(cpt); i >0; i--) - { - if (isalnum(*cpt) == 0) - if ((*cpt != '_') && (*cpt != '.')) - Erreur ("IDENT error not an identifier"); - cpt ++; - } -} - - -/* ###--------------------------------------------------------------### */ -/* function : CheckSeparate */ -/* description : Check `# of blank between value` string declaration */ -/* called func. : isdigit */ -/* ###--------------------------------------------------------------### */ - -char CheckSeparate(chn_blk) -char *chn_blk; -{ - char *pt = chn_blk; - - if (*pt == ':') - { - pt++; - if (strlen (pt) == 1 ) - { - if (isdigit (*pt)) - return (*pt); - } - if (strlen (pt) == 0 ) - return ('0'); - } - Erreur ("SEPARATOR error in paiol declaration"); - return (*pt); -} - -/* ###--------------------------------------------------------------### */ -/* function : CheckFormat */ -/* description : Check if format is : x, X, o, O, b, B */ -/* called func. : KillEsp, Erreur */ -/* ###--------------------------------------------------------------### */ - -char CheckFormat (format) - -char *format; -{ -char value; - - KillEsp (format); - if (strlen (format) > 1 ) - Erreur ("FORMAT format error"); - - switch (*format) - { - case 'x': - case 'X': - value = 'X'; - break; - - case 'o': - case 'O': - value = 'O'; - break; - - case 'b': - case 'B': - value = 'B'; - break; - - default: - Erreur ("FORMAT error"); - } - - return (value); - } - -/* ###--------------------------------------------------------------### */ -/* function : CheckType */ -/* description : Check connector type */ -/* called func. : KillEsp, Erreur */ -/* ###--------------------------------------------------------------### */ - -char CheckType (type) -char *type; -{ - char t; - - KillEsp (type); - if (strlen (type) > 1 ) - Erreur ("TYPE error"); - switch (*type) - { - case 'O':case 'o': t = 'O'; break; - case 'I':case 'i': t = 'I'; break; - case 'T':case 't': t = 'T'; break; - case 'S':case 's': t = 'S'; break; - case 'R':case 'r': t = 'R'; break; - break; - default: - Erreur ("MODE error"); - } - return(t); -} - - -/* ###--------------------------------------------------------------### */ -/* function : CheckOption */ -/* description : Check connector option */ -/* called func. : KillEsp, Erreur */ -/* ###--------------------------------------------------------------### */ - -char CheckOption (option) -char *option; -{ - char flg = 0; - - KillEsp (option); - if (strlen (option) > 1 ) - Erreur ("OPTION error"); - if (strlen (option) == 0) - { - flg = 0; - } - else - { - switch (*option) - { - case 'S': case 's': flg |= PAT_IOL__SPY; break; - default: - Erreur ("OPTION error"); - } - } - return(flg); -} - - -/* ###--------------------------------------------------------------### */ -/* function : CheckPattern */ -/* description : Check if string "pattern" describe a pattern number */ -/* called func. : KillEsp, isdigit, Erreur */ -/* ###--------------------------------------------------------------### */ - -void CheckPattern (pattern) -char *pattern; -{ -int lg,i; - - KillEsp (pattern); - lg = strlen (pattern); - if ( lg == 0) - Erreur("PATTERN NUMBER syntax error"); - if ( (*pattern != '+') && (isdigit(*pattern )== 0) ) - Erreur("PATTERN NUMBER syntax error"); - for (i = 1; i< lg ; i++) - { - pattern ++; - if ( isdigit(*pattern) == 0 ) - Erreur("PATTERN NUMBER syntax error"); - } -} - -/* ###--------------------------------------------------------------### */ -/* function : CheckWidth */ -/* description : Check vector field descriptor */ -/* called func. : atoi, Erreur */ -/* ###--------------------------------------------------------------### */ - -void CheckWidth (chaine) -struct alpha_num *chaine; -{ -int gauche, droite, lg_gauche, lg_droite, lg_alpha; - - lg_gauche = strlen (chaine->gauche); - gauche = atoi(chaine->gauche); - lg_droite = strlen (chaine->droite); - droite = atoi(chaine->droite); - lg_alpha = strlen (chaine->alpha); - - if ( ( lg_alpha == 0 && lg_droite != 0 ) || - ( lg_alpha != 0 && lg_droite == 0 ) || - ( lg_gauche == 0 && ( lg_alpha != 0 || lg_droite != 0) ) ) - Erreur ("CheckWidth :VECTOR field descriptor error, missing argument"); - - if ( (( strcmp (chaine->alpha,"DOWNTO")==0) || - ( strcmp (chaine->alpha,"downto")==0) ) && (gauche < droite)) - Erreur ("CheckWidth :VECTOR field descriptor error, incorrect direction"); - - if ( ( (strcmp (chaine->alpha,"TO")==0) || - (strcmp (chaine->alpha,"to")==0) ) && (droite < gauche) ) - Erreur ("CheckWidth :VECTOR field descriptor error, incorrect direction"); -} - - - -/* ###--------------------------------------------------------------### */ -/* function : SplitIdent */ -/* description : Split Ident (ident) in two strings : */ -/* Ident name (ident) and Ident number (chaine) */ -/* called func. : isspace */ -/* ###--------------------------------------------------------------### */ - - -void SplitIdent (ident,chaine) -char *chaine; -char *ident; -{ -char idtmp[30],reste[30], *cpt; -int i,j =0,k =0, flag1=0,flag2=0; - cpt = ident; - for (i = strlen(ident); i >0; i--) - { - if (flag1 == 0) - { - if (isspace(*cpt) == 0 && *cpt != '(' ) - { - flag2 = 1; - idtmp[j++] = *cpt; - } - else - { - if (flag2 == 1 ) - { - flag1 = 1; - if (*cpt == '(') reste[k++] = *cpt; - } - else idtmp[j++] = *cpt; - } - } - else - { - reste[k++] = *cpt; - } - cpt ++; - } - idtmp[j] = '\0'; - reste[k] = '\0'; - strcpy (chaine,reste); - strcpy (ident,idtmp); -} - -/* ###--------------------------------------------------------------### */ -/* function : TraiterChaine */ -/* description : find out left & right bound and direction of an array */ -/* called func. : isdigit, isalpha, isspace */ -/* ###--------------------------------------------------------------### */ - -void TraiterChaine (chaine,traite) -char * chaine; -struct alpha_num *traite; -{ -char *cpt; -int i=0,j=0,k=0,l=0,flag=0,f=0; - - KillEsp(chaine); - - if ( *chaine == '(') - { - f = 1; - chaine++; - } - - cpt = chaine; - for (i = strlen(chaine); i >0; i--) - { - switch (flag) - { - case 0: - { - if (isdigit(*cpt) ) - traite->gauche[j++] = *cpt; - if (isalpha (*cpt)) - { - traite->alpha[k++] = *cpt; - flag = 1; - } - if (*cpt == ')' && f == 0) - Erreur ("BIT descriptor error"); - break; - } - case 1: - { - if (isalpha (*cpt)) - { - traite->alpha[k++] = *cpt; - flag = 1; - break; - } - if (isdigit(*cpt)) - { - traite->droite[l++] = *cpt; - flag = 2; - break; - } - if ( ! ( (*cpt == ')') && (f==1) && (i==1) ) ) - Erreur("TraiterChaine : VECTOR field descriptor error"); - break; - } - case 2: - { - if (isdigit(*cpt)) - traite->droite[l++] = *cpt; - else - if( ! ( (*cpt == ')') && (f==1) && (i==1) ) ) - Erreur ("TraiterChaine :VECTOR field descriptor error"); - break; - } - } - cpt++; - } - traite->gauche[j] = '\0'; - traite->alpha[k] = '\0'; - traite->droite[l] = '\0'; - - return ; -} -/* ###--------------------------------------------------------------### */ -/* function : CreatePagrp */ -/* description : add a new PAGRP, set hash tab and ident tab & index */ -/* called func. : SymbAlloc, pat_addpagrp, Erreur */ -/* ###--------------------------------------------------------------### */ - -void CreatePagrp(ident,length,sens,type_vecteur) -char *ident; -int length,sens; -short type_vecteur; -{ -int index; -elt *tmp_elt; - - index = GNP_PAIOL_INDEX - length; - if (index < 0 ) - Erreur ( "PAGRP length doesnt match"); - - if (ind_tab_ident >= GNP_MAXTAB_IDENT) - Erreur ("PAGRP too much declared identifiers"); - - tmp_elt = SymbAlloc(ident,hash_pagrp); - racine_pagrp = pat_addpagrp(racine_pagrp, - tmp_elt->name, - length, - index, - type_vecteur); - - tmp_elt->num_index = ind_tab_ident; - tmp_elt->sens = sens; - tab_ident[ind_tab_ident].duplicate =ind_tab_ident; - tab_ident[ind_tab_ident++].pointeur =(void *)racine_pagrp; -} - - -/* ###--------------------------------------------------------------### */ -/* function : DupPaiol */ -/* description : Create (duplicate = -1) or duplicate a PAIOL struct */ -/* set PASEQ struct. and ident tab & index */ -/* called func. : SymbAlloc, pat_addpaiol, ExisteIdent, Erreur */ -/* ###--------------------------------------------------------------### */ - -void DupPaiol (duplicate,format,param_effectif,param_virtuel,i_o,blk,flg) -int duplicate; -char format; -char *param_effectif; -char *param_virtuel; -char i_o, blk, flg; -{ -elt *tmp_elt_effectif; -elt *tmp_elt_virtuel; - - tmp_elt_virtuel = SymbAlloc (param_virtuel,hash_paiol); - - if (duplicate == GNP_NO_DUPLICATE) - tmp_elt_effectif = SymbAlloc(param_effectif,hash_paiol); - else - tmp_elt_effectif = ExisteIdent (param_effectif,hash_paiol); - - if (duplicate != tmp_elt_effectif->num_index) - Erreur ("DupPaiol error unconstistent paiol references"); - - if (ind_tab_ident >= GNP_MAXTAB_IDENT) - Erreur ("too mutch declared identifiers"); - - tmp_elt_virtuel->num_index = ind_tab_ident; - - racine_paiol = pat_addpaiol(racine_paiol, - tmp_elt_effectif->name, - format, - i_o, - (char)((int)blk - (int)'0')); - - racine_paiol->FLAG = flg; - - IOLNUMBER++; - - if (duplicate != GNP_NO_DUPLICATE) - { - tab_ident[ind_tab_ident].duplicate = tab_ident[duplicate].duplicate; - tab_ident[duplicate].duplicate = ind_tab_ident; - } - else - { - tmp_elt_effectif->num_index = ind_tab_ident; - tab_ident[ind_tab_ident].duplicate = ind_tab_ident; - } - - tab_ident[ind_tab_ident].num_paiol = GNP_PAIOL_INDEX++; - tab_ident[ind_tab_ident++].pointeur =(void *)racine_paiol; -} - - -/* ###--------------------------------------------------------------### */ -/* function : CreatePaiol */ -/* description : add a new PAIOL, set hash tab and ident tab & index */ -/* called func. : SymbAlloc, pat_addpaiol, Erreur */ -/* ###--------------------------------------------------------------### */ - -void CreatePaiol (format,ident,mode,blk,flg) -char format; -char *ident; -char mode,blk,flg; -{ -elt *tmp_elt; - - if (ind_tab_ident >= GNP_MAXTAB_IDENT) - Erreur ("too mutch declared identifiers"); - - tmp_elt = SymbAlloc(ident,hash_paiol); - - racine_paiol = pat_addpaiol(racine_paiol, - tmp_elt->name, - format, - mode, - (char)((int)blk - (int)'0')); - - racine_paiol->FLAG = flg; - - IOLNUMBER++; - - tmp_elt->num_index = ind_tab_ident; - tab_ident[ind_tab_ident].duplicate = ind_tab_ident; - tab_ident[ind_tab_ident].num_paiol = GNP_PAIOL_INDEX++; - tab_ident[ind_tab_ident++].pointeur =(void *)racine_paiol; -} - - -/* ###--------------------------------------------------------------### */ -/* function : EmpileParam */ -/* description : push parameter in parameter stack */ -/* called func. : Erreur */ -/* ###--------------------------------------------------------------### */ - -void EmpileParam(param) -char *param; -{ - if ( sp_pile_param >= GNP_MAXPILE_PARAM ) - Erreur (" no more place in param stack"); - - pile_param[sp_pile_param ++] = param ; -} - -/* ###--------------------------------------------------------------### */ -/* function : DefileParam */ -/* description : unchain parameter */ -/* called func. : Erreur */ -/* ###--------------------------------------------------------------### */ - -char *DefileParam() -{ - if ( sp_file_param > sp_pile_param ) - Erreur("empty parameter file"); - - return ( pile_param[sp_file_param++] ) ; -} - - - - -/* ###--------------------------------------------------------------### */ -/* function : FusionPaevt */ -/* description : add a list of PAEVT at the and of a PAEVT list */ -/* called func. : FusionPaevt, Erreur */ -/* ###--------------------------------------------------------------### */ - -struct paevt *FusionPaevt (lst_event,tete_event) -struct paevt *lst_event; -struct paevt *tete_event; -{ -struct paevt *tmp_paevt = tete_event; - - if (tete_event == NULL) return(lst_event); - if (lst_event == NULL) return(tete_event); - - while ( (tmp_paevt->NEXT) != NULL ) - tmp_paevt = tmp_paevt->NEXT; - - tmp_paevt->NEXT = lst_event; - - return (tete_event); -} - - - -/* ###--------------------------------------------------------------### */ -/* function : CreateAction */ -/* description : Change ACTFLAG flag in PAPAT */ -/* called func. : none */ -/* ###--------------------------------------------------------------### */ - -void CreateAction (act_type) -char *act_type; -{ -char car_act; -struct papat *tmp_papat; - - tmp_papat = racine_papat; - -/* recherche de l'emplacement du papat dans la liste des papat */ - - if (tmp_papat == NULL) - Erreur("CreateAction error not yet created pattern"); - - while ((tmp_papat != NULL) && (tmp_papat->TIME > GNP_PATTERN_COURANT)) - tmp_papat = tmp_papat->NEXT; - - if (tmp_papat == NULL) - Erreur("CreateAction error not yet created pattern"); - - if (tmp_papat->TIME != GNP_PATTERN_COURANT) - Erreur ("CreateAction : error in data structure"); - - car_act = *act_type; - tmp_papat->ACTFLAG = car_act; -} - - -/* ###--------------------------------------------------------------### */ -/* function : FusionPaini */ -/* description : merge two initialization lists */ -/* called func. : none */ -/* ###--------------------------------------------------------------### */ - -struct paini *FusionPaini (fst_ini, scd_ini) - -struct paini *fst_ini; -struct paini *scd_ini; - - { - struct paini *res_ini; - - if (fst_ini == NULL) - res_ini = scd_ini; - else - { - res_ini = fst_ini; - while (res_ini->NEXT != NULL) - res_ini = res_ini->NEXT; - - res_ini->NEXT = scd_ini; - res_ini = fst_ini; - } - - return (res_ini); - } - - -/* ###--------------------------------------------------------------### */ -/* function : CreatePapat */ -/* description : add or set a PAPAT struct in PAPAT list */ -/* called func. : pat_addpacom, TriFusion */ -/* ###--------------------------------------------------------------### */ - -void CreatePapat (label,lst_event,lst_ini) - -char *label; -struct paevt *lst_event; -struct paini *lst_ini; - - { - struct papat *fils_papat; - struct papat *pere_papat; - struct papat *tmp_papat; - int size; - - - if (racine_papat == NULL) - { - -/* first PAPAT to be created */ - - racine_papat = pat_addpapat (NULL, namei (label,GNP_PATTERN_COURANT), - GNP_PATTERN_COURANT); - racine_papat->TIME = GNP_PATTERN_COURANT; - racine_papat->PAEVT = lst_event; - racine_papat->PAINI = lst_ini; - PATNUMBER = 1; - } - else - { - -/* putting fils_papat after or on the good papat */ - - pere_papat = racine_papat; - fils_papat = racine_papat; - - while ((fils_papat != NULL) && (fils_papat->TIME > GNP_PATTERN_COURANT)) - { - pere_papat = fils_papat; - fils_papat = fils_papat->NEXT; - } - - if ( (fils_papat == NULL) || (fils_papat->TIME < GNP_PATTERN_COURANT) ) - { - -/* fils_papat is after the good papat or NULL*/ - - - tmp_papat = pat_addpapat (fils_papat, namei(label, GNP_PATTERN_COURANT), - GNP_PATTERN_COURANT); - tmp_papat->TIME = GNP_PATTERN_COURANT; - tmp_papat->PAEVT = lst_event; - tmp_papat->PAINI = lst_ini; - PATNUMBER++; - - if (pere_papat == fils_papat ) - racine_papat = tmp_papat; - else - pere_papat->NEXT = tmp_papat; - - } - else - { - -/* fils_papat is on the good papat */ - - - fils_papat->PAEVT = FusionPaevt (lst_event, fils_papat->PAEVT); - fils_papat->PAINI = FusionPaini (lst_ini , fils_papat->PAINI); - if (label != NULL) - fils_papat->LABEL = namei(label,GNP_PATTERN_COURANT); - } - } - - if ( label != NULL) - { - size = strlen (namei (label, GNP_PATTERN_COURANT)); - if (MAX_LABEL < size) - MAX_LABEL = size; - } - } - - -/* ###--------------------------------------------------------------### */ -/* function : CreatePaevt */ -/* description : add a PAEVT struct at the end of a PAEVT list */ -/* warning : parameters validity is not tested */ -/* called func. : pat_addpacom, TriFusion */ -/* ###--------------------------------------------------------------### */ - -struct paevt *CreatePaevt(tete_paevt,num_ident,valeur) -struct paevt *tete_paevt; -int num_ident; -char valeur; -{ -struct paevt *tmp_paevt ; - - tmp_paevt = pat_addpaevt(NULL,tab_ident[num_ident].num_paiol,valeur); - tete_paevt = FusionPaevt(tmp_paevt,tete_paevt); - return (tete_paevt); -} - - -/* ###--------------------------------------------------------------### */ -/* function : MajPatternCourrant */ -/* description : Set current pattern number */ -/* called func. : atoi */ -/* ###--------------------------------------------------------------### */ - -void MajPatternCourant(pattern) -char *pattern; -{ -unsigned long relatif = 0, valeur; - - if(*pattern == '+') - { - relatif = 1; - pattern++; - } - valeur = atoi (pattern); - GNP_PATTERN_COURANT = (GNP_PATTERN_COURANT * relatif) + valeur; -} - - -/* ###--------------------------------------------------------------### */ -/* function : FormatValue */ -/* description : change inout value to binary according to format */ -/* called func. : Erreur */ -/* ###--------------------------------------------------------------### */ - -void FormatValue (ret_val,value,nb_car,sens,i_o) -char *ret_val; -char *value; -int nb_car, sens; -int i_o; -{ -char *valeur; -char *res; -int lg,i,li; -char tmp [64]; -char flg =' '; - - valeur = value ; - if (i_o == 0) - { - lg = strlen (valeur); - for (i = 0; i< lg ; i++) - { - if (*valeur == '*') - Erreur ("AFFECT/INIT incorrect input or init-value syntax"); - valeur ++; - } - valeur = value; - } - - if (strlen (valeur) >1) - valeur++; - switch (*valeur) - { - case 'b': case 'B': - { - valeur++; - lg = strlen (valeur); - strcpy (ret_val,"\0"); - for (i = 0 ; i < lg ; i++) - { - switch (*valeur) - { - case '0': { strcat (ret_val,"-"); break; } - case '1': { strcat (ret_val,"+"); break; } - case '*': { strcat (ret_val,"*"); - flg='*'; - break; } - default : - Erreur ("AFFECT/INIT incorrect binary format"); - } - valeur++; - } - break; - } - case 'o': case 'O': - { - valeur++; - lg = strlen (valeur); - strcpy (ret_val,"\0"); - for (i = 0 ; i < lg ; i++) - { - switch (*valeur) - { - case '0': { strcat (ret_val,"---"); break; } - case '1': { strcat (ret_val,"--+"); break; } - case '2': { strcat (ret_val,"-+-"); break; } - case '3': { strcat (ret_val,"-++"); break; } - case '4': { strcat (ret_val,"+--"); break; } - case '5': { strcat (ret_val,"+-+"); break; } - case '6': { strcat (ret_val,"++-"); break; } - case '7': { strcat (ret_val,"+++"); break; } - case '*': { strcat (ret_val,"***"); - flg='*'; - break; } - default : Erreur ("AFFECT/INIT incorrect octal format"); - } - valeur++; - } - break; - } - case 'x': case 'X': - { - valeur++; - lg = strlen (valeur); - strcpy (ret_val,"\0"); - for (i = 0 ; i < lg ; i++) - { - switch (*valeur) - { - case '0': { strcat (ret_val,"----"); break; } - case '1': { strcat (ret_val,"---+"); break; } - case '2': { strcat (ret_val,"--+-"); break; } - case '3': { strcat (ret_val,"--++"); break; } - case '4': { strcat (ret_val,"-+--"); break; } - case '5': { strcat (ret_val,"-+-+"); break; } - case '6': { strcat (ret_val,"-++-"); break; } - case '7': { strcat (ret_val,"-+++"); break; } - case '8': { strcat (ret_val,"+---"); break; } - case '9': { strcat (ret_val,"+--+"); break; } - case 'A': case 'a': { strcat (ret_val,"+-+-"); break; } - case 'B': case 'b': { strcat (ret_val,"+-++"); break; } - case 'C': case 'c': { strcat (ret_val,"++--"); break; } - case 'D': case 'd': { strcat (ret_val,"++-+"); break; } - case 'E': case 'e': { strcat (ret_val,"+++-"); break; } - case 'F': case 'f': { strcat (ret_val,"++++"); break; } - case '*': { strcat (ret_val,"****"); - flg='*'; - break; } - default : Erreur ("AFFECT/INIT incorrect hexad. format"); - } - valeur++; - } - break; - } - default : - { - valeur = value; - lg = strlen (valeur); - for (i = 0; i< lg ; i++) - { - if ( isdigit(*valeur) == 0 ) - Erreur ("AFFECT/INIT incorrect decimal format"); - valeur ++; - } - li = atoi(value); - - valeur = ret_val; - while(li != 0) - { - if ( (li & 0x01) == 1) - *valeur++ = '+'; - else - *valeur++ = '-'; - li = li >> 1; - - } - if ( valeur == ret_val ) - *valeur++ = '-'; - *valeur = '\0'; - - valeur = ret_val; - lg = strlen(ret_val); - for(i = lg-1; i>=0; i--) tmp[i]=*valeur++; - tmp[lg]= '\0'; - strcpy(ret_val,tmp); - break; - } - } -/* ajuster la longueur de la chaine en moins */ - lg = strlen (ret_val); - if (lg > nb_car) - { - valeur = res = ret_val ; - printf ("line %d :VALUE too large value: MSB are truncated\n",GNP_LINE); - for (i = 0; i< (lg - nb_car) ; i++,res++); - while ( *res != '\0') - { - *valeur = *res; - valeur++; - res++; - } - *valeur = '\0'; - } -/* ajuster la longueur de la chaine en + avec des 0 */ - if (lg < nb_car) - { - valeur = ret_val; - for (i = 0 ; i < (nb_car - lg) ; i ++) tmp[i] = '-'; - - for (i = i ; i < nb_car ; i ++) tmp[i] = *valeur++; - - tmp[i] = '\0'; - strcpy (ret_val,(char *)tmp); - } - if (sens == GNP_UP) - { -/* inverser la chaine */ - valeur = ret_val; - for (i = nb_car-1 ; i >=0 ; i--) tmp[i] = *valeur++; - tmp[nb_car] = '\0'; - strcpy (ret_val,(char *)tmp); - } -/* ajuster le format */ - if ((i_o == 0) || (flg == '*')) - { - valeur = ret_val; - for (i = nb_car-1 ; i>= 0 ; i--) - if (flg == '*') - *valeur++ = '*'; - else - { - *valeur = ( (*valeur == '-') ? '0' : '1' ); - valeur++; - } - } -} diff --git a/alliance/src/genpat/src/libpat_l.h b/alliance/src/genpat/src/libpat_l.h deleted file mode 100644 index a879540b..00000000 --- a/alliance/src/genpat/src/libpat_l.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - * 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. - */ - -/***************************************************************/ -/* module : libpat_l.h */ -/* date : 12/04/92 */ -/* auteurs : RENAUD & VENOT */ -/***************************************************************/ - -/* $Id: libpat_l.h,v 1.1 2002/05/30 13:28:15 xtof Exp $ */ - -#ifndef LIBPAT_L_H -#define LIBPAT_L_H - -/*------------------------------------------------------------ - * CONSTANTES - *------------------------------------------------------------*/ -#define GNP_MAXPILE_PARAM 40 -/* sp_.. pointe#include MUT_H tjrs sur le suivant */ -#define GNP_PARAM_COURANT (sp_file_param - 1) -#define GNP_MAXTAB_IDENT 4096 -#define GNP_MAXTAB_PAIOL 4096 -#define GNP_NO_DUPLICATE -1 -#define GNP_NOT_FOUND -1 -#define GNP_ACTIF 1 -#define GNP_INACTIF 0 -#define GNP_VECTEUR_VIRTUEL 1 -#define GNP_VECTEUR_EFFECTIF 0 -#define GNP_UP 1 -#define GNP_DO -1 - -/*------------------------------------------------------------ - * STRUCTURE PAT - *------------------------------------------------------------*/ -#define racine_pagrp (racine_paseq->PAGRP) -#define racine_paiol (racine_paseq->PAIOL) -#define racine_papat (racine_paseq->CURPAT) -#define racine_pacom (racine_paseq->CURCOM) -#define racine_paevt (racine_paseq->CURPAT->PAEVT) -#define racine_paini (racine_paseq->CURPAT->PAINI) -#define PATNUMBER (racine_paseq->PATNBR) -#define IOLNUMBER (racine_paseq->IOLNBR) - -extern struct paseq *racine_paseq; -/*------------------------------------------------------------ - * NUMERO DE PATTERN COURANT - *------------------------------------------------------------*/ -extern unsigned long GNP_PATTERN_COURANT; -/*------------------------------------------------------------ - * TAILLE DU MAX. LABEL - *------------------------------------------------------------*/ -extern unsigned int MAX_LABEL; -/*------------------------------------------------------------ - * TABLE DES PAIOLs - *------------------------------------------------------------*/ -extern struct paiol *tab_paiol[]; -extern int GNP_PAIOL_INDEX; -extern int GNP_TAB_PAIOL_CREE; -/*------------------------------------------------------------ - * GESTION DES PARAMETRES A NOMBRE INDETERMINE - *------------------------------------------------------------*/ -struct alpha_num { - char gauche[6]; - char droite[6]; - char alpha[7]; - }; -extern char *pile_param[]; -extern int sp_pile_param ; -extern int sp_file_param ; -extern FILE *fp; -/*------------------------------------------------------------ - * TABLE DES IDENTIFICATEURS - *------------------------------------------------------------*/ -typedef struct { - int duplicate; - int num_paiol; - void * pointeur; - } Tptab_ident; - -extern Tptab_ident tab_ident[]; -extern int ind_tab_ident; - -/*------------------------------------------------------------* - * CONSTANTES DE LA LIBRAIRIE * - *------------------------------------------------------------*/ -#define GNP_HASHSIZE 29 -/*------------------------------------------------------------* - * TABLES DE HACHAGE * - *------------------------------------------------------------*/ -typedef struct _elt - { - char *name; - int num_index; - int sens; /* definit l'ordre de declaration des poids - des elements d'un vecteur */ - struct _elt *next; - }elt; - -extern elt *hash_paiol[GNP_HASHSIZE]; -extern elt *hash_pagrp[GNP_HASHSIZE]; - -/*------------------------------------------------------------* - * FONCTIONS DE LA LIBRAIRIE * - *------------------------------------------------------------*/ - -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif - - - extern void InitHash __P((elt *tab[])); - extern elt * ExisteIdent __P((char *ident, elt *tab[])); - extern elt * SymbAlloc __P((char *ident, elt *tab[])); - extern int FindIdent __P((char *ident, elt *tab[])); - - extern void Erreur __P((char *chaine)); - - extern void KillEsp __P((char *name)); - - extern void CheckIdent __P((char *ident)); - extern char CheckSeparate __P((char *chn_blk)); - extern char CheckFormat __P((char *format)); - extern char CheckType __P((char *type)); - extern char CheckOption __P((char *option)); - extern void CheckPattern __P((char *pattern)); - extern void CheckWidth __P((struct alpha_num *chaine)); - - extern void DupPaiol __P((int duplicate, char format, char *param_effectif, char *param_virtuel, char i_o, char blk, char flg)); - - extern void TraiterChaine __P((char *chaine, struct alpha_num *traite)); - extern void SplitIdent __P((char *chaine, char *ident)); - - extern void FormatValue __P((char *ret_val, char *value, int nb_car, int sens, int i_o)); - - extern char * DefileParam __P(()); - extern void EmpileParam __P((char *param)); - - extern void CreatePapat __P((char *label, struct paevt *lst_event, struct paini *lst_ini)); - extern void CreatePaiol __P((char format, char *ident, char mode, char blk, char flg)); - extern void CreatePagrp __P((char *ident, int length, int sens, short type_vecteur)); - extern void CreateAction __P((char *act_type)); - extern struct paevt * CreatePaevt __P((struct paevt *tete_paevt, int num_ident, char valeur)); - - extern struct paevt * FusionPaevt __P((struct paevt *lst_event, struct paevt *tete_event)); - extern struct paini * FusionPaini __P((struct paini *fst_ini, struct paini *scd_ini)); - extern void MajPatternCourant __P((char *pattern)); - - -#endif diff --git a/alliance/src/lvx/Makefile.am b/alliance/src/lvx/Makefile.am deleted file mode 100644 index ce9d1044..00000000 --- a/alliance/src/lvx/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -## Process this file with automake to produce Makefile.in - -SUBDIRS = doc src diff --git a/alliance/src/lvx/configure.in b/alliance/src/lvx/configure.in deleted file mode 100644 index 0c6feb17..00000000 --- a/alliance/src/lvx/configure.in +++ /dev/null @@ -1,33 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(src/lvx.c) - -LVX_MAJOR_VERSION=1 -LVX_MINOR_VERSION=2 -LVX_VERSION=$LVX_MAJOR_VERSION.$LVX_MINOR_VERSION - -AC_SUBST(LVX_MAJOR_VERSION) -AC_SUBST(LVX_MINOR_VERSION) -AC_SUBST(LVX_VERSION) - -# For automake. -VERSION=$LVX_VERSION -PACKAGE=lvx - -dnl Initialize automake stuff -AM_INIT_AUTOMAKE($PACKAGE, $VERSION) - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_MAKE_SET - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST - -AM_ALLIANCE - -AC_OUTPUT([ -Makefile -doc/Makefile -src/Makefile -]) diff --git a/alliance/src/lvx/doc/Makefile.am b/alliance/src/lvx/doc/Makefile.am deleted file mode 100644 index 3667cafc..00000000 --- a/alliance/src/lvx/doc/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -## Process this file with automake to produce Makefile.in - -man_MANS = lvx.1 -EXTRA_DIST = $(man_MANS) diff --git a/alliance/src/lvx/doc/lvx.1 b/alliance/src/lvx/doc/lvx.1 deleted file mode 100644 index 67f5514a..00000000 --- a/alliance/src/lvx/doc/lvx.1 +++ /dev/null @@ -1,188 +0,0 @@ -.\" $Id: lvx.1,v 1.1 2002/03/20 17:07:59 xtof Exp $ -.\" @(#)lvx.l 0.0 92/11/27 UPMC; Author: Francois Nacabal -.TH LVX 1 "October 1, 1997" "ASIM/LIP6" "ALLIANCE USER COMMANDS" -.SH NAME -lvx \- Logical Versus eXtracted net-list comparator -.SH SYNOPSIS -.TP -\fBlvx \fIformat1 format2 filename1 filename2 \fB[ -a ] [ -o ] [ -f ]\fR -.br -.so man1/alc_origin.1 -.SH DESCRIPTION -.B lvx -compares two gate-level or block level net-list. The goal is to compare -a specification net-list (logical net-list), the input to a place and route tool, -with the physical net-list (extracted net-list) obtained by the -.BR lynx (1) -extractor. -.br -The net-list 1 is considered as the logical net-list and net-list 2 as the -extracted net-list. -.br -.br -.B lvx -is an one-level hierarchical tool: -.IP -The two net-list are flattened, if the \fB-f\fP option is present, to the cells -contained in the catalog file. The path to the catalog file is indicated in the -.BR MBK_CATA_LIB (1) -variable for the cell library, and in the -.BR MBK_WORK_LIB (1) -variable with the name -.BR MBK_CATAL_NAME (1) -for user blocks ( -.BR catal (5) -) that are not to be flattened. -.IP -For both net-list, the instances are considered as black-boxes. -.IP -The two net-list must have the same external connectors names. -.IP -The two net-list must have the same instances names. -.IP -The two net-list must have the same signals names for unconnected signals. -.IP -The two net-list cannot directly contain transistors. -.LP -Comparison is performed in three steps: -.IP -Compare terminals. -.IP -Compare instances. -.IP -Compare connections. -.IP -Compare unconnected signals. -.LP -If an error occurs during first or second step, a message is -immediately displayed and the third step will not start: -.B lvx -cannot compare connections (signals) if terminals -or instances are not equivalent. -.br -The -.B -o -option allows to order connectors if the steps described before have been -reached successfully. -.I Extracted_netlist -is then saved on disk. The file get the name -.I filename2 -suffixed by the value of -.BR MBK_OUT_LO (1) -variable. -.br -Routers add automatically empty feed-through cells. -These cells must not be taken into account in the comparison. -A cell that have the -.I F -attribute in the catalog file ( -.B catal (5) -) is considered as feed-through cell, and are deleted, in memory, from the -net-list where it appears. -.SH OPTIONS -.TP -.B "-a" -Some routers generate layout with several physical connectors for power and -ground ( -.I VDD -or -.I VSS -). -If those connectors are not internally connected, they will have different -indexed names ( -.I VDD1 -, -.I VDD2 -etc...) in the extracted net-list. -It is possible to perform reduction on those power and ground connectors before -comparison, using the -a option. -After reduction, each instance contains only one -.I VDD -connector and one -.I VSS -connector, as the main figure. -.TP -.B "-o" -In this case, -.B lvx -produces a modified net-list (saved with the name -.I filename2 -), which is a copy of net-list 2 with ordered connectors. -Terminals and instance connectors are relisted in the order of the models -in net-list 1. The saved net-list is done with the -.BR MBK_OUT_LO (1) -format, so user has to set this variable before running -.B lvx -\&. -If he does not, default value is used, and net-list 1 could be lost if -filename are identical and input format same as output format. -.br -If -a option is used, then the saved net-list is the reduced net-list with only -one -.I VDD -and one -.I VSS -\&. -.TP -.B "-f" -The two net-lists are flattened to the leaf cells contained in the catalog -file. Usually the extracted net-list is a flatten net-list, while the logical -one can be a hierarchical net-list. -.SH EXAMPLES -With -.I logical_netlist -named amd2901.vst and the corresponding -.I extracted_netlist -as amd2901.al containing multiple power connectors, the command line is : -.br -.IP -.B lvx -vst al amd2901 amd2901 -a -.br -.LP -.SH OUTPUT FILES -.TP 20 -\fIfilename2\fP.\f4xx\fP -Netlist view saved when the \fB-o\fP option is present. The suffixe depend on -the \f4MBK_OUT_LO\fP(1) environment variable. -.SH ENVIRONMENT VARIABLES -.TP 20 -\f4MBK_CATA_LIB\fR -contains the directories where the cell librtaries are. -\f4MBK_WORK_LIB\fR -contains the directory path of the working directory, usually set to -\f4.\fR (dot). -.TP -\f4MBK_OUT_LO\fR -contains the expected format of the netlist output. -.TP -\f4MBK_CATAL_NAME\fR -contains the name of the user cell catalog. -.SH SEE ALSO -.BR lynx (1), -.BR MBK_OUT_LO (1), -.BR MBK_WORK_LIB (1), -.BR MBK_CATA_LIB (1), -.BR MBK_CATAL_NAME (1), -.BR catal (5) -\&. -.SH DIAGNOSTICS -The string "_logic" is appended to the net-list 1 and the string "_extract", is -appended to the net-list 2. -.LP -Two kinds of error message can occur: -.IP -A fatal error causes the program to exit. -It happens when one of the net-lists is not correct, -.B lvx -cannot construct internal structure for compare. -.IP -A compare error occurs when the figures are not identical. -It happens when basic objects (instances, connectors) do not exist in both -net-list, or when connections (signals) do not connect same terminals or -instances in the two net-lists. -.LP -Exit code 0 is returned for identical net-lists. - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/lvx/src/Makefile.am b/alliance/src/lvx/src/Makefile.am deleted file mode 100644 index 211f67eb..00000000 --- a/alliance/src/lvx/src/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -## Process this file with automake to produce Makefile.in -bin_PROGRAMS = lvx - -lvx_LDADD = @LIBS@ \ - -lMlu \ - -lMcl \ - -lMal \ - -lMsl \ - -lMel -lMgl \ - -lMhl \ - -lMvl \ - -lMlo \ - -lMut \ - -lRcn - -lvx_SOURCES = lvx.c diff --git a/alliance/src/lvx/src/lvx.c b/alliance/src/lvx/src/lvx.c deleted file mode 100644 index fdb91639..00000000 --- a/alliance/src/lvx/src/lvx.c +++ /dev/null @@ -1,1823 +0,0 @@ -/* - * 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. - */ - -#ident "@(#)Gate Netlist Comparator" - -/****************************************************************************/ -/* 2.14 : Ressort avec un exit 1 si erreur mbk au chargement */ -/****************************************************************************/ - -/****************************************************************************/ -/* */ -/* ALLIANCE VLSI CAD LVX */ -/* */ -/* Tool : LVX (Netlist Comparator) */ -/* */ -/* (c) copyright 1992 Laboratory UPMC/MASI/CAO-VLSI */ -/* All rights reserved */ -/* Support : e-mail cao-vlsi@masi.ibp.fr */ -/* */ -/* Author : Francois NACABAL October, 1st 1992 */ -/* */ -/****************************************************************************/ -/* $Log: lvx.c,v $ -/* Revision 1.1 2002/03/20 17:07:59 xtof -/* Initial revision -/* -/* Revision 1.2 2000/10/23 16:33:37 syf -/* Big bug dans LVX (a se demander comment ca a pu marcher un jour ...) -/* -/* Revision 1.1.1.1 1998/10/02 15:25:15 alliance -/* Imported by czo -/* - * Revision 2.23 1994/01/19 14:57:20 lvx - * Now the -f option will not print invalid parameter - * - * Revision 2.22 1993/10/03 16:11:11 lvx - * The revision of Alliance is given in the Makefile with ALC define - * - * Revision 2.21 1993/09/08 21:15:48 lvx - * The alliancebanner() is now used. - * - * Revision 2.20 1993/09/08 21:04:55 lvx - * Now to flatten a netlist, you have to specify it using the -f option. - * The power supply names are defined by MBK_VDD and MBK_VSS. - * Unconnected signals are checked using their names. - * Tie cells are defined using the attribute F defined in the CATALOG file. - * - * Revision 2.13 1993/01/07 20:44:48 lvx - * The feed-through cells are detected with the attribute put in the catalog - * file. - * - * Revision 2.12 1992/11/27 18:36:58 lvx - * Models are put out of memory after loading. - * Models are put out of memory before orderring. - * - * Revision 2.11 1992/10/12 17:20:39 lvx - * LOCON list has been reversed with reverse() - * Best way should be modify the orderlocon algorithm - * - * Revision 2.10 1992/10/12 16:31:13 lvx - * The function orderlocon() has been modified to bug fixing - * - */ - -static char rcsid[] = "$Id: lvx.c,v 1.1 2002/03/20 17:07:59 xtof Exp $" ; - -#include -#include -#include -#include -#include - -#define TRUE 1 -#define FALSE 0 - -/* Marks in trees for compare functions */ -#define NET1 1 -#define NET2 2 -#define BOTH 3 - -/* Error codes */ -#define OK 0 -#define ERR 1 /* irregular netlist or comparison failed */ - -/*****************************************************************************/ -/*********** STRUCTURES DEFINITIONS ****************************************/ -/*****************************************************************************/ - -/* Binary Tree of terminals (root connectors) */ - -typedef struct rootlocon_node { - struct locon *LOCON; - unsigned char MARK; - struct rootlocon_node *LEFT; - struct rootlocon_node *RIGHT; - } rootlocon_tree; - - -/* Binary Tree of instances */ - -typedef struct loins_node { - struct loins *LOINS; - unsigned char MARK; - struct loins_node *LEFT; - struct loins_node *RIGHT; - } loins_tree; - - -/* Binary Tree of all connectors */ - -typedef struct locon_node { - struct locon *LOCON1; - struct locon *LOCON2; - struct locon_node *LEFT; - struct locon_node *RIGHT; - } locon_tree; - - -/*****************************************************************************/ -/******* GLOBAL VARIABLES **************************************************/ -/*****************************************************************************/ - -rootlocon_tree *rootlocon_head = NULL; /* Head of the Tree of terminals */ -loins_tree *loins_head = NULL; /* Head of the Tree of instances */ -locon_tree *locon_head = NULL; /* Head of the Tree of all connectors */ - -int rootlocon_count = 0; -int loins_count = 0; -int locon_count = 0; -int power_count = 0; -int error_count = 0; - -long int power_time; -long int rootlocon_time; -long int loins_time; -long int locon_time; -long int total_time; - -int unusig_flag = FALSE; -int exitcode = 2; - -/*****************************************************************************/ -/******* FUNCTIONS *********************************************************/ -/*****************************************************************************/ - -/*===========================================================================*/ - fatalerror (message) -/*===========================================================================*/ -char *message; - -/* Prints a error message, and EXIT with error code. -*/ -{ - (void)fprintf (stderr, "\n!!!!! %s", message); - (void)fprintf (stderr, " - Stop.\n\n"); - - exit (2); -} - - -/*===========================================================================*/ - rootlocon_tree *createrootlocon (ptlocon, mark) -/*===========================================================================*/ -locon_list *ptlocon; -unsigned char mark; - -/* Allocates a block in memory for a terminal node. - Never returns NULL, stop if impossible. -*/ -{ - rootlocon_tree *ptnode; - - if (ptlocon == (locon_list *)NULL) - fatalerror ("Fatal error on tree construction. (createrootlocon)"); - - if ((ptnode = (rootlocon_tree *)malloc (sizeof (rootlocon_tree))) == NULL) - fatalerror ("Fatal error on memory allocation. (createrootlocon)"); - - ptnode->LOCON = ptlocon; - ptnode->MARK = mark; - ptnode->LEFT = ptnode->RIGHT = (rootlocon_tree *)NULL; - - rootlocon_count ++; - if ( (error_count == 0) && ((rootlocon_count&3) == 0) ) - printf ("."); - return ( ptnode ); -} - - -/*===========================================================================*/ - loins_tree *createloins (ptloins, mark) -/*===========================================================================*/ -loins_list *ptloins; -unsigned char mark; - -/* Allocates a block in memory for an instance node. - Never returns NULL, stop if impossible. -*/ -{ - loins_tree *ptnode; - - if (ptloins == (loins_list *)NULL) - fatalerror ("Fatal error on tree construction. (createloins)"); - - if ((ptnode = (loins_tree *)malloc (sizeof (loins_tree))) == NULL) - fatalerror ("Fatal error on memory allocation. (createloins)"); - - ptnode->LOINS = ptloins; - ptnode->MARK = mark; - ptnode->LEFT = ptnode->RIGHT = (loins_tree *)NULL; - - loins_count ++; - if ( (error_count == 0) && ((loins_count&63) == 0) ) - printf ("."); - return ( ptnode ); -} - - -/*===========================================================================*/ - locon_tree *createlocon (ptlocon, mark) -/*===========================================================================*/ -locon_list *ptlocon; -unsigned char mark; - -/* Allocates a block in memory for a connector node. - Never returns NULL, stop if impossible. -*/ -{ - locon_tree *ptnode; - - if (ptlocon == (locon_list *)NULL) - fatalerror ("Fatal error on tree construction. (createlocon)"); - - if ((ptnode = (locon_tree *)malloc (sizeof (locon_tree))) == NULL) - fatalerror ("Fatal error on memory allocation. (createlocon)"); - - switch (mark) { - case NET1 : - ptnode->LOCON1 = ptlocon; - ptnode->LOCON2 = (struct locon *)NULL; - break; - - case NET2 : - ptnode->LOCON1 = (struct locon *)NULL; - ptnode->LOCON2 = ptlocon; - break; - - default : - fatalerror ("Fatal error on tree construction. (createlocon)"); - } - ptnode->LEFT = ptnode->RIGHT = (locon_tree *)NULL; - - locon_count ++; - if ( (error_count == 0) && ((locon_count&63) == 0)) - printf ("."); - return ( ptnode ); -} - - -/*===========================================================================*/ - int loinscmp (loins1, loins2) -/*===========================================================================*/ -loins_list *loins1, *loins2; - -/* Compares the two names (insname and figname) of the instances loins1 and - loins2. - Returns 0 if equal, 1 if less, and 2 if greater. - If insnames are equals, but fignames not, this function returns -1. It's an - error in the netlist(s). -*/ -{ - int result; - - if ( (loins1 == (loins_list *)NULL) || (loins2 == (loins_list *)NULL) ) - fatalerror ("Fatal error on instances compare. (loinscmp)"); - - if ( (result = strcmp (loins1->INSNAME, loins2->INSNAME)) != 0) - return ( (result < 0) ? 1 : 2 ); - - return ( (loins1->FIGNAME == loins2->FIGNAME) ? 0 : -1 ); - -} - - -/*===========================================================================*/ - int loconcmp (locon, ptnode) -/*===========================================================================*/ -locon_list *locon; -locon_tree *ptnode; -/* - Compares the name of the connector pointed by 'locon' with the name of - the connector pointed by one of LOCON1 and LOCON2 fields in the 'ptnode'. - Returns 0 if equal, 1 if less, and 2 if greater. - Returns -1 on error ( pointer to NULL or irregular instances ). -*/ -{ - locon_list *ptaux; - int result1, result2; - - if ( (locon == (locon_list *)NULL) || (ptnode == (locon_tree *)NULL) ) - return ( -1 ); - - /* find the first locon pointed by the node */ - if (ptnode->LOCON1 != NULL) ptaux = ptnode->LOCON1; - else if (ptnode->LOCON2 != NULL) ptaux = ptnode->LOCON2; - else return ( -1 ); - - /* if names different, return less or greater */ - if ( (result1 = strcmp (locon->NAME, ptaux->NAME)) != 0 ) - return ( (result1 < 0) ? 1 : 2 ); - - /* same names */ - /* if both terminals, return equal */ - if ( (locon->TYPE == EXTERNAL) && (ptaux->TYPE == EXTERNAL) ) return ( 0 ); - - /* if both internal, compare instance names and return that result */ - if ( (locon->TYPE == INTERNAL) && (ptaux->TYPE == INTERNAL) ) - return ( loinscmp (locon->ROOT, ptaux->ROOT) ); - - /* if only one is terminal, return it as greater */ - return ( (locon->TYPE == INTERNAL) ? 1 : 2 ); -} - - -/*===========================================================================*/ - int insertrootlocon (locon, mark) -/*===========================================================================*/ -locon_list *locon; -unsigned char mark; - -/* Inserts the connector pointed by 'locon' with his 'mark' in the Binary - Tree of root connectors, beginning with the 'rootlocon_head' global pointer. - Returns ERR if error on insertion, OK else. -*/ -{ - rootlocon_tree *prev_node, *ptnode, *ptaux; - unsigned char prev_mark; - int compar; - - if (locon == (locon_list *)NULL) - fatalerror ("Fatal error on tree construction. (insertrootlocon)"); - - if (rootlocon_head == NULL) { - rootlocon_head = createrootlocon (locon, mark); - return ( OK ); - } - - ptnode = rootlocon_head; - while ( (ptnode != NULL) && (locon->NAME != ptnode->LOCON->NAME) ) { - prev_node = ptnode; - ptnode = (compar = strcmp(locon->NAME, ptnode->LOCON->NAME)) < 0 ? - ptnode->LEFT : - ptnode->RIGHT; - } - - if (ptnode == NULL) { - ptaux = createrootlocon (locon, mark); - if (compar < 0) prev_node->LEFT = ptaux; - else prev_node->RIGHT = ptaux; - return ( OK ); - } - - prev_mark = ptnode->MARK; - if ( (prev_mark == BOTH) || (prev_mark == mark)) { - /* Error: two connectors with the same name in the same figure */ - error_count ++; - printf ("\n\nTerminal '%s' repeated in the netlist %i.", locon->NAME, mark); - return ( ERR ); - } - - if ( (prev_mark + mark) != (NET1 + NET2) ) - fatalerror ("Fatal error on tree construction. (insertrootlocon)"); - - ptnode->MARK = BOTH; - return ( OK ); -} - - -/*===========================================================================*/ - int insertloins (loins, mark) -/*===========================================================================*/ -loins_list *loins; -unsigned char mark; - -/* Inserts the instance pointed by 'loins' with his 'mark' in the Binary - Tree of instances, beginning with the 'loins_head' global pointer. - Returns ERR if error on insertion, OK else. -*/ -{ - loins_tree *prev_node, *ptnode, *ptaux; - unsigned char prev_mark; - int prev_compar, compar; - - if (loins == (loins_list *)NULL) - fatalerror ("Fatal error on tree construction. (insertloins)"); - - if (loins_head == NULL) { - loins_head = createloins (loins, mark); - return ( OK ); - } - - ptnode = loins_head; - while ( (ptnode != NULL) && ((compar=loinscmp (loins, ptnode->LOINS))>0) ) { - prev_node = ptnode; - prev_compar = compar; - ptnode = (compar == 1) ? ptnode->LEFT : ptnode->RIGHT; - } - - if (ptnode == NULL) { - if (prev_compar <= 0) - fatalerror ("Fatal error on tree construction. (insertloins)"); - - ptaux = createloins (loins, mark); - if (prev_compar == 1) prev_node->LEFT = ptaux; - else prev_node->RIGHT = ptaux; - return ( OK ); - } - - prev_mark = ptnode->MARK; - if (compar == -1) { /* two instances with same insname, but fignames differents */ - if (prev_mark == mark) { /* the two instances are in the same figure */ - error_count ++; - printf ("\n\nInstance '%s' repeated with different fignames in netlist %i:", - loins->INSNAME, mark); - printf ("'%s' and '%s'.", loins->FIGNAME, ptnode->LOINS->FIGNAME); - } - - else { /* one instance in each netlist */ - error_count ++; - printf ("\n\nInstance '%s' has different fignames in each netlist :", - loins->INSNAME); - if (mark == NET1) printf ("\n'%s' in netlist 1 and '%s' in netlist 2.", - loins->FIGNAME, ptnode->LOINS->FIGNAME); - else printf ("\n'%s' in netlist 1 and '%s' in netlist 2.", - ptnode->LOINS->FIGNAME, loins->FIGNAME); - } /* endelse prev_mark */ - return ( ERR ); - } /* endif compar */ - - if ( (prev_mark == BOTH) || (prev_mark == mark) ) { - /* Error : two instances with the same names (insname and figname) in the - same figure */ - error_count ++; - printf ("\n\nInstance '%s' repeated in the netlist %i.", loins->INSNAME, mark); - return ( ERR ); - } - - if ( (prev_mark + mark) != (NET1 + NET2) ) - fatalerror ("Fatal error on tree construction. (insertloins)"); - - ptnode->MARK = BOTH; - return ( OK ); -} - - -/*===========================================================================*/ - int insertlocon (locon, mark) -/*===========================================================================*/ -locon_list *locon; -unsigned char mark; - -/* Inserts the connector pointed by 'locon' in the Binary Tree of connectors, - beginning with the 'locon_head' global pointer. - Returns ERR if error on insertion, OK else. -*/ -{ - locon_tree *prev_node, *ptnode, *ptaux; - int prev_compar, compar; - - if (locon == (locon_list *)NULL) - fatalerror ("Fatal error on tree construction. (insertlocon)"); - - if (locon_head == NULL) { - locon_head = createlocon (locon, mark); - return ( OK ); - } - - ptnode = locon_head; - while ( (ptnode != NULL) && ((compar = loconcmp (locon, ptnode)) > 0) ) { - prev_node = ptnode; - prev_compar = compar; - ptnode = (compar == 1) ? ptnode->LEFT : ptnode->RIGHT; - } - - if (ptnode == NULL) { /* terminal node in the tree */ - ptaux = createlocon (locon, mark); - if (prev_compar == 1) prev_node->LEFT = ptaux; - else prev_node->RIGHT = ptaux; - return ( OK ); - } - - if (compar != 0) fatalerror ("Fatal error on tree construction. (insertlocon)"); - - switch (mark) { /* insert new locon in the current node */ - case NET1 : - if (ptnode->LOCON1 != NULL) { - /* Error : two connectors with the same name in the same figure */ - error_count ++; - printf("\n\nConnector '%s' repeated in the netlist 1.",locon->NAME); - return ( ERR ); - } - ptnode->LOCON1 = locon; - return ( OK ); - - case NET2 : - if (ptnode->LOCON2 != NULL) { - /* Error : two connectors with the same name in the same figure */ - error_count ++; - printf("\n\nConnector '%s' repeated in the netlist 2.",locon->NAME); - return ( ERR ); - } - ptnode->LOCON2 = locon; - return ( OK ); - } - - fatalerror ("Fatal error on tree construction. (insertlocon)"); -} - - -/*===========================================================================*/ - int makerootconnectors (lofig, mark) -/*===========================================================================*/ -lofig_list *lofig; -unsigned char mark; - -/* Constructs (creates or appends) the Binary Tree of root connectors of the - 'lofig' figure, with the 'mark' (NET1 or NET2), beginning with the - 'rootlocon_head' global pointer. - Returns ERR if one of the terminals is irregular, OK else. -*/ -{ - locon_list *ptlocon; - int result = OK; - - if (lofig == (struct lofig *)NULL) { - error_count ++; - printf ("\n\nNetlist %i is empty!\n", mark); - return ( ERR ); - } - - for (ptlocon = lofig->LOCON; ptlocon != NULL; ptlocon = ptlocon->NEXT) - result |= insertrootlocon (ptlocon, mark); - - return ( result ); -} - - -/*===========================================================================*/ - int makeinstances (lofig, mark) -/*===========================================================================*/ -lofig_list *lofig; -unsigned char mark; - -/* Constructs (creates or appends) the Binary Tree of the instances in the - 'lofig' figure, with the 'mark' (NET1 or NET2), beginning with the - 'loins_head' global pointer. - Returns ERR if one of the instances is irregular, OK else. -*/ -{ - loins_list *ptloins; - int result = OK; - - if (lofig == (struct lofig *)NULL) { - error_count ++; - printf ("\n\nNetlist %i is empty!\n", mark); - return ( ERR ); - } - - if (lofig->LOINS == NULL) return ( OK ); - - for (ptloins = lofig->LOINS; ptloins != NULL; ptloins = ptloins->NEXT) - result |= insertloins (ptloins, mark); - - return ( result ); -} - - -/*===========================================================================*/ - int makeconnections (lofig, mark) -/*===========================================================================*/ -lofig_list *lofig; -unsigned char mark; - -/* Constructs (creates or appends) the Binary Tree of all the connectors in the - 'lofig' figure, with the 'mark' (NET1 or NET2), beginning with the - 'locon_head' global pointer. - Returns ERR if one of the connectors is irregular, OK else. -*/ -{ - loins_list *ptloins; - locon_list *ptlocon; - int result = OK; - - if (lofig == (struct lofig*)NULL) { - error_count ++; - printf ("\n\nNetlist %i is empty!\n", mark); - return ( ERR ); - } - - /* terminals */ - for (ptlocon = lofig->LOCON; ptlocon != NULL; ptlocon = ptlocon->NEXT) - result |= insertlocon (ptlocon, mark); - - /* connectors of instances */ - for (ptloins = lofig->LOINS; ptloins != NULL; ptloins = ptloins->NEXT) - for (ptlocon = ptloins->LOCON; ptlocon != NULL; ptlocon = ptlocon->NEXT) - result |= insertlocon (ptlocon, mark); - - return ( result ); -} - - -/*===========================================================================*/ - int checkrootlocontree (ptnode) -/*===========================================================================*/ -rootlocon_tree *ptnode; - -/* check recursively if all the marks of the tree pointed by 'ptnode' are BOTH. - Returns OK if all are BOTH, ERR else. -*/ -{ - int checkleft, checkright; - - if (ptnode == NULL) return ( OK ); - - switch (ptnode->MARK) { - case BOTH : - /* this terminal is present in the two figures, continue */ - checkleft = checkrootlocontree (ptnode->LEFT); - checkright = checkrootlocontree (ptnode->RIGHT); - return ( ((checkleft == OK) && (checkright == OK)) ? OK : ERR ); - - case NET1 : - /* this terminal is not in the figure 2, continue */ - error_count ++; - printf ("\nTerminal '%s' only in netlist 1", ptnode->LOCON->NAME); - checkrootlocontree (ptnode->LEFT); - checkrootlocontree (ptnode->RIGHT); - return ( ERR ); - - case NET2 : - /* this terminal is not in the figure 1, continue */ - error_count ++; - printf ("\nTerminal '%s' only in netlist 2", ptnode->LOCON->NAME); - checkrootlocontree (ptnode->LEFT); - checkrootlocontree (ptnode->RIGHT); - return ( ERR ); - } - - fatalerror ("Fatal error on Terminals Tree checking. (checkrootlocontree)"); -} - - -/*===========================================================================*/ - int checkloinstree (ptnode) -/*===========================================================================*/ -loins_tree *ptnode; - -/* check recursively if all the marks of the tree pointed by 'ptnode' are BOTH. - Returns OK if all are BOTH, ERR else. -*/ -{ - int checkleft, checkright; - - if (ptnode == NULL) return ( OK ); - - switch (ptnode->MARK) { - case BOTH : - /* this instance is present in the two figures, continue */ - checkleft = checkloinstree (ptnode->LEFT); - checkright = checkloinstree (ptnode->RIGHT); - return ( ((checkleft == OK) && (checkright == OK)) ? OK : ERR ); - - case NET1 : - /* this instance is not in the figure 2, continue */ - error_count ++; - printf ("\nInstance '%s' only in netlist 1", ptnode->LOINS->INSNAME); - checkloinstree (ptnode->LEFT); - checkloinstree (ptnode->RIGHT); - return ( ERR ); - - case NET2 : - /* this instance is not in the figure 1, continue */ - error_count ++; - printf ("\nInstance '%s' only in netlist 2", ptnode->LOINS->INSNAME); - checkloinstree (ptnode->LEFT); - checkloinstree (ptnode->RIGHT); - return ( ERR ); - } - - fatalerror ("Fatal error on Instances Tree checking. (checkloinstree)"); -} - - -/*===========================================================================*/ - mylofigchain (lofig) -/*===========================================================================*/ -lofig_list *lofig; - -/* Same as lofigchain function, but with additionnal error tests about pointers, - and without transistors list. -*/ -{ -locon_list *ptcon = NULL; -losig_list *ptsig = NULL; -loins_list *ptins = NULL; -ptype_list *ptype = NULL; - - if (lofig->MODE != 'A') - fatalerror ("Fatal error on 'mylofigchain': figure is interface only"); - -/* cleaning ... */ - for (ptsig = lofig->LOSIG; ptsig != NULL; ptsig = ptsig->NEXT) { - ptype = getptype (ptsig->USER, (long)LOFIGCHAIN); - if (ptype != (ptype_list *)NULL) { - freechain ((chain_list *)ptype->DATA); - ptype->DATA = (void *)NULL; - } - else ptsig->USER = addptype (ptsig->USER, (long)LOFIGCHAIN, (void *)NULL); - } - -/* scan connector list */ - for (ptcon = lofig->LOCON; ptcon != NULL; ptcon = ptcon->NEXT) { - ptsig = ptcon->SIG; - if ( (ptype = getptype (ptsig->USER, (long)LOFIGCHAIN)) == NULL ) { - (void)fprintf (stderr, "\nInvalid signal on terminal %s (%s)", - ptcon->NAME, lofig->NAME); - fatalerror ("Fatal error on 'mylofigchain'"); - } - ptype->DATA = (void *)addchain ((chain_list *)ptype->DATA, (void*)ptcon); - } - -/* scan instance list */ - for (ptins = lofig->LOINS; ptins != NULL; ptins = ptins->NEXT) - for (ptcon = ptins->LOCON; ptcon != NULL; ptcon = ptcon->NEXT) { - ptsig = ptcon->SIG; - if ( (ptype = getptype (ptsig->USER, (long)LOFIGCHAIN)) == NULL ) { - (void)fprintf (stderr, "\nInvalid signal on connector %s of %s (%s)", - ptcon->NAME, ptins->INSNAME, lofig->NAME); - fatalerror ("Fatal error on 'mylofigchain'"); - } - ptype->DATA = (void *)addchain ((chain_list *)ptype->DATA,(void *)ptcon); - } /* endfor ptcon */ -} - - -/*===========================================================================*/ - locon_list *findlocon (locon, mark) -/*===========================================================================*/ -locon_list *locon; -unsigned char mark; - -/* Searchs in the Tree of all connectors the node corresponding to the 'locon', - and returns the pointer to the locon in the opposite figure. 'mark' is the - mark of the figure for the given locon. - Returns NULL if not found. -*/ -{ - locon_tree *ptnode; - int compar; - - ptnode = locon_head; - - while ( (ptnode != NULL) && ((compar = loconcmp (locon, ptnode)) > 0) ) - ptnode = (compar == 1) ? ptnode->LEFT : ptnode->RIGHT; - - /* not found */ - if ( ptnode == NULL ) return ( (locon_list *)NULL ); - - /* error on tree scanning */ - if (compar != 0) fatalerror ("Fatal error on tree construction. (findlocon)"); - - /* return opposite locon */ - return ( (mark == NET1) ? ptnode->LOCON2 : ptnode->LOCON1 ); -} - - -/*===========================================================================*/ - char *findrootname (locon) -/*===========================================================================*/ -locon_list *locon; - -/* Returns a char pointer to the name of the object it belongs to. - If 'locon' is INTERNAL, returns INSNAME of instance, - if 'locon' is EXTERNAL, returns NAME of figure, - else fatal error. -*/ -{ - switch (locon->TYPE) { - case INTERNAL : - return ( ((loins_list *)(locon->ROOT))->INSNAME ); - case EXTERNAL : - return ( ((lofig_list *)(locon->ROOT))->NAME ); - } - - fatalerror ("Fatal error on mbk structure: Illegal connector"); -} - - -/*===========================================================================*/ - int checkconnections (lofig, mark) -/*===========================================================================*/ -lofig_list *lofig; -unsigned char mark; - -/* - Checks that all the signals in the figure 'lofig' have same connectors in the - opposite figure. - Two types of error: - - the structure is not correct (invalid or inexistent pointers, bad lofigchain), - Stop on fatal error. - - the netlists are not identical (different signals in each netlist for one - connector, inexistent signal or connector), set the 'result' flag to ERR but - continue to find other errors, or other connectors for the same error. -*/ -{ - losig_list *ptlosig; - long int losig_count = 0; - int result = OK; - - if (lofig == (struct lofig *)NULL) { - error_count ++; - printf ("\n\nNetlist %i is empty!\n", mark); - return ( ERR ); - } - for (ptlosig = lofig->LOSIG; ptlosig != NULL; ptlosig = ptlosig->NEXT) { - ptype_list *ptype; - chain_list *ptchain; - locon_list *firstlocon, *ptlocon, *firstopplocon, *ptopplocon; - losig_list *ptequip; - - if ( (error_count == 0) && ((losig_count&63) == 0) ) { - printf ("."); - losig_count++; - } - ptype = getptype (ptlosig->USER, (long)LOFIGCHAIN); - if (ptype == NULL) { - (void)fprintf (stderr, - "\n\nInvalid ptype pointer for signal %s in netlist %i", - getsigname(ptlosig), mark); - fatalerror ("Fatal error on 'checkconnections'"); - } -/* - ptchain = (chain_list *)(ptype->DATA); - if (ptchain == NULL) { - (void)fprintf (stderr, "\n\nInvalid signal %s on netlist %i", - getsigname(ptlosig), mark); - fatalerror ("Fatal error on 'checkconnections'"); - } -*/ -/* - ptchain = (chain_list *)(ptype->DATA); - if (ptchain == NULL) { - if (strcmp(getsigname(ptlosig),"bulk")!=0) printf ("\nWarning: Signal %s without connector on netlist %i\n", - getsigname(ptlosig), mark); - continue; - } -*/ - ptchain = (chain_list *)(ptype->DATA); - if (ptchain == NULL) { - unusig_flag = TRUE; - continue; - } - - firstlocon = (locon_list *)(ptchain->DATA); - /* find equivalent locon in opposite figure */ - firstopplocon = findlocon ( firstlocon, mark); - if (firstopplocon == NULL) { - error_count ++; - printf ("\n\nConnector %s of '%s' (signal %s) in netlist %i", - firstlocon->NAME, findrootname (firstlocon), - getsigname(ptlosig), mark); - printf (" NOT found in netlist %i", (NET1+NET2-mark)); - result = ERR; - continue; - } - - /* read signal of opposite locon */ - ptequip = firstopplocon->SIG; - if (ptequip == NULL) { - error_count ++; - printf ("\nConnector '%s' without signal in netlist %i", - firstopplocon->NAME, (NET1+NET2-mark)); - result = ERR; - continue; - } - - /* for all other connectors of same signal : find it in opposite */ - for (ptchain = ptchain->NEXT; ptchain != NULL; ptchain = ptchain->NEXT) { - losig_list *ptsigfound; - - ptlocon = (locon_list *)(ptchain->DATA); - ptopplocon = findlocon ( ptlocon, mark); - if (ptopplocon == NULL) { - error_count ++; - printf ("\n\nConnector %s of '%s' (signal %s) in netlist %i", - ptlocon->NAME, findrootname (ptlocon), - getsigname(ptlosig), mark); - printf (" NOT found in netlist %i", (NET1+NET2-mark)); - result = ERR; - continue; - } - ptsigfound = ptopplocon->SIG; - if (ptsigfound == NULL) { - error_count ++; - printf ("\n\nConnector '%s' without signal in netlist %i", - ptopplocon->NAME, mark); - result = ERR; - } - else if (ptopplocon->SIG != ptequip) { - if (mark == NET1) { - error_count ++; - printf ("\n\n%s of '%s' is NOT connected to %s of '%s' in netlist 2", - ptopplocon->NAME, findrootname(ptopplocon), - firstopplocon->NAME, findrootname(firstopplocon)); - printf ("\nthrough signal %s but to signal %s", - getsigname(ptequip), getsigname(ptopplocon->SIG)); - } - else { /* short circuit */ - error_count ++; - printf ("\n\n%s of '%s' IS connected to %s of '%s' in netlist 2", - ptopplocon->NAME, findrootname(ptopplocon), - firstopplocon->NAME, findrootname(firstopplocon)); - printf ("\nthrough signal %s", - getsigname(firstlocon->SIG)); - } - result = ERR; - } /* endelse ptsigfound */ - } /* endfor ptchain */ - } /* endfor ptlosig */ - - return ( result ); -} - - -/*===========================================================================*/ - int comparerootconnectors (lofig1, lofig2) -/*===========================================================================*/ -lofig_list *lofig1, *lofig2; - -/* Calls the tree-construction and checking functions. - Returns OK if terminals are equivalent, ERR else. -*/ -{ - rootlocon_tree *ptnode; - int result; - - rootlocon_time = time( (long *)0 ); - - if ( makerootconnectors (lofig1, NET1) != OK ) return ( ERR ); - if ( makerootconnectors (lofig2, NET2) != OK ) return ( ERR ); - - result = checkrootlocontree (rootlocon_head); - - rootlocon_time = time( (long *)0 ) - rootlocon_time; - return ( result ); -} - - -/*===========================================================================*/ - int compareinstances (lofig1, lofig2) -/*===========================================================================*/ -lofig_list *lofig1, *lofig2; - -/* Calls the tree-construction and checking functions. - Returns OK if instances are equivalent, ERR else. -*/ -{ - int result; - - loins_time = time( (long *)0 ); - - if ( makeinstances (lofig1, NET1) != OK ) return ( ERR ); - if ( makeinstances (lofig2, NET2) != OK ) return ( ERR ); - - result = checkloinstree (loins_head); - - loins_time = time( (long *)0 ) - loins_time; - return ( result ); -} - - -/*===========================================================================*/ - int compareconnections (lofig1, lofig2) -/*===========================================================================*/ -lofig_list *lofig1, *lofig2; - -/* Constructs the Binary Tree of all connectors in the figure, and check that - all signals are connected to the same connectors in the two figures. - Returns OK if equivalent, ERR else. -*/ -{ - int result1, result2; - - locon_time = time( (long *)0 ); - - result1 = makeconnections (lofig1, NET1); - result2 = makeconnections (lofig2, NET2); - - if ( (result1 != OK) || (result2 != OK) ) return ( ERR ); - - mylofigchain ( lofig1 ); - mylofigchain ( lofig2 ); - - result1 = checkconnections (lofig1, NET1); - result2 = checkconnections (lofig2, NET2); - - locon_time = time( (long *)0 ) - locon_time; - return ( ((result1 == OK) && (result2 == OK)) ? OK : ERR ); -} - - -/*===========================================================================*/ - int compareunusedsignals (lofig1, lofig2) -/*===========================================================================*/ -lofig_list *lofig1, *lofig2; - -/* -*/ -{ - losig_list *ptlosig; - int result = OK; - - if (lofig1 == (struct lofig *)NULL) { - error_count ++; - printf ("\n\nNetlist 1 is empty!\n"); - return ( ERR ); - } - if (lofig2 == (struct lofig *)NULL) { - error_count ++; - printf ("\n\nNetlist 2 is empty!\n"); - return ( ERR ); - } - - for (ptlosig = lofig1->LOSIG; ptlosig != NULL; ptlosig = ptlosig->NEXT) { - ptype_list *ptype; - chain_list *ptchain; - losig_list *opplosig; - - ptype = getptype (ptlosig->USER, (long)LOFIGCHAIN); - if (ptype == NULL) { - (void)fprintf (stderr, - "\n\nInvalid ptype pointer for signal %s in netlist 1", - getsigname(ptlosig)); - fatalerror ("Fatal error on 'checkunusedsignals'"); - } - - ptchain = (chain_list *)(ptype->DATA); - if (ptchain == NULL) { - char *signame; - int found = FALSE; - - signame = getsigname(ptlosig); - - for (opplosig = lofig2->LOSIG; opplosig != NULL; opplosig = opplosig->NEXT) - if (getsigname(opplosig) == signame) found = TRUE; - if (found == FALSE) { - error_count ++; - printf ("\n\nNever assigned signal %s in netlist 1", - signame); - printf (" NOT found in netlist 2"); - result = ERR; - } - else - if (strcmp(signame,"bulk")!=0) - printf ("\nWarning: Never assigned signal %s in the 2 netlists\n", signame); - - } - } - - return ( result ); -} - - -/*===========================================================================*/ - int comparelofigs (lofig1, lofig2) -/*===========================================================================*/ -lofig_list *lofig1, *lofig2; - -/* Compare two logical figures (three phases if necessary). - Returns OK if the netlists are equivalent, ERR else. -*/ -{ - int result1, result2, result3, result4; - - if (lofig1 == (struct lofig *)NULL) { - error_count ++; - printf ("\n\nNetlist 1 is empty!\n"); - return ( ERR ); - } - if (lofig2 == (struct lofig *)NULL) { - error_count ++; - printf ("\n\nNetlist 2 is empty!\n"); - return ( ERR ); - } - - printf ("\n\n\n***** Compare Terminals .........."); - if ((result1 = comparerootconnectors (lofig1, lofig2)) == OK) - printf ("\n***** O.K.\t(%lu sec)", rootlocon_time); - - printf ("\n\n***** Compare Instances .........."); - if ((result2 = compareinstances (lofig1, lofig2)) == OK) - printf ("\n***** O.K.\t(%lu sec)", loins_time); - - if ((result1 != OK) || (result2 != OK)) return ( ERR ); - - printf ("\n\n***** Compare Connections ........"); - if ((result3 = compareconnections (lofig1, lofig2)) == OK) - printf ("\n***** O.K.\t(%lu sec)", locon_time); - - if (unusig_flag == TRUE) { - printf ("\n\n***** Compare Connectionless signals ........"); - if ((result4 = compareunusedsignals (lofig1, lofig2)) == OK) - printf ("\n***** O.K."); - } - else result4 = OK; - - printf ("\n\n===== Terminals .......... %-6lu\n", rootlocon_count); - printf ( "===== Instances .......... %-6lu\n", loins_count); - printf ( "===== Connectors ......... %-6lu\n", locon_count); - if (error_count) printf ( "\n===== Errors ............. %i\n", error_count); - - if ( (result3 == OK) && (result4 == OK)) return ( OK ); - else return ( ERR ); - } - - -/*===========================================================================*/ -void equivterminal (lofig, name1, name2, delete) -/*===========================================================================*/ -lofig_list *lofig; -char *name1, *name2; -int delete; - -/* Reduces the first (normally single) terminal called 'name1' to 'name2'. - All the connectors connected to terminal 'name1' are now connected to the - first 'name2' (could be internal or external, priority to external). - Stops if impossible, and returns (without error code) if OK. -*/ -{ - loins_list *ptloins; - locon_list *ptlocon, *ptaux; - locon_list *reflocon = NULL; - losig_list *oldlosig, *reflosig; - int found = FALSE; - - if (lofig == NULL) fatalerror ("Invalid figure. (equivterminal)"); - if ( (name1 == NULL) || (name2 == NULL) ) - fatalerror ("Invalid connector name. (equivterminal)"); - - name1 = namealloc (name1); - name2 = namealloc (name2); -/* Search name2 in terminals */ - for (ptlocon = lofig->LOCON; ptlocon != NULL; ptlocon = ptlocon->NEXT) - if (ptlocon->NAME == name2) break; - - reflocon = ptlocon; - if (reflocon == NULL) { /* Search name2 in internal connectors */ - for (ptloins = lofig->LOINS; (ptloins != NULL) && (found != TRUE); - ptloins = ptloins->NEXT) - for (ptlocon = ptloins->LOCON; (ptlocon != NULL) && (found != TRUE); - ptlocon = ptlocon->NEXT) - if (ptlocon->NAME == name2) { - found = TRUE; - reflocon = ptlocon; - } - } - - if (reflocon == NULL) { - (void)fprintf (stderr, "\n\nConnector %s NOT found in %s", name2, lofig->NAME); - fatalerror ("Fatal error in 'equivterminal'"); - } - - reflosig = reflocon->SIG; - if (reflosig == NULL) { - (void)fprintf (stderr, "\n\nInvalid signal for connector %s in %s", - reflocon->NAME, lofig->NAME); - fatalerror ("Fatal error in 'equivterminal'"); - } - -/* Search and reduce name1 in terminals */ - for (ptlocon = lofig->LOCON; ptlocon != NULL; ptlocon = ptlocon->NEXT) - if (ptlocon->NAME == name1) { /* found name1 */ - oldlosig = ptlocon->SIG; - if (oldlosig == NULL) { - (void)fprintf (stderr, "\n\nInvalid signal for connector %s in %s", - ptlocon->NAME, lofig->NAME); - fatalerror ("Fatal error in 'equivterminal'"); - } - /* branch all the connectors connected to name1 to name2 (ref) */ - for (ptaux = lofig->LOCON; ptaux != NULL; ptaux = ptaux->NEXT) - if ((ptaux != ptlocon)&&(ptaux->SIG == oldlosig)) ptaux->SIG = reflosig; - - for (ptloins = lofig->LOINS; ptloins != NULL; ptloins = ptloins->NEXT) - for (ptaux = ptloins->LOCON; ptaux != NULL; ptaux = ptaux->NEXT) - if ((ptaux != ptlocon)&&(ptaux->SIG == oldlosig)) ptaux->SIG = reflosig; - - if (oldlosig != reflosig) - if (dellosig (lofig, oldlosig->INDEX) != 1) - fatalerror ("Fatal error on signal deleting. (equivterminal)"); - - if (delete) - { - if (dellocon (lofig, name1) != 1) - fatalerror ("Fatal error on connector deleting. (equivterminal)"); - } - - break; - } -} - - -/*===========================================================================*/ -void equivinslocon (lofig, loins, name1, name2) -/*===========================================================================*/ -lofig_list *lofig; -loins_list *loins; -char *name1, *name2; - -/* Reduces the first connector called 'name1' to 'name2'. - All the connectors connected to 'name1' are now connected to 'name2', in the - instance pointed by 'loins'. - Stops if impossible, and returns (without error code) if OK. -*/ -{ - loins_list *ptloins; - locon_list *ptlocon, *ptaux, *prevlocon; - locon_list *reflocon = NULL; - losig_list *oldlosig, *reflosig; - int found = FALSE; - - if (lofig == NULL) fatalerror ("Invalid figure. (equivinslocon)"); - if (loins == NULL) fatalerror ("Invalid instance. (equivinslocon)"); - if ( (name1 == NULL) || (name2 == NULL) ) - fatalerror ("Invalid connector name. (equivinslocon)"); - - name1 = namealloc (name1); - name2 = namealloc (name2); -/* Search name2 */ - for (ptlocon = loins->LOCON; ptlocon != NULL; ptlocon = ptlocon->NEXT) - if (ptlocon->NAME == name2) break; - - reflocon = ptlocon; - if (reflocon == NULL) { - (void)fprintf (stderr, "\n\nConnector %s NOT found in %s of %s", - name2, loins->INSNAME, lofig->NAME); - fatalerror ("Fatal error in 'equivinslocon'"); - } - - reflosig = reflocon->SIG; - if (reflosig == NULL) { - (void)fprintf (stderr, "\n\nInvalid signal for connector %s in %s of %s", - reflocon->NAME, loins->INSNAME, lofig->NAME); - fatalerror ("Fatal error in 'equivinslocon'"); - } - -/* Search and reduce name1 */ - prevlocon = NULL; - for (ptlocon = loins->LOCON; ptlocon != NULL; prevlocon = ptlocon, - ptlocon = ptlocon->NEXT) - if (ptlocon->NAME == name1) { /* found name1 */ - oldlosig = ptlocon->SIG; - if (oldlosig == NULL) { - (void)fprintf (stderr, "\n\nInvalid signal for connector %s in %s", - ptlocon->NAME, loins->INSNAME); - fatalerror ("Fatal error in 'equivinslocon'"); - } - /* branch all the connectors connected to name1 to name2 (ref) */ - for (ptaux = lofig->LOCON; ptaux != NULL; ptaux = ptaux->NEXT) - if ((ptaux != ptlocon)&&(ptaux->SIG == oldlosig)) ptaux->SIG = reflosig; - - for (ptloins = lofig->LOINS; ptloins != NULL; ptloins = ptloins->NEXT) - for (ptaux = ptloins->LOCON; ptaux != NULL; ptaux = ptaux->NEXT) - if ((ptaux != ptlocon)&&(ptaux->SIG == oldlosig)) ptaux->SIG = reflosig; - - if (oldlosig != reflosig) if (dellosig (lofig, oldlosig->INDEX) != 1) - fatalerror ("Fatal error on signal deleting. (equivinslocon)"); - - if (prevlocon == NULL) loins->LOCON = ptlocon->NEXT; - else prevlocon->NEXT = ptlocon->NEXT; - break; - } -} - - -/*=========================================================================== - startid ( lofig, name1, name2) - -lofig_list *lofig; -char *name1, *name2; -{ - locon_list *ptlocon; - - if ( (name1 == NULL) || (name2 == NULL) ) - fatalerror ("Invalid connector name. (startid)"); - - name1 = namealloc (name1); - name2 = namealloc (name2); - if (name1 == name2) return; - for (ptlocon = lofig->LOCON; ptlocon != NULL; ptlocon = ptlocon->NEXT) - if (ptlocon->NAME == name2) ptlocon->NAME = name1; -} -===========================================================================*/ - - -/*===========================================================================*/ - localstartid ( ptlocon, name1, name2) -/*===========================================================================*/ -locon_list *ptlocon; -char *name1, *name2; - -/* All the connectors in the list beginning with 'ptlocon' named by 'name2' - are renamed by 'name1'. -*/ -{ - - if ( (name1 == NULL) || (name2 == NULL) ) - fatalerror ("Invalid connector name. (localstartid)"); - - name1 = namealloc (name1); - name2 = namealloc (name2); - if (name1 == name2) return; - for (; ptlocon != NULL; ptlocon = ptlocon->NEXT) - if (ptlocon->NAME == name2) ptlocon->NAME = name1; -} - - -/*===========================================================================*/ - reducepower (lofig1, lofig2) -/*===========================================================================*/ -lofig_list *lofig1, *lofig2; - -/* Deletes all the connectors (internal or external) beginning with 'vdd' or - 'vss', except one which is renamed by 'vdd' (or 'vss'). - All the connectors in the figure connected to 'vdd*' (or 'vss*') are now - connected to the last 'vdd' (or 'vss'). - Stops on error, returns without error code if OK. -*/ -{ - chain_list *Delete; - chain_list *ScanChain; - locon_list *ptlocon; - locon_list *next_locon; -char *firstvdd; -char *firstvss; - loins_list *ptloins; - - printf ("\n\n***** Reduce Power ..............."); - power_time = time( (long *)0 ); - power_count = 0; - -/* vdd */ - /* instance connectors */ - for (ptloins = lofig1->LOINS; ptloins != NULL; ptloins = ptloins->NEXT) { - power_count ++; - if((power_count&63) == 0 ) printf ("."); - firstvdd = NULL; - for (ptlocon = ptloins->LOCON; ptlocon != NULL; ptlocon = ptlocon->NEXT) { - if (firstvdd == NULL) { - if (isvdd (ptlocon->NAME)) firstvdd = ptlocon->NAME; - continue; - } - if (isvdd (ptlocon->NAME)) - equivinslocon (lofig1, ptloins, ptlocon->NAME, firstvdd); - } - if ( (firstvdd != NULL) && (firstvdd != namealloc (VDD)) ) - localstartid (ptloins->LOCON, VDD, firstvdd); - } - - /* terminals */ - firstvdd = NULL; - Delete = NULL; - for (ptlocon = lofig1->LOCON; ptlocon != NULL; ptlocon = ptlocon->NEXT) { - power_count ++; - if((power_count&63) == 0 ) printf ("."); - if (firstvdd == NULL) { - if ( isvdd (ptlocon->NAME)) firstvdd = ptlocon->NAME; - continue; - } - if (isvdd (ptlocon->NAME)) - { - equivterminal (lofig1, ptlocon->NAME, firstvdd, 0); - Delete = addchain( Delete, ptlocon ); - } - } - - if ( (firstvdd != NULL) && (firstvdd != namealloc (VDD)) ) - localstartid (lofig1->LOCON, VDD, firstvdd); - - for ( ScanChain = Delete; ScanChain != NULL; ScanChain = ScanChain->NEXT ) - { - ptlocon = (locon_list *)ScanChain->DATA; - dellocon( lofig1, ptlocon->NAME ); - } - - freechain( Delete ); - Delete = NULL; - -/* vss */ - /* instance connectors */ - for (ptloins = lofig1->LOINS; ptloins != NULL; ptloins = ptloins->NEXT) { - power_count ++; - if((power_count&63) == 0 ) printf ("."); - firstvss = NULL; - for (ptlocon = ptloins->LOCON; ptlocon != NULL; ptlocon = ptlocon->NEXT) { - if (firstvss == NULL) { - if (isvss (ptlocon->NAME)) firstvss = ptlocon->NAME; - continue; - } - if (isvss (ptlocon->NAME)) - equivinslocon (lofig1, ptloins, ptlocon->NAME, firstvss); - } - if ( (firstvss != NULL) && (firstvss!= namealloc (VSS)) ) - localstartid (ptloins->LOCON, VSS, firstvss); - } - - /* terminals */ - firstvss = NULL; - for (ptlocon = lofig1->LOCON; ptlocon != NULL; ptlocon = ptlocon->NEXT) { - power_count ++; - if((power_count&63) == 0 ) printf ("."); - if (firstvss == NULL) { - if (isvss (ptlocon->NAME)) firstvss = ptlocon->NAME; - continue; - } - if (isvss (ptlocon->NAME)) - { - equivterminal (lofig1, ptlocon->NAME, firstvss, 0); - Delete = addchain( Delete, ptlocon ); - } - } - - if ( (firstvss != NULL) && (firstvss!= namealloc (VSS)) ) - localstartid (lofig1->LOCON, VSS, firstvss); - - for ( ScanChain = Delete; ScanChain != NULL; ScanChain = ScanChain->NEXT ) - { - ptlocon = (locon_list *)ScanChain->DATA; - dellocon( lofig1, ptlocon->NAME ); - } - - freechain( Delete ); - Delete = NULL; - - power_time = time( (long *)0 ) - power_time; - printf ("\n***** O.K. (%lu sec)", power_time); -} - - -/*===========================================================================*/ - locon_list *orderlocon (list1, list2) -/*===========================================================================*/ -locon_list *list1, *list2; - -/* Reorders the connector list 'list2' seeking 'list1'. - Returns the new head of 'list2', or stops if error. -*/ -{ - locon_list *head, *headlist2; - locon_list *reflocon, *ptlocon, *prevlocon; - static long int count; - - if ( (list1 == NULL) || (list2 == NULL) ) - fatalerror ("Invalid connector lists. (orderlocon)"); - - head = NULL ; - headlist2 = list2 ; - for( reflocon = list1 ; reflocon != NULL ; reflocon = reflocon->NEXT ) { - prevlocon = NULL ; - for( ptlocon = headlist2 ; ptlocon != NULL ; ptlocon = ptlocon->NEXT ) { - count ++; - if ((count&63) == 0) printf ("."); - if( ptlocon->NAME == reflocon->NAME ) { - if( headlist2 == ptlocon ) headlist2 = ptlocon->NEXT ; - else prevlocon->NEXT = ptlocon->NEXT ; - ptlocon->NEXT = head ; - head = ptlocon ; - break ; - } - prevlocon = ptlocon ; - } - - if( ptlocon == NULL ) { - (void)fprintf (stderr, "Connector %s of '%s' NOT found in netlist2", - reflocon->NAME, findrootname (reflocon)); - fatalerror ("Fatal error in 'orderlocon'"); - } - } - return ((locon_list *)reverse((chain_list *)head)); -} - - -/*===========================================================================*/ - order (lofig1, lofig2) -/*===========================================================================*/ -lofig_list *lofig1, *lofig2; - -/* Calls orderlocon() function, for terminals and for instances connectors of - lofig2 (referring to model figures). - Stops on fatal error, returns without error code if OK. -*/ -{ - loins_list *ptloins; - long int order_time; - - printf ("***** Orderring ..................."); - - order_time = time( (long *)0 ); - - if (lofig1 == (struct lofig *)NULL) { - (void)fprintf (stderr, "\nNetlist 1 is empty!"); - fatalerror ("Fatal error in 'order'"); - } - if (lofig2 == (struct lofig *)NULL) { - (void)fprintf (stderr, "\nNetlist 2 is empty!"); - fatalerror ("Fatal error in 'order'"); - } - -/* order terminals */ - if ( (lofig2->LOCON = orderlocon (lofig1->LOCON, lofig2->LOCON)) == NULL ) { - (void)fprintf (stderr, "\nCan not order terminals of '%s'", lofig2->NAME); - fatalerror ("Fatal error in 'order'"); - } - -{ struct chain *mchain; - for(mchain=lofig2->MODELCHAIN;mchain!=NULL;mchain=mchain->NEXT) - if(mchain->DATA!=(void *)lofig2->NAME && mchain->DATA!=(void *)lofig1->NAME) - dellofig((char *)mchain->DATA); -} -{ struct chain *mchain; - for(mchain=lofig1->MODELCHAIN;mchain!=NULL;mchain=mchain->NEXT) - if(mchain->DATA!=(void *)lofig2->NAME && mchain->DATA!=(void *)lofig1->NAME) - dellofig((char *)mchain->DATA); -} - -/* order instances connectors */ - for (ptloins = lofig2->LOINS; ptloins != NULL; ptloins = ptloins->NEXT) { - lofig_list *ptmodel; - - if ( (ptmodel = getlofig (ptloins->FIGNAME, 'P'))== NULL ) { - (void)fprintf (stderr, - "\nModel %s NOT found in netlist 1", ptloins->FIGNAME); - fatalerror ("Fatal error in 'order'"); - } - if ((ptloins->LOCON = orderlocon(ptmodel->LOCON,ptloins->LOCON)) == NULL) { - (void)fprintf (stderr, - "\nCan not order connectors of '%s'",ptloins->INSNAME); - fatalerror ("Fatal error in 'order'"); - } - } - - order_time = time( (long *)0 ) - order_time; - printf ("\n***** O.K. (%lu sec)\n\n", order_time); -} - - -/*===========================================================================*/ - lofig_list *loadfigure (format, figname, flag_flatten) -/*===========================================================================*/ -char *format; -char *figname; -int flag_flatten; - -/* Load a figure in memory, and calls rflattenlofig(). - Returns a pointer to the figure, or Stops if error. -*/ -{ - lofig_list *ptlofig; - - if ( (format == NULL) || (figname == NULL) ) return ( NULL ); - - printf ("\n\n***** Loading%s %s (%s)...", - flag_flatten==TRUE?" and flattening":"",figname, format); - strcpy ( IN_LO, format); - ptlofig = getlofig (figname, 'A'); - - if (flag_flatten == TRUE) -/* 92/11/27 - * The rflatten keep the models in memory. First lvx loads an .al and then - * an .alx. The two instance sould not have the same interface, so the - * models must be destroyed of memory. - * - rflattenlofig (ptlofig, 'Y', 'Y'); - */ -{ -lofig_list *ptfig =ptlofig; -char concat='Y'; -char catal='Y'; - -loins_list *p; -chain_list *c; - - catal = catal == NO ? 0 : 1; - for (p = ptfig->LOINS; p != NULL;) { - if (!catal || !incatalog(p->FIGNAME)) { - dellofig(p->FIGNAME); - flattenlofig(ptfig, p->INSNAME, concat); - p = ptfig->LOINS; - } - else - p = p->NEXT; - } - freechain(ptfig->MODELCHAIN); - ptfig->MODELCHAIN = NULL; - p = ptfig->LOINS; - while (p != NULL) { - c = ptfig->MODELCHAIN; - while (c != NULL) { - if ((char *)c->DATA == p->FIGNAME) - break; - c = c->NEXT; - } - if (c == NULL) - ptfig->MODELCHAIN = addchain(ptfig->MODELCHAIN, (void *)p->FIGNAME); - p = p->NEXT; - } -} - - return ( ptlofig ); -} - - -/*===========================================================================*/ - void delfeed (lofig) -/*===========================================================================*/ -lofig_list *lofig; -{ - loins_list *loins, *temploins; - - for (loins = lofig->LOINS; loins != NULL; loins = temploins) { - temploins = loins->NEXT; - if (incatalogfeed(loins->FIGNAME)) - if (delloins (lofig, loins->INSNAME) != 1) - fatalerror ("Fatal error on instance deleting. (delins)"); - } -} - - -/*===========================================================================*/ - void delins (lofig, loinsname) -/*===========================================================================*/ -lofig_list *lofig; -char *loinsname; - -/* Deletes the instance named by 'loinsname' in the figure 'lofig'. - Returns if OK, stops else. -*/ -{ - loins_list *loins, *temploins; - char *ptname; - - ptname = namealloc (loinsname); - for (loins = lofig->LOINS; loins != NULL; loins = temploins) { - temploins = loins->NEXT; - if (loins->FIGNAME == ptname) - if (delloins (lofig, loins->INSNAME) != 1) - fatalerror ("Fatal error on instance deleting. (delins)"); - } -} - - -/*===========================================================================*/ - readparamfile (lofig1, lofig2, filename) -/*===========================================================================*/ -lofig_list *lofig1, *lofig2; -char *filename; - -/* Reads filename and calls 'equivterminal()'. -*/ -{ - FILE *paramfile; - static char locon1[10]; - static char locon2[10]; - static char str[10]; - int netlist; - int code = 3; - - if ((paramfile = fopen (filename, "r")) == NULL) { - (void)fprintf (stderr, "\nCan not open '%s'.\n", filename); - fatalerror ("Fatal error on reading paramfile"); - } - - for (;;) { - code = fscanf (paramfile, "equiv %s %s => %s\n", str, locon1, locon2); - if (code != 3) break; - sscanf ( str, "%i", &netlist); - if ( (netlist != NET1) && (netlist != NET2) ) { - (void)fprintf (stderr, "\nInvalid netlist %s in %s", str, filename); - fatalerror ("Fatal error on reading paramfile"); - } - equivterminal ( (netlist == NET1) ? lofig1 : lofig2, locon1, locon2, 1); - } - - fclose (paramfile); -} - - -/*===========================================================================*/ - presentation () -/*===========================================================================*/ -{ char revision[100] ; - - sscanf( rcsid, "$Id: lvx.c,v %s", revision ) ; - - alliancebanner("LVX",revision,"Gate Netlist Comparator","1992","5.0"); - -} - - -/*****************************************************************************/ - void lvx_exit() -/*****************************************************************************/ -{ - exit (exitcode); -} - -/*****************************************************************************/ - main (argc, argv) -/*****************************************************************************/ -int argc; -char **argv; - -/* Loads figures, calls comparefigures(), orders if demanded. -*/ -{ - static char figname1 [100], figname2 [100]; - lofig_list *lofig1 = NULL, *lofig2 = NULL; - int firstcount = 4, count = 4, flag_flatten = FALSE, flag_ord = FALSE, flag_tie = TRUE; - int result; - - presentation (); - - if (argc < 5) { - printf ("\nUsage : lvx [-a] [-o] [-f]\n"); - printf ( " [-i ] [-t ...]\n\n"); - exit (2); - } - signal (SIGTERM, lvx_exit); - mbkenv (); - - while (++firstcount < argc) { char *option; - option = argv[firstcount]; - if (option[0] == '-') if (option[1] == 'f') flag_flatten = TRUE; - } - - if ( (lofig1 = loadfigure (argv[1], argv[3], flag_flatten)) == NULL ) { - (void)fprintf (stderr, "\n!!!!! Can not load '%s'\n", argv[3]); - fatalerror ("Fatal error on loading figure"); - } - sprintf (figname1, "%s_logic", argv[3]); - lofig1->NAME = namealloc (figname1); - - if ( (lofig2 = loadfigure (argv[2], argv[4], flag_flatten)) == NULL ) { - (void)fprintf (stderr, "\n!!!!! Can not load '%s'\n", argv[4]); - fatalerror ("Fatal error on loading figure"); - } - sprintf (figname2, "%s_extract", argv[4]); - lofig2->NAME = namealloc (figname2); - - total_time = time( (long *)0 ); - while (++count < argc) { char *option; - option = argv[count]; - if (option[0] != '-') { - printf ("\n***** Invalid parameter '%s'\n\n", option); continue; - } - if (option[2] != 0) { - printf ("\n***** Invalid option '%s'\n\n", option); continue; - } - switch (option[1]) { - case 'a' : reducepower(lofig1,lofig2); reducepower(lofig2,lofig1);break; - case 'f' : break; - case 'o' : flag_ord = TRUE; break; - case 'i' : readparamfile (lofig1, lofig2, argv[++count]); break; - case 't' : flag_tie = FALSE; - while ((argv[count+1][0] != '-') && (++count < argc)) { - delins (lofig1, argv[count]); - delins (lofig2, argv[count]); - } - break; - default : printf ("\n***** Invalid option '%s'\n\n", option); continue; - } - } - - delfeed(lofig1);delfeed(lofig2); - - result = comparelofigs (lofig1, lofig2); - total_time = time( (long *)0 ) - total_time; - if (result != OK) { - printf ("\n\n***** Netlists are NOT Identical! *****\t(%lu sec)\n\n", - total_time); - exit (2); - } - printf ("\n\n***** Netlists are Identical. *****\t(%lu sec)\n\n", total_time); - - if (flag_ord) { - strcpy( IN_LO, argv[1] ) ; - order (lofig1, lofig2); - lofig2->NAME = namealloc (argv[4]); - printf ("***** Saving %s (%s)...\n\n", lofig2->NAME, OUT_LO); - savelofig (lofig2); - } - exit ( 0 ); -} diff --git a/alliance/src/s2r/Makefile.am b/alliance/src/s2r/Makefile.am deleted file mode 100644 index ce9d1044..00000000 --- a/alliance/src/s2r/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -## Process this file with automake to produce Makefile.in - -SUBDIRS = doc src diff --git a/alliance/src/s2r/configure.in b/alliance/src/s2r/configure.in deleted file mode 100644 index 8f2165e6..00000000 --- a/alliance/src/s2r/configure.in +++ /dev/null @@ -1,33 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(src/postrat.c) - -S2R_MAJOR_VERSION=4 -S2R_MINOR_VERSION=0 -S2R_VERSION=$S2R_MAJOR_VERSION.$S2R_MINOR_VERSION - -AC_SUBST(S2R_MAJOR_VERSION) -AC_SUBST(S2R_MINOR_VERSION) -AC_SUBST(S2R_VERSION) - -# For automake. -VERSION=$S2R_VERSION -PACKAGE=s2r - -dnl Initialize automake stuff -AM_INIT_AUTOMAKE($PACKAGE, $VERSION) - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_RANLIB -AC_PROG_MAKE_SET - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST - -AM_ALLIANCE - -AC_OUTPUT([ -Makefile -doc/Makefile -src/Makefile -]) diff --git a/alliance/src/s2r/doc/Makefile.am b/alliance/src/s2r/doc/Makefile.am deleted file mode 100644 index 79b4e0f9..00000000 --- a/alliance/src/s2r/doc/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -## Process this file with automake to produce Makefile.in - -man_MANS = s2r.1 -EXTRA_DIST = $(man_MANS) diff --git a/alliance/src/s2r/doc/s2r.1 b/alliance/src/s2r/doc/s2r.1 deleted file mode 100644 index b8537c6b..00000000 --- a/alliance/src/s2r/doc/s2r.1 +++ /dev/null @@ -1,174 +0,0 @@ -.\" $Id: s2r.1,v 1.1 2002/04/09 11:20:14 franck Exp $ -.\" @(#)Labo.l 0.0 90/21/08 UPMC; Author: Fr'ed'eric P'etrot & Franck Wajsburt -.TH S2R 1 "October 1, 1997" "ASIM/LIP6" "ALLIANCE USER COMMANDS" -.SH NAME -.TP -s2r -\- Process mapping from symbolic layout to physical layout -.SH SYNOPSIS -.TP -\fBs2r\fP [\fB-sc1rv\fP] \fIsource\fP [\fIresult\fP] -.so man1/alc_origin.1 -.SH DESCRIPTION -The goal of \fBs2r\fP is to perform the translation from the symbolic layout -to physical layout for the foundry. -\fBs2r\fP uses a technolgy file whose name is defined by the environnement -variable RDS_TECHNO_NAME. -.br -Some cells, like I/O pads, are specific to a given foundry. -In the symbolic methodology, these cells are phantom cells. -It means that only their abutment box and and connectors are present. -\fBs2r\fP wil substitute physical cells to the symbolic phamtom cells. -Beware, this implies that the manufacturer cells must be modified by hand to -ensure the abutment box is a symbolic grid step multiple, and that the -real connectors are centered on symbolic grid. -.br -In order for the replacement to work well, the physicals cells must have -the abutment box lower left corner at coordinate (0,0) -The name of cells to be replaced are written in the catalog file with the -G attribute, see \fBcatal\fP(5) for details on that file. -See also \fBring\fP(1) for more on pads. -Ouput can be generated in either cif or gds formats, to fit the manufacturer -requirements. -.br -.LP -Mainly two kinds of users are concerned with \fBs2r\fP : -.TP 21 -experts -they should be able to parametrize the technology file for a new process -technology file is described in \fBtechno(5)\fP. -.TP -designers -they are not directly concerned with the target process, but need to be able to -compute real capacitances for simulation. -.PP -The \fIsource\fP argument is the name of the symbolic layout file to be -translated. -The optional \fIresult\fP argument indicates the name to be given to the real -layout output. -This name is also the name of the top level model of the layout hierarchy. -If \fIresult\fP name is omitted, then \fIsource\fP name is used. -.PP -Six environment variables must be set for proper usage of \fBs2r\fP, -all of them having default values, thus ensuring the possibility of using it -``as it is''. -.TP 21 -MBK_IN_PH -The input format for symbolic layout is given by this environment variable. -The possible values are \fI cp, ap\fP. Default is \fIcp\fP. -See \fBMBK_IN_PH\fP(1) for details. -.TP -MBK_CATA_LIB -Sets the directories that are to be searched thru for reading files. -The seaching mecanism first look in MBK_WORK_LIB(1) -MBK_WORK_LIB -defines the path where the generated file is saved. -Make sure the write permissions are set up correctly, otherwise no save -will occur. -.TP -MBK_CATAL_NAME -This indicates the name of the catalog file used for pad substitution. -For the appropriate syntax of this file, see \fBcatal\fP(5). -.TP -RDS_IN -Defines the format to be used as input for cell substitution. -The available ones are \fIcif\fP and \fIgds\fP (default one). -The cells to be parsed must not containt 45 -.ie t \(de -.el degrees -wires. If an unknown layer is encountered, the entire cell will be skipped. -.TP -RDS_OUT -Gives the format of the output file. -This may be either \fIcif\fP or \fIgds\fP (default is \fIgds\fP). -.TP -RDS_TECHNO_NAME -This points to the technology file to be used for symbolic to real translation. -This file is in general shared between all the designers. -it is the full path name to the file location, with the extension. -.SH OPTIONS -Without option, \fBs2r\fP should produce a layout that fits for the foundry. -Nevertheless, its behaviour can be modified when invoked with the -following options: -.TP 21 -\-s -Suppress the denotching phase. \fBs2r\fP performs gap filling, denotching -in order to avoid DRC errors. This operation is time consuming. -It is mandatory for the foundry but not really useful for capacitance -evaluation. -.TP -\-c -Deletes connectors and node names at all hierarchy level. -Theses objects link the physical view and the logical view of a chip. -If simulation is to be done after physical mapping, connectors must appear, -so that the extractors and simulators can use them. -This must \fInot\fP be used when preparing a final layout for the foundry. -.br -For the factory, the top level connectors are forbidden, since they do not -represent any physical reality. -.TP -\-1 -Creates the top level cell with the instances as black boxes. -This may be useful for hierarchical extractors, since the file size may be -greatly reduced. -.TP -\-r -does not replace black boxes. -Cells flagged with the \fBG\fP attribute in the \fBcatal\fP(5) file will not -be replaced by their equivalent layout loaded from disk. -.TP -\-v -verbose mode on. - - -.SH EXAMPLES -.RS -You should first have a correct execution environment : -.br -It is recommanded to put it in the ``.cshrc'' file if in c shell, as in the -example below. -.RE -.br -.ie t \{\ -.ft CR \} -.el \fB -.ta 30n -.nf - setenv MBK_IN_PH ap - setenv MBK_WORK_LIB ~fred/mbk/layout - setenv MBK_CATA_LIB ~franck/s2r:/alliance/cells - setenv MBK_CATAL_NAME catalog - setenv RDS_TECHNO_NAME /labo/etc/prol15.rds - setenv RDS_IN gds - setenv RDS_OUT gds - s2r -c na2_y -.fi -.ft R -.RS -This invocation will produce the cell \fBna2_y\fP from the standard cell -library in real layout, without connectors, scotches if needed, in gds format. -.RE -.SH SEE ALSO -.BR mbk (1), -.BR ring(1), -.BR MBK_IN_PH (1), -.BR MBK_CATA_LIB (1), -.BR MBK_WORK_LIB (1), -.BR MBK_CATAL_NAME (1), -.BR RDS_IN (1), -.BR RDS_OUT (1), -.BR RDS_TECHNO_NAME (1), -.BR techno(5), -.BR catal(5). - -.SH DIAGNOSTICS -.br -The actual version of the gds parser and driver doesn't translate neither -connectors, nor node names. -If an extraction on s2r output is needed, cif format will create the -connectors using cif extension \fB4X\fP, and the node names with \fB4N\fP. - - - -.so man1/alc_bug_report.1 - diff --git a/alliance/src/s2r/src/Makefile.am b/alliance/src/s2r/src/Makefile.am deleted file mode 100644 index f32d8911..00000000 --- a/alliance/src/s2r/src/Makefile.am +++ /dev/null @@ -1,15 +0,0 @@ -## Process this file with automake to produce Makefile.in - -bin_PROGRAMS = s2r - -CFLAGS = @CFLAGS@ @ALLIANCE_CFLAGS@ - -s2r_LDADD = @ALLIANCE_LIBS@ \ - -lMpu -lMcp -lMap -lMmg \ - -lRtl -lRgs -lRcf -lRfm -lRpr -lRwi -lRut -lRds\ - -lMph -lMut - -s2r_SOURCES = generic.h hash.h maxima.h merge.h\ - postrat.h rdsacces.h statistics.c hash.c\ - main.c merge.c postrat.c rdsacces.c\ - statistics.h diff --git a/alliance/src/s2r/src/generic.h b/alliance/src/s2r/src/generic.h deleted file mode 100644 index 423a6189..00000000 --- a/alliance/src/s2r/src/generic.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - - -# include -# include -# include -# include -# include diff --git a/alliance/src/s2r/src/hash.c b/alliance/src/s2r/src/hash.c deleted file mode 100644 index d1574654..00000000 --- a/alliance/src/s2r/src/hash.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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. - */ - - -#include -#include -#include -#include -#include "hash.h" - -static int primes[] = { - 101, 223, 311, 419, 547, 659, 727, 877, 967, - 1061, 2053, 3299, 4391, 5309, 6421, 7069, 8543, 9397, - 10337, 20143, 32423, 43151, 52223, 63179, 0 -}; - -void htremove (ht_t * htable) -{ - int i; - for (i = 1; i < (int)htable[0]; i++) - freechain (htable[i]); - free (htable); -} - -ht_t *htinit (int size) -{ - int i; - ht_t *htable; - - /* prend le premier nombre premier au dela de size */ - for (i = 0; primes[i] && (size > primes[i]); i++); - if (primes[i] == 0) - { - fprintf (stderr, "Erreur : hash table trop grande (> %d)\n", primes[i - 1]); - exit (1); - } - size = primes[i]; - if ((htable = calloc (size + 1, sizeof (chain_list *))) == NULL) - { - perror ("htinit"); - exit (1); - } - htable[0] = (chain_list *) size; /* taille de la table dans premiere case */ - return htable; -} - -static int hash (ht_t * htable, char *key) -{ - int alveole = 0; - int length = strlen (key); - int segment; - int l; - - if ((key == NULL) || (length == 0)) - { - fprintf (stderr, "Error : hash (NULL)\n"); - exit (1); - } - for (l = 0; l < length; l += 2) - { - segment = 0xFFFF & ((key[l] << 8) | key[l + 1]); - alveole = alveole ^ ((segment << 1) | (segment >> 15)); - } - alveole %= (int) htable[0]; /* htable[0] == la taille de la table */ - return (alveole + 1); /* +1 car on ne doit rien mettre dans case 0 */ -} - -chain_list *htget (ht_t * htable, char *key) -{ - int alveole = hash (htable, key); - chain_list *p; - - for (p = htable[alveole]; p && strcmp (p->DATA, key); p = p->NEXT); - return p; -} - -chain_list *htset (ht_t * htable, char *key) -{ - int alveole = hash (htable, key); - chain_list *p; - - for (p = htable[alveole]; p && strcmp (p->DATA, key); p = p->NEXT); - if (p) - return p; - htable[alveole] = addchain (htable[alveole], strdup (key)); - return htable[alveole]; -} diff --git a/alliance/src/s2r/src/hash.h b/alliance/src/s2r/src/hash.h deleted file mode 100644 index d85d5cc3..00000000 --- a/alliance/src/s2r/src/hash.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - - -#ifndef HASH_H -#define HASH_H - -#include - -typedef chain_list *ht_t; /* def d'1 table de hachage table de htele_t */ - -extern ht_t *htinit (int size); -extern void htremove (ht_t * htable); -extern chain_list *htset (ht_t * htable, char *key); -extern chain_list *htget (ht_t * htable, char *key); - -#endif diff --git a/alliance/src/s2r/src/main.c b/alliance/src/s2r/src/main.c deleted file mode 100644 index b2044658..00000000 --- a/alliance/src/s2r/src/main.c +++ /dev/null @@ -1,354 +0,0 @@ -/* - * 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. - */ - -/****************************************************************************/ -/* */ -/* ALLIANCE CAO & VLSI CAD */ -/* */ -/* Product : (S)ymbolic (2)to (R)eal translater */ -/* File : main.c */ -/* */ -/* (c) copyright 1992 MASI laboratory CAO & VLSI team */ -/* All Right Reserved */ -/* Support : e-mail cao-vlsi@masi.ibp.fr */ -/* */ -/****************************************************************************/ -/* */ -/* Main of Symbolic to Real */ -/* */ -/****************************************************************************/ - -#ident "@(#)s2r 3.8 30/01/02 ALLIANCE 4.5 (S)ymbolic (2)to (R)eal converter" - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "generic.h" -#include "rdsacces.h" -#include "statistics.h" -#include "postrat.h" - -void Usage (Name) - char *Name; -{ - fprintf (stderr, "\tUsage : %s [-cs1trv] source [result]\n\n", Name); - fprintf (stderr, "\tsource\t: filename of symbolic layout circuit\n"); - fprintf (stderr, "\t\t to translate to real layout\n"); - fprintf (stderr, "\tresult\t: result filename of real layout circuit\n"); - fprintf (stderr, "\t\t source name is used, if result is absent\n\n"); - fprintf (stderr, "\toptionnal options (any order, any occurence) :\n"); - fprintf (stderr, "\t-c\t: deletes top-level (c)onnectors, keeps all others\n"); - fprintf (stderr, "\t-C\t: keeps top-level (c)onnectors, deletes all others\n"); - fprintf (stderr, "\t-n\t: deletes all signal names, but connectors\n"); - fprintf (stderr, "\t-s\t: (s)cotchs are not created\n"); - fprintf (stderr, "\t-1\t: only (1) level is translated, all otherwise.\n"); - fprintf (stderr, "\t-t\t: layout is just (t)ranslated, not post-treated\n"); - fprintf (stderr, "\t-r\t: black boxes are not (r)eplaced\n"); - fprintf (stderr, "\t-v\t: (v)erbose mode armed\n"); - exit (1); -} - -int main (argc, argv) - int argc; - char **argv; -{ - rdsfig_list *rds_model; - phfig_list *mbk_model; - -/*\ - * banner and parameters -\*/ - - char *source_name = NULL; /* need default values */ - char *result_name = NULL; /* need default values */ - int root_conn = 1; /* keep top-level figure connectors by default */ - int sub_conn = 1; /* keep sub-level figure connectors by default */ - int signal_name = 1; /* keep signal names by default */ - int scotch_on = 1; /* scotchs are not created by default */ - int one_level = 0; /* all hierarchy level translated by default */ - int do_post_treat = 1; /* post-treatment is done by default */ - int do_replace_cells = 1; /* cells_replacement is done by default */ - int verbose = 0; /* verbose mode desarmed by default */ - int flat = 0; /* flat mode desarmed by default */ - int physical = 0; /* physical mode desarmed by default */ - int split_layer = 0; /* split_layer mode desarmed by default */ - int shift; - - alliancebanner ("s2r", VERSION, "Symbolic to Real layout converter", "2002", ALLIANCE_VERSION); - - { - char *debug_env; - if ((debug_env = getenv ("S2RDEBUG")) != NULL) - { - unsigned char v = *debug_env - '0'; - s2rdebug = (v <= 9) ? v : 0; - } - } - - if (argc < 2) - Usage (argv[0]); - - mbkenv (); - rdsenv (); - - for (shift = 1; shift < argc; shift++) - { - char *arg = argv[shift]; - if (*arg == '-') - { - while (*++arg) - { - switch (*arg) - { - case 'C': - sub_conn = 0; - break; - case 'c': - root_conn = 0; - break; - case 'n': - signal_name = 0; - break; - case 's': - scotch_on = 0; - break; - case '1': - one_level = 1; - break; - case 't': - do_post_treat = 0; - break; - case 'r': - do_replace_cells = 0; - break; - case 'v': - verbose = 1; - break; - case 'l': - split_layer = 1; - break; - case 'f': - flat = 1; - break; - case 'p': - physical = 1; - break; - default: - Usage (argv[0]); - } - } - } - else - { - if (!source_name) - source_name = namealloc (argv[shift]); - else if (!result_name) - { - result_name = namealloc (argv[shift]); - } - else - Usage (argv[0]); - continue; - } - } - - if (!source_name) - { - Usage (argv[0]); - } - - if (!result_name) - { - result_name = source_name; - } - -/*\ - * setting environement - * MBK_CATAL_NAME : file where file name to be replaced are put - * MBK_CATA_LIB : where cells, catal file and techno file are - * MBK_WORK_LIB : where result file is written or where techno file is - * WORK_LIB is watched before CATA_LIB - * MBK_WORK_LIB : where result file is placed - * MBK_IN_PH : file format of symbolic figure - * RDS_TECHNO_NAME : techno file name - * RDS_IN : file format of real figures to replace - * RDS_OUT : file format of result file -\*/ - -/*\ - * Read the techno file -\*/ - printf ("\n\to loading technology file : %s\n", RDS_TECHNO_NAME); - fflush (stdout); - loadrdsparam (); - -/*\ - * Read the model file -\*/ - if (physical) - { - printf ("\to loading %s level of real layout : %s\n", one_level ? "one" : "all", source_name); - fflush (stdout); - rds_model = getrdsfig (source_name, one_level ? 'P' : 'A', 0); - - } - else - { - printf ("\to loading %s level of symbolic layout : %s\n", one_level ? "one" : "all", source_name); - fflush (stdout); - - mbk_model = getphfig (source_name, 'A'); - if (!root_conn) - mbk_model->PHCON = NULL; - rds_model = S2Rfigmbkrds (mbk_model, one_level ? 0 : 1); - - /* Removing symbolic data structure */ - - printf ("\to removing symbolic data structure \n"); - rds_mbk_kill (); - } - -/*\ - * flattening -\*/ - if (flat) - { - printf ("\to flattening figure\n"); - rflattenrdsfig (rds_model, RDS_NO, RDS_NO); - } - -/*\ - * post treatement -\*/ - rds_model = rds_model_out (source_name); - - if (do_post_treat) - { - printf ("\to layout post-treating\n "); - if (root_conn) - printf ("\t\twith top connectors,\n "); - else - printf ("\t\twithout top connector,\n "); - if (sub_conn) - printf ("\t\twith sub connectors,\n "); - else - printf ("\t\twithout sub connector,\n "); - if (signal_name) - printf ("\t\twith signal names,\n "); - else - printf ("\t\twithout signal name,\n "); - if (scotch_on) - printf ("\t\twith scotchs.\n"); - else - printf ("\t\twithout scotch.\n"); - post_treat (rds_model, scotch_on, verbose); - fflush (stdout); - } - -/*\ - * Replace cells -\*/ - - if (do_replace_cells) - { - replace_cells (verbose); - } - -/*\ - * save file -\*/ - printf ("\to saving %s.%s\n", result_name, RDS_OUT); - rds_model->NAME = result_name; - - if (split_layer) - { - char *RDS_CIF_LAYER_TABLE_BAK[RDS_ALL_LAYER][RDS_CIF_LAYER_FIELD]; - unsigned char RDS_GDS_LAYER_TABLE_BAK[RDS_ALL_LAYER][RDS_GDS_LAYER_FIELD]; - char WORK_LIB_TMP[256]; - char WORK_LIB_BAK[256]; - int layer; - - strcpy (WORK_LIB_BAK, WORK_LIB); - for (layer = 0; layer < RDS_ALL_LAYER; layer++) - { - *strchr (RDS_LAYER_NAME[layer], ' ') = '\0'; - RDS_CIF_LAYER_TABLE_BAK[layer][0] = RDS_CIF_LAYER_TABLE[layer][0]; - RDS_GDS_LAYER_TABLE_BAK[layer][0] = RDS_GDS_LAYER_TABLE[layer][0]; - RDS_GDS_LAYER_TABLE[layer][0] = RDS_GDS_LAYER_EMPTY; - RDS_CIF_LAYER_TABLE[layer][0] = RDS_CIF_LAYER_EMPTY; - } - - for (layer = 0; layer < RDS_ALL_LAYER; layer++) - { - if (!strcmp (RDS_OUT, "gds")) - { - if (RDS_GDS_LAYER_TABLE_BAK[layer][0] != RDS_GDS_LAYER_EMPTY) - { - sprintf (WORK_LIB_TMP, "%s/%s/", WORK_LIB_BAK, RDS_LAYER_NAME[layer]); - WORK_LIB = WORK_LIB_TMP; - if (verbose) - { - printf ("\t - %s\n", WORK_LIB); - fflush (stdout); - } - - RDS_GDS_LAYER_TABLE[layer][0] = RDS_GDS_LAYER_TABLE_BAK[layer][0]; - saverdsfig (rds_model); - RDS_GDS_LAYER_TABLE[layer][0] = RDS_GDS_LAYER_EMPTY; - } - } - else - { - if (RDS_CIF_LAYER_TABLE_BAK[layer][0] != RDS_CIF_LAYER_EMPTY) - { - sprintf (WORK_LIB_TMP, "%s/%s/", WORK_LIB_BAK, RDS_LAYER_NAME[layer]); - WORK_LIB = WORK_LIB_TMP; - if (verbose) - { - printf ("\t - %s\n", WORK_LIB); - fflush (stdout); - } - - RDS_CIF_LAYER_TABLE[layer][0] = RDS_CIF_LAYER_TABLE_BAK[layer][0]; - saverdsfig (rds_model); - RDS_CIF_LAYER_TABLE[layer][0] = RDS_CIF_LAYER_EMPTY; - } - } - } - } - else - saverdsfig (rds_model); - - if (verbose) - print_statistics (scotch_on); - - return (0); -} diff --git a/alliance/src/s2r/src/maxima.h b/alliance/src/s2r/src/maxima.h deleted file mode 100644 index b0fe4012..00000000 --- a/alliance/src/s2r/src/maxima.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -/********************************************************************** - * * - * Definitions to tune the program * - * * - **********************************************************************/ - -#ifndef MAX_WIN_SEG /* max. number of segments( rectangles) */ -#define MAX_WIN_SEG 10000 /* in a window */ -#endif -#ifndef MIN_WIN_SEG /* min. number of segments( rectangles) */ -#define MIN_WIN_SEG 100 /* in a window */ -#endif -#ifndef MRG_EXT_RATIO /* the approx. ratio between the num. */ -#define MRG_EXT_RATIO 20 /* of operations done if a rect. is */ - /* taken in a widow and the num of */ - /* operations done to extract rect. */ -#endif -#ifndef BUFFER_SIZE -#define BUFFER_SIZE 255 -#endif -#ifndef MAX_STRING_SIZE -#define MAX_STRING_SIZE 30 -#endif -#ifndef MAX_FILE_NAME_SIZE -#define MAX_FILE_NAME_SIZE 255 -#endif -#ifndef MAX_PHYS_LAYER -#define MAX_PHYS_LAYER 20 -#endif diff --git a/alliance/src/s2r/src/merge.c b/alliance/src/s2r/src/merge.c deleted file mode 100644 index b895c27a..00000000 --- a/alliance/src/s2r/src/merge.c +++ /dev/null @@ -1,1717 +0,0 @@ -/* - * 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. - */ - -/****************************************************************************/ -/* */ -/* ALLIANCE CAO & VLSI CAD */ -/* */ -/* Product : (S)ymbolic (2)to (R)eal translater */ -/* File : merge.c */ -/* */ -/* (c) copyright 1992 MASI laboratory CAO & VLSI team */ -/* All Right Reserved */ -/* Support : e-mail cao-vlsi@masi.ibp.fr */ -/* */ -/****************************************************************************/ -/* */ -/* Merge functions */ -/* */ -/****************************************************************************/ - -#include "generic.h" -#include -#include -#include -#include -#include -#include "rdsacces.h" -#include "maxima.h" -#include "statistics.h" -#include "merge.h" - -/***************************************************************************** - * name_transfert: given two rectangles, return name to keep after merge - * if the names are different, a warning is done, to prevent - * that the second one is erased - ****************************************************************************/ - -static char *name_transfert (desc1, desc2) - rdsrec_list *desc1, *desc2; -{ - if (desc1->NAME == NULL) - return desc2->NAME; -/*\ - * some segments in different chanels made by scr(1) bloc has - * different name but are linked together throught cells, s2r - * merged then, but can't say it's a error! - * - * if (desc1->u_rec.name != desc2->u_rec.name) - * fprintf(stderr, - * "**s2r error**different nodes merged, %s erased\n", - * desc2->u_rec.name); -\*/ - return (desc1->NAME); -} - -/***** macro definitions *****/ - -#define lgx1 (x1+dx1) -#define lgy1 (yy1+dy1) -#define lgx2 (x2+dx2) -#define lgy2 (y2+dy2) - -/****************************************************************************** - * ext_win_segs: given a model, a layer and a window; it returns a pointer to - * a list of rectangles ( formed by the rectangles in the - * specified model in the specified layer intersecting this window - * - or touching it). - * For consistency purpose these rectangles - which are in the - * list - are extracted from the model and the new list merged is - * returned back to the model. - *****************************************************************************/ - -static rdsrec_list *ext_win_segs (model, layer_num, wx, wy, dx, dy) - register rdsfig_list *model; - register int layer_num; - register long wx, wy, dx, dy; -{ - typedef rdsrec_list *rectangle_typ; - register rectangle_typ *rectanglep; - register rdsrec_list *temp_list; - register rdsrec_list *temp; - - temp_list = NULL; - for (rectanglep = &(model->LAYERTAB[layer_num]); *rectanglep;) - { - if (are_rect_intersec ((*rectanglep)->X, (*rectanglep)->Y, (*rectanglep)->DX, (*rectanglep)->DY, wx, wy, dx, dy)) - { - temp = (*rectanglep)->NEXT; - (*rectanglep)->NEXT = temp_list; - temp_list = *rectanglep; - *rectanglep = temp; - } - else - rectanglep = &((*rectanglep)->NEXT); - } - return (temp_list); -} - -/********************************************************************** - * inclus: determines if one of the given rectangles is included in the - * other and if it is the case: - * - it marks the one included "to be removed" - * - it marks the one that includes "used" - * - it sets modif to 1 to indicate that a modification happened - * - if rectangle1(desc1) was the one included it sets modif1 to1 - * - if rectangle2(desc2) was the one included it sets modif2 to1 - **********************************************************************/ -static void inclus (modif, modif1, modif2, desc1, desc2) - unsigned char *modif; /*indique une modification de la base de donnees */ - unsigned char *modif1; /* indique que le desc 1 a ete elimine */ - unsigned char *modif2; /* indique que le desc 2 a ete elimine */ - rdsrec_list *desc1, *desc2; -{ - register long x1, dx1, yy1, dy1, x2, dx2, y2, dy2; - - x1 = desc1->X; - yy1 = desc1->Y; - dx1 = desc1->DX; - dy1 = desc1->DY; - x2 = desc2->X; - y2 = desc2->Y; - dx2 = desc2->DX; - dy2 = desc2->DY; - - if (x1 == x2) - { - if (yy1 == y2) - { - if (lgx1 == lgx2) - { - if (lgy1 == lgy2) - { - /* desc1 equal desc2 : only one must be erased, - but, because all flattened rectangles will be erased - it's better to delete the not flattened one */ - *modif = 1; - *modif2 = 1; - *modif1 = 1; - if (!is_flattenres (desc2)) - { - mark_remove (desc2); - } - else - { - mark_remove (desc1); - } - return; - } - } - } - } - if (x1 >= x2) - { - if (yy1 >= y2) - { - if (lgx1 <= lgx2) - { - if (lgy1 <= lgy2) - { - if (!is_flattenres (desc2)) - { - desc2->NAME = name_transfert (desc1, desc2); - } - mark_remove (desc1); - *modif = 1; - *modif1 = 1; - return; - } - } - } - } - if (x2 >= x1) - { - if (y2 >= yy1) - { - if (lgx2 <= lgx1) - { - if (lgy2 <= lgy1) - { - /* desc2 include in desc1 */ - if (!is_flattenres (desc1)) - { - desc1->NAME = name_transfert (desc1, desc2); - } - mark_remove (desc2); - *modif = 1; - *modif2 = 1; - } - } - } - } - return; -} - -/************************************************************************ - * prolong: determines if the 2 given rectangles have a dimension in common - * and if it is possible to extend the second one so as to include - * the first one. If it is the case: - * - the first rectangle (desc1) is marked "to be removed". - * - the second rectangle (desc2) is extended and is marked "used". - * - modif and modif1 are set to 1. - *************************************************************************/ - -static void prolong (modif, modif1, desc1, desc2) - unsigned char *modif; /* indique une modificatin de la base de donnees */ - unsigned char *modif1; /* indique que desc 1 a ete elimine */ - rdsrec_list *desc1, *desc2; -{ - register long x1, dx1, yy1, dy1, x2, dx2, y2, dy2; - - x1 = desc1->X; - yy1 = desc1->Y; - dx1 = desc1->DX; - dy1 = desc1->DY; - x2 = desc2->X; - y2 = desc2->Y; - dx2 = desc2->DX; - dy2 = desc2->DY; - - if (yy1 == y2) - { - if (dy1 == dy2) - { - if (x1 < x2) - { - if (lgx1 >= x2) - { -/* cas 1 */ -/* ________________ */ -/* | 1 | | 2 | */ -/* | | | | */ -/* |______|_|_______| */ - *modif = 1; - *modif1 = 1; - desc2->X = x1; - desc2->DX = lgx2 - x1; - mark_used (desc2); - mark_remove (desc1); - if (!is_flattenres (desc2)) - { - desc2->NAME = name_transfert (desc1, desc2); - } - } - } - else - { - if (x2 < x1) - { - if (lgx2 >= x1) - { -/* cas 2 */ -/* ________________ */ -/* | 2 | | 1 | */ -/* | | | | */ -/* |______|_|_______| */ - *modif = 1; - *modif1 = 1; - desc2->DX = lgx1 - x2; - mark_used (desc2); - mark_remove (desc1); - if (!is_flattenres (desc2)) - { - desc2->NAME = name_transfert (desc1, desc2); - } - } - } - } - } - return; - } - if (x1 == x2) - { - if (dx1 == dx2) - { - if (yy1 < y2) - { - if (lgy1 >= y2) - { -/* cas 3 */ -/* ________ */ -/* | 2 | */ -/* | | */ -/* |________| */ -/* |________| */ -/* | | */ -/* | 1 | */ -/* |________| */ - *modif = 1; - *modif1 = 1; - desc2->Y = yy1; - desc2->DY = lgy2 - yy1; - mark_used (desc2); - mark_remove (desc1); - if (!is_flattenres (desc2)) - { - desc2->NAME = name_transfert (desc1, desc2); - } - } - } - else - { - if (y2 < yy1) - { - if (lgy2 >= yy1) - { -/* cas 4 */ -/* ________ */ -/* | 1 | */ -/* | | */ -/* |________| */ -/* |________| */ -/* | | */ -/* | 2 | */ -/* |________| */ - *modif = 1; - *modif1 = 1; - desc2->DY = lgy1 - y2; - mark_used (desc2); - mark_remove (desc1); - if (!is_flattenres (desc2)) - { - desc2->NAME = name_transfert (desc1, desc2); - } - } - } - } - } - } - return; -} - -/***************************************************************************** - * supegl_dimin: determines if the given dimension is greater than twice the - * resize quantity plus the minimum width of a segment in this - * layer ( returns 1) or not (returns 0). - ****************************************************************************/ - -static int supegl_dimin (val, layer_num) /* used in contact */ - long val; - int layer_num; -{ - if (val >= (long) (2 * GET_S2R_OVERSIZE (layer_num) + GET_S2R_LAYER_WIDTH (layer_num))) - { - return (1); - } - else - { - return (0); - } -} - -/************************************************************************* - * contact: determines if the 2 given rectangles intersect each other. - * If it is the case: - * - it extends one of them and marks it "used". - * or - it creates 1 or 2 new compensating rectangles and adds them - * to the given list.( rectangles are not created unless they - * have the dimensions greater than twice the resize quantity - * and only in the first pass (passage).). - **************************************************************************/ - -static void contact (temp_list, layer_num, passage, desc1, desc2) - rds_rectanglep_typ *temp_list; - int layer_num; - char passage; - rdsrec_list *desc1, *desc2; -{ - long mbk_type; - register long x1, dx1, yy1, dy1, x2, dx2, y2, dy2; - - mbk_type = GetRdsMbkType (desc1); - x1 = desc1->X; - yy1 = desc1->Y; - dx1 = desc1->DX; - dy1 = desc1->DY; - x2 = desc2->X; - y2 = desc2->Y; - dx2 = desc2->DX; - dy2 = desc2->DY; - - if (x1 >= x2) - { - if (yy1 < y2) - { - if (lgy1 < lgy2) - { - if (lgx1 <= lgx2) - { - if (lgy1 >= y2) - { -/* cas 1 */ -/* _________ */ -/* | 2 | */ -/* | ___ | */ -/* |__|___|__| */ -/* | 1 | */ -/* |___| */ - desc1->DY = lgy2 - yy1; - mark_used (desc1); - return; - } - } - else if (passage == 0) - { - if (x1 <= lgx2) - { - if (lgy1 > y2) - { -/* cas 2 */ -/* ______________ */ -/* | 2 ____|____ */ -/* | | | 1 | */ -/* |_________|____| | */ -/* | | */ -/* |_________| */ - if (x1 != lgx2) - { - if (supegl_dimin ((lgx2 - x1), layer_num)) - { - (*temp_list) = rds_rectangle_in ((*temp_list), - x1, yy1, lgx2 - x1, lgy2 - yy1, layer_num, mbk_type, NULL); - } - } - if (supegl_dimin ((lgy1 - y2), layer_num)) - { - (*temp_list) = rds_rectangle_in ((*temp_list), x2, y2, lgx1 - x2, lgy1 - y2, layer_num, mbk_type, NULL); - } - return; - } - } - } - } - } - if (yy1 > y2) - { - if (lgx1 <= lgx2) - { - if (yy1 <= lgy2) - { - if (lgy1 > lgy2) - { -/* cas 3 */ -/* _______ */ -/* | 1 | */ -/* ___|_______|____ */ -/* | 2 |_______| | */ -/* | | */ -/* |________________| */ - desc1->Y = y2; - desc1->DY = lgy1 - y2; - mark_used (desc1); - return; - } - } - } - } - } - else - { /* x1= x2) - { - if (yy1 < y2) - { - if (passage == 0) - { - if (lgx1 <= lgx2) - { - if (lgy1 > y2) - { - if (lgx1 >= x2) - { - if (lgy1 < lgy2) - { -/* cas 4 */ -/* _____________ */ -/* | 2 | */ -/* ________|_______ | */ -/* | 1 |_______|_____| */ -/* | | */ -/* |________________| */ - if (x2 != lgx1) - { - if (supegl_dimin ((lgx1 - x2), layer_num)) - { - (*temp_list) = rds_rectangle_in ((*temp_list), - x2, yy1, lgx1 - x2, lgy2 - yy1, layer_num, mbk_type, NULL); - } - } - if (supegl_dimin ((lgy1 - y2), layer_num)) - { - (*temp_list) = rds_rectangle_in ((*temp_list), - x1, y2, lgx2 - x1, lgy1 - y2, layer_num, mbk_type, NULL); - } - return; - } - } - } - } - } - } - else - { /* yy1>=y2 */ - if (lgx1 >= x2) - { - if (lgx1 < lgx2) - { - if (lgy1 <= lgy2) - { -/* cas 5 */ -/* _____________ */ -/* | 2 | */ -/* _______|_______ | */ -/* | 1 | | | */ -/* |_______|_______| | */ -/* |_____________| */ - desc1->DX = lgx2 - x1; - mark_used (desc1); - return; - } - } - } - } - if (lgx1 >= x2) - { - if (lgx1 < lgx2) - { - if (yy1 <= y2) - { - if (lgy1 >= lgy2) - { -/* cas 6 */ -/* _____________ */ -/* | 1 | */ -/* | ______|______ */ -/* | | | 2 | */ -/* | |______|______| */ -/* |_____________| */ - desc2->X = x1; - desc2->DX = lgx2 - x1; - mark_used (desc2); - return; - } - } - } - } - } - } - if (x1 <= x2) - { - if (lgx1 < lgx2) - { - if (passage == 0) - { - if (lgx1 >= x2) - { - if (yy1 > y2) - { - if (lgy1 > lgy2) - { - if (yy1 <= lgy2) - { -/* cas 7 */ -/* ______________ */ -/* | 1 ____|____ */ -/* | | | 2 | */ -/* |_________|____| | */ -/* |_________| */ - if (supegl_dimin ((lgy2 - yy1), layer_num)) - { - (*temp_list) = rds_rectangle_in ((*temp_list), - x1, yy1, lgx2 - x1, lgy2 - yy1, layer_num, mbk_type, NULL); - } - if (x2 != lgx1) - { - if (supegl_dimin ((lgx1 - x2), layer_num)) - { - (*temp_list) = rds_rectangle_in ((*temp_list), - x2, y2, lgx1 - x2, lgy1 - y2, layer_num, mbk_type, NULL); - } - return; - } - } - } - } - } - } - } - else - { /* x1+dx1>=x2+dx2 */ - if (yy1 < y2) - { - if (lgy1 >= y2) - { - if (lgy1 < lgy2) - { -/* cas 8 */ -/* _________ */ -/* | 2 | */ -/* ______|_________|_______ */ -/* | 1 |_________| | */ -/* | | */ -/* |________________________| */ - desc2->Y = yy1; - desc2->DY = lgy2 - yy1; - mark_used (desc2); - return; - } - } - } - if (yy1 > y2) - { - if (lgy1 > lgy2) - { - if (yy1 <= lgy2) - { -/* cas 9 */ -/* _________ */ -/* | 1 | */ -/* | ___ | */ -/* |__|___|__| */ -/* | 2 | */ -/* |___| */ - desc2->DY = lgy1 - y2; - mark_used (desc2); - return; - } - } - } - } - } - if (x1 > x2) - { - if (x1 <= lgx2) - { - if (lgx1 > lgx2) - { - if (yy1 <= y2) - { - if (lgy1 >= lgy2) - { -/* cas 10 */ -/* _____________ */ -/* | 1 | */ -/* _______|_______ | */ -/* | 2 | | | */ -/* |_______|_______| | */ -/* |_____________| */ - desc2->DX = lgx1 - x2; - mark_used (desc2); - return; - } - } - if (yy1 >= y2) - { - if (lgy1 <= lgy2) - { -/* cas 11 */ -/* _____________ */ -/* | 2 | */ -/* | ______|______ */ -/* | | | 1 | */ -/* | |______|______| */ -/* |_____________| */ - desc1->X = x2; - desc1->DX = lgx1 - x2; - mark_used (desc1); - return; - } - } - } - if (passage == 0) - { - if (lgx1 >= lgx2) - { - if (yy1 > y2) - { - if (lgy1 > lgy2) - { - if (yy1 <= lgy2) - { -/* cas 12 */ -/* _____________ */ -/* | 1 | */ -/* ________|_______ | */ -/* | 2 |_______|_____| */ -/* | | */ -/* |________________| */ - if (x1 != lgx2) - { - if (supegl_dimin ((lgx2 - x1), layer_num)) - { - (*temp_list) = rds_rectangle_in ((*temp_list), - x1, y2, lgx2 - x1, lgy1 - y2, layer_num, mbk_type, NULL); - } - } - if (supegl_dimin ((lgy2 - yy1), layer_num)) - { - (*temp_list) = rds_rectangle_in ((*temp_list), - x2, yy1, lgx1 - x2, lgy2 - yy1, layer_num, mbk_type, NULL); - } - return; - } - } - } - } - } - } - return; - } -} /* END contac() */ - - -/***************************************************************************** - * rect_list_sup: compares the given rectangle ( given by its coordinates) to - * every rectangle in the given list, using their quantities of - * oversize, and determines if they are intersecting in the - * normal case ( not oversized). If they are, it returns 1, else - * it returns 0. - ******************************************************************************/ -static int rect_list_sup (x, y, dx, dy, list, qty1, qty2) - register long x, y, dx, dy; - rdsrec_list *list; - register long qty1, qty2; -{ - register rdsrec_list *rectp; - - for (rectp = list; rectp; rectp = rectp->NEXT) - { - /* 1 is added as intersec is true if the 2 rect. touch which is not our case */ - if (are_rect_intersec (x + qty1 + 1, y + qty1 + 1, - dx - 2 * qty1 - 2, dy - 2 * qty1 - 2, - rectp->X + qty2, rectp->Y + qty2, rectp->DX - 2 * qty2, rectp->DY - 2 * qty2)) - { - break; - } - } - if (rectp) - { - return (1); - } - else - { - return (0); - } -} - - -/************************************************************************* - * contact_2: determines if the 2 given rectangles intersect each other. - * If it is the case: - * - it extends one of them and marks it "used". - * or - it creates 1 or 2 new compensating rectangles and adds them - * to the given list. - * - If there is a need for compensating rectangles and they - * cannot be created as they would have a dimension less than - * the minimum width permitted for a segment in the given layer: - * + a pair of scotch will be considered and will be compared - * to all rectangles in the complementary layers (given - * by temp_list_s and temp_list_t). - * * If it does not intersect any of them one rectangle - * of the pair is created and the other will be created - * implicitly in following passes. - * * If it intersects one of them, another pair will be - * considered. - * + The other pair will pass the same test. - * * If it does not intersect any of them one rectangle - * of the pair is created and the other will be created - * implicitly in following passes. - * * If it intersects one of them an error will be - * signaled. - * Remarks: - * - Rectangles are created only in the first pass except if - * one or both of them is a scotch. - * - If a scotch is created then the variable "modif" is set - * to 1 to permit another pass; so as to consider the - * possibility of new merges due to the newly created scotch. - ******************************************************************************/ - -static void contact_2 (temp_list_p, temp_list_s, temp_list_t, layer_num, passage, desc1, desc2, modif) - rds_rectanglep_typ *temp_list_p; - rdsrec_list *temp_list_s, *temp_list_t; - int layer_num; - char passage; - rdsrec_list *desc1, *desc2; - unsigned char *modif; -{ - long mbk_type; - register long x1, dx1, yy1, dy1, x2, dx2, y2, dy2; - register long sx, sdx, sy, sdy; - char need_scotch = 0; - long minwdth_os, qty1, qty2; - - mbk_type = GetRdsMbkType (desc1); - x1 = desc1->X; - yy1 = desc1->Y; - dx1 = desc1->DX; - dy1 = desc1->DY; - x2 = desc2->X; - y2 = desc2->Y; - dx2 = desc2->DX; - dy2 = desc2->DY; - - if (x1 >= x2) - { - if (yy1 < y2) - { - if (lgy1 < lgy2) - { - if (lgx1 <= lgx2) - { - if (lgy1 >= y2) - { -/* cas 1 */ -/* _________ */ -/* | 2 | */ -/* | ___ | */ -/* |__|___|__| */ -/* | 1 | */ -/* |___| */ - desc1->DY = lgy2 - yy1; - mark_used (desc1); - return; - } - } - else if ((passage == 0) || (is_scotch (desc1)) || (is_scotch (desc2))) - { - if (x1 <= lgx2) - { - if (lgy1 > y2) - { -/* cas 2 */ -/* ______________ */ -/* | 2 ____|____ */ -/* | | | 1 | */ -/* |_________|____| | */ -/* | | */ -/* |_________| */ - if (x1 != lgx2) - { - if (supegl_dimin ((lgx2 - x1), layer_num)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), - x1, yy1, lgx2 - x1, lgy2 - yy1, layer_num, mbk_type, NULL); - } - else - { - need_scotch = 1; - } - } - if (supegl_dimin ((lgy1 - y2), layer_num)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), x2, y2, lgx1 - x2, lgy1 - y2, layer_num, mbk_type, NULL); - need_scotch = 0; - } - if (need_scotch) - { - qty1 = GET_S2R_OVERSIZE (layer_num); - qty2 = GET_S2R_POST_COMPLEMENTARY (layer_num); - - if (qty2 != RDS_S2R_POST_TREAT_EMPTY) - { - qty2 = GET_S2R_OVERSIZE (qty2); - } - else - { - qty2 = 0; - } - minwdth_os = GET_S2R_LAYER_WIDTH (layer_num) + 2 * qty1; - STAT_SCTCH_RQRD++; - sx = lgx2 - minwdth_os; - sy = lgy1 - minwdth_os; - sdx = minwdth_os; - sdy = lgy2 - lgy1 + minwdth_os; - if (!rect_list_sup (sx, sy, sdx, sdy, temp_list_s, qty1, qty2)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), sx, sy, sdx, sdy, layer_num, mbk_type, NULL); - - mark_scotch (*temp_list_p); - STAT_SCTCH_CRTD++; - *modif = 1; - } - else - { - sx = x2; - sy = y2; - sdx = x1 - x2 + minwdth_os; - sdy = minwdth_os; - if (!rect_list_sup (sx, sy, sdx, sdy, temp_list_s, qty1, qty2)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), sx, sy, sdx, sdy, layer_num, mbk_type, NULL); - mark_scotch (*temp_list_p); - STAT_SCTCH_CRTD++; - *modif = 1; - } - else - { - fprintf (stderr, "***s2r error***, scotch error (%.1f, %.1f)\n", - (float) sx / RDS_LAMBDA, (float) sy / RDS_LAMBDA); - } - } - } - return; - } - } - } - } - } - if (yy1 > y2) - { - if (lgx1 <= lgx2) - { - if (yy1 <= lgy2) - { - if (lgy1 > lgy2) - { -/* cas 3 */ -/* _______ */ -/* | 1 | */ -/* ___|_______|____ */ -/* | 2 |_______| | */ -/* | | */ -/* |________________| */ - desc1->Y = y2; - desc1->DY = lgy1 - y2; - mark_used (desc1); - return; - } - } - } - } - } - else - { /* x1= x2) - { - if (yy1 < y2) - { - if ((passage == 0) || (is_scotch (desc1)) || (is_scotch (desc2))) - { - if (lgx1 <= lgx2) - { - if (lgy1 > y2) - { - if (lgx1 >= x2) - { - if (lgy1 < lgy2) - { -/* cas 4 */ -/* _____________ */ -/* | 2 | */ -/* ________|_______ | */ -/* | 1 |_______|_____| */ -/* | | */ -/* |________________| */ - if (x2 != lgx1) - { - if (supegl_dimin ((lgx1 - x2), layer_num)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), - x2, yy1, lgx1 - x2, lgy2 - yy1, layer_num, mbk_type, NULL); - } - else - { - need_scotch = 1; - } - } - if (supegl_dimin ((lgy1 - y2), layer_num)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), - x1, y2, lgx2 - x1, lgy1 - y2, layer_num, mbk_type, NULL); - need_scotch = 0; - } - if (need_scotch) - { - qty1 = GET_S2R_OVERSIZE (layer_num); - qty2 = GET_S2R_POST_COMPLEMENTARY (layer_num); - - if (qty2 != RDS_S2R_POST_TREAT_EMPTY) - { - qty2 = GET_S2R_OVERSIZE (qty2); - } - else - { - qty2 = 0; - } - minwdth_os = GET_S2R_LAYER_WIDTH (layer_num) + 2 * qty1; - STAT_SCTCH_RQRD++; - sx = lgx1 - minwdth_os; - sy = y2; - sdx = lgx2 - lgx1 + minwdth_os; - sdy = minwdth_os; - if (!rect_list_sup (sx, sy, sdx, sdy, temp_list_s, qty1, qty2)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), sx, sy, sdx, sdy, layer_num, mbk_type, NULL); - mark_scotch (*temp_list_p); - STAT_SCTCH_CRTD++; - *modif = 1; - } - else - { - sx = x2; - sy = lgy1 - minwdth_os; - sdx = minwdth_os; - sdy = lgy2 - lgy1 + minwdth_os; - if (!rect_list_sup (sx, sy, sdx, sdy, temp_list_s, qty1, qty2)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), sx, sy, sdx, sdy, layer_num, mbk_type, NULL); - mark_scotch (*temp_list_p); - STAT_SCTCH_CRTD++; - *modif = 1; - } - else - { - fprintf (stderr, "***s2r error***, scotch error (%.1f, %.1f)\n", - (float) sx / RDS_LAMBDA, (float) sy / RDS_LAMBDA); - } - } - } - return; - } - } - } - } - } - } - else - { /* yy1>=y2 */ - if (lgx1 >= x2) - { - if (lgx1 < lgx2) - { - if (lgy1 <= lgy2) - { -/* cas 5 */ -/* _____________ */ -/* | 2 | */ -/* _______|_______ | */ -/* | 1 | | | */ -/* |_______|_______| | */ -/* |_____________| */ - desc1->DX = lgx2 - x1; - mark_used (desc1); - return; - } - } - } - } - if (lgx1 >= x2) - { - if (lgx1 < lgx2) - { - if (yy1 <= y2) - { - if (lgy1 >= lgy2) - { -/* cas 6 */ -/* _____________ */ -/* | 1 | */ -/* | ______|______ */ -/* | | | 2 | */ -/* | |______|______| */ -/* |_____________| */ - desc2->X = x1; - desc2->DX = lgx2 - x1; - mark_used (desc2); - return; - } - } - } - } - } - } - if (x1 <= x2) - { - if (lgx1 < lgx2) - { - if ((passage == 0) || (is_scotch (desc1)) || (is_scotch (desc2))) - { - if (lgx1 >= x2) - { - if (yy1 > y2) - { - if (lgy1 > lgy2) - { - if (yy1 <= lgy2) - { -/* cas 7 */ -/* ______________ */ -/* | 1 ____|____ */ -/* | | | 2 | */ -/* |_________|____| | */ -/* |_________| */ - if (supegl_dimin ((lgy2 - yy1), layer_num)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), - x1, yy1, lgx2 - x1, lgy2 - yy1, layer_num, mbk_type, NULL); - } - else - { - need_scotch = 1; - } - if (x2 != lgx1) - { - if (supegl_dimin ((lgx1 - x2), layer_num)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), - x2, y2, lgx1 - x2, lgy1 - y2, layer_num, mbk_type, NULL); - need_scotch = 0; - } - } - if (need_scotch) - { - qty1 = GET_S2R_OVERSIZE (layer_num); - qty2 = GET_S2R_POST_COMPLEMENTARY (layer_num); - - if (qty2 != RDS_S2R_POST_TREAT_EMPTY) - { - qty2 = GET_S2R_OVERSIZE (qty2); - } - else - { - qty2 = 0; - } - minwdth_os = GET_S2R_LAYER_WIDTH (layer_num) + 2 * qty1; - STAT_SCTCH_RQRD++; - sx = lgx1 - minwdth_os; - sy = lgy2 - minwdth_os; - sdx = minwdth_os; - sdy = lgy1 - lgy2 + minwdth_os; - if (!rect_list_sup (sx, sy, sdx, sdy, temp_list_s, qty1, qty2)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), sx, sy, sdx, sdy, layer_num, mbk_type, NULL); - mark_scotch (*temp_list_p); - STAT_SCTCH_CRTD++; - *modif = 1; - } - else - { - sx = x2; - sy = y2; - sdx = minwdth_os; - sdy = yy1 - y2 + minwdth_os; - if (!rect_list_sup (sx, sy, sdx, sdy, temp_list_s, qty1, qty2)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), sx, sy, sdx, sdy, layer_num, mbk_type, NULL); - mark_scotch (*temp_list_p); - STAT_SCTCH_CRTD++; - *modif = 1; - } - else - { - fprintf (stderr, "***s2r error***, scotch error (%.1f, %.1f)\n", - (float) sx / RDS_LAMBDA, (float) sy / RDS_LAMBDA); - } - } - } - return; - } - } - } - } - } - } - else - { /* x1+dx1>=x2+dx2 */ - if (yy1 < y2) - { - if (lgy1 >= y2) - { - if (lgy1 < lgy2) - { -/* cas 8 */ -/* _________ */ -/* | 2 | */ -/* ______|_________|_______ */ -/* | 1 |_________| | */ -/* | | */ -/* |________________________| */ - desc2->Y = yy1; - desc2->DY = lgy2 - yy1; - mark_used (desc2); - return; - } - } - } - if (yy1 > y2) - { - if (lgy1 > lgy2) - { - if (yy1 <= lgy2) - { -/* cas 9 */ -/* _________ */ -/* | 1 | */ -/* | ___ | */ -/* |__|___|__| */ -/* | 2 | */ -/* |___| */ - desc2->DY = lgy1 - y2; - mark_used (desc2); - return; - } - } - } - } - } - if (x1 > x2) - { - if (x1 <= lgx2) - { - if (lgx1 > lgx2) - { - if (yy1 <= y2) - { - if (lgy1 >= lgy2) - { -/* cas 10 */ -/* _____________ */ -/* | 1 | */ -/* _______|_______ | */ -/* | 2 | | | */ -/* |_______|_______| | */ -/* |_____________| */ - desc2->DX = lgx1 - x2; - mark_used (desc2); - return; - } - } - if (yy1 >= y2) - { - if (lgy1 <= lgy2) - { -/* cas 11 */ -/* _____________ */ -/* | 2 | */ -/* | ______|______ */ -/* | | | 1 | */ -/* | |______|______| */ -/* |_____________| */ - desc1->X = x2; - desc1->DX = lgx1 - x2; - mark_used (desc1); - return; - } - } - } - if ((passage == 0) || (is_scotch (desc1)) || (is_scotch (desc2))) - { - if (lgx1 >= lgx2) - { - if (yy1 > y2) - { - if (lgy1 > lgy2) - { - if (yy1 <= lgy2) - { -/* cas 12 */ -/* _____________ */ -/* | 1 | */ -/* ________|_______ | */ -/* | 2 |_______|_____| */ -/* | | */ -/* |________________| */ - if (x1 != lgx2) - { - if (supegl_dimin ((lgx2 - x1), layer_num)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), - x1, y2, lgx2 - x1, lgy1 - y2, layer_num, mbk_type, NULL); - } - else - { - need_scotch = 1; - } - } - if (supegl_dimin ((lgy2 - yy1), layer_num)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), - x2, yy1, lgx1 - x2, lgy2 - yy1, layer_num, mbk_type, NULL); - need_scotch = 0; - } - if (need_scotch) - { - qty1 = GET_S2R_OVERSIZE (layer_num); - qty2 = GET_S2R_POST_COMPLEMENTARY (layer_num); - - if (qty2 != RDS_S2R_POST_TREAT_EMPTY) - { - qty2 = GET_S2R_OVERSIZE (qty2); - } - else - { - qty2 = 0; - } - minwdth_os = GET_S2R_LAYER_WIDTH (layer_num) + 2 * qty1; - STAT_SCTCH_RQRD++; - sx = lgx2 - minwdth_os; - sy = yy1; - sdx = lgx1 - lgx2 + minwdth_os; - sdy = minwdth_os; - if (!rect_list_sup (sx, sy, sdx, sdy, temp_list_s, qty1, qty2)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), sx, sy, sdx, sdy, layer_num, mbk_type, NULL); - mark_scotch (*temp_list_p); - STAT_SCTCH_CRTD++; - *modif = 1; - } - else - { - sx = x2; - sy = lgy2 - minwdth_os; - sdx = x1 - x2 + minwdth_os; - sdy = minwdth_os; - if (!rect_list_sup (sx, sy, sdx, sdy, temp_list_s, qty1, qty2)) - { - (*temp_list_p) = rds_rectangle_in ((*temp_list_p), sx, sy, sdx, sdy, layer_num, mbk_type, NULL); - - mark_scotch (*temp_list_p); - STAT_SCTCH_CRTD++; - *modif = 1; - } - else - { - fprintf (stderr, "***s2r error***, scotch error (%.1f, %.1f)\n", - (float) sx / RDS_LAMBDA, (float) sy / RDS_LAMBDA); - } - } - } - return; - } - } - } - } - } - } - } - return; -} /* END contact_2() */ - -/***************************************************************************** - * merge_layer_win: merges the rectangles of the given list - given also their - * layer. - * Merge consists of: - * - eliminating redundancy (inclusion). - * - extending rectangles. - * - creating compensation rectangles. - ****************************************************************************/ - -static void merge_layer_win (temp_list, layer_num) - register rds_rectanglep_typ *temp_list; - register int layer_num; -{ - unsigned char modif, modif1, modif2; - register char passage = 0; - register rdsrec_list *desc1; - register rdsrec_list *desc2; - - do - { - modif = 0; - for (desc1 = (*temp_list); desc1; desc1 = desc1->NEXT) - { - if (is_remove (desc1) || IsRdsConExter (desc1) || IsRdsRefRef (desc1) || IsRdsRefCon (desc1)) - continue; - - for (desc2 = desc1->NEXT; desc2; desc2 = desc2->NEXT) - { - if (is_remove (desc2) || IsRdsConExter (desc2) || IsRdsRefRef (desc2) || IsRdsRefCon (desc2)) - continue; - - modif1 = 0; - modif2 = 0; - /* appel des tests permettant l'unification */ - inclus (&modif, &modif1, &modif2, desc1, desc2); - - if (modif1 == 0) - { - if (modif2 == 0) - { - prolong (&modif, &modif1, desc1, desc2); - if (modif1 == 0) - { - contact (temp_list, layer_num, passage, desc1, desc2); - } - else - break; - } - } - else - break; - } /* fin for desc2 */ - } /* fin for desc1 */ - /* les creations de masques sont faites dans la premiere passe du while(), passage=0. - Ceci signifie que un masque genere n'entraine pas de creation de masques. Le fait de - travailler avec un desc2 toujours > a desc1, elimine toute redondance d'unification - */ - rds_remove_rectangle (temp_list); - passage++; - } - while (modif == 1); -} /* END merge_layer_win() */ - - -/***************************************************************************** - * merge_layer_win_2: merges the rectangles of the given list - given also their - * layer. - * Merge consists of: - * - eliminating redundancy (inclusion). - * - extending rectangles. - * - creating compensation rectangles. - * - creating scotchs. - ****************************************************************************/ - -static void merge_layer_win_2 (layer_num, temp_list_p, temp_list_s, temp_list_t) - register int layer_num; - register rds_rectanglep_typ *temp_list_p; - register rdsrec_list *temp_list_s, *temp_list_t; -{ - unsigned char modif, modif1, modif2; - register char passage = 0; - register rdsrec_list *desc1; - register rdsrec_list *desc2; - - do - { - modif = 0; - for (desc1 = (*temp_list_p); desc1; desc1 = desc1->NEXT) - { - if (is_remove (desc1) || IsRdsConExter (desc1) || IsRdsRefRef (desc1) || IsRdsRefCon (desc1)) - continue; - - for (desc2 = desc1->NEXT; desc2; desc2 = desc2->NEXT) - { - if (is_remove (desc2) || IsRdsConExter (desc2) || IsRdsRefRef (desc2) || IsRdsRefCon (desc2)) - continue; - modif1 = 0; - modif2 = 0; - - /* appel des tests permettant l'unification */ - inclus (&modif, &modif1, &modif2, desc1, desc2); - if (modif1 == 0) - { - if (modif2 == 0) - { - prolong (&modif, &modif1, desc1, desc2); - if (modif1 == 0) - contact_2 (temp_list_p, temp_list_s, temp_list_t, layer_num, passage, desc1, desc2, &modif); - else - break; - } - } - else - break; - } /* fin for desc2 */ - if (is_scotch (desc1)) - demark_scotch (desc1); - } /* fin for desc1 */ - /* les creations de masques sont faites dans la premiere passe du while(), passage=0. - Ceci signifie que un masque genere n'entraine pas de creation de masques. Le fait de - travailler avec un desc2 toujours > a desc1, elimine toute redondance d'unification - */ - rds_remove_rectangle (temp_list_p); - passage++; - } - while (modif == 1); -} /* END merge_layer_win2 () */ - - -/**************************************************************************** - * calculate_window: calculates the window used in merging the rectangles of - * the specified layer of the specified model. - * The dimensions of this window are put in dx and dy; and - * the number of times it will partition the x dimension - * and the y dimension of the envelop of the model are put - * in nx and ny respectively. - ***************************************************************************/ - -static void calculate_window (model, layer_num, dx, dy, nx, ny) - rdsfig_list *model; - int layer_num; - long *dx, *dy, *nx, *ny; -{ - double tot_num_seg, nb_win, sq_win; - rdsrec_list *rect; - - if (is_empty (model, layer_num)) - printf ("There is an error\n\n"); - for (rect = model->LAYERTAB[layer_num], tot_num_seg = 0; rect; rect = rect->NEXT, tot_num_seg++); - if (tot_num_seg == 0) - { - *dx = *dy = *nx = *ny = 0; - } - else - { - nb_win = 2 * (double) sqrt ((double) tot_num_seg); - sq_win = (double) sqrt ((double) nb_win); - *nx = (long) sq_win + 1; - *ny = *nx; - *dx = model->BBOXTAB[layer_num]->DX / (*nx) + 1; - *dy = model->BBOXTAB[layer_num]->DY / (*ny) + 1; - } -} - - -/****************************************************************************** - * concat_list: concatenates the rectangle list 2 to the rectangle list 1. - *****************************************************************************/ - -static void concat_list (list1, list2) - rds_rectanglep_typ *list1; - rdsrec_list *list2; -{ - typedef rdsrec_list *rds_rectangle_typ; - rds_rectangle_typ *layer_tail; - register rdsrec_list *rectp; - - /* get the tail of list1 */ - for (rectp = (*list1); rectp && rectp->NEXT; rectp = rectp->NEXT); - if (rectp) - layer_tail = &(rectp->NEXT); - else - layer_tail = list1; - *layer_tail = list2; -} - -/****************************************************************************** - * merge_layer: merges the rectangles of the specified layer of the specified - * model. - *****************************************************************************/ - -void merge_layer (model, layer_num, verbose) - rdsfig_list *model; - int layer_num; - int verbose; -{ - long corn_width, dx, dy, nx, ny, wx, wy, countx, county; - rdsrec_list *temp_list; - long nb_win, prc = 0, new_prc = 0, iteration, dot = 0; - - if (model->LAYERTAB[layer_num]) - { - if (verbose) - { - printf ("\t . %s ", RDS_LAYER_NAME[layer_num]); - fflush (stdout); - } - /* corn_width = GET_S2R_RING_WIDTH( layer_num ); */ - corn_width = 0; - calculate_window (model, layer_num, &dx, &dy, &nx, &ny); - nb_win = nx * ny; - iteration = 0; - - for (countx = 0; countx < nx; countx++) - { - for (county = 0; county < ny; county++) - { - iteration++; - if (verbose) - { - new_prc = (iteration * 100 / nb_win) / 3; /* one dot each 3% */ - if (new_prc > prc) - { - dot++; - printf ("."); - fflush (stdout); - prc = new_prc; - } - } - wx = model->BBOXTAB[layer_num]->X + countx * dx - corn_width; - wy = model->BBOXTAB[layer_num]->Y + county * dy - corn_width; - - temp_list = ext_win_segs (model, layer_num, wx, wy, dx + 2 * corn_width, dy + 2 * corn_width); - - merge_layer_win (&(temp_list), layer_num); - concat_list (&(model->LAYERTAB[layer_num]), temp_list); - } - } - if (verbose) - { - for (; dot < 33; dot++) - printf ("."); - printf ("\n"); - fflush (stdout); - } - } -} - -/****************************************************************************** - * merge_layer_2: merges the rectangles of the specified layer of the specified - * model. - * remarks: - * - It differs with merge_layer() in that it calls - * merge_layer_win_2() instead of merge_layer_win(). - * - IT makes another merge in the reverse windowing direction - * to compensate changes that might be done by scotchs. - *****************************************************************************/ - -void merge_layer_2 (model, layer_num, verbose) - rdsfig_list *model; - int layer_num; - int verbose; -{ - long corn_width, countx, county, wx, wy, dx, dy, nx, ny; - rdsrec_list *temp_list_p, *temp_list_s, *temp_list_t; - int comp_layer; - long dot = 0, nb_win, prc = 0, new_prc = 0, iteration; - - temp_list_t = (rdsrec_list *) 0; - temp_list_p = (rdsrec_list *) 0; - temp_list_s = (rdsrec_list *) 0; - - if (model->LAYERTAB[layer_num]) - { - if (verbose) - { - printf ("\t . %s ", RDS_LAYER_NAME[layer_num]); - fflush (stdout); - } -/* corn_width = GET_S2R_RING_WIDTH( layer_num ); */ - corn_width = 0; - calculate_window (model, layer_num, &dx, &dy, &nx, &ny); - nb_win = nx * ny; - iteration = 0; - for (countx = 0; countx < nx; countx++) - { - for (county = 0; county < ny; county++) - { - iteration++; - if (verbose) - { - new_prc = (iteration * 100 / nb_win) / 6; /* one dot each 6% */ - if (new_prc > prc) - { - dot++; - printf ("."); - fflush (stdout); - prc = new_prc; - } - } - wx = model->BBOXTAB[layer_num]->X + countx * dx - corn_width; - wy = model->BBOXTAB[layer_num]->Y + county * dy - corn_width; - temp_list_p = ext_win_segs (model, layer_num, wx, wy, dx + 2 * corn_width, dy + 2 * corn_width); - - comp_layer = GET_S2R_POST_COMPLEMENTARY (layer_num); - if (comp_layer != RDS_S2R_POST_TREAT_EMPTY) - { - temp_list_s = model->LAYERTAB[comp_layer]; - } - else - { - temp_list_s = NULL; - } - merge_layer_win_2 (layer_num, &(temp_list_p), temp_list_s, temp_list_t); - concat_list (&(model->LAYERTAB[layer_num]), temp_list_p); - } - } - iteration = 0; - prc = 0; - - /* another pass beginning with the windows in opposite direction - * to resolve the problems that might appear if creating of scotchs - * result in creation of rectangles in a window previously treated - */ - - for (countx = nx - 1; countx >= 0; countx--) - { - for (county = ny - 1; county >= 0; county--) - { - iteration++; - if (verbose) - { - new_prc = (iteration * 100 / nb_win) / 6; /* one dot each 6% */ - if (new_prc > prc) - { - dot++; - printf ("."); - fflush (stdout); - prc = new_prc; - } - } - wx = model->BBOXTAB[layer_num]->X + countx * dx - corn_width; - wy = model->BBOXTAB[layer_num]->Y + county * dy - corn_width; - - temp_list_p = ext_win_segs (model, layer_num, wx, wy, dx + 2 * corn_width, dy + 2 * corn_width); - merge_layer_win_2 (layer_num, &(temp_list_p), temp_list_s, temp_list_t); - concat_list (&(model->LAYERTAB[layer_num]), temp_list_p); - } - } - if (verbose) - { - for (; dot < 33; dot++) - printf ("."); - printf ("\n"); - fflush (stdout); - } - } -} diff --git a/alliance/src/s2r/src/merge.h b/alliance/src/s2r/src/merge.h deleted file mode 100644 index 114249a1..00000000 --- a/alliance/src/s2r/src/merge.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - */ - -extern void merge_layer_2 (rdsfig_list *model, int layer_num, int verbose); -extern void merge_layer (rdsfig_list *model, int layer_num, int verbose); diff --git a/alliance/src/s2r/src/postrat.c b/alliance/src/s2r/src/postrat.c deleted file mode 100644 index 69b38fc2..00000000 --- a/alliance/src/s2r/src/postrat.c +++ /dev/null @@ -1,1242 +0,0 @@ -/* - * 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. - */ - -/****************************************************************************/ -/* */ -/* ALLIANCE CAO & VLSI CAD */ -/* */ -/* Product : (S)ymbolic (2)to (R)eal translater */ -/* File : postreat.c */ -/* */ -/* (c) copyright 1992 MASI laboratory CAO & VLSI team */ -/* All Right Reserved */ -/* Support : e-mail cao-vlsi@masi.ibp.fr */ -/* */ -/****************************************************************************/ -/* */ -/* Post treatement functions */ -/* */ -/****************************************************************************/ -/* fonction void couron_layer () */ -/* ATTENTION! dx et dy ne sont pas les longueurs mais les positions hautes */ -/* et droites des couronnes dans couronne[] */ -/****************************************************************************/ - -#include "generic.h" -#include "mph.h" -#include "mut.h" -#include "rds.h" -#include "rpr.h" -#include "rtl.h" -#include "rfm.h" -#include "rdsacces.h" -#include "postrat.h" -#include "merge.h" -#include "hash.h" -#include "math.h" - -/************************************************************************* - * bigstacked_layer : maximise layer patch in stacked via - *************************************************************************/ -static void bigstacked_layer (model, layer_num) - rdsfig_list *model; - int layer_num; -{ - rdsrec_list *rectp; - long min_area = 6400; // GET_S2R_MINAREA (layer_num); - long cpt = 0; - - for (rectp = model->LAYERTAB[layer_num]; rectp; rectp = rectp->NEXT) - { - long a = rectp->DY * rectp->DX; - if ((rectp->DX == rectp->DY) && (a <= min_area)) - { - double ma = sqrt (((double) min_area) / RDS_UNIT / RDS_UNIT); - cpt++; - min_area = a; - printf ("layer %d, model %s, min area %ld (%gx%g), %g, %g, %ld occurences\n", layer_num, model->NAME, min_area, ma, ma, - ((double)rectp->X)/RDS_UNIT, ((double)rectp->Y)/RDS_UNIT, cpt); - } - } - if (cpt) - { - double ma = sqrt (((double) min_area) / RDS_UNIT / RDS_UNIT); - printf ("layer %d, model %s, min area %ld (%gx%g), %ld occurences\n", layer_num, model->NAME, min_area, ma, ma, cpt); - } -} - -/************************************************************************* - * resize_layer : extends the sides of all the rectangles in the specified - * layer in the specified model by the amount "qty" at each - * extreme. - *************************************************************************/ -static void resize_layer (model, layer_num) - rdsfig_list *model; - int layer_num; -{ - rdsrec_list *rectp; - long qty; /* given in rds_unit */ - - qty = GET_S2R_OVERSIZE (layer_num); - - for (rectp = model->LAYERTAB[layer_num]; rectp; rectp = rectp->NEXT) - { - (long) rectp->X -= qty; - (long) rectp->Y -= qty; - (long) rectp->DX += 2 * qty; - (long) rectp->DY += 2 * qty; - } -} - -/***************************************************************************** - * inv_resize_layer : minimizes the sides of all the rectangles in the specified - * layer in the specified model by the amount "qty" at each - * extreme. - *****************************************************************************/ -static void inv_resize_layer (model, layer_num) - rdsfig_list *model; - int layer_num; -{ - rdsrec_list *rectp; - long qty; /* given in rds_unit */ - - qty = GET_S2R_OVERSIZE (layer_num); - - for (rectp = model->LAYERTAB[layer_num]; rectp; rectp = rectp->NEXT) - { - (long) rectp->X += qty; - (long) rectp->Y += qty; - (long) rectp->DX -= 2 * qty; - (long) rectp->DY -= 2 * qty; - } -} - -/****************************************************************************** - * adjust_rectangle: adjusts the data of the rectangle considering the symmetry - * of the instance containning it. - * The given symmetry might be different from the symmetry - * of the instance in its father ( the case of several - * hierarchical levels). - * This function is used when copying the rectangle in higher - * hierarchical level. - *****************************************************************************/ -static void adjust_rectangle (x, y, dx, dy, xins, yins, sym) - long *x, *y, *dx, *dy; - long xins, yins; - char sym; -{ - long tx, ty, tdx, tdy; - - tx = *x; - ty = *y; - tdx = *dx; - tdy = *dy; - - switch (sym) - { - case NOSYM: - *x += xins; - *y += yins; - break; - case SYM_X: - *x = xins - tx - tdx; - *y += yins; - break; - case SYM_Y: - *x += xins; - *y = yins - ty - tdy; - break; - case SYMXY: - *x = xins - tx - tdx; - *y = yins - ty - tdy; - break; - case ROT_P: - *x = xins - ty - tdy; - *y = yins + tx; - *dx = tdy; - *dy = tdx; - break; - case ROT_M: - *x = xins + ty; - *y = yins - tx - tdx; - *dx = tdy; - *dy = tdx; - break; - case SY_RP: - *x = xins + ty; - *y = yins + tx; - *dx = tdy; - *dy = tdx; - break; - case SY_RM: - *x = xins - ty - tdy; - *y = yins - tx - tdx; - *dx = tdy; - *dy = tdx; - break; - default: - (void) fprintf (stderr, "**post_trat**adj_rect:unknown symetry number %d\n", sym); - exit (1); - } -} - -/****************************************************************************** - * readjust_rectangle: adjusts the data of the rectangle considering the - * symmetry of the instance that will contain it. - * The given symmetry might be different from the symmetry - * of the instance in its father ( the case of several - * hierarchical levels). - * This function is used when copying the rectangle in lower - * hirerichal level. - *****************************************************************************/ -static void readjust_rectangle (x, y, dx, dy, xins, yins, sym) - long *x, *y, *dx, *dy; - long xins, yins; - char sym; -{ - long tx, ty, tdx, tdy; - - tx = *x; - ty = *y; - tdx = *dx; - tdy = *dy; - switch (sym) - { - case NOSYM: - *x -= xins; - *y -= yins; - break; - case SYM_X: - *x = xins - tx - tdx; - *y -= yins; - break; - case SYM_Y: - *x -= xins; - *y = yins - ty - tdy; - break; - case SYMXY: - *x = xins - tx - tdx; - *y = yins - ty - tdy; - break; - case ROT_P: - *x = ty - yins; - *y = xins - tdx - tx; - *dx = tdy; - *dy = tdx; - break; - case ROT_M: - *x = yins - tdy - ty; - *y = tx - xins; - *dx = tdy; - *dy = tdx; - break; - case SY_RP: - *x = ty - yins; - *y = tx - xins; - *dx = tdy; - *dy = tdx; - break; - case SY_RM: - *x = yins - tdy - ty; - *y = xins - tdx - tx; - *dx = tdy; - *dy = tdx; - break; - default: - (void) fprintf (stderr, "**post_trat**readj_rect:unknown symetry number %d\n", sym); - exit (1); - } -} - -/****************************************************************************** - * result_sym: gives the result of 2 successive symmetry. - *****************************************************************************/ -static char result_sym (first_sym, second_sym) - char first_sym, second_sym; -{ - switch (first_sym) - { - case NOSYM: - switch (second_sym) - { - case NOSYM: - return (NOSYM); - case SYM_X: - return (SYM_X); - case SYM_Y: - return (SYM_Y); - case SYMXY: - return (SYMXY); - case ROT_P: - return (ROT_P); - case ROT_M: - return (ROT_M); - case SY_RP: - return (SY_RP); - case SY_RM: - return (SY_RM); - default: - (void) fprintf (stderr, "**post_trat**result_sym:unknown symetry number %d\n", second_sym); - exit (1); - } - case SYM_X: - switch (second_sym) - { - case NOSYM: - return (SYM_X); - case SYM_X: - return (NOSYM); - case SYM_Y: - return (SYMXY); - case SYMXY: - return (SYM_Y); - case ROT_P: - return (SY_RM); - case ROT_M: - return (SY_RP); - case SY_RP: - return (ROT_M); - case SY_RM: - return (ROT_P); - default: - (void) fprintf (stderr, "**post_trat**result_sym:unknown symetry number %d\n", second_sym); - exit (1); - } - case SYM_Y: - switch (second_sym) - { - case NOSYM: - return (SYM_Y); - case SYM_X: - return (SYMXY); - case SYM_Y: - return (NOSYM); - case SYMXY: - return (SYM_X); - case ROT_P: - return (SY_RP); - case ROT_M: - return (SY_RM); - case SY_RP: - return (ROT_P); - case SY_RM: - return (ROT_M); - default: - (void) fprintf (stderr, "**post_trat**result_sym:unknown symetry number %d\n", second_sym); - exit (1); - } - case SYMXY: - switch (second_sym) - { - case NOSYM: - return (SYMXY); - case SYM_X: - return (SYM_Y); - case SYM_Y: - return (SYM_X); - case SYMXY: - return (NOSYM); - case ROT_P: - return (ROT_M); - case ROT_M: - return (ROT_P); - case SY_RP: - return (SY_RM); - case SY_RM: - return (SY_RP); - default: - (void) fprintf (stderr, "**post_trat**result_sym:unknown symetry number %d\n", second_sym); - exit (1); - } - case ROT_P: - switch (second_sym) - { - case NOSYM: - return (ROT_P); - case SYM_X: - return (SY_RP); - case SYM_Y: - return (SY_RM); - case SYMXY: - return (ROT_M); - case ROT_P: - return (SYMXY); - case ROT_M: - return (NOSYM); - case SY_RP: - return (SYM_Y); - case SY_RM: - return (SYM_X); - default: - (void) fprintf (stderr, "**post_trat**result_sym:unknown symetry number %d\n", second_sym); - exit (1); - } - case ROT_M: - switch (second_sym) - { - case NOSYM: - return (ROT_M); - case SYM_X: - return (SY_RM); - case SYM_Y: - return (SY_RP); - case SYMXY: - return (ROT_P); - case ROT_P: - return (NOSYM); - case ROT_M: - return (SYMXY); - case SY_RP: - return (SYM_X); - case SY_RM: - return (SYM_Y); - default: - (void) fprintf (stderr, "**post_trat**result_sym:unknown symetry number %d\n", second_sym); - exit (1); - } - case SY_RP: - switch (second_sym) - { - case NOSYM: - return (SY_RP); - case SYM_X: - return (ROT_P); - case SYM_Y: - return (ROT_M); - case SYMXY: - return (SY_RM); - case ROT_P: - return (SYM_X); - case ROT_M: - return (SYM_Y); - case SY_RP: - return (NOSYM); - case SY_RM: - return (SYMXY); - default: - (void) fprintf (stderr, "**post_trat**result_sym:unknown symetry number %d\n", second_sym); - exit (1); - } - case SY_RM: - switch (second_sym) - { - case NOSYM: - return (SY_RM); - case SYM_X: - return (ROT_M); - case SYM_Y: - return (ROT_P); - case SYMXY: - return (SY_RP); - case ROT_P: - return (SYM_Y); - case ROT_M: - return (SYM_X); - case SY_RP: - return (SYMXY); - case SY_RM: - return (NOSYM); - default: - (void) fprintf (stderr, "**post_trat**result_sym:unknown symetry number %d\n", second_sym); - exit (1); - } - default: - (void) fprintf (stderr, "**post_trat**result_sym:unknown symetry number %d\n", first_sym); - exit (1); - } - return (NOSYM); -} - -/***************************************************************************** - * flatten_instance_layer: copies to the given layer_tail, all the segments - * in the given instance that intersect the couron of - * the given ancetre, using the given father_sym - * to compose the resulting symmetry of the instance - * in the ancetre. - * The segments of the sons instances are copied also - * as it is a recursive function. - ******************************************************************************/ -static void flatten_instance_layer (instance, ancetre, comp_sym, origin_x, origin_y, layer_tail, layer_num) - rdsins_list *instance; /* instance where there is rectangles to flatten */ - rdsins_list *ancetre; /* first instance where the ring is defined */ - char comp_sym; /* symetry comp of instances without the first */ - long origin_x, origin_y; /* origin comp of instances without the first */ - rds_rectanglep_typ *layer_tail; - int layer_num; -{ - rdsfig_list *modelp; - rdsins_list *instancef; - long nx, ny, ndx, ndy; - long dummy1, dummy2; - long new_origin_x, new_origin_y; - rdsrec_list *rectp; - - modelp = rds_model_out (instance->FIGNAME); - if (incataloggds (instance->FIGNAME)) - return; - - dummy1 = 0l; - dummy2 = 0l; - new_origin_x = origin_x; - new_origin_y = origin_y; - origin_x = instance->X; - origin_y = instance->Y; - adjust_rectangle (&origin_x, &origin_y, &dummy1, &dummy2, new_origin_x, new_origin_y, comp_sym); - comp_sym = result_sym (instance->TRANSF, comp_sym); - - for (instancef = modelp->INSTANCE; instancef; instancef = instancef->NEXT) - flatten_instance_layer (instancef, ancetre, comp_sym, origin_x, origin_y, layer_tail, layer_num); - - for (rectp = modelp->LAYERTAB[layer_num]; rectp; rectp = rectp->NEXT) - { - if (IsRdsConExter (rectp)) - continue; - if (IsRdsRefRef (rectp)) - continue; - if (IsRdsRefCon (rectp)) - continue; - - nx = rectp->X; - ny = rectp->Y; - ndx = rectp->DX; - ndy = rectp->DY; - - adjust_rectangle (&nx, &ny, &ndx, &ndy, origin_x, origin_y, comp_sym); - if ((nx <= ancetre->COURONNE[layer_num]->X) - || (ny <= ancetre->COURONNE[layer_num]->Y) - || ((nx + ndx) >= ancetre->COURONNE[layer_num]->DX) || ((ny + ndy) >= ancetre->COURONNE[layer_num]->DY)) - { - adjust_rectangle (&nx, &ny, &ndx, &ndy, ancetre->X, ancetre->Y, ancetre->TRANSF); - - *layer_tail = rds_rectangle_in (*layer_tail, nx, ny, ndx, ndy, layer_num, rectp->FLAGS, NULL); - mark_flattenres (*layer_tail); - } - } -} - -/****************************************************************************** - * flatten_layer: copies from: all the instances in the specified model in the - * the specified layer any rectangle that intersects - * the couron of the instance or even touches it. - * to: the list of rectangles of the specified model in - * th specified layer. - * A flattened rectangle is marked (flattened) so that if it is - * not used in the merging stage, it will be removed in the - * cleanning stage. - * remark: if there is more than 2 hierarchical levels, there - * will be a call to the flatten_instance_layer() function. - *****************************************************************************/ -static void flatten_layer (model, layer_num) - rdsfig_list *model; - int layer_num; -{ - rdsins_list *instance, *instancef; - rdsrec_list *rectp; - rds_rectanglep_typ *layer_tail; - rdsfig_list *modelp; - long nx, ny, ndx, ndy; - - /* get the tail of the list of segments of the model */ - for (rectp = model->LAYERTAB[layer_num]; (rectp && rectp->NEXT); rectp = rectp->NEXT) - ; - if (rectp) - layer_tail = &(rectp->NEXT); - else - layer_tail = &(model->LAYERTAB[layer_num]); - - for (instance = model->INSTANCE; instance; instance = instance->NEXT) - { - modelp = rds_model_out (instance->FIGNAME); - if (incataloggds (instance->FIGNAME)) - continue; - /* flatten lower levels of the hierarchy */ - for (instancef = modelp->INSTANCE; instancef; instancef = instancef->NEXT) - { - flatten_instance_layer (instancef, instance, NOSYM, /* no symetry for the model */ - 0l, 0l, layer_tail, layer_num); - } - /* flatten the instances of the model */ - for (rectp = modelp->LAYERTAB[layer_num]; rectp; rectp = rectp->NEXT) - { - nx = rectp->X; - ny = rectp->Y; - ndx = rectp->DX; - ndy = rectp->DY; - if ((nx <= instance->COURONNE[layer_num]->X) - || (ny <= instance->COURONNE[layer_num]->Y) - || ((nx + ndx) >= instance->COURONNE[layer_num]->DX) || ((ny + ndy) >= instance->COURONNE[layer_num]->DY)) - { - adjust_rectangle (&nx, &ny, &ndx, &ndy, instance->X, instance->Y, instance->TRANSF); - *layer_tail = rds_rectangle_in (*layer_tail, nx, ny, ndx, ndy, layer_num, rectp->FLAGS, NULL); - mark_flattenres (*layer_tail); - } - } - } -} - -/***************************************************************************** - * envelop_layer: defines the envelop of the specified model in the specified - * layer. - * i.e. the minimum rectangle that contains all the rectangles - * and all the envelops of all instances of the specified model - * in the specified layer. - * This function as it takes into consideration the envelops - * of the instances of the model it must be applied to the - * instances before the father model; what is done implicitly - * by the post_treat function. - * This function once applied on a model at a layer, marks that - * model enveloped at that layer. - * If the model at that layer does not contain any rectangles, - * it is marked empty at that layer. - ****************************************************************************/ -static void envelop_layer (model, layer_num) - rdsfig_list *model; - int layer_num; -{ - rdsfig_list *modelp; - rdsins_list *instancep; - long lx, ly, gx, gy; - rdsrec_list *rectp; - char init = 0; - long nx, ny, ndx, ndy; - - /* printf("envelop %d\n",layer_num); */ - - lx = ly = gx = gy = 0; - - /* segments of the model */ - if (model->LAYERTAB[layer_num]) - { - lx = model->LAYERTAB[layer_num]->X; - ly = model->LAYERTAB[layer_num]->Y; - gx = model->LAYERTAB[layer_num]->X + model->LAYERTAB[layer_num]->DX; - gy = model->LAYERTAB[layer_num]->Y + model->LAYERTAB[layer_num]->DY; - init = 1; - for (rectp = model->LAYERTAB[layer_num]; rectp; rectp = rectp->NEXT) - { - if (rectp->X < lx) - lx = rectp->X; - if (rectp->Y < ly) - ly = rectp->Y; - if ((rectp->X + rectp->DX) > gx) - gx = rectp->X + rectp->DX; - if ((rectp->Y + rectp->DY) > gy) - gy = rectp->Y + rectp->DY; - } - } - /* envelops of the instances of the model */ - for (instancep = model->INSTANCE; instancep; instancep = instancep->NEXT) - { - modelp = rds_model_out (instancep->FIGNAME); - if (!(is_empty (modelp, layer_num)) && !(incataloggds (instancep->FIGNAME))) - { - rectp = modelp->BBOXTAB[layer_num]; - nx = rectp->X; - ny = rectp->Y; - ndx = rectp->DX; - ndy = rectp->DY; - adjust_rectangle (&nx, &ny, &ndx, &ndy, instancep->X, instancep->Y, instancep->TRANSF); - if (init) - { - if (nx < lx) - lx = nx; - if (ny < ly) - ly = ny; - if ((nx + ndx) > gx) - gx = nx + ndx; - if ((ny + ndy) > gy) - gy = ny + ndy; - } - else - { - lx = nx; - ly = ny; - gx = nx + ndx; - gy = ny + ndy; - init = 1; - } - } - } - if (init) - model->BBOXTAB[layer_num] = -/* A VOIR 5 mai 1994 - rds_rectangle_in( model->BBOXTAB[ layer_num], lx, ly, - gx - lx, gy - ly, layer_num, rectp->FLAG, NULL ); - */ - rds_rectangle_in (model->BBOXTAB[layer_num], lx, ly, gx - lx, gy - ly, layer_num, NULL); - else - mark_empty (model, layer_num); -} - -/***************************************************************************** - * mod_ins_couron: given an instance, a layer and the rectangle of intersection - * of this instance with another instance; it modifies the - * couron of this instance in that layer if the rectangle of - * intersection makes the couron wider at any side. - *****************************************************************************/ -static void mod_ins_couron (instance, layer_num, xi, yi, dxi, dyi) - rdsins_list *instance; - int layer_num; - long xi, yi, dxi, dyi; -{ - rdsfig_list *model; - long corn_width, xe, ye, dxe, dye; - - model = rds_model_out (instance->FIGNAME); - - corn_width = GET_S2R_RING_WIDTH (layer_num) + GET_S2R_LAYER_WIDTH (layer_num) / 2; - xe = model->BBOXTAB[layer_num]->X; - ye = model->BBOXTAB[layer_num]->Y; - dxe = model->BBOXTAB[layer_num]->DX; - dye = model->BBOXTAB[layer_num]->DY; - - readjust_rectangle (&xi, &yi, &dxi, &dyi, instance->X, instance->Y, instance->TRANSF); - - if ((xi - xe) > ((xe + dxe) - (xi + dxi))) - { - if ((xi - corn_width) < instance->COURONNE[layer_num]->DX) - instance->COURONNE[layer_num]->DX = xi - corn_width; - } - else if ((xi + dxi + corn_width) > instance->COURONNE[layer_num]->X) - instance->COURONNE[layer_num]->X = xi + dxi + corn_width; - - if ((yi - ye) > ((ye + dye) - (yi + dyi))) - { - if ((yi - corn_width) < instance->COURONNE[layer_num]->DY) - instance->COURONNE[layer_num]->DY = yi - corn_width; - } - else if ((yi + dyi + corn_width) > instance->COURONNE[layer_num]->Y) - instance->COURONNE[layer_num]->Y = yi + dyi + corn_width; -} - -/***************************************************************************** - * couron_layer: defines the courons of every instance in the specified model - * in the specified layer. - * The couron is determined by 4 limits: x, y, dx - * and dy beyond which is the couron area. - * ATTENTION! dx et dy ne sont pas les longueurs mais les positions hautes - * et droites des couronnes dans couronne[] - ****************************************************************************/ -static void couron_layer (model, layer_num, verbose) - rdsfig_list *model; - int layer_num; - int verbose; -{ - register rdsins_list *instance1, *instance2; - long x1, x2, y1, y2, dx1, dx2, dy1, dy2, rx, rdx, ry, rdy; - register rdsfig_list *model1, *model2; - long corn_width; - long dot = 0, nb_inst = 0, prc = 0, new_prc = 0, iteration, first = 1; - - corn_width = GET_S2R_RING_WIDTH (layer_num) + GET_S2R_LAYER_WIDTH (layer_num) / 2; - -/*\ - * initial couron based on the abutment box and the envelop -\*/ - for (instance1 = model->INSTANCE, nb_inst = 0; instance1; instance1 = instance1->NEXT, nb_inst++) - { - model1 = rds_model_out (instance1->FIGNAME); - if (incataloggds (instance1->FIGNAME)) - continue; -/*\ - * allocation d'une structure rectancle pour la couronne[layer_num] -\*/ - instance1->COURONNE[layer_num] = (rdsrec_list *) mbkalloc (sizeof (rdsrec_list)); - instance1->COURONNE[layer_num]->DY = model1->LAYERTAB[RDS_ABOX]->Y + model1->LAYERTAB[RDS_ABOX]->DY - corn_width; - instance1->COURONNE[layer_num]->Y = model1->LAYERTAB[RDS_ABOX]->Y + corn_width; - instance1->COURONNE[layer_num]->DX = model1->LAYERTAB[RDS_ABOX]->X + model1->LAYERTAB[RDS_ABOX]->DX - corn_width; - instance1->COURONNE[layer_num]->X = model1->LAYERTAB[RDS_ABOX]->X + corn_width; - - if (!is_empty (model1, layer_num)) - { - if (instance1->COURONNE[layer_num]->DY > (model1->BBOXTAB[layer_num]->Y + model1->BBOXTAB[layer_num]->DY - corn_width)) - { - instance1->COURONNE[layer_num]->DY = model1->BBOXTAB[layer_num]->Y + model1->BBOXTAB[layer_num]->DY - corn_width; - } - if (instance1->COURONNE[layer_num]->Y < (model1->BBOXTAB[layer_num]->Y + corn_width)) - { - instance1->COURONNE[layer_num]->Y = model1->BBOXTAB[layer_num]->Y + corn_width; - } - if (instance1->COURONNE[layer_num]->DX > (model1->BBOXTAB[layer_num]->X + model1->BBOXTAB[layer_num]->DX - corn_width)) - { - instance1->COURONNE[layer_num]->DX = model1->BBOXTAB[layer_num]->X + model1->BBOXTAB[layer_num]->DX - corn_width; - } - if (instance1->COURONNE[layer_num]->X < (model1->BBOXTAB[layer_num]->X + corn_width)) - { - instance1->COURONNE[layer_num]->X = model1->BBOXTAB[layer_num]->X + corn_width; - } - } - } -/*\ - * final couron based on instance intersections -\*/ - for (instance1 = model->INSTANCE, iteration = 0; instance1; instance1 = instance1->NEXT, iteration++) - { - model1 = rds_model_out (instance1->FIGNAME); - - if (incataloggds (instance1->FIGNAME)) - continue; - - if (verbose) - { - if (first) - { - printf ("\t . %s ", RDS_LAYER_NAME[layer_num]); - first = 0; - } - new_prc = (iteration * 100 / nb_inst) / 3; /* one dot each 3% */ - if (new_prc > prc) - { - dot++; - printf ("."); - fflush (stdout); - prc = new_prc; - } - } - - if (!(is_empty (model1, layer_num))) - { - x1 = model1->BBOXTAB[layer_num]->X; - y1 = model1->BBOXTAB[layer_num]->Y; - dx1 = model1->BBOXTAB[layer_num]->DX; - dy1 = model1->BBOXTAB[layer_num]->DY; - - adjust_rectangle (&x1, &y1, &dx1, &dy1, instance1->X, instance1->Y, instance1->TRANSF); - - for (instance2 = instance1->NEXT; instance2; instance2 = instance2->NEXT) - { - model2 = rds_model_out (instance2->FIGNAME); - - if (incataloggds (instance2->FIGNAME)) - { - continue; - } - - if (!(is_empty (model2, layer_num))) - { - x2 = model2->BBOXTAB[layer_num]->X; - y2 = model2->BBOXTAB[layer_num]->Y; - dx2 = model2->BBOXTAB[layer_num]->DX; - dy2 = model2->BBOXTAB[layer_num]->DY; - - adjust_rectangle (&x2, &y2, &dx2, &dy2, instance2->X, instance2->Y, instance2->TRANSF); - - if (rect_intersec (x1, x2, dx1, dx2, y1, y2, dy1, dy2, &rx, &rdx, &ry, &rdy)) - { - mod_ins_couron (instance1, layer_num, rx, ry, rdx, rdy); - mod_ins_couron (instance2, layer_num, rx, ry, rdx, rdy); - } - } - } - } - } - if (verbose && !first) - { - for (; dot < 33; dot++) - printf ("."); - printf ("\n"); - fflush (stdout); - } -} - -/****************************************************************************** - * cutcut : cut off layer shape from layer board in model - *****************************************************************************/ - -void cutcut (model, board, shape) - rdsfig_list *model; - int board; /* layer number to cut */ - int shape; /* layer number of shapes to cut */ -{ - rdsrec_list *rshp, *rbrd, *rbrd_end; - int f = MBK_SEGMENT_MASK | RDS_FIG_REC_MASK; - ht_t *dejavu; - char buffer[1000]; - - for (rbrd_end=model->LAYERTAB[board]; rbrd_end->NEXT; rbrd_end=rbrd_end->NEXT); - - dejavu = htinit (63179); - for (rbrd = model->LAYERTAB[board]; rbrd; rbrd = rbrd->NEXT) - { - for (rshp = model->LAYERTAB[shape]; rshp; rshp = rshp->NEXT) - { - int rx, rdx, ry, rdy; - if (rect_intersec (rshp->X, rbrd->X, rshp->DX, rbrd->DX, rshp->Y, rbrd->Y, rshp->DY, rbrd->DY, &rx, &rdx, &ry, &rdy)) - { - if ((rdx > 0) && (rdy > 0)) - { - mark_remove (rbrd); - if (rx > (rbrd->X)) /* need right rectangle */ - { - int nx = rbrd->X, ny = rbrd->Y, ndx = rx - (rbrd->X), ndy = rbrd->DY; - sprintf (buffer, "%d %d %d %d", nx, ny, ndx, ndy); - if (!htget (dejavu, buffer)) - { - htset (dejavu, buffer); - rbrd_end->NEXT = rds_rectangle_in (NULL, nx, ny, ndx, ndy, board, f, NULL); - rbrd_end = rbrd_end->NEXT; - } - } - if (ry > (rbrd->Y)) /* need bottom rectangle */ - { - int nx = rbrd->X, ny = rbrd->Y, ndx = rbrd->DX, ndy = ry - (rbrd->Y); - sprintf (buffer, "%d %d %d %d", nx, ny, ndx, ndy); - if (!htget (dejavu, buffer)) - { - htset (dejavu, buffer); - rbrd_end->NEXT = rds_rectangle_in (NULL, nx, ny, ndx, ndy, board, f, NULL); - rbrd_end = rbrd_end->NEXT; - } - } - if (ry + rdy < (rbrd->Y + rbrd->DY)) /* need top rectangle */ - { - int nx = rbrd->X, ny = ry + rdy, ndx = rbrd->DX, ndy = (rbrd->Y + rbrd->DY) - (ry + rdy); - sprintf (buffer, "%d %d %d %d", nx, ny, ndx, ndy); - if (!htget (dejavu, buffer)) - { - htset (dejavu, buffer); - rbrd_end->NEXT = rds_rectangle_in (NULL, nx, ny, ndx, ndy, board, f, NULL); - rbrd_end = rbrd_end->NEXT; - } - } - if (rx + rdx < (rbrd->X + rbrd->DX)) /* need left rectangle */ - { - int nx = rx + rdx, ny = rbrd->Y, ndx = (rbrd->X + rbrd->DX) - (rx + rdx), ndy = rbrd->DY; - sprintf (buffer, "%d %d %d %d", nx, ny, ndx, ndy); - if (!htget (dejavu, buffer)) - { - htset (dejavu, buffer); - rbrd_end->NEXT = rds_rectangle_in (NULL, nx, ny, ndx, ndy, board, f, NULL); - rbrd_end = rbrd_end->NEXT; - } - } - } - } - } - } - rds_remove_rectangle (&(model->LAYERTAB[board])); - htremove (dejavu); -} - -/****************************************************************************** - * addpwell: define RDS_PWELL <- RDS_ABOX - RDS_NWELL - * only on terminal cells (without instance) having NWELL rectangle - *****************************************************************************/ -static void addpwell (model, verbose) - rdsfig_list *model; - int verbose; -{ - if (model->INSTANCE == NULL) - { - if ((model->LAYERTAB[RDS_ABOX]) == NULL) - { - (void) fprintf (stderr, "**post_trat**addpwell:cell %s has none ABOX\n", model->NAME); - exit (1); - } - if (((model->LAYERTAB[RDS_ABOX])->NEXT) != NULL) - { - (void) fprintf (stderr, "**post_trat**addpwell:cell %s has more than one ABOX\n", model->NAME); - exit (1); - } - if (model->LAYERTAB[RDS_NWELL] != NULL) - { - rdsrec_list *rectab = model->LAYERTAB[RDS_ABOX]; - int f = MBK_SEGMENT_MASK | RDS_FIG_REC_MASK; - - long qty = GET_S2R_OVERSIZE (RDS_NIMP); - model->LAYERTAB[RDS_PWELL] = rds_rectangle_in (model->LAYERTAB[RDS_PWELL], - rectab->X-qty, rectab->Y-qty, rectab->DX+2*qty, rectab->DY+2*qty, RDS_PWELL,f,NULL); - cutcut (model, RDS_PWELL, RDS_NWELL); - - qty = GET_S2R_OVERSIZE (RDS_NIMP); - model->LAYERTAB[RDS_USER9] = rds_rectangle_in (NULL, rectab->X-qty, rectab->Y-qty, rectab->DX+2*qty, rectab->DY+2*qty, RDS_NWELL, f, NULL); - cutcut (model, RDS_USER9, RDS_PWELL); - model->LAYERTAB[NWELL] = model->LAYERTAB[RDS_USER9]; - - qty = GET_S2R_OVERSIZE (RDS_PIMP); - model->LAYERTAB[RDS_USER9] = rds_rectangle_in (NULL, rectab->X-qty, rectab->Y-qty, rectab->DX+2*qty, rectab->DY+2*qty, RDS_PWELL, f, NULL); - cutcut (model, RDS_USER9, RDS_NWELL); - model->LAYERTAB[PWELL] = model->LAYERTAB[RDS_USER9]; - } - } -} - -/****************************************************************************** - * addpimp: define on NWELL RDS_PIMP <- RDS_WELL - RDS_NIMP - * only on terminal cells (without instance) having NWELL rectangle - * put RDS_PIMP all over NWELL - * put RDS_NIMP all over PWELL - *****************************************************************************/ -static void addimp (model, verbose) - rdsfig_list *model; - int verbose; -{ - rdsrec_list *r; - int f = MBK_SEGMENT_MASK | RDS_FIG_REC_MASK; - - if (model->INSTANCE == NULL) - { - for (r = model->LAYERTAB[RDS_NWELL]; r; r = r->NEXT) - model->LAYERTAB[RDS_PIMP] = rds_rectangle_in (model->LAYERTAB[RDS_PIMP], r->X, r->Y, r->DX, r->DY, RDS_PIMP, f, NULL); - - for (r = model->LAYERTAB[RDS_PWELL]; r; r = r->NEXT) - model->LAYERTAB[RDS_NIMP] = rds_rectangle_in (model->LAYERTAB[RDS_NIMP], r->X, r->Y, r->DX, r->DY, RDS_NIMP, f, NULL); - cutcut (model, RDS_NIMP, RDS_PTIE); - cutcut (model, RDS_PIMP, RDS_NTIE); - } -} - -/****************************************************************************** - * envelop: envelops the post_treatable layers of the given model. - *****************************************************************************/ -static void envelop (model) - rdsfig_list *model; -{ - int layer_num; - - for (layer_num = 0; layer_num < RDS_MAX_LAYER; layer_num++) - { - if (GET_S2R_POST_Y_OR_N (layer_num) == S2R_TREAT) - { - envelop_layer (model, layer_num); - } - } -} - -/****************************************************************************** - * couron: courons the post_treatable layers of the given model. - *****************************************************************************/ -static void couron (model, verbose) - rdsfig_list *model; - int verbose; -{ - int layer_num; - - for (layer_num = 0; layer_num < RDS_MAX_LAYER; layer_num++) - { - if ((GET_S2R_POST_Y_OR_N (layer_num) == S2R_TREAT) && (GET_S2R_RING_WIDTH (layer_num) != 0)) - { - couron_layer (model, layer_num, verbose); - } - } -} - -/****************************************************************************** - * flatten: flattens the post_treatable layers of the model. - *****************************************************************************/ -static void flatten (model) - rdsfig_list *model; -{ - int layer_num; - - for (layer_num = 0; layer_num < RDS_MAX_LAYER; layer_num++) - { - if ((GET_S2R_POST_Y_OR_N (layer_num) == S2R_TREAT) && (GET_S2R_RING_WIDTH (layer_num) != 0)) - { - flatten_layer (model, layer_num); - } - } -} - -/****************************************************************************** - * resize: oversize all post_treatable layers of the model - *****************************************************************************/ -static void resize (model) - rdsfig_list *model; -{ - int layer_num; - - for (layer_num = 0; layer_num < RDS_MAX_LAYER; layer_num++) - { - if (GET_S2R_POST_Y_OR_N (layer_num) == S2R_TREAT) - { - resize_layer (model, layer_num); - } - } -} - -/****************************************************************************** - * merge: merges all post_treatable layers of the model. - * If the layer to be merged is of the type that needs scotchs - * ( indicated by having a complementary layer in its postreat table), - * merge_layer_2() will be called instead of merge_layer(). - *****************************************************************************/ -static void merge (model, scotch_on_flag, verbose) - rdsfig_list *model; - int scotch_on_flag, verbose; -{ - int layer_num; - - for (layer_num = 0; layer_num < RDS_MAX_LAYER; layer_num++) - { - if (GET_S2R_POST_Y_OR_N (layer_num) == S2R_TREAT) - { - if ((GET_S2R_POST_COMPLEMENTARY (layer_num) != RDS_S2R_POST_TREAT_EMPTY) && scotch_on_flag) - { - merge_layer_2 (model, layer_num, verbose); - } - else - { - merge_layer (model, layer_num, verbose); - } - } - } -} - -/****************************************************************************** - * clean: cleans all post_treatable layers. - *****************************************************************************/ -static void clean (model) - rdsfig_list *model; -{ - int layer_num; - - for (layer_num = 0; layer_num < RDS_MAX_LAYER; layer_num++) - { - if (GET_S2R_POST_Y_OR_N (layer_num) == S2R_TREAT) - { - rds_clean_layer (&(model->LAYERTAB[layer_num])); - } - } -} - -/****************************************************************************** - * inv_resize: undersizes all post_treatable layers. - *****************************************************************************/ -static void inv_resize (model) - rdsfig_list *model; -{ - int layer_num; - - for (layer_num = 0; layer_num < RDS_MAX_LAYER; layer_num++) - { - if (GET_S2R_POST_Y_OR_N (layer_num) == S2R_TREAT) - { - inv_resize_layer (model, layer_num); - } - } -} - -/****************************************************************************** - * bigstacked : maximise the stacked vias - *****************************************************************************/ -static void bigstacked (model) - rdsfig_list *model; -{ - if (model->INSTANCE != NULL) - { - if (GET_S2R_POST_Y_OR_N (RDS_ALU2) == S2R_TREAT) - bigstacked_layer (model, RDS_ALU2); - if (GET_S2R_POST_Y_OR_N (RDS_ALU3) == S2R_TREAT) - bigstacked_layer (model, RDS_ALU3); - if (GET_S2R_POST_Y_OR_N (RDS_ALU4) == S2R_TREAT) - bigstacked_layer (model, RDS_ALU4); - if (GET_S2R_POST_Y_OR_N (RDS_ALU5) == S2R_TREAT) - bigstacked_layer (model, RDS_ALU5); - } -} - -/***************************************************************************** - * post_treat: post_treats the specified model. - * After completion it marks this model at this layer post_treated. - * This is a recursive function: if an instance of this model - * has its model not yet post treated at this layer, it is - * post treated first. - ****************************************************************************/ -void post_treat (model, scotch_on_flag, verbose) - rdsfig_list *model; - int scotch_on_flag; - int verbose; -{ - rdsins_list *instance; - rdsfig_list *modelp; - - for (instance = model->INSTANCE; instance; instance = instance->NEXT) - { - modelp = rds_model_out (instance->FIGNAME); - - if (!modelp->FLAGS && !incataloggds (modelp->NAME)) - { - post_treat (modelp, scotch_on_flag, verbose); - } - } - if (verbose) - printf ("\t--> post-treating model %s\n", model->NAME); - if (verbose && model->INSTANCE) - { - printf ("\t ring flattenning : \n"); - fflush (stdout); - } - if (!incataloggds (model->NAME)) - { - envelop (model); - couron (model, verbose); - flatten (model); - resize (model); - if (verbose) - { - printf ("\t rectangle merging : \n"); - fflush (stdout); - } - merge (model, scotch_on_flag, verbose); - clean (model); - inv_resize (model); - addpwell (model, verbose); - addimp (model, verbose); - bigstacked (model); - mark_treat (model); - } -} - -/******************************************************************************* - * replace_cells: traverses the list of models and replaces the models that are - * found in the gds catalog by the corresponding models parsed - * from this catalog. - * remarks: - ******************************************************************************/ -void replace_cells (verbose) - int verbose; -{ - rdsfig_list *model, *model_next; - static int not_print_yet = 1; - char *model_name; - - for (model = HEAD_RDSFIG; model;) - { - model_next = model->NEXT; - if (incataloggds (model->NAME)) - { - if (not_print_yet) - { - printf ("\to replacing black boxes\n"); - not_print_yet = 0; - } - if (verbose) - printf ("\t--> replace cell %s \n", model->NAME); - model_name = model->NAME; - delrdsfig (model_name); - (void) getrdsfig (model_name, 'A', 0); - } - model = model_next; - } -} diff --git a/alliance/src/s2r/src/postrat.h b/alliance/src/s2r/src/postrat.h deleted file mode 100644 index ca587739..00000000 --- a/alliance/src/s2r/src/postrat.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -#define TREAT 1 -#define NOTREAT 0 - -extern void post_treat (); -extern void replace_cells (); diff --git a/alliance/src/s2r/src/rdsacces.c b/alliance/src/s2r/src/rdsacces.c deleted file mode 100644 index 75656436..00000000 --- a/alliance/src/s2r/src/rdsacces.c +++ /dev/null @@ -1,649 +0,0 @@ -/* - * 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. - */ - -/****************************************************************************/ -/* */ -/* ALLIANCE CAO & VLSI CAD */ -/* */ -/* Product : (S)ymbolic (2)to (R)eal translater */ -/* File : rdsacces+.c */ -/* */ -/* (c) copyright 1992 MASI laboratory CAO & VLSI team */ -/* All Right Reserved */ -/* Support : e-mail cao-vlsi@masi.ibp.fr */ -/* */ -/****************************************************************************/ -/* */ -/* Access functions to the rds database objects */ -/* */ -/****************************************************************************/ - -#include "generic.h" -#include -#include -#include -#include -#include -#include "rdsacces.h" -#include "statistics.h" - -int s2rdebug = 0; - -rdsrec_list *Free_List = NULL; /* a global variable pointing to the free list - of rectangles */ -void view_rec (rec) - rdsrec_list *rec; -{ - viewrdsrec (rec); -} - -/**************************************************************************** - * rds_rectangle_in: adds the rectangle given by its data to the given list - * and returns a pointer to the new list. - * Before allocating memory for the new rectangle, the free - * list is checked and if it is not empty : we use the memory - * area pointed by the first element of this list. - ****************************************************************************/ - -rdsrec_list *rds_rectangle_in (layer_list, x, y, dx, dy, layer_num, flags, name) - rdsrec_list *layer_list; - long x, y, dx, dy; - int layer_num; - long flags; - char *name; -{ - rdsrec_list *npr; - - STAT_RECT_REQRD++; - if (Free_List) - npr = pull_free_list (); - else - { - npr = allocrdsrec (0); - STAT_RECT_ALLOC++; - } - - flags = flags & 0xFFFFFF00; - - npr->NEXT = layer_list; - npr->X = x; - npr->Y = y; - npr->DX = dx; - npr->DY = dy; - npr->FLAGS = flags | (long) (layer_num); - npr->NAME = name; - - return layer_list = npr; -} - - -/**************************************************************************** - * rds_instance_in: adds the instance given by its data to the given list - * and returns a pointer to the new list. - ****************************************************************************/ - -rdsins_list *rds_instance_in (instance, model, name, x, y, sym) - rdsins_list *instance; - char *model, *name; - long x, y; - char sym; -{ - rdsins_list *npr; - int i; - - npr = allocrdsins (); - - npr->NEXT = instance; - npr->FIGNAME = namealloc (model); - npr->INSNAME = namealloc (name); - npr->X = x; - npr->Y = y; - npr->TRANSF = sym; - for (i = 0; i < RDS_MAX_LAYER; i++) - npr->COURONNE[i] = NULL; - - return instance = npr; -} - - -/****************************************************************************** - * rds_remove_model: removes the model with the specified name from the list - * of models. - ****************************************************************************/ - -void rds_remove_model (name) - char *name; -{ - - rds_figurep_typ *modelp; - - name = namealloc (name); - for (modelp = &(HEAD_RDSFIG); *modelp;) - if ((*modelp)->NAME == name) - *modelp = (*modelp)->NEXT; - /***************************************************** - *** return to system the free memory would be cue *** - *****************************************************/ - else - modelp = &((*modelp)->NEXT); -} - - -/**************************************************************************** - * rds_create_model: creates a new model with the given name and adds it to - * the list of models pointed by HeadFigureRds and returns - * a pointer to the created model. - * Note: if the model exists it creates a new model and - * remove the existing one. - ****************************************************************************/ - -rdsfig_list *rds_create_model (name) - char *name; -{ - rdsfig_list *npr; - - rds_remove_model (name); - npr = allocrdsfig (); - - npr->NEXT = HEAD_RDSFIG; - npr->NAME = namealloc (name); - npr->INSTANCE = NULL; - - return HEAD_RDSFIG = npr; -} - - -/****************************************************************************** - * rds_model_out: given a model name it returns a pointer to it by inspecting - * the model list pointed by HeadFigureRds. - ****************************************************************************/ - -rdsfig_list *rds_model_out (name) - char *name; -{ - rdsfig_list *pt; - - name = namealloc (name); - - for (pt = HEAD_RDSFIG; pt; pt = pt->NEXT) - if (pt->NAME == name) - return pt; - return NULL; -} - - -/***************************************************************************** - * rds_instance_out: given an instance name and a pointer to its father model - * it returns a poiner to the instance. - ****************************************************************************/ - -rdsins_list *rds_instance_out (rds_model, name) - rdsfig_list *rds_model; - char *name; -{ - rdsins_list *pt; - - name = namealloc (name); - - for (pt = rds_model->INSTANCE; pt; pt = pt->NEXT) - if (pt->INSNAME == name) - return pt; - return NULL; -} - - -/***************************************************************************** -* rds_mbk_kill: destroies mbk database. May take time ... -*****************************************************************************/ - -void rds_mbk_kill () -{ - phfig_list *pt, *pt_next; - - for (pt = HEAD_PHFIG; pt; pt = pt_next) - { - pt_next = pt->NEXT; - delphfig (pt->NAME); - } -} - - -/******************************************************************************* - * mark_remove: marks the given rectangle as to be removed - ******************************************************************************/ - -void mark_remove (rectangle) - rdsrec_list *rectangle; -{ - if (!(is_remove (rectangle))) - rectangle->FLAGS += REMOVE; -} - - -/******************************************************************************* - * demark_flattenres: removes the flag of the given rectangle - ******************************************************************************/ - -void demark_flattenres (rectangle) - rdsrec_list *rectangle; -{ - if (is_flattenres (rectangle)) - rectangle->FLAGS -= FLATTENRES; -} - - -/******************************************************************************* - * mark_flattenres: marks the given rectangle as a result of a flatten operation - ******************************************************************************/ - -void mark_flattenres (rectangle) - rdsrec_list *rectangle; -{ - if (!(is_flattenres (rectangle))) - rectangle->FLAGS += FLATTENRES; -} - - -/******************************************************************************* - * demark_used: removes the used flag - ******************************************************************************/ - -void demark_used (rectangle) - rdsrec_list *rectangle; -{ - if (is_used (rectangle)) - rectangle->FLAGS -= USED; -} - - -/******************************************************************************* - * mark_used: marks the given rectangle as used - ******************************************************************************/ - -void mark_used (rectangle) - rdsrec_list *rectangle; -{ - if (!(is_used (rectangle))) - rectangle->FLAGS += USED; -} - - -/****************************************************************************** - * mark_scotch: marks the given rectangle as a scotch. - ******************************************************************************/ - -void mark_scotch (rectangle) - rdsrec_list *rectangle; -{ - if (!(is_scotch (rectangle))) - { - rectangle->FLAGS += SCOTCH; - } -} - - -/****************************************************************************** - * demark_scotch: removes the scotch flag from the rectangle. - ******************************************************************************/ - -void demark_scotch (rectangle) - rdsrec_list *rectangle; -{ - if (is_scotch (rectangle)) - rectangle->FLAGS -= SCOTCH; -} - - -/****************************************************************************** - * mark_old_scotch: marks the given rectangle as an old scotch - ******************************************************************************/ - -void mark_old_scotch (rectangle) - rdsrec_list *rectangle; -{ - if (!(is_old_scotch (rectangle))) - rectangle->FLAGS += OLD_SCOTCH; -} - - -/***************************************************************************** - * mark_empty: marks the given model at the specified layer as empty - ****************************************************************************/ - -void mark_empty (model, layer_num) - rdsfig_list *model; - int layer_num; -{ - if (!(is_empty (model, layer_num))) - model->FLAGTAB[layer_num] += EMPTY; -} - - -/***************************************************************************** - * mark_post: marks the given model at the specified layer as post_treated - ****************************************************************************/ - -void mark_treat (model) - rdsfig_list *model; -{ - model->FLAGS = S2R_TREAT; -} - - -/******************************************************************************* - * push_free_list: pushes the given pointer to a deleted rectangle into the free - * list. - ******************************************************************************/ - -void push_free_list (rectp) - rdsrec_list *rectp; -{ - rectp->NEXT = Free_List; - Free_List = rectp; -} - - -/******************************************************************************* - * pull_free_list: pulls from the free list - if not empty - a pointer to - * a ( rectangle) memory space area not used anymore. - ******************************************************************************/ - -rdsrec_list *pull_free_list () -{ - rdsrec_list *temp; - - if (Free_List) - { - temp = Free_List; - Free_List = Free_List->NEXT; - temp->X = 0; - temp->Y = 0; - temp->DX = 0; - temp->DY = 0; - temp->NAME = NULL; - temp->USER = (void *) NULL; - temp->FLAGS = 0; - return (temp); - } - else - return (NULL); -} - - -/*************************************************************************** - * rds_remove_rectangle: removes from the specified list at the specified - * layer all the rectangles that are marked to be removed. - * The removed rectangles are put in a free list, to minimize - * memory consumption: if we need to allocate memory for a new - * rectangle we check the free list first. - ***************************************************************************/ - -void rds_remove_rectangle (list) - rds_rectanglep_typ *list; -{ - register rds_rectanglep_typ *rectanglep; - register rdsrec_list *temp; - - for (rectanglep = list; *rectanglep;) - { - if (is_remove (*rectanglep)) - { - temp = (*rectanglep)->NEXT; - push_free_list ((*rectanglep)); - *rectanglep = temp; - } - else - rectanglep = &((*rectanglep)->NEXT); - } -} - - -/*************************************************************************** - * rds_clean_layer: removes from the specified model at the specified layer - * all the rectangles that have been flattened and were not used. - * The removed rectangles are put in a free list, to minimize - * memory consumption: if we need to allocate memory for a new - * rectangle we check the free list first. - ***************************************************************************/ - -void rds_clean_layer (list) - rds_rectanglep_typ *list; -{ - register rds_rectanglep_typ *rectanglep; - register rdsrec_list *temp; - - for (rectanglep = list; *rectanglep;) - { - /* when a rectangle is issued from a subcell after a ring flattening - if is to be erased if it was not used by merge */ - if ((is_flattenres (*rectanglep)) && (!(is_used (*rectanglep)))) - { - /**** remove it ****/ - temp = (*rectanglep)->NEXT; - push_free_list ((*rectanglep)); - *rectanglep = temp; - } - else - { - /**** just erase using flag and flattenres ****/ - /**** the rectangle owns to the current hierararchical level ***/ - demark_flattenres (*rectanglep); - demark_used (*rectanglep); - rectanglep = &((*rectanglep)->NEXT); - } - } -} - - -/***************************************************************************** - * side_intersec: determines if 2 rectangles could intersect in the dimension - * of the specified sides. - * If yes it returns (1) and puts where and how long is the side - * of their intersection in rs and rds respectively. - * If not it returns (0). - *****************************************************************************/ - -int side_intersec (s1, s2, ds1, ds2, rs, rds) - long s1, s2, ds1, ds2, *rs, *rds; -{ - if ((s2 >= s1) && (s2 <= (s1 + ds1))) - { - if ((s2 + ds2) >= (s1 + ds1)) - { - *rs = s2; - *rds = s1 + ds1 - s2; - } - else - { - *rs = s2; - *rds = ds2; - } - return (1); - } - if ((s2 <= s1) && ((s2 + ds2) >= s1)) - { - if ((s2 + ds2) >= (s1 + ds1)) - { - *rs = s1; - *rds = ds1; - } - else - { - *rs = s1; - *rds = s2 + ds2 - s1; - } - return (1); - } - return (0); -} - - -/***************************************************************************** - * rect_intersec: determines if 2 rectangles intersect. - * If yes it returns (1) and puts the data of the rectangle - * of their intersection in rx, ry, rdx and rdy. - * If not it returns (0). - *****************************************************************************/ - -int rect_intersec (x1, x2, dx1, dx2, y1, y2, dy1, dy2, rx, rdx, ry, rdy) - long x1, x2, dx1, dx2, y1, y2, dy1, dy2, *rx, *rdx, *ry, *rdy; -{ - if (side_intersec (x1, x2, dx1, dx2, rx, rdx)) - return (side_intersec (y1, y2, dy1, dy2, ry, rdy)); - else - return (0); -} - -static chain_list *MODEL_CHAIN; - -static chain_list *rmake_model_list (pt_phfig) - phfig_list *pt_phfig; - -{ - phins_list *pt_ins; - chain_list *pt_chain; - - for (pt_ins = pt_phfig->PHINS; pt_ins != NULL; pt_ins = pt_ins->NEXT) - { - for (pt_chain = MODEL_CHAIN; pt_chain != NULL; pt_chain = pt_chain->NEXT) - { - if (((phfig_list *) pt_chain->DATA)->NAME == pt_ins->FIGNAME) - { - break; - } - } - if (pt_chain == NULL) - { - /* if not already in model list , add a new model to it */ - phfig_list *pt_model; - pt_model = getphfig (pt_ins->FIGNAME, 'A'); - /* cells whose have got gds equivalent must have been shifted to zero */ - if (incataloggds (pt_model->NAME)) - zero (pt_model); - (void) rmake_model_list (pt_model); - } - } - MODEL_CHAIN = addchain (MODEL_CHAIN, (char *) pt_phfig); - - return (MODEL_CHAIN); -} - -static chain_list *make_model_list (fig) - phfig_list *fig; -{ - if (MODEL_CHAIN != NULL) - freechain (MODEL_CHAIN); - MODEL_CHAIN = NULL; - return rmake_model_list (fig); -} - -/*------------------------------------------------------\ -| Transform a hierarchy Mbk -> Rds | -\------------------------------------------------------*/ - -rdsfig_list *S2Rfigmbkrds (FigureMbk, All) - phfig_list *FigureMbk; - char All; -{ - rdsfig_list *FigureRds; - chain_list *Pt; - - if (All) - { - Pt = make_model_list (FigureMbk); - - if (s2rdebug) - { - chain_list *pc = Pt; - fprintf (stderr, "MODELS :\n"); - for (; pc; pc = pc->NEXT) - { - fprintf (stderr, " %s\t", ((phfig_list *) (pc->DATA))->NAME); - if ((((phfig_list *) (pc->DATA))->PHINS) == NULL) - fprintf (stderr, "FEUILLE"); - fprintf (stderr, "\n"); - } - } - - FigureRds = figmbkrds ((phfig_list *) Pt->DATA, 0, 0); - for (Pt = Pt->NEXT; Pt != NULL; Pt = Pt->NEXT) - figmbkrds ((phfig_list *) Pt->DATA, 0, 0); - } - else - { - FigureRds = figmbkrds (FigureMbk, 0, 0); - for (Pt = FigureMbk->MODELCHAIN; Pt != NULL; Pt = Pt->NEXT) - figmbkrds (getphfig ((char *) Pt->DATA, 'P'), 0, 0); - } - return FigureRds; -} - -void zero (phfig) - phfig_list *phfig; -{ - long x, y; - phins_list *phins; - phcon_list *phcon; - phseg_list *phseg; - phvia_list *phvia; - phref_list *phref; - - x = phfig->XAB1; - y = phfig->YAB1; - - phfig->XAB1 = phfig->YAB1 = 0; - phfig->XAB2 -= x; - phfig->YAB2 -= y; - - for (phins = phfig->PHINS; phins != NULL; phins = phins->NEXT) - { - phins->XINS -= x; - phins->YINS -= y; - } - - for (phcon = phfig->PHCON; phcon != NULL; phcon = phcon->NEXT) - { - phcon->XCON -= x; - phcon->YCON -= y; - } - - for (phseg = phfig->PHSEG; phseg != NULL; phseg = phseg->NEXT) - { - phseg->X1 -= x; - phseg->Y1 -= y; - phseg->X2 -= x; - phseg->Y2 -= y; - } - - for (phvia = phfig->PHVIA; phvia != NULL; phvia = phvia->NEXT) - { - phvia->XVIA -= x; - phvia->YVIA -= y; - } - - for (phref = phfig->PHREF; phref != NULL; phref = phref->NEXT) - { - phref->XREF -= x; - phref->YREF -= y; - } -} diff --git a/alliance/src/s2r/src/rdsacces.h b/alliance/src/s2r/src/rdsacces.h deleted file mode 100644 index f349a181..00000000 --- a/alliance/src/s2r/src/rdsacces.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * 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. - */ - -extern int s2rdebug; - -/****************************************************************************** - * * - * Rectangle Data Base : Structures and Access functions * - * * - *****************************************************************************/ - -#include "maxima.h" - -/****************************************************************************** - * definitions of flags - *****************************************************************************/ - -#define is_remove(rectangle) ( (rectangle)->FLAGS & REMOVE) -#define is_flattenres(rectangle) ( (rectangle)->FLAGS & FLATTENRES) -#define is_used(rectangle) ( (rectangle)->FLAGS & USED) -#define is_scotch(rectangle) ( (rectangle)->FLAGS & SCOTCH) -#define is_old_scotch(rectangle) ( (rectangle)->FLAGS & OLD_SCOTCH) - -#define REC_INIT 0x00000000 /* rectangle: default */ -#define REMOVE 0x01000000 /* rectangle: to be removed */ -#define FLATTENRES 0x02000000 /* rectangle: resulted from a flatten */ -#define USED 0x04000000 /* rectangle: used in merge */ -#define SCOTCH 0x08000000 /* rectangle: a scotch */ -#define OLD_SCOTCH 0x10000000 /* rectangle: an old scotch */ - -#define EMPTY 1 /* model(specific for a layer): - it contains nothing in this layer */ -#define POST 1 /* model->FLAGS: the model is postrated */ -#define READ 2 /* model->FLAGS: model already read from disk */ - /* when a cell contains a model which has been */ - /* already read in another cell, this flag */ - /* prevents from reading it twice from disk */ - -/* Rectangles */ - -typedef rdsrec_list *rds_rectanglep_typ; - - -/***************************************************************************** - * Instances : - * The coordinates and symetry semantics are the gds & cif 's one, that's - * completly different from mbk's - *****************************************************************************/ - -/* Models */ - -typedef rdsfig_list *rds_figurep_typ; - -/************************************************************************ -* types and definitions of rectangle data base access -*************************************************************************/ - -/************************************************************************ - * free list of rectangles removed to be - * allocated when a creation of a rectangle is requested - ************************************************************************/ -extern rdsrec_list *Free_List; - -/************************************************************************ - * declaration of the functions defined in rds_access.c - ************************************************************************/ - -extern rdsfig_list *S2Rfigmbkrds (); -extern void zero (); -extern rdsrec_list *rds_rectangle_in (); -extern rdsins_list *rds_instance_in (); -extern void rds_remove_model (); -extern rdsfig_list *rds_create_model (); -extern rdsfig_list *rds_model_out (); -extern rdsins_list *rds_instance_out (); -extern void rds_mbk_kill (); -extern void mark_treat (); -extern void mark_remove (); -extern void mark_flattenres (); -extern void mark_used (); -extern void mark_scotch (); -extern void mark_old_scotch (); -extern void mark_empty (); -extern void mark_post (); -extern void demark_flattenres (); -extern void demark_scotch (); -extern void demark_used (); -extern void push_free_list (); -extern rdsrec_list *pull_free_list (); -extern void rds_remove_rectangle (); -extern void rds_clean_layer (); -extern int side_intersec (); -extern int rect_intersec (); - -/******************************************************************************* - * macro definitions to test the flags fields of rectangles and models - ******************************************************************************/ - -/****************************************************************************** - * rectangles - *****************************************************************************/ - -#define is_remove(rectangle) ( (rectangle)->FLAGS & REMOVE) -#define is_flattenres(rectangle) ( (rectangle)->FLAGS & FLATTENRES) -#define is_used(rectangle) ( (rectangle)->FLAGS & USED) -#define is_scotch(rectangle) ( (rectangle)->FLAGS & SCOTCH) -#define is_old_scotch(rectangle) ( (rectangle)->FLAGS & OLD_SCOTCH) - -/***************************************************************************** - * are_rect_intersec: tests if the 2 given rectangles ( given by their - * coordinates) intersect or not. - ******************************************************************************/ - -#define are_rect_intersec(x1,y1,dx1,dy1,x2,y2,dx2,dy2) (\ - (( ((x2) >= (x1)) && ((x2) <= ((x1)+(dx1))))\ - ||\ - (( (x2) <= (x1)) && ( ((x2)+(dx2)) >= (x1))))\ - &&\ - (( ((y2) >= (y1)) && ((y2) <= ((y1)+(dy1))))\ - ||\ - (( (y2) <= (y1)) && ( ((y2)+(dy2)) >= (y1))))\ - ) - -/**************************************************************************** - * models - ****************************************************************************/ - -#define is_empty(model,layer_num) ( (model)->FLAGTAB[layer_num] & EMPTY) -#define is_post(model) ( (model)->FLAGS & POST) -#define is_read(model) ( (model)->FLAGS & READ) diff --git a/alliance/src/s2r/src/rdsx2y.c b/alliance/src/s2r/src/rdsx2y.c deleted file mode 100644 index 0f1f8c8b..00000000 --- a/alliance/src/s2r/src/rdsx2y.c +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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. - */ - -/****************************************************************************/ -/* */ -/* ALLIANCE CAO & VLSI CAD */ -/* */ -/* Product : (S)ymbolic (2)to (R)eal translater */ -/* File : rdsx2y.c */ -/* */ -/* (c) copyright 1992 MASI laboratory CAO & VLSI team */ -/* All Right Reserved */ -/* Support : e-mail cao-vlsi@masi.ibp.fr */ -/* */ -/****************************************************************************/ -/* */ -/* Main of cif or gds translater */ -/* */ -/****************************************************************************/ - -#include "generic.h" -#include -#include -#include -#include -#include -#include -#include -#include - -getarg (argc, argv, model_name) - int argc; - char **argv; - char **model_name; -{ - char *option1; - char *option2; - - if (argc != 2) - { - fprintf (stderr, "usage : %s \n", argv[0]); - exit (1); - } - *model_name = namealloc (argv[1]); -} - - -main (argc, argv) - int argc; - char **argv; -{ - char *model_name; - rdsfig_list *pf; - - /**** banner and parameters ****/ - getarg (argc, argv, &model_name); - -/*\ - * setting environement - * MBK_CATAL_NAME : file where file name to be replaced are put - * MBK_CATA_LIB : where cells, catal file and techno file are - * MBK_WORK_LIB : where result file is written or where techno file is - * WORK_LIB is watched before CATA_LIB - * MBK_WORK_LIB : where result file is placed - * MBK_IN_PH : file format of symbolic figure - * RDS_TECHNO_NAME : techno file name - * RDS_IN : file format of real figures to replace - * RDS_OUT : file format of result file -\*/ - mbkenv (); - rdsenv (); - loadrdsparam (); - pf = getrdsfig (model_name, 'A', 0); - saverdsfig (pf); - - return (0); -} diff --git a/alliance/src/s2r/src/statistics.c b/alliance/src/s2r/src/statistics.c deleted file mode 100644 index e4f15d1f..00000000 --- a/alliance/src/s2r/src/statistics.c +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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. - */ - -/****************************************************************************/ -/* */ -/* ALLIANCE CAO & VLSI CAD */ -/* */ -/* Product : (S)ymbolic (2)to (R)eal translater */ -/* File : statistics.c */ -/* */ -/* (c) copyright 1992 MASI laboratory CAO & VLSI team */ -/* All Right Reserved */ -/* Support : e-mail cao-vlsi@masi.ibp.fr */ -/* */ -/****************************************************************************/ -/* */ -/* Statistics functions */ -/* */ -/****************************************************************************/ - -#include -#include "statistics.h" - -long STAT_RECT_REQRD = 0; /* number of rectangles required to be allocated */ -long STAT_RECT_ALLOC = 0; /* number of rectangles really allocated in memory */ -long STAT_SCTCH_RQRD = 0; /* number of scotchs needed */ -long STAT_SCTCH_CRTD = 0; /* number of scotchs created */ -extern long mbkalloc_stat; /* memory allocated by mbk */ - -/******************************************************************************* - * print_statistics: prints statistics - ******************************************************************************/ - -void print_statistics (scotch_on_flag) - int scotch_on_flag; -{ - printf ("\to memory allocation informations\n"); - printf ("\t--> required rectangles = %ld ", STAT_RECT_REQRD); - printf (" really allocated = %ld\n", STAT_RECT_ALLOC); - if (scotch_on_flag) - { - printf ("\t--> required scotchs = %ld ", STAT_SCTCH_RQRD); - printf (" really created = %ld\n", STAT_SCTCH_CRTD); - } - printf ("\t--> Number of allocated bytes: %ld\n", mbkalloc_stat); -} diff --git a/alliance/src/s2r/src/statistics.h b/alliance/src/s2r/src/statistics.h deleted file mode 100644 index a5f11044..00000000 --- a/alliance/src/s2r/src/statistics.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -extern void print_statistics (); -extern long STAT_RECT_REQRD; -extern long STAT_RECT_ALLOC; -extern long STAT_SCTCH_RQRD; -extern long STAT_SCTCH_CRTD; diff --git a/alliance/src/sea/Makefile.am b/alliance/src/sea/Makefile.am deleted file mode 100644 index 9dd5545d..00000000 --- a/alliance/src/sea/Makefile.am +++ /dev/null @@ -1,3 +0,0 @@ -## Process this file with automake to produce Makefile.in - -SUBDIRS = src diff --git a/alliance/src/sea/configure.in b/alliance/src/sea/configure.in deleted file mode 100644 index eabc073b..00000000 --- a/alliance/src/sea/configure.in +++ /dev/null @@ -1,36 +0,0 @@ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(src/DEF2a.c) - -SEA_MAJOR_VERSION=1 -SEA_MINOR_VERSION=0 -SEA_VERSION=$SEA_MAJOR_VERSION.$SEA_MINOR_VERSION - -AC_SUBST(SEA_MAJOR_VERSION) -AC_SUBST(SEA_MINOR_VERSION) -AC_SUBST(SEA_VERSION) - -# For automake. -VERSION=$SEA_VERSION -PACKAGE=sea - -dnl Initialize automake stuff -AM_INIT_AUTOMAKE($PACKAGE, $VERSION) - -dnl Checks for programs. -AC_PROG_CC -AC_PROG_RANLIB -AM_PROG_LEX -AC_PROG_YACC -AC_PROG_MAKE_SET - -AC_CHECK_LIB(m, pow) - -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST - -AM_ALLIANCE - -AC_OUTPUT([ -Makefile -src/Makefile -]) diff --git a/alliance/src/sea/src/DEF2a.c b/alliance/src/sea/src/DEF2a.c deleted file mode 100644 index 1ed8d77f..00000000 --- a/alliance/src/sea/src/DEF2a.c +++ /dev/null @@ -1,241 +0,0 @@ -/* - * $Id: DEF2a.c,v 1.1 2002/04/25 16:16:19 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Mael Nagat | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./DEF2a.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "util_Defs.h" -# include "DEF_grammar.h" - - -/* ------------------------------------------------------------------ - * Local constants. - */ - -# define F_PHFIG 0x00000001 -# define F_LOFIG 0x00000002 -# define F_SPLIT_POWER 0x00000004 -# define F_SHRINK 0x00000008 -# define F_NO_IOS 0x00000010 -# define F_NO_INTERF 0x00000020 -# define F_MERGE_TERM 0x00000040 -# define M_OUTPUT (F_PHFIG | F_LOFIG) - - -/* ------------------------------------------------------------------ - * Local variables. - */ - - static long LV_VL; /* Verbose level. */ - static long LV_flags; - - -/* ---------------------------------------------------------------------- - * Internal functions declarations. - */ - - static void printHelp __FP((void)); - static void getlophfig __FP((lofig_list **appLoFig, - phfig_list **appPhFig, - char *aDefName, - char *aNetlayName, - char aMode, - long aVL, - long aFlags)); - - -/* - * /--------------------------------------------------------------------\ - * | Functions Definitions | - * \--------------------------------------------------------------------/ - */ - -/* ---------------------------------------------------------------------- - * Function : "printHelp()". - */ - -static void printHelp() -{ - printf (" o Usage := \"DEF2a <-l|-p|-l -p>"); - printf ( " [-v] [-V] [-h] [-s] [-b] [-i] [-r]\n"); - printf (" []\"\n\n"); - printf (" o Options :\n"); - printf (" [-v] := Be verbose.\n"); - printf (" [-V] := Be very verbose.\n"); - printf (" [-h] := Print this message.\n"); - printf (" [-l] := Drive the logical figure.\n"); - printf (" [-p] := Drive the physical figure.\n"); - printf (" [-b] := Suppress AB terminals.\n"); - printf (" [-s] := Split the power nets.\n"); - printf (" [-S] := Shrink the abutment box.\n"); - printf (" [-i] := Do not build physical interface.\n"); - printf (" [-r] := Merge power terminals for ring.\n"); - printf (" := Name of the input DEF file (mandatory).\n"); - printf (" := Name of the output netlist and/or layout.\n"); - printf ("\n" ); -} - - -/* ---------------------------------------------------------------------- - * Function : "getlophfig()". - */ - -static void getlophfig (appLoFig, - appPhFig, - aDefName, - aNetlayName, - aMode, - aVL, - aFlags) - lofig_list **appLoFig; - phfig_list **appPhFig; - char *aDefName; - char *aNetlayName; - char aMode; - long aVL; - long aFlags; -{ - (*appLoFig) = addlofig (aNetlayName); - (*appPhFig) = addphfig (aNetlayName); - - defloadlophfig ((*appLoFig), (*appPhFig), aDefName, aMode, aVL, aFlags); -} - - - -/* ---------------------------------------------------------------------- - * Function : "main()". - */ - -extern int main (argc, argv) - int argc; - char *argv[]; -{ - struct phfig *pPhFig; - struct lofig *pLoFig; - char *defName; - char *netlayName; - long defFlags; - int argC, i; - - - /* Read MBK environment. */ - mbkenv(); - - argC = argc; - - /* Default options. */ - defFlags = 0L; - LV_flags = 0L; - - - /* Initialise the "Ut" module. */ - util_init (C_VerboseLevel0, F_DUMPCORE, "DEF2a"); - - - /* Read the options. */ - for (i = 1; i < argc; i++) { - if (!strcmp (argv[i], "-h")) { printHelp (); exit (0); } - if (!strcmp (argv[i], "-v")) { LV_VL = C_VerboseLevel1; continue; } - if (!strcmp (argv[i], "-V")) { LV_VL = C_VerboseLevel2; continue; } - if (!strcmp (argv[i], "-p")) { defFlags |= F_PHFIG; continue; } - if (!strcmp (argv[i], "-l")) { defFlags |= F_LOFIG; continue; } - if (!strcmp (argv[i], "-s")) { defFlags |= F_SPLIT_POWER; continue; } - if (!strcmp (argv[i], "-S")) { defFlags |= F_SHRINK; - LV_flags |= F_DEF_SHRINK;continue; } - if (!strcmp (argv[i], "-b")) { defFlags |= F_NO_IOS; - LV_flags |= F_DEF_NO_IOS; continue; } - if (!strcmp (argv[i], "-i")) { defFlags |= F_NO_INTERF; - LV_flags |= F_DEF_NO_INTERF; continue; } - if (!strcmp (argv[i], "-r")) { defFlags |= F_MERGE_TERM; - LV_flags |= F_DEF_MERGE_TERM; continue; } - - if ((argC - i) > 2) { - eprinth (NULL); - eprintf ("Unknown argument \"%s\"\n\n", argv[argC - 1]); - printHelp (); - exit (1); - } - else - break; - } - - - if ((argC - i) < 1) { - eprinth (NULL); - eprintf ("Missing DEF file name .\n\n"); - printHelp (); - exit (1); - } else { - defName = namealloc (argv[i]); - - if ((argC - i) >= 2) - netlayName = namealloc (argv[i + 1]); - else - netlayName = defName; - } - - - if (!(defFlags & M_OUTPUT)) { - eprinth ("DEF2a"); - eprints ("Neither <-p> nor <-l> is present.\n\n"); - printHelp (); - - exit (1); - } - - - setVL (LV_VL); - - if (LV_VL > 0) { - alliancebanner( - "DEF2a", "V.RR", "Alliance to DEF converter", - "2000", ALLIANCE_VERSION); - } - - printMBKEnv (); - if (defFlags & F_PHFIG) mprintf1 (" o Extract physical datas.\n"); - if (defFlags & F_LOFIG) mprintf1 (" o Extract logical datas.\n"); - if (defFlags & F_SPLIT_POWER) { - mprintf1 (" o Split the power nets.\n"); - LV_flags |= F_DEF_SPLIT_POWER; - } - - - mprintf1 (" o Parsing \"%s\".\n", defName); - getlophfig (&pLoFig, &pPhFig, defName, netlayName, 'A', LV_VL, LV_flags); - - if ((defFlags & F_SHRINK) && (defFlags & F_PHFIG)) { - mprintf1 (" o Shrinking abutment-box.\n"); - shrinkFloorplan (pPhFig); - } - - mprintf1 (" o Building obstacles.\n"); - rtu (pPhFig); - - if (defFlags & F_PHFIG) { - mprintf1 (" o Driving \"%s\" (physical).\n", netlayName); - savephfig (pPhFig); - } - - if (defFlags & F_LOFIG) { - mprintf1 (" o Driving \"%s\" (logical).\n", netlayName); - savelofig (pLoFig); - } - - - exit(0); -} diff --git a/alliance/src/sea/src/DEF_actions.c b/alliance/src/sea/src/DEF_actions.c deleted file mode 100644 index cd9bd0f0..00000000 --- a/alliance/src/sea/src/DEF_actions.c +++ /dev/null @@ -1,1794 +0,0 @@ - -/* - * $Id: DEF_actions.c,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./DEF_actions.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "debugoff.h" -# include "util_Defs.h" -# include "DEF_actions.h" -# include "DEF_grammar.h" - - - /* Flex substitutions. */ -# define yylex DEF_grammarlex -# define yyin DEF_grammarin -# define yylineno DEF_grammarlineno - - /* Bison substitutions. */ -# define yyparse DEF_grammarparse -# define yydebug DEF_grammardebug - - -# define SIZE_TPT 1024 -# define SIZE_TDATALAYER 16 -# define SIZE_TDATACUT 16 -# define SIZE_TDATAVIA 128 -# define SIZE_TPIN 512 -# define F_DATA_SET 0x00000001 -# define F_PIN_STATE 0x00000001 -# define F_PIN_LAYER 0x00000002 -# define F_PIN_DIRECTION 0x00000004 -# define M_PIN_ISPLACED (F_PIN_STATE | F_PIN_LAYER) -# define F_VIA_CUT 0x00000001 -# define F_VIA_PATTERN 0x00000002 -# define F_SEG_INITIAL 0x00000001 -# define F_SEG_SPECIAL 0x00000002 -# define F_SEG_PIN 0x00000004 -# define F_SEG_BLOCKAGE 0x00000008 - - -/* ------------------------------------------------------------------ - * Internal types. - */ - - - typedef struct dataLayer_s { - char layer; /* MBK layer. */ - char clayer; /* MBK terminal layer. */ - char flags; /* Tell if this entry is set. */ - char *name; /* "nameallocatted" name of the layer. */ - long width; /* layer minimal width. */ - } dataLayer_t; - - - typedef struct dataCut_s { - char VIA; /* MBK VIA. */ - char flags; /* Tell if this entry is set . */ - char *name; /* "namellocatted" name of the cut layer. */ - } dataCut_t; - - - typedef struct dataVIA_s { - char VIA; /* MBK VIA or TURN_VIA. */ - char flags; /* Tell if this entry is set . */ - char *name; /* "namellocatted" name of the via . */ - long width; /* VIA width. */ - long height; /* VIA height. */ - } dataVIA_t; - - - typedef struct pin_s { - char *pinName; - char *netName; - } pin_t; - - -/* ------------------------------------------------------------------ - * Local variables (prefix 'LV_'). - */ - - static char *LV_IN_PH = "def"; - static struct lofig *LV_pLoFig; - static struct phfig *LV_pPhFig; - static struct phins *LV_pPhIns; - static char *LV_name; - static char LV_mode; - static char LV_defFlags; - static char *LV_blockageName; - static struct dataLayer_s tDataLayer[SIZE_TDATALAYER]; - static struct dataCut_s tDataCut[SIZE_TDATACUT]; - static struct dataVIA_s tDataVIA[SIZE_TDATAVIA]; - static long LV_mVIA = 0L; - static long LV_mPin; - static struct pin_s *LV_tPin; - static struct authtable *LV_htPin; - static char *LV_modelName; - static long LV_flags; - static long LV_orient; - static char LV_layer; - static char LV_VIA; - static long LV_width; - static long LV_height; - static long LV_lastX; - static long LV_lastY; - static struct pt *LV_ptCurrent; - static struct pt *LV_pt1; - static struct pt *LV_pt2; - static long LV_numPins; - static long LV_numObjects; - static long LV_numObjectsRead; - static long LV_direction; - static long LV_mSig; - static struct losig *LV_pLoSig; - static struct tLoseg_s *LV_ptLoseg; - - -/* ------------------------------------------------------------------ - * Internal functions. - */ - -# define IS_X_PT(pt) ((pt)->x != HUGE_VAL) -# define IS_Y_PT(pt) ((pt)->y != HUGE_VAL) -# define IS_XY_PT(pt) (IS_X_PT(pt) && IS_Y_PT(pt)) - - - static void initDataTables __FP((void)); - static void setDataLayer __FP(( int aN, - char *aName, - char aLayer, - char aCLayer, - long aWidth)); - static void setDataCut __FP(( int aN, - char *aName, - char aCut)); - static void addDataVIA __FP((char *aName, - char aCut, - long width, - long height)); - static dataVIA_t *DEF2MBK_dataVIA __FP((char *aName)); - static long DEF_isLayer __FP((char *aName)); - static char DEF2MBK_layer __FP((char *aName)); - static long DEF2MBK_layerWidth __FP((char *aName)); - static long MBK_layerWidth __FP((char aLayer)); - static char DEF2MBK_dataCut __FP((char *aName)); - static void orderCoord __FP((long *aX1, long *aX2)); - static void DEF_pinxyflat __FP((long *apX_flat, long *apY_flat, - long aX , long aY , - long aX_ins , long aY_ins , - char aT)); - - -/* ------------------------------------------------------------------ - * Functions from Bison/flex. - */ - - extern FILE *yyin; - extern long yylineno; - extern int yydebug; - extern int yyparse __FP((void)); - - - -/* - * /----------------------------------------------------------------\ - * | Functions Definitions | - * \----------------------------------------------------------------/ - */ - -/* ------------------------------------------------------------------ - * Function : "def_design_name()". - */ - -extern void def_design_name(name) - char *name; -{ - if (strcmp (name, LV_pPhFig->NAME)) { - warnMBK ("DEFloadphlofig"); - wprintf ("\n The design name \"%s\" doesn't match with the", name); - wprintf (" file name \"%s\" (.%s).\n", LV_pPhFig->NAME, LV_IN_PH); - } -} - - -/* ------------------------------------------------------------------ - * Function : "def_tech_name()". - */ - -extern void def_tech_name(char *name) -{ -} - - -/* ------------------------------------------------------------------ - * Function : "def_end_design()". - */ - -extern void def_end_design(void) -{ -} - - -/* ------------------------------------------------------------------ - * Function : "def_units()". - */ - -extern void def_units(number) - double number; -{ - DEF_UNITS_MICRONS = (long)number; -} - - -/* ------------------------------------------------------------------ - * Function : "def_die_area()". - */ - -extern void def_die_area(ab1, ab2) - struct pt *ab1, *ab2; -{ - if ( !IS_XY_PT (ab1) || !IS_XY_PT (ab2) ) { - errMBK ("defloadlophfig"); - eprintf ("Invalid coordinate '*' in DIEAREA at line %ld.\n", - yylineno); - EXIT (1); - } - - if (LV_pPhFig) - defab(LV_pPhFig, DEF2MBK_length ((long)(ab1->x)), - DEF2MBK_length ((long)(ab1->y)), - DEF2MBK_length ((long)(ab2->x)), - DEF2MBK_length ((long)(ab2->y))); - - def_free_pt (ab1); - def_free_pt (ab2); -} - - -/* ------------------------------------------------------------------ - * Function : "def_row_rule()". - */ - -extern void def_row_rule(row_name, row_type, x, y, orient, - do_number, by_number, step_x, step_y) - char *row_name; - char *row_type; - double x, y, orient, do_number, by_number, step_x, step_y; -{ - if (LV_pPhFig) { - DEF2MBK_row(LV_pPhFig, - row_name, - row_type, - (long)orient, - (long)do_number, - (long)by_number, - (long)step_x, - (long)step_y, - DEF2MBK_length ((long)x), - DEF2MBK_length ((long)y)); - } - - - free (row_name); - free (row_type); -} - - -/* ------------------------------------------------------------------ - * Function : "def_track_rule()". - */ - -extern void def_track_rule(axis_name, start, do_number, step, layer_list) - char *axis_name; - double start; - double do_number; - double step; - char *layer_list; -{ - long xREF, yREF; - - - - if (LV_pPhFig) { - switch (axis_name[0]) { - case 'Y': - case 'y': - xREF = LV_pPhFig->XAB1; - yREF = DEF2MBK_length ((long)start); - break; - case 'X': - case 'x': - default: - xREF = DEF2MBK_length ((long)start); - yREF = LV_pPhFig->YAB1; - } - - DEF2MBK_track(LV_pPhFig, - axis_name, - (long)start, - (long)do_number, - (long)step, - layer_list, - xREF, - yREF); - } - - - free (axis_name); -} - - -/* ------------------------------------------------------------------ - * Function : "def_track_layers()". - */ - -extern char *def_track_layers(layer_name, layer_list) - char *layer_name; - char *layer_list; -{ - char *layerList; - - - layerList = s64printf ("%s.%s", layer_name, layer_list); - - free (layer_name); - - return (layerList); -} - - -/* ------------------------------------------------------------------ - * Function : "def_start_pins()". - */ - - -extern void def_start_pins(number) - double number; -{ - LV_numObjects = (long)number; - LV_numObjectsRead = 0L; - LV_numPins = 0L; - LV_mPin = LV_numObjects; - - LV_tPin = (pin_t*)malloc (sizeof (pin_t) * LV_numObjects); - - /* Half empty HT are faster. */ - LV_htPin = createauthtable (LV_numObjects); -} - - -/* ------------------------------------------------------------------ - * Function : "def_end_pins()". - */ - -extern void def_end_pins(void) -{ - if (LV_numObjects != LV_numObjectsRead) { - warnMBK ("DEFloadlophig"); - wprintf ("Invalid pins number : %d, (%d read)\n", - LV_numObjects, LV_numObjectsRead); - } -} - - -/* ------------------------------------------------------------------ - * Function : "def_pin_start()". - */ - -extern void def_pin_start(char *pin_name, char *net_name) -{ - char *netName; - - - netName = DEF2MBK_name (net_name); - - if ((searchauthelem (LV_htPin, netName)) == NULL) { - addauthelem (LV_htPin, netName, LV_numPins); - - if (LV_numPins >= LV_mPin) { - LV_mPin += SIZE_TPIN; - LV_tPin = (struct pin_s*)realloc ( - LV_tPin, sizeof (struct pin_s) * LV_mPin); - - if (!LV_tPin) { - eprinth ("defloadlophfig"); - eprintf ("\n Not enougth memory to re-allocate \"LV_tPin[]\".\n"); - EXIT (1); - } - } - - LV_tPin[LV_numPins].netName = netName; - LV_tPin[LV_numPins].pinName = DEF2MBK_name (pin_name); - - LV_numPins++; - } - - LV_flags = 0L; - LV_direction = UNKNOWN; - - LV_numObjectsRead++; - - free (pin_name); - free (net_name); -} - - -/* ------------------------------------------------------------------ - * Function : "def_pin_options()". - */ - -extern void def_pin_options() -{ - char *netName; - char orientCon; - long xCon, yCon, widthCon, lengthCon, fakeCon; - long xR1 , yR1 , xR2 , yR2; - long xFR1, yFR1, xFR2, yFR2; - losig_list *pLoSig; - phseg_list *pPhSeg; - phcon_list *pPhCon; - authelem *pElem; - - - netName = LV_tPin[LV_numPins - 1].netName; - - - /* Process the logical terminal. */ - - if (LV_pLoFig) { - /* The logical terminal/signal pair must be created only once. */ - if (!findlocon (LV_pLoFig, netName)) { - pLoSig = addlosig (LV_pLoFig, - LV_mSig++, - addchain (NULL, (void*)netName), - EXTERNAL); - addlocon (LV_pLoFig, netName, pLoSig, LV_direction); - } - } - - - /* Process the physical terminal, if any. */ - - /* Shuts up "gcc -w" ... */ - xR1 = 0; - yR1 = 0; - xR2 = 0; - yR2 = 0; - xCon = 0; - yCon = 0; - - if (LV_flags & F_PIN_LAYER) { - xR1 = DEF2MBK_length ((long)(LV_pt1->x)); - yR1 = DEF2MBK_length ((long)(LV_pt1->y)); - xR2 = DEF2MBK_length ((long)(LV_pt2->x)); - yR2 = DEF2MBK_length ((long)(LV_pt2->y)) - MBKSCALE(1); - - def_free_pt (LV_pt1); - def_free_pt (LV_pt2); - } - - if (LV_flags & F_PIN_STATE) { - xCon = DEF2MBK_length ((long)(LV_ptCurrent->x)); - yCon = DEF2MBK_length ((long)(LV_ptCurrent->y)); - - def_free_pt (LV_ptCurrent); - } - - - if ((LV_pPhFig) && ((LV_flags & M_PIN_ISPLACED) == M_PIN_ISPLACED)) { - pElem = gettlosegitem (LV_ptLoseg, netName); - - /* Transform (flatten) the PIN segment. */ - DEF_pinxyflat (&xFR1, &yFR1, xR1, yR1, xCon, yCon, LV_orient); - DEF_pinxyflat (&xFR2, &yFR2, xR2, yR2, xCon, yCon, LV_orient); - - orderCoord (&xFR1, &xFR2); - orderCoord (&yFR1, &yFR2); - - - fakeCon = FALSE; - pPhSeg = NULL; /* Shut up "gcc -w ..." */ - /* if (!(LV_defFlags & F_DEF_NO_IOS)) { */ - /* Add the physical segment. */ - switch (LV_orient) { - case NOSYM: - case SYM_X: - case SYM_Y: - case SYMXY: - /* Vertical segment. */ - widthCon = xFR2 - xFR1; - lengthCon = yFR2 - yFR1 + MBKSCALE(1); - - if (lengthCon + widthCon < MBK_X_GRID + FLOOR_XY_EXPAND) { - fakeCon = (LV_defFlags & F_DEF_SHRINK) ? TRUE : FALSE; - __DBG( fprintf (stderr, " - Terminal \"%s\" is fake.\n", - netName); ) - } else { - __DBG( fprintf (stderr, " - Terminal \"%s\" is not fake", - netName); - fprintf (stderr, " DY := %ld\n", MBKUNSCALE(lengthCon)); - ) - fakeCon = FALSE; - } - - if (!fakeCon) { - pPhSeg = addphseg (LV_pPhFig, - getCALU (LV_layer), - widthCon, - xFR1 + widthCon / 2, - yFR1, - xFR1 + widthCon / 2, - yFR2, - netName); - } - break; - default: - case ROT_P: - case ROT_M: - case SY_RP: - case SY_RM: - /* horizontal segment. */ - widthCon = yFR2 - yFR1; - lengthCon = xFR2 - xFR1 + MBKSCALE(1); - - if (lengthCon + widthCon < MBK_X_GRID + FLOOR_XY_EXPAND) { - fakeCon = (LV_defFlags & F_DEF_SHRINK) ? TRUE : FALSE; - __DBG( fprintf (stderr, " - Terminal \"%s\" is fake.\n", - netName); ) - } else { - __DBG( fprintf (stderr, " - Terminal \"%s\" is not fake", - netName); - fprintf (stderr, " DX := %ld\n", MBKUNSCALE(lengthCon)); - ) - fakeCon = FALSE; - } - - if (!fakeCon) { - pPhSeg = addphseg (LV_pPhFig, - getCALU (LV_layer), - widthCon, - xFR1, - yFR1 + widthCon / 2, - xFR2, - yFR1 + widthCon / 2, - netName); - } - break; - } /* End of "switch (LV_orient)". */ - - if (!fakeCon) { - LV_ptLoseg->tLoseg[pElem->VALUE] = addloseg ( - LV_ptLoseg->tLoseg[pElem->VALUE], LOSEG_SEGCON, (void*)pPhSeg); - - - /* Add the old-style terminal. */ - switch (LV_orient) { - - case NOSYM: /* DEF : N (North). */ - case SYM_X: /* DEF : FN (Flipped North). */ - orientCon = SOUTH; - xCon = xFR1 + widthCon / 2; - yCon = yFR1; - break; - - case SYM_Y: /* DEF : FS (Flipped South). */ - case SYMXY: /* DEF : S (South). */ - orientCon = NORTH; - xCon = xFR1 + widthCon / 2; - yCon = yFR2; - break; - - case ROT_M: /* DEF : E (East). */ - case SY_RM: /* DEF : FE (Flipped East). */ - orientCon = WEST; - xCon = xFR1; - yCon = yFR1 + widthCon / 2; - break; - - default: - case ROT_P: /* DEF : W (West). */ - case SY_RP: /* DEF : FW (Flipped West). */ - orientCon = EAST; - xCon = xFR2; - yCon = yFR1 + widthCon / 2; - break; - } /* End of "switch (LV_orient)". */ - - pPhCon = addphcon (LV_pPhFig, - orientCon, - netName, - xCon, - yCon, - LV_layer, - widthCon); - - LV_ptLoseg->tLoseg[pElem->VALUE] = addloseg ( - LV_ptLoseg->tLoseg[pElem->VALUE], LOSEG_CON, (void*)pPhCon); - } - } - /* } */ -} - - -/* ------------------------------------------------------------------ - * Function : "def_pin_option_direction()". - */ - -extern void def_pin_option_direction(dir) - double dir; -{ - LV_flags |= F_PIN_DIRECTION; - LV_direction = DEF2MBK_direction (dir); -} - - -/* ------------------------------------------------------------------ - * Function : "def_pin_option_place()". - */ - -extern void def_pin_option_place(ptcon, orient) - struct pt *ptcon; - double orient; -{ - LV_flags |= F_PIN_STATE; - LV_ptCurrent = ptcon; - LV_orient = DEF2MBK_transf (orient); -} - - -/* ------------------------------------------------------------------ - * Function : "def_pin_option_layer()". - */ - -extern void def_pin_option_layer(layer_name, pt1, pt2) - char *layer_name; - struct pt *pt1; - struct pt *pt2; -{ - LV_flags |= F_PIN_LAYER; - LV_layer = getALU (DEF2MBK_layer (namealloc (layer_name))); - - LV_pt1 = pt1; - LV_pt2 = pt2; -} - - -/* ------------------------------------------------------------------ - * Function : "def_start_vias()". - */ - - -extern void def_start_vias(number) - double number; -{ - LV_numObjects = (long)number; - LV_numObjectsRead = 0L; - LV_flags = 0L; - /* Reset the VIA table. */ - LV_mVIA = 0L; -} - - -/* ------------------------------------------------------------------ - * Function : "def_end_vias()". - */ - -extern void def_end_vias(void) -{ - if (LV_numObjects != LV_numObjectsRead) { - warnMBK ("DEFloadlophig"); - wprintf ("Invalid VIAs number : %d, (%d read)\n", - LV_numObjects, LV_numObjectsRead); - } -} - - -/* ------------------------------------------------------------------ - * Function : "def_via_start()". - */ - -extern void def_via_start(via_name) - char *via_name; -{ - LV_modelName = namealloc (via_name); - LV_numObjectsRead++; - - free (via_name); -} - - -/* ------------------------------------------------------------------ - * Function : "def_via_stmt_rect()". - */ - -extern void def_via_stmt_rect(layer_name, pt1, pt2) - char *layer_name; - struct pt *pt1, *pt2; -{ - char *DEF_layer; - - - DEF_layer = namealloc (layer_name); - - if (DEF_isLayer (DEF_layer)) { - LV_layer = DEF2MBK_layer (DEF_layer); - - /* This is one of the layer geometry. */ - LV_width = DEF2MBK_length ((long)(pt2->x) - (long)(pt1->x)); - LV_height = DEF2MBK_length ((long)(pt2->y) - (long)(pt1->y)); - - LV_width = ABS(LV_width); - LV_height = ABS(LV_height); - - if ( (LV_height <= MBKSCALE(2)) - && (LV_width <= MBKSCALE(2))) { - LV_width = 0; - LV_height = 0; - } - } else { - /* This is the cut layer. */ - LV_VIA = DEF2MBK_dataCut (DEF_layer); - - LV_flags |= F_VIA_CUT; - } - - def_free_pt (pt1); - def_free_pt (pt2); - free (layer_name); -} - - -/* ------------------------------------------------------------------ - * Function : "def_via_stmt_pattern()". - */ - -extern void def_via_stmt_pattern(pattern_name) - char *pattern_name; -{ - LV_flags |= F_VIA_PATTERN; - - free (pattern_name); -} - - -/* ------------------------------------------------------------------ - * Function : "def_via_end()". - */ - -extern void def_via_end() -{ - if (!(LV_flags & F_VIA_CUT)) - LV_VIA = getTurnVIA (LV_layer); - - mprintf2 (" - \"%20s\" id %02d %5ldx%-5ld.\n", - LV_modelName, LV_VIA, LV_width, LV_height); - - addDataVIA (LV_modelName, LV_VIA, LV_width, LV_height); - - LV_flags = 0; -} - - -/* ------------------------------------------------------------------ - * Function : "def_start_comps()". - */ - - -extern void def_start_comps(number) - double number; -{ - LV_numObjects = (long)number; - LV_numObjectsRead = 0L; -} - - -/* ------------------------------------------------------------------ - * Function : "def_end_comps()". - */ - -extern void def_end_comps(void) -{ - if (LV_numObjects != LV_numObjectsRead) { - warnMBK ("DEFloadlophig"); - wprintf ("Invalid components number : %d, (%d read)", - LV_numObjects, LV_numObjectsRead); - } -} - - -/* ------------------------------------------------------------------ - * Function : "def_comp_start()". - */ - -extern void def_comp_start(char *ins_name, char *cell_name) -{ - LV_numObjectsRead++; - - if (LV_pPhFig) { - /* Coordinates and symetry will be filled by "comp_options()". */ - LV_pPhIns = addphins (LV_pPhFig, cell_name, ins_name, NOSYM, 0, 0); - } - - if (LV_pLoFig) { - /* Assignement of signals to terminals will be done in the "net" - * section. - */ - addloins_noSig (LV_pLoFig, ins_name, getlofig (cell_name, 'P')); - } - - free ( ins_name); - free (cell_name); -} - - -/* ------------------------------------------------------------------ - * Function : "def_comp_net_list()". - */ - -extern void def_comp_net_list(char *name) -{ -} - - -/* ------------------------------------------------------------------ - * Function : "def_comp_type()". - */ - -extern void def_comp_type(pt, orient) - struct pt *pt; - double orient; -{ - if (LV_pPhFig) { - if (!IS_XY_PT (pt)) { - errMBK ("defloadlophfig"); - eprintf ("\n Invalid coordinate '*' for instance placement \"%s\"\n", - LV_pPhIns->INSNAME); - eprintf (" at line %ld.\n", yylineno); - EXIT (1); - } - - LV_pPhIns->XINS = DEF2MBK_length ((long)(pt->x)); - LV_pPhIns->YINS = DEF2MBK_length ((long)(pt->y)); - LV_pPhIns->TRANSF = DEF2MBK_transf (orient); - } - - def_free_pt (pt); -} - - -/* ------------------------------------------------------------------ - * Function : "def_start_nets()". - */ - - -extern void def_start_nets(double number) -{ - LV_numObjects = (long)number; - LV_numObjectsRead = 0L; - - mprintf1 (" o Reading NETS section (%ld nets)\n", LV_numObjects); -} - - -/* ------------------------------------------------------------------ - * Function : "def_end_nets()". - */ - -extern void def_end_nets(void) -{ - if (LV_numObjects != LV_numObjectsRead) { - warnMBK ("DEFloadlophig"); - wprintf ("Invalid net number : %d, (%d read)", - LV_numObjects, LV_numObjectsRead); - } -} - - -/* ------------------------------------------------------------------ - * Function : "def_net_start()". - */ - -extern void def_net_start(char *name) -{ - struct authelem *pElem; - - - LV_numObjectsRead++; - LV_modelName = DEF2MBK_name (name); - - mprintf2 (" - \"%s\"\n", LV_modelName); - - if ((pElem = searchauthelem (LV_htPin, LV_modelName)) != NULL) { - /* The terminal name no longer override the net name. But we keep - * the pin hash table because we must know if the net is external - * or internal (i.e. the layer is ALU or CALU. - * - * LV_modelName = LV_tPin[pElem->VALUE].pinName; - */ - LV_flags = F_SEG_PIN; - if (LV_pLoFig) { - LV_pLoSig = getlosig (LV_pLoFig, pElem->VALUE); - } - } else { - /* This not is not linked to a terminal. So it has not been created - * while reading the PIN section. We do it now. - */ - if (LV_pLoFig) { - LV_pLoSig = addlosig (LV_pLoFig, - LV_mSig++, - addchain (NULL, (void*)LV_modelName), - INTERNAL); - } - LV_flags = 0L; - } - - free (name); -} - - -/* ------------------------------------------------------------------ - * Function : "def_path_start()". - */ - -extern void def_path_start(layer_name) - char *layer_name; -{ - char *DEF_layer; - - - DEF_layer = namealloc (layer_name); - - LV_layer = DEF2MBK_layer (DEF_layer); - LV_width = DEF2MBK_layerWidth (DEF_layer); - LV_flags |= F_SEG_INITIAL; - - free (layer_name); -} - - -/* ------------------------------------------------------------------ - * Function : "def_path_item_via()". - */ - -extern void def_path_item_via(via_name) - char *via_name; -{ - char *DEF_viaLayer; - dataVIA_t *pDataVIA; - authelem *pElem; - phvia_list *pPhvia; - - - /* This a VIA and maybe a layer change. */ - DEF_viaLayer = namealloc (via_name); - - - if (LV_flags & F_SEG_INITIAL) { - errMBK ("defloadlophfig"); - eprintf ("Net path cannot begin by a VIA at line %ld", yylineno); - EXIT (1); - } - - - pDataVIA = DEF2MBK_dataVIA (DEF_viaLayer); - LV_layer = getAltVIALayer (pDataVIA->VIA, LV_layer); - - if (!(LV_flags & F_SEG_SPECIAL)) { - LV_width = MBK_layerWidth (LV_layer); - } - - - if (LV_pPhFig && !(LV_flags & F_SEG_BLOCKAGE)) { - pPhvia = addphvia(LV_pPhFig, - pDataVIA->VIA, - LV_lastX, - LV_lastY, - pDataVIA->width, - pDataVIA->height, - LV_modelName); - - if (!getmvia (LV_ptLoseg->tMVIA, pPhvia)) { - LV_ptLoseg->tMVIA = addmvia (LV_ptLoseg->tMVIA, pPhvia); - } - - pElem = gettlosegitem (LV_ptLoseg, LV_modelName); - - LV_ptLoseg->tLoseg[pElem->VALUE] = addloseg ( - LV_ptLoseg->tLoseg[pElem->VALUE], LOSEG_VIA, (void*)pPhvia); - } - - - free (via_name); -} - - -/* ------------------------------------------------------------------ - * Function : "def_path_item_pt()". - */ - -extern void def_path_item_pt(pt) - struct pt *pt; -{ - long curX, curY; - char *sigName, powerName[64]; - authelem *pElem; - phseg_list *pPhSeg; - - - if (IS_X_PT(pt)) { curX = DEF2MBK_length ((long)pt->x); } - else { curX = LV_lastX; } - - - if (IS_Y_PT(pt)) { curY = DEF2MBK_length ((long)pt->y); } - else { curY = LV_lastY; } - - - if (LV_flags & F_SEG_INITIAL) { - if (!IS_XY_PT(pt)) { - errMBK ("defloadlophfig"); - eprintf ("Invalid first net path point at line %ld", yylineno); - EXIT (1); - } - - LV_flags &= ~F_SEG_INITIAL; - } else { - if (LV_pPhFig) { - if ( (LV_defFlags & F_DEF_SPLIT_POWER) - && (isvdd (LV_modelName) || isvss (LV_modelName))) { - sigName = powerName; - sprintf (sigName, - "%s.%ld", - LV_modelName, - (curY - LV_pPhFig->XAB1 + MBKSCALE(25)) / MBKSCALE(50)); - } else - sigName = LV_modelName; - - if (!(LV_flags & F_SEG_BLOCKAGE)) { - pPhSeg = addphseg (LV_pPhFig, - (LV_flags & F_SEG_PIN) ? getCALU (LV_layer) - : LV_layer, - LV_width, - LV_lastX, - LV_lastY, - curX, - curY, - sigName); - - pElem = gettlosegitem (LV_ptLoseg, sigName); - - LV_ptLoseg->tLoseg[pElem->VALUE] = addloseg ( - LV_ptLoseg->tLoseg[pElem->VALUE], LOSEG_SEG, (void*)pPhSeg); - } - } - } - - - LV_lastX = curX; - LV_lastY = curY; - - def_free_pt (pt); -} - - -/* ------------------------------------------------------------------ - * Function : "def_opt_width()". - */ - - extern void def_opt_width(number) - double number; -{ - LV_width = DEF2MBK_length ((long)number); -} - - -/* ------------------------------------------------------------------ - * Function : "def_net_conn_start()". - */ - -extern void def_net_conn_start(char *ins_name, char *pin_name) -{ - if (LV_pLoFig) { - if (strcmp (ins_name, "PIN")) { - addlosig_insCon (getloins (LV_pLoFig, - ins_name), - DEF2MBK_name (pin_name), - LV_pLoSig); - - free (ins_name); - } - } - - - free (pin_name); -} - - -/* ------------------------------------------------------------------ - * Function : "def_net_conn_opt_synthesized()". - */ - -extern void def_net_conn_opt_synthesized() -{ -} - - -/* ------------------------------------------------------------------ - * Function : "def_start_snets()". - */ - - -extern void def_start_snets(double number) -{ - LV_numObjects = (long)number; - LV_numObjectsRead = 0L; - - mprintf1 (" o Reading SPECIALNETS section.\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "def_end_snets()". - */ - -extern void def_end_snets(void) -{ - if (LV_numObjects != LV_numObjectsRead) { - warnMBK ("DEFloadlophig"); - wprintf ("Invalid special nets number : %d, (%d read)", - LV_numObjects, LV_numObjectsRead); - } -} - - -/* ------------------------------------------------------------------ - * Function : "def_snet_start()". - */ - -extern void def_snet_start(char *name) -{ - struct authelem *pElem; - - - LV_numObjectsRead++; - LV_modelName = namealloc (name); - LV_flags = F_SEG_SPECIAL; - - if (LV_modelName == LV_blockageName) { - /* This is a special net named "_BLOCKAGE_RESERVED" used to forbid - * the corners of the design when placing the IO pins. Must not be - * driven in the MBK data-base. - */ - LV_flags |= F_SEG_BLOCKAGE; - } else { - if ((pElem = searchauthelem (LV_htPin, LV_modelName)) != NULL) { - /* The terminal name no longer override the net name. But we keep - * the pin hash table because we must know if the net is external - * or internal (i.e. the layer is ALU or CALU. - * - * LV_modelName = LV_tPin[pElem->VALUE].pinName; - */ - LV_flags |= F_SEG_PIN; - if (LV_pLoFig) { - LV_pLoSig = getlosig (LV_pLoFig, pElem->VALUE); - } - } else { - /* This not is not linked to a terminal. So it has not been created - * while reading the PIN section. We do it now. - */ - if (LV_pLoFig) { - LV_pLoSig = addlosig (LV_pLoFig, - LV_mSig++, - addchain (NULL, - (void*)DEF2MBK_name(LV_modelName)), - INTERNAL); - } - LV_flags = 0L; - } - } - - mprintf2 (" - \"%s\".\n", LV_modelName); - - - free (name); -} - - -/* ------------------------------------------------------------------ - * Function : "def_snet_conn_start()". - */ - -extern void def_snet_conn_start(char *ins_name, char *pin_name) -{ - if (LV_pLoFig) { - if (strcmp (ins_name, "PIN")) { - addlosig_insCon (getloins (LV_pLoFig, - ins_name), - pin_name, - LV_pLoSig); - - free (ins_name); - } - } - - - free (pin_name); -} - - -/* ------------------------------------------------------------------ - * Function : "def_snet_conn_opt_synthesized()". - */ - -extern void def_snet_conn_opt_synthesized() -{ -} - - -/* ------------------------------------------------------------------ - * Function : "def_snet_conn_opt_synthesized()". - */ - -extern void def_parse_error(str) - char *str; -{ - errMBK ("DEFloadphlofig"); - eprintf ("%s line %d.\n", str, yylineno); - EXIT (1); -} - - -/* ------------------------------------------------------------------ - * Function : "def_alloc_pt()". - */ - -extern struct pt *def_alloc_pt(x, y) - double x, y; -{ - struct pt *pt; - - - pt = (struct pt*)malloc (sizeof (struct pt)); - - if (!pt) { - errMBK ("DEFloadlophig"); - eprintf ("Not enougth memory in \"def_alloc_pt()\"!\n"); - EXIT (1); - } - - pt->x = x; - pt->y = y; - - return (pt); -} - - -/* ------------------------------------------------------------------ - * Function : "def_free_pt()". - */ - -extern void def_free_pt(pt) - struct pt *pt; -{ - free (pt); -} - - -/* ------------------------------------------------------------------ - * Function : "initDataTables()". - */ - -static void initDataTables() -{ - int iData; - - - for (iData = 0; iData < SIZE_TDATALAYER; iData++) { - tDataLayer[iData].flags = 0L; - } - - for (iData = 0; iData < SIZE_TDATACUT; iData++) { - tDataCut[iData].flags = 0L; - } - - for (iData = 0; iData < SIZE_TDATAVIA; iData++) { - tDataVIA[iData].flags = 0L; - } -} - - -/* ------------------------------------------------------------------ - * Function : "setDataLayer()". - */ - -static void setDataLayer(aN, aName, aLayer, aCLayer, aWidth) - int aN; - char *aName; - char aLayer; - char aCLayer; - long aWidth; -{ - tDataLayer[aN].name = namealloc (aName); - tDataLayer[aN].layer = aLayer; - tDataLayer[aN].clayer = aCLayer; - tDataLayer[aN].width = aWidth; - tDataLayer[aN].flags |= F_DATA_SET; -} - - -/* ------------------------------------------------------------------ - * Function : "setDataCut()". - */ - -static void setDataCut(aN, aName, aCut) - int aN; - char *aName; - char aCut; -{ - tDataCut[aN].name = namealloc (aName); - tDataCut[aN].VIA = aCut; - tDataCut[aN].flags |= F_DATA_SET; -} - - -/* ------------------------------------------------------------------ - * Function : "addDataVIA()". - */ - -static void addDataVIA(aName, aCut, aWidth, aHeight) - char *aName; - char aCut; - long aWidth; - long aHeight; -{ - if (LV_mVIA > SIZE_TDATAVIA) { - errMBK ("DEFloadlophig"); - eprintf ("VIA table overfow (more than %d VIAs).\n", SIZE_TDATAVIA); - EXIT (1); - } - - tDataVIA[LV_mVIA].name = namealloc (aName); - tDataVIA[LV_mVIA].VIA = aCut; - tDataVIA[LV_mVIA].flags |= F_DATA_SET; - tDataVIA[LV_mVIA].width = aWidth; - tDataVIA[LV_mVIA].height = aHeight; - - LV_mVIA++; -} - - -/* ------------------------------------------------------------------ - * Function : "DEF2MBK_dataVIA()". - */ - -static dataVIA_t *DEF2MBK_dataVIA(aName) - char *aName; -{ - int iDV; - - - for (iDV = 0; iDV < SIZE_TDATAVIA; iDV++) { - if ( (tDataVIA[iDV].flags & F_DATA_SET) - && (tDataVIA[iDV].name == aName)) { - return (&(tDataVIA[iDV])); - } - } - - errMBK ("DEFloadphlofig"); - eprintf ("\n Unknown DEF VIA name \"%s\" at line %d.\n", - aName, yylineno); - EXIT (1); - - /* Only to shut up GCC... */ - return (NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF_isLayer()". - */ - -static long DEF_isLayer(aName) - char *aName; -{ - int iDL; - - - for (iDL = 0; iDL < SIZE_TDATALAYER; iDL++) { - if ( (tDataLayer[iDL].flags & F_DATA_SET) - && (tDataLayer[iDL].name == aName)) { - return (TRUE); - } - } - - return (FALSE); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF2MBK_layer()". - */ - -static char DEF2MBK_layer(aName) - char *aName; -{ - int iDL; - - - for (iDL = 0; iDL < SIZE_TDATALAYER; iDL++) { - if ( (tDataLayer[iDL].flags & F_DATA_SET) - && (tDataLayer[iDL].name == aName)) { - return (tDataLayer[iDL].layer); - } - } - - errMBK ("DEFloadphlofig"); - eprintf ("\n Unknown DEF layer name \"%s\" at line %d.\n", - aName, yylineno); - EXIT (1); - - /* Only to shut up GCC... */ - return ('\0'); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF2MBK_layerWidth()". - */ - -static long DEF2MBK_layerWidth(aName) - char *aName; -{ - int iDL; - - - for (iDL = 0; iDL < SIZE_TDATALAYER; iDL++) { - if ( (tDataLayer[iDL].flags & F_DATA_SET) - && (tDataLayer[iDL].name == aName)) { - return (tDataLayer[iDL].width); - } - } - - errMBK ("DEFloadphlofig"); - eprintf ("\n Unknown DEF layer name \"%s\" at line %d.\n", - aName, yylineno); - EXIT (1); - - /* Only to shut up GCC... */ - return (0L); -} - - -/* ------------------------------------------------------------------ - * Function : "MBK_layerWidth()". - */ - -static long MBK_layerWidth(aLayer) - char aLayer; -{ - int iDL; - - - for (iDL = 0; iDL < SIZE_TDATALAYER; iDL++) { - if ( (tDataLayer[iDL].flags & F_DATA_SET) - && ( (tDataLayer[iDL].layer == aLayer) - || (tDataLayer[iDL].clayer == aLayer))) { - return (tDataLayer[iDL].width); - } - } - - errMBK ("DEFloadphlofig"); - eprintf ("\n Unknown MBK layer id \"%d\" at line %d.\n", - (int)aLayer, yylineno); - EXIT (1); - - /* Only to shut up GCC... */ - return (0L); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF2MBK_dataCut()". - */ - -static char DEF2MBK_dataCut(aName) - char *aName; -{ - int iDC; - - - for (iDC = 0; iDC < SIZE_TDATACUT; iDC++) { - if ( (tDataCut[iDC].flags & F_DATA_SET) - && (tDataCut[iDC].name == aName)) { - return (tDataCut[iDC].VIA); - } - } - - errMBK ("DEFloadphlofig"); - eprintf ("\n Unknown DEF cut layer name \"%s\" at line %d.\n", - aName, yylineno); - EXIT (1); - - /* Only to shut up GCC... */ - return ('\0'); -} - - -/* ------------------------------------------------------------------ - * Function : "orderCoord()". - */ - -static void orderCoord (aX1, aX2) - long *aX1, *aX2; -{ - long tmp; - - - if (*aX1 > *aX2) - { tmp = *aX1; *aX1 = *aX2; *aX2 = tmp; } -} - - -/* ------------------------------------------------------------------ - * Function : "DEF_pinxyflat()". - */ - -static void DEF_pinxyflat(apX_flat, apY_flat, aX, aY, aX_ins, aY_ins, aT) - long *apX_flat, *apY_flat; - long aX , aY; - long aX_ins , aY_ins; - char aT; -{ - switch (aT) { - /* DEF : N (North). */ - case NOSYM : - *apX_flat = aX_ins + aX; - *apY_flat = aY_ins + aY; - break; - - /* DEF : FN (Flipped North). */ - case SYM_X : - *apX_flat = aX_ins - aX; - *apY_flat = aY_ins + aY; - break; - - /* DEF : S (Flipped South). */ - case SYM_Y : - *apX_flat = aX_ins + aX; - *apY_flat = aY_ins - aY; - break; - - /* DEF : S (South). */ - case SYMXY : - *apX_flat = aX_ins - aX; - *apY_flat = aY_ins - aY; - break; - - /* DEF : W (West). */ - case ROT_P : - *apX_flat = aX_ins - aY; - *apY_flat = aY_ins + aX; - break; - - /* DEF : E (East). */ - case ROT_M : - *apX_flat = aX_ins + aY; - *apY_flat = aY_ins - aX; - break; - - /* DEF : FP (Flipped West). */ - case SY_RP : - *apX_flat = aX_ins + aY; - *apY_flat = aY_ins + aX; - break; - - /* DEF : FE (Flipped East). */ - case SY_RM : - *apX_flat = aX_ins - aY; - *apY_flat = aY_ins - aX; - break; - } -} - - -/* ------------------------------------------------------------------ - * Function : "LEF2MBK_setData()". - */ - -static void LEF2MBK_setData() -{ - setDataLayer (0, "L_ALU1", ALU1, CALU1, MBKSCALE(1)); - setDataLayer (1, "L_ALU2", ALU2, CALU2, MBKSCALE(2)); - setDataLayer (2, "L_ALU3", ALU3, CALU3, MBKSCALE(2)); - setDataLayer (3, "L_ALU4", ALU4, CALU4, MBKSCALE(2)); - setDataLayer (4, "L_ALU5", ALU5, CALU5, MBKSCALE(2)); - setDataLayer (5, "L_ALU6", ALU6, CALU6, MBKSCALE(2)); - setDataLayer (6, "L_ALU7", ALU7, CALU7, MBKSCALE(2)); - setDataLayer (7, "L_ALU8", ALU8, CALU8, MBKSCALE(2)); - setDataLayer (8, "L_ALU9", ALU9, CALU9, MBKSCALE(2)); - - setDataCut (0, "L_CONT", CONT_POLY); - setDataCut (1, "L_VIA1", CONT_VIA); - setDataCut (2, "L_VIA2", CONT_VIA2); - setDataCut (3, "L_VIA3", CONT_VIA3); - setDataCut (4, "L_VIA4", CONT_VIA4); - setDataCut (5, "L_VIA5", CONT_VIA5); - setDataCut (6, "L_VIA6", CONT_VIA6); - setDataCut (7, "L_VIA7", CONT_VIA7); - setDataCut (8, "L_VIA8", CONT_VIA8); -} - - -/* ------------------------------------------------------------------ - * Function : "defloadlophig()". - */ - -extern void defloadlophfig (apLoFig, apPhFig, aName, aMode, aVL, aFlags) - lofig_list *apLoFig; - phfig_list *apPhFig; - char *aName; - char aMode; - long aVL; - long aFlags; -{ - long isRouted, iLoseg, type; - void *MBKobj; - struct ePow_s *plPow; - struct eLoseg_s *pLoseg; - - - LV_pPhFig = apPhFig; - LV_pLoFig = apLoFig; - LV_mode = aMode; - LV_name = namealloc (aName); - LV_mSig = 0L; - LV_defFlags = aFlags; - - LV_blockageName = namealloc ("_BLOCKAGE_RESERVED"); - - setVL (aVL); - - - initDataTables (); - LEF2MBK_setData (); - - - if (!LV_pLoFig) { - errMBK ("defloadlophfig"); - eprintf ("\n lofig is not allocated"); - eprintf (" while loading \"%s.%s\"\n", aName, LV_IN_PH); - EXIT (1); - } - - if (LV_mode != 'A') { - errMBK ("defloadlophfig"); - eprintf ("\n Unsupported load mode '%c'", aMode); - eprintf (" while loading \"%s.%s\"\n", aName, LV_IN_PH); - EXIT (1); - } - - yyin = mbkfopen (LV_name, LV_IN_PH, READ_TEXT); - if (!yyin) { - errMBK ("defloadlophfig"); - eprintf ("\n Unable to open file \"%s.%s\"\n", aName, LV_IN_PH); - EXIT (1); - } - - - mprintf2 ("\n"); - - LV_ptLoseg = addtloseg (LV_pPhFig); - - yylineno = 1; - yydebug = 0; - yyparse (); - - destroyauthtable (LV_htPin); - free (LV_tPin); - - mprintf2 ("\n"); - - - if (fclose (yyin)) { - warnMBK ("defloadlophfig"); - wprintf ("\n Unable to close file \"%s.%s\"\n", aName, LV_IN_PH); - } - - - delfeed (LV_pLoFig); - checkLofig (LV_pLoFig); - - if (LV_pPhFig) { - if (LV_defFlags & F_DEF_NO_IOS) { - __DBG( fprintf (stderr, "\n o Removing fake IO\'s.\n"); ) - for (iLoseg = 0; iLoseg < LV_ptLoseg->sigNB; iLoseg++) { - isRouted = FALSE; - - for (pLoseg = LV_ptLoseg->tLoseg[iLoseg]; - pLoseg != NULL; pLoseg = pLoseg->next) { - switch (pLoseg->type) { - case LOSEG_VIA: - __DBG( - fprintf (stderr, " - \"%s\" is routed.\n", - ((struct phvia*)(pLoseg->MBKobj))->NAME); - ) - isRouted = TRUE; - break; - case LOSEG_SEG: - __DBG( - fprintf (stderr, " - \"%s\" is routed.\n", - ((struct phseg*)(pLoseg->MBKobj))->NAME); - ) - isRouted = TRUE; - break; - case LOSEG_CON: - case LOSEG_SEGCON: - break; - } - - if (isRouted) break; - } - - /* If There is only terminal related objects : delete them. */ - if (!isRouted) { - __DBG( fprintf (stderr, " - Removing ?\n"); ) - for (pLoseg = LV_ptLoseg->tLoseg[iLoseg]; pLoseg != NULL; ) { - __DBG( fprintf (stderr, " - Removing loseg item.\n"); ) - type = pLoseg->type; - MBKobj = pLoseg->MBKobj; - __DBG( fprintf (stderr, " - MBKobj := %p.\n", MBKobj); ) - - pLoseg = delloseg (pLoseg); - - switch (type) { - case LOSEG_VIA: - delphvia (LV_pPhFig, (struct phvia*)MBKobj); - break; - case LOSEG_CON: - __DBG( - fprintf (stderr, " - Removing MBK phcon := "); - fprintf (stderr, "\"%s\".\n", ((struct phcon*)MBKobj)->NAME); - ) - - delphcon (LV_pPhFig, (struct phcon*)MBKobj); - break; - case LOSEG_SEG: - case LOSEG_SEGCON: - __DBG( - fprintf (stderr, " - Removing MBK phseg := "); - fprintf (stderr, "\"%s\".\n", ((struct phseg*)MBKobj)->NAME); - ) - delphseg (LV_pPhFig, (struct phseg*)MBKobj); - break; - } - } - - LV_ptLoseg->tLoseg[iLoseg] = NULL; - } - } - } - - if (!(LV_defFlags & F_DEF_NO_INTERF)) { - long powFlags; - - - mprintf1 (" o Copying up CALUx terminal segments.\n"); - copyUpCALU (LV_pLoFig, LV_pPhFig, 0); - - mprintf1 (" o Adding power supplies terminals.\n"); - - - powFlags = 0L; - if (LV_defFlags & F_DEF_MERGE_TERM) powFlags = F_POWER_MERGE; - - plPow = buildPow (LV_pPhFig, ALU1, C_POWER_HORIZONTAL, ""); - powToCon (LV_pPhFig, ALU1, C_POWER_HORIZONTAL, plPow, powFlags); - - plPow = buildPow (LV_pPhFig, ALU3, C_POWER_VERTICAL, ""); - powToCon (LV_pPhFig, ALU3, C_POWER_VERTICAL, plPow, powFlags); - } - } -} diff --git a/alliance/src/sea/src/DEF_actions.h b/alliance/src/sea/src/DEF_actions.h deleted file mode 100644 index 4a61fe50..00000000 --- a/alliance/src/sea/src/DEF_actions.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * $Author: jpc $ - * $Id: DEF_actions.h,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * $Date: 2002/04/25 16:16:20 $ - */ - -#ifndef __deffunc_h -#define __deffunc_h - -#ifdef __cplusplus -extern "C" { -#endif - -#define DEF_NOSYM 0x0000 -#define DEF_SYM_X 0x0001 -#define DEF_SYM_Y 0x0002 -#define DEF_ROT_P 0x0004 -#define DEF_ROT_M 0x0008 - -#define DEF_N (DEF_NOSYM) -#define DEF_S (DEF_SYM_X | DEF_SYM_Y) -#define DEF_W (DEF_ROT_P) -#define DEF_E (DEF_ROT_M) -#define DEF_FN (DEF_SYM_X) -#define DEF_FS (DEF_SYM_Y) -#define DEF_FW (DEF_SYM_Y | DEF_ROT_M) -#define DEF_FE (DEF_SYM_Y | DEF_ROT_P) - -#define DEF_INPUT 10 -#define DEF_OUTPUT 11 -#define DEF_INOUT 12 -#define DEF_FEEDTHRU 13 - -struct pt { double x, y; }; - -extern void def_design_name(char *name); -extern void def_tech_name(char *name); -extern void def_end_design(void); - -extern void def_units(double number); - -extern void def_die_area(struct pt *ab1, struct pt *ab2); - -extern void def_row_rule(char *row_name, - char *row_type, - double x, - double y, - double orient, - double do_number, - double by_number, - double step_x, - double step_y); - -extern void def_track_rule(char *axis_name, - double start, - double do_number, - double step, - char *layer_list); -extern char *def_track_layers(char *layer_name, char *layer_list); - -extern void def_start_pins(double number); -extern void def_end_pins(void); -extern void def_pin_start(char *pin_name, char *net_name); -extern void def_pin_options(void); -extern void def_pin_option_direction(double dir); -extern void def_pin_option_place(struct pt *pt, double orient); -extern void def_pin_option_layer(char *layer_name, struct pt *pt1, struct pt *pt2); - -extern void def_start_vias(double number); -extern void def_end_vias(void); -extern void def_via_start(char *via_name); -extern void def_via_stmt_rect(char *layer_name, struct pt *pt1, struct pt *pt2); -extern void def_via_stmt_pattern(char *pattern_name); -extern void def_via_end(void); - -extern void def_start_comps(double number); -extern void def_end_comps(void); -extern void def_comp_start(char *ins_name, char *cell_name); -extern void def_comp_net_list(char *name); -extern void def_comp_type(struct pt* pt, double orient); - -extern void def_start_nets(double number); -extern void def_end_nets(void); -extern void def_net_start(char *name); -extern void def_net_conn_start(char *ins_name, char *pin_name); -extern void def_net_conn_opt_synthesized(void); -extern void def_path_start(char *layer_name); -extern void def_path_item_via(char *via_name); -extern void def_path_item_pt(struct pt *pt1); -extern void def_opt_width(double number); - -extern void def_start_snets(double number); -extern void def_end_snets(void); -extern void def_snet_start(char *name); -extern void def_snet_conn_start(char *ins_name, char *pin_name); -extern void def_snet_conn_opt_synthesized(void); - -extern struct pt *def_alloc_pt(double x, double y); -extern void def_free_pt(struct pt *pt); - -extern void def_parse_error(char *str); - - -#ifdef __cplusplus -} -#endif - -#endif /* __deffunc_h */ diff --git a/alliance/src/sea/src/DEF_drive.c b/alliance/src/sea/src/DEF_drive.c deleted file mode 100644 index a86f1ed6..00000000 --- a/alliance/src/sea/src/DEF_drive.c +++ /dev/null @@ -1,1699 +0,0 @@ -/* - * $Id: DEF_drive.c,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./DEF_drive.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "debugoff.h" -# include "util_Defs.h" -# include "DEF_drive.h" - - -/* ------------------------------------------------------------------ - * Internal types and defines. - */ - -# define C_DIRECTION_NONE ((char)0) -# define C_DIRECTION_INPUT ((char)1) -# define C_DIRECTION_OUTPUT ((char)2) -# define C_DIRECTION_TRISTATE ((char)3) -# define C_DIRECTION_INOUT ((char)4) -# define C_DIRECTION_FEEDTHRU ((char)5) - -# define C_USE_NONE ((char)0) -# define C_USE_SIGNAL ((char)1) -# define C_USE_ANALOG ((char)2) -# define C_USE_POWER ((char)3) -# define C_USE_GROUND ((char)4) -# define C_USE_CLOCK ((char)5) - -# define TTERM_SIZE 1024 - -# define PTYPE_PHFIG 1024 -# define PTYPE_LOFIG 1025 - -# define F_REGULAR_NET 0x00000001 -# define F_SPECIAL_NET 0x00000002 - -# define F_SEG_WIDTH 0x00000001 -# define F_SEG_STRIPE 0x00000002 - - -/* ------------------------------------------------------------------ - * Internal types. - */ - - typedef struct row_s { - char *rowName; - char *rowType; - long x; - long y; - long orient; - long doNumber; - long byNumber; - long stepX; - long stepY; - struct row_s *next; - } row_t; - - typedef struct track_s { - char axisName; - long start; - long doNumber; - long step; - char *routingLayers; - long x; - long y; - struct track_s *next; - } track_t; - - typedef struct blockage_s { - long x; - long y; - long width; - long height; - struct blockage_s *next; - } blockage_t; - - -/* ------------------------------------------------------------------ - * Internal variables. - */ - - static FILE *DEF_FILE; - static long LV_Flags = 0L; - static long LV_localFlags = 0L; - static char *LV_name; - static struct lofig *LV_lofig; - static struct phfig *LV_phfig; - static struct row_s *LV_row; - static struct track_s *LV_track; - static struct blockage_s *LV_blockage; - static struct authtable *LV_htTerm; - static char routingLayers3[256] = "L_ALU1 L_ALU2 L_ALU3"; - static char routingLayers4[256] = - "L_ALU1 L_ALU2 L_ALU3 L_ALU4"; - static char routingLayers6[256] = - "L_ALU1 L_ALU2 L_ALU3 L_ALU4 L_ALU5 L_ALU6"; - - -/* ------------------------------------------------------------------ - * Local functions. - */ - - static struct phins *getphinslink __FP((struct loins *apLoins)); - static void buildphinslinks __FP((void)); - static void buildtterm __FP((void)); - static void freetterm __FP((void)); - static void freephinslinks __FP((void)); - static void swapOrient __FP((char *apSameOrient, - char *apOppositeOrient)); - static char normOrient __FP((char aOrient)); - static long orientPhfig __FP((struct phfig *apPhfig, - char *apSameOrient, - char *apOppositeOrient)); - static char *DIRtoa __FP((char acDIR)); - static char *USEtoa __FP((char acUSE)); - static char *strLCat __FP((char *asLine, - char *asEl, - long *aplLine, - long alMax)); - static void fprintDIEAREA __FP((void)); - static struct row_s *newrow __FP((void)); - static void freerow __FP((void)); - static void ref2ROW __FP((void)); - static struct row_s *getBaseRow __FP((long aX, - long aY, - char aOrient)); - static void fprintROWS __FP((void)); - static struct track_s *newtrack __FP((void)); - static void freetrack __FP((void)); - static void ref2TRACK __FP((void)); - static void fprintTRACKS __FP((void)); - static struct blockage_s *newblockage __FP((void)); - static void freeblockage __FP((void)); - static void ref2BLOCKAGE __FP((void)); - static void fprintBLOCKAGE __FP((void)); - static void fprintVIAMATRIX __FP((char aType, - long aWidth, - long aHeight)); - static void fprintVIAS __FP((void)); - static long checkPhins __FP((struct phins *apPhins)); - static void fprintCOMPONENTS __FP((void)); - static void fprintPIN __FP((struct locon *apLocon, - struct phcon *apPhcon, - char *asState)); - static void fprintPINS __FP((void)); - static void fprintWIRESEG __FP((struct phseg *apPhseg, - long aFlags)); - static void fprintWIREVIA __FP((struct phvia *apPhvia, - long aFlags)); - static void fprintWIRES __FP((struct losig *apLosig)); - static void fprintNET __FP((struct losig *apLoSig, - char aUse)); - static void fprintNETS __FP((void)); - static void fprintSPECIALNETS __FP((void)); - static void fprintDEF __FP((void)); - - -/* - * /----------------------------------------------------------------\ - * | Functions Definitions | - * \----------------------------------------------------------------/ - */ - -/* ------------------------------------------------------------------ - * Function : "getphinslink()". - */ - -static struct phins *getphinslink(apLoins) - struct loins *apLoins; -{ - struct ptype *pType; - - - if ((pType = getptype (apLoins->USER, PTYPE_PHFIG)) == NULL) - return (NULL); - - return ((struct phins*)pType->DATA); -} - - -/* ------------------------------------------------------------------ - * Function : "buildphinslinks()". - */ - -static void buildphinslinks() -{ - struct loins *pLoins; - struct phins *pPhins; - long flag; - - - flag = FALSE; - - /* Check if there is a physical figure. */ - if (!LV_phfig) return; - - for (pLoins = LV_lofig->LOINS; pLoins != NULL; pLoins = pLoins->NEXT) { - if ((pPhins = findphins (LV_phfig, pLoins->INSNAME))) { - if (pLoins->FIGNAME != pPhins->FIGNAME) { - flag = TRUE; - - eprinth (NULL); - eprintf ("Instances of \"%s\" have NOT the same physical", - pLoins->INSNAME); - eprintf (" and logical model :\n"); - eprintf (" logical := \"%s\"", pLoins->FIGNAME); - eprintf (" physical := \"%s\".\n", pPhins->FIGNAME); - - continue; - } - - pLoins->USER = addptype (pLoins->USER, PTYPE_PHFIG, (void*)pPhins); - pPhins->USER = addptype (pPhins->USER, PTYPE_LOFIG, (void*)pLoins); - } - } - - - /* Check if all physical instances are in the netlist. */ - - - for (pPhins = LV_phfig->PHINS; pPhins != NULL; pPhins = pPhins->NEXT) { - if (!getptype (pPhins->USER, PTYPE_LOFIG)) { - if (!flag) { - /* Print the head error message. */ - flag = TRUE; - - eprinth (NULL); - eprintf ("The following physical instances are not in the"); - eprintf (" netlist :\n"); - } - - eprintf ("- \"%s\" (model \"%s\").\n", - pPhins->INSNAME, pPhins->FIGNAME); - } - } - - - if (flag) EXIT (1); -} - - -/* ------------------------------------------------------------------ - * Function : "freephinslinks()". - */ - -static void freephinslinks() -{ - struct loins *pLoins; - struct phins *pPhins; - - - /* Check if there is a physical figure. */ - if (!LV_phfig) return; - - for (pLoins = LV_lofig->LOINS; pLoins != NULL; pLoins = pLoins->NEXT) { - if (pLoins->USER) - pLoins->USER = delptype (pLoins->USER, PTYPE_PHFIG); - } - - - for (pPhins = LV_phfig->PHINS; pPhins != NULL; pPhins = pPhins->NEXT) { - if (pPhins->USER) - pPhins->USER = delptype (pPhins->USER, PTYPE_LOFIG); - } -} - - -/* ------------------------------------------------------------------ - * Function : "buildtterm()". - */ - -static void buildtterm() -{ - struct locon *pLocon; - - - LV_htTerm = createauthtable (TTERM_SIZE); - - for (pLocon = LV_lofig->LOCON; pLocon != NULL; pLocon = pLocon->NEXT) { - addauthelem (LV_htTerm, getsigname (pLocon->SIG), (long)pLocon->NAME); - } -} - - -/* ------------------------------------------------------------------ - * Function : "freetterm()". - */ - -static void freetterm() -{ - destroyauthtable (LV_htTerm); -} - - - -/* ------------------------------------------------------------------ - * Function : "swapOrient()". - */ - -static void swapOrient(apSameOrient, apOppositeOrient) - char *apSameOrient; - char *apOppositeOrient; -{ - char tmpOrient; - - tmpOrient = *apSameOrient; - *apSameOrient = *apOppositeOrient; - *apOppositeOrient = tmpOrient; -} - - -/* ------------------------------------------------------------------ - * Function : "normOrient()". - */ - -static char normOrient(aOrient) - char aOrient; -{ - char normOrient; - - - switch (aOrient) { - default: - case DEF_N: normOrient = DEF_N; break; - case DEF_FN: normOrient = DEF_N; break; - case DEF_FS: normOrient = DEF_FS; break; - case DEF_S: normOrient = DEF_FS; break; - case DEF_W: normOrient = DEF_W; break; - case DEF_FW: normOrient = DEF_W; break; - case DEF_E: normOrient = DEF_FE; break; - case DEF_FE: normOrient = DEF_FE; break; - } - - return (normOrient); -} - - -/* ------------------------------------------------------------------ - * Function : "getOppositeOrient()". - */ - -static char getOppositeOrient(aOrient) - char aOrient; -{ - char oppositeOrient; - - - switch (aOrient) { - default: - case DEF_N: oppositeOrient = DEF_FS; break; - case DEF_FN: oppositeOrient = DEF_FS; break; - case DEF_FS: oppositeOrient = DEF_N; break; - case DEF_S: oppositeOrient = DEF_N; break; - case DEF_W: oppositeOrient = DEF_FE; break; - case DEF_FW: oppositeOrient = DEF_FE; break; - case DEF_E: oppositeOrient = DEF_W; break; - case DEF_FE: oppositeOrient = DEF_W; break; - } - - return (oppositeOrient); -} - - -/* ------------------------------------------------------------------ - * Function : "orientPhfig()". - */ - -static long orientPhfig(apPhfig, apSameOrient, apOppositeOrient) - struct phfig *apPhfig; - char *apSameOrient; - char *apOppositeOrient; -{ - struct ePow_s *plPow; - long sliceHeight; - - - plPow = buildPow (apPhfig, ALU1, C_POWER_HORIZONTAL, ""); - - sliceHeight = (apPhfig->YAB2 - apPhfig->YAB1) / MBK_Y_SLICE; - - if (!plPow) { - if (LV_Flags & F_TRUST_ORIENT) { - *apSameOrient = DEF_N; - *apOppositeOrient = DEF_FS; - - return (FALSE); - } - - eprinth (NULL); - eprintf ("\n Model \"%s\" have no horizontal ALU1 power supplies.", - apPhfig->NAME); - eprintf ("\n Can't guess allowed orientations.\n"); - EXIT (1); - } - - - switch (plPow->Type) { - default: - case C_POWER_ISVSS: - *apSameOrient = DEF_N; - *apOppositeOrient = DEF_FS; - break; - case C_POWER_ISVDD: - *apSameOrient = DEF_FS; - *apOppositeOrient = DEF_N; - break; - } - - if (!(sliceHeight % 2)) - *apOppositeOrient = *apSameOrient; - - - freePow (plPow); - - return (TRUE); -} - - -/* ------------------------------------------------------------------ - * Function : "DIRtoa()". - */ - -static char *DIRtoa(acDIR) - char acDIR; -{ - switch(acDIR) { - case C_DIRECTION_NONE: return((char*)NULL); - case C_DIRECTION_INPUT: return("INPUT"); - case C_DIRECTION_OUTPUT: return("OUTPUT"); - case C_DIRECTION_TRISTATE: return("OUTPUT"); - case C_DIRECTION_INOUT: return("INOUT"); - case C_DIRECTION_FEEDTHRU: return("FEEDTHRU"); - } - return((char*)NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "USEtoa()". - */ - -static char *USEtoa(acUSE) - char acUSE; -{ - switch(acUSE) { - case C_USE_NONE: return((char*)NULL); - case C_USE_SIGNAL: return("signal"); - case C_USE_ANALOG: return("analog"); - case C_USE_POWER: return("power"); - case C_USE_GROUND: return("ground"); - case C_USE_CLOCK: return("clock"); - } - - return((char*)NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "strLCat()". - */ - -static char *strLCat(asLine, asEl, aplLine, alMax) - char *asLine, *asEl; - long *aplLine, alMax; -{ - long lCopy; - - - /* Copy the string `asEl' if there is enougth place. */ - lCopy = m_Min(alMax - *aplLine - 1, strlen(asEl)); - strncpy(asLine + *aplLine, asEl, lCopy); - *aplLine += lCopy; - - /* Terminate the string by a zero. */ - asLine[(*aplLine)] = (char)0; - - return(asLine); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintDIEAREA()". - */ - -static void fprintDIEAREA() -{ - if (LV_phfig) { - fprintf (DEF_FILE, - "\nDIEAREA ( %ld %ld ) ( %ld %ld ) ;\n", - MBK2DEF_length (LV_phfig->XAB1), - MBK2DEF_length (LV_phfig->YAB1), - MBK2DEF_length (LV_phfig->XAB2), - MBK2DEF_length (LV_phfig->YAB2)); - } -} - - -/* ------------------------------------------------------------------ - * Function : "newrow()". - */ - -static struct row_s *newrow() -{ - struct row_s *pRow; - - pRow = (row_t*)mbkalloc (sizeof (row_t)); - pRow->next = LV_row; - - return (LV_row = pRow); -} - - -/* ------------------------------------------------------------------ - * Function : "freerow()". - */ - -static void freerow() -{ - struct row_s *pRow; - - while (LV_row) { - pRow = LV_row->next; - - mbkfree (LV_row->rowName); - mbkfree (LV_row->rowType); - mbkfree (LV_row); - - LV_row = pRow; - } -} - - -/* ------------------------------------------------------------------ - * Function : "ref2ROW()". - */ - -static void ref2ROW() -{ - struct phref *pPhref; - struct row_s *pRow; - - - if (LV_phfig) { - for (pPhref = LV_phfig->PHREF; pPhref != NULL; pPhref = pPhref->NEXT) { - if (!strncmp (pPhref->NAME, "row_", 4)) { - pRow = newrow (); - - MBK2DEF_row (pPhref, - &pRow->rowName, - &pRow->rowType, - &pRow->orient, - &pRow->doNumber, - &pRow->byNumber, - &pRow->stepX, - &pRow->stepY, - &pRow->x, - &pRow->y); - } - } - } -} - - -/* ------------------------------------------------------------------ - * Function : "hasROW()". - */ - -extern long hasROW(apPhfig) - struct phfig *apPhfig; -{ - struct phref *pPhref; - - - for (pPhref = apPhfig->PHREF; pPhref != NULL; pPhref = pPhref->NEXT) { - if (!strncmp (pPhref->NAME, "row_", 4)) { - return (TRUE); - } - } - - return(FALSE); -} - - -/* ------------------------------------------------------------------ - * Function : "buildROWS()". - */ - -extern long buildROWS(apPhfig) - struct phfig *apPhfig; -{ - struct phins *pIns; - long iRow; - long rowGridX0, rowGridY0, rowGridIns, rowSizeX, rowSizeY; - char sameOrient, oppositeOrient; - char rowName[1024]; - - - if (hasROW(apPhfig)) return (FALSE); - - - pIns = NULL; - - rowGridX0 = apPhfig->XAB1; - rowGridY0 = apPhfig->YAB1; - sameOrient = DEF_N; - oppositeOrient = DEF_FS; - - rowSizeX = (apPhfig->XAB2 - apPhfig->XAB1) / MBK_X_GRID; - rowSizeY = (apPhfig->YAB2 - apPhfig->YAB1) / MBK_Y_SLICE; - - - for (pIns = apPhfig->PHINS; pIns != NULL; pIns = pIns->NEXT) { - /* Skip unpitched instances. */ - if ((pIns->XINS - apPhfig->XAB1) % MBK_X_GRID) continue; - if ((pIns->YINS - apPhfig->YAB1) % MBK_X_GRID) continue; - - if (!orientPhfig (getphfig (pIns->FIGNAME, 'A'), - &sameOrient, - &oppositeOrient)) continue; - - mprintf2 (" o Taking \"%s\" as reference for the ROW grid.\n", - pIns->INSNAME); - - rowGridX0 = apPhfig->XAB1; - rowGridY0 = apPhfig->YAB1 - + (pIns->YINS - apPhfig->YAB1) % MBK_Y_SLICE; - - rowSizeX = (apPhfig->XAB2 - apPhfig->XAB1) / MBK_X_GRID; - rowSizeY = (apPhfig->YAB2 - rowGridY0) / MBK_Y_SLICE; - - rowGridIns = (pIns->YINS - rowGridY0) / MBK_Y_SLICE; - - switch (pIns->TRANSF) { - default: - case SYM_X: - case NOSYM: - break; - case SYM_Y: - case SYMXY: - swapOrient (&sameOrient, &oppositeOrient); - break; - /* We do not allow rotated instances. */ - case ROT_P: - case ROT_M: - case SY_RP: - case SY_RM: continue; - } - - __DBG ( - fflush (stdout); - fprintf (stderr, "pIns->YINS := %ld.\n", pIns->YINS); - fprintf (stderr, "apPhfig->YAB1 := %ld.\n", apPhfig->YAB1); - fprintf (stderr, "rowGridY0 := %ld.\n", rowGridY0); - fprintf (stderr, "rowGridIns := %ld.\n", rowGridIns); - fflush (stderr); - ) - if (rowGridIns % 2) - swapOrient (&sameOrient, &oppositeOrient); - - break; - } - - - /* Restore the opposite orient, when the cell is 2*N slices tall. */ - oppositeOrient = getOppositeOrient (sameOrient); - - for (iRow = 0; iRow < rowSizeY; iRow++) { - sprintf (rowName, "ROW_%ld", iRow); - - DEF2MBK_row (apPhfig, - rowName, - "core", - (iRow % 2) ? oppositeOrient : sameOrient, - rowSizeX, - 1, - MBK2DEF_length (MBK_X_GRID), - MBK2DEF_length (MBK_Y_SLICE), - rowGridX0, - rowGridY0 + iRow * MBK_Y_SLICE - ); - } - - - return (TRUE); -} - - -/* ------------------------------------------------------------------ - * Function : "getBaseRow()". - */ - -static struct row_s *getBaseRow(aX, aY, aOrient) - long aX, aY; - char aOrient; -{ - struct row_s *pRow; - long rowMax; - char orient; - - - for (pRow = LV_row; pRow != NULL; pRow = pRow->next) { - orient = normOrient (aOrient); - - switch (aOrient) { - case DEF_N: - case DEF_FN: - case DEF_FS: - case DEF_S: - if (pRow->y != aY) continue; - rowMax = DEF2MBK_length (pRow->stepX) * pRow->doNumber; - - if ((aX < pRow->x) || (aX > pRow->x + rowMax)) continue; - - if (pRow->orient == orient) return (pRow); - break; - case DEF_W: - case DEF_E: - case DEF_FW: - case DEF_FE: - if (pRow->x != aX) continue; - rowMax = DEF2MBK_length (pRow->stepY) * pRow->byNumber; - - if ((aY < pRow->y) || (aY > pRow->y + rowMax)) continue; - - if (pRow->orient == orient) - return (pRow); - break; - } - } - - - return (NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintROWS()". - */ - -static void fprintROWS () -{ - struct row_s *pRow; - - - for (pRow = LV_row; pRow != NULL; pRow = pRow->next) { - fprintf (DEF_FILE, - "ROW %s %s %ld %ld %s DO %ld BY %ld STEP %ld %ld ;\n", - pRow->rowName, - pRow->rowType, - pRow->x, - pRow->y, - DEF_orient2a(pRow->orient), - pRow->doNumber, - pRow->byNumber, - pRow->stepX, - pRow->stepY); - } -} - - -/* ------------------------------------------------------------------ - * Function : "newtrack()". - */ - -static struct track_s *newtrack() -{ - struct track_s *pTrack; - - pTrack = (track_t*)mbkalloc (sizeof (track_t)); - pTrack->next = LV_track; - - return (LV_track = pTrack); -} - - -/* ------------------------------------------------------------------ - * Function : "freetrack()". - */ - -static void freetrack() -{ - struct track_s *pTrack; - - while (LV_track) { - pTrack = LV_track->next; - - mbkfree (LV_track->routingLayers); - mbkfree (LV_track); - - LV_track = pTrack; - } -} - - -/* ------------------------------------------------------------------ - * Function : "ref2TRACK()". - */ - -static void ref2TRACK() -{ - struct phref *pPhref; - struct track_s *pTrack; - - - if (LV_phfig) { - for (pPhref = LV_phfig->PHREF; pPhref != NULL; pPhref = pPhref->NEXT) { - if (!strncmp (pPhref->NAME, "tracks.", 7)) { - pTrack = newtrack (); - - MBK2DEF_track (pPhref, - &pTrack->axisName, - &pTrack->start, - &pTrack->doNumber, - &pTrack->step, - &pTrack->routingLayers, - &pTrack->x, - &pTrack->y); - } - } - } -} - - -/* ------------------------------------------------------------------ - * Function : "buildTRACKS()". - */ - -extern long buildTRACKS(apPhfig, aFlags) - struct phfig *apPhfig; - long aFlags; -{ - long tracksX, tracksY, startX, startY; - char *routingLayers; - - - tracksX = ((apPhfig->XAB2 - apPhfig->XAB1) / MBK_X_GRID) - 1; - tracksY = ((apPhfig->YAB2 - apPhfig->YAB1) / MBK_X_GRID) - 1; - startX = apPhfig->XAB1 + MBK_X_GRID; - startY = apPhfig->YAB1 + MBK_X_GRID; - - routingLayers = routingLayers6; - if (aFlags & F_LAYERS_3) { - routingLayers = routingLayers3; - } - if (aFlags & F_LAYERS_4) { - routingLayers = routingLayers4; - } - - - /* Allocate the horizontal tracks. */ - DEF2MBK_track (apPhfig, - "Y", - MBK2DEF_length (startY), - tracksY, - MBK2DEF_length (MBK_X_GRID), - routingLayers, - apPhfig->XAB1, - apPhfig->YAB1 + MBK_X_GRID); - - - /* Allocate the vertical tracks. */ - DEF2MBK_track (apPhfig, - "X", - MBK2DEF_length (startX), - tracksX, - MBK2DEF_length (MBK_X_GRID), - routingLayers, - apPhfig->XAB1 + MBK_X_GRID, - apPhfig->YAB1); - - - return (TRUE); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintTRACKS()". - */ - -static void fprintTRACKS () -{ - struct track_s *pTrack; - - - for (pTrack = LV_track; pTrack != NULL; pTrack = pTrack->next) { - fprintf (DEF_FILE, - "TRACKS %c %ld DO %ld STEP %ld LAYER %s ;\n", - pTrack->axisName, - pTrack->start, - pTrack->doNumber, - pTrack->step, - pTrack->routingLayers); - } - - - fprintf (DEF_FILE, "\n\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "newblockage()". - */ - -static struct blockage_s *newblockage() -{ - struct blockage_s *pBlockage; - - pBlockage = (blockage_t*)mbkalloc (sizeof (blockage_t)); - pBlockage->next = LV_blockage; - - return (LV_blockage = pBlockage); -} - - -/* ------------------------------------------------------------------ - * Function : "freeblockage()". - */ - -static void freeblockage() -{ - struct blockage_s *pBlockage; - - while (LV_blockage) { - pBlockage = LV_blockage->next; - - mbkfree (LV_blockage); - - LV_blockage = pBlockage; - } -} - - -/* ------------------------------------------------------------------ - * Function : "ref2BLOCKAGE()". - */ - -static void ref2BLOCKAGE() -{ - struct phref *pPhref; - struct blockage_s *pBlockage; - - - if (LV_phfig) { - for (pPhref = LV_phfig->PHREF; pPhref != NULL; pPhref = pPhref->NEXT) { - if (!strncmp (pPhref->NAME, "blockage.", 9)) { - pBlockage = newblockage (); - - MBK2DEF_blockage (pPhref, - &pBlockage->x, - &pBlockage->y, - &pBlockage->width, - &pBlockage->height); - } - } - } -} - - -/* ------------------------------------------------------------------ - * Function : "fprintBLOCKAGE()". - */ - -static void fprintBLOCKAGE() -{ - struct blockage_s *pBlockage; - long layer; - - - for (pBlockage = LV_blockage; - pBlockage != NULL; pBlockage = pBlockage->next) { - - if (pBlockage == LV_blockage) { - fprintf (DEF_FILE, " - _BLOCKAGE_RESERVED"); - fprintf (DEF_FILE, "\n + ROUTED "); - } else { - fprintf (DEF_FILE, "\n NEW "); - } - - for (layer = 1; layer < 7; layer++) { - if (layer != 1) - fprintf (DEF_FILE, "\n NEW "); - - fprintf (DEF_FILE, - "L_ALU%ld %ld + SHAPE BLOCKAGEWIRE ( %ld %ld ) ( %ld * )", - layer, - pBlockage->height, - pBlockage->x, - pBlockage->y + pBlockage->height / 2, - pBlockage->x + pBlockage->width); - } - } - - if (LV_blockage) - fprintf (DEF_FILE, "\n + SOURCE DIST + USE GROUND + WEIGHT 0 ;\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintVIAMATRIX()". - */ - -static void fprintVIAMATRIX (aType, aWidth, aHeight) - char aType; - long aWidth; - long aHeight; -{ - long xCutNB, yCutNB, xCut, yCut; - - - xCutNB = (aWidth / MBKSCALE(5)) / 2; - yCutNB = (aHeight / MBKSCALE(5)) / 2; - - - for (xCut = - xCutNB; xCut <= xCutNB; xCut++) { - for (yCut = - yCutNB; yCut <= yCutNB; yCut++) { - fprintf (DEF_FILE, " + RECT %s ( %ld %ld ) ( %ld %ld )\n", - DEF_layer2a (aType), - MBK2DEF_length (xCut - SCALE_X / 2), - MBK2DEF_length (yCut - SCALE_X / 2), - MBK2DEF_length (xCut + SCALE_X / 2), - MBK2DEF_length (yCut + SCALE_X / 2)); - } - } -} - - -/* ------------------------------------------------------------------ - * Function : "fprintVIAS()". - */ - -static void fprintVIAS() -{ - struct tLoseg_s *pTLoseg; - struct eMVIA_s *pMVIA; - long nVIA, flagDefault, width, height; - char viaName[1024]; - - - pTLoseg = gettloseg (LV_phfig); - - if (pTLoseg) { - nVIA = 0; - - __DBG( - fflush (stdout); - fprintf (stderr, "pTLoseg := 0x%08lx\n", (unsigned long)pTLoseg); - fprintf (stderr, "tMVIA := 0x%08lx\n", (unsigned long)pTLoseg->tMVIA); - fflush (stderr); - ) - - for (pMVIA = pTLoseg->tMVIA; pMVIA != NULL; pMVIA = pMVIA->next) - { nVIA++; } - - fprintf (DEF_FILE, "VIAS %ld ;\n", nVIA); - - for (pMVIA = pTLoseg->tMVIA; pMVIA != NULL; pMVIA = pMVIA->next) { - flagDefault = (pMVIA->width <= MBKSCALE(2)) - && (pMVIA->height <= MBKSCALE(2)); - - __DBG( - if (!flagDefault) { - fprintf (stderr, "macro VIA : %d (%ldx%ld)\n", - (int)pMVIA->type, pMVIA->width, pMVIA->height); - } - ) - - width = MBKSCALE(2); - height = MBKSCALE(2); - - fprintf (DEF_FILE, " - %s", DEF_via2a (pMVIA->type, - pMVIA->width, - pMVIA->height, viaName)); - - if (!flagDefault) { - width = pMVIA->width; - height = pMVIA->height; - } - - fprintf (DEF_FILE, "\n + RECT %s ( %ld %ld ) ( %ld %ld )\n", - DEF_layer2a (getBottomVIALayer (pMVIA->type)), - DEF2MBK_length (- width / 2), - DEF2MBK_length (- height / 2), - DEF2MBK_length ( width / 2), - DEF2MBK_length ( height / 2)); - - fprintVIAMATRIX (pMVIA->type, width, height); - - fprintf (DEF_FILE, " + RECT %s ( %ld %ld ) ( %ld %ld ) ;\n", - DEF_layer2a (getTopVIALayer (pMVIA->type)), - DEF2MBK_length (- width / 2), - DEF2MBK_length (- height / 2), - DEF2MBK_length ( width / 2), - DEF2MBK_length ( height / 2)); - } - - fprintf (DEF_FILE, "END VIAS\n\n"); - } -} - - -/* ------------------------------------------------------------------ - * Function : "fprintPIN()". - */ - -static void fprintPIN(apLocon, apPhcon, asState) - struct locon *apLocon; - struct phcon *apPhcon; - char *asState; -{ - char sSig[1024]; - long conLength; - - - MBK2DEF_name(sSig, apLocon->NAME); - - - fprintf(DEF_FILE, " - %s.%ld + NET %s", sSig, apPhcon->INDEX, sSig); - - if (isvdd(apLocon->NAME)) { - /* - * if (LV_Flags & F_FIXED_PINS) - * fprintf(DEF_FILE, " + SPECIAL"); - */ - - fprintf(DEF_FILE, " + DIRECTION INPUT + USE POWER"); - } else if (isvss(apLocon->NAME)) { - /* - * if (LV_Flags & F_FIXED_PINS) - * fprintf(DEF_FILE, " + SPECIAL"); - */ - - fprintf(DEF_FILE, " + DIRECTION INPUT + USE GROUND"); - } else - fprintf(DEF_FILE, " + DIRECTION %s", - DIRtoa(MBK2DEF_locondir(apLocon))); - - if ( (LV_Flags & F_FIXED_PINS) - && (strncmp(apLocon->NAME, "vddv", 4)) - && (strncmp(apLocon->NAME, "vssv", 4)) - && !isvdd (apLocon->NAME) - && !isvss (apLocon->NAME)) { - conLength = MBK_X_GRID; - if (LV_Flags & F_EXPAND_ROUTE) conLength += FLOOR_XY_EXPAND; - - if (strcmp ("UNPLACED", asState)) { - fprintf(DEF_FILE, "\n + %s ( %ld %ld ) %s", - asState, - apPhcon->XCON, - apPhcon->YCON, - DEF_side2a (apPhcon->ORIENT)); - - if (LV_Flags & F_EXPAND_PLACE) conLength += FLOOR_XY_EXPAND; - } else { - if (LV_Flags & F_EXPAND_PLACE) conLength += FLOOR_XY_EXPAND / 2; - } - - fprintf(DEF_FILE, " + LAYER %s ( %ld 0 ) ( %ld %ld )", - DEF_layer2a (apPhcon->LAYER), - - MBK2DEF_length (apPhcon->WIDTH / 2), - MBK2DEF_length (apPhcon->WIDTH / 2), - MBK2DEF_length (conLength)); - } - - fprintf(DEF_FILE, " ;\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintPINS()". - */ - -static void fprintPINS() -{ - struct locon *pLoCon; - struct phcon Phcon; - struct eLoseg_s *pLoseg; - long loconNB, phconNB; - - - loconNB = 0; - - /* First : compute the number of terminals. */ - for(pLoCon = LV_lofig->LOCON; - pLoCon != (locon_list*)NULL; pLoCon = pLoCon->NEXT) { - loconNB += 1; - phconNB = 0; - - if (LV_phfig) { - pLoseg = getloseglist (LV_phfig, getsigname (pLoCon->SIG)); - - for (; pLoseg != NULL; pLoseg = pLoseg->next) { - if (pLoseg->type == LOSEG_CON) { phconNB += 1; } - } - - if (phconNB > 1) loconNB += phconNB - 1; - } - } - - fprintf(DEF_FILE, "\n\nPINS %ld ;\n", loconNB); - - for(pLoCon = LV_lofig->LOCON; - pLoCon != (locon_list*)NULL; pLoCon = pLoCon->NEXT) { - - phconNB = 0; - - if (LV_phfig) { - pLoseg = getloseglist (LV_phfig, getsigname (pLoCon->SIG)); - - for (; pLoseg != NULL; pLoseg = pLoseg->next) { - __DBG( - fprintf (stderr, "sig %s pLoseg->type := %ld\n", - getsigname (pLoCon->SIG), - pLoseg->type); - fflush (stderr); - ) - if (pLoseg->type == LOSEG_CON) { - phconNB += 1; - - fprintPIN (pLoCon, (struct phcon*)(pLoseg->MBKobj), "FIXED"); - } - } - } - - if (!phconNB) { - Phcon.XCON = 0; - Phcon.YCON = 0; - Phcon.INDEX = 0; - Phcon.WIDTH = MBKSCALE(2); - Phcon.LAYER = ALU2; - Phcon.ORIENT = SOUTH; - - fprintPIN (pLoCon, &Phcon, "UNPLACED"); - } - } - - fprintf(DEF_FILE, "END PINS\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "checkPhins()". - */ - -static long checkPhins(apPhins) - struct phins *apPhins; -{ - struct row_s *pRow; - char sameOrient, oppositeOrient, orient; - - - orientPhfig (getphfig (apPhins->FIGNAME, 'A'), - &sameOrient, - &oppositeOrient); - - orient = DEF_N; - - switch (normOrient (MBK2DEF_transf (apPhins->TRANSF))) { - case DEF_W: - case DEF_N: orient = sameOrient; break; - case DEF_FE: - case DEF_FS: orient = oppositeOrient; break; - } - - pRow = getBaseRow (apPhins->XINS, apPhins->YINS, orient); - - - if (!pRow) { - warnMBK (NULL); - wprintf ("\n Instance %s of model %s at (%ld,%ld) is NOT on row grid.\n", - apPhins->INSNAME, - apPhins->FIGNAME, - apPhins->XINS, - apPhins->YINS); - wprintf ( " Will be removed from the placement file.\n"); - - return (FALSE); - } - - return (TRUE); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintCOMPONENTS()". - */ - -static void fprintCOMPONENTS() -{ - loins_list *pLoins; - phins_list *pPhins; - long loInsNB; - - - /* First : compute the number of instances. */ - for(pLoins = LV_lofig->LOINS, loInsNB = 0L; - pLoins != NULL; loInsNB++, pLoins = pLoins->NEXT); - - fprintf(DEF_FILE, "\n\nCOMPONENTS %ld ;\n", loInsNB); - - /* Dump the list of instance/model pairs. */ - for(pLoins = LV_lofig->LOINS; - pLoins != (loins_list*)NULL; pLoins = pLoins->NEXT) { - fprintf(DEF_FILE, " - %s %s ", pLoins->INSNAME, pLoins->FIGNAME); - - if (!(pPhins = getphinslink(pLoins)) || !checkPhins (pPhins)) { - fprintf(DEF_FILE, ";\n"); - } else { - fprintf(DEF_FILE, - "+ FIXED ( %ld %ld ) %s ;\n", - MBK2DEF_length(pPhins->XINS), - MBK2DEF_length(pPhins->YINS), - DEF_orient2a(MBK2DEF_transf (pPhins->TRANSF))); - } - } - - - fprintf(DEF_FILE, "END COMPONENTS\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintWIRESEG()". - */ - -static void fprintWIRESEG(apPhseg, aFlags) - struct phseg *apPhseg; - long aFlags; -{ - fprintf (DEF_FILE, "%s ", DEF_layer2a (apPhseg->LAYER)); - - if (aFlags & F_SEG_WIDTH) - fprintf (DEF_FILE, "%ld ", MBK2DEF_length (apPhseg->WIDTH)); - - if (aFlags & F_SEG_STRIPE) - fprintf (DEF_FILE, "+ SHAPE STRIPE "); - - fprintf (DEF_FILE, "( %ld %ld ) ( %ld %ld ) ", - MBK2DEF_length (apPhseg->X1), - MBK2DEF_length (apPhseg->Y1), - MBK2DEF_length (apPhseg->X2), - MBK2DEF_length (apPhseg->Y2)); - - __DBG( - fprintf (stderr, "MBK X1 := %ld, DEF X1 := %ld\n", - apPhseg->X1, MBK2DEF_length (apPhseg->X1)); - ) -} - - -/* ------------------------------------------------------------------ - * Function : "fprintWIREVIA()". - */ - -static void fprintWIREVIA(apPhvia, aFlags) - struct phvia *apPhvia; - long aFlags; -{ - char viaName[1024]; - - - fprintf (DEF_FILE, "%s ", DEF_layer2a (getBottomVIALayer (apPhvia->TYPE))); - - if (aFlags & F_SEG_WIDTH) - fprintf (DEF_FILE, "%ld ", MBK2DEF_length (apPhvia->DX)); - - fprintf (DEF_FILE, "( %ld %ld ) %s ", - MBK2DEF_length (apPhvia->XVIA), - MBK2DEF_length (apPhvia->YVIA), - DEF_via2a (apPhvia->TYPE, apPhvia->DX, apPhvia->DY, viaName)); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintWIRES()". - */ - -static void fprintWIRES(apLosig) - struct losig *apLosig; -{ - struct eLoseg_s *pLoseg; - long flagFirst, flagSeg; - - - flagFirst = TRUE; - pLoseg = getloseglist (LV_phfig, getsigname (apLosig)); - - flagSeg = 0L; - if (LV_localFlags & F_SPECIAL_NET) { - flagSeg = F_SEG_STRIPE | F_SEG_WIDTH; - } - - - if (pLoseg) { - for (; pLoseg != NULL; pLoseg = pLoseg->next) { - if (!flagFirst) - fprintf (DEF_FILE, "\n NEW "); - - switch (pLoseg->type) { - case LOSEG_SEG: - if (flagFirst) fprintf (DEF_FILE, "\n + ROUTED "); - fprintWIRESEG ((struct phseg*)pLoseg->MBKobj, flagSeg); - flagFirst = FALSE; - break; - case LOSEG_VIA: - if (flagFirst) fprintf (DEF_FILE, "\n + ROUTED "); - fprintWIREVIA ((struct phvia*)pLoseg->MBKobj, flagSeg); - flagFirst = FALSE; - break; - } - - } - } -} - - -/* ------------------------------------------------------------------ - * Function : "fprintNET()". - */ - -static void fprintNET(apLoSig, aUse) - losig_list *apLoSig; - char aUse; -{ - struct ptype *pType; - struct chain *pChain; - struct locon *pLoCon; - struct authelem *pElem; - char sLine[80], sItem[1024]; - char *sSig, sSigLEF[1024], sConLEF[1024]; - long lLine; - - - /* Try to guess if this is a VST devectorized internal signal. - * We first seach a loseg with the signal name, if nothing is - * found we try with a vectorized name. - */ - sSig = getsigname (apLoSig); - pElem = searchauthelem (LV_htTerm, sSig); - - /* In case of external signal, override with the terminal name. */ - if (pElem != NULL) { sSig = (char*)pElem->VALUE; } - - pType = getptype(apLoSig->USER, (long)LOFIGCHAIN); - if (pType == (ptype_list*)NULL) { - wprinth((char*)NULL); - wprintf(" Signal \"%s\" have no LOFIGCHAIN.\n", sSig); - - pChain = (chain_list*)NULL; - } else { - pChain = (chain_list*)(pType->DATA); - } - - - sSig = MBK2DEF_name(sSigLEF, sSig); -/*snprintf(sItem, 79, " - %s ", sSig);*/ - sprintf(sItem, " - %s ", sSig); - - sLine[0] = (char)0; lLine = 0L; - if (strlen (sItem) > 79) - fprintf(DEF_FILE, "%s\n", sItem); - else - strLCat(sLine, sItem, &lLine, 79); - - - - for(; pChain != (chain_list*)NULL; - pChain = pChain->NEXT) { - pLoCon = (locon_list*)(pChain->DATA); - - if (pLoCon->TYPE == INTERNAL) { - /*snprintf(sItem, 79, "( %s %s ) ", - * ((loins_list*)(pLoCon->ROOT))->INSNAME, - * MBK2DEF_name(sConLEF, pLoCon->NAME)); - */ - sprintf(sItem, "( %s %s ) ", - ((loins_list*)(pLoCon->ROOT))->INSNAME, - MBK2DEF_name(sConLEF, pLoCon->NAME)); - - if (lLine + strlen(sItem) + 4 > 70) { - fprintf(DEF_FILE, "%s", sLine); - if (strlen (sItem) > 70) { - /* sItem too long anyway... flush it immediatly. */ - fprintf(DEF_FILE, " %s\n", sItem); - sItem[0] = (char)0; - } else { - fprintf(DEF_FILE, "\n"); - } - lLine = 0L; - strLCat(sLine, " ", &lLine, 79); - } - strLCat(sLine, sItem, &lLine, 79); - } - } - if (lLine > 0) fprintf(DEF_FILE, "%s", sLine); - - if (LV_phfig) fprintWIRES (apLoSig); - - if (aUse != C_USE_NONE) - fprintf(DEF_FILE, "\n + USE %s ;\n", USEtoa(aUse)); - else - fprintf(DEF_FILE, ";\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintNETS()". - */ - -static void fprintNETS() -{ - losig_list *pLoSig; - long loSigNB; - char *sSig; - - - LV_localFlags &= ~ F_SPECIAL_NET; - LV_localFlags |= F_REGULAR_NET; - - - /* First : compute the number of signals. */ - for(pLoSig = LV_lofig->LOSIG, loSigNB = 0L; - pLoSig != (losig_list*)NULL; pLoSig = pLoSig->NEXT) { - sSig = getsigname(pLoSig); - if (isvdd(sSig) || isvss(sSig)) continue; - - loSigNB += 1; - } - - fprintf(DEF_FILE, "\n\nNETS %ld ;\n", loSigNB); - - /* Dump the list of signal connections. */ - for(pLoSig = LV_lofig->LOSIG; - pLoSig != (losig_list*)NULL; pLoSig = pLoSig->NEXT) { - - sSig = getsigname(pLoSig); - if ( isvdd(sSig) - || isvss(sSig) - || !strcmp(sSig, "cki")) continue; - - fprintNET(pLoSig, C_USE_NONE); - } - - fprintf(DEF_FILE, "END NETS\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintSPECIALNETS()". - */ - -static void fprintSPECIALNETS() -{ - losig_list *pLoSig; - long loSigNB; - char *sSig, Use; - - - LV_localFlags &= ~ F_REGULAR_NET; - LV_localFlags |= F_SPECIAL_NET; - - - /* First : compute the number of signals. */ - for(pLoSig = LV_lofig->LOSIG, loSigNB = 0L; - pLoSig != (losig_list*)NULL; pLoSig = pLoSig->NEXT) { - sSig = getsigname(pLoSig); - if ( !isvdd(sSig) - && !isvss(sSig) - && strcmp(sSig, "cki")) continue; - - loSigNB += 1; - } - - fprintf(DEF_FILE, "\n\nSPECIALNETS %ld ;\n", - loSigNB + ((LV_blockage) ? 1 : 0)); - - /* Dump the list of signal connections. */ - for(pLoSig = LV_lofig->LOSIG; - pLoSig != (losig_list*)NULL; pLoSig = pLoSig->NEXT) { - - sSig = getsigname(pLoSig); - - Use = C_USE_NONE; - if ( isvdd(sSig) ) Use = C_USE_POWER; - if ( isvss(sSig) ) Use = C_USE_GROUND; - if (!strcmp(sSig, "cki")) Use = C_USE_CLOCK; - if (Use == C_USE_NONE) continue; - - fprintNET(pLoSig, Use); - } - - fprintBLOCKAGE (); - - fprintf(DEF_FILE, "END SPECIALNETS\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintDEF()". - */ - -static void fprintDEF() -{ - fprintf (DEF_FILE, "DESIGN %s ;\n\n\n" , LV_name); - fprintf (DEF_FILE, " TECHNOLOGY %s ;\n\n" , "cmos_12"); - fprintf (DEF_FILE, " UNITS DISTANCE MICRONS %ld ;\n", DEF_UNITS_MICRONS); - - if (LV_phfig) { - fprintDIEAREA (); - - ref2ROW (); - if (!LV_row) { - wprinth ("fprintfDEF"); - wprintf ("\n Generate default rows and tracks. This may lead to"); - wprintf ("\n incorrect results if the design is expanded.\n"); - - buildROWS (LV_phfig); - buildTRACKS (LV_phfig, LV_Flags); - } else { - ref2TRACK (); - } - - fprintROWS (); - fprintTRACKS (); - - ref2BLOCKAGE(); - - fprintVIAS (); - } - - - fprintCOMPONENTS (); - fprintPINS (); - fprintNETS (); - - fprintSPECIALNETS (); - - fprintf(DEF_FILE, "\n\nEND DESIGN\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "defsavelophfig()". -*/ - -extern void defsavelophfig(apLofig, apPhfig, aDefName, aFlags) - struct lofig *apLofig; - struct phfig *apPhfig; - char *aDefName; - long aFlags; -{ - LV_Flags = aFlags; - LV_lofig = apLofig; - LV_phfig = apPhfig; - LV_name = aDefName; - LV_row = NULL; - LV_track = NULL; - LV_blockage = NULL; - - if (LV_phfig) { - addfeed (LV_lofig, LV_phfig); - lofigchain (LV_lofig); - } - - buildphinslinks (); - buildtterm (); - - if (!LV_name) LV_name = apLofig->NAME; - DEF_FILE = mbkfopen (LV_name, "def", "w+"); - - fprintDEF (); - if (LV_phfig) checklosegaccess (LV_phfig); - - fclose (DEF_FILE); - freerow (); - freetrack (); - freeblockage (); - - freetterm (); - freephinslinks (); - - if (LV_phfig) { - delfeed (LV_lofig); - lofigchain (LV_lofig); - } -} diff --git a/alliance/src/sea/src/DEF_drive.h b/alliance/src/sea/src/DEF_drive.h deleted file mode 100644 index 8a659d1c..00000000 --- a/alliance/src/sea/src/DEF_drive.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * $Id: DEF_drive.h,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Header : "./DEF_drive.h" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# ifndef __DEF_drive__ -# define __DEF_drive__ - - -# define F_PHFIG 0x00000001 -# define F_FIXED_PINS 0x00000002 -# define F_PAD 0x00000004 -# define F_LAYERS_3 0x00000008 -# define F_LAYERS_4 0x00000010 -# define F_LAYERS_6 0x00000020 -# define F_EXPAND_PLACE 0x00000040 -# define F_EXPAND_ROUTE 0x00000080 -# define F_TRUST_ORIENT 0x00000100 - - - extern long hasROW (struct phfig *apPhfig); - extern long buildROWS (struct phfig *apPhfig); - extern long buildTRACKS (struct phfig *apPhfig, long aFlags); - extern void defsavelophfig (struct lofig *apLofig, - struct phfig *apPhfig, - char *aDefName, - long aFlags); - -# endif diff --git a/alliance/src/sea/src/DEF_grammar.h b/alliance/src/sea/src/DEF_grammar.h deleted file mode 100644 index e77abbc2..00000000 --- a/alliance/src/sea/src/DEF_grammar.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * $Id: DEF_grammar.h,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Mael Nagat | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Header : "./DEF_grammar.h" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - -# ifndef __DEF_grammar__ -# define __DEF_grammar__ - -# define F_DEF_SPLIT_POWER 0x00000001 -# define F_DEF_NO_IOS 0x00000002 -# define F_DEF_NO_INTERF 0x00000004 -# define F_DEF_MERGE_TERM 0x00000008 -# define F_DEF_SHRINK 0x00000010 - - - extern void defloadlophfig (lofig_list *apLoFig, - phfig_list *apPhFig, - char *aName, - char aMode, - long aVL, - long aFlags); - - -# endif diff --git a/alliance/src/sea/src/DEF_grammar_lex.l b/alliance/src/sea/src/DEF_grammar_lex.l deleted file mode 100644 index 0516b047..00000000 --- a/alliance/src/sea/src/DEF_grammar_lex.l +++ /dev/null @@ -1,268 +0,0 @@ -%{ -/* - * $Author: jpc $ - * $Id: DEF_grammar_lex.l,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * $Date: 2002/04/25 16:16:20 $ - */ - -#include -#include -#include -#include -#include "util_Defs.h" -#include "DEF_grammar_yacc.h" - - -# define YY_NO_UNPUT -# define yylval DEF_grammarlval -# define yylineno DEF_grammarlineno - - - int yylineno = 1; - - -static int yywrap(void); -static int string(void); -static int history(void); - -%} - - -L [_A-Za-z] -D [0-9] -S [\-\+] -E [eE] -X [\.\-\<\>\[\]\(\)] - -%% - -[ \t\f] { } - -\n { ++yylineno; } -#.* { } - -"VERSION" { return T_VERSION; } -"NAMESCASESENSITIVE" { return T_NAMESCASESENSITIVE; } -"NAMEMAPSTRING" { return T_NAMEMAPSTRING; } -"HISTORY" { history (); } -"DESIGN" { return T_DESIGN; } -"VIAS" { return T_VIAS; } -"TECHNOLOGY" { return T_TECH; } -"UNITS" { return T_UNITS; } -"BUSBITCHARS" { return T_BUSBITCHARS; } -"DIVIDERCHAR" { return T_DIVIDERCHAR; } -"DISTANCE" { return T_DISTANCE; } -"MICRONS" { return T_MICRONS; } -"RECT" { return T_RECT; } -"REENTRANTPATHS" { return T_REENTRANTPATHS; } -"SITE" { return T_SITE; } -"CANPLACE" { return T_CANPLACE; } -"CANNOTOCCUPY" { return T_CANNOTOCCUPY; } -"DIEAREA" { return T_DIE_AREA; } -"PINS" { return T_PINS; } -"DEFAULTCAP" { return T_DEFAULTCAP; } -"MINPINS" { return T_MINPINS; } -"WIRECAP" { return T_WIRECAP; } -"TRACKS" { return T_TRACKS; } -"GCELLGRID" { return T_GCELLGRID; } -"DO" { return T_DO; } -"BY" { return T_BY; } -"STEP" { return T_STEP; } -"LAYER" { return T_LAYER; } -"COMPONENTS" { return T_COMPS; } -"GENERATE" { return T_COMP_GEN; } -"SOURCE" { return T_SOURCE; } -"WEIGHT" { return T_WEIGHT; } -"FIXED" { return T_FIXED; } -"COVER" { return T_COVER; } -"PLACED" { return T_PLACED; } -"UNPLACED" { return T_UNPLACED; } -"FOREIGN" { return T_FOREIGN; } -"EEQMASTER" { return T_EEQMASTER; } -"REGION" { return T_REGION; } -"REGIONS" { return T_REGIONS; } -"NETS" { return T_NETS; } -"MUSTJOIN" { return T_MUSTJOIN; } -"ORIGINAL" { return T_ORIGINAL; } -"USE" { return T_USE; } -"STYLE" { return T_STYLE; } -"PATTERN" { return T_PATTERN; } -"PATTERNNAME" { return T_PATTERNNAME; } -"NONDEFAULTRULE" { return T_NONDEFAULTRULE; } -"ESTCAP" { return T_ESTCAP; } -"ROUTED" { return T_ROUTED; } -"ROW" { return T_ROW; } -"TAPER" { return T_TAPER; } -"TAPERRULE" { return T_TAPERRULE; } -"NEW" { return T_NEW; } -"SHAPE" { return T_SHAPE; } -"SPECIALNETS" { return T_SNETS; } -"SPECIALNET" { return T_SNET; } -"WIDTH" { return T_WIDTH; } -"VOLTAGE" { return T_VOLTAGE; } -"SPACING" { return T_SPACING; } -"N" { return T_N; } -"S" { return T_S; } -"E" { return T_E; } -"W" { return T_W; } -"FN" { return T_FN; } -"FS" { return T_FS; } -"FE" { return T_FE; } -"FW" { return T_FW; } -"INPUT" { return T_INPUT; } -"OUTPUT" { return T_OUTPUT; } -"INOUT" { return T_INOUT; } -"FEEDTHRU" { return T_FEEDTHRU; } -"GROUPS" { return T_GROUPS; } -"GROUP" { return T_GROUP; } -"COMPONENT" { return T_COMPONENT; } -"SOFT" { return T_SOFT; } -"MAXX" { return T_MAXX; } -"MAXY" { return T_MAXY; } -"MAXHALFPERIMETER" { return T_MAXHALFPERIMETER; } -"CONSTRAINTS" { return T_CONSTRAINTS; } -"NET" { return T_NET; } -"PATH" { return T_PATH; } -"SUM" { return T_SUM; } -"DIFF" { return T_DIFF; } -"RISEMIN" { return T_RISEMIN; } -"RISEMAX" { return T_RISEMAX; } -"FALLMIN" { return T_FALLMIN; } -"FALLMAX" { return T_FALLMAX; } -"WIREDLOGIC" { return T_WIREDLOGIC; } -"MAXDIST" { return T_MAXDIST; } -"ASSERTIONS" { return T_ASSERTIONS; } -"END" { return T_END; } -"ARRAY" { return T_ARRAY; } -"FLOORPLAN" { return T_FLOORPLAN; } -"SCANCHAINS" { return T_SCANCHAINS; } -"START" { return T_START; } -"FLOATING" { return T_FLOATING; } -"ORDERED" { return T_ORDERED; } -"STOP" { return T_STOP; } -"TIMINGDISABLES" { return T_TIMINGDISABLES; } -"IOTIMINGS" { return T_IOTIMINGS; } -"RISE" { return T_RISE; } -"FALL" { return T_FALL; } -"VARIABLE" { return T_VARIABLE; } -"SLEWRATE" { return T_SLEWRATE; } -"CAPACITANCE" { return T_CAPACITANCE; } -"DRIVECELL" { return T_DRIVECELL; } -"FROMPIN" { return T_FROMPIN; } -"TOPIN" { return T_TOPIN; } -"PARALLEL" { return T_PARALLEL; } -"PARTITIONS" { return T_PARTITIONS; } -"TURNOFF" { return T_TURNOFF; } -"FROMCLOCKPIN" { return T_FROMCLOCKPIN; } -"FROMCOMPPIN" { return T_FROMCOMPPIN; } -"FROMIOPIN" { return T_FROMIOPIN; } -"TOCLOCKPIN" { return T_TOCLOCKPIN; } -"TOCOMPPIN" { return T_TOCOMPPIN; } -"TOIOPIN" { return T_TOIOPIN; } -"SETUPRISE" { return T_SETUPRISE; } -"SETUPFALL" { return T_SETUPFALL; } -"HOLDRISE" { return T_HOLDRISE; } -"HOLDFALL" { return T_HOLDFALL; } -"VPIN" { return T_VPIN; } -"SUBNET" { return T_SUBNET; } -"XTALK" { return T_XTALK; } -"PIN" { return T_PIN; } -"SYNTHESIZED" { return T_SYNTHESIZED; } -"SPECIAL" { return T_SPECIAL; } -"DIRECTION" { return T_DIRECTION; } -"RANGE" { return T_RANGE; } -"FLOORPLANCONSTRAINTS" { return T_FPC; } -"HORIZONTAL" { return T_HORIZONTAL; } -"VERTICAL" { return T_VERTICAL; } -"ALIGN" { return T_ALIGN; } -"MIN" { return T_MIN; } -"MAX" { return T_MAX; } -"EQUAL" { return T_EQUAL; } -"BOTTOMLEFT" { return T_BOTTOMLEFT; } -"TOPRIGHT" { return T_TOPRIGHT; } -"ROWS" { return T_ROWS; } -"PROPERTYDEFINITIONS" { return T_PROPERTYDEFINITIONS; } -"PROPERTY" { return T_PROPERTY; } -"REAL" { return T_REAL; } -"INTEGER" { return T_INTEGER; } -"BEGINEXT" { return T_BEGINEXT; } -"PINPROPERTIES" { return T_PINPROPERTIES; } -"COMMONSCANPINS" { return T_COMMONSCANPINS; } -"COMPONENTPIN" { return T_COMPONENTPIN; } -"SHIELD" { return T_SHIELD; } -"SHIELDNET" { return T_SHIELDNET; } -"NOSHIELD" { return T_NOSHIELD; } - -{L}({L}|{D}|{X})* { yylval.s = strdup(yytext); return T_Ident; } -{S}?{D}+ { yylval.n = atof(yytext); return T_Number; } -{S}?{D}+\.{D}* { yylval.n = atof(yytext); return T_Number; } -{S}?{D}*\.{D}+ { yylval.n = atof(yytext); return T_Number; } -{S}?{D}+{E}{S}?{D}+ { yylval.n = atof(yytext); return T_Number; } -{S}?{D}+\.{D}*{E}{S}?{D}+ { yylval.n = atof(yytext); return T_Number; } -{S}?{D}*\.{D}+{E}{S}?{D}+ { yylval.n = atof(yytext); return T_Number; } - -"\"" { return string(); } -. { return *yytext; } - -%% - -static int yywrap() { return (1); } - -static int -string() -{ - char *str; - size_t max; - int c; - size_t len; - - if ((str = (char *)malloc(max = 64)) == NULL) - { perror("string"); exit (1); } - - len = 0; - while ((c = input()) >= 0 && c != '"') { - if (len + 1 == max) - if ((str = (char *)realloc(str, max *= 2)) == NULL) - { perror ("string"); exit (1); } - str[len++] = (char)c; - if (c == '\n') yylineno++; - } - str[len] = '\0'; - if (c == EOF) { - fflush (stdout); - fprintf (stderr, "unterminated string constant"); - exit (1); - } - yylval.s = str; - return T_String; -} - - -static int -history() -{ - char *str; - size_t max; - int c; - size_t len; - - if ((str = (char *)malloc(max = 64)) == NULL) - { perror("history"); exit (1); } - - len = 0; - while ((c = input()) >= 0 && c != ';') { - if (len + 1 == max) - if ((str = (char *)realloc(str, max *= 2)) == NULL) - { perror ("history"); exit (1); } - str[len++] = (char)c; - if (c == '\n') yylineno++; - } - str[len] = '\0'; - if (c == EOF) { - fflush (stdout); - fprintf (stderr, "unterminated history line"); - exit (1); - } - yylval.s = str; - return T_HISTORY; -} diff --git a/alliance/src/sea/src/DEF_grammar_yacc.y b/alliance/src/sea/src/DEF_grammar_yacc.y deleted file mode 100644 index 06719014..00000000 --- a/alliance/src/sea/src/DEF_grammar_yacc.y +++ /dev/null @@ -1,1351 +0,0 @@ -%{ -/* - * $Author: jpc $ - * $Id: DEF_grammar_yacc.y,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * $Date: 2002/04/25 16:16:20 $ - */ - -#include -#include -#include -#include -#include "util_Defs.h" -#include "DEF_actions.h" - - - /* Flex substitutions. */ -# define yylex DEF_grammarlex -# define yyin DEF_grammarin -# define yylineno DEF_grammarlineno - - -#define YYDEBUG 1 -#define YYERROR_VERBOSE 1 - -extern int yylineno; -extern char *yytext; - -extern void yyerror(char *str); -extern int yylex(void); - -%} - -%union { - double n; - char *s; - struct pt *pt; -}; - -%token T_Number -%token T_Ident -%token T_String -%token T_History - -%type orient -%type direction -%type pt -%type track_start -%type track_layer_statement -%type track_layer -%type track_layers - -%token T_ALIGN T_ARRAY T_ASSERTIONS T_BEGINEXT T_BOTTOMLEFT -%token T_BUSBITCHARS T_BY T_CANNOTOCCUPY T_CANPLACE T_CAPACITANCE -%token T_COMMONSCANPINS T_COMPONENT T_COMPONENTPIN T_COMPS -%token T_COMP_GEN T_CONSTRAINTS T_COVER T_DEFAULTCAP T_DESIGN -%token T_DIE_AREA T_DIFF T_DIRECTION T_DISTANCE T_DIVIDERCHAR T_DO -%token T_DRIVECELL T_E T_EEQMASTER T_END T_EQUAL T_ESTCAP T_FALL -%token T_FALLMAX T_FALLMIN T_FE T_FIXED T_FLOATING T_FLOORPLAN T_FN -%token T_FOREIGN T_FPC T_FROMCLOCKPIN T_FROMCOMPPIN T_FROMIOPIN -%token T_FROMPIN T_FS T_FW T_GCELLGRID T_GROUP T_GROUPS T_HISTORY -%token T_HOLDFALL T_HOLDRISE T_HORIZONTAL T_INTEGER T_IOTIMINGS -%token T_LAYER T_MACRO T_MAX T_MAXDIST T_MAXHALFPERIMETER T_MAXX -%token T_MAXY T_MICRONS T_MIN T_MINPINS T_MUSTJOIN T_N -%token T_NAMEMAPSTRING T_NAMESCASESENSITIVE T_NET T_NETS T_NEW -%token T_NONDEFAULTRULE T_NOSHIELD T_ORDERED T_ORIGINAL T_PARALLEL -%token T_PARTITIONS T_PATH T_PATTERN T_PATTERNNAME T_PIN -%token T_PINPROPERTIES T_PINS T_PLACED T_PROPERTY -%token T_PROPERTYDEFINITIONS T_RANGE T_REAL T_RECT T_REENTRANTPATHS -%token T_REGION T_REGIONS T_RISE T_RISEMAX T_RISEMIN T_ROUTED T_ROW -%token T_ROWS T_S T_SCANCHAINS T_SETUPFALL T_SETUPRISE T_SHAPE -%token T_SHIELD T_SHIELDNET T_SITE T_SLEWRATE T_SNET T_SNETS T_SOFT -%token T_SOURCE T_SPACING T_SPECIAL T_START T_STEP T_STOP T_STYLE -%token T_SUBNET T_SUM T_SYNTHESIZED T_TAPER T_TAPERRULE T_TECH -%token T_THRUPIN T_TIMINGDISABLES T_TOCLOCKPIN T_TOCOMPPIN T_TOIOPIN -%token T_TOPIN T_TOPRIGHT T_TRACKS T_TURNOFF T_UNITS T_UNPLACED T_USE -%token T_VARIABLE T_VERSION T_VERTICAL T_VIAS T_VOLTAGE T_VPIN T_W -%token T_WEIGHT T_WIDTH T_WIRECAP T_WIREDLOGIC T_XTALK -%token T_INPUT T_OUTPUT T_INOUT T_FEEDTHRU - -%% - -def_file - : version_stmt case_sens_stmt rules - | version_stmt case_sens_stmt rules end_design - ; - -version_stmt - : /* empty */ - | T_VERSION T_Number ';' - ; - -case_sens_stmt - : /* empty */ - | T_NAMESCASESENSITIVE T_Ident ';' - ; - -rules - : /* empty */ - | rules rule - | error - ; - -rule - : design_section - | via_section - | extension_section - | comps_section - | nets_section - | snets_section - | groups_section - | scanchains_section - | constraint_section - | assertions_section - | iotiming_section - | regions_section - | floorplan_contraints_section - | timingdisables_section - | partitions_section - | pin_props_section - ; - -design_section - : design_name - | tech_name - | history - | units - | divider_char - | bus_bit_chars - | site - | canplace - | cannotoccupy - | die_area - | pin_cap_rule - | pin_rule - | tracks_rule - | gcellgrid - | array_name - | floorplan_name - | row_rule - | prop_def_section - ; - -design_name - : T_DESIGN T_Ident ';' { def_design_name($2); } - ; - -end_design - : T_END T_DESIGN { def_end_design(); } - ; - -tech_name - : T_TECH T_Ident ';' { def_tech_name($2); } - ; - -array_name - : T_ARRAY T_Ident ';' - ; - -floorplan_name - : T_FLOORPLAN T_Ident ';' - ; - -history - : T_HISTORY T_History ';' - ; - -prop_def_section - : T_PROPERTYDEFINITIONS property_defs T_END T_PROPERTYDEFINITIONS - ; - -property_defs - : /* empty */ - | property_defs property_def - ; - -property_def - : T_DESIGN T_Ident property_type_and_val ';' - | T_NET T_Ident property_type_and_val ';' - | T_SNET T_Ident property_type_and_val ';' - | T_REGION T_Ident property_type_and_val ';' - | T_GROUP T_Ident property_type_and_val ';' - | T_COMPONENT T_Ident property_type_and_val ';' - | T_ROW T_Ident property_type_and_val ';' - | T_PIN T_Ident property_type_and_val ';' - | T_COMPONENTPIN T_Ident property_type_and_val ';' - ; - -property_type_and_val - : T_INTEGER opt_range opt_num_val {} - | T_REAL opt_range opt_num_val {} - | T_Ident {} - | T_Ident T_String {} - | T_NAMEMAPSTRING T_Ident {} - ; - -opt_num_val - : /* empty */ {} - | T_Number {} - ; - -units - : T_UNITS T_DISTANCE T_MICRONS T_Number ';' { def_units ($4); } - ; - -divider_char - : T_DIVIDERCHAR T_String ';' - ; - -bus_bit_chars - : T_BUSBITCHARS T_String ';' - ; - -site - : T_SITE T_Ident T_Number T_Number orient T_DO T_Number T_BY T_Number T_STEP T_Number T_Number ';' - ; - -canplace - : T_CANPLACE T_Ident T_Number T_Number orient T_DO T_Number T_BY T_Number T_STEP T_Number T_Number ';' - ; - -cannotoccupy - : T_CANNOTOCCUPY T_Ident T_Number T_Number orient T_DO T_Number T_BY T_Number T_STEP T_Number T_Number ';' - ; - -orient - : T_N { $$ = DEF_N; } - | T_E { $$ = DEF_E; } - | T_S { $$ = DEF_S; } - | T_W { $$ = DEF_W; } - | T_FN { $$ = DEF_FN; } - | T_FE { $$ = DEF_FE; } - | T_FS { $$ = DEF_FS; } - | T_FW { $$ = DEF_FW; } - ; - -direction - : T_INPUT { $$ = DEF_INPUT; } - | T_OUTPUT { $$ = DEF_OUTPUT; } - | T_INOUT { $$ = DEF_INOUT; } - | T_FEEDTHRU { $$ = DEF_FEEDTHRU; } - ; - -die_area - : T_DIE_AREA pt pt ';' { def_die_area ($2, $3); } - ; - -pin_cap_rule - : start_def_cap pin_caps end_def_cap - ; - -start_def_cap - : T_DEFAULTCAP T_Number - ; - -pin_caps - : /* empty */ - | pin_caps pin_cap - ; - -pin_cap - : T_MINPINS T_Number T_WIRECAP T_Number ';' - ; - -end_def_cap - : T_END T_DEFAULTCAP - ; - -pin_rule - : start_pins pins end_pins - ; - -start_pins - : T_PINS T_Number ';' { def_start_pins($2); } - ; - -pins - : /* empty */ - | pins pin - ; - -pin - : pin_start pin_options ';' { def_pin_options (); } - ; - -pin_start - : '-' T_Ident '+' T_NET T_Ident { def_pin_start($2, $5); } - ; - -pin_options - : /* empty */ - | pin_options pin_option - ; - -pin_option - : '+' T_SPECIAL - | extension_stmt - | '+' T_DIRECTION direction { def_pin_option_direction ($3); } - | '+' T_USE T_Ident - | '+' T_LAYER T_Ident pt pt { def_pin_option_layer ($3, $4, $5); } - | placement_status pt orient { def_pin_option_place ($2, $3); } - ; - -end_pins - : T_END T_PINS { def_end_pins(); } - ; - -row_rule - : T_ROW T_Ident T_Ident T_Number T_Number orient T_DO T_Number T_BY T_Number T_STEP T_Number T_Number row_options ';' - { def_row_rule ($2, $3, $4, $5, $6, $8, $10, $12, $13); } - ; - -row_options - : /* empty */ - | row_options row_option - ; - -row_option - : '+' T_PROPERTY row_prop_list - ; - -row_prop_list - : /* empty */ - | row_prop_list row_prop - ; - -row_prop - : T_Ident property_val {} - ; - -tracks_rule - : track_start T_Number T_DO T_Number T_STEP T_Number track_layer_statement ';' - { def_track_rule ($1, $2, $4, $6, $7); } - ; - -track_start - : T_TRACKS T_Ident { $$ = $2; } - ; - -track_layer_statement - : /* empty */ { $$ = ""; } - | T_LAYER track_layers { $$ = $2; } - ; - -track_layers - : /* empty */ { $$ = ""; } - | track_layer track_layers { $$ = def_track_layers ($1, $2); } - ; - -track_layer - : T_Ident { $$ = $1; } - ; - -gcellgrid - : T_GCELLGRID T_Ident T_Number T_DO T_Number T_STEP T_Number ';' - ; - -extension_section - : T_BEGINEXT - ; - -extension_stmt - : '+' T_BEGINEXT - ; - -via_section - : via via_declarations via_end - ; - -via - : T_VIAS T_Number ';' { def_start_vias ($2); } - ; - -via_declarations - : /* empty */ - | via_declarations via_declaration - ; - -via_declaration - : via_start layer_stmts ';' { def_via_end (); } - ; - -via_start - : '-' T_Ident { def_via_start ($2); } - ; - -layer_stmts - : /* empty */ - | layer_stmts layer_stmt - ; - -layer_stmt - : '+' T_RECT T_Ident pt pt { def_via_stmt_rect ($3, $4, $5); } - | '+' T_PATTERNNAME T_Ident { def_via_stmt_pattern ($3); } - | extension_stmt - ; - -pt - : '(' T_Number T_Number ')' { $$ = def_alloc_pt ( $2 , $3 ); } - | '(' '*' T_Number ')' { $$ = def_alloc_pt (HUGE_VAL, $3 ); } - | '(' T_Number '*' ')' { $$ = def_alloc_pt ( $2 , HUGE_VAL); } - | '(' '*' '*' ')' { $$ = def_alloc_pt (HUGE_VAL, HUGE_VAL); } - ; - -via_end - : T_END T_VIAS { def_end_vias (); } - ; - -regions_section - : regions_start regions_stmts T_END T_REGIONS - ; - -regions_start - : T_REGIONS T_Number ';' - ; - -regions_stmts - : /* empty */ - | regions_stmts regions_stmt - ; - -regions_stmt - : '-' T_Ident rect_list region_options ';' - ; - -rect_list - : pt pt { } - | rect_list pt pt { } - ; - -region_options - : /* empty */ - | region_options region_option - ; - -region_option - : '+' T_PROPERTY region_prop_list - ; - -region_prop_list - : /* empty */ - | region_prop_list region_prop - ; - -region_prop - : T_Ident property_val {} - ; - -comps_section - : start_comps comps_rule end_comps - ; - -start_comps - : T_COMPS T_Number ';' { def_start_comps($2); } - ; - -comps_rule - : /* empty */ - | comps_rule comp - ; - -comp - : comp_start comp_net_list comp_options ';' - ; - -comp_start - : '-' T_Ident T_Ident { def_comp_start($2, $3); } - ; - -comp_net_list - : /* empty */ {} - | comp_net_list '*' { def_comp_net_list("*"); } - | comp_net_list T_Ident { def_comp_net_list($2); } - ; - -comp_options - : /* empty */ - | comp_options comp_option - ; - -comp_option - : comp_generate - | comp_source - | comp_type - | weight - | comp_foreign - | comp_region - | comp_eeq - | comp_property - | comp_extension_stmt - ; - -comp_extension_stmt - : extension_stmt - ; - -comp_eeq - : '+' T_EEQMASTER T_Ident - ; - -comp_generate - : '+' T_COMP_GEN T_Ident opt_pattern - ; - -opt_pattern - : /* empty */ {} - | T_Ident {} - ; - -comp_source - : '+' T_SOURCE T_Ident - ; - -comp_region - : comp_region_start comp_pnt_list - | comp_region_start T_Ident - ; - -comp_pnt_list - : pt pt { } - | comp_pnt_list pt pt { } - ; - -comp_property - : '+' T_PROPERTY comp_prop_list - ; - -comp_prop_list - : /* empty */ - | comp_prop_list comp_prop - ; - -comp_prop - : T_Ident property_val {} - ; - -comp_region_start - : '+' T_REGION - ; - -comp_foreign - : '+' T_FOREIGN T_Ident opt_paren T_Ident - ; - -opt_paren - : pt {} - | T_Number T_Number {} - ; - -comp_type - : placement_status pt orient { def_comp_type ($2, $3); } - ; - -placement_status - : '+' T_FIXED - | '+' T_COVER - | '+' T_PLACED - | '+' T_UNPLACED - ; - -weight - : '+' T_WEIGHT T_Number - ; - -end_comps - : T_END T_COMPS { def_end_comps(); } - ; - -nets_section - : start_nets net_rules end_nets - ; - -start_nets - : T_NETS T_Number ';' { def_start_nets($2); } - ; - -net_rules - : /* empty */ - | net_rules one_net - ; - -one_net - : net_start net_connections net_options ';' - ; - -net_start - : '-' T_Ident { def_net_start($2); } - ; - -net_connections - : /* empty */ - | net_connections net_connection - ; - -net_connection - : '(' net_conn_start net_conn_opt ')' - | T_MUSTJOIN '(' net_conn_start net_conn_opt ')' - ; - -net_conn_start - : T_Ident T_Ident { def_net_conn_start($1, $2); } - | T_PIN T_Ident { def_net_conn_start("PIN", $2); } - ; - -net_conn_opt - : /* empty */ - | extension_stmt - | '+' T_SYNTHESIZED { def_net_conn_opt_synthesized(); } - ; - -net_options - : /* empty */ - | net_options net_option - ; - -net_option - : '+' net_type paths - | '+' T_SOURCE T_Ident - | '+' T_ORIGINAL T_Ident - | '+' T_PATTERN T_Ident - | '+' T_WEIGHT T_Number - | '+' T_XTALK T_Number - | '+' T_ESTCAP T_Number - | '+' T_USE T_Ident - | '+' T_STYLE T_Ident - | '+' T_NONDEFAULTRULE T_Ident - | vpin_stmt - | '+' T_SHIELDNET T_Ident - | '+' T_NOSHIELD paths - | '+' T_SUBNET T_Ident comp_names subnet_options - | '+' T_PROPERTY net_prop_list - | extension_stmt - ; - -net_prop_list - : /* empty */ - | net_prop_list net_prop - ; - -net_prop - : T_Ident property_val {} - ; - -vpin_stmt - : vpin_begin vpin_layer_opt pt pt vpin_options - ; - -vpin_begin - : '+' T_VPIN T_Ident - ; - -vpin_layer_opt - : /* empty */ - | T_LAYER T_Ident - ; - -property_val - : T_Number {} - | T_String {} - ; - -vpin_options - : /* empty */ - | vpin_status pt orient - ; - -vpin_status - : T_PLACED - | T_FIXED - | T_COVER - ; - -net_type - : T_FIXED - | T_COVER - | T_ROUTED - ; - -paths - : path - | paths new_path - ; - -new_path - : T_NEW path - ; - -path - : path_start opt_width opt_shape opt_taper path_pt path_item_list - ; - -path_start - : T_Ident { def_path_start ($1); } - ; - -path_item_list - : /* empty */ - | path_item_list path_item - ; - -path_item - : T_Ident { def_path_item_via ($1); } - | path_pt - ; - -path_pt - : '(' T_Number T_Number ')' { def_path_item_pt (def_alloc_pt ( $2 , $3 )); } - | '(' '*' T_Number ')' { def_path_item_pt (def_alloc_pt (HUGE_VAL, $3 )); } - | '(' T_Number '*' ')' { def_path_item_pt (def_alloc_pt ( $2 , HUGE_VAL)); } - | '(' '*' '*' ')' { def_path_item_pt (def_alloc_pt (HUGE_VAL, HUGE_VAL)); } - | '(' T_Number T_Number T_Number ')' { def_path_item_pt (def_alloc_pt ( $2 , $3 )); } - | '(' '*' T_Number T_Number ')' { def_path_item_pt (def_alloc_pt (HUGE_VAL, $3 )); } - | '(' T_Number '*' T_Number ')' { def_path_item_pt (def_alloc_pt ( $2 , HUGE_VAL)); } - | '(' '*' '*' T_Number ')' { def_path_item_pt (def_alloc_pt (HUGE_VAL, HUGE_VAL)); } - ; - -opt_taper - : /* empty */ - | T_TAPER - | T_TAPERRULE T_Ident - ; - -opt_shape - : /* empty */ - | '+' T_SHAPE T_Ident - ; - -opt_width - : /* empty */ {} - | T_Number { def_opt_width ($1); } - ; - -end_nets - : T_END T_NETS { def_end_nets(); } - ; - -snets_section - : start_snets snet_rules end_snets - ; - -snet_rules - : /* empty */ - | snet_rules snet_rule - ; - -snet_rule - : snet_start snet_connections snet_options ';' - ; - -snet_start - : '-' T_Ident { def_snet_start($2); } - ; - -snet_connections - : /* empty */ - | snet_connections snet_connection - ; - -snet_connection - : '(' snet_conn_start snet_conn_opt ')' - ; - -snet_conn_start - : T_Ident T_Ident { def_snet_conn_start($1, $2); } - | T_PIN T_Ident { def_snet_conn_start("PIN", $2); } - | '*' T_Ident { def_snet_conn_start("PIN", $2); } - ; - -snet_conn_opt - : /* empty */ - | extension_stmt - | '+' T_SYNTHESIZED { def_snet_conn_opt_synthesized(); } - ; - -snet_options - : /* empty */ - | snet_options snet_option - ; - -snet_option - : snet_width - | snet_voltage - | snet_spacing - | snet_other_option - ; - -snet_other_option - : '+' net_type paths - | '+' T_SHIELD T_Ident paths - | '+' T_SOURCE T_Ident - | '+' T_ORIGINAL T_Ident - | '+' T_PATTERN T_Ident - | '+' T_WEIGHT T_Number - | '+' T_ESTCAP T_Number - | '+' T_USE T_Ident - | '+' T_STYLE T_Ident - | '+' T_PROPERTY net_prop_list - | extension_stmt - ; - -snet_width - : '+' T_WIDTH T_Ident T_Number - ; - -snet_voltage - : '+' T_VOLTAGE T_Number - ; - -snet_spacing - : '+' T_SPACING T_Ident T_Number opt_snet_range - ; - -opt_snet_range - : /* nothing */ - | T_RANGE T_Number T_Number - ; - -opt_range - : /* nothing */ - | T_RANGE T_Number T_Number - ; - -start_snets - : T_SNETS T_Number ';' { def_start_snets($2); } - ; - -end_snets - : T_END T_SNETS { def_end_snets(); } - ; - -groups_section - : groups_start group_rules groups_end - ; - -groups_start - : T_GROUPS T_Number ';' - ; - -group_rules - : /* empty */ - | group_rules group_rule - ; - -group_rule - : start_group group_members group_options ';' - ; - -start_group - : '-' T_Ident - ; - -group_members - : /* empty */ - | group_members group_member - ; - -group_member - : T_Ident {} - ; - -group_options - : /* empty */ - | group_options group_option - ; - -group_option - : '+' T_SOFT group_soft_options - | '+' T_PROPERTY group_prop_list - | '+' T_REGION group_region - | extension_stmt - ; - -group_region - : pt pt {} - | T_Ident {} - ; - -group_prop_list - : /* empty */ - | group_prop_list group_prop - ; - -group_prop - : T_Ident property_val {} - ; - -group_soft_options - : /* empty */ - | group_soft_options group_soft_option - ; - -group_soft_option - : T_MAXX T_Number - | T_MAXY T_Number - | T_MAXHALFPERIMETER T_Number - ; - -groups_end - : T_END T_GROUPS - ; - -assertions_section - : assertions_start constraint_rules assertions_end - ; - -constraint_section - : constraints_start constraint_rules constraints_end - ; - -assertions_start - : T_ASSERTIONS T_Number ';' - ; - -constraints_start - : T_CONSTRAINTS T_Number ';' - ; - -constraint_rules - : /* empty */ - | constraint_rules constraint_rule - ; - -constraint_rule - : operand_rule - | wiredlogic_rule - ; - -operand_rule - : '-' operand delay_specs ';' - ; - -operand - : T_NET T_Ident - | T_PATH T_Ident T_Ident T_Ident T_Ident - | T_SUM '(' operand_list ')' - | T_DIFF '(' operand_list ')' - ; - -operand_list - : operand - | operand_list ',' operand - ; - -wiredlogic_rule - : '-' T_WIREDLOGIC T_Ident opt_plus T_MAXDIST T_Number ';' - ; - -opt_plus - : /* empty */ - | '+' - ; - -delay_specs - : /* empty */ - | delay_specs delay_spec - ; - -delay_spec - : '+' T_RISEMIN T_Number - | '+' T_RISEMAX T_Number - | '+' T_FALLMIN T_Number - | '+' T_FALLMAX T_Number - ; - -constraints_end - : T_END T_CONSTRAINTS - ; - -assertions_end - : T_END T_ASSERTIONS - ; - -scanchains_section - : scanchain_start scanchain_rules scanchain_end - ; - -scanchain_start - : T_SCANCHAINS T_Number ';' - ; - -scanchain_rules - : /* empty */ - | scanchain_rules scan_rule - ; - -scan_rule - : start_scan scan_members ';' - ; - -start_scan - : '-' T_Ident - ; - -scan_members - : /* empty */ - | scan_members scan_member - ; - -opt_pin - : /* empty */ {} - | T_Ident {} - ; - -scan_member - : '+' T_START T_Ident opt_pin - | '+' T_FLOATING floating_inst_list - | '+' T_ORDERED ordered_inst_list - | '+' T_STOP T_Ident opt_pin - | '+' T_COMMONSCANPINS opt_common_pins - | extension_stmt - ; - -opt_common_pins - : /* empty */ - | '(' T_Ident T_Ident ')' - | '(' T_Ident T_Ident ')' '(' T_Ident T_Ident ')' - ; - -floating_inst_list - : /* empty */ - | floating_inst_list one_floating_inst - ; - -one_floating_inst - : T_Ident floating_pins {} - ; - -floating_pins - : /* empty */ - | '(' T_Ident T_Ident ')' - | '(' T_Ident T_Ident ')' '(' T_Ident T_Ident ')' - ; - -ordered_inst_list - : /* empty */ - | ordered_inst_list one_ordered_inst - ; - -one_ordered_inst - : T_Ident ordered_pins {} - ; - -ordered_pins - : /* empty */ - | '(' T_Ident T_Ident ')' - | '(' T_Ident T_Ident ')' '(' T_Ident T_Ident ')' - ; - -scanchain_end - : T_END T_SCANCHAINS - ; - -iotiming_section - : iotiming_start iotiming_rules iotiming_end - ; - -iotiming_start - : T_IOTIMINGS T_Number ';' - ; - -iotiming_rules - : /* empty */ - | iotiming_rules iotiming_rule - ; - -iotiming_rule - : start_iotiming iotiming_members ';' - ; - -start_iotiming - : '-' '(' T_Ident T_Ident ')' - ; - -iotiming_members - : /* empty */ - | iotiming_members iotiming_member - ; - -iotiming_member - : '+' risefall T_VARIABLE T_Number T_Number - | '+' risefall T_SLEWRATE T_Number T_Number - | '+' T_CAPACITANCE T_Number - | '+' T_DRIVECELL T_Ident - | T_FROMPIN T_Ident - | T_TOPIN T_Ident - | T_PARALLEL T_Number - | extension_stmt - ; - -risefall - : T_RISE - | T_FALL - ; - -iotiming_end - : T_END T_IOTIMINGS - ; - -floorplan_contraints_section - : fp_start fp_stmts T_END T_FPC - ; - -fp_start - : T_FPC T_Number ';' - ; - -fp_stmts - : /* empty */ - | fp_stmts fp_stmt - ; - -fp_stmt - : '-' T_Ident h_or_v constraint_type constrain_what_list ';' - ; - -h_or_v - : T_HORIZONTAL - | T_VERTICAL - ; - -constraint_type - : T_ALIGN - | T_MAX T_Number - | T_MIN T_Number - | T_EQUAL T_Number - ; - -constrain_what_list - : /* empty */ - | constrain_what_list constrain_what - ; - -constrain_what - : '+' T_BOTTOMLEFT row_or_comp_list - | '+' T_TOPRIGHT row_or_comp_list - ; - -row_or_comp_list - : /* empty */ - | row_or_comp_list row_or_comp - ; - -row_or_comp - : '(' T_ROWS T_Ident ')' - | '(' T_COMPS T_Ident ')' - ; - -timingdisables_section - : timingdisables_start timingdisables_rules timingdisables_end - ; - -timingdisables_start - : T_TIMINGDISABLES T_Number ';' - ; - -timingdisables_rules - : /* empty */ - | timingdisables_rules timingdisables_rule - ; - -timingdisables_rule - : '-' T_FROMPIN T_Ident T_Ident T_TOPIN T_Ident T_Ident ';' - | '-' T_THRUPIN T_Ident T_Ident ';' - | '-' T_MACRO T_Ident td_macro_option ';' - | '-' T_REENTRANTPATHS ';' - ; - -td_macro_option - : T_FROMPIN T_Ident T_TOPIN T_Ident - | T_THRUPIN T_Ident - ; - -timingdisables_end - : T_END T_TIMINGDISABLES - ; - -partitions_section - : partitions_start partition_rules partitions_end - ; - -partitions_start - : T_PARTITIONS T_Number ';' - ; - -partition_rules - : /* empty */ - | partition_rules partition_rule - ; - -partition_rule - : start_partition partition_members ';' - ; - -start_partition - : '-' T_Ident turnoff - ; - -turnoff - : /* empty */ - | T_TURNOFF turnoff_setup turnoff_hold - ; - -turnoff_setup - : /* empty */ - | T_SETUPRISE - | T_SETUPFALL - ; - -turnoff_hold - : /* empty */ - | T_HOLDRISE - | T_HOLDFALL - ; - -partition_members - : /* empty */ - | partition_members partition_member - ; - -partition_member - : '+' T_FROMCLOCKPIN T_Ident T_Ident risefall minmaxpins - | '+' T_FROMCOMPPIN T_Ident T_Ident risefallminmax2_list - | '+' T_FROMIOPIN T_Ident risefallminmax1_list - | '+' T_TOCLOCKPIN T_Ident T_Ident risefall minmaxpins - | '+' T_TOCOMPPIN T_Ident T_Ident risefallminmax2_list - | '+' T_TOIOPIN T_Ident risefallminmax1_list - | extension_stmt - ; - -minmaxpins - : min_or_max_list T_PINS pin_list - ; - -min_or_max_list - : /* empty */ - | min_or_max_list min_or_max_member - ; - -min_or_max_member - : T_MIN T_Number T_Number - | T_MAX T_Number T_Number - ; - -pin_list - : /* empty */ - | pin_list T_Ident - ; - -risefallminmax1_list - : /* empty */ - | risefallminmax1_list risefallminmax1 - ; - -risefallminmax1 - : T_RISEMIN T_Number - | T_FALLMIN T_Number - | T_RISEMAX T_Number - | T_FALLMAX T_Number - ; - -risefallminmax2_list - : risefallminmax2 - | risefallminmax2_list risefallminmax2 - ; - -risefallminmax2 - : T_RISEMIN T_Number T_Number - | T_FALLMIN T_Number T_Number - | T_RISEMAX T_Number T_Number - | T_FALLMAX T_Number T_Number - ; - -partitions_end - : T_END T_PARTITIONS - ; - -comp_names - : /* empty */ - | comp_names comp_name - ; - -comp_name - : '(' T_Ident T_Ident subnet_opt_syn ')' - ; - -subnet_opt_syn - : /* empty */ - | '+' T_SYNTHESIZED - ; - -subnet_options - : /* empty */ - | subnet_options subnet_option - ; - -subnet_option - : net_type paths - | T_NONDEFAULTRULE T_Ident - ; - -pin_props_section - : begin_pin_props pin_prop_list end_pin_props - ; - -begin_pin_props - : T_PINPROPERTIES T_Number opt_semi - ; - -opt_semi - : /* empty */ - | ';' - ; - -end_pin_props - : T_END T_PINPROPERTIES - ; - -pin_prop_list - : /* empty */ - | pin_prop_list pin_prop_terminal - ; - -pin_prop_terminal - : '-' T_Ident T_Ident pin_prop_options ';' - ; - -pin_prop_options - : /* empty */ - | pin_prop_options pin_prop - ; - -pin_prop - : '+' T_PROPERTY pin_prop_name_value_list - ; - -pin_prop_name_value_list - : /* empty */ - | pin_prop_name_value_list pin_prop_name_value - ; - -pin_prop_name_value - : T_Ident property_val {} - ; - -%% - -void -yyerror(char *str) -{ - def_parse_error(str); -} - diff --git a/alliance/src/sea/src/GNU_Defs.h b/alliance/src/sea/src/GNU_Defs.h deleted file mode 100644 index f95b2c4a..00000000 --- a/alliance/src/sea/src/GNU_Defs.h +++ /dev/null @@ -1,100 +0,0 @@ - -/* - * $Id: GNU_Defs.h,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Header : "./GNU_Defs.h" | - * | ************************************************************** | - * | | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# ifdef __GNUC__ -# if defined(__sparc__) && !defined(__svr4__) -# define __MISS_GNU_PROTO__ 1 -# else -# define __MISS_GNU_PROTO__ 0 -# endif - - -/* ---------------------------------------------------------------------- - * Functions from "". - */ - - -# ifdef _ERRNO_H -# define _errno_h 1 -# endif -# ifdef _errno_h -# if __MISS_GNU_PROTO__ - extern void perror __FP(( char* )); -# endif -# endif - - -/* ---------------------------------------------------------------------- - * Functions from "". - */ - - -# ifdef _SIGNAL_H -# define __signal_h 1 -# endif -# ifdef __signal_h -# if __MISS_GNU_PROTO__ - extern void (*ssignal())(); - extern int gsignal __FP(( int )); -# endif -# endif - - -/* ---------------------------------------------------------------------- - * Functions from "". - */ - - -# ifdef _SYS_UNISTD_H -# define __sys_unistd_h 1 -# endif -# ifdef __sys_unistd_h -# if __MISS_GNU_PROTO__ - extern int read __FP(( int, void*, __SIZE_TYPE__ )); -# endif -# endif - - -/* ---------------------------------------------------------------------- - * Functions from "". - */ - - -# ifdef _STDIO_H -# define __stdio_h 1 -# endif -# ifdef FILE -# define __stdio_h 1 -# endif -# ifdef __stdio_h -# if __MISS_GNU_PROTO__ - extern int fclose __FP(( FILE* )); - extern int fflush __FP(( FILE* )); - extern int printf __FP(( char*, ... )); - extern int fprintf __FP(( FILE*, char*, ... )); - extern int vfprintf __FP(( FILE*, char*, va_list )); - extern int vsprintf __FP(( char*, char*, va_list )); - extern int fputs __FP(( char*, FILE* )); -# endif -# endif - - -# endif diff --git a/alliance/src/sea/src/LEF_drive.c b/alliance/src/sea/src/LEF_drive.c deleted file mode 100644 index 3dadfd9d..00000000 --- a/alliance/src/sea/src/LEF_drive.c +++ /dev/null @@ -1,640 +0,0 @@ -/* - * $Id: LEF_drive.c,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./LEF_drive.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "util_Defs.h" -# include "LEF_drive.h" - - -/* ------------------------------------------------------------------ - * Global variables (declared `extern' in "UtDefs.h"). - */ - - eMACRO_t *LEF_lMACRO = (eMACRO_t*)NULL; - - -/* ------------------------------------------------------------------ - * Internal functions declarations. - */ - - static char *CLASStoa __FP((char acCLASS)); - static char *DIRtoa __FP((char acDIR)); - static char *USEtoa __FP((char acUSE)); - static char *SHAPEtoa __FP((char acSHAPE)); - static char *LAYERtoa __FP((char acLAYER)); - static char *SYMMETRYtoa __FP((char acSYMMETRY)); - static char *pttoa __FP((XY_t *apXY)); - static char *SIZEtoa __FP((XY_t *apXY)); - static void fprintPATH __FP((FILE *LEF, ePATH_t *alPATH)); - static void fprintPORT __FP((FILE *LEF, ePORT_t *alPORT)); - static void fprintPIN __FP((FILE *LEF, ePIN_t *apPIN)); - static void fprintOBS __FP((FILE *LEF, eOBS_t *alOBS)); - - -/* - * /----------------------------------------------------------------\ - * | Functions Definitions | - * \----------------------------------------------------------------/ - */ - -/* ------------------------------------------------------------------ - * Function : "allocRECT()". - */ - -extern RECT_t *allocRECT(aX0, aY0, aX1, aY1) - long aX0, aY0, aX1, aY1; -{ - RECT_t *pRECT; - - pRECT = (RECT_t*)malloc(sizeof(RECT_t)); - pRECT->pt0.x = MBK2DEF_length (aX0); - pRECT->pt0.y = MBK2DEF_length (aY0); - pRECT->pt1.x = MBK2DEF_length (aX1); - pRECT->pt1.y = MBK2DEF_length (aY1); - - return(pRECT); -} - - -/* ------------------------------------------------------------------ - * Function : "allocPATH()". - */ - -extern ePATH_t *allocPATH(alPATH, aX, aY) - ePATH_t *alPATH; - long aX, aY; -{ - ePATH_t *pPATH; - - pPATH = (ePATH_t*)malloc(sizeof(ePATH_t)); - pPATH->pt.x = MBK2DEF_length (aX); - pPATH->pt.y = MBK2DEF_length (aY); - - /* Add the new element in head of list. */ - pPATH->Next = alPATH; - - return(pPATH); -} - - -/* ------------------------------------------------------------------ - * Function : "revPATH()". - */ - -extern ePATH_t *revPATH(apPATH) - ePATH_t *apPATH; -{ - ePATH_t *pPATH, *lRevPATH, *pTmp; - - - lRevPATH = (ePATH_t *)NULL; - - for(pPATH = apPATH; pPATH != (ePATH_t*)NULL;) { - - pTmp = pPATH; - pPATH = pPATH->Next; - - pTmp->Next = lRevPATH; - lRevPATH = pTmp; - - } /* End of "pPATH" loop. */ - - return(lRevPATH); -} - - -/* ------------------------------------------------------------------ - * Function : "allocOBS()". - */ - -extern eOBS_t *allocOBS(alOBS, aType, apData) - eOBS_t *alOBS; - char aType; - void *apData; -{ - eOBS_t *pOBS; - - pOBS = (eOBS_t*)malloc(sizeof(eOBS_t)); - pOBS->Type = aType; - - if (aType == C_OBSITEM_WIDTH) - pOBS->Data = (void*)(MBK2DEF_length ((long)apData)); - else - pOBS->Data = apData; - - /* Add the new element in head of list. */ - pOBS->Next = alOBS; - - return(pOBS); -} - - -/* ------------------------------------------------------------------ - * Function : "revOBS()". - */ - -extern eOBS_t *revOBS(apOBS) - eOBS_t *apOBS; -{ - eOBS_t *pOBS, *lRevOBS, *pTmp; - - - lRevOBS = (eOBS_t *)NULL; - - for(pOBS = apOBS; pOBS != (eOBS_t*)NULL;) { - - pTmp = pOBS; - pOBS = pOBS->Next; - - pTmp->Next = lRevOBS; - lRevOBS = pTmp; - - } /* End of "pOBS" loop. */ - - return(lRevOBS); -} - - -/* ------------------------------------------------------------------ - * Function : "allocPORT()". - */ - -extern ePORT_t *allocPORT(alPORT, aType, apData) - ePORT_t *alPORT; - char aType; - void *apData; -{ - ePORT_t *pPORT; - - pPORT = (ePORT_t*)malloc(sizeof(ePORT_t)); - pPORT->Type = aType; - - if (aType == C_PORTITEM_WIDTH) - pPORT->Data = (void*)(MBK2DEF_length ((long)apData)); - else - pPORT->Data = apData; - - /* Add the new element in head of list. */ - pPORT->Next = alPORT; - - return(pPORT); -} - - -/* ------------------------------------------------------------------ - * Function : "revPORT()". - */ - -extern ePORT_t *revPORT(apPORT) - ePORT_t *apPORT; -{ - ePORT_t *pPORT, *lRevPORT, *pTmp; - - - lRevPORT = (ePORT_t *)NULL; - - for(pPORT = apPORT; pPORT != (ePORT_t*)NULL;) { - - pTmp = pPORT; - pPORT = pPORT->Next; - - pTmp->Next = lRevPORT; - lRevPORT = pTmp; - - } /* End of "pPORT" loop. */ - - return(lRevPORT); -} - - -/* ------------------------------------------------------------------ - * Function : "allocPIN()". - */ - -extern ePIN_t *allocPIN(alPin, asName) - ePIN_t *alPin; - char *asName; -{ - ePIN_t *pPIN; - - /* Allocate, and for security'sake, blank all the fields. */ - pPIN = (ePIN_t*)malloc(sizeof(ePIN_t)); - pPIN->pinName = namealloc(asName); - pPIN->DIRECTION = C_DIRECTION_NONE; - pPIN->USE = C_USE_NONE; - pPIN->SHAPE = C_SHAPE_NONE; - pPIN->lPORT = (ePORT_t*)NULL; - - /* Add the new element in head of list. */ - pPIN->Next = alPin; - - return(pPIN); -} - - -/* ------------------------------------------------------------------ - * Function : "getPIN()". - */ - -extern ePIN_t *getPIN(apMACRO, asName) - eMACRO_t *apMACRO; - char *asName; -{ - ePIN_t *pPIN; - - - for(pPIN = apMACRO->lPIN; pPIN != (ePIN_t*)NULL; pPIN = pPIN->Next) { - if (pPIN->pinName == asName) return(pPIN); - } /* End of "pPIN" loop. */ - - return((ePIN_t*)NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "allocMACRO()". - */ - -extern eMACRO_t *allocMACRO(asName) - char *asName; -{ - eMACRO_t *pMACRO; - - /* Allocate, and for security'sake, blank all the fields. */ - pMACRO = (eMACRO_t*)malloc(sizeof(eMACRO_t)); - pMACRO->macroName = namealloc(asName); - pMACRO->CLASS = C_CLASS_NONE; - pMACRO->ORIGIN.x = 0L; - pMACRO->ORIGIN.y = 0L; - pMACRO->SIZE.x = 0L; - pMACRO->SIZE.y = 0L; - pMACRO->SYMMETRY = F_SYMMETRY_NONE; - pMACRO->SITE = (char*)NULL; - pMACRO->lPIN = (ePIN_t*)NULL; - pMACRO->lOBS = (eOBS_t*)NULL; - - /* Add the new element in head of list. */ - pMACRO->Next = LEF_lMACRO; - LEF_lMACRO = pMACRO; - - return(pMACRO); -} - - -/* ------------------------------------------------------------------ - * Function : "CLASStoa()". - */ - -static char *CLASStoa(acCLASS) - char acCLASS; -{ - switch(acCLASS) { - case C_CLASS_NONE: return((char*)NULL); - case C_CLASS_COVER: return("COVER"); - case C_CLASS_RING: return("RING"); - case C_CLASS_PAD: return("PAD"); - case C_CLASS_CORE: return("CORE"); - case C_CLASS_FEEDTHRU: return("CORE FEEDTHRU"); - case C_CLASS_ENDCAP: return("ENDCAP"); - case C_CLASS_TOPRIGHT: return("ENDCAP TOPRIGHT"); - case C_CLASS_TOPLEFT: return("ENDCAP TOPLEFT"); - } - - return((char*)NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "DIRtoa()". - */ - -static char *DIRtoa(acDIR) - char acDIR; -{ - switch(acDIR) { - case C_DIRECTION_NONE: return((char*)NULL); - case C_DIRECTION_INPUT: return("INPUT"); - case C_DIRECTION_OUTPUT: return("OUTPUT"); - case C_DIRECTION_TRISTATE: return("OUTPUT TRISTATE"); - case C_DIRECTION_INOUT: return("INOUT"); - case C_DIRECTION_FEEDTHRU: return("FEEDTHRU"); - } - - return((char*)NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "USEtoa()". - */ - -static char *USEtoa(acUSE) - char acUSE; -{ - switch(acUSE) { - case C_USE_NONE: return((char*)NULL); - case C_USE_SIGNAL: return("signal"); - case C_USE_ANALOG: return("analog"); - case C_USE_POWER: return("power"); - case C_USE_GROUND: return("ground"); - case C_USE_CLOCK: return("clock"); - } - - return((char*)NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "SHAPEtoa()". - */ - -static char *SHAPEtoa(acSHAPE) - char acSHAPE; -{ - switch(acSHAPE) { - case C_SHAPE_NONE: return((char*)NULL); - case C_SHAPE_ABUTMENT: return("ABUTMENT"); - case C_SHAPE_RING: return("RING"); - case C_SHAPE_FEEDTHRU: return("FEEDTHRU"); - } - - return((char*)NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "LAYERtoa()". - */ - -static char *LAYERtoa(acLAYER) - char acLAYER; -{ - switch(acLAYER) { - case ALU1: return("L_ALU1"); - case ALU2: return("L_ALU2"); - case ALU3: return("L_ALU3"); - case ALU4: return("L_ALU4"); - case ALU5: return("L_ALU5"); - case ALU6: return("L_ALU6"); - case CALU1: return("L_ALU1"); - case CALU2: return("L_ALU2"); - case CALU3: return("L_ALU3"); - case CALU4: return("L_ALU4"); - case CALU5: return("L_ALU5"); - case CALU6: return("L_ALU6"); - } - - return((char*)NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "SYMMETRYtoa()". - */ - -static char *SYMMETRYtoa(acSYMMETRY) - char acSYMMETRY; -{ - static char sSYMMETRY[32]; - int iSYMMETRY; - - iSYMMETRY = 0; - - if (acSYMMETRY & F_SYMMETRY_X) { - sSYMMETRY[iSYMMETRY++] = 'X'; sSYMMETRY[iSYMMETRY++] = ' '; } - - if (acSYMMETRY & F_SYMMETRY_Y) { - sSYMMETRY[iSYMMETRY++] = 'Y'; sSYMMETRY[iSYMMETRY++] = ' '; } - - if (acSYMMETRY & F_SYMMETRY_R90) { - strncpy(sSYMMETRY + iSYMMETRY, "r90 ", 4); - iSYMMETRY += 4; - } - - sSYMMETRY[iSYMMETRY - 1] = (char)0; - - return(sSYMMETRY); -} - - -/* ------------------------------------------------------------------ - * Function : "pttoa()". - */ - -static char *pttoa(apXY) - XY_t *apXY; -{ - static char sXY[32]; - - sprintf(sXY, "%.2f %.2f", MICRONS(apXY->x), MICRONS(apXY->y)); - - return(sXY); -} - - -/* ------------------------------------------------------------------ - * Function : "SIZEtoa()". - */ - -static char *SIZEtoa(apXY) - XY_t *apXY; -{ - static char sXY[32]; - - sprintf(sXY, "%.2f BY %.2f", MICRONS(apXY->x), MICRONS(apXY->y)); - - return(sXY); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintPATH()". - */ - -static void fprintPATH(LEF, alPATH) - FILE *LEF; - ePATH_t *alPATH; -{ - ePATH_t *pPATH; - - - fprintf(LEF, " PATH "); - - for(pPATH = alPATH; pPATH != (ePATH_t*)NULL; pPATH = pPATH->Next) { - fprintf(LEF, "%s ", pttoa(&(pPATH->pt))); - } /* End of "pPATH" loop. */ - - fprintf(LEF, ";\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintPORT()". - */ - -static void fprintPORT(LEF, alPORT) - FILE *LEF; - ePORT_t *alPORT; -{ - ePORT_t *pPORT; - - - fprintf(LEF, " PORT\n"); - - for(pPORT = alPORT; pPORT != (ePORT_t*)NULL; pPORT = pPORT->Next) { - switch(pPORT->Type) { - - case C_PORTITEM_LAYER: - fprintf(LEF, " LAYER %s ;\n", - LAYERtoa((char)(long)((pPORT->Data)))); - break; - - case C_PORTITEM_WIDTH: - fprintf(LEF, " WIDTH %.2f ;\n", - MICRONS((long)(pPORT->Data))); - break; - - case C_PORTITEM_RECT: - fprintf(LEF, " RECT %s ", - pttoa(&((RECT_t*)pPORT->Data)->pt0)); - - fprintf(LEF, "%s ;\n", pttoa(&((RECT_t*)pPORT->Data)->pt1)); - break; - - case C_PORTITEM_PATH: - fprintPATH(LEF, (ePATH_t *)pPORT->Data); - break; - - } /* End of "pPORT->Type" switch. */ - } /* End of "pPORT" loop. */ - - fprintf(LEF, " END\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintPIN()". - */ - -static void fprintPIN(LEF, apPIN) - FILE *LEF; - ePIN_t *apPIN; -{ - char *sPin, sPinLEF[80]; - - - sPin = MBK2DEF_name(sPinLEF, apPIN->pinName); - - fprintf(LEF, " PIN %s\n", sPin); - - if (apPIN->DIRECTION != C_DIRECTION_NONE) { - fprintf(LEF, " DIRECTION %s ;\n", DIRtoa(apPIN->DIRECTION)); } - - if (apPIN->USE != C_USE_NONE) { - fprintf(LEF, " USE %s ;\n", USEtoa(apPIN->USE)); } - - if (apPIN->SHAPE != C_SHAPE_NONE) { - fprintf(LEF, " SHAPE %s ;\n", SHAPEtoa(apPIN->SHAPE)); } - - if (apPIN->lPORT != (ePORT_t*)NULL) - fprintPORT(LEF, apPIN->lPORT); - - fprintf(LEF, " END %s\n", sPin); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintOBS()". - */ - -static void fprintOBS(LEF, alOBS) - FILE *LEF; - eOBS_t *alOBS; -{ - eOBS_t *pOBS; - - - if (alOBS != (eOBS_t*)NULL) fprintf(LEF, " OBS\n"); - - for(pOBS = alOBS; pOBS != (eOBS_t*)NULL; pOBS = pOBS->Next) { - switch(pOBS->Type) { - - case C_OBSITEM_LAYER: - fprintf(LEF, " LAYER %s ;\n", - LAYERtoa((char)(long)((pOBS->Data)))); - break; - - case C_OBSITEM_WIDTH: - fprintf(LEF, " WIDTH %.2f ;\n", - MICRONS((long)(pOBS->Data))); - break; - - case C_OBSITEM_RECT: - fprintf(LEF, " RECT %s ", - pttoa(&((RECT_t*)pOBS->Data)->pt0)); - - fprintf(LEF, "%s ;\n", pttoa(&((RECT_t*)pOBS->Data)->pt1)); - break; - - case C_OBSITEM_PATH: - fprintPATH(LEF, (ePATH_t *)pOBS->Data); - break; - - } /* End of "pOBS->Type" switch. */ - } /* End of "pOBS" loop. */ - - if (alOBS != (eOBS_t*)NULL) fprintf(LEF, " END\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "fprintMACRO()". - */ - -extern void fprintMACRO(LEF, apMACRO) - FILE *LEF; - eMACRO_t *apMACRO; -{ - ePIN_t *pPIN; - - - fprintf(LEF, "MACRO %s\n", apMACRO->macroName); - - - if (apMACRO->CLASS != C_CLASS_NONE) { - fprintf(LEF, " CLASS %s ;\n", CLASStoa(apMACRO->CLASS)); } - - fprintf(LEF, " ORIGIN %s ;\n", pttoa(&(apMACRO->ORIGIN))); - fprintf(LEF, " SIZE %s ;\n", SIZEtoa(&(apMACRO->SIZE ))); - - if (apMACRO->SYMMETRY != F_SYMMETRY_NONE) { - fprintf(LEF, " SYMMETRY %s ;\n", SYMMETRYtoa(apMACRO->SYMMETRY)); } - - if (apMACRO->SITE != (char*)NULL) { - fprintf(LEF, " SITE %s ;\n", apMACRO->SITE); } - - - for(pPIN = apMACRO->lPIN; pPIN != (ePIN_t *)NULL; pPIN = pPIN->Next) - fprintPIN(LEF, pPIN); - - - fprintOBS(LEF, apMACRO->lOBS); - - - fprintf(LEF, "END %s\n\n", apMACRO->macroName); -} diff --git a/alliance/src/sea/src/LEF_drive.h b/alliance/src/sea/src/LEF_drive.h deleted file mode 100644 index eb19650e..00000000 --- a/alliance/src/sea/src/LEF_drive.h +++ /dev/null @@ -1,146 +0,0 @@ -/* - * $Id: LEF_drive.h,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Header : "./LEF_drive.h" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# ifndef __LEF_drive__ -# define __LEF_drive__ - - -# define C_CLASS_NONE ((char)0) -# define C_CLASS_COVER ((char)1) -# define C_CLASS_RING ((char)2) -# define C_CLASS_PAD ((char)3) -# define C_CLASS_CORE ((char)4) -# define C_CLASS_FEEDTHRU ((char)5) -# define C_CLASS_ENDCAP ((char)6) -# define C_CLASS_TOPRIGHT ((char)7) -# define C_CLASS_TOPLEFT ((char)8) - -# define F_SYMMETRY_NONE ((char)0) -# define F_SYMMETRY_X ((char)1) -# define F_SYMMETRY_Y ((char)2) -# define F_SYMMETRY_R90 ((char)4) -# define F_SYMMETRY_XY ((char)( F_SYMMETRY_X \ - | F_SYMMETRY_Y )) -# define F_SYMMETRY_XYR90 ((char)( F_SYMMETRY_X \ - | F_SYMMETRY_Y \ - | F_SYMMETRY_R90 )) - -# define C_USE_NONE ((char)0) -# define C_USE_SIGNAL ((char)1) -# define C_USE_ANALOG ((char)2) -# define C_USE_POWER ((char)3) -# define C_USE_GROUND ((char)4) -# define C_USE_CLOCK ((char)5) - -# define C_SHAPE_NONE ((char)0) -# define C_SHAPE_ABUTMENT ((char)1) -# define C_SHAPE_RING ((char)2) -# define C_SHAPE_FEEDTHRU ((char)3) - -# define C_PORTITEM_LAYER ((char)1) -# define C_PORTITEM_WIDTH ((char)2) -# define C_PORTITEM_PATH ((char)3) -# define C_PORTITEM_RECT ((char)4) -# define C_OBSITEM_LAYER C_PORTITEM_LAYER -# define C_OBSITEM_WIDTH C_PORTITEM_WIDTH -# define C_OBSITEM_PATH C_PORTITEM_PATH -# define C_OBSITEM_RECT C_PORTITEM_RECT - - - typedef struct XY_s { long x; long y; } XY_t; - - - typedef struct ePATH_s { - struct XY_s pt; - struct ePATH_s *Next; - } ePATH_t; - - - typedef struct RECT_s { - struct XY_s pt0; - struct XY_s pt1; - } RECT_t; - - - typedef struct ePORT_s { - char Type; - void *Data; - struct ePORT_s *Next; - } ePORT_t; - - - typedef struct eOBS_s { - char Type; - void *Data; - struct eOBS_s *Next; - } eOBS_t; - - - typedef struct ePIN_s { - char *pinName; - char DIRECTION; - char USE; - char SHAPE; - struct ePORT_s *lPORT; - struct ePIN_s *Next; - } ePIN_t; - - - typedef struct eMACRO_s { - char *macroName; - char CLASS; - struct XY_s ORIGIN; - struct XY_s SIZE; - char SYMMETRY; - char *SITE; - struct ePIN_s *lPIN; - struct eOBS_s *lOBS; - struct eMACRO_s *Next; /* The next element... */ - } eMACRO_t; - - -# define MICRONS(m) (((float)(m)) / DEF_UNITS_MICRONS) - -# define m_AddPin(p,n) ((p) = allocPIN((p), (n))) -# define m_AddPort(p,t,d) ((p) = allocPORT((p), (t), (void*)(d))) -# define m_RevPort(p) ((p) = revPORT((p))) -# define m_AddObs(p,t,d) ((p) = allocOBS((p), (t), (void*)(d))) -# define m_RevObs(p) ((p) = revOBS((p))) - -# define m_AddRect(x0,y0,x1,y1) (allocRECT(x0, y0, x1, y1)) - -# define m_AddPath(p,x,y) ((p) = allocPATH((p), x, y)) - -# define m_RevPath(p) ((p) = revPATH((p))) - - - extern RECT_t *allocRECT __FP((long aX0, long aY0, long aX1, long aY1)); - extern ePATH_t *allocPATH __FP((ePATH_t *alPATH, long aX, long aY)); - extern ePATH_t *revPATH __FP((ePATH_t *apPATH)); - extern eOBS_t *allocOBS __FP((eOBS_t *alOBS, char aType, void *apData)); - extern eOBS_t *revOBS __FP((eOBS_t *apOBS)); - extern ePORT_t *allocPORT __FP((ePORT_t *alPORT, char aType, void *apData)); - extern ePORT_t *revPORT __FP((ePORT_t *apPORT)); - extern ePIN_t *allocPIN __FP((ePIN_t *alPin, char *asName)); - extern ePIN_t *getPIN __FP((eMACRO_t *apMACRO, char *asName)); - extern eMACRO_t *allocMACRO __FP((char *asName)); - extern void fprintMACRO __FP((FILE *LEF, eMACRO_t *apMACRO)); - - -# endif diff --git a/alliance/src/sea/src/LEF_drive_sxlib.c b/alliance/src/sea/src/LEF_drive_sxlib.c deleted file mode 100644 index ed0f9a2c..00000000 --- a/alliance/src/sea/src/LEF_drive_sxlib.c +++ /dev/null @@ -1,1056 +0,0 @@ -/* - * $Id: LEF_drive_sxlib.c,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./LEF_drive_sxlib.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "util_Defs.h" -# include "LEF_drive.h" -# include "LEF_drive_sxlib.h" - - -/* ------------------------------------------------------------------ - * Local constants. - */ - - -# define XGRID MBKSCALE(5) -# define YGRID MBKSCALE(5) -# define YSLICE MBKSCALE(50) -# define EXT_ALU1 MBKSCALE(0.5) -# define EXT_ALU2 MBKSCALE(1.0) -# define EXT_ALU3 MBKSCALE(1.0) -# define EXT_ALU4 MBKSCALE(1.0) -# define EXT_ALU5 MBKSCALE(1.0) -# define EXT_ALU6 MBKSCALE(1.0) -# define WIDTH_CALUx MBKSCALE(2) -# define MIN_WIDTH_ALU1 MBKSCALE(1) -# define WIDTH_OBS_ALU1 MBKSCALE(2) -# define HEIGHT_OBS_ALU1 MBKSCALE(2) -# define LEFTRIGHT_OBS_ALU1 MBKSCALE(2.5) -# define F_POWER_PIN_LEFT 0x00000001 -# define F_POWER_PIN_RIGHT 0x00000002 - - -/* ------------------------------------------------------------------ - * Internal structures definitions. - */ - - typedef struct eGrid_s { - long x; - long y; - struct eGrid_s *Next; - } eGrid_t; - - -/* ------------------------------------------------------------------ - * Local variables (prefix 'LV_'). - */ - - - static phfig_list *LV_phfig; /* Working physical figure. */ - static lofig_list *LV_lofig; /* Working logical figure. */ - static eMACRO_t *LV_pMACRO; - static eGrid_t *LV_tHolesALU1 = (eGrid_t*)NULL; - static char *LV_ref_ref; /* Pointer to the "ref_ref" string. */ - static char *LV_ref_con; /* Pointer to the "ref_con" string. */ - static long LV_flags; /* Conversion flags. */ - - -/* ------------------------------------------------------------------ - * Internal functions declarations. - */ - -static long getLayerExt __FP((char aLayer)); -static eGrid_t *getTGrid __FP((eGrid_t **aptGrid, long aX, long aY)); -static eGrid_t *addTGrid __FP((eGrid_t **aptGrid, long aX, long aY)); -static void phseg2TGrid __FP((eGrid_t **aptGrid, - phseg_list *apPhSeg)); -static void TGrid2PORT __FP((ePORT_t **aplPORT, eGrid_t *aptGrid)); -static char *refCon2Name __FP((char *asRefCon)); -static int onGrid __FP((long aX, long aY)); -static locon_list *getLoCon __FP((char *asName)); -static void SxLib2SYMMETRY __FP((void)); -static void AddEmptyPowerPIN __FP((char *asName)); -static void AddPowerPIN __FP((char *asName, - char aDir, - char aLayer, - long aY, - long aWidth, - long aFlags)); -static void SxLib2PowerPINS __FP((char aLayer, - char aDir, - char *asSuffix)); -static void phref2PINS __FP((void)); -static void phseg2PINS __FP((void)); -static void SxLib2SignalPINS __FP((void)); -static void insertPIN __FP((ePIN_t **appHead, - ePIN_t **appTail, - ePIN_t *apPIN)); -static void sortPINS __FP((void)); -static void checkPIN __FP((void)); -# if 0 -static void SxLib2ALU1OBS __FP((void)); -# endif -static void SxLib2ALUxOBS __FP((char aLayer)); -static void revPINPORT __FP((void)); -static eMACRO_t *SxLib2MACRO __FP((void)); - - -/* - * /--------------------------------------------------------------------\ - * | Functions Definitions | - * \--------------------------------------------------------------------/ - */ - - -/* ---------------------------------------------------------------------- - * Function : "getLayerExt()". - */ - -static long getLayerExt(aLayer) - char aLayer; -{ - switch(aLayer) { - case ALU1: return(EXT_ALU1); - case ALU2: return(EXT_ALU2); - case ALU3: return(EXT_ALU3); - case ALU4: return(EXT_ALU4); - case ALU5: return(EXT_ALU5); - case ALU6: return(EXT_ALU6); - } - - return(0L); -} - - -/* ---------------------------------------------------------------------- - * Function : "getTGrid()". - */ - -static eGrid_t *getTGrid(aptGrid, aX, aY) - eGrid_t **aptGrid; - long aX, aY; -{ - eGrid_t *pGrid; - - - for(pGrid = *aptGrid; pGrid != (eGrid_t*)NULL; pGrid = pGrid->Next) - if ((pGrid->x == aX) && (pGrid->y == aY)) return(pGrid); - - return((eGrid_t*)NULL); -} - - -/* ---------------------------------------------------------------------- - * Function : "addTGrid()". - */ - -static eGrid_t *addTGrid(aptGrid, aX, aY) - eGrid_t **aptGrid; - long aX, aY; -{ - eGrid_t *pGrid; - - - pGrid = getTGrid(aptGrid, aX, aY); - if (pGrid != (eGrid_t*)NULL) return(pGrid); - - pGrid = (eGrid_t*)malloc(sizeof(eGrid_t)); - pGrid->x = aX; - pGrid->y = aY; - - pGrid->Next = *aptGrid; - *aptGrid = pGrid; - - return(pGrid); -} - - -/* ---------------------------------------------------------------------- - * Function : "phseg2TGrid()". - */ - -static void phseg2TGrid(aptGrid, apPhSeg) - eGrid_t **aptGrid; - phseg_list *apPhSeg; -{ - long y, yMin, yMax; - - - if (apPhSeg->X1 == apPhSeg->X2) { - if (!(LV_flags & F_ALLOW_OFFGRID)) { - if ((apPhSeg->X1 - LV_phfig->XAB1) % XGRID) { - wprinth((char*)NULL); - wprintf("Segment \"%s\" (%d,%d) (%d,%d) is NOT on grid (skipped).\n", - apPhSeg->NAME, apPhSeg->X1, apPhSeg->Y1, - apPhSeg->X2, apPhSeg->Y2); - return; - } - } - - yMax = apPhSeg->Y2 - (apPhSeg->Y2 % YGRID); - yMin = apPhSeg->Y1; - if (apPhSeg->Y1 % YGRID) yMin += YGRID - (apPhSeg->Y1 % YGRID); - - for(y = yMin; y <= yMax; y += YGRID) { - addTGrid(aptGrid, apPhSeg->X1, y); - } - } else { - if (!(LV_flags & F_ALLOW_OFFGRID)) { - if ((apPhSeg->Y1 - LV_phfig->YAB1) % YGRID) { - wprinth((char*)NULL); - wprintf("Segment \"%s\" (%d,%d) (%d,%d) is NOT on grid (skipped).\n", - apPhSeg->NAME, apPhSeg->X1, apPhSeg->Y1, - apPhSeg->X2, apPhSeg->Y2); - return; - } - } - - yMax = apPhSeg->X2 - (apPhSeg->X2 % XGRID); - yMin = apPhSeg->X1; - if (apPhSeg->X1 % XGRID) yMin += XGRID - (apPhSeg->X1 % XGRID); - - for(y = yMin; y <= yMax; y += XGRID) { - addTGrid(aptGrid, y, apPhSeg->Y1); - } - } -} - - -/* ---------------------------------------------------------------------- - * Function : "TGrid2PORT()". - */ - -static void TGrid2PORT(aplPORT, aptGrid) - ePORT_t **aplPORT; - eGrid_t *aptGrid; -{ - eGrid_t *pGrid; - - - for(pGrid = aptGrid; pGrid != NULL; pGrid = pGrid->Next) { - m_AddPort((*aplPORT), C_PORTITEM_RECT, - m_AddRect(pGrid->x - WIDTH_CALUx / 2, - pGrid->y - WIDTH_CALUx / 2, - pGrid->x + WIDTH_CALUx / 2, - pGrid->y + WIDTH_CALUx / 2)); - } /* End of "pGrid" loop. */ -} - - -/* ---------------------------------------------------------------------- - * Function : "refCon2Name()". - */ - -static char *refCon2Name(asRefCon) - char *asRefCon; -{ - char *c, *e, sIOName[1024]; - - - strcpy(sIOName, asRefCon); - - for(e = (char*)NULL, c = sIOName; *c != (char)0; c++) - if (*c == '_') e = c; - - if (e != (char*)NULL) *e = (char)0; - - - return(namealloc(sIOName)); -} - - -/* ---------------------------------------------------------------------- - * Function : "onGrid()". - */ - -static int onGrid(aX, aY) - long aX, aY; -{ - if ((aX - LV_phfig->XAB1) % XGRID) return(FALSE); - if ((aY - LV_phfig->YAB1) % YGRID) return(FALSE); - - return(TRUE); -} - - -/* ---------------------------------------------------------------------- - * Function : "getLoCon()". - */ - -static locon_list *getLoCon(asName) - char *asName; -{ - locon_list *pLoCon; - - - for(pLoCon = LV_lofig->LOCON; - pLoCon != (locon_list*)NULL; - pLoCon = pLoCon->NEXT) { - if (pLoCon->NAME == asName) return(pLoCon); - } - - /* No matching locon found. */ - return((locon_list *)NULL); -} - - -/* ---------------------------------------------------------------------- - * Function : "SxLib2SYMMETRY()". - */ - -static void SxLib2SYMMETRY() -{ - /* Symmetry generation. */ - if (((LV_phfig->YAB2 - LV_phfig->YAB1) / YSLICE) % 2) { - LV_pMACRO->SYMMETRY = F_SYMMETRY_XY; - } else { - LV_pMACRO->SYMMETRY = F_SYMMETRY_Y; - } -} - - -/* ---------------------------------------------------------------------- - * Function : "AddEmptyPowerPIN()". - */ - -static void AddEmptyPowerPIN(asName) - char *asName; -{ - ePIN_t *pPIN; - char Use; - - - Use = C_USE_NONE; - if (!strncmp(asName, "vdd", 3)) Use = C_USE_POWER; - if (!strncmp(asName, "vss", 3)) Use = C_USE_GROUND; - - - if ((pPIN = getPIN(LV_pMACRO, asName)) == (ePIN_t*)NULL) { - m_AddPin(LV_pMACRO->lPIN, asName); - LV_pMACRO->lPIN->DIRECTION = C_DIRECTION_INOUT; - LV_pMACRO->lPIN->USE = Use; - LV_pMACRO->lPIN->SHAPE = C_SHAPE_FEEDTHRU; - } -} - - -/* ---------------------------------------------------------------------- - * Function : "AddPowerPIN()". - */ - -static void AddPowerPIN(asName, aDir, aLayer, aY, aWidth, aFlags) - char *asName; - char aLayer, aDir; - long aY, aWidth, aFlags; -{ - ePATH_t *pPATH; - ePIN_t *pPIN; - char Use, Shape; - long XO1, XO2, YO1, YO2; - - - pPIN = NULL; /* Shut up "gcc -w" ... */ - - if (aFlags) { - /* Either left or right terminal is asked or both, we need to create - * a PIN if it's not already present. - */ - Use = C_USE_NONE; - if (!strncmp(asName, "vdd", 3)) Use = C_USE_POWER; - if (!strncmp(asName, "vss", 3)) Use = C_USE_GROUND; - - Shape = C_SHAPE_FEEDTHRU; - if (LV_flags & F_POWER_ABUTMENT) - Shape = C_SHAPE_ABUTMENT; - - if ((pPIN = getPIN(LV_pMACRO, asName)) == (ePIN_t*)NULL) { - m_AddPin(LV_pMACRO->lPIN, asName); - LV_pMACRO->lPIN->DIRECTION = C_DIRECTION_INOUT; - LV_pMACRO->lPIN->USE = Use; - LV_pMACRO->lPIN->SHAPE = Shape; - - pPIN = LV_pMACRO->lPIN; - } - - m_AddPort(pPIN->lPORT, C_PORTITEM_LAYER, (long)aLayer); - m_AddPort(pPIN->lPORT, C_PORTITEM_WIDTH, aWidth); - } - - if (aFlags && (LV_flags & F_POWER_ABUTMENT)) { - pPATH = (ePATH_t *)NULL; - - switch(aDir) { - default: - case C_POWER_HORIZONTAL: - m_AddPath(pPATH, LV_phfig->XAB1 + aWidth / 2, aY); - m_AddPath(pPATH, LV_phfig->XAB2 - aWidth / 2, aY); - break; - case C_POWER_VERTICAL: - m_AddPath(pPATH, aY, LV_phfig->YAB1 + aWidth / 2); - m_AddPath(pPATH, aY, LV_phfig->YAB2 - aWidth / 2); - break; - } - - m_AddPort(pPIN->lPORT, C_PORTITEM_PATH, revPATH(pPATH)); - } else { - switch(aDir) { - default: - case C_POWER_HORIZONTAL: - if (aFlags & F_POWER_PIN_LEFT) { - pPATH = (ePATH_t *)NULL; - - m_AddPath(pPATH, LV_phfig->XAB1 + aWidth / 2, aY); - m_AddPath(pPATH, LV_phfig->XAB1 + MBKSCALE(4) + aWidth / 2, aY); - - m_AddPort(pPIN->lPORT, C_PORTITEM_PATH, revPATH(pPATH)); - } - - if (aFlags & F_POWER_PIN_RIGHT) { - pPATH = (ePATH_t *)NULL; - - m_AddPath(pPATH, LV_phfig->XAB2 - MBKSCALE(4) - aWidth / 2, aY); - m_AddPath(pPATH, LV_phfig->XAB2 - aWidth / 2, aY); - - m_AddPort(pPIN->lPORT, C_PORTITEM_PATH, revPATH(pPATH)); - } - - if (aLayer == ALU1) { - XO1 = LV_phfig->XAB1 + ((aFlags & F_POWER_PIN_LEFT) - ? MBKSCALE(13) - : MBK_ALU1_SPACING / 2); - XO2 = LV_phfig->XAB2 - ((aFlags & F_POWER_PIN_RIGHT) - ? MBKSCALE(13) - : MBK_ALU1_SPACING / 2); - YO1 = aY - aWidth / 2; - YO2 = aY + aWidth / 2; - - m_AddObs(LV_pMACRO->lOBS, C_OBSITEM_RECT, - m_AddRect(XO1, YO1, XO2, YO2)); - } - break; - case C_POWER_VERTICAL: - pPATH = (ePATH_t *)NULL; - - m_AddPath(pPATH, aY, LV_phfig->YAB1 + aWidth / 2); - m_AddPath(pPATH, aY, LV_phfig->YAB1 + MBKSCALE(4) + aWidth / 2); - - m_AddPort(pPIN->lPORT, C_PORTITEM_PATH, revPATH(pPATH)); - pPATH = (ePATH_t *)NULL; - - m_AddPath(pPATH, aY, LV_phfig->YAB2 - MBKSCALE(4) - aWidth / 2); - m_AddPath(pPATH, aY, LV_phfig->YAB2 - aWidth / 2); - - m_AddPort(pPIN->lPORT, C_PORTITEM_PATH, revPATH(pPATH)); - break; - } - } -} - - -/* ---------------------------------------------------------------------- - * Function : "SxLib2PowerPINS()". - */ - -static void SxLib2PowerPINS(aLayer, aDir, asSuffix) - char aLayer; - char aDir; - char *asSuffix; -{ - ePow_t *pPow, *plPow; - char sTmp[32], *name; - long XO1, XO2, YO1, YO2, width_top, width_bottom, flags; - - - plPow = buildPow (LV_phfig, aLayer, aDir, asSuffix); - - - if (plPow == (ePow_t*)NULL) { - if (aLayer == ALU1) { - wprinth((char*)NULL); - wprints("\n Can't find any ALU1 power terminals! If this is not a bug"); - wprints(" please consider\n usage of \"-p\" flag.\n"); - } - - return; - } - - - if (aLayer == ALU1) { - if (plPow->Type != C_POWER_ISVSS) { - eprinth (NULL); - eprintf ("\n Bottom power supply is not VSS.\n"); - EXIT (1); - } - } - - - LV_flags |= F_POWER_ABUTMENT; - LV_flags &= ~F_POWER_FEEDTHRU; - - for (pPow = plPow; pPow != NULL; pPow = pPow->Next) { - if (!(pPow->flags & F_POWER_COMPLETE)) { - LV_flags &= ~F_POWER_ABUTMENT; - LV_flags |= F_POWER_FEEDTHRU; - break; - } - } - - - if (aLayer == ALU1) - m_AddObs(LV_pMACRO->lOBS, C_OBSITEM_LAYER, ALU1); - - - /* Power pin generation. */ - for (pPow = plPow; pPow != NULL; pPow = pPow->Next) { - switch (pPow->Type) { - case C_POWER_ISVDD: - /* - * Doesn't exist under SunOS 4.1.4. - * - * snprintf(sTmp, 31, "vdd%s", asSuffix); - */ - sprintf (sTmp, "vdd%s", asSuffix); - name = namealloc (sTmp); - width_bottom = MBK_WIDTH_VDD; - width_top = MBK_WIDTH_VSS; - - break; - default: - case C_POWER_ISVSS: - /* snprintf(sTmp, 31, "vss%s", asSuffix); - */ - sprintf (sTmp, "vss%s", asSuffix); - name = namealloc (sTmp); - width_bottom = MBK_WIDTH_VSS; - width_top = MBK_WIDTH_VDD; - break; - } - - flags = F_POWER_PIN_LEFT | F_POWER_PIN_RIGHT; - - if (aLayer == ALU1) { - if (pPow->min != LV_phfig->XAB1) flags &= ~F_POWER_PIN_LEFT; - if (pPow->max != LV_phfig->XAB2) flags &= ~F_POWER_PIN_RIGHT; - printf ("max %ld XAB2 %ld\n", pPow->max, LV_phfig->XAB2); - } - AddPowerPIN (name, aDir, aLayer, pPow->y, pPow->w, flags); - - /* In case of ALU1 layer add one big obstacle. */ - if ((aLayer == ALU1) && (pPow->Next != NULL)) { - if (pPow->Next->y - pPow->y > - MBK_ALU1_SPACING + (width_bottom + width_top) / 2) { - XO1 = LV_phfig->XAB1 + MBK_ALU1_SPACING / 2; - XO2 = LV_phfig->XAB2 - MBK_ALU1_SPACING / 2; - YO1 = pPow->y + MBK_ALU1_SPACING + width_bottom / 2; - YO2 = pPow->Next->y - MBK_ALU1_SPACING - width_top / 2; - - m_AddObs(LV_pMACRO->lOBS, C_OBSITEM_RECT, - m_AddRect(XO1, YO1, XO2, YO2)); - } - } - } /* End of "pPow" loop. */ - - - freePow (plPow); -} - - -/* ---------------------------------------------------------------------- - * Function : "phref2PINS()". - */ - -static void phref2PINS() -{ - phref_list *pPhRef; - locon_list *pLoCon; - ePIN_t *pPIN; - char *sIOName; - - - for(pPhRef = LV_phfig->PHREF; - pPhRef != (phref_list*)NULL; - pPhRef = pPhRef->NEXT) { - if (pPhRef->FIGNAME == LV_ref_con) { - - /* Get the IO name from the "ref_con" name. */ - sIOName = refCon2Name(pPhRef->NAME); - - /* Find the IO in the behavioral view. */ - if ((pLoCon = getLoCon(sIOName)) == (locon_list*)NULL) { - wprinth((char*)NULL); - wprintf( - "\n Physical terminal \"%s\" doesn't match any ", pPhRef->NAME); - wprints("logical terminal.\n"); - - continue; - } - - /* Skip connectors not on routing grid. */ - if (!onGrid(pPhRef->XREF, pPhRef->YREF)) { - wprinth((char*)NULL); - wprintf("Terminal \"%s\" is NOT on routing grid, skipped.\n", - pPhRef->NAME); - - continue; - } - - /* Add to the list of holes in the obstacle grid. */ - addTGrid(&LV_tHolesALU1, pPhRef->XREF, pPhRef->YREF); - - if ((pPIN = getPIN(LV_pMACRO, sIOName)) == (ePIN_t*)NULL) { - - /* Create a new pin named from "sIOName". */ - m_AddPin(LV_pMACRO->lPIN, sIOName); - LV_pMACRO->lPIN->DIRECTION = MBK2DEF_locondir(pLoCon); - m_AddPort(LV_pMACRO->lPIN->lPORT, C_PORTITEM_LAYER, ALU1); - - pPIN = LV_pMACRO->lPIN; - } - - m_AddPort(pPIN->lPORT, C_PORTITEM_RECT, - m_AddRect(pPhRef->XREF - WIDTH_CALUx / 2, - pPhRef->YREF - WIDTH_CALUx / 2, - pPhRef->XREF + WIDTH_CALUx / 2, - pPhRef->YREF + WIDTH_CALUx / 2)); - } - } /* End of "pPhRef" loop. */ -} - - -/* ---------------------------------------------------------------------- - * Function : "phseg2PINS()". - */ - -static void phseg2PINS() -{ - phseg_list *pPhSeg; - locon_list *pLoCon; - ePIN_t *pPIN; - eGrid_t *tCALU; - - - for(pPhSeg = LV_phfig->PHSEG; - pPhSeg != (phseg_list*)NULL; - pPhSeg = pPhSeg->NEXT) { - if (isvdd(pPhSeg->NAME)) continue; - if (isvss(pPhSeg->NAME)) continue; - - switch(pPhSeg->LAYER) { - case CALU1: - case CALU2: - case CALU3: - case CALU4: - case CALU5: - case CALU6: - /* Find the IO in the behavioral view. */ - if ((pLoCon = getLoCon(pPhSeg->NAME)) == (locon_list*)NULL) { - wprinth((char*)NULL); - wprintf( - "\n Physical terminal \"%s\" doesn't match any ", pPhSeg->NAME); - wprints("logical terminal.\n"); - - continue; - } - - tCALU = (eGrid_t*)NULL; - phseg2TGrid(&tCALU, pPhSeg); - - if ((pPIN = getPIN(LV_pMACRO, pPhSeg->NAME)) == (ePIN_t*)NULL) { - /* Create a new pin named from "pPhSeg->NAME". */ - m_AddPin(LV_pMACRO->lPIN, pPhSeg->NAME); - LV_pMACRO->lPIN->DIRECTION = MBK2DEF_locondir(pLoCon); - - pPIN = LV_pMACRO->lPIN; - } - - m_AddPort(pPIN->lPORT, C_PORTITEM_LAYER, (long)pPhSeg->LAYER); - TGrid2PORT(&(pPIN->lPORT), tCALU); - - break; - } /* End of "pPhSeg->LAYER" switch. */ - } /* End of "pPhSeg" loop. */ -} - - -/* ---------------------------------------------------------------------- - * Function : "SxLib2SignalPINS()". - */ - -static void SxLib2SignalPINS() -{ - phref2PINS(); - phseg2PINS(); -} - - -/* ---------------------------------------------------------------------- - * Function : "insertPIN()". - */ - -static void insertPIN(appHead, appTail, apPIN) - ePIN_t **appHead, **appTail; - ePIN_t *apPIN; -{ - if (*appHead == (ePIN_t*)NULL) { - *appHead = apPIN; - } else { - (*appTail)->Next = apPIN; - } - - *appTail = apPIN; - (*appTail)->Next = (ePIN_t*)NULL; -} - - -/* ---------------------------------------------------------------------- - * Function : "sortPINS()". - */ - -static void sortPINS() -{ - ePIN_t *pPIN, *pTmp, **ppHead; - ePIN_t *pHeadINOUT , *pTailINOUT; - ePIN_t *pHeadOUTPUT, *pTailOUTPUT; - ePIN_t *pHeadINPUT , *pTailINPUT; - ePIN_t *pHeadPOWER , *pTailPOWER; - - - pHeadINOUT = pTailINOUT = (ePIN_t*)NULL; - pHeadOUTPUT = pTailOUTPUT = (ePIN_t*)NULL; - pHeadINPUT = pTailINPUT = (ePIN_t*)NULL; - pHeadPOWER = pTailPOWER = (ePIN_t*)NULL; - - for(pPIN = LV_pMACRO->lPIN; pPIN != (ePIN_t*)NULL;) { - pTmp = pPIN; - pPIN = pPIN->Next; - - switch(pTmp->USE) { - case C_USE_POWER: - case C_USE_GROUND: - insertPIN(&pHeadPOWER, &pTailPOWER, pTmp); - continue; - } /* End of "USE" switch. */ - - switch(pTmp->DIRECTION) { - case C_DIRECTION_INPUT: - insertPIN(&pHeadINPUT, &pTailINPUT, pTmp); - continue; - case C_DIRECTION_OUTPUT: - case C_DIRECTION_TRISTATE: - insertPIN(&pHeadOUTPUT, &pTailOUTPUT, pTmp); - continue; - case C_DIRECTION_INOUT: - case C_DIRECTION_FEEDTHRU: - insertPIN(&pHeadINOUT, &pTailINOUT, pTmp); - continue; - } /* End of "DIRECTION" switch. */ - - eprinth((char*)NULL); - eprintf("\n Pin \"%s\" have no DIRECTION!?\n", pTmp->pinName); - EXIT(1); - } /* End of "pPIN" loop. */ - - /* Rebuild the complete list (in reverse order). */ - ppHead = &(LV_pMACRO->lPIN); - - if (pHeadINOUT != (ePIN_t*)NULL) { - *ppHead = pHeadINOUT; ppHead = &(pTailINOUT->Next); - } - - if (pHeadOUTPUT != (ePIN_t*)NULL) { - *ppHead = pHeadOUTPUT; ppHead = &(pTailOUTPUT->Next); - } - - if (pHeadINPUT != (ePIN_t*)NULL) { - *ppHead = pHeadINPUT; ppHead = &(pTailINPUT->Next); - } - - if (pHeadPOWER != (ePIN_t*)NULL) { - *ppHead = pHeadPOWER; ppHead = &(pTailPOWER->Next); - } - - *ppHead = (ePIN_t*)NULL; -} - - -/* ---------------------------------------------------------------------- - * Function : "revPINPORT()". - */ - -static void revPINPORT() -{ - ePIN_t *pPIN; - - for(pPIN = LV_pMACRO->lPIN; pPIN != (ePIN_t*)NULL; pPIN = pPIN->Next) { - m_RevPort(pPIN->lPORT); - } -} - - -/* ---------------------------------------------------------------------- - * Function : "checkPIN()". - */ - -static void checkPIN() -{ - ePIN_t *pPIN; - ePORT_t *pPORT; - locon_list *pLoCon; - long fError, fPORT; - - - fError = FALSE; - for(pLoCon = LV_lofig->LOCON; - pLoCon != (locon_list*)NULL; - pLoCon = pLoCon->NEXT) { - if (isvdd(pLoCon->NAME)) continue; - if (isvss(pLoCon->NAME)) continue; - - fPORT = FALSE; - - pPIN = getPIN(LV_pMACRO, pLoCon->NAME); - if (pPIN == (ePIN_t*)NULL) { - fError = TRUE; - - eprinth((char*)NULL); - eprintf("\n Logical terminal \"%s\" ", pLoCon->NAME); - eprints("have no physical terminal.\n\n"); - } else { - for(pPORT = pPIN->lPORT; pPORT != NULL; pPORT = pPORT->Next) { - switch(pPORT->Type) { - case C_PORTITEM_RECT: - case C_PORTITEM_PATH: fPORT = TRUE; - } - } - } - - if (fPORT || fError) continue; - - eprinth((char*)NULL); - eprintf("\n Terminal \"%s\" ", pLoCon->NAME); - - if (LV_flags & F_ALLOW_OFFGRID) { - eprints("have no terminals either on grid or offgrid."); - eprints("\n This must be a program bug.\n\n"); - } else - eprints("have no terminals on grid.\n\n"); - fError = TRUE; - } - - if (fError) EXIT(1); -} - - -# if 0 -/* ---------------------------------------------------------------------- - * Function : "SxLib2ALU1OBS()". - */ - -static void SxLib2ALU1OBS() -{ - long XO1, YO1, XO2, YO2; - long iX, iY, iTrack; - - - if (LV_phfig->XAB2 - LV_phfig->XAB1 < 2 * MBK_ALU1_SPACING) - return; - - XO1 = LV_phfig->XAB1 + MBK_ALU1_SPACING; - XO2 = LV_phfig->XAB2 - MBK_ALU1_SPACING; - YO1 = LV_phfig->YAB1 + MBK_ALU1_SPACING + MBK_WIDTH_VSS; - YO2 = LV_phfig->YAB2 - MBK_ALU1_SPACING - MBK_WIDTH_VDD; - - m_AddObs(LV_pMACRO->lOBS, C_OBSITEM_LAYER, ALU1); - m_AddObs(LV_pMACRO->lOBS, C_OBSITEM_RECT, - m_AddRect(XO1, YO1, XO2, YO2)); - - - /* We replace all the "dot" obstacles by one big. */ - for(iY = LV_phfig->YAB1 + (2 * YGRID); - iY < LV_phfig->YAB2 - YGRID ; iY += YGRID) { - - /* Do not put obstacles under the power supplies. */ - iTrack = ((iY - LV_phfig->YAB1) % YSLICE) / YGRID; - if ((iTrack < 2) || (iTrack > 8)) continue; - - for(iX = LV_phfig->XAB1 + XGRID; - iX < LV_phfig->XAB2; iX += XGRID) { - /*if (getTGrid(&LV_tHolesALU1, iX, iY) != (eGrid_t*)NULL) continue;*/ - - XO1 = iX - WIDTH_OBS_ALU1 / 2; - YO1 = iY - HEIGHT_OBS_ALU1 / 2; - XO2 = iX + WIDTH_OBS_ALU1 / 2; - YO2 = iY + HEIGHT_OBS_ALU1 / 2; - - if (iX == LV_phfig->XAB1 + XGRID) XO1 -= LEFTRIGHT_OBS_ALU1; - if (iX == LV_phfig->XAB2 - XGRID) XO2 += LEFTRIGHT_OBS_ALU1; - - m_AddObs(LV_pMACRO->lOBS, C_OBSITEM_RECT, - m_AddRect(XO1, YO1, XO2, YO2)); - } /* End of "iX" loop. */ - } /* End of "iY" loop. */ -} -# endif - - -/* ---------------------------------------------------------------------- - * Function : "SxLib2ALUxOBS()". - */ - -static void SxLib2ALUxOBS(aLayer) - char aLayer; -{ - phseg_list *pPhSeg; - long fComp, fFirst, X1, Y1, X2, Y2, Ext; - - - Ext = getLayerExt(aLayer); - - fFirst = TRUE; - - - for(pPhSeg = LV_phfig->PHSEG; pPhSeg != NULL; pPhSeg = pPhSeg->NEXT) { - fComp = cmpALU(aLayer, pPhSeg->LAYER); - - if (!(fComp & F_EQUAL)) continue; - if ( fComp & F_CALU ) continue; - - switch(pPhSeg->TYPE) { - case LEFT: - case RIGHT: - default: - X1 = pPhSeg->X1 - Ext; - X2 = pPhSeg->X2 + Ext; - Y1 = pPhSeg->Y1 - pPhSeg->WIDTH / 2; - Y2 = pPhSeg->Y2 + pPhSeg->WIDTH / 2; - break; - case UP: - case DOWN: - X1 = pPhSeg->X1 - pPhSeg->WIDTH / 2; - X2 = pPhSeg->X2 + pPhSeg->WIDTH / 2; - Y1 = pPhSeg->Y1 - Ext; - Y2 = pPhSeg->Y2 + Ext; - break; - } /* End of "pPhSeg->TYPE" switch. */ - - if (fFirst) { - fFirst = FALSE; - m_AddObs(LV_pMACRO->lOBS, C_OBSITEM_LAYER, (long)aLayer); - } - - m_AddObs(LV_pMACRO->lOBS, C_OBSITEM_RECT, m_AddRect(X1, Y1, X2, Y2)); - } /* End of "pPhSeg" loop. */ -} - - -/* ---------------------------------------------------------------------- - * Function : "SxLib2MACRO()". - */ - -static eMACRO_t *SxLib2MACRO() -{ - /* Shift the cell so that the AB is at (0,0). */ - shiftphfig (LV_phfig, -LV_phfig->XAB1, -LV_phfig->YAB1); - - LV_pMACRO = allocMACRO(LV_phfig->NAME); - - if ( strncmp(LV_phfig->NAME, "tie_", 4) - && strncmp(LV_phfig->NAME, "rowend_", 4)) - LV_pMACRO->CLASS = C_CLASS_CORE; - else - LV_pMACRO->CLASS = C_CLASS_FEEDTHRU; - - LV_pMACRO->ORIGIN.x = 0; - LV_pMACRO->ORIGIN.y = 0; - /* - * LV_pMACRO->ORIGIN.x = - MBK2DEF_length(LV_phfig->XAB1); - * LV_pMACRO->ORIGIN.y = - MBK2DEF_length(LV_phfig->YAB1); - */ - LV_pMACRO->SIZE.x = MBK2DEF_length(LV_phfig->XAB2 - LV_phfig->XAB1); - LV_pMACRO->SIZE.y = MBK2DEF_length(LV_phfig->YAB2 - LV_phfig->YAB1); - LV_pMACRO->SITE = "core"; - - SxLib2SYMMETRY(); - - if (LV_flags & F_NO_POWER_GEOM) { - long XO1, XO2, YO1, YO2; - - AddEmptyPowerPIN("vdd"); - AddEmptyPowerPIN("vss"); - - m_AddObs(LV_pMACRO->lOBS, C_OBSITEM_LAYER, ALU1); - - XO1 = LV_phfig->XAB1 + MBK_ALU1_SPACING / 2; - XO2 = LV_phfig->XAB2 - MBK_ALU1_SPACING / 2; - YO1 = LV_phfig->YAB1 + MBK_ALU1_SPACING / 2; - YO2 = LV_phfig->YAB2 - MBK_ALU1_SPACING / 2; - - m_AddObs(LV_pMACRO->lOBS, C_OBSITEM_RECT, - m_AddRect(XO1, YO1, XO2, YO2)); - } else { - SxLib2PowerPINS(ALU1, C_POWER_HORIZONTAL, ""); - SxLib2PowerPINS(ALU3, C_POWER_VERTICAL , ""); - } - SxLib2SignalPINS(); - sortPINS(); - revPINPORT(); - checkPIN(); - - /* SxLib2ALU1OBS(); */ - SxLib2ALUxOBS(ALU2); - SxLib2ALUxOBS(ALU3); - SxLib2ALUxOBS(ALU4); - SxLib2ALUxOBS(ALU5); - SxLib2ALUxOBS(ALU6); - m_RevObs(LV_pMACRO->lOBS); - - - return(LV_pMACRO); -} - - -/* ---------------------------------------------------------------------- - * Function : "lefsavesxlophig()". - */ - -extern void lefsavesxlophfig(apLofig, apPhfig, aFlags) - struct lofig *apLofig; - struct phfig *apPhfig; - long aFlags; -{ - FILE *LEF_FILE; - char LEF_name[1024]; - - - LV_ref_ref = namealloc ("ref_ref"); - LV_ref_con = namealloc ("ref_con"); - - LV_lofig = apLofig; - LV_phfig = apPhfig; - LV_flags = aFlags; - - (void)SxLib2MACRO (); - - - sprintf (LEF_name, "%s.lef", apLofig->NAME); - LEF_FILE = fopen (LEF_name, "w+"); - - fprintMACRO (LEF_FILE, LV_pMACRO); - - fclose (LEF_FILE); -} diff --git a/alliance/src/sea/src/LEF_drive_sxlib.h b/alliance/src/sea/src/LEF_drive_sxlib.h deleted file mode 100644 index e3f863e3..00000000 --- a/alliance/src/sea/src/LEF_drive_sxlib.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * $Id: LEF_drive_sxlib.h,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Header : "./LEF_drive_sxlib.h" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# ifndef __LEF_drive_sxlib__ -# define __LEF_drive_sxlib__ - - /* SxLib to LEF conversion options. */ -# define F_ALLOW_OFFGRID 0x00000001 -# define F_NO_POWER_GEOM 0x00000002 -# define F_POWER_ABUTMENT 0x00000004 -# define F_POWER_FEEDTHRU 0x00000008 - - - extern void lefsavesxlophfig (struct lofig *apLofig, - struct phfig *apPhfig, - long aFlags); - - -# endif diff --git a/alliance/src/sea/src/MAC_drive.c b/alliance/src/sea/src/MAC_drive.c deleted file mode 100644 index 5e39a667..00000000 --- a/alliance/src/sea/src/MAC_drive.c +++ /dev/null @@ -1,319 +0,0 @@ -/* - * $Id: MAC_drive.c,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./MAC_drive.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "util_Defs.h" -# include "MAC_drive.h" - - -# define SIZE_SNAME 1024 - - -/* ------------------------------------------------------------------ - * Local variables. - */ - - static FILE *MAC_FILE; - - -/* ------------------------------------------------------------------ - * Local functions. - */ - - static void fillTie __FP((struct phfig *apPhfig)); - - -/* - * /----------------------------------------------------------------\ - * | Functions Definitions | - * \----------------------------------------------------------------/ - */ - -/* ------------------------------------------------------------------ - * Function : "fillTie()". - */ - -static void fillTie(apPhfig) - struct phfig *apPhfig; -{ - /* Fill with spare space with "tie_x0", two pitchs wide with polarization - * contacts for P bulk and N bulk. - */ - fprintf (MAC_FILE, " SROUTE ADDCELL\n"); - fprintf (MAC_FILE, " MODEL tie_x0 PREFIX tiex0\n"); - fprintf (MAC_FILE, " SPIN vdd NET vdd\n"); - fprintf (MAC_FILE, " SPIN vss NET vss\n"); - fprintf (MAC_FILE, " AREA (%ld %ld) (%ld %ld)\n", - MBK2DEF_length (apPhfig->XAB1), - MBK2DEF_length (apPhfig->YAB1), - MBK2DEF_length (apPhfig->XAB2), - MBK2DEF_length (apPhfig->YAB2)); - fprintf (MAC_FILE, " ;\n\n"); - - /* Fill with the one pitch cell "rowend_x0". */ - fprintf (MAC_FILE, " SROUTE ADDCELL\n"); - fprintf (MAC_FILE, " MODEL rowend_x0 PREFIX rowendx0\n"); - fprintf (MAC_FILE, " SPIN vdd NET vdd\n"); - fprintf (MAC_FILE, " SPIN vss NET vss\n"); - fprintf (MAC_FILE, " AREA (%ld %ld) (%ld %ld)\n", - MBK2DEF_length (apPhfig->XAB1), - MBK2DEF_length (apPhfig->YAB1), - MBK2DEF_length (apPhfig->XAB2), - MBK2DEF_length (apPhfig->YAB2)); - fprintf (MAC_FILE, " ;\n\n"); -} - -/* ------------------------------------------------------------------ - * Function : "macPlace()". - */ - -extern void macPlace(apPhfig, apLofig, macName, aPower, aFlags) - struct phfig *apPhfig; - struct lofig *apLofig; - char *macName; - long aPower; - long aFlags; -{ - MAC_FILE = mbkfopen (macName, "mac", "w+"); - if (!MAC_FILE) { - errMBK (NULL); - eprintf ("Can't open SE mac file \"%s.mac\".", macName); - EXIT (1); - } - - - /* Set a nice viewport. */ - fprintf (MAC_FILE, " WINDOW FIT ;\n\n"); - - - if (aFlags & F_MAC_FIXED_PINS) { - fprintf (MAC_FILE, " IOPLACE\n"); - if (aFlags & F_MAC_IOC) { - fprintf (MAC_FILE, " FILENAME %s.ioc\n", apLofig->NAME); - } - fprintf (MAC_FILE, " TOPBOTTOMLAYER L_ALU2\n"); - fprintf (MAC_FILE, " RIGHTLEFTLAYER L_ALU2\n"); - fprintf (MAC_FILE, " ;\n\n"); - } - - - /* Power stripes made of "powmid_x0". */ - if (aPower > 0) { - fprintf (MAC_FILE, " SROUTE ADDCELL\n"); - fprintf (MAC_FILE, " MODEL powmid_x0 PREFIX powmidx0\n"); - fprintf (MAC_FILE, " SPIN vdd NET vdd\n"); - fprintf (MAC_FILE, " SPIN vss NET vss\n"); - fprintf (MAC_FILE, " AREA (%ld %ld) (%ld %ld)\n", - MBK2DEF_length (apPhfig->XAB1), - MBK2DEF_length (apPhfig->YAB1), - MBK2DEF_length (apPhfig->XAB2), - MBK2DEF_length (apPhfig->YAB2)); - fprintf (MAC_FILE, " XNUM %ld\n", aPower); - fprintf (MAC_FILE, " ;\n\n"); - } - - - /* Placement itself. */ - fprintf (MAC_FILE, " SET VARIABLE Qplace.Place.Pin \"concurrent\" ;\n" ); - fprintf (MAC_FILE, " QPLACE NOCONFIG ;\n\n"); - - - /* Fill with tie cells. */ - if (aFlags & F_MAC_FILL_TIE) fillTie (apPhfig); - - - /* Save the placement file. */ - fprintf (MAC_FILE, " OUTPUT DEF FILENAME %s_p.def ;\n\n", apLofig->NAME); - - - /* Fast QUIT : do not save the internal SE data-base. */ - fprintf (MAC_FILE, " FQUIT ;\n"); - - - fclose (MAC_FILE); -} - - -/* ------------------------------------------------------------------ - * Function : "macRoute()". - */ - -extern void macRoute(apPhfig, apLofig, macName, aPower, aFlags) - struct phfig *apPhfig; - struct lofig *apLofig; - char *macName; - long aPower; - long aFlags; -{ - struct eLoseg_s *pLoseg; - struct losig *pLosig; - struct phseg *pPhseg; - long isRouted, isFirst /*, dx */; - char *sigName; - char defSigName[SIZE_SNAME]; - - - MAC_FILE = mbkfopen (macName, "mac", "w+"); - if (!MAC_FILE) { - errMBK (NULL); - eprintf ("Can't open SE mac file \"%s.mac\".", macName); - EXIT (1); - } - - - /* Set a nice viewport. */ - fprintf (MAC_FILE, " WINDOW FIT ;\n\n"); - - - /* Fill with tie cells. */ - if (aFlags & F_MAC_FILL_TIE) fillTie (apPhfig); - - - if (aFlags & F_MAC_FIXED_PINS) { - fprintf (MAC_FILE, " IOPLACE\n"); - if (aFlags & F_MAC_IOC) { - fprintf (MAC_FILE, " FILENAME %s.ioc\n", apLofig->NAME); - } - fprintf (MAC_FILE, " TOPBOTTOMLAYER L_ALU2\n"); - fprintf (MAC_FILE, " RIGHTLEFTLAYER L_ALU2\n"); - fprintf (MAC_FILE, " ;\n\n"); - } - - - if (! (aFlags & F_MAC_NO_POWER)) { - /* Special routing : ALU1 horizontal stripes. */ - fprintf (MAC_FILE, " SROUTE FOLLOWPINS\n"); - fprintf (MAC_FILE, " NET vdd NET vss\n"); - fprintf (MAC_FILE, " LAYER L_ALU1 WIDTH 600 FILL DIRECTION HORIZONTAL\n"); - fprintf (MAC_FILE, " AREA (%ld %ld) (%ld %ld)\n", - MBK2DEF_length (apPhfig->XAB1), - MBK2DEF_length (apPhfig->YAB1), - MBK2DEF_length (apPhfig->XAB2), - MBK2DEF_length (apPhfig->YAB2)); - fprintf (MAC_FILE, " ;\n\n"); - - - /* Special routing : ALU3 vertical stripes. */ - if (findphmodel (apPhfig, namealloc ("powmid_x0"))) { - fprintf (MAC_FILE, " SROUTE FOLLOWPINS\n"); - fprintf (MAC_FILE, " NET vdd NET vss\n"); - fprintf (MAC_FILE, " LAYER L_ALU3 WIDTH 1200 FILL DIRECTION VERTICAL\n"); - fprintf (MAC_FILE, " AREA (%ld %ld) (%ld %ld)\n", - MBK2DEF_length (apPhfig->XAB1), - MBK2DEF_length (apPhfig->YAB1), - MBK2DEF_length (apPhfig->XAB2), - MBK2DEF_length (apPhfig->YAB2)); - fprintf (MAC_FILE, " ;\n\n"); - } - } - - - /* Global routing of regular nets. */ - fprintf (MAC_FILE, " GROUTE ;\n\n"); - - - /* Final routing of regular nets. */ - fprintf (MAC_FILE, " FROUTE "); - - isFirst = TRUE; - - for(pLosig = apLofig->LOSIG; - pLosig != (losig_list*)NULL; pLosig = pLosig->NEXT) { - sigName = getsigname (pLosig); - - if (isvdd (sigName) || isvss (sigName)) continue; - - if (apPhfig) { - isRouted = FALSE; - pLoseg = getloseglist (apPhfig, getsigname (pLosig)); - - for (; pLoseg != NULL; pLoseg = pLoseg->next) { - if (pLoseg->type == LOSEG_SEG) { - pPhseg = (struct phseg*)(pLoseg->MBKobj); - - /* Is this segment touching the AB. */ - /*if ( ( (pPhseg->X1 == apPhfig->XAB1) - * && (pPhseg->Y1 > apPhfig->YAB1) - * && (pPhseg->Y1 < apPhfig->YAB2)) - * || ( (pPhseg->X2 == apPhfig->XAB1) - * && (pPhseg->Y1 > apPhfig->YAB1) - * && (pPhseg->Y1 < apPhfig->YAB2)) - * || ( (pPhseg->X1 == apPhfig->XAB2) - * && (pPhseg->Y1 > apPhfig->YAB1) - * && (pPhseg->Y1 < apPhfig->YAB2)) - * || ( (pPhseg->X2 == apPhfig->XAB2) - * && (pPhseg->Y1 > apPhfig->YAB1) - * && (pPhseg->Y1 < apPhfig->YAB2)) - * - * || ( (pPhseg->Y1 == apPhfig->YAB1) - * && (pPhseg->X1 > apPhfig->XAB1) - * && (pPhseg->X1 < apPhfig->XAB2)) - * || ( (pPhseg->Y2 == apPhfig->YAB1) - * && (pPhseg->X1 > apPhfig->XAB1) - * && (pPhseg->X1 < apPhfig->XAB2)) - * || ( (pPhseg->Y1 == apPhfig->YAB2) - * && (pPhseg->X1 > apPhfig->XAB1) - * && (pPhseg->X1 < apPhfig->XAB2)) - * || ( (pPhseg->Y2 == apPhfig->YAB2) - * && (pPhseg->X1 > apPhfig->XAB1) - * && (pPhseg->X1 < apPhfig->XAB2))) { - * continue; - */ - /* - * dx = 0; - * - * switch (pPhseg->TYPE) { - * case UP: - * case DOWN: dx = pPhseg->Y2 - pPhseg->Y1; break; - * case LEFT: - * case RIGHT: dx = pPhseg->X2 - pPhseg->X1; break; - * } - * - * if (dx == MBKSCALE (5)) continue; - */ - /*} */ - - isRouted = TRUE; break; - } - } - - if (isRouted) { - if (!isFirst) { - fprintf (MAC_FILE, " "); - } - - isFirst = FALSE; - - fprintf (MAC_FILE, "NONETS \"%s\"\n", - MBK2DEF_name (defSigName, sigName)); - } - } - } - fprintf (MAC_FILE, " ;\n\n"); - - - /* Save the routed file. */ - fprintf (MAC_FILE, " OUTPUT DEF FILENAME %s_r.def ;\n\n", apLofig->NAME); - - - /* Fast QUIT : do not save the internal SE data-base. */ - fprintf (MAC_FILE, " FQUIT ;\n"); - - - fclose (MAC_FILE); -} diff --git a/alliance/src/sea/src/MAC_drive.h b/alliance/src/sea/src/MAC_drive.h deleted file mode 100644 index b6bed34a..00000000 --- a/alliance/src/sea/src/MAC_drive.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * $Id: MAC_drive.h,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Header : "./MAC_drive.h" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# ifndef __MAC_drive__ -# define __MAC_drive__ - - -# define F_MAC_IOC 0x00000001 -# define F_MAC_NO_POWER 0x00000002 -# define F_MAC_FIXED_PINS 0x00000004 -# define F_MAC_FILL_TIE 0x00000008 - - - extern void macPlace __FP((struct phfig *apPhfig, - struct lofig *apLofig, - char *macName, - long aPower, - long aFlags)); - extern void macRoute __FP((struct phfig *apPhfig, - struct lofig *apLofig, - char *macName, - long aPower, - long aFlags)); - - -# endif diff --git a/alliance/src/sea/src/Makefile.am b/alliance/src/sea/src/Makefile.am deleted file mode 100644 index 8c31c950..00000000 --- a/alliance/src/sea/src/Makefile.am +++ /dev/null @@ -1,107 +0,0 @@ -## Process this file with automake to produce Makefile.in - -AM_YFLAGS = -d -v -p DEF_grammar -AM_LFLAGS = -s -f -8 -pp -PDEF_grammar -olex.yy.c - -AM_CFLAGS = @ALLIANCE_CFLAGS@ - -bin_PROGRAMS = a2def def2a sxlib2lef -bin_SCRIPTS = sea seroute seplace a2lef - -a2def_LDADD = @ALLIANCE_LIBS@ \ - $(top_builddir)/src/libUtil.a \ - -lMpu -lMlu \ - -lMcl -lMcp \ - -lMal -lMap \ - -lMsl \ - -lMel -lMgl \ - -lMhl \ - -lMvl \ - -lMmg \ - -lMlo \ - -lMph -lMut \ - -lRcn \ - -lAut - -def2a_LDADD = @ALLIANCE_LIBS@ \ - $(top_builddir)/src/libUtil.a \ - -lMpu -lMlu \ - -lMcl -lMcp \ - -lMal -lMap \ - -lMsl \ - -lMel -lMgl \ - -lMhl \ - -lMvl \ - -lMmg \ - -lMlo \ - -lMph -lMut \ - -lRcn \ - -lAut - -sxlib2lef_LDADD = @ALLIANCE_LIBS@ \ - $(top_builddir)/src/libUtil.a \ - -lMpu -lMlu \ - -lMcl -lMcp \ - -lMal -lMap \ - -lMsl \ - -lMel -lMgl \ - -lMhl \ - -lMvl \ - -lMmg \ - -lMlo \ - -lMph -lMut \ - -lRcn \ - -lAut - -noinst_LIBRARIES = libUtil.a - -libUtil_a_SOURCES = util_Floorplan.c \ - util_Inter.c \ - util_LEFDEF.c \ - util_MBK.c \ - util_Power.c \ - util_RTU.c \ - util_Sys.c \ - util_Defs.h \ - GNU_Defs.h - -a2def_SOURCES = DEF_drive.c \ - DEF_drive.h \ - MAC_drive.c \ - MAC_drive.h \ - a2DEF.c - -def2a_SOURCES = DEF_actions.c \ - DEF_actions.h \ - DEF_grammar.h \ - DEF_grammar_yacc.y \ - DEF_grammar_lex.l \ - DEF2a.c - -sxlib2lef_SOURCES = LEF_drive.h \ - LEF_drive.c \ - LEF_drive_sxlib.c \ - LEF_drive_sxlib.h \ - sxlib2LEF.c - -sea: $(srcdir)/sea.sh - cp $< $@ - chmod a+x $@ - -seplace: $(srcdir)/seplace.sh - cp $< $@ - chmod a+x $@ - -seroute: $(srcdir)/seroute.sh - cp $< $@ - chmod a+x $@ - -a2lef: $(srcdir)/a2lef.sh - cp $< $@ - chmod a+x $@ - -EXTRA_DIST = debug.c debugon.h debugoff.h - -CLEANFILES =DEF_grammar_lex.c DEF_grammar_yacc.c \ - y.output DEF_grammar_yacc.h \ - seplace seroute sea a2lef diff --git a/alliance/src/sea/src/a2DEF.c b/alliance/src/sea/src/a2DEF.c deleted file mode 100644 index 35bb8578..00000000 --- a/alliance/src/sea/src/a2DEF.c +++ /dev/null @@ -1,639 +0,0 @@ -/* - * $Id: a2DEF.c,v 1.1 2002/04/25 16:16:19 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./a2DEF.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "util_Defs.h" -# include "DEF_drive.h" -# include "MAC_drive.h" - - -/* ------------------------------------------------------------------ - * Local constants. - */ - -# define A_PHFIG 0x00000001 /* 1 */ -# define A_FIXED_PINS 0x00000002 /* 2 */ -# define A_PAD 0x00000004 /* 4 */ -# define A_LAYERS_3 0x00000008 /* 8 */ -# define A_LAYERS_4 0x00000010 /* 8 */ -# define A_LAYERS_6 0x00000020 /* 16 */ -# define A_FLOORPLAN 0x00000040 /* 32 */ -# define A_MARGIN 0x00000080 /* 64 */ -# define A_ROW_NUMBER 0x00000100 /* 128 */ -# define A_X_SIZE 0x00000200 /* 256 */ -# define A_Y_SIZE 0x00000400 /* 512 */ -# define A_ASPECT_RATIO 0x00000800 /* 1024 */ -# define A_POWER 0x00001000 /* 2048 */ -# define A_EXPAND_PLACE 0x00002000 /* 4096 */ -# define A_EXPAND_ROUTE 0x00004000 /* 4096 */ -# define A_MAC_PLACE 0x00008000 /* 8192 */ -# define A_MAC_ROUTE 0x00010000 /* 16384 */ -# define A_MAC_IOC 0x00020000 /* 16384 */ -# define A_MAC_NO_POWER 0x00040000 /* 16384 */ -# define A_MAC_FILL_TIE 0x00080000 /* 16384 */ -# define A_TRUST_ORIENT 0x00100000 /* 16384 */ - - -/* ---------------------------------------------------------------------- - * Local functions. - */ - -static void printHelp __FP((void)); - - -/* - * /--------------------------------------------------------------------\ - * | Functions Definitions | - * \--------------------------------------------------------------------/ - */ - -/* ---------------------------------------------------------------------- - * Function : "printHelp()". - */ - -static void printHelp() -{ - printf (" o Usage := \"a2def [-h] [-v] [-V]\n"); - printf (" [-b] [-c] [-P] [-3] [-6] [-e] [-E]\n"); - printf (" [--mac-place=]\n"); - printf (" [--mac-route=]\n"); - printf (" [--ioc] [-n] [-t]\n"); - printf (" [-F [--margin= |\n"); - printf (" --row-number= |\n"); - printf (" --x-size= |\n"); - printf (" --y-size= |\n"); - printf (" --aspect-ratio=|\n"); - printf (" --power= ]]\n"); - printf (" [--place=]\n"); - printf (" []\"\n\n"); - printf (" o Options :\n"); - printf (" [-v] := Be verbose.\n"); - printf (" [-V] := Be very verbose.\n"); - printf (" [-h] := Print this message.\n"); - printf (" [-b] := Do not put terminals on the abutment box.\n"); - printf (" [-c] := Put terminals on the abutment box.\n"); - printf (" [-P] := The design have pads.\n"); - printf (" [-3] := Uses only 3 levels of metal.\n"); - printf (" [-6] := Uses all 6 levels of metal.\n"); - printf (" [-e] := Expand AB of the physical figure (place).\n"); - printf (" [-E] := Expand AB of the physical figure (route).\n"); - printf (" [-F] := Generate a floorplan.\n"); - printf (" [-n] := Do not route power supplies (in .mac).\n"); - printf (" [-T] := Trust MBK instance orientations.\n"); - printf (" [-t] := Fill the remaining space with tie (in .mac).\n"); - printf (" [--ioc] := Terminal placement file, used by the mac\n"); - printf (" generator.\n"); - printf (" [--mac-place=] :=\n"); - printf (" Generate a Silicon Ensemble script (.mac)\n"); - printf (" for the placement step.\n"); - printf (" [--mac-route=] :=\n"); - printf (" Generate a Silicon Ensemble script (.mac)\n"); - printf (" for the routing step.\n"); - printf (" [--margin=] :=\n"); - printf (" Set the free area in percentage of the\n"); - printf (" cell area. The resulting area will be\n"); - printf (" equal to CELL_AREA * (1 + /100).\n"); - printf (" Default value 10.\n"); - printf (" [--row-number=] :=\n"); - printf (" Set the preferred number of rows of the\n"); - printf (" design to . The width is computed.\n"); - printf (" [--x-size=] :=\n"); - printf (" Set the preferred width of the design to\n"); - printf (" . is rounded to the pitch\n"); - printf (" (currently 5 lambdas). The height is\n"); - printf (" computed.\n"); - printf (" [--y-size=] :=\n"); - printf (" Set the preferred height of the design to\n"); - printf (" . is rounded to the pitch\n"); - printf (" (currently 50 lambdas). The width is\n"); - printf (" computed.\n"); - printf (" [--aspect-ratio=] :=\n"); - printf (" Set the preferred form factor of the design\n"); - printf (" to .\n"); - printf (" [--power=] :=\n"); - printf (" Set the number of vertical power rail to \n"); - printf (" (default : 1).\n"); - printf (" [--place=] :=\n"); - printf (" The Design is preplaced/prerouted.\n"); - printf (" := The input netlist (mandatory).\n"); - printf (" := The output DEF file.\n"); - printf ("\n" ); -} - - -/* ---------------------------------------------------------------------- - * Function : "main()". - */ - -extern int main(argc, argv) - int argc; - char *argv[]; -{ - struct lofig *pLofig; - struct phfig *pPhfig; - struct loins *pLoins; - char *netlistName, *layoutName, *defName; - int argC, i, optCount; - long VL, argFlags, defFlags, floFlags, macFlags; - long margin, xSize, ySize, power; - double formFactor; - char macPlaceName[1024], macRouteName[1024]; - - - /* Read MBK environment. */ - mbkenv (); - autenv (); - - /* Initialise the "util" module. */ - util_init (C_VerboseLevel2, F_DUMPCORE, "a2DEF"); - - - optCount = 0; - argC = argc; - pPhfig = NULL; - - /* Default options. */ - layoutName = NULL; - defName = NULL; - VL = C_VerboseLevel0; - defFlags = F_LAYERS_6; - floFlags = F_FLOOR_ASPECT_RATIO; - argFlags = 0L; - macFlags = 0L; - margin = 10L; - xSize = 0L; - ySize = 0L; - formFactor = 1.0; - power = 1; - - /* Read the options. */ - for(i = 1; i < argc; i++) { - /* - * fflush (stdout); - * fprintf (stderr, "argFlags := %ld (%s)\n", argFlags, argv[i]); - */ - if (!strcmp (argv[i], "-h")) { printHelp (); exit (0); } - if (!strcmp (argv[i], "-v")) { VL = C_VerboseLevel1; continue; } - if (!strcmp (argv[i], "-V")) { VL = C_VerboseLevel2; continue; } - if (!strcmp (argv[i], "-e")) { argFlags |= A_EXPAND_PLACE; - defFlags |= F_EXPAND_PLACE; - continue; } - if (!strcmp (argv[i], "-E")) { argFlags |= A_EXPAND_ROUTE; - defFlags |= F_EXPAND_ROUTE; - continue; } - - /* Short options. */ - if (!strcmp (argv[i], "-c")) { - argFlags |= A_FIXED_PINS; - defFlags |= F_FIXED_PINS; - /*macFlags |= F_MAC_FIXED_PINS;*/ - continue; - } - - if (!strcmp (argv[i], "-b")) { - argFlags &= ~A_FIXED_PINS; - defFlags &= ~F_FIXED_PINS; - continue; - } - - if (!strcmp (argv[i], "-p")) { - continue; - } - if (!strncmp (argv[i], "--place=", 8)) { - argFlags |= A_PHFIG; - defFlags |= F_PHFIG; - power = 0; - layoutName = namealloc (argv[i] + 8); - continue; - } - - if (!strcmp (argv[i], "-P")) { - argFlags |= A_PAD; - argFlags &= ~A_FIXED_PINS; - defFlags |= F_PAD; - defFlags &= ~F_FIXED_PINS; - continue; - } - - if (!strcmp (argv[i], "-3")) { - argFlags |= A_LAYERS_3; - argFlags &= ~A_LAYERS_4; - argFlags &= ~A_LAYERS_6; - defFlags |= F_LAYERS_3; - defFlags &= ~F_LAYERS_4; - defFlags &= ~F_LAYERS_6; - floFlags |= F_FLOOR_LAYERS_3; - floFlags &= ~F_FLOOR_LAYERS_4; - floFlags &= ~F_FLOOR_LAYERS_6; - continue; - } - - if (!strcmp (argv[i], "-4")) { - argFlags |= A_LAYERS_4; - argFlags &= ~A_LAYERS_3; - argFlags &= ~A_LAYERS_6; - defFlags |= F_LAYERS_4; - defFlags &= ~F_LAYERS_3; - defFlags &= ~F_LAYERS_6; - floFlags |= F_FLOOR_LAYERS_4; - floFlags &= ~F_FLOOR_LAYERS_3; - floFlags &= ~F_FLOOR_LAYERS_6; - continue; - } - - if (!strcmp (argv[i], "-6")) { - argFlags |= A_LAYERS_6; - argFlags &= ~A_LAYERS_3; - defFlags |= F_LAYERS_6; - defFlags &= ~F_LAYERS_3; - floFlags |= F_FLOOR_LAYERS_6; - floFlags &= ~F_FLOOR_LAYERS_3; - continue; - } - - if (!strcmp (argv[i], "--ioc")) { - argFlags |= A_MAC_IOC; - macFlags |= F_MAC_IOC; - continue; - } - - if (!strcmp (argv[i], "-n")) { - argFlags |= A_MAC_NO_POWER; - macFlags |= F_MAC_NO_POWER; - continue; - } - - if (!strcmp (argv[i], "-t")) { - argFlags |= A_MAC_FILL_TIE; - macFlags |= F_MAC_FILL_TIE; - continue; - } - - if (!strcmp (argv[i], "-T")) { - argFlags |= A_TRUST_ORIENT; - defFlags |= F_TRUST_ORIENT; - continue; - } - - if (!strncmp (argv[i], "--mac-place=", 12)) { - argFlags |= A_MAC_PLACE; - strcpy (macPlaceName, argv[i] + 12); - continue; - } - - if (!strncmp (argv[i], "--mac-route=", 12)) { - argFlags |= A_MAC_ROUTE; - strcpy (macRouteName, argv[i] + 12); - continue; - } - - - if (!strcmp (argv[i], "-F")) { argFlags |= A_FLOORPLAN; continue; } - - /* Long options : associated with floorplan. */ - if (!strncmp (argv[i], "--margin=", 9)) { - argFlags |= A_MARGIN; - if (1 != sscanf (argv[i] + 9, "%ld", &margin)) { - eprinth (NULL); - eprintf ("Invalid value.\n"); - printHelp (); - exit (2); - } - if (margin < 0) { - eprinth (NULL); - eprintf ("Negative value (%ld).\n", margin); - printHelp (); - exit (2); - } - continue; - } - - if (!strncmp (argv[i], "--row-number=", 13)) { - optCount += 1; - argFlags |= A_ROW_NUMBER; - floFlags |= F_FLOOR_Y_SIZE; - floFlags &= ~F_FLOOR_ASPECT_RATIO; - if (1 != sscanf (argv[i] + 13, "%ld", &ySize)) { - eprinth (NULL); - eprintf ("Invalid value.\n\n"); - printHelp (); - exit (2); - } - if (ySize <= 0) { - eprinth (NULL); - eprintf ("Negative or null value (%ld).\n", margin); - printHelp (); - exit (2); - } - continue; - } - - if (!strncmp (argv[i], "--y-size=", 9)) { - optCount += 1; - argFlags |= A_Y_SIZE; - floFlags |= F_FLOOR_Y_SIZE; - floFlags &= ~F_FLOOR_ASPECT_RATIO; - if (1 != sscanf (argv[i] + 9, "%ld", &ySize)) { - eprinth (NULL); - eprintf ("Invalid value.\n\n"); - printHelp (); - exit (2); - } - if (ySize <= 0) { - eprinth (NULL); - eprintf ("Negative or null value (%ld).\n", ySize); - printHelp (); - exit (2); - } - ySize /= Y_SLICE; - continue; - } - - if (!strncmp (argv[i], "--x-size=", 9)) { - optCount += 1; - argFlags |= A_X_SIZE; - floFlags |= F_FLOOR_X_SIZE; - floFlags &= ~F_FLOOR_ASPECT_RATIO; - if (1 != sscanf (argv[i] + 9, "%ld", &xSize)) { - eprinth (NULL); - eprintf ("Invalid value.\n\n"); - printHelp (); - exit (2); - } - if (xSize <= 0) { - eprinth (NULL); - eprintf ("Negative or null value (%ld).\n", xSize); - printHelp (); - exit (2); - } - xSize /= X_GRID; - continue; - } - - if (!strncmp (argv[i], "--aspect-ratio=", 15)) { - optCount += 1; - argFlags |= A_ASPECT_RATIO; - floFlags |= F_FLOOR_ASPECT_RATIO; - if (1 != sscanf (argv[i] + 15, "%lf", &formFactor)) { - eprinth (NULL); - eprintf ("Invalid value.\n\n"); - printHelp (); - exit (2); - } - if (formFactor <= 0.0) { - eprinth (NULL); - eprintf ("Negative or null value (%f).\n", formFactor); - printHelp (); - exit (2); - } - continue; - } - - if (!strncmp (argv[i], "--power=", 8)) { - argFlags |= A_POWER; - if (1 != sscanf (argv[i] + 8, "%ld", &power)) { - eprinth (NULL); - eprintf ("Invalid value.\n\n"); - printHelp (); - exit (2); - } - if (power < 0) { - eprinth (NULL); - eprintf ("Negative value (%ld).\n", power); - printHelp (); - exit (2); - } - continue; - } - - if ((argC - i) > 2) { - eprinth (NULL); - eprintf ("Unknown argument \"%s\"\n\n", argv[argC - 1]); - printHelp (); - exit (1); - } - else - break; - } - - if ((argC - i) < 1) { - eprinth (NULL); - eprintf ("Missing netlist name .\n\n"); - printHelp (); - exit (1); - } else { - netlistName = namealloc (argv[i]); - - if ((argC - i) == 2) - defName = namealloc (argv[i + 1]); - else - defName = netlistName; - } - - - if (argFlags & A_FLOORPLAN) { - if (argFlags & A_PHFIG) { - eprinth (NULL); - eprintf ("\n Options -F and -p are mutually exclusive : either you"); - eprintf (" want to make\n a floorplan or you supply a placement file."); - eprintf ("\n"); - exit (1); - } - - if (optCount > 1) { - eprinth (NULL); - eprintf ("\n Options --row-number, --x-size, --y-size and"); - eprintf (" --aspect-ratio\n"); - eprintf ( " are mutually exclusive.\n)"); - exit (1); - } - - if (!optCount) argFlags |= A_ASPECT_RATIO; - } else { - if (argFlags & A_MARGIN) { - wprinth (NULL); - wprintf (" ignored --margin argument, must be used with -F\n"); - } - - if (argFlags & A_X_SIZE) { - wprinth (NULL); - wprintf (" ignored --x-size argument, must be used with -F\n"); - } - - if (argFlags & A_Y_SIZE) { - wprinth (NULL); - wprintf (" ignored --y-size argument, must be used with -F\n"); - } - - if (argFlags & A_ASPECT_RATIO) { - wprinth (NULL); - wprintf (" ignored --aspect-ratio argument, must be used with -F\n"); - } - - if ((argFlags & A_EXPAND_PLACE) && !(argFlags & A_PHFIG)) { - wprinth (NULL); - wprintf (" ignored -e argument, no physical layout.\n"); - } - - if ((argFlags & A_EXPAND_ROUTE) && !(argFlags & A_PHFIG)) { - wprinth (NULL); - wprintf (" ignored -E argument, no physical layout.\n"); - } - } - - - setVL (VL); - - if (VL > C_VerboseLevel0) - alliancebanner( - "a2DEF", "V.RR", "Alliance to DEF converter", - "2000", ALLIANCE_VERSION ); - - printMBKEnv (); - if (argFlags & A_PAD) mprintf1 (" o Forced pad design.\n"); - if (argFlags & A_PHFIG) mprintf1 (" o Preplaced/prerouted design.\n"); - - - mprintf2 (" o Loading \"%s\" (logical).\n", netlistName); - - pLofig = getlofig (netlistName, 'A'); - - if (defFlags & F_PHFIG) { - mprintf2 (" o Loading \"%s\" (physical).\n", layoutName); - pPhfig = getphfig (layoutName, 'A'); - } else - pPhfig = (phfig_list *)NULL; - - - mprintf2 (" o Flattening \"%s\" to the catalog.\n", netlistName); - mprintf2 (" (using MBK_SEPAR := \'%c\' as separator)\n", SEPAR); - if (defFlags & F_PHFIG) - rflattenphfig (pPhfig, YES, YES); - rflattenlofig (pLofig, YES, YES); - - - /* Build a floorplan. */ - if (argFlags & A_FLOORPLAN) { - mprintf2 (" o Making floorplan.\n"); - - pPhfig = makeFloorplan (pLofig, - margin, - xSize, - ySize, - formFactor, - power, - floFlags); - - if (layoutName) pPhfig->NAME = layoutName; - - /*savephfig (pPhfig);*/ - } - - - /* Add ROWS & TRACKS references, if needed. */ - if ((argFlags & A_PHFIG) && (!hasROW (pPhfig))) { - mprintf2 (" o Building default ROWS and TRACKS.\n"); - - buildROWS (pPhfig); - buildTRACKS (pPhfig, defFlags); - } - - - /* Place terminals. */ - mprintf2 (" o Placing terminals.\n"); - /* placeTerms (pLofig, pPhfig); */ - - - if (( (argFlags & A_PHFIG) - || (argFlags & A_FLOORPLAN)) && ( (argFlags & A_EXPAND_PLACE) - || (argFlags & A_EXPAND_ROUTE))) { - mprintf2 (" o Expanding the abutment box.\n"); - - expandFloorplan (pPhfig); - /* savephfig (pPhfig); */ - } - - - /* Try to guess if the design have pads. */ - for (pLoins = pLofig->LOINS; pLoins != NULL; pLoins = pLoins->NEXT) { - if (isPad (pLoins->FIGNAME)) { - defFlags |= F_PAD; - defFlags &= ~F_FIXED_PINS; - - mprintf1 (" o Pads found in this design (%s).\n", - pLoins->FIGNAME); - break; - } - } - - - /* Generate a separate "vdd/vss" for the core and the pads. */ - lofigchain (pLofig); - initSigIndex (pLofig->LOSIG); - if (defFlags & F_PAD) { - splitPowerNet (pLofig, namealloc("vdd")); - splitPowerNet (pLofig, namealloc("vss")); - lofigchain (pLofig); - } - - - /* Build the loseg list. */ - if (defFlags & F_PHFIG) { - phsegchain (pLofig, pPhfig); - } - - - /* Prevent SE to put terminal on power cells. */ - if (pPhfig) protectPowmid (pPhfig); - - - /* Drive the DEF file. */ - defsavelophfig (pLofig, pPhfig, defName, defFlags); - - - /* Drive ".mac" files, if any. */ - if (argFlags & A_MAC_PLACE) { - if (pPhfig) - macPlace (pPhfig, pLofig, macPlaceName, power, macFlags); - else { - eprinth (NULL); - eprintf (" --mac-place= option must be given with"); - eprintf (" [--place] or [-F].\n"); - exit (2); - } - } - if (argFlags & A_MAC_ROUTE) { - if (pPhfig) - macRoute (pPhfig, pLofig, macRouteName, power, macFlags); - else { - eprinth (NULL); - eprintf (" --mac-route= option must be given with"); - eprintf (" [-place] or [-F].\n"); - exit (2); - } - } - - - /* free the loseg list. */ - if (defFlags & F_PHFIG) { - freeloseg (pPhfig); - } - - - exit(0); -} diff --git a/alliance/src/sea/src/a2lef.sh b/alliance/src/sea/src/a2lef.sh deleted file mode 100644 index 905468a5..00000000 --- a/alliance/src/sea/src/a2lef.sh +++ /dev/null @@ -1,427 +0,0 @@ -#!/bin/sh -# -# $Id: a2lef.sh,v 1.1 2002/04/25 16:16:19 jpc Exp $ -# -# /------------------------------------------------------------------\ -# | | -# | A l l i a n c e C A D S y s t e m | -# | S i l i c o n E n s e m b l e / A l l i a n c e | -# | | -# | Author : Jean-Paul CHAPUT | -# | E-mail : alliance-support@asim.lip6.fr | -# | ================================================================ | -# | Script : "./a2LEF.sh" | -# | **************************************************************** | -# | U p d a t e s | -# | | -# \------------------------------------------------------------------/ -# - - -# -------------------------------------------------------------------- -# Constants definitions. - - VL=0 - techFile="" - lLibDir="" - lefFile="" - sx2lef_args="" - cellName="" - - -# /------------------------------------------------------------------\ -# | | -# | Functions Definitions | -# | | -# \------------------------------------------------------------------/ -# -# -------------------------------------------------------------------- -# Function : "vecho()". - - vecho() - { - if [ $1 -le $VL ]; then - if [ "$2" = "-n" ]; then - printf "$3" - else - echo "$2" - fi - fi - } - - -# -------------------------------------------------------------------- -# Function : "title()". - - title() - { - if [ $VL -ge 1 ]; then - echo "" - alcbanner "a2LEF" "V.RR" "Alliance Library to LEF converter" "2000" - echo "" - fi - } - - -# -------------------------------------------------------------------- -# Function : `print_usage()'. - - print_usage() - { - echo "" - echo "" - echo "Usage: a2LEF.sh [--verbose] [--very-verbose] [--help] \\" - echo " [--allow-offgrid] [--fake-power] \\" - echo " <--techno > \\" - echo " <--library [--library ]> \\" - echo " <--lef > \\" - echo " <--cell >" - echo " a2LEF.sh [-vVhop] <-t > \\" - echo " <-l [-l ]> \\" - echo " <-L > \\" - echo " <-c > " - echo "" - echo "Options:" - echo " o [--help|-h] : print this help." - echo " o [--verbose|-v] : be verbose." - echo " o [--very-verbose|-V] : be very verbose :-)." - echo " o [--allow-offgrid|-o] : allow terminals to be offgrid." - echo " o [--fake-power|-p] : do not attempt to generate" - echo " PORT geometries for power pins." - echo " o <--techno|-t > : location of the LEF techno header." - echo " o <--library|-l > : Alliance library directory." - echo " o <--lef|-L > : output LEF file." - echo " o <--cell|-c > : process a single (macro) cell." - echo "" - echo "" - } - - -# -------------------------------------------------------------------- -# Function : `setTechno()'. - - setTechno() - { - aTechFile="$1" - aLEF="$2" - - rm -f $aLEF > /dev/null 2>&1 - cp $aTechFile $aLEF - } - - -# -------------------------------------------------------------------- -# Function : `buildLib()'. - - buildLib() - { - aLibDir="$1" - aLEF="$2" - - if [ ! -d $aLibDir ]; then - echo "a2LEF:error: Library \"$aLibDir\" doesn't exist." - exit 1 - fi - - - MBK_CATA_LIB="$aLibDir"; export MBK_CATA_LIB - - - lCellAp=`(cd $aLibDir; \ls *.vbe)` - - if [ "$lCellAp" = "" ]; then - echo "a2LEF:error: Library \"$aLibDir\" is empty." - exit 1 - fi - - - libName="`echo $aLibDir | sed 's,.*/,,'`" - vecho 1 "" - vecho 1 " o Processing library \"$libName\"." - - - success="$libName.success" - failed="$libName.failed" - log="$libName.log" - failedNB=0 - successNB=0 - - rm -f $success $failed $log > /dev/null 2>&1 - - for cellAp in $lCellAp; do - - cell=`echo $cellAp | sed 's,\.vbe$,,'` - vecho 2 -n " - \"$cell\"... " - - case $cell in - *_sp) pxlib2lef -V $cell >> $log 2>&1; RV=$?;; - *) sxlib2lef -V $sx2lef_args $cell >> $log 2>&1; RV=$?;; - esac - if [ $RV -ne 0 ]; then - - failedNB=`expr $failedNB + 1` - echo "$cell" >> $failed - - vecho 2 "KO." - - else - - echo "" >> $aLEF - cat $cell.lef >> $aLEF - rm -f $cell.lef - - successNB=`expr $successNB + 1` - echo "$cell" >> $success - - vecho 2 "OK." - - fi - - done - - - vecho 1 " o $successNB successful cells." - - - if [ $failedNB -gt 0 ]; then - - echo "" - echo "a2LEF:error:" - echo " $failedNB failed cells in library \"$libName\"." - echo " Please read \"$log\" for detailed explanations." - exit 1 - - fi - } - - -# -------------------------------------------------------------------- -# Function : `closeLib()'. - - closeLib() - { - aLEF="$1" - - echo "" >> $aLEF - echo "END LIBRARY" >> $aLEF - } - - -# /------------------------------------------------------------------\ -# | | -# | Main Part of the Shell Script | -# | | -# \------------------------------------------------------------------/ -# -# -------------------------------------------------------------------- -# Process the command line. - - while [ $# -gt 0 ]; do - - case $1 in - - --help) print_usage; exit 0;; - --verbose) VL=1;; - --very-verbose) VL=2;; - --allow-offgrid) sx2lef_args="$sx2lef_args -o";; - --fake-power) sx2lef_args="$sx2lef_args -p";; - - --techno) - if [ $# -ge 2 ]; then - techFile="$2" - shift - else - echo "a2LEF.sh:error: Missing argument." - print_usage; exit 1 - fi;; - - --library) - if [ $# -ge 2 ]; then - lLibDir="$lLibDir $2" - shift - else - echo "a2LEF.sh:error: Missing argument." - print_usage; exit 1 - fi - if [ ! -z "$cellName" ]; then - echo -n "a2LEF.sh:error: --library and --cell options are" - echo " mutually exclusive." - print_usage; exit 1 - fi;; - - --lef) - if [ $# -ge 2 ]; then - lefFile="$2" - shift - else - echo "a2LEF.sh:error: Missing argument." - print_usage; exit 1 - fi;; - - --cell) - if [ $# -ge 2 ]; then - cellName="$2" - shift - else - echo "a2LEF.sh:error: Missing argument." - print_usage; exit 1 - fi - if [ ! -z "$lLibDir" ]; then - echo -n "a2LEF.sh:error: --library and --cell options are" - echo " mutually exclusive." - print_usage; exit 1 - fi;; - - --*) echo "a2LEF.sh:error: Invalid argument \`$1'." - print_usage; exit 1;; - - -*) lSwitch="$1"; NB=2; CH=`echo $lSwitch | cut -c$NB` - - while [ "$CH" != "" ]; do - - case $CH in - - h) print_usage; exit 0;; - v) VL=1;; - V) VL=2;; - o) sx2lef_args="$sx2lef_args -o";; - p) sx2lef_args="$sx2lef_args -p";; - - t) if [ $# -ge 2 ]; then - techFile="$2" - shift - else - echo "a2LEF.sh:error: Missing argument." - print_usage; exit 1 - fi;; - - l) if [ $# -ge 2 ]; then - lLibDir="$lLibDir $2" - shift - else - echo "a2LEF.sh:error: Missing argument." - print_usage; exit 1 - fi - if [ ! -z "$cellName" ]; then - echo -n "a2LEF.sh:error: --library and --cell options are" - echo " mutually exclusive." - print_usage; exit 1 - fi;; - - L) - if [ $# -ge 2 ]; then - lefFile="$2" - shift - else - echo "a2LEF.sh:error: Missing argument." - print_usage; exit 1 - fi;; - - c) - if [ $# -ge 2 ]; then - cellName="$2" - shift - else - echo "a2LEF.sh:error: Missing argument." - print_usage; exit 1 - fi - if [ ! -z "$lLibDir" ]; then - echo -n "a2LEF.sh:error: --library and --cell options are" - echo " mutually exclusive." - print_usage; exit 1 - fi;; - - *) echo "a2LEF:error: Invalid option \`$CH'." - print_usage; exit 1;; - - esac - - NB=`expr $NB + 1` - CH=`echo $lSwitch | cut -c$NB` - - done;; - - *) echo "a2LEF:error: Invalid option \`$1'." - print_usage; exit 1;; - - esac - - shift - - done - - - title - - - MBK_IN_PH=ap ; export MBK_IN_PH - MBK_IN_LO=vst ; export MBK_IN_LO - MBK_OUT_PH=ap ; export MBK_OUT_PH - MBK_OUT_LO=vst; export MBK_OUT_LO - - - if [ "$techFile" != "" ]; then - if [ ! -f $techFile ]; then - echo "a2LEF:error: Technological file \"$techFile\" doesn't exist." - exit 1 - fi - setTechno $techFile $lefFile - fi - - - if [ -z "$cellName" ]; then - if [ "$lLibDir" = "" ]; then - echo "a2LEF:error: Missing mandatory argument <--library >." - print_usage; exit 1 - fi - - if [ "$lefFile" = "" ]; then - echo "a2LEF:error: Missing mandatory argument <--lef >." - print_usage; exit 1 - fi - - # ------------------------------------------------------------------ - # Library Generation. - - rm -f $lefFile > /dev/null 2>&1 - - for libDir in $lLibDir; do - buildLib $libDir $lefFile - done - - closeLib $lefFile - else - if [ ! -f ${cellName}.ap ]; then - echo "a2LEF:error: Can't find layout file \"${cellName}.ap\"." - print_usage; exit 1 - fi - - if [ ! -f ${cellName}.vbe -a ! -f ${cellName}.vst ]; then - echo "a2LEF:error: Can't find netlist/behavioral file :" - echo " \"${cellName}.vst or \"${cellName}.vbe\"." - print_usage; exit 1 - fi - - log="$cellName.log" - rm -f $log - - vecho 2 -n " - \"$cellName\"... " - sxlib2lef -V $sx2lef_args $cellName >> $log 2>&1; RV=$? - - if [ $RV -ne 0 ]; then - vecho 2 "KO." - else - vecho 2 "OK." - fi - - closeLib ${cellName}.lef - fi - - - -# -------------------------------------------------------------------- -# That's all Folks. - - vecho 2 "" - vecho 2 "" - exit 0 diff --git a/alliance/src/sea/src/debug.c b/alliance/src/sea/src/debug.c deleted file mode 100644 index f70b9578..00000000 --- a/alliance/src/sea/src/debug.c +++ /dev/null @@ -1,73 +0,0 @@ - -/* - * $Id: debug.c,v 1.1 2002/04/25 16:16:19 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./debug.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "util_Defs.h" - - - - - -/* - * /--------------------------------------------------------------------\ - * | Functions Definitions | - * \--------------------------------------------------------------------/ - */ - -/* ---------------------------------------------------------------------- - * Function : "main()". - */ - -extern int main(argc, argv) - int argc; - char *argv[]; -{ - struct lInter_s *pInter; - - - pInter = NULL; - - /* Add the "B" segments. */ - pInter = addinter (pInter, 1, 3); - pInter = addinter (pInter, 5, 7); - pInter = addinter (pInter, 9, 11); - pInter = addinter (pInter, 13, 15); - pInter = addinter (pInter, 17, 19); -# if 0 -# endif - - /* See if the B segments are OK. */ - printinter (pInter); - - /* Add the "A" interval. */ - pInter = addinter (pInter, 4, 16); -# if 0 - pInter = addinter (pInter, 6, 14); - pInter = addinter (pInter, 2, 6); -# endif - - /* See if the "A" segments has been correctly merged. */ - printinter (pInter); - - - /* Free all intervals. */ - freeinter (pInter); - - exit(0); -} diff --git a/alliance/src/sea/src/debugoff.h b/alliance/src/sea/src/debugoff.h deleted file mode 100644 index bfc6bbd6..00000000 --- a/alliance/src/sea/src/debugoff.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * $Id: debugoff.h,v 1.1 2002/04/25 16:16:19 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | D p G e n | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Header : "./debugoff.h" | - * | ************************************************************** | - * | Compile without debug specific code. | - * | | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# ifdef __DBG__ -# undef __DBG__ -# endif -# ifdef __DBG -# undef __DBG -# endif -# define __DBG(code) diff --git a/alliance/src/sea/src/debugon.h b/alliance/src/sea/src/debugon.h deleted file mode 100644 index 15f4eb8b..00000000 --- a/alliance/src/sea/src/debugon.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * $Id: debugon.h,v 1.1 2002/04/25 16:16:19 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | D p G e n | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Header : "./debugon.h" | - * | ************************************************************** | - * | Compile with debug specific code. | - * | | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# ifndef __DBG__ -# define __DBG__ -# endif -# ifdef __DBG -# undef __DBG -# endif -# define __DBG(code) code diff --git a/alliance/src/sea/src/sea.sh b/alliance/src/sea/src/sea.sh deleted file mode 100644 index 083d008b..00000000 --- a/alliance/src/sea/src/sea.sh +++ /dev/null @@ -1,466 +0,0 @@ -#!/bin/sh -# -# $Id: sea.sh,v 1.1 2002/04/25 16:16:20 jpc Exp $ -# -# /------------------------------------------------------------------\ -# | | -# | A l l i a n c e C A D S y s t e m | -# | S i l i c o n E n s e m b l e / A l l i a n c e | -# | | -# | Author : Jean-Paul CHAPUT | -# | E-mail : alliance-support@asim.lip6.fr | -# | ================================================================ | -# | Script : "./sea.sh" | -# | **************************************************************** | -# | U p d a t e s | -# | | -# \------------------------------------------------------------------/ -# - - -# -------------------------------------------------------------------- -# Constants definitions. - - VL=0 - script_SE_init="./se_script_init.mac" - script_SE_load="./se_script_load.mac" - - -# /------------------------------------------------------------------\ -# | | -# | Functions Definitions | -# | | -# \------------------------------------------------------------------/ -# -# -------------------------------------------------------------------- -# Function : "vecho()". - - vecho() - { - if [ $1 -le $VL ]; then - if [ "$2" = "-n" ]; then - printf "$3" - else - echo "$2" - fi - fi - } - - -# -------------------------------------------------------------------- -# Function : "title()". - - title() - { - if [ $VL -ge 1 ]; then - echo "" - alcbanner "Sissi" "1.00" "Alliance Silicon Ensemble Front End" "2000" - echo "" - fi - } - - -# -------------------------------------------------------------------- -# Function : `print_usage()'. - - print_usage() - { - echo "" - echo "" - echo "Usage: sea.sh [--verbose] [--very-verbose] [--help] \\" - echo " [--keep-se] [--keep-tmp] [--no-deflib] \\" - echo " [--memory ] [--ansi] [--batch] \\" - echo " [lef_def_file [lef_def_file]] \\" - echo " sea.sh [-vVhkKNb] [-m ] \\" - echo "" - echo "Options:" - echo " o [--help|-h] : print this help." - echo " o [--verbose|-v] : be verbose." - echo " o [--very-verbose|-V] : be very verbose :-)." - echo " o [--batch|-b] : batch mode." - echo " o [--memory|-m ] : uses Mo for memory. Legal" - echo " memory sizes are 12, 24, 36, 48, 60, 72, 84, 96, 108, 120," - echo " 150, 200, 250, 300, 400, 500, 800, 1200, 1600, 1900." - echo " o [--ansi] :" - echo " run in text mode only (do not start the graphic interface)." - echo " o [--keep-se|-K] : keep SE temporary files." - echo " o [--keep-tmp|-k] : keep SEA temporary files." - echo " o [--no-deflib|-N] :" - echo " Do not load defaults technology, libraries and settings" - echo " (i.e. sxlib & cmos_12)." - echo " o [lef_def_file] :" - echo " LEF or DEF file to load. The files should be given with" - echo " their extention (.lef or .def)." - echo "" - echo "" - } - - -# -------------------------------------------------------------------- -# Function : `set_SE_env()'. - - set_SE_env() - { - OPUS_DIR=/users/soft6/opus/DSM_SE5.2; export OPUS_DIR - - PATH=${PATH}:${OPUS_DIR}/tools/bin - PATH=${PATH}:${OPUS_DIR}/tools.sun4v/bin - PATH=${PATH}:${OPUS_DIR}/tools.sun4v/dfII/bin - PATH=${PATH}:${OPUS_DIR}/tools.sun4v/dsm/bin - PATH=${PATH}:${OPUS_DIR}/frame/bin - PATH=${PATH}:${OPUS_DIR}/bin - export PATH; hash -r - } - - -# -------------------------------------------------------------------- -# Function : `load_LEF_TECHNO_NAME()'. - - load_LEF_TECHNO_NAME() - { - if [ "$LEF_TECHNO_NAME" != "" ]; then - vecho 2 " o Loading LEF_TECHNO_NAME." - else - vecho 2 " o Loading default LEF_TECHNO_NAME." - LEF_TECHNO_NAME=$ALLIANCE_TOP/etc/cmos_12.lef - fi - - vecho 2 " - $LEF_TECHNO_NAME" - vecho 2 "" - add_script_SE_load lef $LEF_TECHNO_NAME \ - $script_SE_init > /dev/null 2>&1 - } - - -# -------------------------------------------------------------------- -# Function : `norm_CATA_DIR()'. - - norm_CATA_DIR() - { - aDir="$1" - - echo `echo $aDir | sed 's,//,/,g - s,/$,,'` - } - - -# -------------------------------------------------------------------- -# Function : `load_MBK_CATA_LIB()'. - - load_MBK_CATA_LIB() - { - vecho 1 " o Loading MBK_CATA_LIB." - NDIR=1 - CATA_dir=`echo ${MBK_CATA_LIB}:END | cut -d ':' -f $NDIR` - - while [ "$CATA_dir" != "END" ]; do - CATA_dir=`norm_CATA_DIR $CATA_dir` - - if [ "$CATA_dir" != "." ]; then - CATA_name=`echo $CATA_dir | sed 's,.*/,,'`.lef - - vecho 2 " - $CATA_dir/${CATA_name}" - if [ ! -f "$CATA_dir/${CATA_name}" ]; then - echo "sea:warning: LEF file not found \"$CATA_dir/${CATA_name}\"." - else - add_script_SE_load lef "$CATA_dir/${CATA_name}" \ - $script_SE_init > /dev/null 2>&1 - fi - fi - - NDIR=`expr $NDIR + 1` - CATA_dir=`echo ${MBK_CATA_LIB}:END | cut -d ':' -f $NDIR` - done - vecho 2 "" - } - - -# -------------------------------------------------------------------- -# Function : `rm_SE_db()'. - - rm_SE_db() - { - rm -f LBRARY.* *.dtp *.rpt *.opt.def *.opt.lef '&1' - } - - -# -------------------------------------------------------------------- -# Function : `rm_SEA_tmp()'. - - rm_SEA_tmp() - { - rm -f $script_SE_init $script_SE_load - } - - -# -------------------------------------------------------------------- -# Function : `clean_sea()'. - - clean_sea() - { - if [ "$TAIL_pid" != "" ]; then kill -KILL $TAIL_pid; fi - - if [ "$keepSE" = "n" ]; then rm_SE_db; fi - if [ "$keepTmp" = "n" ]; then rm_SEA_tmp; fi - } - - -# -------------------------------------------------------------------- -# Function : `abort_sea()'. - - abort_sea() - { - clean_sea - - exit 1 - } - - -# -------------------------------------------------------------------- -# Function : `add_script_SE_init()'. - - add_script_SE_init() - { - aScript="$1" - aMAC="$2" - - if [ ! -f "$aScript" ]; then - echo "sea.sh:error: Script not found: \"$aScript\"." - exit 1 - fi - - echo " EXEC $aScript ;" >> $aMAC - } - - -# -------------------------------------------------------------------- -# Function : `add_script_SE_load()'. - - add_script_SE_load() - { - aType="$1" - aFile="$2" - aMAC="$3" - - vecho 2 " - LEF/DEF/mac to load : \"$aFile\"." - - if [ ! -f "$aFile" ]; then - echo "sea.sh:error: LEF/DEF/mac not found: \"$aFile\"." - exit 1 - fi - - case $aType in - "lef") echo " INPUT LEF FILENAME \"$aFile\" ;" >> $aMAC;; - "def") echo " INPUT DEF FILENAME \"$aFile\" ;" >> $aMAC;; - "mac") echo " EXEC \"$aFile\" ;" >> $aMAC;; - *) echo "sea.sh(add_script_SE_load):error:" - echo " Invalid type \"$aType\"." - exit 1;; - esac - } - - -# /------------------------------------------------------------------\ -# | | -# | Main Part of the Shell Script | -# | | -# \------------------------------------------------------------------/ -# - - -# SIGINT : 2 (^C). -# SIGQUIT : 3 -# SIGTERM : 15 (sent from a kill). - trap abort_sea 2 3 15 - - -# -------------------------------------------------------------------- -# Process the command line. - - - devel="n" - keepSE="n" - keepTmp="n" - defLib="y" - argMemory="" - argJNL="-j=sea.jnl" - argGD="" - argBatch="" - - - rm -f $script_SE_init - rm -f $script_SE_load - - - while [ $# -gt 0 ]; do - - case $1 in - --devel) devel="y";; - --help) print_usage; exit 0;; - --verbose) VL=1;; - --very-verbose) VL=2;; - --keep-se) keepSE="y";; - --keep-tmp) keepTmp="y";; - --no-deflib) defLib="n";; - --ansi) argGD="-gd=ansi";; - --batch) argBatch="-b";; - --memory) - if [ $# -ge 2 ]; then - argMemory="-m=$2" - shift - else - echo "sea.sh:error: Missing argument." - print_usage; exit 1 - fi;; - - --*) echo "sea.sh:error: Invalid option \`$1'." - print_usage; exit 1;; - - -*) lSwitch="$1"; NB=2; CH=`echo $lSwitch | cut -c$NB` - - while [ "$CH" != "" ]; do - case $CH in - D) devel="y";; - h) print_usage; exit 0;; - v) VL=1;; - V) VL=2;; - K) keepSE="y";; - k) keepTmp="y";; - N) defLib="n";; - a) argGD="-gd=ansi";; - b) argBatch="-b";; - m) if [ $# -ge 2 ]; then - argMemory="-m=$2" - shift - else - echo "sea.sh:error: Missing argument." - print_usage; exit 1 - fi;; - - *) echo "sea.sh:error: Invalid option \`$CH'." - print_usage; exit 1;; - esac - - NB=`expr $NB + 1` - CH=`echo $lSwitch | cut -c$NB` - done;; - - *) # Unmatched argument, find if this is a LEF, DEF or mac file. - if echo "$1" | grep '\.lef$' > /dev/null 2>&1; then - add_script_SE_load lef "$1" $script_SE_load - else if echo "$1" | grep '\.def$' > /dev/null 2>&1; then - add_script_SE_load def "$1" $script_SE_load - else if echo "$1" | grep '\.mac$' > /dev/null 2>&1; then - add_script_SE_load mac "$1" $script_SE_load - else - echo "sea.sh:error: Invalid argument: \"$1\"." - print_usage; exit 1 - fi; fi; fi - ;; - esac - - shift - done - - - title - - -# -------------------------------------------------------------------- -# Consistency checks. - - - if [ -z "$ALLIANCE_TOP" ]; then - echo "sea.sh:error: \$ALLIANCE_TOP is not set, please set your Alliance" - echo " environment." - exit 1 - fi - if [ -z "$ALLIANCE_OS" ]; then - echo "sea.sh:error: \$ALLIANCE_OS is not set, please set your Alliance" - echo " environment." - exit 1 - fi - - if [ "$ALLIANCE_OS" != "Solaris" ]; then - echo "sea.sh:error: Must be run only under Solaris OS." - echo " (current OS : \"$ALLIANCE_OS\")" - exit 1 - fi - - - if [ "$devel" = "y" ]; then - ALLIANCE_TOP="/users/cao/jpc/alliance/archi/$ALLIANCE_OS" - - echo "WARNING:" - echo "WARNING: You are using the developement version." - echo "WARNING: Resetting \$ALLIANCE_TOP to \"$ALLIANCE_TOP\"." - echo "WARNING:" - echo "" - echo "" - fi - - -# -------------------------------------------------------------------- -# Script at work. - - - rm_SE_db - set_SE_env - - if [ "$defLib" = "y" ]; then - vecho 2 " o Loading defaults settings." - vecho 2 "" - add_script_SE_init $ALLIANCE_TOP/etc/se_defaults.mac $script_SE_init - - load_LEF_TECHNO_NAME - load_MBK_CATA_LIB - fi - if [ -f "$script_SE_load" ]; then - cat "$script_SE_load" >> "$script_SE_init" - fi - - vecho 1 " o Running Silicon Ensemble." - if [ ! -f "$script_SE_init" ]; then - sedsm $argMemory $argJNL $argGD $argBatch & - SE_pid="$!" - - if [ $VL -ge 2 ]; then - sleep 2; tail -f sea.jnl & - TAIL_pid="$!" - fi - wait $SE_pid - else - if [ "$argBatch" != "" ]; then - if [ $VL -ge 2 ]; then - echo " o Silicon Ensemble output follow (in 2s)." - - (sleep 5; exec tail -f sea.jnl) & - TAIL_pid="$!" - fi - - SE_pid=`sedsm $argMemory \ - $argJNL \ - $argGD \ - $argBatch \ - "EXEC $script_SE_init ;" 2>&1 > /dev/null |\ - sed '1d - s,.*\[\([0-9]*\)\] Forking.*,\1,'` - else - sedsm $argMemory $argJNL $argGD "EXEC $script_SE_init ;" - fi - - #echo "$SE_pid" > SE_pid - #echo " o SE has forked." - - fi - - - clean_sea - - -# -------------------------------------------------------------------- -# That's all Folks. - - vecho 2 "" - vecho 2 "" - exit 0 diff --git a/alliance/src/sea/src/seplace.sh b/alliance/src/sea/src/seplace.sh deleted file mode 100755 index 0a6da0d7..00000000 --- a/alliance/src/sea/src/seplace.sh +++ /dev/null @@ -1,463 +0,0 @@ -#!/bin/sh -# -# $Id: seplace.sh,v 1.1 2002/04/25 16:16:20 jpc Exp $ -# -# /------------------------------------------------------------------\ -# | | -# | A l l i a n c e C A D S y s t e m | -# | S i l i c o n E n s e m b l e / A l l i a n c e | -# | | -# | Author : Jean-Paul CHAPUT | -# | E-mail : alliance-support@asim.lip6.fr | -# | ================================================================ | -# | Script : "./seplace.sh" | -# | **************************************************************** | -# | U p d a t e s | -# | | -# \------------------------------------------------------------------/ -# - - -# -------------------------------------------------------------------- -# Constants definitions. - - VL=0 - LOG="./seplace.log" - DEF_UNITS=100 - - -# /------------------------------------------------------------------\ -# | | -# | Functions Definitions | -# | | -# \------------------------------------------------------------------/ -# -# -------------------------------------------------------------------- -# Function : "vecho()". - - vecho() - { - if [ $1 -le $VL ]; then - if [ "$2" = "-n" ]; then - printf "$3" - else - echo "$2" - fi - fi - } - - -# -------------------------------------------------------------------- -# Function : "title()". - - title() - { - #if [ $VL -ge 1 ]; then - # echo "" - alcbanner "SEplace" "1.00" \ - "Alliance Silicon Ensemble Placer Front End" "2000" - echo "" - #fi - } - - -# -------------------------------------------------------------------- -# Function : `print_usage()'. - - print_usage() - { - echo "" - echo "" - echo "Usage: sea.sh [--verbose|-v] [--very-verbose|-V] [--help|-h] \\" - echo " [--memory=] \\" - echo " [--ioc] [--4] [--all] [--partial-place=] \\" - echo " [--rows=] [--power=] [--margin=] \\" - echo " " - echo "" - echo "Options:" - echo " o [--help] : Print this help." - echo " o [--verbose] : Be verbose." - echo " o [--very-verbose] : Be very verbose :-)." - echo " o [--all] : Sets the number of routing layers avalai-" - echo " bles to the router to 6. By default only 3 will be used." - echo " o [--4] : Uses ALU2, ALU3 & ALU4." - echo " o [--memory=] : Sets the amount of memory used by" - echo " Silicon Ensemble. Avalaible are : " - echo " 12, 24, 36, 48, 60, 72, 84, 96, 108, 120, 150, 200, 250," - echo " 300, 400, 500, 800, 1200, 1600, 1900." - echo " o [--partial-place=] :" - echo " The design is already partially placed (there must be a" - echo " physical view describing this partial placement)." - echo " o [--ioc] : Load a terminal placement file." - echo " (named .ioc)." - echo " o [--rows=] : The placement will have rows." - echo " (by default the layout will have an aspect ratio of 1)" - echo " o [--power=] : The design will have vertical power" - echo " stripes (each stripe have a width of 35l)." - echo " o [--margin=] :" - echo " The amount of free area added, in percentage of the cells" - echo " area. The resulting area will be equal to" - echo " CELL_AREA * (1 + /100). Default value : 10." - echo " o : The netlist name (mandatory)." - echo " o : The resulting layout name (mandatory)." - echo " By default the same as the netlist name, will erase any" - echo " pre-placement." - echo "" - echo "" - } - - -# -------------------------------------------------------------------- -# Function : `log_exec()'. - - log_exec() - { - eval "$1" >> $LOG 2>&1 - value="$?" - if [ $value -ne 0 ]; then - echo "seplace.sh: \"$1\"." - echo "seplace.sh:error: command failed." - exit 1 - fi - return $value - } - - -# -------------------------------------------------------------------- -# Function : `MBK_env()'. - - MBK_env() - { - vecho 1 " o Current Alliance environment:" - vecho 1 " - ALLIANCE_TOP : ${ALLIANCE_TOP-not set}" - vecho 1 " - ALLIANCE_OS : ${ALLIANCE_OS-not set}" - vecho 1 " o Current MBK environment:" - vecho 1 " - MBK_IN_LO : ${MBK_IN_LO-not set}" - vecho 1 " - MBK_OUT_LO : ${MBK_OUT_LO-not set}" - vecho 1 " - MBK_IN_PH : ${MBK_IN_PH-not set}" - vecho 1 " - MBK_OUT_PH : ${MBK_OUT_PH-not set}" - vecho 1 " - MBK_WORK_LIB : ${MBK_WORK_LIB-not set}" - vecho 1 -n " - MBK_CATA_LIB : " - - if [ -z "$MBK_CATA_LIB" ]; then - vecho 1 "not set" - else - STRING=`echo ${MBK_CATA_LIB} | \ - awk 'BEGIN { FS=":"; } \ - { for( i=1; i<=NF; i++) { \ - printf("%s\n", $i); \ - if (i < NF) \ - printf(" "); \ - } \ - }' -` - vecho 1 "$STRING" - fi - - vecho 1 " - MBK_CATAL_NAME : ${MBK_CATAL_NAME-not set}" - vecho 1 " - MBK_VDD : ${MBK_VDD-not set}" - vecho 1 " - MBK_VSS : ${MBK_VSS-not set}" - vecho 1 " - RDS_TECHNO_NAME : ${RDS_TECHNO_NAME-not set}" - vecho 1 "" - vecho 1 "" - } - - -# -------------------------------------------------------------------- -# Function : `get_number()'. - - get_number() - { - number=`echo $1 | cut -d '=' -f 2` - - #notDigit=`echo $number | sed 's,[0-9],,'` - #if [ "$notDigit" != "" ]; then echo $noDigit >&2; exit 1; fi - - echo $number - } - - -# -------------------------------------------------------------------- -# Function : `get_string()'. - - get_string() - { - string=`echo $1 | cut -d '=' -f 2` - - echo $string - } - - -# -------------------------------------------------------------------- -# Function : `rm_SEplace_tmp()'. - - rm_SEplace_tmp() - { - RM_PREV_RUN="n" - - while [ $# -gt 0 ]; do - case $1 in - "--previous-run") RM_PREV_RUN="y";; - esac - - shift - done - - rm -f ${netlistName}_p.mac - rm -f ${netlistName}.def - rm -f ${netlistName}_p.def - - if [ "$RM_PREV_RUN" = "y" ]; then - rm -f ${placementName}_p.$MBK_IN_PH - fi - } - - -# /------------------------------------------------------------------\ -# | | -# | Main Part of the Shell Script | -# | | -# \------------------------------------------------------------------/ -# - - - rm -f $LOG - - - title - - - if [ "`uname`" != "SunOS" ]; then - echo "seplace.sh:error: This progam must be run under Solaris." - exit 1 - fi - - -# -------------------------------------------------------------------- -# Process the command line. - - - keepTmp="n" - margin="10" - powerNumber="1" - rowNumber="" - argRows="" - memNumber="150" - netlistName="" - partialName="" - placementName="" - ioc="n" - argVL="" - argLayers="-3" - argsA2DEF="-V -t -c -e" - argsDEF2A="-V -p -S -i -b" - argsSEA="--batch --ansi" -# argsSEA="-V" - - - if [ $# -eq 0 ]; then - print_usage - exit 0 - fi - - - while [ $# -gt 0 ]; do - - case $1 in - --keep-tmp) keepTmp="y";; - --devel) argsSEA="$argsSEA --devel";; - --help) print_usage; exit 0;; - --verbose) VL=1; argVL="-v";; - --very-verbose) VL=2; argVL="-V";; - --ioc) ioc="y";; - --all) argLayers="-6";; - --4) argLayers="-4";; - --partial-place=*) partialName=`get_string $1`;; - --rows=*) rowNumber=`get_number $1` - if [ $? -ne 0 ]; then - echo -n "seplace.sh:error: Bad number `get_number $1`" - echo " in argument \"$1\"." - print_usage - exit 1 - fi;; - --margin=*) margin=`get_number $1` - if [ $? -ne 0 ]; then - echo -n "seplace.sh:error: Bad number" - echo " in argument \"$1\"." - print_usage - exit 1 - fi;; - --power=*) powerNumber=`get_number $1` - if [ $? -ne 0 ]; then - echo -n "seplace.sh:error: Bad number" - echo " in argument \"$1\"." - print_usage - exit 1 - fi;; - --memory=*) memNumber=`get_number $1` - if [ $? -ne 0 ]; then - echo -n "seplace.sh:error: Bad number" - echo " in argument \"$1\"." - print_usage - exit 1 - fi;; - - --*) echo "seplace.sh:error: Invalid option \`$1'." - print_usage; exit 1;; - - -*) lSwitch="$1"; NB=2; CH=`echo $lSwitch | cut -c$NB` - - while [ "$CH" != "" ]; do - case $CH in - h) print_usage; exit 0;; - v) VL=1; argVL="-v";; - V) VL=2; argVL="-V";; - k) keepTmp="y";; - - *) echo "sea.sh:error: Invalid option \`$CH'." - print_usage; exit 1;; - esac - - NB=`expr $NB + 1` - CH=`echo $lSwitch | cut -c$NB` - done;; - - *) # Unmatched argument, this is the netlist name. - if [ "$netlistName" = "" ]; then - netlistName=$1 - else if [ "$placementName" = "" ]; then - placementName=$1 - else - echo "seplace.sh:warning: Ignored extra argument \`$1'." - fi; fi - ;; - esac - - shift - done - - -# -------------------------------------------------------------------- -# Consistency checks. - - - if [ "$netlistName" = "" ]; then - echo "seplace.sh:error: Missing argument." - print_usage - exit 1 - else - if [ ! -f "$netlistName".$MBK_IN_LO ]; then - echo -n "seplace.sh:error: Can't find netlist file" - echo " \"$netlistName.$MBK_IN_LO\"." - print_usage; exit 1 - fi - fi - - - if [ "$placementName" = "" ]; then - echo "seplace.sh:error: Missing argument." - print_usage - exit 1 - fi - - - if [ "$partialName" != "" -a ! -f "$partialName".$MBK_IN_PH ]; then - echo -n "seplace.sh:error: Can't find pre-placement file" - echo " \"$partialName.$MBK_IN_PH\"." - print_usage; exit 1 - fi - - - if [ "$ioc" = "y" -a ! -f "$netlistName.ioc" ]; then - echo -n "seplace.sh:error: Can't find terminal placement file" - echo " \"$netlistName.ioc\"." - print_usage; exit 1 - fi - - - if [ "$partialName" != "" -a "$rowNumber" != "" ]; then - echo "seplace.sh:warning: As a partial placement is supplied, the row" - echo " number will be ignored." - print_usage; exit 1 - fi - - -# -------------------------------------------------------------------- -# Script at work. - - - MBK_env - rm_SEplace_tmp --previous-run - - - argsA2DEF="$argsA2DEF $argLayers" - - - vecho 1 " o Netlist file is := \"$netlistName.$MBK_IN_LO\"." - argsA2DEF="$argsA2DEF --mac-place=${netlistName}_p" - - - if [ "$partialName" != "" ]; then - vecho 1 " o Partial placement file is := \"$partialName.$MBK_IN_PH\"." - argsA2DEF="$argsA2DEF --place=$partialName" - rowNumber="" - margin="0" - else - vecho 1 " o Automatic floorplan generation." - argsA2DEF="$argsA2DEF -F" - fi - - - if [ "$rowNumber" != "" ]; then - vecho 2 " - placement will have $rowNumber rows." - argsA2DEF="$argsA2DEF --row-number=$rowNumber" - fi - - - if [ "$margin" != "0" ]; then - vecho 2 " - Increasing cell area by $margin percent." - argsA2DEF="$argsA2DEF --margin=$margin" - fi - - - if [ "$powerNumber" != "1" ]; then - vecho 2 " - placement will have $powerNumber power." - argsA2DEF="$argsA2DEF --power=$powerNumber" - fi - - - if [ "$ioc" = "y" ]; then - vecho 1 " o IO placement file is := \"$netlistName.ioc\"." - argsA2DEF="$argsA2DEF --ioc" - fi - - - vecho 1 " o Silicon ensemble memory used := $memNumber." - argsSEA="$argsSEA --memory $memNumber" - - - vecho 2 "" - vecho 2 " o Translating \"$netlistName\" into DEF format." - log_exec "a2def $argsA2DEF $netlistName" - - - vecho 2 "" - vecho 2 " o Silicon Ensemble." - - - vecho 2 " - Running SEA/SE..." - sea $argVL $argsSEA $netlistName.def ${netlistName}_p.mac - cat sea.jnl >> $LOG - rm sea.jnl - - - vecho 2 "" - vecho 2 " o Translating \"$netlistName\" back into Alliance format." - log_exec "def2a $argsDEF2A ${netlistName}_p ${placementName}" - - - if [ "$keepTmp" = "n" ]; then - rm_SEplace_tmp - fi - - - exit 0 diff --git a/alliance/src/sea/src/seroute.sh b/alliance/src/sea/src/seroute.sh deleted file mode 100755 index 0388182c..00000000 --- a/alliance/src/sea/src/seroute.sh +++ /dev/null @@ -1,430 +0,0 @@ -#!/bin/sh -# -# $Id: seroute.sh,v 1.1 2002/04/25 16:16:20 jpc Exp $ -# -# /------------------------------------------------------------------\ -# | | -# | A l l i a n c e C A D S y s t e m | -# | S i l i c o n E n s e m b l e / A l l i a n c e | -# | | -# | Author : Jean-Paul CHAPUT | -# | E-mail : alliance-support@asim.lip6.fr | -# | ================================================================ | -# | Script : "./seroute.sh" | -# | **************************************************************** | -# | U p d a t e s | -# | | -# \------------------------------------------------------------------/ -# - - -# -------------------------------------------------------------------- -# Constants definitions. - - VL=0 - LOG="./seroute.log" - DEF_UNITS=100 - - -# /------------------------------------------------------------------\ -# | | -# | Functions Definitions | -# | | -# \------------------------------------------------------------------/ -# -# -------------------------------------------------------------------- -# Function : "vecho()". - - vecho() - { - if [ $1 -le $VL ]; then - if [ "$2" = "-n" ]; then - printf "$3" - else - echo "$2" - fi - fi - } - - -# -------------------------------------------------------------------- -# Function : "title()". - - title() - { - #if [ $VL -ge 1 ]; then - # echo "" - alcbanner "SEroute" "1.00" \ - "Alliance Silicon Ensemble Router Front End" "2000" - echo "" - #fi - } - - -# -------------------------------------------------------------------- -# Function : `print_usage()'. - - print_usage() - { - echo "" - echo "" - echo "Usage: seroute [--verbose|-v] [--very-verbose|-V] [--help|-h] \\" - echo " [--memory=] \\" - echo " [--core] [--ring] [--ioc] [--all] [--4] \\" - echo " [--trust-orient] [--no-power] [--generator] \\" - echo " [--place=] \\" - echo " " - echo "" - echo "Options:" - echo " o [--help] : Print this help." - echo " o [--verbose] : Be verbose." - echo " o [--very-verbose] : Be very verbose :-)." - echo " o [--memory=] : Sets the amount of memory used by" - echo " Silicon Ensemble. Avalaible are : " - echo " 12, 24, 36, 48, 60, 72, 84, 96, 108, 120, 150, 200, 250," - echo " 300, 400, 500, 800, 1200, 1600, 1900." - echo " o [--ioc] : Load a terminal placement file." - echo " (named .ioc)." - echo " o [--all] : Use all 6 layers for routing." - echo " o [--4] : Use only ALU2 to ALU4 for routing." - echo " o [--core] : Route terminals to the edge of the" - echo " abutment-box." - echo " o [--ring] : Produce a layout suitable for ring." - echo " This option implies \"--core\"." - echo " o [--trust-orient] : Trust MBK orientation, i.e. allow cells" - echo " without regular vdd/vss power rails." - echo " o [--no-power] : Do not route power rails, this implies" - echo " that they must be pre-routed by the user." - echo " o [--generator] : Route a user build block like a RAM" - echo " or a ROM. This allow the generator leaf cells not to" - echo " comply strictly to the SxLib requirements. This option is" - echo " equivalent to --no-power --trust-orient." - echo " o [--place=] : The name of the placement file," - echo " (if different from the netlist)." - echo " o : The netlist name (mandatory)." - echo " o : The resulting layout name (mandatory)." - echo "" - echo "" - } - - -# -------------------------------------------------------------------- -# Function : `get_number()'. - - get_number() - { - number=`echo $1 | cut -d '=' -f 2` - - #notDigit=`echo $number | sed 's,[0-9],,'` - #if [ "$notDigit" != "" ]; then echo $noDigit >&2; exit 1; fi - - echo $number - } - - -# -------------------------------------------------------------------- -# Function : `log_exec()'. - - log_exec() - { - eval "$1" >> $LOG 2>&1 - value="$?" - if [ $value -ne 0 ]; then - echo "seroute.sh: \"$1\"." - echo "seroute.sh:error: command failed." - exit 1 - fi - return $value - } - - -# -------------------------------------------------------------------- -# Function : `MBK_env()'. - - MBK_env() - { - vecho 1 " o Current Alliance environment:" - vecho 1 " - ALLIANCE_TOP : ${ALLIANCE_TOP-not set}" - vecho 1 " - ALLIANCE_OS : ${ALLIANCE_OS-not set}" - vecho 1 " o Current MBK environment:" - vecho 1 " - MBK_IN_LO : ${MBK_IN_LO-not set}" - vecho 1 " - MBK_OUT_LO : ${MBK_OUT_LO-not set}" - vecho 1 " - MBK_IN_PH : ${MBK_IN_PH-not set}" - vecho 1 " - MBK_OUT_PH : ${MBK_OUT_PH-not set}" - vecho 1 " - MBK_WORK_LIB : ${MBK_WORK_LIB-not set}" - vecho 1 -n " - MBK_CATA_LIB : " - - if [ -z "$MBK_CATA_LIB" ]; then - vecho 1 "not set" - else - STRING=`echo ${MBK_CATA_LIB} | \ - awk 'BEGIN { FS=":"; } \ - { for( i=1; i<=NF; i++) { \ - printf("%s\n", $i); \ - if (i < NF) \ - printf(" "); \ - } \ - }' -` - vecho 1 "$STRING" - fi - - vecho 1 " - MBK_CATAL_NAME : ${MBK_CATAL_NAME-not set}" - vecho 1 " - MBK_VDD : ${MBK_VDD-not set}" - vecho 1 " - MBK_VSS : ${MBK_VSS-not set}" - vecho 1 " - RDS_TECHNO_NAME : ${RDS_TECHNO_NAME-not set}" - vecho 1 "" - vecho 1 "" - } - - -# -------------------------------------------------------------------- -# Function : `rm_SEroute_tmp()'. - - rm_SEroute_tmp() - { - RM_PREV_RUN="n" - - while [ $# -gt 0 ]; do - case $1 in - "--previous-run") RM_PREV_RUN="y";; - esac - - shift - done - - rm -f ${netlistName}_r.mac - rm -f ${netlistName}.def - rm -f ${netlistName}_r.def - - if [ "$RM_PREV_RUN" = "y" ]; then - rm -f ${layoutName}_r.$MBK_IN_PH - fi - } - - -# -------------------------------------------------------------------- -# Function : `get_string()'. - - get_string() - { - string=`echo $1 | cut -d '=' -f 2` - - echo $string - } - - -# /------------------------------------------------------------------\ -# | | -# | Main Part of the Shell Script | -# | | -# \------------------------------------------------------------------/ -# - - - rm -f $LOG - - - title - - - if [ "`uname`" != "SunOS" ]; then - echo "seplace.sh:error: This progam must be run under Solaris." - exit 1 - fi - - -# -------------------------------------------------------------------- -# Process the command line. - - - keepTmp="n" - memNumber="150" - netlistName="" - placementName="" - layoutName="" - ioc="n" - core="n" - ring="n" - argVL="" - argLayers="-3" - argFillTie="" - argsA2DEF="-V -p" - argsDEF2A="-V -p" -# argsA2DEF="-V -p -E" -# argsDEF2A="-V -p -S" - argsSEA="--batch --ansi" -# argsSEA="-V" - - - if [ $# -eq 0 ]; then - print_usage - exit 0 - fi - - - while [ $# -gt 0 ]; do - - case $1 in - --devel) argsSEA="$argsSEA --devel";; - --help) print_usage; exit 0;; - --verbose) VL=1; argVL="-v";; - --very-verbose) VL=2; argVL="-V";; - --keep-tmp) keepTmp="y";; - --ioc) ioc="y";; - --core) core="y";; - --ring) ring="y"; core="y";; - --all) argLayers="-6";; - --4) argLayers="-4";; - --fill-tie) argFillTie="-t";; - --trust-orient) argsA2DEF="$argsA2DEF -T";; - --no-power) argsA2DEF="$argsA2DEF -n";; - --generator) argsA2DEF="$argsA2DEF -T -n";; - --place=*) placementName=`get_string $1`;; - --memory=*) memNumber=`get_number $1` - if [ $? -ne 0 ]; then - echo -n "seplace.sh:error: Bad number" - echo " in argument \"$1\"." - print_usage - exit 1 - fi;; - - --*) echo "seroute.sh:error: Invalid option \`$1'." - print_usage; exit 1;; - - -*) lSwitch="$1"; NB=2; CH=`echo $lSwitch | cut -c$NB` - - while [ "$CH" != "" ]; do - case $CH in - h) print_usage; exit 0;; - k) keepTmp="y";; - v) VL=1; argVL="-v";; - V) VL=2; argVL="-V";; - - *) echo "sea.sh:error: Invalid option \`$CH'." - print_usage; exit 1;; - esac - - NB=`expr $NB + 1` - CH=`echo $lSwitch | cut -c$NB` - done;; - - *) # Unmatched argument, this is the netlist name. - if [ "$netlistName" = "" ]; then - netlistName=$1 - else if [ "$layoutName" = "" ]; then - layoutName=$1 - else - echo "seroute.sh:warning: Ignored extra argument \`$1'." - fi; fi - ;; - esac - - shift - done - - -# -------------------------------------------------------------------- -# Consistency checks. - - - if [ "$netlistName" = "" ]; then - echo "seplace.sh:error: Missing argument." - print_usage - exit 1 - else - if [ ! -f "$netlistName.$MBK_IN_LO" ]; then - echo -n "seroute.sh:error: Can't find netlist file" - echo " \"$netlistName.$MBK_IN_LO\"." - print_usage; exit 1 - fi - fi - - - if [ "$placementName" = "" ]; then placementName=$netlistName; fi - - if [ ! -f "$placementName".$MBK_IN_PH ]; then - echo -n "seroute.sh:error: Can't find placement file" - echo " \"$placementName.$MBK_IN_PH\"." - print_usage; exit 1 - fi - - argsA2DEF="$argsA2DEF --place=$placementName" - - - if [ "$layoutName" = "" ]; then - echo "seplace.sh:error: Missing argument." - print_usage - exit 1 - fi - - - if [ "$ioc" = "y" -a ! -f "$netlistName.ioc" ]; then - echo -n "seroute.sh:error: Can't find terminal placement file" - echo " \"$netlistName.ioc\"." - print_usage; exit 1 - fi - - -# -------------------------------------------------------------------- -# Script at work. - - - MBK_env - rm_SEroute_tmp --previous-run - - - argsA2DEF="$argsA2DEF $argLayers $argFillTie" - - - vecho 1 " o Netlist file is := \"$netlistName.$MBK_IN_LO\"." - argsA2DEF="$argsA2DEF --mac-route=${netlistName}_r" - - - if [ "$ioc" = "y" ]; then - vecho 1 " o IO placement file is := \"$netlistName.ioc\"." - argsA2DEF="$argsA2DEF --ioc" - fi - - - if [ "$core" = "y" ]; then - vecho 1 " o The design will have pins." - argsA2DEF="$argsA2DEF -c" - fi - - - if [ "$ring" = "y" ]; then - vecho 1 " o Merge power terminals for ring." - argsDEF2A="$argsDEF2A -r" - fi - - - vecho 1 " o Silicon ensemble memory used := $memNumber." - argsSEA="$argsSEA --memory $memNumber" - - - vecho 2 "" - vecho 2 " o Translating \"$netlistName\" into DEF format." - log_exec "a2def $argsA2DEF $netlistName" - - - vecho 2 "" - vecho 2 " o Silicon Ensemble." - - - vecho 2 " - Running SEA/SE..." - sea $argVL $argsSEA $netlistName.def ${netlistName}_r.mac - cat sea.jnl >> $LOG - rm sea.jnl - - - vecho 2 "" - vecho 2 " o Translating \"$netlistName\" back into Alliance format." - log_exec "def2a $argsDEF2A ${netlistName}_r ${layoutName}" - - - if [ "$keepTmp" = "n" ]; then - rm_SEroute_tmp - fi - - - exit 0 diff --git a/alliance/src/sea/src/sxlib2LEF.c b/alliance/src/sea/src/sxlib2LEF.c deleted file mode 100644 index a4c0a0b7..00000000 --- a/alliance/src/sea/src/sxlib2LEF.c +++ /dev/null @@ -1,114 +0,0 @@ -/* - * $Id: sxlib2LEF.c,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./LEF_drive_sxlib.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "util_Defs.h" -# include "LEF_drive_sxlib.h" - - -/* ---------------------------------------------------------------------- - * Internal functions declarations. - */ - - static void printHelp __FP((void)); - - -/* - * /--------------------------------------------------------------------\ - * | Functions Definitions | - * \--------------------------------------------------------------------/ - */ - -/* ---------------------------------------------------------------------- - * Function : "printHelp()". - */ - -static void printHelp() -{ - printf(" o Usage := \"sxlib2lef [options] \"\n\n"); - printf(" o Options :\n"); - printf(" -v := Be verbose.\n"); - printf(" -V := Be very verbose.\n"); - printf(" -h := Print this message.\n"); - printf(" -o := Allow offgrid terminals.\n"); - printf(" -p := Do not generate power PORT geometries.\n"); - printf("\n" ); -} - - -/* ---------------------------------------------------------------------- - * Function : "main()". - */ - -extern int main(argc, argv) - int argc; - char *argv[]; -{ - struct lofig *pLofig; - struct phfig *pPhfig; - long VL, sxFlags; - int argC, i; - - - /* Read MBK environment. */ - mbkenv(); - - /* Initialise the "Ut" module. */ - util_init(C_VerboseLevel2, F_DUMPCORE, "sx2LEF"); - - - argC = argc; - - /* Default options. */ - VL = C_VerboseLevel0; - sxFlags = FALSE; - - /* Read the options. */ - for(i = 1; i < argc; i++) { - if (!strcmp(argv[i], "-h")) { printHelp(); exit(0); } - if (!strcmp(argv[i], "-v")) { VL = C_VerboseLevel1; continue; } - if (!strcmp(argv[i], "-V")) { VL = C_VerboseLevel2; continue; } - if (!strcmp(argv[i], "-o")) { sxFlags |= F_ALLOW_OFFGRID; continue; } - if (!strcmp(argv[i], "-p")) { sxFlags |= F_NO_POWER_GEOM; continue; } - - break; - } - - if ((argC - i) != 1) { printHelp(); exit(1); } - - - setVL(VL); - - if (VL > C_VerboseLevel0) - alliancebanner( - "sx2LEF", "V.RR", "SxLib to LEF MACRO converter", - "2000", ALLIANCE_VERSION ); - - printMBKEnv(); - - mprintf1 (" o Processing cell \"%s\".\n", argv[i]); - - pPhfig = getphfig(argv[i], 'A'); - pLofig = getlofig(argv[i], 'P'); - - - lefsavesxlophfig (pLofig, pPhfig, sxFlags); - - - exit(0); -} diff --git a/alliance/src/sea/src/util_Defs.h b/alliance/src/sea/src/util_Defs.h deleted file mode 100644 index 22a5bb7c..00000000 --- a/alliance/src/sea/src/util_Defs.h +++ /dev/null @@ -1,544 +0,0 @@ -/* - * $Id: util_Defs.h,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Header : "./util_Defs.h" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# ifndef __util_Defs__ -# define __util_Defs__ - - -# include -# include -# include -# include -# include -# include -# include -# include -# include - - -/* ---------------------------------------------------------------------- - * Looks if functions prototypes are availables. - */ - -# ifndef __FP -# ifdef __STDC__ - /* Compiler is ANSI C compliant. */ -# include -# include - -# define __FP( arguments ) arguments -# define __FPV( arguments ) arguments - -# define __KR_C( code ) -# define __ANSI_C( code ) code -# else - /* Compiler is K&R C. */ -# include -# include - -# define __FP( arguments ) () -# define __FPV( arguments ) (va_alist) va_dcl - -# define __KR_C( code ) code -# define __ANSI_C( code ) -# endif -# endif - - -/* ---------------------------------------------------------------------- - * Missing GNU functions prototypes under GCC/SunOS 4.1.4. - */ - -# include "GNU_Defs.h" - - -/* ---------------------------------------------------------------------- - * Miscellaneous. - */ - -# define TRUE 1 -# define FALSE 0 - -# define m_Max(a,b) (((a) > (b)) ? (a) : (b)) -# define m_Min(a,b) (((a) > (b)) ? (b) : (a)) -# define ABS(a) (((a) > 0 ) ? (a) : -(a)) - - - /* Usual types shortcut. */ - - - - -/* ---------------------------------------------------------------------- - * Alliance Includes. - */ - -# include -# include -# include -# include -# include -# include - - - - -/* ---------------------------------------------------------------------- - * Module : "util_Sys.c" - */ - -# define F_DUMPCORE 0 -# define F_NOCORE 1 - -# define C_SIGTFLT ((int)1) -# define C_SIGERR ((int)2) - -# define C_VerboseLevel0 (0L) -# define C_VerboseLevel1 (1L) -# define C_VerboseLevel2 (2L) - -# define SIZE_S64 2048 - - - /* External variables from the various modules. */ - extern long util_VL; - extern long util_flags; - extern char util_binName[1024]; - - /* Interruptions handling functions. */ - extern void trapInit __FP((void)); - extern void sendGSignal __FP((int aSig)); - extern void setBinName __FP((char *asName)); - - /* Errors printing functions. */ - extern void stdflush __FP((void)); - extern void errMBK __FP((char *asName)); - extern void eprinth __FP((char *asName)); - extern int eprintf __FPV((char *aFormat, ...)); - extern int eprints __FP((char *aS)); - - /* Warnings printing functions. */ - extern void warnMBK __FP((char *asName)); - extern void wprinth __FP((char *asName)); - extern int wprintf __FPV((char *aFormat, ...)); - extern int wprints __FP((char *aS)); - - /* Messages printing functions. */ - extern void setVL __FP((long aVL)); - extern long getVL __FP((void)); - extern int vmprintf __FP((long aVL, char *aFormat, va_list aArgList)); - extern int mprintf __FPV((long aVL, char *aFormat, ...)); - extern int mprints __FP((long aVL, char *aS)); - extern int mprintf0 __FPV((char *aFormat, ...)); - extern int mprintf1 __FPV((char *aFormat, ...)); - extern int mprintf2 __FPV((char *aFormat, ...)); - - /* "util_init" global initialisation function. */ - extern void util_init __FP((long aVL, long aFlags, char *asName)); - - /* Persistent strings printing function (up to 64 strings). */ - extern char *s64printf __FPV((char *aFormat, ...)); - - /* Miscellaneous. */ - extern char *strtoup __FP((char *aS)); - - - - -/* ---------------------------------------------------------------------- - * Module : "util_Inter.c" - */ - - - /* Interval list element. */ - typedef struct eInter_s { - long min; - long max; - struct eInter_s *next; - } eInter_t; - - /* Interval list head. */ - typedef struct lInter_s { - long min; - long max; - long len; - struct eInter_s *l; - } lInter_t; - - - extern void printinter __FP((struct lInter_s *apInter)); - extern struct lInter_s *addinter __FP((struct lInter_s *apInter, - long aMin, - long aMax)); - extern void freeinter __FP((struct lInter_s *apInter)); - - -/* ---------------------------------------------------------------------- - * Module : "util_MBK.c" - */ - - -# define F_EQUAL (1L) -# define F_CALU (2L) -# define F_TALU (4L) -# define F_EQUAL_M (F_EQUAL) -# define F_EQUAL_C (F_EQUAL | F_CALU) -# define F_EQUAL_T (F_EQUAL | F_TALU) - -# define PTYPE_LOSEG 512 -# define PTYPE_TLOSEG 513 -# define PTYPE_ULOCON 514 - -# define LOSEG_VIA 1 -# define LOSEG_SEG 2 -# define LOSEG_CON 3 -# define LOSEG_SEGCON 4 - -# define F_HAS_SUBNET (1L<<0) -# define F_NET_ROUTED (1L<<1) -# define F_SUBNET_ROUTED (1L<<2) - - -# define MBKSCALE(l) ((l) * SCALE_X) -# define MBKUNSCALE(l) ((l) / SCALE_X) -# define NEWSIGINDEX (++MBK_sigIndex) - - - /* Model of physical VIA. */ - typedef struct eMVIA_s { - char type; - long width; - long height; - struct eMVIA_s *next; - } eMVIA_t; - - - /* Added to each segment (USER pointer). */ - typedef struct eLoseg_s { - long type; - void *MBKobj; - struct eLoseg_s *next; - } eLoseg_t; - - - /* Added to the phfig (USER pointer). */ - typedef struct tLoseg_s { - long sigNB; /* Number of signals. */ - long tSize; /* Real table size. */ - struct authtable *tHT; /* Sig name --> tLoseg index. */ - long *tAccess; /* Number of signal accesses. */ - long *tFlags; /* Some flags... */ - struct eLoseg_s **tLoseg; /* Head of signal seg list. */ - struct eMVIA_s *tMVIA; /* list of model VIAS. */ - } tLoseg_t; - - - extern long MBK_sigIndex; - - - extern long isobs __FP((struct phseg *apSeg)); - extern long getsigaliasnumber __FP((struct losig *apLosig)); - extern long signamecmp __FP((char *aLoname, char *aPhname)); - extern char **makesegnamelist __FP((char *aName)); - extern void printMBKEnv __FP((void)); - extern char getAltVIALayer __FP((char aVIA, char aLayer)); - extern char getTopVIALayer __FP((char aVIA)); - extern char getBottomVIALayer __FP((char aVIA)); - extern char getTurnVIA __FP((char aLayer)); - extern long isVIALayer __FP((char aVIA, char aLayer)); - extern long getUpVIALayer __FP((char aVIA, char aLayer)); - extern char getUpLayer __FP((char aLayer)); - extern long cmpALU __FP((char aLayer1, char aLayer2)); - extern char getALU __FP((char aLayer)); - extern char getCALU __FP((char aLayer)); - extern long isCALU __FP((char aLayer)); - extern char getTALU __FP((char aLayer)); - extern long getLayerTrackWidth __FP((char aLayer)); - extern void xyflatseg __FP((struct phseg *apFlatSeg, - struct phseg *apSeg, - long aXINS, long aYINS, - long aXAB1, long aYAB1, - long aXAB2, long aYAB2, - char aTransf)); - extern void xyflatvia __FP((struct phvia *apFlatVIA, - struct phvia *apVIA, - long aXINS, long aYINS, - long aXAB1, long aYAB1, - long aXAB2, long aYAB2, - char aTransf)); - - /* Utilities for pad power splitting. */ - extern long isPad __FP((char *asCell)); - extern long initSigIndex __FP((struct losig *apLoSig)); - extern long cmpSigName __FP((struct losig *apLoSig, char *asName)); - extern struct locon *addInsLoCon __FP((struct loins *apIns, - char *asName, - struct losig *apSig, - char aDir)); - extern void splitPowerNet __FP((struct lofig *apLoFig, - char *asPower)); - extern struct phins *findphins __FP((struct phfig *apPhfig, - char *insName)); - extern struct phins *findphmodel __FP((struct phfig *apPhfig, - char *modelName)); - extern struct locon *findlocon __FP((struct lofig *apLofig, - char *conName)); - - extern loins_list *addloins_noSig __FP((lofig_list *apFig, - char *asIns, - lofig_list *apModel)); - - extern locon_list *addlosig_insCon __FP((loins_list *apIns, - char *asCon, - losig_list *apSig)); - - extern void checkLofig __FP((struct lofig *apLofig)); - extern void addfeed __FP((struct lofig *apLofig, - struct phfig *apPhfig)); - extern void delfeed __FP((struct lofig *apLofig)); - extern void copyUpCALU __FP((struct lofig *apLofig, - struct phfig *apPhfig, - long aExit)); - - extern struct eMVIA_s *addmvia __FP((struct eMVIA_s *apHead, - struct phvia *apVIA)); - extern struct eMVIA_s *getmvia __FP((struct eMVIA_s *apHead, - struct phvia *apVIA)); - extern struct eLoseg_s *addloseg __FP((struct eLoseg_s *apHead, - long aType, - void *apSegvia)); - extern struct eLoseg_s *delloseg __FP((struct eLoseg_s *apLoseg)); - extern struct tLoseg_s *gettloseg __FP((struct phfig *apPhfig)); - extern struct tLoseg_s *addtloseg __FP((struct phfig *apPhfig)); - extern struct authelem *gettlosegitem __FP((struct tLoseg_s *apTLoseg, - char *asKey)); - extern void freeloseg __FP((struct phfig *apPhfig)); - extern void phsegchain __FP((struct lofig *apLofig, - struct phfig *apPhfig)); - extern struct eLoseg_s *getloseglist __FP((struct phfig *apPhfig, - char *aName)); - extern void checklosegaccess __FP((struct phfig *apPhfig)); - extern void shiftphfig __FP((struct phfig *apPhfig, - long DX, - long DY)); - - - - -/* ---------------------------------------------------------------------- - * Module : "util_Power.c" - */ - - -# define F_POWER_COMPLETE 0x00000001 -# define C_POWER_ISNONE ((char)0) -# define C_POWER_ISVDD ((char)1) -# define C_POWER_ISVSS ((char)2) -# define C_POWER_VERTICAL ((char)1) -# define C_POWER_HORIZONTAL ((char)2) - -# define F_POWER_MERGE 0x00000001 - - - typedef struct ePow_s { - long flags; - long y; - long w; - long xMin; - long xMax; - long min; - long max; - char *Name; - char Type; - struct lInter_s *inter; - struct ePow_s *Next; - } ePow_t; - - - extern struct ePow_s *addPow __FP((struct ePow_s **applPow, - long aY, - long aW, - char *aName, - char aType, - char aDir)); - extern void freePow __FP((struct ePow_s *aplPow)); - extern struct ePow_s *getPow __FP((struct ePow_s *aplPow, long aY)); - extern void mergeXPow __FP((struct ePow_s *apPow, - long axMin, - long axMax, - long aW)); - extern struct ePow_s *buildPow __FP((struct phfig *apPhfig, - char aLayer, - char aDir, - char *asSuffix)); - extern void powToCon __FP(( struct phfig *apPhfig, - char aLayer, - char aDir, - struct ePow_s *aplPow, - long aFlags)); - - - - -/* ---------------------------------------------------------------------- - * Module : "util_RTU.c" - */ - - - extern void rtu __FP((struct phfig *aPhfig)); - - - - -/* ---------------------------------------------------------------------- - * Module : "util_Floorplan.c" - */ - -# define F_FLOOR_LAYERS_3 0x00000010 /* 16. */ -# define F_FLOOR_LAYERS_4 0x00000020 /* 16. */ -# define F_FLOOR_LAYERS_6 0x00000040 /* 32. */ -# define F_FLOOR_MARGIN 0x00000080 /* 64. */ -# define F_FLOOR_ROW_NUMBER 0x00000100 /* 128. */ -# define F_FLOOR_X_SIZE 0x00000200 /* 256. */ -# define F_FLOOR_Y_SIZE 0x00000400 /* 512. */ -# define F_FLOOR_ASPECT_RATIO 0x00000800 /* 1024. */ - -# define FLOOR_XY_EXPAND MBKSCALE(50) - - - extern void placeTerms __FP((struct lofig *apLofig, - struct phfig *apPhfig)); - extern struct phfig *makeFloorplan __FP((struct lofig *apLofig, - long aMargin, - long aXSize, - long aYSize, - double aAspectRatio, - long aPower, - long aFlags)); - extern void expandFloorplan __FP((struct phfig *apPhfig)); - extern void shrinkFloorplan __FP((struct phfig *apPhfig)); - extern void protectPowmid __FP((struct phfig *apPhfig)); - - - - -/* ---------------------------------------------------------------------- - * Module : "util_LEFDEF.c" - */ - - -# include "DEF_actions.h" - - - /* LEF/DEF terminal direction. */ -# define C_DIRECTION_NONE ((char)0) -# define C_DIRECTION_INPUT ((char)1) -# define C_DIRECTION_OUTPUT ((char)2) -# define C_DIRECTION_TRISTATE ((char)3) -# define C_DIRECTION_INOUT ((char)4) -# define C_DIRECTION_FEEDTHRU ((char)5) - -# define X_GRID 5 -# define Y_SLICE 50 -# define WIDTH_VDD 6 -# define WIDTH_VSS 6 -# define VIA_SIDE 2 -# define ALU1_SPACING 3 -# define MBK_X_GRID (X_GRID * SCALE_X) -# define MBK_Y_SLICE (Y_SLICE * SCALE_X) -# define MBK_WIDTH_VDD (WIDTH_VDD * SCALE_X) -# define MBK_WIDTH_VSS (WIDTH_VSS * SCALE_X) -# define MBK_VIA_SIDE (MBKSCALE (VIA_SIDE)) -# define MBK_ALU1_SPACING (MBKSCALE (ALU1_SPACING)) -# define DEF_X_GRID (X_GRID * DEF_UNITS_MICRONS) -# define DEF_Y_SLICE (Y_SLICE * DEF_UNITS_MICRONS) - - - extern long DEF_UNITS_MICRONS; - - - extern long DEF2MBK_length __FP((long aL)); - extern char *DEF2MBK_name __FP((char *aS)); - extern char DEF2MBK_transf __FP((double aO)); - extern char DEF2MBK_direction __FP((double aDEFdir)); - extern struct phref *DEF2MBK_row __FP((struct phfig *apPhfig, - char *aRowName, - char *aRowType, - long aOrient, - long aDoNumber, - long aByNumber, - long aStepX, - long aStepY, - long aX, - long aY)); - extern struct phref *DEF2MBK_track __FP((struct phfig *apPhfig, - char *aAxisName, - long aStart, - long aDoNumber, - long aStep, - char *asLayers, - long aX, - long aY)); - extern struct phref *DEF2MBK_blockage __FP((struct phfig *apPhfig, - long aXB1, - long aYB1, - long aWidth, - long aHeight)); - - extern long MBK2DEF_length __FP((long aL)); - extern char *MBK2DEF_name __FP((char *asLEF, char *asMBK)); - extern char MBK2DEF_direction __FP((char acDir)); - extern char MBK2DEF_transf __FP((char aO)); - extern void MBK2DEF_row __FP((struct phref *apPhref, - char **appRowName, - char **appRowType, - long *apOrient, - long *apDoNumber, - long *apByNumber, - long *apStepX, - long *apStepY, - long *apX, - long *apY)); - extern void MBK2DEF_track __FP((struct phref *apPhref, - char *apAxisName, - long *apStart, - long *apDoNumber, - long *apStep, - char **apsLayers, - long *apX, - long *apY)); - extern void MBK2DEF_blockage __FP((struct phref *apPhref, - long *apXB1, - long *apYB1, - long *apWidth, - long *apHeight)); - extern char MBK2DEF_locondir __FP((struct locon *apLocon)); - extern char *DEF_orient2a __FP((long aT)); - extern long DEF_a2orient __FP((char *aT)); - extern char *DEF_side2a __FP((char aSide)); - extern char *DEF_layer2a __FP((char aLayer)); - extern char *DEF_via2a __FP((char aType, - long aDX, - long aDY, - char *aViaName)); - - extern char BEH2DEF_direction __FP((char acDir)); - - -# endif diff --git a/alliance/src/sea/src/util_Floorplan.c b/alliance/src/sea/src/util_Floorplan.c deleted file mode 100644 index fb9851cb..00000000 --- a/alliance/src/sea/src/util_Floorplan.c +++ /dev/null @@ -1,1207 +0,0 @@ -/* - * $Id: util_Floorplan.c,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./util_Floorplan.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "util_Defs.h" -# include "debugoff.h" - - -/* ------------------------------------------------------------------ - * Local constants. - */ - -# define F_NO_OVERLAP ((long)(1<<0)) -# define F_OVERLAP ((long)(1<<1)) -# define F_I1_IN_I2 ((long)(1<<2)) -# define F_I2_IN_I1 ((long)(1<<3)) -# define F_SEG_EXCLUS ((long)(1<<0)) -# define F_SEG_INCLUS ((long)(1<<1)) -# define F_SEG_HALFOVER ((long)(1<<2)) -# define F_SEG_OVER ((long)(1<<3)) -# define F_TERM_XY ((long)(1<<0)) -# define F_TERM_LAYER ((long)(1<<1)) -# define F_TERM_SIDE ((long)(1<<2)) -# define F_TERM_USER ((long)(1<<3)) - -# define F_SIDE_FULL ((long)(1<<1)) - -# define SIDE_NORTH 0 -# define SIDE_SOUTH 1 -# define SIDE_EAST 2 -# define SIDE_WEST 3 -# define SIDE_ALL 4 - - -/* ------------------------------------------------------------------ - * Local structures. - */ - - typedef struct ulocon_s { - long flags; - } ulocon_t; - - typedef struct term_s { - long flags; - char *name; - char layer; - long XY; - struct term_s *next; - } term_t; - - - typedef struct side_s { - char orient; - char layer; - long flags; - long x; - long y; - long length; - long nbTerm; - long maxTerm; - struct term_s *lTerm; - } side_t; - - -/* ------------------------------------------------------------------ - * Local variables. - */ - - static char routingLayers3[256] = "l_alu1.l_alu2.l_alu3."; - static char routingLayers4[256] = - "l_alu1.l_alu2.l_alu3.l_alu4."; - static char routingLayers6[256] = - "l_alu1.l_alu2.l_alu3.l_alu4.l_alu5.l_alu6."; - static long LV_dupTerm; - static long LV_loTerm; - - -/* ------------------------------------------------------------------ - * Local macros. - */ - -# define SNAPGRID(x) ((x) - ((x) % MBK_X_GRID)) - - -/* ---------------------------------------------------------------------- - * Local functions declarations. - */ - - static struct term_s *newTerm __FP((struct term_s *apHead, - long aFlags, - char *aName, - char aLayer, - long aXY)); - static struct term_s *freeTerm __FP((struct term_s *apTerm)); - static struct ulocon_s *getUlocon __FP((struct locon *apLocon)); - static struct ulocon_s *newUlocon __FP((struct locon *apLocon)); - static void freeUlocon __FP((struct locon *apLocon)); - static void linkTerm __FP((struct locon *apLocon, - long aFlags)); - static void unlinkTerm __FP((struct locon *apLocon)); - static struct side_s *newSide __FP((char aOrient, - char aLayer, - long aX, - long aY, - long aLength)); - static void freeSide __FP((struct side_s *apSide)); - static struct side_s *buildSide __FP((struct phfig *apPhfig, - struct lofig *apLofig, - char aOrient, - char aLayer)); - static long countDupTerms __FP((struct phfig *apPhfig)); - static long addLoconUinfo __FP((struct lofig *apLofig)); - static void freeLoconUinfo __FP((struct lofig *apLofig)); - static long computeArea __FP((struct lofig *apLofig)); -# if 0 - static long intervalRel __FP((long aI1_min, - long aI1_max, - long aI2_min, - long aI2_max)); - static long segInArea __FP((struct phseg *aPhseg, - long aX1, - long aY1, - long aX2, - long aY2)); -# endif - - -/* - * /--------------------------------------------------------------------\ - * | Functions Definitions | - * \--------------------------------------------------------------------/ - */ - -/* ---------------------------------------------------------------------- - * Function : "newTerm()". - */ - -static struct term_s *newTerm (apHead, aFlags, aName, aLayer, aXY) - struct term_s *apHead; - long aFlags; - char *aName; - char aLayer; - long aXY; -{ - struct term_s *pTerm; - - - pTerm = (struct term_s*)mbkalloc (sizeof (struct term_s)); - - pTerm->flags = aFlags; - pTerm->name = aName; - pTerm->layer = aLayer; - pTerm->XY = aXY; - pTerm->next = apHead; - - return (pTerm); -} - - -/* ---------------------------------------------------------------------- - * Function : "freeTerm()". - */ - -static struct term_s *freeTerm (apTerm) - struct term_s *apTerm; -{ - struct term_s *pNext; - - - pNext = apTerm->next; - - mbkfree (apTerm); - - return (pNext); -} - - -/* ---------------------------------------------------------------------- - * Function : "getUlocon()". - */ - -static struct ulocon_s *getUlocon (apLocon) - struct locon *apLocon; -{ - struct ptype *pType; - - - if (!(pType = getptype (apLocon->USER, PTYPE_ULOCON))) return (NULL); - - return ((struct ulocon_s*)pType->DATA); -} - - -/* ---------------------------------------------------------------------- - * Function : "newUlocon()". - */ - -static struct ulocon_s *newUlocon (apLocon) - struct locon *apLocon; -{ - struct ptype *pType; - struct ulocon_s *pUlocon; - - - if (!(pUlocon = getUlocon (apLocon))) { - pUlocon = (struct ulocon_s*)mbkalloc (sizeof (struct ulocon_s)); - - pUlocon->flags = 0L; - - apLocon->USER = addptype (apLocon->USER, PTYPE_ULOCON, (void*)pUlocon); - - pType = apLocon->USER; - } - - - return (pUlocon); -} - - -/* ---------------------------------------------------------------------- - * Function : "freeUlocon()". - */ - -static void freeUlocon (apLocon) - struct locon *apLocon; -{ - struct ptype *pType; - - - if ((pType = getptype (apLocon->USER, PTYPE_ULOCON))) { - mbkfree (pType->DATA); - - apLocon->USER = delptype (apLocon->USER, PTYPE_ULOCON); - } -} - - -/* ---------------------------------------------------------------------- - * Function : "linkTerm()". - */ - -static void linkTerm (apLocon, aFlags) - struct locon *apLocon; - long aFlags; -{ - struct ulocon_s *pUlocon; - - - if (!(pUlocon = getUlocon (apLocon))) - pUlocon = newUlocon (apLocon); - - pUlocon->flags = aFlags; -} - - -/* ---------------------------------------------------------------------- - * Function : "unlinkTerm()". - */ - -static void unlinkTerm (apLocon) - struct locon *apLocon; -{ - freeUlocon (apLocon); -} - - -/* ---------------------------------------------------------------------- - * Function : "newSide()". - */ - -static struct side_s *newSide (aOrient, aLayer, aX, aY, aLength) - char aOrient; - char aLayer; - long aX; - long aY; - long aLength; -{ - struct side_s *pSide; - - - pSide = (struct side_s*)mbkalloc (sizeof (struct side_s)); - - pSide->nbTerm = 0; - pSide->maxTerm = 0; - pSide->flags = 0; - pSide->lTerm = NULL; - pSide->orient = aOrient; - pSide->layer = aLayer; - pSide->x = aX; - pSide->y = aY; - pSide->length = aLength; - - return (pSide); -} - - -/* ---------------------------------------------------------------------- - * Function : "freeSide()". - */ - -static void freeSide (apSide) - struct side_s *apSide; -{ - struct term_s *pTerm; - - - for (pTerm = apSide->lTerm; pTerm != NULL; pTerm = freeTerm (pTerm)); - - mbkfree (apSide); -} - - -/* ---------------------------------------------------------------------- - * Function : "buildSide()". - */ - -static struct side_s *buildSide (apPhfig, apLofig, aOrient, aLayer) - struct phfig *apPhfig; - struct lofig *apLofig; - char aOrient; - char aLayer; -{ - struct side_s *pSide; - struct phcon *pPhcon; - long XSIDE, YSIDE, sideLength; - - - switch (aOrient) { - case WEST: - XSIDE = apPhfig->XAB1; - YSIDE = apPhfig->YAB1; - sideLength = apPhfig->YAB2 - apPhfig->YAB1; - break; - case EAST: - XSIDE = apPhfig->XAB2; - YSIDE = apPhfig->YAB1; - sideLength = apPhfig->YAB2 - apPhfig->YAB1; - break; - case NORTH: - XSIDE = apPhfig->XAB1; - YSIDE = apPhfig->YAB2; - sideLength = apPhfig->XAB2 - apPhfig->XAB1; - break; - default: - case SOUTH: - XSIDE = apPhfig->XAB1; - YSIDE = apPhfig->YAB1; - sideLength = apPhfig->XAB2 - apPhfig->XAB1; - break; - } - - - pSide = newSide (aOrient, aLayer, XSIDE, YSIDE, sideLength); - - for (pPhcon = apPhfig->PHCON; pPhcon != NULL; pPhcon = pPhcon->NEXT) { - /* Checking terminal orientation. */ - if (pPhcon->ORIENT == aOrient) { - switch (aOrient) { - case EAST: - case WEST: - if (XSIDE != pPhcon->XCON) { - eprinth ("buildSide"); - eprintf ("\n East/west terminal %s at (%ld,%ld) is not on", - pPhcon->NAME, - pPhcon->XCON, - pPhcon->YCON); - eprintf ("\n the abutment-box.\n"); - EXIT (1); - } - - /* Adding the terminal to the side's list. */ - pSide->nbTerm++; - pSide->lTerm = newTerm (pSide->lTerm, - F_TERM_XY|F_TERM_LAYER|F_TERM_USER, - pPhcon->NAME, - pPhcon->LAYER, - pPhcon->YCON); - break; - case NORTH: - default: - case SOUTH: - if (YSIDE != pPhcon->YCON) { - eprinth ("buildSide"); - eprintf ("\n North/south terminal %s at (%ld,%ld) is not on", - pPhcon->NAME, - pPhcon->XCON, - pPhcon->YCON); - eprintf ("\n the abutment-box.\n"); - EXIT (1); - } - - /* Adding the terminal to the side's list. */ - pSide->nbTerm++; - pSide->lTerm = newTerm (pSide->lTerm, - F_TERM_XY|F_TERM_LAYER|F_TERM_USER, - pPhcon->NAME, - pPhcon->LAYER, - pPhcon->XCON); - break; - } - - linkTerm (getlocon (apLofig, pPhcon->NAME), - F_TERM_XY|F_TERM_LAYER|F_TERM_SIDE); - } - } - - return (pSide); -} - - -/* ---------------------------------------------------------------------- - * Function : "sortSide()". - */ - -static void sortSide(apSide) - struct side_s *apSide; -{ - struct term_s *pTerm; - char *tFilled; - long i, spacing, sideOrig; - - - tFilled = (char*)mbkalloc (sizeof (char) * apSide->nbTerm); - - switch (apSide->orient) { - case EAST: - case WEST: - sideOrig = apSide->y; break; - case NORTH: - case SOUTH: - default: - sideOrig = apSide->x; break; - } - - spacing = apSide->length / apSide->nbTerm; - for (i = 0; i < apSide->nbTerm; i++) tFilled[i] = '\0'; - - for (pTerm = apSide->lTerm; pTerm != NULL; pTerm = pTerm->next) { - if (pTerm->flags & F_TERM_XY) { - tFilled[(pTerm->XY - sideOrig) / spacing ] = '\1'; - } - } - - __DBG( fprintf (stderr, "spacing := %ld\n", spacing); ) - - i = 0; - for (pTerm = apSide->lTerm; pTerm != NULL; pTerm = pTerm->next) { - __DBG( fprintf (stderr, "i := %ld\n", i); ) - - if (!(pTerm->flags & F_TERM_XY)) { - pTerm->XY = sideOrig + SNAPGRID((spacing * i) + (spacing >> 1)); - pTerm->layer = apSide->layer; - - __DBG( fprintf (stderr, "pTerm->XY := %ld\n", pTerm->XY); ) - } - - i++; - } -} - - -/* ---------------------------------------------------------------------- - * Function : "countDupTerms()". - */ - -static long countDupTerms (apPhfig) - struct phfig *apPhfig; -{ - struct phcon *pPhcon; - struct authtable *htCon; - struct authelem *pElem; - - - htCon = createauthtable (1024); - - /* Find the number of duplicated terminals. */ - for (pPhcon = apPhfig->PHCON; pPhcon != NULL; pPhcon = pPhcon->NEXT) { - pElem = searchauthelem (htCon, pPhcon->NAME); - - if (!pElem) { - pElem = addauthelem (htCon, pPhcon->NAME, -1); - } - - pElem->VALUE++; - } - - - LV_dupTerm = 0; - - /* Make the sum. */ - for (pPhcon = apPhfig->PHCON; pPhcon != NULL; pPhcon = pPhcon->NEXT) { - pElem = searchauthelem (htCon, pPhcon->NAME); - - LV_dupTerm += pElem->VALUE; - - /* Do not count twice duplicated terminals... */ - pElem->VALUE = 0; - } - - destroyauthtable (htCon); - - - return (LV_dupTerm); -} - - -/* ---------------------------------------------------------------------- - * Function : "addLoconUinfo()". - */ - -static long addLoconUinfo (apLofig) - struct lofig *apLofig; -{ - struct locon *pLocon; - - - LV_loTerm = 0; - - - for (pLocon = apLofig->LOCON; pLocon != NULL; pLocon = pLocon->NEXT) { - LV_loTerm++; - - linkTerm (pLocon, 0); - } - - return (LV_loTerm); -} - - -/* ---------------------------------------------------------------------- - * Function : "freeLoconUinfo()". - */ - -static void freeLoconUinfo (apLofig) - struct lofig *apLofig; -{ - struct locon *pLocon; - - - for (pLocon = apLofig->LOCON; pLocon != NULL; pLocon = pLocon->NEXT) { - unlinkTerm (pLocon); - } -} - - -/* ---------------------------------------------------------------------- - * Function : "nextFreeLocon()". - */ - -static struct locon *nextFreeLocon (apLocon) - struct locon *apLocon; -{ - struct ulocon_s *pUlocon; - struct locon *pLocon; - - - for (pLocon = apLocon; pLocon != NULL; pLocon = pLocon->NEXT) { - pUlocon = getUlocon (pLocon); - - if (!(pUlocon->flags & F_TERM_SIDE)) return (pLocon); - } - - return (NULL); -} - - -/* ---------------------------------------------------------------------- - * Function : "placeTerms()". - */ - -extern void placeTerms (apLofig, apPhfig) - struct lofig *apLofig; - struct phfig *apPhfig; -{ - struct side_s *tSide[4]; - struct term_s *pTerm; - struct locon *pLocon; - long iSide; - long spaceTerm, newSpaceTerm, sideSpaceTerm; - long nbPhterm , newNbPhterm; - long nbPlacedTerm; - long flagLoop; - long XCON, YCON; - - - addLoconUinfo (apLofig); - countDupTerms (apPhfig); - - tSide[SIDE_NORTH] = buildSide (apPhfig, apLofig, NORTH, ALU3); - tSide[SIDE_SOUTH] = buildSide (apPhfig, apLofig, SOUTH, ALU3); - tSide[SIDE_EAST] = buildSide (apPhfig, apLofig, EAST , ALU2); - tSide[SIDE_WEST] = buildSide (apPhfig, apLofig, WEST , ALU2); - - - /* Side allocation for free terminals. */ - - nbPhterm = LV_loTerm + LV_dupTerm; - spaceTerm = 0; - nbPlacedTerm = 0; - - for (iSide = 0; iSide < SIDE_ALL; iSide++) { - spaceTerm += tSide[iSide]->length; - nbPlacedTerm += tSide[iSide]->nbTerm; - } - - spaceTerm /= (nbPhterm + 1); - - __DBG( fprintf (stderr, "spaceTerm := %ld\n", spaceTerm); ) - __DBG( fprintf (stderr, "nbPhterm := %ld\n", nbPhterm ); ) - - - if (nbPlacedTerm < nbPhterm) { - /* Find sides with free space for terminals. */ - for (flagLoop = TRUE; flagLoop; ) { - flagLoop = FALSE; - - newSpaceTerm = 0; - newNbPhterm = LV_loTerm + LV_dupTerm; - - for (iSide = 0; iSide < SIDE_ALL; iSide++) { - if (tSide[iSide]->flags & F_SIDE_FULL) { - newNbPhterm -= tSide[iSide]->nbTerm; - } else { - - sideSpaceTerm = tSide[iSide]->length / (tSide[iSide]->nbTerm + 1); - __DBG( fprintf (stderr, "sideSpaceTerm := %ld\n", sideSpaceTerm); ) - - if (sideSpaceTerm <= spaceTerm) { - __DBG( fprintf (stderr, "side %ld overloaded\n", iSide); ) - /* This side is overloaded : skip it. */ - flagLoop = TRUE; - - tSide[iSide]->flags |= F_SIDE_FULL; - tSide[iSide]->maxTerm = tSide[iSide]->nbTerm; - newNbPhterm -= tSide[iSide]->nbTerm; - } else { - newSpaceTerm += sideSpaceTerm; - tSide[iSide]->maxTerm = tSide[iSide]->length / spaceTerm; - __DBG( fprintf (stderr, - "tSide[%ld]->maxTerm := %ld\n", - iSide, - tSide[iSide]->maxTerm); ) - } - } - } /* End of 'for(iSide ...)'. */ - - spaceTerm = newSpaceTerm / (newNbPhterm + 1); - - __DBG( fprintf (stderr, "spaceTerm := %ld\n", spaceTerm); ) - } /* End of 'for(flagLoop... )'. */ - } - - - /* Dispatch remaining terminals on non-overloaded sides. */ - iSide = 0; - - for (pLocon = nextFreeLocon (apLofig->LOCON); - pLocon != NULL; pLocon = nextFreeLocon (pLocon->NEXT)) { - while (tSide[iSide]->nbTerm >= tSide[iSide]->maxTerm) { - if (iSide >= SIDE_ALL) { - eprinth ("placeTerms"); - eprintf ("\n No more sides to place terminals"); - eprintf (" (this is a bug)\n\n"); - EXIT (1); - } - - iSide++; - } - - tSide[iSide]->nbTerm++; - tSide[iSide]->lTerm = newTerm (tSide[iSide]->lTerm, - 0, - pLocon->NAME, - 0, - 0); - - linkTerm (pLocon, F_TERM_SIDE); - } - - - /* Sets the positions on all sides. */ - for (iSide = 0; iSide < SIDE_ALL; iSide++) { - __DBG (fprintf (stderr, "sortSide(%ld)\n", iSide); ) - sortSide (tSide[iSide]); - } - - - /* Add the physical terminals. */ - for (iSide = 0; iSide < SIDE_ALL; iSide++) { - for (pTerm = tSide[iSide]->lTerm; pTerm != NULL; pTerm = pTerm->next) { - switch (tSide[iSide]->orient) { - case NORTH: - case SOUTH: - default: - XCON = pTerm->XY; - YCON = tSide[iSide]->y; - break; - case EAST: - case WEST: - XCON = tSide[iSide]->x; - YCON = pTerm->XY; - break; - } - - addphcon (apPhfig, - tSide[iSide]->orient, - pTerm->name, - XCON, - YCON, - pTerm->layer, - MBKSCALE(2)); - } - } - - - - /* Free all the sides structures. */ - for (iSide = 0; iSide < SIDE_ALL; iSide++) freeSide (tSide[iSide]); - - freeLoconUinfo (apLofig); -} - - -/* ---------------------------------------------------------------------- - * Function : "computeArea()". - */ - -static long computeArea(apLofig) - struct lofig *apLofig; -{ - struct loins* pLoins; - struct phfig* pModel; - long area; - long AB_width, AB_height; - - - area = 0L; - - for (pLoins = apLofig->LOINS; pLoins != NULL; pLoins = pLoins->NEXT) { - pModel = getphfig (pLoins->FIGNAME, 'P'); - - AB_width = pModel->XAB2 - pModel->XAB1; - AB_height = pModel->YAB2 - pModel->YAB1; - - - if (AB_width <= 0) { - eprinth (NULL); - eprintf ( - "Negative or null width (%ld) for abutment box of \"%s\".\n", - AB_width, pModel->NAME); - EXIT (1); - } - - if (AB_height <= 0) { - eprinth (NULL); - eprintf ( - "Negative or null height (%ld) for abutment box of \"%s\".\n", - AB_height, pModel->NAME); - EXIT (1); - } - - if (AB_width % MBK_X_GRID) { - eprinth (NULL); - eprintf ( - "Unpitched width (%ld) for abutment box of \"%s\".\n", - AB_width, pModel->NAME); - EXIT (1); - } - - if (AB_height % MBK_Y_SLICE) { - eprinth (NULL); - eprintf ( - "Unpitched height (%ld) for abutment box of \"%s\".\n", - AB_height, pModel->NAME); - EXIT (1); - } - - - AB_width = AB_width / MBK_X_GRID; - AB_height = AB_height / MBK_Y_SLICE; - - area += AB_width * AB_height; - } - - - return (area); -} - - -/* ---------------------------------------------------------------------- - * Function : "makeFloorplan()". - */ - -extern struct phfig *makeFloorplan(apLofig, - aMargin, - aXSize, - aYSize, - aAspectRatio, - aPower, - aFlags) - struct lofig *apLofig; - long aMargin; - long aXSize; - long aYSize; - double aAspectRatio; - long aPower; - long aFlags; -{ - struct phfig *pPhfig; - long specCount, i; - long area; - long xSize, ySize; - long XAB1, YAB1, XAB2, YAB2; - char row_name[1024], row_type[1024]; - char *routingLayers; - - - specCount = (aFlags & F_FLOOR_X_SIZE) ? 1 : 0; - specCount += (aFlags & F_FLOOR_Y_SIZE) ? 1 : 0; - specCount += (aFlags & F_FLOOR_ASPECT_RATIO) ? 1 : 0; - - if (specCount != 1) { - errMBK ("makeFloorplan"); - eprintf ("\n One, and only one argument among aXSize, aYSize and"); - eprintf ( " aAspectRatio must\n be non zero.\n"); - EXIT (1); - } - - pPhfig = addphfig (apLofig->NAME); - - area = computeArea (apLofig); - area = (long)((1.0 + (double)aMargin / 100.0) * (double)area); - - /* Shut up GCC. */ - xSize = 0; - ySize = 0; - - if (aFlags & F_FLOOR_X_SIZE) { - xSize = aXSize; - ySize = area / (xSize - 7 * aPower) - + ((area % (xSize - 7 * aPower)) ? 1 : 0); - } - - if (aFlags & F_FLOOR_Y_SIZE) { - ySize = aYSize; - xSize = (7 * aPower) + (area / aYSize) + ((area / aYSize) ? 1 : 0); - } - - if (aFlags & F_FLOOR_ASPECT_RATIO) { - double x, r, b, xy; - - xy = (double)(Y_SLICE / X_GRID); - - b = ((double)(7 * aPower)) / xy; - x = (b + sqrt (pow (b, 2.0) + 4 * xy * (double)(area) * aAspectRatio)) - / (2 * xy * aAspectRatio); - - ySize = (long)floor (x * aAspectRatio); - - /* Compute missing area (as ySize is rounded down). - * The unit the number of horizontal sites. - */ - r = ((double)(area + 7 * aPower * ySize) - pow ((double)ySize, 2.0) * xy) - / (double)(ySize); - - xSize = ((long)ceil ((double)ySize * xy + r)); - } - - - XAB1 = 0L; - YAB1 = 0L; - XAB2 = xSize * MBK_X_GRID; - YAB2 = ySize * MBK_Y_SLICE; - - - /* Build the floorplan. */ - - /* The Abutment-box. */ - defab (pPhfig, XAB1, YAB1, XAB2, YAB2); - - /* The row matrix. */ - strcpy (row_type, "core"); - for (i = 0; i < ySize; i++) { - sprintf (row_name, "row_%ld", i); - - DEF2MBK_row (pPhfig, - row_name, - row_type, - (i % 2) ? DEF_FS : DEF_N, - xSize, - 1L, - DEF_X_GRID, - DEF_Y_SLICE, - XAB1, - YAB1 + i * MBK_Y_SLICE); - } - - /* The tracks matrix. */ - routingLayers = routingLayers6; - - if (aFlags & F_FLOOR_LAYERS_3) { - routingLayers = routingLayers3; - } - - if (aFlags & F_FLOOR_LAYERS_4) { - routingLayers = routingLayers4; - } - - /* Horizontal tracks. */ - DEF2MBK_track (pPhfig, - "Y", - MBK2DEF_length (YAB1 + MBK_X_GRID), - ySize * (Y_SLICE / X_GRID) - 1, - DEF_X_GRID, - routingLayers, - XAB1, - YAB1 + MBK_X_GRID); - - /* Vertical tracks. */ - DEF2MBK_track (pPhfig, - "X", - MBK2DEF_length (XAB1 + MBK_X_GRID), - xSize - 1, - DEF_X_GRID, - routingLayers, - XAB1 + MBK_X_GRID, - YAB1); - - - return (pPhfig); -} - - -/* ---------------------------------------------------------------------- - * Function : "expandFloorplan()". - */ - -extern void expandFloorplan(apPhfig) - struct phfig *apPhfig; -{ - struct phseg *pPhseg; - struct phcon *pPhcon; - long XAB1, YAB1, XAB2, YAB2; - - - XAB1 = apPhfig->XAB1; - YAB1 = apPhfig->YAB1; - XAB2 = apPhfig->XAB2; - YAB2 = apPhfig->YAB2; - - - apPhfig->XAB1 -= FLOOR_XY_EXPAND; - apPhfig->YAB1 -= FLOOR_XY_EXPAND; - apPhfig->XAB2 += FLOOR_XY_EXPAND; - apPhfig->YAB2 += FLOOR_XY_EXPAND; - - - /* Move terminals to the new AB. */ - for (pPhcon = apPhfig->PHCON; pPhcon != NULL; pPhcon = pPhcon->NEXT) { - if (pPhcon->XCON == XAB1) pPhcon->XCON = apPhfig->XAB1; - if (pPhcon->XCON == XAB2) pPhcon->XCON = apPhfig->XAB2; - if (pPhcon->YCON == YAB1) pPhcon->YCON = apPhfig->YAB1; - if (pPhcon->YCON == YAB2) pPhcon->YCON = apPhfig->YAB2; - } - - - /* Shrink segments to fit in the new AB. */ - for (pPhseg = apPhfig->PHSEG; pPhseg != NULL; pPhseg = pPhseg->NEXT) { - if (pPhseg->X1 == XAB1) pPhseg->X1 = apPhfig->XAB1; - if (pPhseg->X2 == XAB2) pPhseg->X2 = apPhfig->XAB2; - if (pPhseg->Y1 == YAB1) pPhseg->Y1 = apPhfig->YAB1; - if (pPhseg->Y2 == YAB2) pPhseg->Y2 = apPhfig->YAB2; - } - - -# if 0 - DEF2MBK_blockage (apPhfig, - MBK2DEF_length (apPhfig->XAB1), - MBK2DEF_length (apPhfig->YAB1), - MBK2DEF_length (FLOOR_XY_EXPAND), - MBK2DEF_length (FLOOR_XY_EXPAND) - ); - - DEF2MBK_blockage (apPhfig, - MBK2DEF_length (apPhfig->XAB1), - MBK2DEF_length (apPhfig->YAB2 - FLOOR_XY_EXPAND), - MBK2DEF_length (FLOOR_XY_EXPAND), - MBK2DEF_length (FLOOR_XY_EXPAND) - ); - - DEF2MBK_blockage (apPhfig, - MBK2DEF_length (apPhfig->XAB2 - FLOOR_XY_EXPAND), - MBK2DEF_length (apPhfig->YAB1), - MBK2DEF_length (FLOOR_XY_EXPAND), - MBK2DEF_length (FLOOR_XY_EXPAND) - ); - - DEF2MBK_blockage (apPhfig, - MBK2DEF_length (apPhfig->XAB2 - FLOOR_XY_EXPAND), - MBK2DEF_length (apPhfig->YAB2 - FLOOR_XY_EXPAND), - MBK2DEF_length (FLOOR_XY_EXPAND), - MBK2DEF_length (FLOOR_XY_EXPAND) - ); -# endif -} - - -# if 0 -/* ---------------------------------------------------------------------- - * Function : "intervalRel()". - */ - -static long intervalRel(aI1_min, aI1_max, aI2_min, aI2_max) - long aI1_min, aI1_max, aI2_min, aI2_max; -{ - long flag; - - - if (aI1_min > aI1_max) { - errMBK ("intervalRel"); - eprintf (" I1_min(%ld) > I1_max(%ld) !\n", aI1_min, aI1_max); - EXIT (1); - } - if (aI2_min > aI2_max) { - errMBK ("intervalRel"); - eprintf (" I2_min(%ld) > I2_max(%ld) !\n", aI2_min, aI2_max); - EXIT (1); - } - - - flag = 2; - - if ((aI1_min < aI2_min) || (aI1_min > aI2_max)) flag--; - if ((aI1_max < aI2_min) || (aI1_max > aI2_max)) flag--; - if ((aI1_min < aI2_min) && (aI1_max > aI2_max)) flag = 3; - - - switch (flag) { - default: - case 3: flag = F_I2_IN_I1; break; - case 2: flag = F_I1_IN_I2; break; - case 1: flag = F_OVERLAP; break; - case 0: flag = F_NO_OVERLAP; break; - } - - return (flag); -} - - -/* ---------------------------------------------------------------------- - * Function : "segInArea()". - */ - -static long segInArea(aPhseg, aX1, aY1, aX2, aY2) - struct phseg *aPhseg; - long aX1, aY1, aX2, aY2; -{ - long flagX, flagY; - - - if (aX1 > aX2) { - errMBK ("segInArea"); - eprintf ("Bad area X1(%ld) > X2(%ld) !\n", aX1, aX2); - EXIT (1); - } - if (aY1 > aY2) { - errMBK ("segInArea"); - eprintf ("Bad area Y1(%ld) > Y2(%ld) !\n", aY1, aY2); - EXIT (1); - } - - - flagX = intervalRel (aPhseg->X1, aPhseg->X2, aX1, aX2); - flagY = intervalRel (aPhseg->Y1, aPhseg->Y2, aY1, aY2); - - - if ((flagX == F_NO_OVERLAP) || (flagY == F_NO_OVERLAP)) - return (F_SEG_EXCLUS); - - if ((flagX == F_I1_IN_I2) && (flagY == F_I1_IN_I2)) - return (F_SEG_INCLUS); - - if ((flagX == F_I2_IN_I1) && (flagY == F_I2_IN_I1)) - return (F_SEG_HALFOVER); - - return (F_SEG_OVER); -} -# endif - - -/* ---------------------------------------------------------------------- - * Function : "shrinkFloorplan()". - */ - -extern void shrinkFloorplan(apPhfig) - struct phfig *apPhfig; -{ - struct phseg *pPhseg; - struct phcon *pPhcon; - struct phref *pPhref; - long XAB1, YAB1, XAB2, YAB2; - - - XAB1 = apPhfig->XAB1; - YAB1 = apPhfig->YAB1; - XAB2 = apPhfig->XAB2; - YAB2 = apPhfig->YAB2; - - /* Shrink the abutment-box. */ - apPhfig->XAB1 += FLOOR_XY_EXPAND; - apPhfig->YAB1 += FLOOR_XY_EXPAND; - apPhfig->XAB2 -= FLOOR_XY_EXPAND; - apPhfig->YAB2 -= FLOOR_XY_EXPAND; - - - /* Move terminals to the new AB. */ - for (pPhcon = apPhfig->PHCON; pPhcon != NULL; pPhcon = pPhcon->NEXT) { - if (pPhcon->XCON == XAB1) pPhcon->XCON = apPhfig->XAB1; - if (pPhcon->XCON == XAB2) pPhcon->XCON = apPhfig->XAB2; - if (pPhcon->YCON == YAB1) pPhcon->YCON = apPhfig->YAB1; - if (pPhcon->YCON == YAB2) pPhcon->YCON = apPhfig->YAB2; - } - - - /* Shrink segments to fit in the new AB. */ - for (pPhseg = apPhfig->PHSEG; pPhseg != NULL; pPhseg = pPhseg->NEXT) { - if (pPhseg->X1 == XAB1) pPhseg->X1 = apPhfig->XAB1; - if (pPhseg->X2 == XAB2) pPhseg->X2 = apPhfig->XAB2; - if (pPhseg->Y1 == YAB1) pPhseg->Y1 = apPhfig->YAB1; - if (pPhseg->Y2 == YAB2) pPhseg->Y2 = apPhfig->YAB2; - } - - - /* Move references to the new AB. */ - for (pPhref = apPhfig->PHREF; pPhref != NULL; pPhref = pPhref->NEXT) { - if (pPhref->XREF == XAB1) pPhref->XREF = apPhfig->XAB1; - if (pPhref->XREF == XAB2) pPhref->XREF = apPhfig->XAB2; - if (pPhref->YREF == YAB1) pPhref->YREF = apPhfig->YAB1; - if (pPhref->YREF == YAB2) pPhref->YREF = apPhfig->YAB2; - } -} - - -/* ---------------------------------------------------------------------- - * Function : "protectPowmid()". - */ - -extern void protectPowmid(apPhfig) - struct phfig *apPhfig; -{ -# if 0 - struct phins *pIns; -# endif - struct phfig *pModel; - char *powmidName; - long width, height, expand; - - - expand = FLOOR_XY_EXPAND; - - - powmidName = namealloc ("powmid_x0"); - - pModel = getphfig ("powmid_x0", 'A'); - width = pModel->XAB2 - pModel->XAB1; - height = pModel->YAB2 - pModel->YAB1; - -# if 0 - for (pIns = apPhfig->PHINS; pIns != NULL; pIns = pIns->NEXT) { - if (pIns->FIGNAME == powmidName) { - if (pIns->YINS == apPhfig->YAB1 + expand) { - DEF2MBK_blockage (apPhfig, - MBK2DEF_length (pIns->XINS), - MBK2DEF_length (apPhfig->YAB1), - MBK2DEF_length (width), - MBK2DEF_length ((MBK_X_GRID << 1) + expand) - ); - } - - if (pIns->YINS + height == apPhfig->YAB2 - expand) { - DEF2MBK_blockage (apPhfig, - MBK2DEF_length (pIns->XINS), - MBK2DEF_length (apPhfig->YAB2 - - (MBK_X_GRID << 1) - expand), - MBK2DEF_length (width), - MBK2DEF_length ((MBK_X_GRID << 1) + expand) - ); - } - } - } -# endif -} diff --git a/alliance/src/sea/src/util_Inter.c b/alliance/src/sea/src/util_Inter.c deleted file mode 100644 index 880b6236..00000000 --- a/alliance/src/sea/src/util_Inter.c +++ /dev/null @@ -1,296 +0,0 @@ - -/* - * $Id: util_Inter.c,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./util_Inter.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "util_Defs.h" -# include "debugoff.h" - - - -/* ------------------------------------------------------------------ - * Local constants. - */ - -# define SHIFT_MAX 8 -# define F_MIN_IN 0x00000001 -# define F_MIN_LOWER 0x00000002 -# define F_MIN_GREATER 0x00000004 -# define F_MAX_IN ((F_MIN_IN) << SHIFT_MAX) -# define F_MAX_LOWER ((F_MIN_LOWER) << SHIFT_MAX) -# define F_MAX_GREATER ((F_MIN_GREATER) << SHIFT_MAX) -# define C_INTER_LOWER (F_MIN_LOWER | F_MAX_LOWER ) -# define C_INTER_CROSS_MIN (F_MIN_LOWER | F_MAX_IN ) -# define C_INTER_IN (F_MIN_IN | F_MAX_IN ) -# define C_INTER_CROSS_MAX (F_MIN_IN | F_MAX_GREATER) -# define C_INTER_GREATER (F_MIN_GREATER | F_MAX_GREATER) -# define C_INTER_OUT (F_MIN_LOWER | F_MAX_GREATER) - - -# define INBOUNDS_INTER(i,v) (inbounds ((i)->min, (i)->max, (v))) - - -/* ------------------------------------------------------------------ - * Local functions declarations. - */ - -static long inbounds __FP((long aMin, long aMax, long aValue)); -static struct eInter_s *alloceinter __FP((long aMin, long aMax)); -static void freeeinter __FP((struct eInter_s *apInter)); -static long cmpeinter __FP((struct eInter_s *apInterA, - struct eInter_s *apInterB)); - - - -/* - * /----------------------------------------------------------------\ - * | Functions Definitions | - * \----------------------------------------------------------------/ - */ - -/* ------------------------------------------------------------------ - * Function : "inbounds()". - */ - -static long inbounds (aMin, aMax, aValue) - long aMin, aMax, aValue; -{ - if ((aValue >= aMin) && (aValue <= aMax)) return (F_MIN_IN); - - if (aValue < aMin) return (F_MIN_LOWER); - - return (F_MIN_GREATER); -} - - -/* ------------------------------------------------------------------ - * Function : "alloceinter()". - */ - -static struct eInter_s *alloceinter (aMin, aMax) - long aMin, aMax; -{ - struct eInter_s *newInter; - - - if (!(newInter = (struct eInter_s*)mbkalloc(sizeof (struct eInter_s)))) { - eprinth ("util_Inter.c"); - eprintf ("Not enough memory to allcate an interval element.\n"); - EXIT (1); - } - - newInter->min = aMin; - newInter->max = aMax; - newInter->next = NULL; - - return (newInter); -} - - -/* ------------------------------------------------------------------ - * Function : "freeeinter()". - */ - -static void freeeinter (apInter) - struct eInter_s *apInter; -{ - mbkfree ((void*)apInter); -} - - -/* ------------------------------------------------------------------ - * Function : "cmpeinter()". - */ - -static long cmpeinter (apInterA, apInterB) - struct eInter_s *apInterA, *apInterB; -{ - long state; - - - state = INBOUNDS_INTER(apInterA, apInterB->min); - state |= INBOUNDS_INTER(apInterA, apInterB->max) << SHIFT_MAX; - - return (state); -} - - -/* ------------------------------------------------------------------ - * Function : "allocinter()". - */ - -static struct lInter_s *allocinter () -{ - struct lInter_s *newInter; - - - if (!(newInter = (struct lInter_s*)mbkalloc(sizeof (struct lInter_s)))) { - eprinth ("util_Inter.c"); - eprintf ("Not enough memory to allocate an interval object.\n"); - EXIT (1); - } - - newInter->min = 0; - newInter->max = 0; - newInter->len = 0; - newInter->l = NULL; - - return (newInter); -} - - -/* ------------------------------------------------------------------ - * Function : "printinter()". - */ - -extern void printinter (apInter) - struct lInter_s *apInter; -{ - struct eInter_s *pInter; - - - fflush (stderr); - fprintf (stdout, " o Interval set : (min = %ld, max = %ld, len = %ld)\n", - apInter->min, - apInter->max, - apInter->len); - fflush (stdout); - - for (pInter = apInter->l; pInter != NULL; pInter = pInter->next) { - fprintf (stdout, " [%6ld,%6ld]\n", pInter->min, pInter->max); - fflush (stdout); - } -} - - -/* ------------------------------------------------------------------ - * Function : "addinter()". - */ - -extern struct lInter_s *addinter (apInter, aMin, aMax) - struct lInter_s *apInter; - long aMin; - long aMax; -{ - struct eInter_s *currInter; - struct eInter_s *newInter; - struct eInter_s mergeInter; - struct eInter_s **ppInter; - - - /* Case of the first interval. */ - if (apInter == NULL) apInter = allocinter (); - - - /* Update the interval list bounds. */ - apInter->max = m_Max(apInter->max, aMax); - apInter->min = m_Min(apInter->min, aMin); - - - mergeInter.min = aMin; - mergeInter.max = aMax; - newInter = NULL; - ppInter = &(apInter->l); - - - for (; *ppInter != NULL;) { - switch (cmpeinter (&mergeInter, *ppInter)) { - case C_INTER_LOWER: break; - case C_INTER_OUT: break; - - case C_INTER_CROSS_MIN: - (*ppInter)->max = mergeInter.max; - newInter = *ppInter; - break; - - case C_INTER_IN: - if (!newInter) { - (*ppInter)->min = mergeInter.min; - (*ppInter)->max = mergeInter.max; - newInter = *ppInter; - } else { - currInter = *ppInter; - *ppInter = (*ppInter)->next; - freeeinter (currInter); - apInter->len -= 1; - continue; - } - break; - - case C_INTER_CROSS_MAX: - if (!newInter) { - (*ppInter)->min = mergeInter.min; - newInter = *ppInter; - } else { - newInter->max = (*ppInter)->max; - mergeInter.max = (*ppInter)->max; - - currInter = *ppInter; - *ppInter = (*ppInter)->next; - freeeinter (currInter); - apInter->len -= 1; - continue; - } - break; - - case C_INTER_GREATER: - if (!newInter) { - newInter = alloceinter (mergeInter.min, mergeInter.max); - newInter->next = *ppInter; - *ppInter = newInter; - apInter->len += 1; - } - break; - } - - ppInter = &((*ppInter)->next); - } - - - /* Tail of first added interval. */ - if (!newInter) { - *ppInter = alloceinter (aMin, aMax); - apInter->len += 1; - } - - - return (apInter); -} - - -/* ------------------------------------------------------------------ - * Function : "freeinter()". - */ - -extern void freeinter (apInter) - struct lInter_s *apInter; -{ - struct eInter_s *pNextInter; - struct eInter_s *pInter; - - - for (pInter = apInter->l; pInter != NULL; ) { - pNextInter = pInter->next; - - freeeinter (pInter); - - pInter = pNextInter; - } - - mbkfree ((void*)apInter); -} diff --git a/alliance/src/sea/src/util_LEFDEF.c b/alliance/src/sea/src/util_LEFDEF.c deleted file mode 100644 index d621d5e3..00000000 --- a/alliance/src/sea/src/util_LEFDEF.c +++ /dev/null @@ -1,643 +0,0 @@ -/* - * $Id: util_LEFDEF.c,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./util_LEFDEF.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "debugoff.h" -# include "util_Defs.h" - - -/* ------------------------------------------------------------------ - * Global variables (declared `extern' in "util_Defs.h"). - */ - - long DEF_UNITS_MICRONS = 100L; - - - static char *getRowToken __FP((char *aS, char *aSepar, char *aRefName)); - - -/* - * /----------------------------------------------------------------\ - * | Functions Definitions | - * \----------------------------------------------------------------/ - */ - - -/* ------------------------------------------------------------------ - * Function : "DEF2MBK_length()". - */ - -extern long DEF2MBK_length(aL) - long aL; -{ - return ((aL * SCALE_X) / DEF_UNITS_MICRONS); -} - - -/* ------------------------------------------------------------------ - * Function : "MBK2DEF_length()". - */ - -extern long MBK2DEF_length(aL) - long aL; -{ - return ((aL * DEF_UNITS_MICRONS) / SCALE_X); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF2MBK_name()". - */ - -extern char *DEF2MBK_name(aS) - char *aS; -{ - int iS; - char *sTmp, *sAlloc, *pDelim; - - - iS = 0; if (aS[0] == '|') iS++; - sTmp = strdup (&aS[iS]); - - /* Translate '|' (hierarchical separator) to SEPAR. */ - for (iS = 0; sTmp[iS] != '\0'; iS++) - if (sTmp[iS] == '|') sTmp[iS] = SEPAR; - - /* Translate vectorisation : "name<2>" --> "name 2". */ - if ((pDelim = strchr (sTmp, '<'))) *pDelim = ' '; - if ((pDelim = strchr (sTmp, '>'))) *pDelim = '\0'; - if ((pDelim = strchr (sTmp, '('))) *pDelim = ' '; - if ((pDelim = strchr (sTmp, ')'))) *pDelim = '\0'; - - sAlloc = namealloc (sTmp); - free (sTmp); - - - return (sAlloc); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF2MBK_row()". - */ - -extern struct phref *DEF2MBK_row(apPhfig, - aRowName, aRowType, - aOrient, - aDoNumber, aByNumber, - aStepX, aStepY, - aX, aY) - struct phfig *apPhfig; - char *aRowName, *aRowType; - long aOrient; - long aDoNumber, aByNumber; - long aStepX, aStepY; - long aX, aY; -{ - static char ref_name[16384]; - - - sprintf (ref_name, - "%s.%s.%s_do_%ld_by_%ld_step_%ld_%ld", - aRowName, - aRowType, - DEF_orient2a(aOrient), - aDoNumber, - aByNumber, - aStepX, - aStepY); - - return (addphref(apPhfig, - "ref_ref", - ref_name, - aX, - aY)); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF2MBK_track()". - */ - -extern struct phref *DEF2MBK_track(apPhfig, - aAxisName, - aStart, - aDoNumber, - aStep, - asLayers, - aX, aY) - struct phfig *apPhfig; - char *aAxisName; - long aStart; - long aDoNumber; - long aStep; - char *asLayers; - long aX, aY; -{ - static char ref_name[16384]; - - - sprintf (ref_name, - "tracks.%s_%ld_do_%ld_step_%ld.%s", - aAxisName, - aStart, - aDoNumber, - aStep, - asLayers); - - return (addphref(apPhfig, - "ref_ref", - ref_name, - aX, - aY)); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF2MBK_blockage()". - */ - -extern struct phref *DEF2MBK_blockage(apPhfig, aX, aY, aWidth, aHeight) - struct phfig *apPhfig; - long aX, aY, aWidth, aHeight; -{ - static char ref_name[16384]; - - - sprintf (ref_name, - "blockage.%ld_%ld", - aWidth, - aHeight); - - return (addphref(apPhfig, - "ref_ref", - ref_name, - aX, - aY)); -} - - -/* ------------------------------------------------------------------ - * Function : "MBK2DEF_name()". - */ - -extern char *MBK2DEF_name(asLEF, asMBK) - char *asLEF, *asMBK; -{ - char sTmp[1024], *pS, *pI; - - - strncpy (sTmp, asMBK, 1023); - - /* Find the signal index separator ' '. */ - pI = (char*)NULL; - for(pS = sTmp; (*pS) != (char)0; pS++) if ((*pS) == ' ') pI = pS; - - - if (pI != (char*)NULL) { - *pI = (char)0; pI += 1; - sprintf (asLEF, "%s(%s)", sTmp, pI); - } else { - sprintf (asLEF, sTmp); - } - - return (asLEF); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF2MBK_transf()". - */ - -extern char DEF2MBK_transf(aO) - double aO; -{ - switch ((long)aO) { - case DEF_N: return (NOSYM); - case DEF_S: return (SYMXY); - case DEF_W: return (ROT_P); - case DEF_E: return (ROT_M); - case DEF_FN: return (SYM_X); - case DEF_FS: return (SYM_Y); - case DEF_FW: return (SY_RM); - case DEF_FE: return (SY_RP); - } - - return (NOSYM); -} - - -/* ------------------------------------------------------------------ - * Function : "MBK2DEF_direction()". - */ - -extern char MBK2DEF_direction(acDir) - char acDir; -{ - switch(acDir) { - case IN: return (C_DIRECTION_INPUT); - case OUT: return (C_DIRECTION_OUTPUT); - case INOUT: return (C_DIRECTION_INOUT); - case TRANSCV: - case TRISTATE: return (C_DIRECTION_TRISTATE); - } - - return (C_DIRECTION_NONE); -} - - -/* ------------------------------------------------------------------ - * Function : "MBK2DEF_locondir()". - */ - -extern char MBK2DEF_locondir (apLocon) - locon_list *apLocon; -{ - char dir; - - - dir = MBK2DEF_direction (apLocon->DIRECTION); - - if (dir == C_DIRECTION_NONE) { - dir = C_DIRECTION_INPUT; - wprinth (NULL); - wprintf ("Unknown direction for terminal \"%s\" (forced \"INPUT\").\n", - apLocon->NAME); - } - - return (dir); -} - - -/* ------------------------------------------------------------------ - * Function : "BEH2DEF_direction()". - */ - -extern char BEH2DEF_direction(acDir) - char acDir; -{ - switch (acDir) { - case 'I': return (C_DIRECTION_INPUT); - case 'O': return (C_DIRECTION_OUTPUT); - case 'B': return (C_DIRECTION_INOUT); - case 'Z': - case 'T': return (C_DIRECTION_TRISTATE); - } - - return (C_DIRECTION_NONE); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF2MBK_direction()". - */ - -extern char DEF2MBK_direction(aDEFdir) - double aDEFdir; -{ - switch ((long)aDEFdir) { - case DEF_INPUT: return (IN); - case DEF_OUTPUT: return (OUT); - case DEF_INOUT: return (INOUT); - case DEF_FEEDTHRU: return (INOUT); - } - - return (UNKNOWN); -} - - -/* ------------------------------------------------------------------ - * Function : "MBK2DEF_transf()". - */ - -extern char MBK2DEF_transf(aO) - char aO; -{ - switch (aO) { - case NOSYM: return (DEF_N); - case SYMXY: return (DEF_S); - case ROT_P: return (DEF_W); - case ROT_M: return (DEF_E); - case SYM_X: return (DEF_FN); - case SYM_Y: return (DEF_FS); - case SY_RP: return (DEF_FW); - case SY_RM: return (DEF_FE); - } - - return (DEF_N); -} - - -/* ------------------------------------------------------------------ - * Function : "getRowToken()". - */ - -static char *getRowToken(aS, aSepar, aRefName) - char *aS, *aSepar, *aRefName; -{ - char *token; - - if ((token = strtok (aS, aSepar)) == NULL) { - errMBK ("defsavelophfig"); - eprintf ("Malformed row reference name :\n \"%s\"\n", - aRefName); - EXIT (1); - } - - return (token); -} - - - -/* ------------------------------------------------------------------ - * Function : "MBK2DEF_row()". - */ - -extern void MBK2DEF_row(apPhref, - appRowName, appRowType, - apOrient, - apDoNumber, apByNumber, - apStepX, apStepY, - apX, apY) - struct phref *apPhref; - char **appRowName, **appRowType; - long *apOrient; - long *apDoNumber, *apByNumber; - long *apStepX, *apStepY; - long *apX, *apY; -{ - static char ref_name[16384]; - char *token; - - - strcpy (ref_name, apPhref->NAME); - - token = getRowToken (ref_name, ".", apPhref->NAME); - *appRowName = (char*)mbkalloc (sizeof (char) * strlen (token)); - strcpy (*appRowName, token); - strtoup (*appRowName); - - token = getRowToken (NULL, ".", apPhref->NAME); - *appRowType = (char*)mbkalloc (sizeof (char) * strlen (token)); - strcpy (*appRowType, token); - - token = strtoup (getRowToken (NULL, "_", apPhref->NAME)); - *apOrient = DEF_a2orient (token); - - token = strtoup (getRowToken (NULL, "_", apPhref->NAME)); - token = strtoup (getRowToken (NULL, "_", apPhref->NAME)); - *apDoNumber = atol (token); - - token = strtoup (getRowToken (NULL, "_", apPhref->NAME)); - token = strtoup (getRowToken (NULL, "_", apPhref->NAME)); - *apByNumber = atol (token); - - token = strtoup (getRowToken (NULL, "_", apPhref->NAME)); - token = strtoup (getRowToken (NULL, "_", apPhref->NAME)); - *apStepX = atol (token); - - token = strtoup (getRowToken (NULL, "_", apPhref->NAME)); - *apStepY = atol (token); - - *apX = apPhref->XREF; - *apY = apPhref->YREF; -} - - -/* ------------------------------------------------------------------ - * Function : "MBK2DEF_track()". - */ - -extern void MBK2DEF_track(apPhref, - apAxisName, - apStart, - apDoNumber, - apStep, - apsLayers, - apX, apY) - struct phref *apPhref; - char *apAxisName; - long *apStart; - long *apDoNumber; - long *apStep; - char **apsLayers; - long *apX, *apY; -{ - static char ref_name[16384]; - char *token; - - - strcpy (ref_name, apPhref->NAME); - - token = getRowToken (ref_name, ".", apPhref->NAME); - token = getRowToken (NULL, "_", apPhref->NAME); - *apAxisName = (char)toupper ((int)*token); - - token = getRowToken (NULL, "_", apPhref->NAME); - *apStart = atol (token); - - token = getRowToken (NULL, "_", apPhref->NAME); - token = getRowToken (NULL, "_", apPhref->NAME); - *apDoNumber = atol (token); - - token = getRowToken (NULL, "_", apPhref->NAME); - token = getRowToken (NULL, ".", apPhref->NAME); - *apStep = atol (token); - - token = getRowToken (NULL, ";", apPhref->NAME); - *apsLayers = (char*)mbkalloc (sizeof (char) * strlen (token)); - strcpy (*apsLayers, token); - strtoup (*apsLayers); - - for (token = *apsLayers; *token != '\0'; token++) - if (*token == '.') *token = ' '; - - *apX = apPhref->XREF; - *apY = apPhref->YREF; -} - - -/* ------------------------------------------------------------------ - * Function : "MBK2DEF_blockage()". - */ - -extern void MBK2DEF_blockage(apPhref, apXB1, apYB1, apWidth, apHeight) - struct phref *apPhref; - long *apXB1, *apYB1, *apWidth, *apHeight; -{ - static char ref_name[16384]; - char *token; - - - strcpy (ref_name, apPhref->NAME); - - token = getRowToken (ref_name, ".", apPhref->NAME); - token = getRowToken (NULL, "_", apPhref->NAME); - *apWidth = atol (token); - - token = getRowToken (NULL, "_", apPhref->NAME); - *apHeight = atol (token); - - *apXB1 = apPhref->XREF; - *apYB1 = apPhref->YREF; -} - - -/* ------------------------------------------------------------------ - * Function : "DEF_orient2a()". - */ - -extern char *DEF_orient2a(aT) - long aT; -{ - static char *tTransf[] = { "N", "S", "W", "E", "FN", "FS", "FW", "FE" }; - - - switch (aT) { - case DEF_N: return (tTransf[0]); - case DEF_S: return (tTransf[1]); - case DEF_W: return (tTransf[2]); - case DEF_E: return (tTransf[3]); - case DEF_FN: return (tTransf[4]); - case DEF_FS: return (tTransf[5]); - case DEF_FW: return (tTransf[6]); - case DEF_FE: return (tTransf[7]); - } - - return (tTransf[0]); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF_a2orient()". - */ - -extern long DEF_a2orient(aT) - char *aT; -{ - if (!strcmp (aT, "N")) return (DEF_N); - if (!strcmp (aT, "S")) return (DEF_S); - if (!strcmp (aT, "W")) return (DEF_W); - if (!strcmp (aT, "E")) return (DEF_E); - if (!strcmp (aT, "FN")) return (DEF_FN); - if (!strcmp (aT, "FS")) return (DEF_FS); - if (!strcmp (aT, "FW")) return (DEF_FW); - if (!strcmp (aT, "FE")) return (DEF_FE); - - return (DEF_N); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF_side2a()". - */ - -extern char *DEF_side2a(aSide) - char aSide; -{ - static char *tTransf[] = { "N", "S", "W", "E" }; - - - switch (aSide) { - case SOUTH: return (tTransf[0]); - case NORTH: return (tTransf[1]); - case EAST: return (tTransf[2]); - case WEST: return (tTransf[3]); - } - - return (tTransf[0]); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF_layer2a()". - */ - -extern char *DEF_layer2a(aLayer) - char aLayer; -{ - char *layerName; - - - __DBG (fprintf (stderr, "layer id %d\n", (int)aLayer); ) - switch (aLayer) { - case ALU1: layerName = "L_ALU1"; break; - case ALU2: layerName = "L_ALU2"; break; - case ALU3: layerName = "L_ALU3"; break; - case ALU4: layerName = "L_ALU4"; break; - case ALU5: layerName = "L_ALU5"; break; - case ALU6: layerName = "L_ALU6"; break; - case ALU7: layerName = "L_ALU7"; break; - case ALU8: layerName = "L_ALU8"; break; - case CALU1: layerName = "L_ALU1"; break; - case CALU2: layerName = "L_ALU2"; break; - case CALU3: layerName = "L_ALU3"; break; - case CALU4: layerName = "L_ALU4"; break; - case CALU5: layerName = "L_ALU5"; break; - case CALU6: layerName = "L_ALU6"; break; - case CALU7: layerName = "L_ALU7"; break; - case CALU8: layerName = "L_ALU8"; break; - case CONT_VIA: layerName = "L_VIA1"; break; - case CONT_VIA2: layerName = "L_VIA2"; break; - case CONT_VIA3: layerName = "L_VIA3"; break; - case CONT_VIA4: layerName = "L_VIA4"; break; - case CONT_VIA5: layerName = "L_VIA5"; break; - case CONT_VIA6: layerName = "L_VIA6"; break; - case CONT_VIA7: layerName = "L_VIA7"; break; - default: layerName = "L_MBK_ERROR"; break; - } - - return (layerName); -} - - -/* ------------------------------------------------------------------ - * Function : "DEF_via2a()". - */ - -extern char *DEF_via2a(aType, aDX, aDY, aViaName) - char aType; - long aDX, aDY; - char *aViaName; -{ - long flagDefault, length; - - - switch (aType) { - case CONT_VIA: strcpy (aViaName, "CONT_VIA"); break; - case CONT_VIA2: strcpy (aViaName, "CONT_VIA2"); break; - case CONT_VIA3: strcpy (aViaName, "CONT_VIA3"); break; - case CONT_VIA4: strcpy (aViaName, "CONT_VIA4"); break; - case CONT_VIA5: strcpy (aViaName, "CONT_VIA5"); break; - case CONT_VIA6: strcpy (aViaName, "CONT_VIA6"); break; - case CONT_VIA7: strcpy (aViaName, "CONT_VIA7"); break; - default: strcpy (aViaName, "MBK_ERROR"); break; - } - length = strlen (aViaName); - - flagDefault = (aDX <= MBKSCALE(2)) - && (aDY <= MBKSCALE(2)); - - if (!flagDefault) { - sprintf (aViaName + length, "_%ld_%ld", - MBK2DEF_length (aDX), - MBK2DEF_length (aDY)); - } - - return (aViaName); -} diff --git a/alliance/src/sea/src/util_MBK.c b/alliance/src/sea/src/util_MBK.c deleted file mode 100644 index 7c1d5d1b..00000000 --- a/alliance/src/sea/src/util_MBK.c +++ /dev/null @@ -1,2375 +0,0 @@ - -/* - * $Id: util_MBK.c,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./util_MBK.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "util_Defs.h" -# include "debugoff.h" - - -# define C_POWER_VDD (0) -# define C_POWER_VSS (1) -# define C_POWER_UNKNOWN (1024) - -# define TLOSEG_SIZE (512) - -# define SIZE_SNAME (1024) - - -/* ------------------------------------------------------------------ - * Internal types. - */ - - typedef struct sigalias_s { - char *name; /* The main signal name (getsigname()). */ - long flags; /* The subnet field. */ - } sigalias_t; - - - -/* ------------------------------------------------------------------ - * Global variables (declared `extern' in "util_Defs.h"). - */ - - long MBK_sigIndex = 0L; - - -/* ------------------------------------------------------------------ - * Local variables. - */ - - static authtable *LV_htSigAlias = NULL; - static struct sigalias_s *LV_tSigAlias = NULL; - - -/* ------------------------------------------------------------------ - * Local functions declarations. - */ - - static void buildtsigalias __FP((struct losig *apLosig)); - static void freetsigalias __FP((void)); - - static char *getlosegname __FP((struct eLoseg_s *apLoseg)); - - -/* - * /----------------------------------------------------------------\ - * | Functions Definitions | - * \----------------------------------------------------------------/ - */ - -/* ------------------------------------------------------------------ - * Function : "isobs()". - */ - -extern long isobs(apSeg) - struct phseg *apSeg; -{ - switch (apSeg->LAYER) { - case TALU1: - case TALU2: - case TALU3: - case TALU4: - case TALU5: - case TALU6: - case TALU7: - case TALU8: - case TALU9: - return (TRUE); - } - - return (FALSE); -} - - -/* ------------------------------------------------------------------ - * Function : "getsigaliasnumber()". - */ - -extern long getsigaliasnumber(apLosig) - struct losig *apLosig; -{ - struct chain *pChain; - long aliasNumber; - - - aliasNumber = 0; - - for (pChain = apLosig->NAMECHAIN; pChain != NULL; pChain = pChain->NEXT) { - aliasNumber++; - } - - return (aliasNumber - 1); -} - - -/* ------------------------------------------------------------------ - * Function : "signamecmp()". - */ - -extern long signamecmp(aLoname, aPhname) - char *aLoname, *aPhname; -{ - char *pS, *pVector; - char losigName[SIZE_SNAME]; - - - if (aLoname == aPhname) return (TRUE); - - /* Try to guess if the losig name was a vector name. */ - strcpy (losigName, aLoname); - - pVector = NULL; - for (pS = losigName; pS != '\0'; pS++) - if (*pS == '_') pVector = pS; - - if (!pVector) return (FALSE); - - for (pS = pVector + 1; pS != '\0'; pS++) - if (!isdigit ((int)*pS)) return (FALSE); - - *pVector = ' '; - - if (!strcmp (losigName, aPhname)) return (TRUE); - - return (FALSE); -} - - -/* ------------------------------------------------------------------ - * Function : "makesegnamelist()". - */ - -extern char **makesegnamelist(aName) - char *aName; -{ - static char *tSegAlias[1024]; - long mSegAlias; - char *pS, *pVector; - char losegName[SIZE_SNAME]; -# if 0 - char pathName[SIZE_SNAME]; -# endif - long iEnd; - - - mSegAlias = 0; - strcpy (losegName, aName); - iEnd = strlen (losegName) - 1; - - - /* Add the signal name "as is". */ - tSegAlias[mSegAlias++] = namealloc (losegName); - - /* Try to find if it is a vector. */ - pVector = NULL; - for (pS = losegName + iEnd; pS != losegName; pS--) { - if (*pS == ' ') { - *pS = '_'; - tSegAlias[mSegAlias++] = namealloc (losegName); - } - } - - -# if 0 - /* This code is no longer needed, for we. */ - /* Loop on the path name, using SEPAR. */ - for (; iEnd > 0; iEnd--) { - if (losegName[iEnd] == SEPAR) { - strncpy (pathName, losegName, iEnd); - pathName[iEnd] = '\0'; - - /* Add the path name "as is". */ - tSegAlias[mSegAlias++] = pathName; - - /* Try to find if it is a vector. */ - pVector = NULL; - for (pS = pathName + iEnd; pS != pathName; pS--) { - if (*pS == ' ') { - *pS = '_'; - tSegAlias[mSegAlias++] = pathName; - } - } - } - } /* End of "iEnd" loop. */ -# endif - - - tSegAlias[mSegAlias++] = NULL; - - return (tSegAlias); -} - - -/* ------------------------------------------------------------------ - * Function : "printMBKEnv()". - */ - -extern void printMBKEnv() -{ - int i; - - mprintf2 (" o MBK environment :\n\n" ); - mprintf2 (" MBK_IN_LO := %s\n", IN_LO ); - mprintf2 (" MBK_OUT_LO := %s\n", OUT_LO ); - mprintf2 (" MBK_IN_PH := %s\n", IN_PH ); - mprintf2 (" MBK_OUT_PH := %s\n", OUT_PH ); - mprintf2 (" MBK_WORK_LIB := %s\n", WORK_LIB); - - for(i = 0; CATA_LIB[i] != (char *)NULL; i++) { - if (i == 0) mprintf2 (" MBK_CATA_LIB := "); - else mprintf2 (" "); - mprintf2 ("%s\n", CATA_LIB[i]); - } - - mprintf2 (" MBK_CATAL_NAME := %s\n", CATAL); - mprintf2 (" MBK_VDD := %s\n", VDD ); - mprintf2 (" MBK_VSS := %s\n", VSS ); - mprintf2 (" MBK_SEPAR := %c\n", SEPAR); - mprintf2 ("\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "getAltVIALayer()". - */ - -extern char getAltVIALayer(aVIA, aLayer) - char aVIA, aLayer; -{ - char topLayer, bottomLayer, topCLayer, bottomCLayer, dualLayer; - - - topLayer = ALU1; - bottomLayer = ALU2; - topCLayer = CALU1; - bottomCLayer = CALU2; - - switch (aVIA) { - case CONT_POLY: - topLayer = ALU1; bottomLayer = POLY; - topCLayer = CALU1; bottomCLayer = POLY; - break; - case CONT_VIA: - topLayer = ALU2; bottomLayer = ALU1; - topCLayer = CALU2; bottomCLayer = CALU1; - break; - case CONT_VIA2: - topLayer = ALU3; bottomLayer = ALU2; - topCLayer = CALU3; bottomCLayer = CALU2; - break; - case CONT_VIA3: - topLayer = ALU4; bottomLayer = ALU3; - topCLayer = CALU4; bottomCLayer = CALU3; - break; - case CONT_VIA4: - topLayer = ALU5; bottomLayer = ALU4; - topCLayer = CALU5; bottomCLayer = CALU4; - break; - case CONT_VIA5: - topLayer = ALU6; bottomLayer = ALU5; - topCLayer = CALU6; bottomCLayer = CALU5; - break; - case CONT_VIA6: - topLayer = ALU7; bottomLayer = ALU6; - topCLayer = CALU7; bottomCLayer = CALU6; - break; - case CONT_VIA7: - topLayer = ALU8; bottomLayer = ALU7; - topCLayer = CALU8; bottomCLayer = CALU7; - break; - case CONT_VIA8: - topLayer = ALU9; bottomLayer = ALU8; - topCLayer = CALU9; bottomCLayer = CALU8; - break; - case CONT_TURN1: - topLayer = ALU1; bottomLayer = ALU1; - topCLayer = CALU1; bottomCLayer = CALU1; - break; - case CONT_TURN2: - topLayer = ALU2; bottomLayer = ALU2; - topCLayer = CALU2; bottomCLayer = CALU2; - break; - case CONT_TURN3: - topLayer = ALU3; bottomLayer = ALU3; - topCLayer = CALU3; bottomCLayer = CALU3; - break; - case CONT_TURN4: - topLayer = ALU4; bottomLayer = ALU4; - topCLayer = CALU4; bottomCLayer = CALU4; - break; - case CONT_TURN5: - topLayer = ALU5; bottomLayer = ALU5; - topCLayer = CALU5; bottomCLayer = CALU5; - break; - case CONT_TURN6: - topLayer = ALU6; bottomLayer = ALU6; - topCLayer = CALU6; bottomCLayer = CALU6; - break; - case CONT_TURN7: - topLayer = ALU7; bottomLayer = ALU7; - topCLayer = CALU7; bottomCLayer = CALU7; - break; - case CONT_TURN8: - topLayer = ALU8; bottomLayer = ALU8; - topCLayer = CALU8; bottomCLayer = CALU8; - break; - case CONT_TURN9: - topLayer = ALU9; bottomLayer = ALU9; - topCLayer = CALU9; bottomCLayer = CALU9; - break; - default: - errMBK ("getAltVIALayer"); - eprintf ("Unknown VIA id %d.\n", (int)aVIA); - EXIT (1); - } - - - /* ALU connectivity. */ - dualLayer = (aLayer == topLayer) ? bottomLayer : - ((aLayer == bottomLayer) ? topLayer : (LAST_LAYER + 1)); - - /* CALU connectivity. */ - if (dualLayer == LAST_LAYER + 1) { - __DBG( - fprintf (stderr, "This is a CALU %d %d | ", (int)aVIA, (int)aLayer); - fprintf (stderr, "topC = %d, bottomC = %d, ", (int)topCLayer, - (int)bottomCLayer); - ) - dualLayer = (aLayer == topCLayer) ? bottomCLayer : - ((aLayer == bottomCLayer) ? topCLayer : (LAST_LAYER + 1)); - __DBG( fprintf (stderr, "Layer is now %d\n", (int)dualLayer); ) - } - - if (dualLayer == LAST_LAYER + 1) { - errMBK ("getAltVIALayer"); - eprintf ("VIA id %d is not contiguous with layer id %d\n", - (int)aVIA, (int)aLayer); - EXIT (1); - } - - return (dualLayer); -} - - -/* ------------------------------------------------------------------ - * Function : "getTopVIALayer()". - */ - -extern char getTopVIALayer(aVIA) - char aVIA; -{ - char topLayer; - - - topLayer = ALU1; - - switch (aVIA) { - case CONT_BODY_N: topLayer = ALU1; break; - case CONT_BODY_P: topLayer = ALU1; break; - case CONT_DIF_N: topLayer = ALU1; break; - case CONT_DIF_P: topLayer = ALU1; break; - case CONT_POLY: topLayer = ALU1; break; - case CONT_POLY2: topLayer = ALU1; break; - case CONT_VIA: topLayer = ALU2; break; - case CONT_VIA2: topLayer = ALU3; break; - case CONT_VIA3: topLayer = ALU4; break; - case CONT_VIA4: topLayer = ALU5; break; - case CONT_VIA5: topLayer = ALU6; break; - case CONT_VIA6: topLayer = ALU7; break; - case CONT_VIA7: topLayer = ALU8; break; - case CONT_VIA8: topLayer = ALU9; break; - case CONT_TURN1: topLayer = ALU1; break; - case CONT_TURN2: topLayer = ALU2; break; - case CONT_TURN3: topLayer = ALU3; break; - case CONT_TURN4: topLayer = ALU4; break; - case CONT_TURN5: topLayer = ALU5; break; - case CONT_TURN6: topLayer = ALU6; break; - case CONT_TURN7: topLayer = ALU7; break; - case CONT_TURN8: topLayer = ALU8; break; - case CONT_TURN9: topLayer = ALU9; break; - default: - errMBK ("getTopVIALayer"); - eprintf ("Unknown VIA id %d.\n", (int)aVIA); - EXIT (1); - } - - - return (topLayer); -} - - -/* ------------------------------------------------------------------ - * Function : "getBottomVIALayer()". - */ - -extern char getBottomVIALayer(aVIA) - char aVIA; -{ - char bottomLayer; - - - bottomLayer = ALU1; - - switch (aVIA) { - case CONT_BODY_N: bottomLayer = NWELL; break; - case CONT_BODY_P: bottomLayer = PWELL; break; - case CONT_DIF_N: bottomLayer = NDIF; break; - case CONT_DIF_P: bottomLayer = PDIF; break; - case CONT_POLY: bottomLayer = POLY; break; - case CONT_POLY2: bottomLayer = POLY2; break; - case CONT_VIA: bottomLayer = ALU1; break; - case CONT_VIA2: bottomLayer = ALU2; break; - case CONT_VIA3: bottomLayer = ALU3; break; - case CONT_VIA4: bottomLayer = ALU4; break; - case CONT_VIA5: bottomLayer = ALU5; break; - case CONT_VIA6: bottomLayer = ALU6; break; - case CONT_VIA7: bottomLayer = ALU7; break; - case CONT_VIA8: bottomLayer = ALU8; break; - case CONT_TURN1: bottomLayer = ALU1; break; - case CONT_TURN2: bottomLayer = ALU2; break; - case CONT_TURN3: bottomLayer = ALU3; break; - case CONT_TURN4: bottomLayer = ALU4; break; - case CONT_TURN5: bottomLayer = ALU5; break; - case CONT_TURN6: bottomLayer = ALU6; break; - case CONT_TURN7: bottomLayer = ALU7; break; - case CONT_TURN8: bottomLayer = ALU8; break; - case CONT_TURN9: bottomLayer = ALU9; break; - default: - errMBK ("getBottomVIALayer"); - eprintf ("Unknown VIA id %d.\n", (int)aVIA); - EXIT (1); - } - - - return (bottomLayer); -} - - -/* ------------------------------------------------------------------ - * Function : "isVIALayer()". - */ - -extern long isVIALayer(aVIA, aLayer) - char aVIA; - char aLayer; -{ - switch (aVIA) { - case CONT_BODY_N: - if (aLayer == NWELL) return (TRUE); - case CONT_BODY_P: - if (aLayer == PWELL) return (TRUE); - if (aLayer == ALU1) return (TRUE); - if (aLayer == CALU1) return (TRUE); - break; - case CONT_DIF_N: - if (aLayer == NDIF) return (TRUE); - case CONT_DIF_P: - if (aLayer == PDIF) return (TRUE); - if (aLayer == ALU1) return (TRUE); - if (aLayer == CALU1) return (TRUE); - break; - case CONT_POLY: - if (aLayer == POLY) return (TRUE); - if (aLayer == ALU1) return (TRUE); - if (aLayer == CALU1) return (TRUE); - break; - case CONT_POLY2: - if (aLayer == POLY2) return (TRUE); - if (aLayer == ALU1) return (TRUE); - if (aLayer == CALU1) return (TRUE); - break; - case CONT_VIA8: - if (aLayer == ALU9) return (TRUE); - if (aLayer == CALU9) return (TRUE); - case CONT_VIA7: - if (aLayer == ALU8) return (TRUE); - if (aLayer == CALU8) return (TRUE); - case CONT_VIA6: - if (aLayer == ALU7) return (TRUE); - if (aLayer == CALU7) return (TRUE); - case CONT_VIA5: - if (aLayer == ALU6) return (TRUE); - if (aLayer == CALU6) return (TRUE); - case CONT_VIA4: - if (aLayer == ALU5) return (TRUE); - if (aLayer == CALU5) return (TRUE); - case CONT_VIA3: - if (aLayer == ALU4) return (TRUE); - if (aLayer == CALU4) return (TRUE); - case CONT_VIA2: - if (aLayer == ALU3) return (TRUE); - if (aLayer == CALU3) return (TRUE); - case CONT_VIA: - if (aLayer == ALU2) return (TRUE); - if (aLayer == CALU2) return (TRUE); - if (aLayer == ALU1) return (TRUE); - if (aLayer == CALU1) return (TRUE); - break; - case CONT_TURN9: - if (aLayer == ALU9) return (TRUE); - if (aLayer == CALU9) return (TRUE); - break; - case CONT_TURN8: - if (aLayer == ALU8) return (TRUE); - if (aLayer == CALU8) return (TRUE); - break; - case CONT_TURN7: - if (aLayer == ALU7) return (TRUE); - if (aLayer == CALU7) return (TRUE); - break; - case CONT_TURN6: - if (aLayer == ALU6) return (TRUE); - if (aLayer == CALU6) return (TRUE); - break; - case CONT_TURN5: - if (aLayer == ALU5) return (TRUE); - if (aLayer == CALU5) return (TRUE); - break; - case CONT_TURN4: - if (aLayer == ALU4) return (TRUE); - if (aLayer == CALU4) return (TRUE); - break; - case CONT_TURN3: - if (aLayer == ALU3) return (TRUE); - if (aLayer == CALU3) return (TRUE); - break; - case CONT_TURN2: - if (aLayer == ALU2) return (TRUE); - if (aLayer == CALU2) return (TRUE); - break; - case CONT_TURN1: - if (aLayer == ALU1) return (TRUE); - if (aLayer == CALU1) return (TRUE); - break; - default: - errMBK ("isVIALayer"); - eprintf ("Unknown VIA id %d.\n", (int)aVIA); - EXIT (1); - } - - return (FALSE); -} - - -/* ------------------------------------------------------------------ - * Function : "getUpVIALayer()". - */ - -extern long getUpVIALayer(aVIA, aLayer) - char aVIA; - char aLayer; -{ - char upLayer; - - - if (!isVIALayer (aVIA, aLayer)) { - errMBK ("getUpVIALayer"); - eprintf ("Layer id %d do not belong to VIA id %d.\n", - (int)aLayer, (int)aVIA); - EXIT (1); - } - - upLayer = getUpLayer (aLayer); - if (!isVIALayer (aVIA, upLayer)) upLayer = aLayer; - - return (upLayer); -} - - -/* ------------------------------------------------------------------ - * Function : "getTurnVIA()". - */ - -extern char getTurnVIA(aLayer) - char aLayer; -{ - char turnVIA; - - - turnVIA = CONT_TURN1; - - switch (aLayer) { - case ALU1: - case CALU1: turnVIA = CONT_TURN1; break; - case ALU2: - case CALU2: turnVIA = CONT_TURN3; break; - case ALU3: - case CALU3: turnVIA = CONT_TURN4; break; - case ALU4: - case CALU4: turnVIA = CONT_TURN5; break; - case ALU5: - case CALU5: turnVIA = CONT_TURN6; break; - case ALU6: - case CALU6: turnVIA = CONT_TURN7; break; - case ALU7: - case CALU7: turnVIA = CONT_TURN8; break; - case ALU8: - case CALU8: turnVIA = CONT_TURN9; break; - case ALU9: - case CALU9: turnVIA = CONT_TURN9; break; - default: - errMBK ("getTurnVIA"); - eprintf ("No turn VIA for layer id %d.\n", (int)aLayer); - EXIT (1); - } - - return (turnVIA); -} - - -/* ------------------------------------------------------------------ - * Function : "getUpLayer()". - */ - -extern char getUpLayer(aLayer) - char aLayer; -{ - char upLayer; - - - upLayer = ALU1; - - switch (aLayer) { - case NWELL: upLayer = ALU1; break; - case PWELL: upLayer = ALU1; break; - case NTIE: upLayer = ALU1; break; - case PTIE: upLayer = ALU1; break; - case NDIF: upLayer = ALU1; break; - case PDIF: upLayer = ALU1; break; - case NTRANS: upLayer = ALU1; break; - case PTRANS: upLayer = ALU1; break; - case POLY: upLayer = ALU1; break; - case ALU1: upLayer = ALU2; break; - case CALU1: upLayer = ALU2; break; - case TALU1: upLayer = ALU2; break; - case ALU2: upLayer = ALU3; break; - case CALU2: upLayer = ALU3; break; - case TALU2: upLayer = ALU3; break; - case ALU3: upLayer = ALU4; break; - case CALU3: upLayer = ALU4; break; - case TALU3: upLayer = ALU4; break; - case ALU4: upLayer = ALU5; break; - case CALU4: upLayer = ALU5; break; - case TALU4: upLayer = ALU5; break; - case ALU5: upLayer = ALU6; break; - case CALU5: upLayer = ALU6; break; - case TALU5: upLayer = ALU6; break; - case ALU6: upLayer = ALU7; break; - case CALU6: upLayer = ALU7; break; - case TALU6: upLayer = ALU7; break; - case ALU7: upLayer = ALU8; break; - case CALU7: upLayer = ALU8; break; - case TALU7: upLayer = ALU8; break; - case ALU8: upLayer = ALU9; break; - case CALU8: upLayer = ALU9; break; - case TALU8: upLayer = ALU9; break; - case ALU9: upLayer = ALU9; break; - case CALU9: upLayer = ALU9; break; - case TALU9: upLayer = ALU9; break; - default: - errMBK ("getUpLayer"); - eprintf ("Unknown Layer id %d.\n", (int)aLayer); - EXIT (1); - } - - return (upLayer); -} - - -/* ------------------------------------------------------------------ - * Function : "cmpALU()". - */ - -extern long cmpALU(aLayer1, aLayer2) - char aLayer1, aLayer2; -{ - switch(aLayer1) { - case ALU1: - switch(aLayer2) { - case ALU1: return(F_EQUAL_M); - case CALU1: return(F_EQUAL_C); - case TALU1: return(F_EQUAL_T); - } - break; - - case ALU2: - switch(aLayer2) { - case ALU2: return(F_EQUAL_M); - case CALU2: return(F_EQUAL_C); - case TALU2: return(F_EQUAL_T); - } - break; - - case ALU3: - switch(aLayer2) { - case ALU3: return(F_EQUAL_M); - case CALU3: return(F_EQUAL_C); - case TALU3: return(F_EQUAL_T); - } - break; - - case ALU4: - switch(aLayer2) { - case ALU4: return(F_EQUAL_M); - case CALU4: return(F_EQUAL_C); - case TALU4: return(F_EQUAL_T); - } - break; - - case ALU5: - switch(aLayer2) { - case ALU5: return(F_EQUAL_M); - case CALU5: return(F_EQUAL_C); - case TALU5: return(F_EQUAL_T); - } - break; - - case ALU6: - switch(aLayer2) { - case ALU6: return(F_EQUAL_M); - case CALU6: return(F_EQUAL_C); - case TALU6: return(F_EQUAL_T); - } - break; - } - - return(FALSE); -} - - -/* ------------------------------------------------------------------ - * Function : "getALU()". - */ - -extern char getALU(aLayer) - char aLayer; -{ - char ALU; - - - ALU = CALU1; - - switch (aLayer) { - case CALU1: - case ALU1: ALU = ALU1; break; - case CALU2: - case ALU2: ALU = ALU2; break; - case CALU3: - case ALU3: ALU = ALU3; break; - case CALU4: - case ALU4: ALU = ALU4; break; - case CALU5: - case ALU5: ALU = ALU5; break; - case CALU6: - case ALU6: ALU = ALU6; break; - case CALU7: - case ALU7: ALU = ALU7; break; - case CALU8: - case ALU8: ALU = ALU8; break; - case CALU9: - case ALU9: ALU = ALU9; break; - default: - errMBK ("getALU"); - eprintf ("No ALU for layer id %d.\n", (int)aLayer); - EXIT (1); - } - - - return (ALU); -} - - -/* ------------------------------------------------------------------ - * Function : "getCALU()". - */ - -extern char getCALU(aLayer) - char aLayer; -{ - char CALU; - - - CALU = CALU1; - - switch (aLayer) { - case CALU1: - case ALU1: CALU = CALU1; break; - case CALU2: - case ALU2: CALU = CALU2; break; - case CALU3: - case ALU3: CALU = CALU3; break; - case CALU4: - case ALU4: CALU = CALU4; break; - case CALU5: - case ALU5: CALU = CALU5; break; - case CALU6: - case ALU6: CALU = CALU6; break; - case CALU7: - case ALU7: CALU = CALU7; break; - case CALU8: - case ALU8: CALU = CALU8; break; - case CALU9: - case ALU9: CALU = CALU9; break; - default: - errMBK ("getCALU"); - eprintf ("No CALU for layer id %d.\n", (int)aLayer); - EXIT (1); - } - - - return (CALU); -} - - -/* ------------------------------------------------------------------ - * Function : "isCALU()". - */ - -extern long isCALU(aLayer) - char aLayer; -{ - long flag; - - - flag = FALSE; - switch (aLayer) { - case CALU1: - case CALU2: - case CALU3: - case CALU4: - case CALU5: - case CALU6: - case CALU7: - case CALU8: - case CALU9: flag = TRUE; break; - } - - - return (flag); -} - - -/* ------------------------------------------------------------------ - * Function : "getTALU()". - */ - -extern char getTALU(aLayer) - char aLayer; -{ - char TALU; - - - TALU = TALU1; - - switch (aLayer) { - case TALU1: - case CALU1: - case ALU1: TALU = TALU1; break; - case TALU2: - case CALU2: - case ALU2: TALU = TALU2; break; - case TALU3: - case CALU3: - case ALU3: TALU = TALU3; break; - case TALU4: - case CALU4: - case ALU4: TALU = TALU4; break; - case TALU5: - case CALU5: - case ALU5: TALU = TALU5; break; - case TALU6: - case CALU6: - case ALU6: TALU = TALU6; break; - case TALU7: - case CALU7: - case ALU7: TALU = TALU7; break; - case TALU8: - case CALU8: - case ALU8: TALU = TALU8; break; - case TALU9: - case CALU9: - case ALU9: TALU = TALU9; break; - default: - errMBK ("getTALU"); - eprintf ("No TALU for layer id %d.\n", (int)aLayer); - EXIT (1); - } - - - return (TALU); -} - - -/* ------------------------------------------------------------------ - * Function : "getLayerTrackWidth()". - */ - -extern long getLayerTrackWidth(aLayer) - char aLayer; -{ - long trackWidth; - - - trackWidth = MBKSCALE(2); - - switch (aLayer) { - case CALU1: - case TALU1: - case ALU1: trackWidth = MBKSCALE (1); break; - case CALU2: - case TALU2: - case ALU2: - case CALU3: - case TALU3: - case ALU3: - case CALU4: - case TALU4: - case ALU4: - case CALU5: - case TALU5: - case ALU5: - case CALU6: - case TALU6: - case ALU6: - case CALU7: - case TALU7: - case ALU7: - case CALU8: - case TALU8: - case ALU8: - case CALU9: - case TALU9: - case ALU9: trackWidth = MBKSCALE (2); break; - default: - errMBK ("getLayerTrackWidth"); - eprintf ("No minimal track width for layer id %d.\n", (int)aLayer); - EXIT (1); - } - - return (trackWidth); -} - - -/* ------------------------------------------------------------------ - * Function : "xyflatseg()". - */ - -extern void xyflatseg(apFlatSeg, apSeg, - aXINS, aYINS, - aXAB1, aYAB1, - aXAB2, aYAB2, - aTransf) - struct phseg *apFlatSeg, *apSeg; - long aXINS, aYINS, aXAB1, aYAB1, aXAB2, aYAB2; - char aTransf; -{ - long swap; - - - apFlatSeg->NAME = apSeg->NAME; - apFlatSeg->LAYER = apSeg->LAYER; - apFlatSeg->WIDTH = apSeg->WIDTH; - - - xyflat (&apFlatSeg->X1, &apFlatSeg->Y1, - apSeg->X1, apSeg->Y1, - aXINS, aYINS, - aXAB1, aYAB1, - aXAB2, aYAB2, - aTransf); - - xyflat (&apFlatSeg->X2, &apFlatSeg->Y2, - apSeg->X2, apSeg->Y2, - aXINS, aYINS, - aXAB1, aYAB1, - aXAB2, aYAB2, - aTransf); - - - if (apFlatSeg->X1 > apFlatSeg->X2) { - swap = apFlatSeg->X1; - apFlatSeg->X1 = apFlatSeg->X2; - apFlatSeg->X2 = swap; - } - - if (apFlatSeg->Y1 > apFlatSeg->Y2) { - swap = apFlatSeg->Y1; - apFlatSeg->Y1 = apFlatSeg->Y2; - apFlatSeg->Y2 = swap; - } - - if (apFlatSeg->Y1 == apFlatSeg->Y2) { - if (apFlatSeg->X1 < apFlatSeg->X2) apFlatSeg->TYPE = LEFT; - else apFlatSeg->TYPE = RIGHT; - } else { - if (apFlatSeg->Y1 < apFlatSeg->Y2) apFlatSeg->TYPE = UP; - else apFlatSeg->TYPE = DOWN; - } -} - - -/* ------------------------------------------------------------------ - * Function : "isPad()". - */ - -extern long isPad (asCell) - char *asCell; -{ - char *i, *ext; - - ext = NULL; - for(i = asCell; *i != (char)0; i++) - if (*i == '_') ext = i; - - if (ext == NULL) return (FALSE); - if (strcmp (ext, "_sp")) return (FALSE); - - return (TRUE); -} - - -/* ------------------------------------------------------------------ - * Function : "initSigIndex()". - */ - -extern long initSigIndex(apLoSig) - losig_list *apLoSig; -{ - losig_list *pLoSig; - long iMax; - - iMax = 0L; - for(pLoSig = apLoSig; pLoSig != (losig_list*)NULL; pLoSig = pLoSig->NEXT) - if (pLoSig->INDEX > iMax) iMax = pLoSig->INDEX; - - return(MBK_sigIndex = iMax); -} - - -/* ------------------------------------------------------------------ - * Function : "cmpSigName()". - */ - -extern long cmpSigName(apLoSig, asName) - losig_list *apLoSig; - char *asName; -{ - chain_list *pChain; - - - for(pChain = apLoSig->NAMECHAIN; - pChain != (chain_list*)NULL; - pChain = pChain->NEXT) { - if ((char*)(pChain->DATA) == asName) return(TRUE); - } - - return(FALSE); -} - - -/* ------------------------------------------------------------------ - * Function : "addInsLoCon()". - */ - -extern locon_list *addInsLoCon(apIns, asName, apSig, aDir) - loins_list *apIns; - char *asName; - losig_list *apSig; - char aDir; -{ - locon_list *pCon; - char *sName; - - - sName = namealloc(asName); - for(pCon = apIns->LOCON; pCon != (locon_list*)NULL; pCon = pCon->NEXT) { - if (pCon->NAME == sName) { - pCon->SIG = apSig; - return(pCon); - } - } - - pCon = (locon_list*)malloc(sizeof(locon_list)); - pCon->NAME = sName; - pCon->SIG = apSig; - pCon->ROOT = (void*)apIns; - pCon->TYPE = INTERNAL; - pCon->DIRECTION = aDir; - - pCon->NEXT = apIns->LOCON; - apIns->LOCON = pCon; - - return(pCon); -} - - -/* ------------------------------------------------------------------ - * Function : "splitPowerNet()". - */ - -extern void splitPowerNet(apLoFig, asPower) - lofig_list *apLoFig; - char *asPower; -{ - ptype_list *pType; - chain_list *pChain; - locon_list *pLoCon; - loins_list *pLoIns; - losig_list *pSigPower, *pSig; - char *tsSig[2], *sVDD, *sVSS, *sPOW; - long powerType; - - - sVDD = namealloc("vdd"); - sVSS = namealloc("vss"); - - tsSig[C_POWER_VDD] = namealloc("vddi"); - tsSig[C_POWER_VSS] = namealloc("vssi"); - - powerType = C_POWER_UNKNOWN; sPOW = (char*)NULL; - if (!strcmp(asPower, sVDD)) { powerType = C_POWER_VDD; sPOW = sVDD; } - if (!strcmp(asPower, sVSS)) { powerType = C_POWER_VSS; sPOW = sVSS; } - - if (powerType == C_POWER_UNKNOWN) { - eprinth((char*)NULL); - eprintf("\n Only \"vdd\" and \"vss\" can be splitted (%s).\n", asPower); - EXIT (1); - } - - - pChain = addchain((chain_list*)NULL, (void*)tsSig[powerType]); - pSigPower = addlosig(apLoFig, NEWSIGINDEX, pChain, INTERNAL); - - - /* Find the power net to be splitted. */ - for(pSig = apLoFig->LOSIG; pSig != (losig_list*)NULL; pSig = pSig->NEXT) - if (cmpSigName(pSig, sPOW)) break; - - if (pSig == (losig_list*)NULL) { - eprinth((char*)NULL); - eprintf("\n Signal \"%s\" not found for splitting.\n", sPOW); - EXIT (1); - } - - pType = getptype(pSig->USER, (long)LOFIGCHAIN); - if (pType == (ptype_list*)NULL) { - eprinth((char*)NULL); - eprintf("\n Signal \"%s\" have no LOFIGCHAIN.\n", sPOW); - EXIT (1); - } - - - /* Split the power between core cells and pad cells. */ - pChain = (chain_list*)(pType->DATA); - - for(; pChain != (chain_list*)NULL; - pChain = pChain->NEXT) { - pLoCon = (locon_list*)(pChain->DATA); - - if (pLoCon->TYPE == INTERNAL) { - pLoIns = (loins_list*)(pLoCon->ROOT); - - if (isPad(pLoIns->FIGNAME)) pLoCon->SIG = pSigPower; - - if ( (powerType == C_POWER_VDD) - && !strcmp(pLoIns->FIGNAME, "pvddi_sp")) { - addInsLoCon(pLoIns, sPOW, pSig, pLoCon->DIRECTION); - } - - if ( (powerType == C_POWER_VSS) - && !strcmp(pLoIns->FIGNAME, "pvssi_sp")) { - addInsLoCon(pLoIns, sPOW, pSig, pLoCon->DIRECTION); - } - } - } /* End of "pChain" loop. */ -} - - -/* ------------------------------------------------------------------ - * Function : "addPowerNet()". - */ - -extern void addPowerNet(apLoFig, asPower) - lofig_list *apLoFig; - char *asPower; -{ - chain_list *pChain; - losig_list *pSigPower; - char *sPOW; - - - sPOW = namealloc(asPower); - - pChain = addchain((chain_list*)NULL, (void*)sPOW); - pSigPower = addlosig(apLoFig, NEWSIGINDEX, pChain, EXTERNAL); -} - - -/* ------------------------------------------------------------------ - * Function : "xyflatvia()". - */ - -extern void xyflatvia(apFlatVIA, apVIA, - aXINS, aYINS, - aXAB1, aYAB1, - aXAB2, aYAB2, - aTransf) - struct phvia *apFlatVIA, *apVIA; - long aXINS, aYINS, aXAB1, aYAB1, aXAB2, aYAB2; - char aTransf; -{ - apFlatVIA->NAME = apVIA->NAME; - apFlatVIA->TYPE = apVIA->TYPE; - - xyflat (&apFlatVIA->XVIA, &apFlatVIA->YVIA, - apVIA->XVIA, apVIA->YVIA, - aXINS, aYINS, - aXAB1, aYAB1, - aXAB2, aYAB2, - aTransf); - - switch (aTransf) { - case ROT_M: - case ROT_P: - case SY_RM: - case SY_RP: - apFlatVIA->DX = apVIA->DY; - apFlatVIA->DY = apVIA->DX; - break; - case NOSYM: - case SYM_X: - case SYM_Y: - case SYMXY: - default: - apFlatVIA->DX = apVIA->DX; - apFlatVIA->DY = apVIA->DY; - break; - } -} - - -/* ------------------------------------------------------------------ - * Function : "findphins()". - */ - -extern struct phins *findphins(apPhfig, insName) - struct phfig *apPhfig; - char *insName; -{ - struct phins *pIns; - - for (pIns = apPhfig->PHINS; pIns != NULL; pIns = pIns->NEXT) - if (pIns->INSNAME == insName) return (pIns); - - return (NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "findphmodel()". - */ - -extern struct phins *findphmodel(apPhfig, modelName) - struct phfig *apPhfig; - char *modelName; -{ - struct phins *pIns; - - for (pIns = apPhfig->PHINS; pIns != NULL; pIns = pIns->NEXT) - if (pIns->FIGNAME == modelName) return (pIns); - - return (NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "findlocon()". - */ - -extern struct locon *findlocon(apLofig, conName) - struct lofig *apLofig; - char *conName; -{ - struct locon *pCon; - - for (pCon = apLofig->LOCON; pCon != NULL; pCon = pCon->NEXT) - if (pCon->NAME == conName) return (pCon); - - return (NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "addloins_noSig()". - */ - -extern loins_list *addloins_noSig(apFig, asIns, apModel) - lofig_list *apFig, *apModel; - char *asIns; -{ - loins_list *pIns = NULL; - locon_list *pCon = NULL; - locon_list *pInsCon = NULL; - chain_list *pChain; - char *figName; - char *insName; - - - insName = namealloc (asIns); - figName = apModel->NAME; - - - /* Check insName unicity */ - if (strcmp (insName, "*") && FAST_MODE != 'Y') { - for (pIns = apFig->LOINS; pIns; pIns = pIns->NEXT) { - if (pIns->INSNAME == insName) { - errMBK ("defloadlophig"); - eprintf ("\n addloins_noSig impossible, "); - eprintf ("instance %s already exist in figure %s\n", - insName, apFig->NAME); - EXIT(1); - } - } - } - - - if (apFig->NAME == figName) { - errMBK ("defloadlophig"); - eprintf ("\n addloins_noSig impossible for %s,", insName); - eprintf ("\n instance model is the figure %s itself\n", figName); - EXIT(1); - } - - - pIns = (loins_list *)mbkalloc (sizeof (loins_list)); - - pIns->INSNAME = insName; - pIns->FIGNAME = figName; - pIns->LOCON = NULL; - pIns->USER = NULL; - pIns->NEXT = apFig->LOINS; - apFig->LOINS = pIns; - - - /* Update model list */ - for (pChain = apFig->MODELCHAIN; pChain; pChain = pChain->NEXT) - if (pChain->DATA == (void *)figName) break; - - if (!pChain) - apFig->MODELCHAIN = addchain (apFig->MODELCHAIN, (void *)figName); - - - for (pCon = apModel->LOCON; pCon; pCon = pCon->NEXT) { - pInsCon = (locon_list *)mbkalloc (sizeof (locon_list)); - - pInsCon->NAME = pCon->NAME; - pInsCon->DIRECTION = pCon->DIRECTION; - pInsCon->TYPE = 'I'; - /* We do not known the signals for the time beeing. */ - pInsCon->SIG = NULL; - pInsCon->ROOT = (void *)pIns; - pInsCon->USER = NULL; - pInsCon->PNODE = NULL; - pInsCon->NEXT = pIns->LOCON; - pIns->LOCON = pInsCon; - } - - pIns->LOCON = (locon_list *)reverse((chain_list *)pIns->LOCON); - - - return (pIns); -} - - -/* ------------------------------------------------------------------ - * Function : "addlosig_insCon()". - */ - -extern locon_list *addlosig_insCon(apIns, asCon, apSig) - loins_list *apIns; - losig_list *apSig; - char *asCon; -{ - locon_list *pCon; - char *sCon; - - - sCon = namealloc (asCon); - - for (pCon = apIns->LOCON; pCon != NULL; pCon = pCon->NEXT) { - if (pCon->NAME == sCon) { - pCon->SIG = apSig; - - return (pCon); - } - - } - - - if (!pCon) { - errMBK ("defloadlophig"); - eprintf ("\n addlosig_insCon impossible, "); - eprintf ("instance %s of model %s has no terminal %s.\n", - apIns->INSNAME, apIns->FIGNAME, sCon); - EXIT(1); - } - - return (pCon); -} - - -/* ------------------------------------------------------------------ - * Function : "addfeed()". - */ - -extern void addfeed (apLofig, apPhfig) - struct lofig *apLofig; - struct phfig *apPhfig; -{ - struct locon *pLocon; - struct phins *pPhins; - struct lofig *pFeedfig; - struct losig *sig, *sigVDD, *sigVSS; - struct chain *pSighead, **ppSigtail; - - - /* Find VDD & VSS signals. */ - for (sigVDD = apLofig->LOSIG; - !isvdd (getsigname (sigVDD)); sigVDD = sigVDD->NEXT); - - if (!sigVDD) { - errMBK (NULL); - eprintf ("The netlist have no VDD net.\n"); - EXIT (1); - } - - for (sigVSS = apLofig->LOSIG; - !isvss (getsigname (sigVSS)); sigVSS = sigVSS->NEXT); - - if (!sigVSS) { - errMBK (NULL); - eprintf ("The netlist have no VSS net.\n"); - EXIT (1); - } - - - /* Find the feedthru instances. */ - for (pPhins = apPhfig->PHINS; pPhins != NULL; pPhins = pPhins->NEXT) { - if (incatalogfeed (pPhins->FIGNAME)) { - pFeedfig = getlofig (pPhins->FIGNAME, 'P'); - - pSighead = NULL; - ppSigtail = &pSighead; - - /* Build the signal list. */ - for (pLocon = pFeedfig->LOCON; pLocon != NULL; pLocon = pLocon->NEXT) { - sig = NULL; - - if (isvdd (pLocon->NAME)) sig = sigVDD; - if (isvss (pLocon->NAME)) sig = sigVSS; - - if (!sig) { - errMBK (NULL); - eprintf ("\n Terminal \"%s\" of feedthru model \"%s\" is not a\n", - pLocon->NAME, - pPhins->FIGNAME); - eprintf (" power terminal!\n"); - EXIT (1); - } - - *ppSigtail = addchain (*ppSigtail, (void*)sig); - ppSigtail = &((*ppSigtail)->NEXT); - } - - /* Add the instance. */ - addloins (apLofig, pPhins->INSNAME, pFeedfig, pSighead); - } - } -} - - -/* ------------------------------------------------------------------ - * Function : "delfeed()". - */ - -extern void delfeed (apLofig) - struct lofig *apLofig; -{ - struct loins *pIns; - struct chain *pFeedIns, *pChain; - - pFeedIns = NULL; - - /* Find the feedthru instances. */ - for (pIns = apLofig->LOINS; pIns != NULL; pIns = pIns->NEXT) { - if (incatalogfeed (pIns->FIGNAME)) - pFeedIns = addchain (pFeedIns, (void*)pIns->INSNAME); - } - - - /* Remove thoses instances. */ - for (pChain = pFeedIns; pChain != NULL; pChain = pChain->NEXT) { - delloins (apLofig, (char*)(pChain->DATA)); - } - - - freechain (pFeedIns); -} - - -/* ------------------------------------------------------------------ - * Function : "checkLofig()". - */ - -extern void checkLofig(apLofig) - struct lofig *apLofig; -{ - struct loins *pIns; - struct locon *pCon; - long unassigned; - - - unassigned = 0; - - for (pIns = apLofig->LOINS; pIns != NULL; pIns = pIns->NEXT) { - for(pCon = pIns->LOCON; pCon != NULL; pCon = pCon->NEXT) { - if (!pCon->SIG) { - unassigned++; - - warnMBK ("defloadlophfig"); - wprintf ("Terminal %s of instance %s is not assigned.\n", - pCon->NAME, pIns->INSNAME); - } - } - } - - if (unassigned) { - errMBK ("defloadlophig"); - eprintf ("There is %ld terminals unassigned.\n", unassigned); - EXIT (1); - } -} - - -/* ------------------------------------------------------------------ - * Function : "copyUpCALU()". - */ - -extern void copyUpCALU(apLofig, apPhfig, aExit) - struct lofig *apLofig; - struct phfig *apPhfig; - long aExit; -{ - long flag; - struct locon *pLocon, *pLoconIns; - struct losig *pLosig; - struct chain *pChain, *pChainLocon; - struct loins *pLoins; - struct phseg *pPhseg; - struct phins *pPhins; - struct phfig *pPhfigIns; - char *sigName; - long X1, Y1, X2, Y2; - - - lofigchain (apLofig); - - - for (pLocon = apLofig->LOCON; pLocon != NULL; pLocon = pLocon->NEXT) { - pLosig = pLocon->SIG; - - flag = FALSE; - - for(pChain = pLosig->NAMECHAIN; pChain != NULL; pChain = pChain->NEXT) { - sigName = (char*)pChain->DATA; - - if (isvdd (sigName) || isvss (sigName)) continue; - - /* Looks if the terminal already have physical segments in CALU on - * the top level of the design. - * This is a bit slow but I have no time for optimization. - */ - for (pPhseg = apPhfig->PHSEG; pPhseg != NULL; pPhseg = pPhseg->NEXT) { - if ( (pPhseg->NAME == sigName) - && (isCALU(pPhseg->LAYER)) ) { - flag = TRUE; - break; - } - } - - - if (!flag) { - /* No CALU in the top level design. We have to copy up the - * terminals from the instances (in fact there should be only one - * instance). - */ - flag = FALSE; - - pChainLocon = (chain_list*)(getptype (pLosig->USER, - LOFIGCHAIN)->DATA); - - for (; pChainLocon != NULL; pChainLocon = pChainLocon->NEXT) { - /* Copy only the first CALU segment to avoid separate segments - * for one equi (this is not valid for lynx). - */ - pLoconIns = (locon_list*) pChainLocon->DATA; - - if (pLoconIns->TYPE == INTERNAL) { - pLoins = (loins_list*)(pLoconIns->ROOT); - - pPhfigIns = getphfig (pLoins->FIGNAME, 'A'); - pPhins = getphins (apPhfig, pLoins->INSNAME); - - for (pPhseg = pPhfigIns->PHSEG; - pPhseg != NULL; pPhseg = pPhseg->NEXT) { - if ( (pPhseg->NAME == pLoconIns->NAME) - && (isCALU(pPhseg->LAYER)) ) { - flag = TRUE; - - xyflat ( &X1 , &Y1 , - pPhseg->X1 , pPhseg->Y1 , - pPhins->XINS , pPhins->YINS, - pPhfigIns->XAB1, pPhfigIns->YAB1, - pPhfigIns->XAB2, pPhfigIns->YAB2, - pPhins->TRANSF); - - xyflat ( &X2 , &Y2 , - pPhseg->X2 , pPhseg->Y2 , - pPhins->XINS , pPhins->YINS, - pPhfigIns->XAB1, pPhfigIns->YAB1, - pPhfigIns->XAB2, pPhfigIns->YAB2, - pPhins->TRANSF); - - addphseg (apPhfig, - pPhseg->LAYER, - pPhseg->WIDTH, - X1, Y1, X2, Y2, - sigName - ); - } - } - } - } /* End of "for(pChainLocon...)". */ - - if (!flag) { - if (aExit) { - errMBK ("copyUpCALU"); - eprintf ("\n No instances CALUx for terminal \"%s\".\n", - pLocon->NAME); - EXIT (1); - } else { - warnMBK ("copyUpCALU"); - wprintf ("\n No instances CALUx for terminal \"%s\".\n", - pLocon->NAME); - } - } - } /* End of "for(pChain...)". */ - } - } -} - - -/* ------------------------------------------------------------------ - * Function : "addloseg()". - */ - -extern struct eLoseg_s *addloseg (apHead, aType, apMBKobj) - struct eLoseg_s *apHead; - long aType; - void *apMBKobj; -{ - struct eLoseg_s *pLoseg; - struct ptype **ppUser; - - - ppUser = NULL; - pLoseg = (struct eLoseg_s*)mbkalloc (sizeof (struct eLoseg_s)); - - switch (aType) { - case LOSEG_VIA: ppUser = &(((struct phvia*)apMBKobj)->USER); break; - case LOSEG_CON: ppUser = &(((struct phcon*)apMBKobj)->USER); break; - case LOSEG_SEG: - case LOSEG_SEGCON: ppUser = &(((struct phseg*)apMBKobj)->USER); break; - default: - wprinth ("addloseg"); - eprintf ("\n Bad loseg type id %ld.\n", aType); - EXIT (1); - } - - *ppUser = addptype (*ppUser, PTYPE_LOSEG, (void*)pLoseg); - - pLoseg->type = aType; - pLoseg->MBKobj = apMBKobj; - pLoseg->next = apHead; - - - return (pLoseg); -} - - -/* ------------------------------------------------------------------ - * Function : "delloseg()". - */ - -extern struct eLoseg_s *delloseg (apLoseg) - struct eLoseg_s *apLoseg; -{ - struct ptype **ppUser; - - - ppUser = NULL; - - switch (apLoseg->type) { - case LOSEG_VIA: ppUser = &(((struct phvia*)apLoseg->MBKobj)->USER); break; - case LOSEG_CON: ppUser = &(((struct phcon*)apLoseg->MBKobj)->USER); break; - case LOSEG_SEG: - case LOSEG_SEGCON: ppUser = &(((struct phseg*)apLoseg->MBKobj)->USER); break; - default: - wprinth ("delloseg"); - eprintf ("\n Bad loseg type id %ld.\n", apLoseg->type); - EXIT (1); - } - - *ppUser = delptype (*ppUser, PTYPE_LOSEG); - - return (apLoseg->next); -} - - -/* ------------------------------------------------------------------ - * Function : "addtloseg()". - */ - -extern struct tLoseg_s *addtloseg (apPhfig) - struct phfig *apPhfig; -{ - struct tLoseg_s *ptLoseg; - int tLoseg_size; - - - if (getptype (apPhfig->USER, PTYPE_TLOSEG)) { - eprinth ("addtloseg"); - eprintf ("\n Attempt to re-create loseglist on figure \"%s\".", - apPhfig->NAME); - EXIT (1); - } - - - ptLoseg = (struct tLoseg_s*)mbkalloc (sizeof (struct tLoseg_s)); - - apPhfig->USER = addptype (apPhfig->USER, PTYPE_TLOSEG, (void*)ptLoseg); - - tLoseg_size = sizeof (struct eLoseg_s*) * TLOSEG_SIZE; - - ptLoseg->sigNB = 0; - ptLoseg->tSize = TLOSEG_SIZE; - ptLoseg->tHT = createauthtable (TLOSEG_SIZE); - ptLoseg->tAccess = (long*) malloc (sizeof (long) * TLOSEG_SIZE); - ptLoseg->tFlags = (long*) malloc (sizeof (long) * TLOSEG_SIZE); - ptLoseg->tLoseg = (struct eLoseg_s**) malloc (tLoseg_size); - - memset (ptLoseg->tLoseg , 0, tLoseg_size); - memset (ptLoseg->tAccess, 0, sizeof(long) * TLOSEG_SIZE); - memset (ptLoseg->tFlags , 0, sizeof(long) * TLOSEG_SIZE); - - ptLoseg->tMVIA = NULL; - - - return (ptLoseg); -} - - -/* ------------------------------------------------------------------ - * Function : "gettloseg()". - */ - -extern struct tLoseg_s *gettloseg (apPhfig) - struct phfig *apPhfig; -{ - struct ptype *pType; - - pType = getptype (apPhfig->USER, PTYPE_TLOSEG); - - if (pType) return ((struct tLoseg_s*)(pType->DATA)); - - return (NULL); -} - - -/* ------------------------------------------------------------------ - * Function : "gettlosegitem()". - */ - -extern struct authelem *gettlosegitem (apTLoseg, asKey) - struct tLoseg_s *apTLoseg; - char *asKey; -{ - struct authelem *pElem; - size_t eLoseg_size; - long sigIndex; - - - eLoseg_size = sizeof (struct eLoseg_s*); - - pElem = searchauthelem (apTLoseg->tHT, asKey); - - if (!pElem) { - sigIndex = apTLoseg->sigNB; - - __DBG( - fflush (stdout); - fprintf (stderr, "Adding loseg \"%s\" (id %ld)\n", asKey, sigIndex); - ) - - if (apTLoseg->sigNB >= apTLoseg->tSize) { - apTLoseg->tSize += TLOSEG_SIZE; - - /* Re-allocate the 'tLoseg' table. */ - apTLoseg->tLoseg = (struct eLoseg_s**)realloc ( - apTLoseg->tLoseg, eLoseg_size * apTLoseg->tSize); - - if (!apTLoseg->tLoseg) { - eprinth ("phsegchain"); - eprintf ("\n Not enougth memory to re-allocate \"tLoseg\".\n"); - EXIT (1); - } - - memset (apTLoseg->tLoseg + (apTLoseg->tSize - TLOSEG_SIZE), - 0, eLoseg_size * TLOSEG_SIZE); - - - /* Re-allocate the 'tAccess' & 'tFlags' tables. */ - apTLoseg->tAccess = (long*)realloc ( - apTLoseg->tAccess, sizeof(long) * apTLoseg->tSize); - apTLoseg->tFlags = (long*)realloc ( - apTLoseg->tFlags , sizeof(long) * apTLoseg->tSize); - - if (!apTLoseg->tAccess || !apTLoseg->tFlags) { - eprinth ("phsegchain"); - eprintf ("\n Not enougth memory to re-allocate \"tLoseg\".\n"); - EXIT (1); - } - - memset (apTLoseg->tAccess + (apTLoseg->tSize - TLOSEG_SIZE), - 0, sizeof(long) * TLOSEG_SIZE); - } - - pElem = addauthelem (apTLoseg->tHT, asKey, sigIndex); - - apTLoseg->sigNB += 1; - } - - - return (pElem); -} - - -/* ------------------------------------------------------------------ - * Function : "getlosegname()". - */ - -static char *getlosegname (apLoseg) - struct eLoseg_s *apLoseg; -{ - switch (apLoseg->type) { - case LOSEG_SEG: return (((struct phseg*)(apLoseg->MBKobj))->NAME); - case LOSEG_VIA: return (((struct phvia*)(apLoseg->MBKobj))->NAME); - case LOSEG_CON: return (((struct phcon*)(apLoseg->MBKobj))->NAME); - } - - - return ("Invalid loseg object! This should never happens!\n"); -} - - -/* ------------------------------------------------------------------ - * Function : "freeloseg()". - */ - -extern void freeloseg (apPhfig) - struct phfig *apPhfig; -{ - struct phseg *pPhseg; - struct ptype *pType; - struct tLoseg_s *ptLoseg; - struct eMVIA_s *pMVIA, *pMVIA_next; - - - for (pPhseg = apPhfig->PHSEG; pPhseg != NULL; pPhseg = pPhseg->NEXT) { - if ((pType = getptype (pPhseg->USER, PTYPE_LOSEG))) { - mbkfree (pType->DATA); - pPhseg->USER = delptype (pPhseg->USER, PTYPE_LOSEG); - } - } - - - - if ((pType = getptype (apPhfig->USER, PTYPE_TLOSEG))) { - ptLoseg = (struct tLoseg_s*)(pType->DATA); - - destroyauthtable (ptLoseg->tHT); - free (ptLoseg->tLoseg); - - for (pMVIA = ptLoseg->tMVIA; pMVIA != NULL;) { - pMVIA_next = pMVIA->next; - - mbkfree (pMVIA); - - pMVIA = pMVIA_next; - } - - - mbkfree (ptLoseg->tAccess); - mbkfree (ptLoseg->tFlags); - mbkfree (ptLoseg); - - apPhfig->USER = delptype (apPhfig->USER, PTYPE_TLOSEG); - } -} - - -/* ------------------------------------------------------------------ - * Function : "addmvia()". - */ - -extern struct eMVIA_s *addmvia (apHead, apVIA) - struct eMVIA_s *apHead; - struct phvia *apVIA; -{ - struct eMVIA_s *pMVIA; - - - pMVIA = (struct eMVIA_s*)mbkalloc (sizeof (struct eMVIA_s)); - - pMVIA->type = apVIA->TYPE; - pMVIA->width = apVIA->DX; - pMVIA->height = apVIA->DY; - pMVIA->next = apHead; - - - return (pMVIA); -} - - -/* ------------------------------------------------------------------ - * Function : "getmvia()". - */ - -extern struct eMVIA_s *getmvia (apHead, apVIA) - struct eMVIA_s *apHead; - struct phvia *apVIA; -{ - struct eMVIA_s *pMVIA; - - - for (pMVIA = apHead; pMVIA != NULL; pMVIA = pMVIA->next) { - if ( (pMVIA->type == apVIA->TYPE) - && (pMVIA->width == apVIA->DX ) - && (pMVIA->height == apVIA->DY )) - break; - } - - return (pMVIA); -} - - -/* ------------------------------------------------------------------ - * Function : "buildtsigalias()". - */ - -static void buildtsigalias(apLosig) - struct losig *apLosig; -{ - struct losig *pLosig; - struct chain *pChain; - long sigNumber; - - - if (LV_htSigAlias || LV_tSigAlias) { - eprinth ("buildtsigalias"); - eprintf ("\n Attempt to re-allocate the signal alias name table.\n"); - EXIT (1); - } - - - sigNumber = 0; - - for (pLosig = apLosig; pLosig != NULL; pLosig = pLosig->NEXT) sigNumber++; - - - LV_tSigAlias = (struct sigalias_s*) mbkalloc ( - sigNumber * sizeof (struct sigalias_s)); - LV_htSigAlias = createauthtable (sigNumber); - - - sigNumber = 0; - - for (pLosig = apLosig; pLosig != NULL; pLosig = pLosig->NEXT) { - LV_tSigAlias[sigNumber].name = getsigname (pLosig); - LV_tSigAlias[sigNumber].flags = 0L; - - __DBG( fprintf (stderr, " o Main signal name := \"%s\".\n", - LV_tSigAlias[sigNumber].name); ) - - for (pChain = pLosig->NAMECHAIN; pChain != NULL; pChain = pChain->NEXT) { - addauthelem (LV_htSigAlias, pChain->DATA, sigNumber); - - __DBG( - fprintf (stderr, " - Alias := \"%s\".\n", (char*)pChain->DATA); ) - - if (pChain != pLosig->NAMECHAIN) - LV_tSigAlias[sigNumber].flags = F_HAS_SUBNET; - } - - sigNumber++; - } -} - - -/* ------------------------------------------------------------------ - * Function : "freetsigalias()". - */ - -static void freetsigalias() -{ - if (!LV_htSigAlias) destroyauthtable (LV_htSigAlias); - if (!LV_tSigAlias) mbkfree (LV_tSigAlias); - - LV_htSigAlias = NULL; - LV_tSigAlias = NULL; -} - - -/* ------------------------------------------------------------------ - * Function : "matchsigname()". - */ - -static struct sigalias_s *matchsigname(aSegName) - char *aSegName; -{ - static struct sigalias_s noSigAlias; - authelem *pElem; - char **tSegAlias; - long iSegAlias; - - - tSegAlias = makesegnamelist (aSegName); - - for (iSegAlias = 0; tSegAlias[iSegAlias] != NULL; iSegAlias++) { - pElem = searchauthelem (LV_htSigAlias, tSegAlias[iSegAlias]); - - if (pElem) - return (&(LV_tSigAlias[pElem->VALUE])); - } - - /* This name doesn't match any net name (losig). - * This is probably an error. - */ - noSigAlias.name = aSegName; - noSigAlias.flags = 0L; - - return (&noSigAlias); -} - - -/* ------------------------------------------------------------------ - * Function : "phsegchain()". - */ - -extern void phsegchain(apLofig, apPhfig) - struct lofig *apLofig; - struct phfig *apPhfig; -{ - struct tLoseg_s *ptLoseg; - struct phseg *pPhseg; - struct phvia *pPhvia; - struct phcon *pPhcon; - struct sigalias_s *pSigAlias; - authelem *pElem; - - - ptLoseg = addtloseg (apPhfig); - - - /* Building alias table name. */ - buildtsigalias (apLofig->LOSIG); - - - /* Sorting segments by names. */ - for (pPhseg = apPhfig->PHSEG; pPhseg != NULL; pPhseg = pPhseg->NEXT) { - __DBG( - fprintf (stdout, "seg (%ld,%ld) (%ld,%ld) width %ld layer id %d\n", - pPhseg->X1, - pPhseg->Y1, - pPhseg->X2, - pPhseg->Y2, - pPhseg->WIDTH, - (int)pPhseg->LAYER); - fflush (stdout); - ) - if (pPhseg->NAME == NULL) { - eprinth ("phsegchain"); - eprintf ("\n Segment (%ld,%ld) (%ld,%ld) width %ld layer id %d", - pPhseg->X1, - pPhseg->Y1, - pPhseg->X2, - pPhseg->Y2, - pPhseg->WIDTH, - (int)pPhseg->LAYER); - eprintf ("\n doesn't have a name.\n"); - EXIT (1); - } - - if (pPhseg->NAME[0] == (char)0) { - eprinth ("phsegchain"); - eprintf ("\n Segment (%ld,%ld) (%ld,%ld) width %ld layer id %d", - pPhseg->X1, - pPhseg->Y1, - pPhseg->X2, - pPhseg->Y2, - pPhseg->WIDTH, - (int)pPhseg->LAYER); - eprintf ("\n have an empty string for name.\n"); - EXIT (1); - } - - if (isobs (pPhseg)) continue; - - pSigAlias = matchsigname (pPhseg->NAME); - - pElem = gettlosegitem (ptLoseg, pSigAlias->name); - - ptLoseg->tLoseg[pElem->VALUE] = addloseg (ptLoseg->tLoseg[pElem->VALUE], - LOSEG_SEG, - (void*)pPhseg); - } - - - /* Sorting vias by names. */ - for (pPhvia = apPhfig->PHVIA; pPhvia != NULL; pPhvia = pPhvia->NEXT) { - if (pPhvia->NAME == NULL) { - eprinth ("phsegchain"); - eprintf ("\n VIA (%ld,%ld) type id %d", - pPhvia->XVIA, - pPhvia->YVIA, - (int)pPhvia->TYPE); - eprintf ("\n doesn't have a name.\n"); - EXIT (1); - } - - if (!getmvia (ptLoseg->tMVIA, pPhvia)) { - ptLoseg->tMVIA = addmvia (ptLoseg->tMVIA, pPhvia); - __DBG( - fflush (stdout); - fprintf (stderr, "tMVIA := 0x%08lx\n", (unsigned long)ptLoseg->tMVIA); - fflush (stderr); - ) - } - - pSigAlias = matchsigname (pPhvia->NAME); - - pElem = gettlosegitem (ptLoseg, pSigAlias->name); - - ptLoseg->tLoseg[pElem->VALUE] = addloseg (ptLoseg->tLoseg[pElem->VALUE], - LOSEG_VIA, - (void*)pPhvia); - - __DBG( - fprintf (stderr, " - New loseg := 0x%08ld\n", - (unsigned long)ptLoseg->tLoseg[pElem->VALUE]); - ) - } - - - /* Sorting terminals by names. */ - for (pPhcon = apPhfig->PHCON; pPhcon != NULL; pPhcon = pPhcon->NEXT) { - if (pPhcon->NAME == NULL) { - eprinth ("phsegchain"); - eprintf ("\n CON (%ld,%ld) type id %d", - pPhcon->XCON, - pPhcon->YCON, - (int)pPhseg->TYPE); - eprintf ("\n doesn't have a name.\n"); - EXIT (1); - } - - pSigAlias = matchsigname (pPhcon->NAME); - - pElem = gettlosegitem (ptLoseg, pSigAlias->name); - - ptLoseg->tLoseg[pElem->VALUE] = addloseg (ptLoseg->tLoseg[pElem->VALUE], - LOSEG_CON, - (void*)pPhcon); - - __DBG( - fprintf (stderr, " - New loseg := 0x%08ld\n", - (unsigned long)ptLoseg->tLoseg[pElem->VALUE]); - ) - } - - - freetsigalias (); - - __DBG( - fprintf (stderr, "ptLoseg := 0x%08lx\n", (unsigned long)ptLoseg); - fflush (stderr); - ) -} - - -/* ------------------------------------------------------------------ - * Function : "getloseglist()". - */ - -extern struct eLoseg_s *getloseglist(apPhfig, aName) - struct phfig *apPhfig; - char *aName; -{ - struct tLoseg_s *ptLoseg; - struct eLoseg_s *pLoseg; - struct ptype *pType; - authelem *pElem; - - - if (!(pType = getptype (apPhfig->USER, PTYPE_TLOSEG))) { - /* - * eprinth ("getloseglist"); - * eprintf ("\n Figure \"%s\" doesn't have a loseg list.\n", - * apPhfig->NAME); - * EXIT (1); - */ - return (NULL); - } - ptLoseg = (struct tLoseg_s*)(pType->DATA); - - - pLoseg = NULL; - - pElem = searchauthelem (ptLoseg->tHT, aName); - - if (pElem) { - __DBG( - fflush (stdout); - fprintf (stderr, "getloseglist:Loseg found (id %ld)\n", pElem->VALUE); - ) - - pLoseg = ptLoseg->tLoseg [pElem->VALUE]; - ptLoseg->tAccess[pElem->VALUE]++; - } - - - return (pLoseg); -} - - -/* ------------------------------------------------------------------ - * Function : "checklosegaccess()". - */ - -extern void checklosegaccess(apPhfig) - struct phfig *apPhfig; -{ - struct tLoseg_s *ptLoseg; - struct ptype *pType; - long iLoseg; - long flag; - - - if (!(pType = getptype (apPhfig->USER, PTYPE_TLOSEG))) { - /* - * eprinth ("getloseglist"); - * eprintf ("\n Figure \"%s\" doesn't have a loseg list.\n", - * apPhfig->NAME); - * EXIT (1); - */ - return; - } - ptLoseg = (struct tLoseg_s*)(pType->DATA); - - - flag = FALSE; - for (iLoseg = 0; iLoseg < ptLoseg->sigNB; iLoseg++) { - if (ptLoseg->tAccess[iLoseg] == 0) { - if (!flag) { - /* Print the head error message. */ - flag = TRUE; - - eprinth (NULL); - eprintf ("The following physical net segments are not in the"); - eprintf (" netlist :\n"); - flag = TRUE; - } - - eprintf ("- \"%s\".\n", getlosegname (ptLoseg->tLoseg[iLoseg])); - } - } - - - if (flag) EXIT (1); -} - - -/* ------------------------------------------------------------------ - * Function : "shiftphfig()". - */ - -extern void shiftphfig(apPhfig, DX, DY) - struct phfig *apPhfig; - long DX, DY; -{ - struct phseg *pSeg; - struct phins *pIns; - struct phvia *pVIA; - struct phref *pRef; - struct phcon *pCon; - - - apPhfig->XAB1 -= DX; - apPhfig->XAB2 -= DX; - apPhfig->YAB1 -= DY; - apPhfig->YAB2 -= DY; - - - for (pSeg = apPhfig->PHSEG; pSeg != NULL; pSeg = pSeg->NEXT) { - pSeg->X1 -= DX; - pSeg->X2 -= DX; - pSeg->Y1 -= DY; - pSeg->Y2 -= DY; - } - - for (pIns = apPhfig->PHINS; pIns != NULL; pIns = pIns->NEXT) { - pIns->XINS -= DX; - pIns->YINS -= DY; - } - - for (pVIA = apPhfig->PHVIA; pVIA != NULL; pVIA = pVIA->NEXT) { - pVIA->XVIA -= DX; - pVIA->YVIA -= DY; - } - - for (pRef = apPhfig->PHREF; pRef != NULL; pRef = pRef->NEXT) { - pRef->XREF -= DX; - pRef->YREF -= DY; - } - - for (pCon = apPhfig->PHCON; pCon != NULL; pCon = pCon->NEXT) { - pCon->XCON -= DX; - pCon->YCON -= DY; - } -} diff --git a/alliance/src/sea/src/util_Power.c b/alliance/src/sea/src/util_Power.c deleted file mode 100644 index 5e121f20..00000000 --- a/alliance/src/sea/src/util_Power.c +++ /dev/null @@ -1,498 +0,0 @@ -/* - * $Id: util_Power.c,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./util_Power.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "util_Defs.h" -# include "debugoff.h" - - -/* ------------------------------------------------------------------ - * Local variables (prefix 'LV_'). - */ - - static long LV_XAB1; - static long LV_YAB1; - static long LV_XAB2; - static long LV_YAB2; - - -/* ---------------------------------------------------------------------- - * Local functions declarations. - */ - - static int onSlice __FP((long aY)); - static void setPowerAB __FP((long XAB1, long YAB1, - long XAB2, long YAB2)); - - -/* - * /--------------------------------------------------------------------\ - * | Functions Definitions | - * \--------------------------------------------------------------------/ - */ - - -/* ---------------------------------------------------------------------- - * Function : "setPowerAB()". - */ - -static void setPowerAB(XAB1, YAB1, XAB2, YAB2) - long XAB1, YAB1, XAB2, YAB2; -{ - LV_XAB1 = XAB1; - LV_YAB1 = YAB1; - LV_XAB2 = XAB2; - LV_YAB2 = YAB2; -} - - - -/* ---------------------------------------------------------------------- - * Function : "onSlice()". - */ - -static int onSlice(aY) - long aY; -{ - if (aY < LV_YAB1) return (FALSE); - if (aY > LV_YAB2) return (FALSE); - - if (!(((aY - MBK_WIDTH_VDD / 2) - LV_YAB1) % MBK_Y_SLICE)) return (TRUE); - if (!(((aY + MBK_WIDTH_VDD / 2) - LV_YAB1) % MBK_Y_SLICE)) return (TRUE); - - if (!(((aY - MBK_WIDTH_VSS / 2) - LV_YAB1) % MBK_Y_SLICE)) return (TRUE); - if (!(((aY + MBK_WIDTH_VSS / 2) - LV_YAB1) % MBK_Y_SLICE)) return (TRUE); - - return (FALSE); -} - -/* ---------------------------------------------------------------------- - * Function : "addPow()". - */ - -extern ePow_t *addPow(applPow, aY, aW, aName, aType, aDir) - ePow_t **applPow; - long aY; - long aW; - char *aName; - char aType; - char aDir; -{ - ePow_t *pPow, **ppPow; - - - pPow = (ePow_t*)mbkalloc(sizeof(ePow_t)); - pPow->y = aY; - pPow->w = aW; - pPow->flags = 0; - pPow->inter = NULL; - - switch(aDir) { - case C_POWER_VERTICAL: - pPow->xMin = LV_YAB1; - pPow->xMax = LV_YAB2; - pPow->min = LV_YAB2; - pPow->max = LV_YAB1; - break; - default: - case C_POWER_HORIZONTAL: - pPow->xMin = LV_XAB1; - pPow->xMax = LV_XAB2; - pPow->min = LV_XAB2; - pPow->max = LV_XAB1; - break; - } - - pPow->Name = namealloc(aName); - pPow->Type = aType; - - - /* Insert in the ordered list. */ - for(ppPow = applPow ; *ppPow != NULL ; ppPow = &((*ppPow)->Next)) { - if ((*ppPow)->y >= pPow->y) { - pPow->Next = *ppPow; - *ppPow = pPow; - break; - } - } - - - /* The list is empty or the element is the last one. */ - if (*ppPow == (ePow_t*)NULL) { - pPow->Next = *ppPow; - *ppPow = pPow; - } - - - return(pPow); -} - - -/* ---------------------------------------------------------------------- - * Function : "freePow()". - */ - -extern void freePow(aplPow) - struct ePow_s *aplPow; -{ - struct ePow_s *pDel, *pNext; - - - for (pDel = aplPow; pDel != NULL; ) { - pNext = pDel->Next; - - freeinter (pDel->inter); - mbkfree (pDel); - - pDel = pNext; - } -} - - -/* ---------------------------------------------------------------------- - * Function : "getPow()". - */ - -extern ePow_t *getPow(aplPow, aY) - ePow_t *aplPow; - long aY; -{ - ePow_t *pPow; - - - for( pPow = aplPow ; pPow != NULL ; pPow = pPow->Next ) - if (pPow->y == aY) return( pPow ); - - return( NULL ); -} - - -/* ---------------------------------------------------------------------- - * Function : "mergeXPow()". - */ - -extern void mergeXPow(apPow, axMin, axMax, aW) - ePow_t *apPow; - long axMin, axMax, aW; -{ - if (aW == apPow->w) - apPow->inter = addinter (apPow->inter, axMin, axMax); - - apPow->min = m_Min(apPow->min, axMin); - apPow->max = m_Max(apPow->max, axMax); -} - - -/* ---------------------------------------------------------------------- - * Function : "buildPow()". - */ - -extern ePow_t *buildPow(apPhfig, aLayer, aDir, asSuffix) - struct phfig *apPhfig; - char aLayer; - char aDir; - char *asSuffix; -{ - ePow_t **pplPow, *plPow, *pPow; - phseg_list *pPhseg; - phcon_list *pPhcon; - char type; - char ORIENT1, ORIENT2, *sDir1, *sDir2; - long X1, X2, Y1, Y2; - - - setPowerAB (apPhfig->XAB1, apPhfig->YAB1, - apPhfig->XAB2, apPhfig->YAB2); - - - switch(aDir) { - case C_POWER_VERTICAL: - sDir1 = "vertical"; - sDir2 = "NORTH/SOUTH"; - ORIENT1 = NORTH; - ORIENT2 = SOUTH; - break; - default: - case C_POWER_HORIZONTAL: - sDir1 = "horizontal"; - sDir2 = "EAST/WEST"; - ORIENT1 = EAST; - ORIENT2 = WEST; - break; - } - - - pplPow = &plPow; - *pplPow = NULL; - - - /* Find power terminals among CALUx segments (new convention). */ - for(pPhseg = apPhfig->PHSEG ; pPhseg != NULL ; pPhseg = pPhseg->NEXT) { - type = C_POWER_ISNONE; - - if (isvdd(pPhseg->NAME)) type = C_POWER_ISVDD; - if (isvss(pPhseg->NAME)) type = C_POWER_ISVSS; - - switch(aDir) { - case C_POWER_VERTICAL: - Y1 = pPhseg->X1; - Y2 = pPhseg->X2; - X1 = pPhseg->Y1; - X2 = pPhseg->Y2; - break; - default: - case C_POWER_HORIZONTAL: - Y1 = pPhseg->Y1; - Y2 = pPhseg->Y2; - X1 = pPhseg->X1; - X2 = pPhseg->X2; - break; - } - - if (type != C_POWER_ISNONE) { - if (cmpALU(aLayer, pPhseg->LAYER) & F_CALU) { - if (Y1 != Y2) { - wprinth(NULL); - wprintf("\n In figure \"%s\" :", apPhfig->NAME); - wprintf("\n CALU1 Power segment \"%s\" at (%d,%d)", - pPhseg->NAME, - MBKUNSCALE (pPhseg->X1), - MBKUNSCALE (pPhseg->Y1)); - wprintf(" is not %s.\n", sDir1); - continue; - } - - if (aDir == C_POWER_HORIZONTAL) { - if (!onSlice(Y1)) { - wprinth(NULL); - wprintf("\n In figure \"%s\" :", apPhfig->NAME); - wprintf("\n CALU1 Power segment \"%s\" at (%d,%d)", - pPhseg->NAME, - MBKUNSCALE (pPhseg->X1), - MBKUNSCALE (pPhseg->Y1)); - wprintf(" is not on a slice boundary."); - wprintf("\n (valide slices boundaries are"); - wprintf(" ((n * %ld) - %ld) or" , Y_SLICE, WIDTH_VSS / 2); - wprintf(" ((n * %ld) + %ld) )\n" , Y_SLICE, WIDTH_VSS / 2); - continue; - } - } - - if ((pPow = getPow(plPow, Y1)) == NULL) { - pPow = addPow(pplPow , - Y1 , - pPhseg->WIDTH, - pPhseg->NAME , - type , - aDir ); - } - - if (pPhseg->NAME != pPow->Name) { - eprinth(NULL); - eprintf("\n In figure \"%s\" :", apPhfig->NAME); - eprintf("\n CALU1 Power segment \"%s\" at (%d,%d)\n", - pPhseg->NAME, - MBKUNSCALE (pPhseg->X1), - MBKUNSCALE (pPhseg->Y1)); - eprintf(" conflict with \"%s\" power line at %d.\n", - pPow->Name, - pPow->y ); - EXIT(1); - } - - mergeXPow(pPow, X1, X2, pPhseg->WIDTH); - } - } - } /* End of "pPhseg" loop. */ - - - /* Find power terminals among terminals (for backward compatibility). */ - for(pPhcon = apPhfig->PHCON ; pPhcon != NULL ; pPhcon = pPhcon->NEXT) { - type = C_POWER_ISNONE; - - if (isvdd(pPhcon->NAME)) type = C_POWER_ISVDD; - if (isvss(pPhcon->NAME)) type = C_POWER_ISVSS; - - switch(aDir) { - case C_POWER_VERTICAL: - Y1 = pPhcon->XCON; - X1 = pPhcon->YCON; - break; - default: - case C_POWER_HORIZONTAL: - Y1 = pPhcon->YCON; - X1 = pPhcon->XCON; - break; - } - - if (type != C_POWER_ISNONE) { - if (cmpALU(aLayer, pPhcon->LAYER)) { - if ( (pPhcon->ORIENT != ORIENT1) - && (pPhcon->ORIENT != ORIENT2)) { - eprinth(NULL); - eprintf("\n In figure \"%s\" :", apPhfig->NAME); - eprintf("\n ALU1 Power terminal \"%s\" at (%d,%d)", - pPhcon->NAME, - MBKUNSCALE (pPhcon->XCON), - MBKUNSCALE (pPhcon->YCON)); - eprintf(" is not on %s side.\n", sDir2); - EXIT(1); - } - - if (aDir == C_POWER_HORIZONTAL) { - if (!onSlice(pPhcon->YCON)) { - eprinth(NULL); - eprintf("\n In figure \"%s\" :", apPhfig->NAME); - eprintf("\n ALU1 Power terminal \"%s\" at (%d,%d)", - pPhcon->NAME, - MBKUNSCALE (pPhcon->XCON), - MBKUNSCALE (pPhcon->YCON)); - eprintf(" is not on a slice boundary."); - eprintf("\n (valide slices boundaries are"); - eprintf(" ((n * %ld) - %ld) or" , Y_SLICE, WIDTH_VSS / 2); - eprintf(" ((n * %ld) + %ld) )\n" , Y_SLICE, WIDTH_VSS / 2); - EXIT(1); - } - } - - if ((pPow = getPow(plPow, Y1)) == NULL) { - pPow = addPow(pplPow , - Y1 , - pPhcon->WIDTH, - pPhcon->NAME , - type , - aDir ); - } - - if (pPhcon->NAME != pPow->Name) { - eprinth(NULL); - eprintf("\n In figure \"%s\" :", apPhfig->NAME); - eprintf("\n ALU1 Power terminal \"%s\" at (%d,%d)\n", - pPhcon->NAME, - MBKUNSCALE (pPhcon->XCON), - MBKUNSCALE (pPhcon->YCON)); - eprintf(" conflict with \"%s\" power line at %d.\n", - pPow->Name, - pPow->y ); - EXIT(1); - } - - mergeXPow(pPow, X1, X1, pPhcon->WIDTH); - } - } - } /* End of "pPhcon" loop. */ - - - /* Look if the power lines are complete. */ - for (pPow = plPow; pPow != NULL; pPow = pPow->Next) { - if ( (pPow->inter->len == 1) - && (pPow->inter->min == pPow->xMin) - && (pPow->inter->max == pPow->xMax)) { - pPow->flags |= F_POWER_COMPLETE; - __DBG( printf ("powerline at %ld is complete.\n", pPow->y); ) - } - } - - - return (plPow); -} - - -/* ---------------------------------------------------------------------- - * Function : "powToCon()". - */ - -extern void powToCon(apPhfig, aLayer, aDir, aplPow, aFlags) - struct phfig *apPhfig; - char aLayer; - char aDir; - struct ePow_s *aplPow; - long aFlags; -{ - struct ePow_s *pPow; - char *conName; - long w, y, skipFlag; - - - for (pPow = aplPow; pPow != NULL; pPow = pPow->Next) { - skipFlag = FALSE; - - switch (pPow->Type) { - default: - case C_POWER_ISVSS: conName = "vss"; break; - case C_POWER_ISVDD: conName = "vdd"; break; - } - - w = pPow->w; - y = pPow->y; - - if (aFlags & F_POWER_MERGE) { - if ( (pPow->Next != NULL) - && (pPow->Next->y == pPow->y + MBKSCALE(6))) { - skipFlag = TRUE; - - w = MBKSCALE(12); - y += MBKSCALE(3); - } - } - - if (aDir == C_POWER_HORIZONTAL) { - if (pPow->flags & F_POWER_COMPLETE) { - addphcon (apPhfig, - WEST, - conName, - pPow->xMin, - y, - aLayer, - w); - } - - if (pPow->flags & F_POWER_COMPLETE) { - addphcon (apPhfig, - EAST, - conName, - pPow->xMax, - y, - aLayer, - w); - } - } else { - if (pPow->flags & F_POWER_COMPLETE) { - addphcon (apPhfig, - SOUTH, - conName, - y, - pPow->xMin, - aLayer, - w); - } - - if (pPow->flags & F_POWER_COMPLETE) { - addphcon (apPhfig, - NORTH, - conName, - y, - pPow->xMax, - aLayer, - w); - } - } - - if (skipFlag) pPow = pPow->Next; - } -} diff --git a/alliance/src/sea/src/util_RTU.c b/alliance/src/sea/src/util_RTU.c deleted file mode 100644 index 77da4766..00000000 --- a/alliance/src/sea/src/util_RTU.c +++ /dev/null @@ -1,593 +0,0 @@ - -/* - * $Id: util_RTU.c,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./util_RTU.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "util_Defs.h" -# include "debugoff.h" - - -# define LAYERS_NUMBER 6 -# define LAYERS_ALIAS 3 -# define TRACK_PITCH MBKSCALE(5) -# define F_PITCH_INF 0x00000001 -# define F_PITCH_SUP 0x00000002 -# define HT_TERM_SIZE 1024 - - -# define STRING_OBSTACLE "obs" - - -/* ------------------------------------------------------------------ - * Internal types. - */ - - typedef struct obsTrack_s { - long min; - long max; - } obsTrack_t; - - -/* ------------------------------------------------------------------ - * Local variables (prefix 'LV_'). - */ - - static struct phfig *LV_phfig; - static struct obsTrack_s *LV_ttObs[LAYERS_NUMBER]; - static char LV_tLayersNames[LAYERS_NUMBER][LAYERS_ALIAS]; - static long LV_hTracksNumber; - static long LV_vTracksNumber; - static long LV_hTracksMax; - static long LV_vTracksMax; - static authtable *LV_htTerm; - - -/* ------------------------------------------------------------------ - * Internal functions. - */ - -# define SETMIN(v,m) ((v) = m_Min((v),(m))) -# define SETMAX(v,m) ((v) = m_Max((v),(m))) -# define LAMBDA2TRACKS(l) (lambda2pitch((l), F_PITCH_INF)) -# define TRACKS2LAMBDA(t) ((t) * TRACK_PITCH) -# define NORMVIASIDE(s) (((s) > MBK_VIA_SIDE) ? (s) : 0L) - - static void buildHTTerm __FP((struct phseg *apSeg)); - static void delHTTerm __FP((void)); - static long lambda2pitch __FP((long aLength, long aFlags)); - static long getLayerTable __FP((char aLayer)); - static void allocTableLayers __FP((void)); - static void allocTableObs __FP((void)); - static void addObs __FP((long aiTable, - long aX1, - long aY1, - long aX2, - long aY2)); - static void seg2obs __FP((struct phseg *apSeg)); - static void via2obs __FP((struct phvia *apVIA)); - static void instance2obs __FP((struct phins *pIns)); - extern void instances2obs __FP((void)); - static void wiring2obs __FP((void)); - static void obs2layers __FP((void)); - - -/* - * /----------------------------------------------------------------\ - * | Functions Definitions | - * \----------------------------------------------------------------/ - */ - -/* ------------------------------------------------------------------ - * Function : "buildHTTerm()". - */ - -static void buildHTTerm(apSeg) - struct phseg *apSeg; -{ - struct phseg *pSeg; - - - LV_htTerm = createauthtable (HT_TERM_SIZE); - - for (pSeg = apSeg; pSeg != NULL; pSeg = pSeg->NEXT) { - if (pSeg->NAME == NULL) { - eprinth ("rtu"); - eprintf ("\n Segment (%ld,%ld) (%ld,%ld) width %ld layer id %d", - pSeg->X1, - pSeg->Y1, - pSeg->X2, - pSeg->Y2, - pSeg->WIDTH, - (int)pSeg->LAYER); - eprintf ("\n doesn't have a name.\n"); - EXIT (1); - } - - if (!isCALU (pSeg->LAYER)) continue; - if (searchauthelem (LV_htTerm, pSeg->NAME)) continue; - - addauthelem (LV_htTerm, pSeg->NAME, 0); - } -} - - -/* ------------------------------------------------------------------ - * Function : "delHTTerm()". - */ - -static void delHTTerm() -{ - destroyauthtable (LV_htTerm); -} - - -/* ------------------------------------------------------------------ - * Function : "lambda2pitch()". - */ - -static long lambda2pitch(aLength, aFlags) - long aLength; - long aFlags; -{ - long pitch; - - - pitch = aLength / TRACK_PITCH; - - if (aFlags & F_PITCH_SUP) - pitch += (aLength % TRACK_PITCH) ? 1 : 0; - - return (pitch); -} - -/* ------------------------------------------------------------------ - * Function : "getLayerTable()". - */ - -static long getLayerTable(aLayer) - char aLayer; -{ - long iTable, iAlias; - - - for (iTable = 1; iTable < LAYERS_NUMBER; iTable++) { - for (iAlias = 0; iAlias < LAYERS_ALIAS; iAlias++) { - if (LV_tLayersNames[iTable][iAlias] == aLayer) { - return (iTable); - } - } - } - - /* No table found : return LAYERS_NUMBER. */ - return (LAYERS_NUMBER); -} - - -/* ------------------------------------------------------------------ - * Function : "allocTableLayers()". - */ - -static void allocTableLayers() -{ - /* Base layer. */ - LV_tLayersNames[0][0] = ALU1; - LV_tLayersNames[1][0] = ALU2; - LV_tLayersNames[2][0] = ALU3; - LV_tLayersNames[3][0] = ALU4; - LV_tLayersNames[4][0] = ALU5; - LV_tLayersNames[5][0] = ALU6; - - /* Associated obstacles layer. */ - LV_tLayersNames[0][1] = TALU1; - LV_tLayersNames[1][1] = TALU2; - LV_tLayersNames[2][1] = TALU3; - LV_tLayersNames[3][1] = TALU4; - LV_tLayersNames[4][1] = TALU5; - LV_tLayersNames[5][1] = TALU6; - - /* Associated terminal layer. */ - LV_tLayersNames[0][2] = CALU1; - LV_tLayersNames[1][2] = CALU2; - LV_tLayersNames[2][2] = CALU3; - LV_tLayersNames[3][2] = CALU4; - LV_tLayersNames[4][2] = CALU5; - LV_tLayersNames[5][2] = CALU6; -} - - -/* ------------------------------------------------------------------ - * Function : "allocTableObs()". - */ - -static void allocTableObs() -{ - long iTable, iTrack; - long tracksNumber, trackMax; - - - LV_hTracksNumber = LAMBDA2TRACKS (LV_phfig->YAB2 - LV_phfig->YAB1) + 1; - LV_hTracksMax = LAMBDA2TRACKS (LV_phfig->XAB2 - LV_phfig->XAB1) + 1; - - LV_vTracksNumber = LAMBDA2TRACKS (LV_phfig->XAB2 - LV_phfig->XAB1) + 1; - LV_vTracksMax = LAMBDA2TRACKS (LV_phfig->YAB2 - LV_phfig->YAB1) + 1; - - - for (iTable = 0; iTable < LAYERS_NUMBER; iTable++) { - if (!(iTable % 2)) { - /* i.e. ALU1, ALU3 & ALU5 : vertical tracks. */ - tracksNumber = LV_vTracksNumber; - trackMax = LV_vTracksMax; - } else { - /* i.e. ALU2, ALU4 & ALU6 : horizontal tracks. */ - tracksNumber = LV_hTracksNumber; - trackMax = LV_hTracksMax; - } - - - LV_ttObs[iTable] = (struct obsTrack_s*)mbkalloc ( - sizeof (struct obsTrack_s) * tracksNumber); - - /* Initialize table boundaries. */ - for (iTrack = 0; iTrack < tracksNumber; iTrack++) { - LV_ttObs[iTable][iTrack].min = trackMax; - LV_ttObs[iTable][iTrack].max = 0L; - } - } -} - - -/* ------------------------------------------------------------------ - * Function : "addObs()". - */ - -static void addObs(aiTable, aX1, aY1, aX2, aY2) - long aiTable; - long aX1, aY1, aX2, aY2; -{ - long iTrack, ivTrackMin, ivTrackMax; - long hTrackMin, hTrackMax; - - - if (!(aiTable % 2)) { - /* i.e. ALU1, ALU3 & ALU5 : vertical tracks. */ - hTrackMin = lambda2pitch (aY1 - LV_phfig->YAB1, F_PITCH_INF); - hTrackMax = lambda2pitch (aY2 - LV_phfig->YAB1, F_PITCH_SUP); - - ivTrackMin = lambda2pitch (aX1 - LV_phfig->XAB1, F_PITCH_INF); - ivTrackMax = lambda2pitch (aX2 - LV_phfig->XAB1, F_PITCH_SUP); - } else { - /* i.e. ALU2, ALU4 & ALU6 : horizontal tracks. */ - hTrackMin = lambda2pitch (aX1 - LV_phfig->XAB1, F_PITCH_INF); - hTrackMax = lambda2pitch (aX2 - LV_phfig->XAB1, F_PITCH_SUP); - - ivTrackMin = lambda2pitch (aY1 - LV_phfig->YAB1, F_PITCH_INF); - ivTrackMax = lambda2pitch (aY2 - LV_phfig->YAB1, F_PITCH_SUP); - } - - - for (iTrack = ivTrackMin; iTrack <= ivTrackMax; iTrack++) { - SETMIN (LV_ttObs[aiTable][iTrack].min, hTrackMin); - SETMAX (LV_ttObs[aiTable][iTrack].max, hTrackMax); - } -} - - -/* ------------------------------------------------------------------ - * Function : "seg2obs()". - */ - -static void seg2obs(apSeg) - struct phseg *apSeg; -{ - long iTable, X1, Y1, X2, Y2, trackWidth; - - - /* Special policy for xALU1 layers : segments are all passed "as is" - * in TALU1. - */ - switch (apSeg->LAYER) { - case ALU1: - case CALU1: - case TALU1: - /* Do nothing. - *addphseg (LV_phfig, - * TALU1, - * apSeg->WIDTH, - * apSeg->X1, - * apSeg->Y1, - * apSeg->X2, - * apSeg->Y2, - * STRING_OBSTACLE - * ); - */ - return; - } - - - iTable = getLayerTable (apSeg->LAYER); - - - if (iTable == LAYERS_NUMBER) return; - - - trackWidth = getLayerTrackWidth (apSeg->LAYER); - - switch (apSeg->TYPE) { - case UP: - case DOWN: - X1 = apSeg->X1 - (apSeg->WIDTH - trackWidth) / 2; - X2 = apSeg->X2 + (apSeg->WIDTH - trackWidth) / 2; - Y1 = apSeg->Y1; - Y2 = apSeg->Y2; - break; - case LEFT: - case RIGHT: - default: - X1 = apSeg->X1; - X2 = apSeg->X2; - Y1 = apSeg->Y1 - (apSeg->WIDTH - trackWidth) / 2; - Y2 = apSeg->Y2 + (apSeg->WIDTH - trackWidth) / 2; - break; - } - - addObs (iTable, X1, Y1, X2, Y2); -} - - -/* ------------------------------------------------------------------ - * Function : "via2obs()". - */ - -static void via2obs(apVIA) - struct phvia *apVIA; -{ - long iTable, X1, Y1, X2, Y2, trackWidth; - char layer; -# if 0 - char topLayer; -# endif - - - if (apVIA->NAME == NULL) { - eprinth ("rtu"); - eprintf ("\n VIA (%ld,%ld) size (%ld,%ld) type id %d", - MBKUNSCALE (apVIA->XVIA), - MBKUNSCALE (apVIA->YVIA), - MBKUNSCALE (apVIA->DX), - MBKUNSCALE (apVIA->DY), - (int)apVIA->TYPE); - eprintf ("\n doesn't have a name.\n"); - EXIT (1); - } - - - __DBG( fprintf (stderr, "via2obs(): VIA at %ld %ld.\n", - apVIA->XVIA, apVIA->YVIA); ) - - /* Check if this VIA belongs to an terminal net. */ - /* if (searchauthelem (LV_htTerm, apVIA->NAME)) return; */ - - - for (layer = getBottomVIALayer (apVIA->TYPE); TRUE; - layer = getUpVIALayer (apVIA->TYPE, layer)) { - iTable = getLayerTable (layer); - - if ((!isvdd (apVIA->NAME) && !isvss (apVIA->NAME)) || (iTable % 2)) { - if (iTable != LAYERS_NUMBER) { - __DBG (fprintf (stderr, " OBS Layer %d\n", (int)layer); ) - - trackWidth = getLayerTrackWidth (layer); - - X1 = apVIA->XVIA - (NORMVIASIDE(apVIA->DX) - trackWidth) / 2; - X2 = apVIA->XVIA + (NORMVIASIDE(apVIA->DX) - trackWidth) / 2; - Y1 = apVIA->YVIA - (NORMVIASIDE(apVIA->DY) - trackWidth) / 2; - Y2 = apVIA->YVIA + (NORMVIASIDE(apVIA->DY) - trackWidth) / 2; - - addObs (iTable, X1, Y1, X2, Y2); - } - } - - if (layer == getTopVIALayer (apVIA->TYPE)) break; - } - -# if 0 - fprintf (stderr, " Intermediate layers :\n"); - layer = getUpVIALayer (apVIA->TYPE, getBottomVIALayer (apVIA->TYPE)); - topLayer = getTopVIALayer (apVIA->TYPE); - - while (layer != topLayer) { - iTable = getLayerTable (layer); - - if (iTable != LAYERS_NUMBER) { - fprintf (stderr, " OBS Layer %d\n", (int)layer); - - trackWidth = getLayerTrackWidth (layer); - - X1 = apVIA->XVIA - (NORMVIASIDE(apVIA->DX) - trackWidth) / 2; - X2 = apVIA->XVIA + (NORMVIASIDE(apVIA->DX) - trackWidth) / 2; - Y1 = apVIA->YVIA - (NORMVIASIDE(apVIA->DY) - trackWidth) / 2; - Y2 = apVIA->YVIA + (NORMVIASIDE(apVIA->DY) - trackWidth) / 2; - - addObs (iTable, X1, Y1, X2, Y2); - } - - layer = getUpVIALayer (apVIA->TYPE, layer); - } -# endif -} - - -/* ------------------------------------------------------------------ - * Function : "instance2obs()". - */ - -static void instance2obs(apIns) - struct phins *apIns; -{ - struct phfig *pFig; - struct phseg *pSeg, flatSeg; -# if 0 - struct phvia *pVIA, flatVIA; - char *viaName = STRING_OBSTACLE; -# endif - - - pFig = getphfig (apIns->FIGNAME, 'A'); - - for (pSeg = pFig->PHSEG; pSeg != NULL; pSeg = pSeg->NEXT) { - if ( isvdd (pSeg->NAME ) || isvss (pSeg->NAME )) continue; - if (!isCALU (pSeg->LAYER) && !isobs (pSeg)) continue; - /*if (isCALU (pSeg->LAYER) || !isobs (pSeg)) continue;*/ - - xyflatseg (&flatSeg, pSeg, - apIns->XINS, apIns->YINS, - pFig->XAB1, pFig->YAB1, - pFig->XAB2, pFig->YAB2, - apIns->TRANSF); - - seg2obs (&flatSeg); - } - -# if 0 - for (pVIA = pFig->PHVIA; pVIA != NULL; pVIA = pVIA->NEXT) { - if (isvdd (pVIA->NAME) || isvss (pVIA->NAME)) continue; - - xyflatvia (&flatVIA, pVIA, - apIns->XINS, apIns->YINS, - pFig->XAB1, pFig->YAB1, - pFig->XAB2, pFig->YAB2, - apIns->TRANSF); - - flatVIA.NAME = (pVIA->NAME != NULL) ? pVIA->NAME : viaName; - - via2obs (&flatVIA); - } -# endif -} - - -/* ------------------------------------------------------------------ - * Function : "wiring2obs()". - */ - -static void wiring2obs() -{ - struct phseg *pSeg; - struct phvia *pVIA; - - - for (pSeg = LV_phfig->PHSEG; pSeg != NULL; pSeg = pSeg->NEXT) { - /* Terminals (i.e. segments in CALUx layers) are not to be - * considered as obstacles. - */ - /*if (!isCALU (pSeg->LAYER)) seg2obs (pSeg);*/ - if (!isvdd (pSeg->NAME) && !isvss (pSeg->NAME)) seg2obs (pSeg); - } - - for (pVIA = LV_phfig->PHVIA; pVIA != NULL; pVIA = pVIA->NEXT) { - /* Skip default VIA, as they belongs to regular wiring. */ - if (pVIA->DX || pVIA->DY) via2obs (pVIA); - } -} - - -/* ------------------------------------------------------------------ - * Function : "instances2obs()". - */ - -extern void instances2obs() -{ - struct phins *pIns; - - - for (pIns = LV_phfig->PHINS; pIns != NULL; pIns = pIns->NEXT) { - instance2obs (pIns); - } -} - - - -/* ------------------------------------------------------------------ - * Function : "obs2layers()". - */ - -static void obs2layers() -{ - long iTable, iTrack, tracksNumber; - long X1, Y1, X2, Y2, width; - char layer; - - - for (iTable = 0; iTable < LAYERS_NUMBER; iTable++) { - layer = getTALU (LV_tLayersNames[iTable][0]); - width = getLayerTrackWidth (layer); - - - if (!(iTable % 2)) { - /* i.e. ALU1, ALU3 & ALU5 : vertical tracks. */ - tracksNumber = LV_vTracksNumber; - } else { - /* i.e. ALU2, ALU4 & ALU6 : horizontal tracks. */ - tracksNumber = LV_hTracksNumber; - } - - - for (iTrack = 0; iTrack < tracksNumber; iTrack++) { - /* Skip empty tracks. */ - if (LV_ttObs[iTable][iTrack].min >= LV_ttObs[iTable][iTrack].max) - continue; - - if (!(iTable % 2)) { - /* i.e. ALU1, ALU3 & ALU5 : vertical tracks. */ - X1 = X2 = LV_phfig->XAB1 + TRACKS2LAMBDA (iTrack); - Y1 = LV_phfig->YAB1 + TRACKS2LAMBDA (LV_ttObs[iTable][iTrack].min); - Y2 = LV_phfig->YAB1 + TRACKS2LAMBDA (LV_ttObs[iTable][iTrack].max); - } else { - /* i.e. ALU2, ALU4 & ALU6 : horizontal tracks. */ - Y1 = Y2 = LV_phfig->YAB1 + TRACKS2LAMBDA (iTrack); - X1 = LV_phfig->XAB1 + TRACKS2LAMBDA (LV_ttObs[iTable][iTrack].min); - X2 = LV_phfig->XAB1 + TRACKS2LAMBDA (LV_ttObs[iTable][iTrack].max); - } - - - addphseg (LV_phfig, layer, width, X1, Y1, X2, Y2, STRING_OBSTACLE); - } /* End of "for (iTrack ...)". */ - } /* End of "for (iTable ...)". */ -} - - -/* ------------------------------------------------------------------ - * Function : "rtu()". - */ - -extern void rtu(aPhfig) - struct phfig *aPhfig; -{ - LV_phfig = aPhfig; - - - allocTableLayers (); - allocTableObs (); - - buildHTTerm (aPhfig->PHSEG); - instances2obs (); - wiring2obs (); - obs2layers (); - delHTTerm (); - -} diff --git a/alliance/src/sea/src/util_Sys.c b/alliance/src/sea/src/util_Sys.c deleted file mode 100644 index 785128de..00000000 --- a/alliance/src/sea/src/util_Sys.c +++ /dev/null @@ -1,520 +0,0 @@ -/* - * $Id: util_Sys.c,v 1.1 2002/04/25 16:16:20 jpc Exp $ - * - * /----------------------------------------------------------------\ - * | | - * | A l l i a n c e C A D S y s t e m | - * | S i l i c o n E n s e m b l e / A l l i a n c e | - * | | - * | Author : Jean-Paul CHAPUT | - * | E-mail : alliance-support@asim.lip6.fr | - * | ============================================================== | - * | C Module : "./util_Sys.c" | - * | ************************************************************** | - * | U p d a t e s | - * | | - * \----------------------------------------------------------------/ - */ - - -# include "util_Defs.h" - - -/* ------------------------------------------------------------------ - * Global variables (declared `extern' in "util_Defs.h"). - */ - - long util_VL = 1L; - long util_flags = 0L; - char util_binName[1024] = "noname"; - - -/* ------------------------------------------------------------------ - * Internal functions declarations. - */ - - static void trapSig __FP((int aSig)); - - -/* - * /----------------------------------------------------------------\ - * | Functions Definitions | - * \----------------------------------------------------------------/ - */ - -/* ------------------------------------------------------------------ - * Function : "trapSig()". - */ - -static void trapSig(aSig) - int aSig; -{ - switch (aSig) - { - case C_SIGERR: - /* A "normal" error occurs (produced by 'esignal'). */ - break; - - case C_SIGTFLT: - /* "util_init" was unable to setup 'trapSig'. */ - eprinth ("util_Sys"); - eprints ("\n Unable to trap SOFTSIG|SIGSEGV|SIGTERM.\n"); - break; - - case SIGTERM: - /* This occurs on MBK errors. */ - eprinth ((char *)NULL); - eprints ("\n An error have occur in the MBK data-base."); - eprints ("\n Please check your Alliance environment."); - eprints ("\n\n"); - eprintf ("\n %s terminated.", util_binName); - eprints ("\n" ); - break; - - case SIGFPE: - case SIGBUS: - case SIGSEGV: - /* Ouch !! This may result from a program bug. */ - eprinth ((char *)NULL); - eprintf ("\n An %s internal bug have occur ", util_binName); - - if (aSig == SIGFPE ) eprints ("(SIGFPE)." ); - if (aSig == SIGBUS ) eprints ("(SIGBUS)." ); - if (aSig == SIGSEGV) eprints ("(SIGSEGV)."); - eprints ("\n Please e-mail to \"alliance-support@asim.lip6.fr\"."); - eprints ("\n\n"); - eprintf ("\n %s terminated ", util_binName); - - if (util_flags & F_NOCORE) { - eprints ("(core not dumped).\n"); - exit (1); - } - else { - eprints( "(core will be dumped).\n"); - if ( (signal(SIGFPE , SIG_DFL) == SIG_ERR) - || (signal(SIGBUS , SIG_DFL) == SIG_ERR) - || (signal(SIGSEGV, SIG_DFL) == SIG_ERR)) - exit (1); - else { - kill (getpid(), aSig); - return; - } - } - break; - - default: - /* Unexpected signal. */ - eprinth ("util_Sys"); - eprintf ("\n Unexpected signal \'%d\' in trap function.\n", aSig); - break; - } - - exit (1); -} - - -/* ------------------------------------------------------------------ - * Function : "trapInit()". - */ - -extern void trapInit() -{ - /* Set the trap function for the ERROR signal. */ - if (ssignal (C_SIGERR, trapSig) == SIG_ERR) { trapSig (C_SIGTFLT); } - - /* Set the trap function for SIGTERM signal. */ - if (signal(SIGTERM, trapSig) == SIG_ERR) { trapSig (C_SIGTFLT); } - - /* Set the trap function for SIGFPE, SIGBUS and SIGSEGV signals. */ - if ( (signal(SIGFPE , trapSig) == SIG_ERR) - || (signal(SIGBUS , trapSig) == SIG_ERR) - || (signal(SIGSEGV, trapSig) == SIG_ERR)) trapSig (C_SIGTFLT); -} - - -/* ------------------------------------------------------------------ - * Function : "sendGSignal()". - */ - -extern void sendGSignal(aSig) - int aSig; -{ - gsignal (aSig); -} - - -/* ------------------------------------------------------------------ - * Function : "setBinName()". - */ - -extern void setBinName (asName) - char *asName; -{ - strncpy (util_binName, asName, 1023); -} - - - -/* ------------------------------------------------------------------ - * Function : "stdflush()". - */ - -extern void stdflush() -{ - fflush(stdout); - fflush(stderr); -} - - -/* ------------------------------------------------------------------ - * Function : "errMBK()". - */ - -extern void errMBK(asName) - char *asName; -{ - stdflush(); - - fprintf(stderr, "\n*** MBK error ***:"); - - if (asName != (char *)NULL) { - fprintf(stderr, "%s:", asName); - } -} - - -/* ------------------------------------------------------------------ - * Function : "eprinth()". - */ - -extern void eprinth(asName) - char *asName; -{ - stdflush(); - - fprintf(stderr, "\n*** Error ***:"); - - if (asName != (char *)NULL) { - fprintf(stderr, "%s:", asName); - } -} - - -/* ------------------------------------------------------------------ - * Function : "eprintf()". - */ - -extern int eprintf __FPV((char *aFormat, ...)) -{ - va_list ArgList; - __KR_C( char *aFormat; ) - int retVal; - - - __ANSI_C( va_start(ArgList, aFormat); ) - __KR_C( va_start(ArgList); ) - __KR_C( aFormat = va_arg(ArgList, char*); ) - - retVal = vfprintf(stderr, aFormat, ArgList); - - va_end(ArgList); - - return(retVal); -} - - -/* ------------------------------------------------------------------ - * Function : "eprints()". - */ - -extern int eprints(aS) - char *aS; -{ - return(fputs(aS, stderr)); -} - - -/* ------------------------------------------------------------------ - * Function : "warnMBK()". - */ - -extern void warnMBK(asName) - char *asName; -{ - stdflush(); - - fprintf(stderr, "*** MBK warning ***:"); - - if (asName != (char *)NULL) { - fprintf(stderr, "%s:", asName); - } -} - - -/* ------------------------------------------------------------------ - * Function : "wprinth()". - */ - -extern void wprinth(asName) - char *asName; -{ - stdflush(); - - fprintf(stderr, "*** Warning ***:"); - - if (asName != (char *)NULL) { - fprintf(stderr, "%s:", asName); - } -} - - -/* ------------------------------------------------------------------ - * Function : "wprintf()". - */ - -extern int wprintf __FPV((char *aFormat, ...)) -{ - va_list AL; - __KR_C( char *aFormat; ) - int RV; - - __ANSI_C( va_start(AL, aFormat); ) - __KR_C( va_start(AL); ) - __KR_C( aFormat = va_arg(AL, char*); ) - - RV = vfprintf(stderr, aFormat, AL); - va_end(AL); - - return(RV); -} - - -/* ------------------------------------------------------------------ - * Function : "wprints()". - */ - -extern int wprints(aS) - char *aS; -{ - return(fputs(aS, stderr)); -} - - -/* ------------------------------------------------------------------ - * Function : "setVL()". - */ - -extern void setVL(aVL) - long aVL; -{ - switch (aVL) { - case C_VerboseLevel0: - case C_VerboseLevel1: - case C_VerboseLevel2: util_VL = aVL; break; - default: util_VL = C_VerboseLevel2; break; - } -} - - -/* ------------------------------------------------------------------ - * Function : "getVL()". - */ - -extern long getVL() -{ - return (util_VL); -} - - -/* ------------------------------------------------------------------ - * Function : "vmprintf()". - */ - -extern int vmprintf(aVL, aFormat, aArgList) - va_list aArgList; - long aVL; - char *aFormat; -{ - int retVal; - - - if (aVL <= util_VL) { - retVal = vfprintf (stdout, aFormat, aArgList); - } else { - retVal = 0; - } - - return (retVal); -} - - -/* ------------------------------------------------------------------ - * Function : "mprintf()". - */ - -extern int mprintf __FPV((long aVL, char *aFormat, ...)) -{ - va_list ArgList; - __KR_C( char aVL; ) - __KR_C( char *aFormat; ) - int retVal; - - - __ANSI_C( va_start (ArgList, aFormat); ) - __KR_C( va_start (ArgList); ) - __KR_C( aVL = va_arg (ArgList, long ); ) - __KR_C( aFormat = va_arg (ArgList, char*); ) - - retVal = vmprintf (aVL, aFormat, ArgList); - - va_end(ArgList); - - return(retVal); -} - - -/* ------------------------------------------------------------------ - * Function : "mprints()". - */ - -extern int mprints(aVL, aS) - long aVL; - char *aS; -{ - int retVal; - - - if (aVL <= util_VL) { - retVal = fputs (aS, stdout); - } else { - retVal = 0; - } - - return (retVal); -} - - -/* ------------------------------------------------------------------ - * Function : "mprintf0()". - */ - -extern int mprintf0 __FPV((char *aFormat, ...)) -{ - va_list ArgList; - __KR_C( char *aFormat; ) - int retVal; - - - __ANSI_C( va_start (ArgList, aFormat); ) - __KR_C( va_start (ArgList); ) - __KR_C( aFormat = va_arg (ArgList, char*); ) - - retVal = vmprintf (C_VerboseLevel0, aFormat, ArgList); - - va_end (ArgList); - - return (retVal); -} - - -/* ------------------------------------------------------------------ - * Function : "mprintf1()". - */ - -extern int mprintf1 __FPV((char *aFormat, ...)) -{ - va_list ArgList; - __KR_C( char *aFormat; ) - int retVal; - - - __ANSI_C( va_start (ArgList, aFormat); ) - __KR_C( va_start (ArgList); ) - __KR_C( aFormat = va_arg (ArgList, char*); ) - - retVal = vmprintf (C_VerboseLevel1, aFormat, ArgList); - - va_end (ArgList); - - return (retVal); -} - - -/* ------------------------------------------------------------------ - * Function : "mprintf2()". - */ - -extern int mprintf2 __FPV((char *aFormat, ...)) -{ - va_list ArgList; - __KR_C( char *aFormat; ) - int retVal; - - - __ANSI_C( va_start (ArgList, aFormat); ) - __KR_C( va_start (ArgList); ) - __KR_C( aFormat = va_arg (ArgList, char*); ) - - retVal = vmprintf (C_VerboseLevel2, aFormat, ArgList); - - va_end (ArgList); - - return (retVal); -} - - -/* ------------------------------------------------------------------ - * Function : "util_init()". - */ - -extern void util_init(aVL, aFlags, asName) - long aVL; - long aFlags; - char *asName; -{ - util_flags = aFlags; - - trapInit (); - setVL (aVL); - setBinName (asName); -} - - -/* ------------------------------------------------------------------ - * Function : "s64printf()". - */ - -extern char *s64printf __FPV((char *aFormat, ...)) -{ - va_list aAL; - __KR_C( char *aFormat; ) - - static char s64[64][SIZE_S64]; - static long iS = 0; - - - __ANSI_C( va_start(aAL, aFormat); ) - __KR_C( va_start(aAL); ) - __KR_C( aFormat = va_arg(aAL, char*); ) - - vsprintf(s64[(++iS) % 64] , aFormat, aAL); - - va_end(aAL); - - return(s64[iS % 64]); -} - - -/* ------------------------------------------------------------------ - * Function : "strtoup()". - */ - -extern char *strtoup (aS) - char *aS; -{ - char *p; - - for (p = aS; *p != '\0'; p++) *p = (char)toupper ((int)*p); - - return (aS); -} diff --git a/alliance/src/vex/Makefile.am b/alliance/src/vex/Makefile.am deleted file mode 100644 index af437a64..00000000 --- a/alliance/src/vex/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -SUBDIRS = src diff --git a/alliance/src/vex/configure.in b/alliance/src/vex/configure.in deleted file mode 100644 index d19f8716..00000000 --- a/alliance/src/vex/configure.in +++ /dev/null @@ -1,45 +0,0 @@ -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 -dnl $Id: configure.in,v 1.1 2002/03/20 12:34:01 ludo Exp $ -dnl -dnl -AC_INIT(src/vex.h) -AM_INIT_AUTOMAKE(vex, 1.3) -AC_PROG_INSTALL -AC_PROG_CC -AC_HEADER_STDC -AC_C_CONST -AC_PROG_RANLIB - -AM_ALLIANCE - -AC_OUTPUT([ -Makefile -src/Makefile -]) diff --git a/alliance/src/vex/src/Makefile.am b/alliance/src/vex/src/Makefile.am deleted file mode 100644 index 6cf04568..00000000 --- a/alliance/src/vex/src/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -CFLAGS = @CFLAGS@ \ - -DALLIANCE_TOP=\"${ALLIANCE_TOP}\" -lib_LIBRARIES = libVex.a -include_HEADERS = vex.h -libVex_a_SOURCES = \ -vexcreate.h vexerror.c vexfree.h vexshift.c vexunflat.h \ -vex.h vexdel.c vexerror.h vexget.c vexshift.h vexview.c \ -vexadd.c vexdel.h vexeval.c vexget.h vexsimp.c vexview.h \ -vexadd.h vexdup.c vexeval.h vexis.c vexsimp.h \ -vexalloc.c vexdup.h vexextend.c vexis.h vexslice.c \ -vexalloc.h vexenv.c vexextend.h vexoptim.c vexslice.h \ -vexcreate.c vexenv.h vexfree.c vexoptim.h vexunflat.c diff --git a/alliance/src/vex/src/main.c b/alliance/src/vex/src/main.c deleted file mode 100644 index 8a998d1d..00000000 --- a/alliance/src/vex/src/main.c +++ /dev/null @@ -1,155 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -# include -# include -# include - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -int main( argc, argv ) - - int argc; - char **argv; -{ - long Integer; - long Value; - vexexpr *Vex; - vexexpr *Atom; - int Width = 8; - - mbkenv(); - autenv(); - vexenv(); - - if ( argc > 1 ) Width = atoi( argv[ 1 ] ); - -fprintf( stdout, "Width %d\n", Width ); - -fprintf( stdout, "width 0, signed 0\n" ); - for ( Integer = -10; Integer < 10; Integer++ ) - { - Vex = createvexatomlong( Integer, 0, 0 ); - fprintf( stdout, "%ld -> ", Integer ); - viewvexexprboundln( Vex ); - - if ( evalvexatomlong( Vex, &Value ) != -1 ) - fprintf( stdout, "<- %ld\n", Value ); - else - fprintf( stdout, "<- ERROR\n" ); - - Vex = extendvexatomsign( Vex, Width ); - if ( Vex != (vexexpr *)0 ) - { - viewvexexprboundln( Vex ); - fprintf( stdout, "\n" ); - } - else - fprintf( stdout, "<- ERROR\n" ); - } - -fprintf( stdout, "width 0, signed 1\n" ); - for ( Integer = -10; Integer < 10; Integer++ ) - { - Vex = createvexatomlong( Integer, 0, 1 ); - fprintf( stdout, "%ld -> ", Integer ); - viewvexexprboundln( Vex ); - if ( evalvexatomlong( Vex, &Value ) != -1 ) - fprintf( stdout, "<- %ld\n", Value ); - else - fprintf( stdout, "<- ERROR\n" ); - - Vex = extendvexatomsign( Vex, Width ); - if ( Vex != (vexexpr *)0 ) - { - viewvexexprboundln( Vex ); - fprintf( stdout, "\n" ); - } - else - fprintf( stdout, "<- ERROR\n" ); - } - -fprintf( stdout, "width 6, signed 0\n" ); - for ( Integer = -10; Integer < 10; Integer++ ) - { - Vex = createvexatomlong( Integer, 6, 0 ); - fprintf( stdout, "%ld -> ", Integer ); - viewvexexprboundln( Vex ); - if ( evalvexatomlong( Vex, &Value ) != -1 ) - fprintf( stdout, "<- %ld\n", Value ); - else - fprintf( stdout, "<- ERROR\n" ); - - Vex = extendvexatomsign( Vex, Width ); - if ( Vex != (vexexpr *)0 ) - { - viewvexexprboundln( Vex ); - fprintf( stdout, "\n" ); - } - else - fprintf( stdout, "<- ERROR\n" ); - } - -fprintf( stdout, "width 6, signed 1\n" ); - for ( Integer = -10; Integer < 10; Integer++ ) - { - Vex = createvexatomlong( Integer, 6, 1 ); - fprintf( stdout, "%ld -> ", Integer ); - viewvexexprboundln( Vex ); - if ( evalvexatomlong( Vex, &Value ) != -1 ) - fprintf( stdout, "<- %ld\n", Value ); - else - fprintf( stdout, "<- ERROR\n" ); - - Vex = extendvexatomsign( Vex, Width ); - if ( Vex != (vexexpr *)0 ) - { - viewvexexprboundln( Vex ); - fprintf( stdout, "\n" ); - } - else - fprintf( stdout, "<- ERROR\n" ); - } - - Atom = createvexatomvec( "v", 3, 0 ); - viewvexexprboundln( Atom ); - fprintf( stdout, "\n ici " ); - Vex = extendvexatomsign( Atom, 5 ); - viewvexexprboundln( Vex ); - fprintf( stdout, "\n" ); - - Atom = createvexatomvec( "v", 3, 0 ); - SetVexNodeSigned( Atom ); - viewvexexprboundln( Atom ); - fprintf( stdout, "\n" ); - Vex = extendvexatomsign( Atom, 5 ); - viewvexexprboundln( Vex ); - fprintf( stdout, "\n" ); - - return( 1 ); -} diff --git a/alliance/src/vex/src/vex.h b/alliance/src/vex/src/vex.h deleted file mode 100644 index a90f7db3..00000000 --- a/alliance/src/vex/src/vex.h +++ /dev/null @@ -1,693 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------\ -| | -| Title : Structures and fonctions for VEX | -| | -| Date : 04.02.97 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------*/ - -# ifndef VEX_103_H -# define VEX_103_H - -/*------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------*/ - -# ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -# endif - -/*------------------------------------------------------\ -| | -| View Mode | -| | -\------------------------------------------------------*/ - -# define VEX_VIEW_VHDL 0 -# define VEX_VIEW_VERILOG 1 - -/*------------------------------------------------------\ -| | -| Node Type | -| | -\------------------------------------------------------*/ - -# define VEX_NODE_ATOM_MASK (unsigned short)(0x1000) -# define VEX_NODE_OPER_MASK (unsigned short)(0x2000) -# define VEX_NODE_FUNC_MASK (unsigned short)(0x4000) -# define VEX_NODE_TYPE_MASK (unsigned short)(0x7000) - -# define VEX_NODE_TAG_MASK (unsigned short)(0x8000) - -# define VEX_ATOM_LITERAL_MASK (unsigned short)(0x0100) /*Literal Name */ -# define VEX_NODE_SIGNED_MASK (unsigned short)(0x0200) /*Signed Unsigned */ -# define VEX_NODE_BIT_MASK (unsigned short)(0x0400) /*Bit Vector */ -# define VEX_NODE_DOWN_MASK (unsigned short)(0x0800) /*Down Up */ -# define VEX_NODE_VAR_WIDTH_MASK (unsigned short)(0x0080) /*Variable Width */ - -# define VEX_NODE_USER1_MASK (unsigned short)(0x0020) -# define VEX_NODE_USER2_MASK (unsigned short)(0x0040) - -# define VEX_NODE_VHDL_TYPE_MASK (unsigned short)(0x001f) - -/*------------------------------------------------------\ -| | -| Macro Node Type | -| | -\------------------------------------------------------*/ - -# define IsVexNodeAtom( N ) ( (N)->TYPE & VEX_NODE_ATOM_MASK ) -# define SetVexNodeAtom( N ) ( (N)->TYPE = ((N)->TYPE & ~VEX_NODE_TYPE_MASK )\ - | VEX_NODE_ATOM_MASK ) -# define IsVexNodeOper( N ) ( (N)->TYPE & VEX_NODE_OPER_MASK ) -# define SetVexNodeOper( N ) ( (N)->TYPE = ((N)->TYPE & ~VEX_NODE_TYPE_MASK )\ - | VEX_NODE_OPER_MASK ) -# define IsVexNodeFunc( N ) ( (N)->TYPE & VEX_NODE_FUNC_MASK ) -# define SetVexNodeFunc( N ) ( (N)->TYPE = ((N)->TYPE & ~VEX_NODE_TYPE_MASK )\ - | VEX_NODE_FUNC_MASK ) - -/*------------------------------------------------------\ -| | -| Macro Node Width | -| | -\------------------------------------------------------*/ - -# define IsVexNodeVarWidth( N ) ( (N)->TYPE & VEX_NODE_VAR_WIDTH_MASK ) -# define SetVexNodeVarWidth( N ) ( (N)->TYPE |= VEX_NODE_VAR_WIDTH_MASK ) -# define ClearVexNodeVarWidth( N ) ( (N)->TYPE &= ~VEX_NODE_VAR_WIDTH_MASK ) - -/*------------------------------------------------------\ -| | -| Macro Node Signed | -| | -\------------------------------------------------------*/ - -# define IsVexNodeSigned( N ) ( (N)->TYPE & VEX_NODE_SIGNED_MASK ) -# define SetVexNodeSigned( N ) ( (N)->TYPE |= VEX_NODE_SIGNED_MASK ) -# define ClearVexNodeSigned( N ) ( (N)->TYPE &= ~VEX_NODE_SIGNED_MASK ) - -/*------------------------------------------------------\ -| | -| Macro Node Bit | -| | -\------------------------------------------------------*/ - -# define IsVexNodeBit( N ) ( (N)->TYPE & VEX_NODE_BIT_MASK ) -# define SetVexNodeBit( N ) ( (N)->TYPE |= VEX_NODE_BIT_MASK ) -# define ClearVexNodeBit( N ) ( (N)->TYPE &= ~VEX_NODE_BIT_MASK ) - -/*------------------------------------------------------\ -| | -| Macro Node Direction | -| | -\------------------------------------------------------*/ - -# define IsVexNodeDown( N ) ( (N)->TYPE & VEX_NODE_DOWN_MASK ) -# define SetVexNodeDown( N ) ( (N)->TYPE |= VEX_NODE_DOWN_MASK ) -# define ClearVexNodeDown( N ) ( (N)->TYPE &= ~VEX_NODE_DOWN_MASK ) - -/*------------------------------------------------------\ -| | -| Macro Node Tag | -| | -\------------------------------------------------------*/ - -# define IsVexNodeTag( N ) ( (N)->TYPE & VEX_NODE_TAG_MASK ) -# define SetVexNodeTag( N ) ( (N)->TYPE |= VEX_NODE_TAG_MASK ) -# define ClearVexNodeTag( N ) ( (N)->TYPE &= ~VEX_NODE_TAG_MASK ) - -/*------------------------------------------------------\ -| | -| Macro Atom | -| | -\------------------------------------------------------*/ - -# define IsVexAtomLiteral( N ) ( (N)->TYPE & VEX_ATOM_LITERAL_MASK ) -# define SetVexAtomLiteral( N ) ( (N)->TYPE |= VEX_ATOM_LITERAL_MASK ) -# define ClearVexAtomLiteral( N ) ( (N)->TYPE &= ~VEX_ATOM_LITERAL_MASK ) - -# define IsVexAtomVarWidth( N ) ( IsVexNodeVarWidth( N ) ) -# define SetVexAtomVarWidth( N ) ( SetVexNodeVarWidth( N ) ) -# define IsVexAtomStaWidth( N ) ( ! IsVexNodeVarWidth( N ) ) -# define SetVexAtomStaWidth( N ) ( ClearVexNodeVarWidth( N ) ) - -# define IsVexAtomBit( N ) ( IsVexNodeBit( N ) ) -# define SetVexAtomBit( N ) ( SetVexNodeBit( N ) ) -# define IsVexAtomVector( N ) ( ! IsVexNodeBit( N ) ) -# define SetVexAtomVector( N ) ( ClearVexNodeBit( N ) ) - -# define IsVexAtomSigned( N ) ( IsVexNodeSigned( N ) ) -# define SetVexAtomSigned( N ) ( SetVexNodeSigned( N ) ) -# define IsVexAtomUnsigned( N ) ( ! IsVexNodeSigned( N ) ) -# define SetVexAtomUnsigned( N ) ( ClearVexNodeSigned( N ) ) - -# define IsVexAtomDown( N ) ( IsVexNodeDown( N ) ) -# define SetVexAtomDown( N ) ( SetVexNodeDown( N ) ) -# define IsVexAtomUp( N ) ( ! IsVexNodeDown( N ) ) -# define SetVexAtomUp( N ) ( ClearVexNodeDown( N ) ) - -/*------------------------------------------------------\ -| | -| Macro Oper | -| | -\------------------------------------------------------*/ - -# define IsVexOperVarWidth( N ) ( IsVexNodeVarWidth( N ) ) -# define SetVexOperVarWidth( N ) ( SetVexNodeVarWidth( N ) ) -# define IsVexOperStaWidth( N ) ( ! IsVexNodeVarWidth( N ) ) -# define SetVexOperStaWidth( N ) ( ClearVexNodeVarWidth( N ) ) - -# define IsVexOperBit( N ) ( IsVexNodeBit( N ) ) -# define SetVexOperBit( N ) ( SetVexNodeBit( N ) ) -# define IsVexOperVector( N ) ( ! IsVexNodeBit( N ) ) -# define SetVexOperVector( N ) ( ClearVexNodeBit( N ) ) - -# define IsVexOperSigned( N ) ( IsVexNodeSigned( N ) ) -# define SetVexOperSigned( N ) ( SetVexNodeSigned( N ) ) -# define IsVexOperUnsigned( N ) ( ! IsVexNodeSigned( N ) ) -# define SetVexOperUnsigned( N ) ( ClearVexNodeSigned( N ) ) - -# define IsVexOperDown( N ) ( IsVexNodeDown( N ) ) -# define SetVexOperDown( N ) ( SetVexNodeDown( N ) ) -# define IsVexOperUp( N ) ( ! IsVexNodeDown( N ) ) -# define SetVexOperUp( N ) ( ClearVexNodeDown( N ) ) - -/*------------------------------------------------------\ -| | -| Macro Func | -| | -\------------------------------------------------------*/ - -# define IsVexFuncVarWidth( N ) ( IsVexNodeVarWidth( N ) ) -# define SetVexFuncVarWidth( N ) ( SetVexNodeVarWidth( N ) ) -# define IsVexFuncStaWidth( N ) ( ! IsVexNodeVarWidth( N ) ) -# define SetVexFuncStaWidth( N ) ( ClearVexNodeVarWidth( N ) ) - -# define IsVexFuncBit( N ) ( IsVexNodeBit( N ) ) -# define SetVexFuncBit( N ) ( SetVexNodeBit( N ) ) -# define IsVexFuncVector( N ) ( ! IsVexNodeBit( N ) ) -# define SetVexFuncVector( N ) ( ClearVexNodeBit( N ) ) - -# define IsVexFuncSigned( N ) ( IsVexNodeSigned( N ) ) -# define SetVexFuncSigned( N ) ( SetVexNodeSigned( N ) ) -# define IsVexFuncUnsigned( N ) ( ! IsVexNodeSigned( N ) ) -# define SetVexFuncUnsigned( N ) ( ClearVexNodeSigned( N ) ) - -# define IsVexFuncDown( N ) ( IsVexNodeDown( N ) ) -# define SetVexFuncDown( N ) ( SetVexNodeDown( N ) ) -# define IsVexFuncUp( N ) ( ! IsVexNodeDown( N ) ) -# define SetVexFuncUp( N ) ( ClearVexNodeDown( N ) ) - -/*------------------------------------------------------\ -| | -| Macro Type | -| | -\------------------------------------------------------*/ - -# define SetVexVhdlType( N, T ) ((N)->TYPE = ((N)->TYPE & ~VEX_NODE_VHDL_TYPE_MASK)|(T)) -# define GetVexVhdlType( N ) ((N)->TYPE & VEX_NODE_VHDL_TYPE_MASK) - -/*------------------------------------------------------\ -| | -| Operators | -| | -\------------------------------------------------------*/ - -# define VEX_CONCAT 0 -# define VEX_NOT 1 -# define VEX_NEG 2 -# define VEX_EVENT 3 -# define VEX_OR 4 -# define VEX_AND 5 -# define VEX_XOR 6 -# define VEX_NOR 7 -# define VEX_NAND 8 -# define VEX_NXOR 9 -# define VEX_EQ 10 -# define VEX_NE 11 -# define VEX_LT 12 -# define VEX_LE 13 -# define VEX_GT 14 -# define VEX_GE 15 -# define VEX_ADD 16 -# define VEX_SUB 17 -# define VEX_MUL 18 -# define VEX_DIV 19 -# define VEX_EXP 20 -# define VEX_MOD 21 -# define VEX_REM 22 -# define VEX_TO 23 -# define VEX_DOWNTO 24 -# define VEX_INDEX 25 -# define VEX_LEFT 26 -# define VEX_RIGHT 27 -# define VEX_LOW 28 -# define VEX_HIGH 29 -# define VEX_LENGTH 30 -# define VEX_RANGE 31 -# define VEX_REV_RANGE 32 -# define VEX_DRIVER 33 -# define VEX_IFT 34 -# define VEX_ARRAY 35 -# define VEX_INDEX_N 36 -# define VEX_OTHERS 37 -# define VEX_NUM_BIT 38 -# define VEX_ABS 39 - -# define VEX_MAX_OPERATOR 40 - -/*------------------------------------------------------\ -| | -| Vhdl Type | -| | -\------------------------------------------------------*/ - -# define VEX_TYPE_SEVERITY 0 -# define VEX_TYPE_BOOLEAN 1 -# define VEX_TYPE_CHARACTER 2 -# define VEX_TYPE_STRING 3 -# define VEX_TYPE_BIT 4 -# define VEX_TYPE_INTEGER 5 -# define VEX_TYPE_NATURAL 6 -# define VEX_TYPE_BIT_VECTOR 7 -# define VEX_TYPE_STD_ULOGIC 8 -# define VEX_TYPE_STD_LOGIC 9 -# define VEX_TYPE_STD_ULOGIC_VECTOR 10 -# define VEX_TYPE_STD_LOGIC_VECTOR 11 -# define VEX_TYPE_X01 12 -# define VEX_TYPE_X01Z 13 -# define VEX_TYPE_UX01 14 -# define VEX_TYPE_UX01Z 15 -# define VEX_TYPE_UNSIGNED 16 -# define VEX_TYPE_SIGNED 17 -# define VEX_TYPE_SMALL_INT 18 -# define VEX_TYPE_REG_BIT 19 -# define VEX_TYPE_REG_VECTOR 20 -# define VEX_TYPE_MUX_BIT 21 -# define VEX_TYPE_MUX_VECTOR 22 -# define VEX_TYPE_WOR_BIT 23 -# define VEX_TYPE_WOR_VECTOR 24 -# define VEX_TYPE_ENUMERATE 25 -# define VEX_TYPE_ARRAY 26 - -# define VEX_MAX_TYPE 27 - -/*------------------------------------------------------\ -| | -| Std Function | -| | -\------------------------------------------------------*/ - -# define VEX_STD_TO_BIT 0 -# define VEX_STD_TO_BITVECTOR 1 -# define VEX_STD_TO_STDULOGIC 2 -# define VEX_STD_TO_STDLOGICVECTOR 3 -# define VEX_STD_TO_STDULOGICVECTOR 4 -# define VEX_STD_TO_X01 5 -# define VEX_STD_TO_X01Z 6 -# define VEX_STD_TO_UX01 7 -# define VEX_STD_RISING_EDGE 8 -# define VEX_STD_FALLING_EDGE 9 -# define VEX_STD_IS_X 10 -# define VEX_STD_ABS 11 -# define VEX_STD_SHL 12 -# define VEX_STD_SHR 13 -# define VEX_STD_CONV_INTEGER 14 -# define VEX_STD_CONV_UNSIGNED 15 -# define VEX_STD_CONV_SIGNED 16 -# define VEX_STD_CONV_STD_LOGIC_VECTOR 17 -# define VEX_STD_EXT 18 -# define VEX_STD_SXT 19 -# define VEX_STD_SHIFT_LEFT 20 -# define VEX_STD_SHIFT_RIGHT 21 -# define VEX_STD_ROTATE_LEFT 22 -# define VEX_STD_ROTATE_RIGHT 23 -# define VEX_STD_RESIZE 24 -# define VEX_STD_TO_INTEGER 25 -# define VEX_STD_TO_UNSIGNED 26 -# define VEX_STD_TO_SIGNED 27 -# define VEX_STD_STD_LOGIC_VECTOR 28 -# define VEX_STD_STD_ULOGIC_VECTOR 29 -# define VEX_STD_SIGNED 30 -# define VEX_STD_UNSIGNED 31 - -# define VEX_MAX_STD_FUNC 32 - -/*------------------------------------------------------\ -| | -| Literals 9 | -| | -\------------------------------------------------------*/ - -# define VEX_UNINIT_ID 0 /* Uninitialized */ -# define VEX_UNKNOWN_ID 1 /* Forcing Unknown */ -# define VEX_ZERO_ID 2 /* Forcing 0 */ -# define VEX_ONE_ID 3 /* Forcing 1 */ -# define VEX_TRISTATE_ID 4 /* High Impedance */ -# define VEX_WEAK_UNKNOWN_ID 5 /* Weak Unknown */ -# define VEX_WEAK_ZERO_ID 6 /* Weak 0 */ -# define VEX_WEAK_ONE_ID 7 /* Weak 1 */ -# define VEX_DC_ID 8 /* Don't care */ -# define VEX_MAX_ID 9 - -/*------------------------------------------------------\ -| | -| Macro Literals 9 | -| | -\------------------------------------------------------*/ - -# define VEX_UNINIT VEX_LITERAL_BY_ID[ VEX_UNINIT_ID ] -# define VEX_UNKNOWN VEX_LITERAL_BY_ID[ VEX_UNKNOWN_ID ] -# define VEX_ZERO VEX_LITERAL_BY_ID[ VEX_ZERO_ID ] -# define VEX_ONE VEX_LITERAL_BY_ID[ VEX_ONE_ID ] -# define VEX_TRISTATE VEX_LITERAL_BY_ID[ VEX_TRISTATE_ID ] -# define VEX_WEAK_UNKNOWN VEX_LITERAL_BY_ID[ VEX_WEAK_UNKNOWN_ID ] -# define VEX_WEAK_ZERO VEX_LITERAL_BY_ID[ VEX_WEAK_ZERO_ID ] -# define VEX_WEAK_ONE VEX_LITERAL_BY_ID[ VEX_WEAK_ONE_ID ] -# define VEX_DC VEX_LITERAL_BY_ID[ VEX_DC_ID ] - -/*------------------------------------------------------\ -| | -| Macro Atom Literals 9 | -| | -\------------------------------------------------------*/ - -# define VEX_ATOM_UNINIT VEX_ATOM_BY_ID[ VEX_UNINIT_ID ] -# define VEX_ATOM_UNKNOWN VEX_ATOM_BY_ID[ VEX_UNKNOWN_ID ] -# define VEX_ATOM_ZERO VEX_ATOM_BY_ID[ VEX_ZERO_ID ] -# define VEX_ATOM_ONE VEX_ATOM_BY_ID[ VEX_ONE_ID ] -# define VEX_ATOM_TRISTATE VEX_ATOM_BY_ID[ VEX_TRISTATE_ID ] -# define VEX_ATOM_WEAK_UNKNOWN VEX_ATOM_BY_ID[ VEX_WEAK_UNKNOWN_ID ] -# define VEX_ATOM_WEAK_ZERO VEX_ATOM_BY_ID[ VEX_WEAK_ZERO_ID ] -# define VEX_ATOM_WEAK_ONE VEX_ATOM_BY_ID[ VEX_WEAK_ONE_ID ] -# define VEX_ATOM_DC VEX_ATOM_BY_ID[ VEX_DC_ID ] - -/*------------------------------------------------------\ -| | -| Macro Oper Types | -| | -\------------------------------------------------------*/ - -# define GetVexFuncValue( N ) ( (char *)(N)->VALUE ) -# define SetVexFuncValue( N, F ) ( (N)->VALUE = (void *)(F) ) - -# define GetVexOperValue( N ) ( (long )(N)->VALUE ) -# define SetVexOperValue( N, O ) ( (N)->VALUE = (void *)(O) ) - -# define GetVexAtomValue( N ) ( (char *)(N)->VALUE ) -# define SetVexAtomValue( N, A ) ( (N)->VALUE = (void *)(A) ) - -# define GetVexOperand( C ) ( (vexexpr *)(C)->DATA ) -# define SetVexOperand( C, O ) ( (C)->DATA = (void *)(O) ) - -/*------------------------------------------------------\ -| | -| Type | -| | -\------------------------------------------------------*/ - - typedef struct vexexpr - { - chain_list *OPERAND; - void *VALUE; - short TYPE; - short LEFT; - short RIGHT; - short WIDTH; - - } vexexpr; - -/*------------------------------------------------------\ -| | -| Global Variable | -| | -\------------------------------------------------------*/ - - extern char *VEX_OPER_NAME[ VEX_MAX_OPERATOR ]; - extern char *VEX_OPER_UPPER_NAME[ VEX_MAX_OPERATOR ]; - extern char *VEX_OPER_VERILOG_NAME[ VEX_MAX_OPERATOR ]; - extern char *VEX_TYPE_NAME[ VEX_MAX_TYPE ]; - extern long VEX_OPER_NOT[ VEX_MAX_OPERATOR ]; - extern char VEX_LITERAL_BY_ID[ VEX_MAX_ID ]; - extern char *VEX_ATOM_BY_ID[ VEX_MAX_ID ]; - extern char *VEX_STD_FUNC_NAME[ VEX_MAX_STD_FUNC ]; - extern char *VEX_STD_FUNC_UPPER_NAME[ VEX_MAX_STD_FUNC ]; - -/*------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------*/ -/*------------------------------------------------------\ -| | -| Initialize Functions | -| | -\------------------------------------------------------*/ - - extern void vexenv __P(()); - -/*------------------------------------------------------\ -| | -| Node Functions | -| | -\------------------------------------------------------*/ - - extern vexexpr *allocvexnode __P(()); - extern vexexpr *dupvexnode __P((vexexpr *Node)); - extern vexexpr *copyvexnode __P((vexexpr *Target, vexexpr *Source)); - extern void freevexnode __P((vexexpr *Node)); - -/*------------------------------------------------------\ -| | -| Create Functions | -| | -\------------------------------------------------------*/ - - extern vexexpr *createvexatombit __P((char *Name)); - extern vexexpr *createvexatomvec __P((char *Name, short Left, short Right)); - extern vexexpr *createvexatomlit __P((char *Name)); - extern vexexpr *createvexatomveclit __P((unsigned char Literal, short Width)); - extern vexexpr *createvexatomlong __P((long Integer, short Width, short Signed)); - extern vexexpr *createvexatomlongarray __P((long *Array, short Size, short Width, short Signed)); - - extern vexexpr *createvexoper __P((long Oper, short Width)); - extern vexexpr *createvexbinexpr __P((long Oper, short Width, vexexpr *Expr1, vexexpr *Expr2)); - extern vexexpr *createvexternaryexpr __P((long Oper, short Width, \ - vexexpr *Expr1, vexexpr *Expr2, vexexpr *Expr3)); - extern vexexpr *createvexunaryexpr __P((long Oper, short Width, vexexpr *Expr)); - - extern vexexpr *createvexfunc __P((char *Func, short Width)); - -/*------------------------------------------------------\ -| | -| Simplify Functions | -| | -\------------------------------------------------------*/ - - extern vexexpr *simpvexexpr __P((vexexpr *Expr)); - extern vexexpr *simpvexexpreq __P((vexexpr *Expr)); - extern vexexpr *simpvexexprothers __P((vexexpr *Expr, short Width )); - -/*------------------------------------------------------\ -| | -| Optimize Functions | -| | -\------------------------------------------------------*/ - - extern vexexpr *optimvexnotexpr __P((vexexpr *Expr)); - extern vexexpr *optimvexbinexpr __P((long Oper, short Width, vexexpr *Expr1, vexexpr *Expr2)); - -/*------------------------------------------------------\ -| | -| Add Functions | -| | -\------------------------------------------------------*/ - - extern void addvexqexpr __P((vexexpr *Expr1, vexexpr *Expr2)); - extern void addvexhexpr __P((vexexpr *Expr1, vexexpr *Expr2)); - -/*------------------------------------------------------\ -| | -| Duplicate Functions | -| | -\------------------------------------------------------*/ - - extern vexexpr *dupvexexpr __P((vexexpr *Expr)); - -/*------------------------------------------------------\ -| | -| Del Functions | -| | -\------------------------------------------------------*/ - - extern void delvexexpr __P((vexexpr *Expr)); - extern void delvexexprnum __P((vexexpr *Expr, int Number)); - -/*------------------------------------------------------\ -| | -| Free Functions | -| | -\------------------------------------------------------*/ - - extern void freevexexpr __P((vexexpr *Expr)); - -/*------------------------------------------------------\ -| | -| Is Functions | -| | -\------------------------------------------------------*/ - - extern int isvexunaryoper __P((long Oper)); - extern int isvexbinaryoper __P((long Oper)); - extern int isvexternaryoper __P((long Oper)); - extern int isvexoperinexpr __P((vexexpr *Expr, long Oper)); - extern int isvexarithoperinexpr __P((vexexpr *Expr)); - extern int isvexnameinexpr __P((vexexpr *Expr, char *Name)); - extern int isvexpositiveoper __P((long Oper)); - extern int isvexnegativeoper __P((long Oper)); - extern int isvexequalexpr __P((vexexpr *Expr1, vexexpr *Expr2)); - extern int isvextypedivisible __P((int Type)); - extern int isvextypevector __P((int Type)); - -/*------------------------------------------------------\ -| | -| Get Functions | -| | -\------------------------------------------------------*/ - - extern char *getvexvectorname __P((char *Vector, long *Index)); - extern char *getvexopername __P((long Oper)); - extern char *getvexatomname __P((vexexpr *Expr)); - extern char *getvexoperuppername __P((long Oper)); - extern char *getvexoperverilogname __P((long Oper)); - extern long getvexoperbyname __P((char *Name)); - extern long getvexnotoper __P((long Oper)); - - extern char *getvexarrayname __P((vexexpr *Atom)); - extern vexexpr *getvexarrayatom __P((vexexpr *Expr)); - - extern chain_list *getvexatombitname __P((vexexpr *Expr)); - extern chain_list *getvexexprsupport __P((vexexpr *Expr)); - extern chain_list *unionvexexprsupport __P((chain_list *Support, vexexpr *Expr)); - - extern ptype_list *getvexatombitnameptype __P((vexexpr *Expr)); - extern ptype_list *getvexexprsupportptype __P((vexexpr *Expr)); - extern ptype_list *unionvexexprsupportptype __P((ptype_list *Support, vexexpr *Expr)); - - extern chain_list *getvexexprallname __P((vexexpr *Expr)); - extern chain_list *unionvexexprallname __P((chain_list *AllName, vexexpr *Expr)); - - extern int getvextypescalar __P((int Type)); - - extern long getvexexprdepth __P((vexexpr *Expr)); - extern long getvexexprnumnode __P((vexexpr *Expr)); - extern int getvexliteralid __P((char Literal)); - extern int getvexstdfuncid __P((char *FuncName)); - - extern int getvexvectorpos __P((vexexpr *Vector, short Index)); - extern int getvexvectorindex __P((vexexpr *Atom, short Position)); - extern int getvexvectormin __P((vexexpr *Expr)); - extern int getvexvectormax __P((vexexpr *Expr)); - - extern int getvexintnumbit __P((long Size)); - extern int getvexintervalnumbit __P((long Left, long Right)); - -/*------------------------------------------------------\ -| | -| Eval Functions | -| | -\------------------------------------------------------*/ - - extern int evalvexatomlong __P((vexexpr *Expr, long *PLong)); - - extern int evalvexnotliteral __P((char Literal, char *PChar)); - extern int evalvexandliteral __P((char Literal1, char Literal2, char *PChar)); - extern int evalvexorliteral __P((char Literal1, char Literal2, char *PChar)); - extern int evalvexxorliteral __P((char Literal1, char Literal2, char *PChar)); - -/*------------------------------------------------------\ -| | -| Extend Sign Functions | -| | -\------------------------------------------------------*/ - - extern vexexpr *extendvexatomsign __P((vexexpr *Expr, short Width)); - -/*------------------------------------------------------\ -| | -| Shift Functions | -| | -\------------------------------------------------------*/ - - extern vexexpr *shiftvexatomleft __P((vexexpr *Expr, short Count )); - extern vexexpr *shiftvexatomright __P((vexexpr *Expr, short Count )); - -/*------------------------------------------------------\ -| | -| Slice Functions | -| | -\------------------------------------------------------*/ - - extern vexexpr *slicevexatomvec __P((vexexpr *Expr, short Left, short Right)); - -/*------------------------------------------------------\ -| | -| Unflat Functions | -| | -\------------------------------------------------------*/ - - extern vexexpr *unflatvexexpr __P((vexexpr *Expr)); - -/*------------------------------------------------------\ -| | -| View Functions | -| | -\------------------------------------------------------*/ - - extern void viewvexexprfile __P((FILE *VexFile, vexexpr *Expr)); - extern void viewvexexpr __P((vexexpr *Expr)); - extern void viewvexexprln __P((vexexpr *Expr)); - extern void viewvexexprbound __P((vexexpr *Expr)); - extern void viewvexexprboundln __P((vexexpr *Expr)); - - extern char *viewvexexprstr __P((vexexpr *Expr)); - extern char *viewvexexprstrbound __P((vexexpr *Expr)); - - extern int getvexviewmode __P(()); - extern void setvexviewmode __P((int Mode)); - -# endif diff --git a/alliance/src/vex/src/vexadd.c b/alliance/src/vex/src/vexadd.c deleted file mode 100644 index 2608d790..00000000 --- a/alliance/src/vex/src/vexadd.c +++ /dev/null @@ -1,115 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexadd.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include "vexadd.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Add Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Add Vex Queue Expr | -| | -\------------------------------------------------------------*/ - -void addvexqexpr( Expr1, Expr2 ) - - vexexpr *Expr1; - vexexpr *Expr2; -{ - chain_list *ScanOper; - chain_list **PrevOper; - - PrevOper = &Expr1->OPERAND; - - for ( ScanOper = Expr1->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - PrevOper = &ScanOper->NEXT; - } - - *PrevOper = addchain( (chain_list *)0, (void *)Expr2 ); -} - -/*------------------------------------------------------------\ -| | -| Add Vex Head Expr | -| | -\------------------------------------------------------------*/ - -void addvexhexpr( Expr1, Expr2 ) - - vexexpr *Expr1; - vexexpr *Expr2; -{ - Expr1->OPERAND = addchain( Expr1->OPERAND, (void *)Expr2 ); -} diff --git a/alliance/src/vex/src/vexadd.h b/alliance/src/vex/src/vexadd.h deleted file mode 100644 index e0f228b5..00000000 --- a/alliance/src/vex/src/vexadd.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexadd.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_ADD_H -# define VEX_ADD_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexalloc.c b/alliance/src/vex/src/vexalloc.c deleted file mode 100644 index ef1d2063..00000000 --- a/alliance/src/vex/src/vexalloc.c +++ /dev/null @@ -1,123 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexalloc.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include -# include -# include "vexalloc.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Vex Alloc Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Vex Alloc Node | -| | -\------------------------------------------------------------*/ - -vexexpr *allocvexnode() -{ - return( (vexexpr *)autallocheap( sizeof( vexexpr ) ) ); -} - -/*------------------------------------------------------------\ -| | -| Vex Copy Node | -| | -\------------------------------------------------------------*/ - -vexexpr *copyvexnode( Target, Source ) - - vexexpr *Target; - vexexpr *Source; -{ - memcpy( (char *)Target, (char *)Source, sizeof( vexexpr ) ); - - return( Target ); -} - -/*------------------------------------------------------------\ -| | -| Vex Duplicate Node | -| | -\------------------------------------------------------------*/ - -vexexpr *dupvexnode( Node ) - - vexexpr *Node; -{ - vexexpr *DupNode; - - DupNode = (vexexpr *)autallocheap( sizeof( vexexpr ) ); - DupNode = copyvexnode( DupNode, Node ); - - return( DupNode ); -} - diff --git a/alliance/src/vex/src/vexalloc.h b/alliance/src/vex/src/vexalloc.h deleted file mode 100644 index ce72f0a5..00000000 --- a/alliance/src/vex/src/vexalloc.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexalloc.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_ALLOC_H -# define VEX_ALLOC_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexcreate.c b/alliance/src/vex/src/vexcreate.c deleted file mode 100644 index ca6187db..00000000 --- a/alliance/src/vex/src/vexcreate.c +++ /dev/null @@ -1,530 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexcreate.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include -# include "vexcreate.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Create Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Create Vex Atom Vector | -| | -\------------------------------------------------------------*/ - -vexexpr *createvexatomvec( Name, Left, Right ) - - char *Name; - short Left; - short Right; -{ - vexexpr *Node; - short Width; - - Name = namealloc( Name ); - Node = allocvexnode(); - - SetVexNodeAtom( Node ); - SetVexAtomValue( Node, Name ); - SetVexAtomVector( Node ); - - if ( ( Left < 0 ) || - ( Right < 0 ) ) - { - Node->WIDTH = 1; - SetVexNodeVarWidth( Node ); - } - else - { - if ( Left < Right ) - { - Width = 1 + Right - Left; - } - else - { - Width = 1 + Left - Right; - SetVexAtomDown( Node ); - } - - Node->LEFT = Left; - Node->RIGHT = Right; - Node->WIDTH = Width; - } - - if ( Name[ 0 ] == '"' ) - { - SetVexAtomLiteral( Node ); - } - - return( Node ); -} - -/*------------------------------------------------------------\ -| | -| Create Vex Atom Literal | -| | -\------------------------------------------------------------*/ - -vexexpr *createvexatomlit( Name ) - - char *Name; -{ - vexexpr *Node; - short Width; - - Name = namealloc( Name ); - Node = allocvexnode(); - - SetVexNodeAtom( Node ); - SetVexAtomValue( Node, Name ); - SetVexAtomLiteral( Node ); - - Width = strlen( Name ) - 2; - - Node->LEFT = Width - 1; - Node->RIGHT = 0; - Node->WIDTH = Width; - - if ( Width > 1 ) SetVexAtomVector( Node ); - else SetVexAtomBit( Node ); - - return( Node ); -} - -/*------------------------------------------------------------\ -| | -| Create Vex Atom Literal Vector | -| | -\------------------------------------------------------------*/ - -vexexpr *createvexatomveclit( Literal, Width ) - - unsigned char Literal; - short Width; -{ - vexexpr *Node; - char *Name; - char Buffer[ 512 ]; - char Cote; - - if ( Width > 1 ) Cote = '\"'; - else Cote = '\''; - - Buffer[ 0 ] = Cote; - Buffer[ Width + 1 ] = Cote; - Buffer[ Width + 2 ] = '\0'; - - memset( Buffer + 1, Literal, Width ); - - Name = namealloc( Buffer ); - Node = allocvexnode(); - - SetVexNodeAtom( Node ); - SetVexAtomValue( Node, Name ); - SetVexAtomLiteral( Node ); - - Node->LEFT = Width - 1; - Node->RIGHT = 0; - Node->WIDTH = Width; - - if ( Width > 1 ) SetVexAtomVector( Node ); - else SetVexAtomBit( Node ); - - return( Node ); -} - -/*------------------------------------------------------------\ -| | -| Create Vex Atom Bit | -| | -\------------------------------------------------------------*/ - -vexexpr *createvexatombit( Name ) - - char *Name; -{ - vexexpr *Node; - - Name = namealloc( Name ); - - Node = allocvexnode(); - - SetVexNodeAtom( Node ); - SetVexAtomValue( Node, Name ); - SetVexAtomBit( Node ); - - Node->WIDTH = 1; - - if ( Name[ 0 ] == '\'' ) - { - SetVexAtomLiteral( Node ); - } - - return( Node ); -} - -/*------------------------------------------------------------\ -| | -| Create Vex Oper | -| | -\------------------------------------------------------------*/ - -vexexpr *createvexoper( Oper, Width ) - - long Oper; - short Width; -{ - vexexpr *Node; - - if ( ( Oper < 0 ) || - ( Oper >= VEX_MAX_OPERATOR ) ) - { - vexerror( VEX_OPERATOR_ERROR, Oper ); - } - - Node = allocvexnode(); - - if ( Width <= 0 ) - { - Width = 1; - SetVexNodeVarWidth( Node ); - } - - Node->WIDTH = Width; - Node->LEFT = Width - 1; - - SetVexNodeOper( Node ); - SetVexOperValue( Node, Oper ); - - return( Node ); -} - -/*------------------------------------------------------------\ -| | -| Create Vex Bin Expr | -| | -\------------------------------------------------------------*/ - -vexexpr *createvexbinexpr( Oper, Width, Expr1, Expr2 ) - - long Oper; - short Width; - vexexpr *Expr1; - vexexpr *Expr2; -{ - vexexpr *Expr; - - if ( ! isvexbinaryoper( Oper ) ) - { - vexerror( VEX_OPERATOR_ERROR, Oper ); - } - - Expr = createvexoper( Oper, Width ); - - addvexhexpr( Expr, Expr2 ); - addvexhexpr( Expr, Expr1 ); - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Create Vex Unary Expr | -| | -\------------------------------------------------------------*/ - -vexexpr *createvexunaryexpr( Oper, Width, Expr ) - - long Oper; - short Width; - vexexpr *Expr; -{ - vexexpr *Expr1; - - if ( ! isvexunaryoper( Oper ) ) - { - vexerror( VEX_NOT_UNARY_ERROR, Oper ); - } - - Expr1 = createvexoper( Oper, Width ); - addvexhexpr( Expr1, Expr ); - - return( Expr1 ); -} - -/*------------------------------------------------------------\ -| | -| Create Vex Ternary Expr | -| | -\------------------------------------------------------------*/ - -vexexpr *createvexternaryexpr( Oper, Width, Expr1, Expr2, Expr3 ) - - long Oper; - short Width; - vexexpr *Expr1; - vexexpr *Expr2; - vexexpr *Expr3; -{ - vexexpr *Expr; - - if ( ! isvexternaryoper( Oper ) ) - { - vexerror( VEX_OPERATOR_ERROR, Oper ); - } - - Expr = createvexoper( Oper, Width ); - - addvexhexpr( Expr, Expr3 ); - addvexhexpr( Expr, Expr2 ); - addvexhexpr( Expr, Expr1 ); - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Create Vex Func | -| | -\------------------------------------------------------------*/ - -vexexpr *createvexfunc( Func, Width ) - - char *Func; - short Width; -{ - vexexpr *Node; - - Node = allocvexnode(); - - if ( Width <= 0 ) - { - Width = 1; - SetVexNodeVarWidth( Node ); - } - - Node->WIDTH = Width; - Node->LEFT = Width - 1; - - SetVexNodeFunc( Node ); - SetVexFuncValue( Node, Func ); - - return( Node ); -} - -/*------------------------------------------------------------\ -| | -| Create Vex Atom Long Array | -| | -\------------------------------------------------------------*/ - -vexexpr *createvexatomlongarray( Array, Size, Width, Signed ) - - long *Array; - short Size; - short Width; - short Signed; -{ - vexexpr *Node; - char Buffer[ 512 ]; - long Integer; - short Index; - short MaxWidth; - int Scan; - unsigned long Mask; - - if ( Size == 0 ) return( (vexexpr *)0 ); - - Node = allocvexnode(); - - MaxWidth = Size * 32; - - if ( Width == 0 ) - { - Width = MaxWidth; - Index = 0; - Mask = 1L << 31; - - Integer = Array[ 0 ]; - - if ( Integer & Mask ) - { - if ( Signed ) - { - while ( ( Integer & Mask ) != 0 ) - { - Width--; Mask = Mask >> 1; - - if ( Mask == 0 ) - { - Index++; - - if ( Index == Size ) break; - - Integer = Array[ Index ]; - Mask = 1L << 31; - } - } - - Width++; - - Signed = 1; - } - } - else - { - while ( ( Integer & Mask ) == 0 ) - { - Width--; Mask = Mask >> 1; - - if ( Mask == 0 ) - { - Index++; - - if ( Index == Size ) break; - - Integer = Array[ Index ]; - Mask = 1L << 31; - } - } - - if ( ( Signed == 1 ) || - ( Width == 0 ) ) Width++; - } - } - - if ( Width > MaxWidth ) return( (vexexpr *)0 ); - - Node->WIDTH = Width; - Node->LEFT = Width - 1; - Node->RIGHT = 0; - - Scan = 1; - Index = Size - ((Width + 31) / 32); - Mask = 1L << ((Width - 1) % 32); - - do - { - if ( Array[ Index ] & Mask ) Buffer[ Scan ] = '1'; - else Buffer[ Scan ] = '0'; - - Scan = Scan + 1; - Mask = Mask >> 1; - - if ( Mask == 0 ) - { - Mask = 1L << 31; Index++; - } - } - while ( Index < Size ); - - if ( Width == 1 ) - { - Buffer[ 0 ] = '\''; - Buffer[ Scan++ ] = '\''; - - SetVexAtomBit( Node ); - } - else - { - Buffer[ 0 ] = '"'; - Buffer[ Scan++ ] = '"'; - - SetVexAtomVector( Node ); - } - - Buffer[ Scan ] = '\0'; - - if ( Signed == 1 ) SetVexNodeSigned( Node ); - - SetVexNodeAtom( Node ); - SetVexAtomValue( Node, namealloc( Buffer ) ); - SetVexAtomLiteral( Node ); - - return( Node ); -} - -/*------------------------------------------------------------\ -| | -| Create Vex Atom Long | -| | -\------------------------------------------------------------*/ - -vexexpr *createvexatomlong( Integer, Width, Signed ) - - long Integer; - short Width; - short Signed; -{ - return( createvexatomlongarray( &Integer, 1, Width, Signed ) ); -} - diff --git a/alliance/src/vex/src/vexcreate.h b/alliance/src/vex/src/vexcreate.h deleted file mode 100644 index 06b4c64f..00000000 --- a/alliance/src/vex/src/vexcreate.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexcreate.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_CREATE_H -# define VEX_CREATE_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexdel.c b/alliance/src/vex/src/vexdel.c deleted file mode 100644 index 200b212e..00000000 --- a/alliance/src/vex/src/vexdel.c +++ /dev/null @@ -1,144 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexdel.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include "vexdel.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Del Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Del Vex Expr | -| | -\------------------------------------------------------------*/ - -void delvexexpr( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - - if ( ! IsVexNodeAtom( Expr ) ) - { - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - freevexexpr( GetVexOperand( ScanOper ) ); - } - - freechain( Expr->OPERAND ); - } - - freevexnode( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Del Vex Expr Number | -| | -\------------------------------------------------------------*/ - -void delvexexprnum( Expr, Number ) - - vexexpr *Expr; - int Number; -{ - chain_list **PrevOper; - chain_list *ScanOper; - int Counter; - - if ( ! IsVexNodeAtom( Expr ) ) - { - PrevOper = &Expr->OPERAND; - Counter = 0; - - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - if ( Counter == Number ) - { - *PrevOper = ScanOper->NEXT; - ScanOper->NEXT = (chain_list *)0; - - delvexexpr( GetVexOperand( ScanOper ) ); - freechain( ScanOper ); - - return; - } - - Counter = Counter + 1; - PrevOper = &ScanOper->NEXT; - ScanOper = ScanOper->NEXT; - } - } -} diff --git a/alliance/src/vex/src/vexdel.h b/alliance/src/vex/src/vexdel.h deleted file mode 100644 index b1cf533f..00000000 --- a/alliance/src/vex/src/vexdel.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexdel.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_DEL_H -# define VEX_DEL_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexdup.c b/alliance/src/vex/src/vexdup.c deleted file mode 100644 index 5b297c87..00000000 --- a/alliance/src/vex/src/vexdup.c +++ /dev/null @@ -1,115 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexdup.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include "vexdup.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Dup Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Duplicate Vex Expr | -| | -\------------------------------------------------------------*/ - -vexexpr *dupvexexpr( Expr ) - - vexexpr *Expr; -{ - vexexpr *ExprDup; - chain_list *ScanOper; - chain_list *DupOper; - chain_list **PrevOper; - - if ( Expr == (vexexpr *) 0) - { - return( (vexexpr *)0 ); - } - - ExprDup = dupvexnode( Expr ); - - if ( ! IsVexNodeAtom( Expr ) ) - { - PrevOper = &ExprDup->OPERAND; - - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - DupOper = addchain( (chain_list *)0, - (void *)dupvexexpr( GetVexOperand( ScanOper ) ) ); - *PrevOper = DupOper; - PrevOper = &DupOper->NEXT; - } - } - - return( ExprDup ); -} diff --git a/alliance/src/vex/src/vexdup.h b/alliance/src/vex/src/vexdup.h deleted file mode 100644 index 5f74024c..00000000 --- a/alliance/src/vex/src/vexdup.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexdup.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_DUP_H -# define VEX_DUP_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexenv.c b/alliance/src/vex/src/vexenv.c deleted file mode 100644 index 5e420b40..00000000 --- a/alliance/src/vex/src/vexenv.c +++ /dev/null @@ -1,270 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexenv.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include "vexenv.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - char *VEX_OPER_UPPER_NAME[ VEX_MAX_OPERATOR ] = - { - "&" , - "NOT" , - "NEG" , - "EVENT" , - "OR" , - "AND" , - "XOR" , - "NOR" , - "NAND" , - "XNOR" , - "=" , - "/=" , - "<" , - "<=" , - ">" , - ">=" , - "+" , - "-" , - "*" , - "/" , - "**" , - "MOD" , - "REM" , - "TO" , - "DOWNTO", - "INDEX" , - "LEFT" , - "RIGHT", - "LOW", - "HIGH", - "LENGTH", - "RANGE", - "REV_RANGE", - "DRIVER", - "IFT", - "ARRAY", - "INDEX_N", - "OTHERS =>", - "NUM_BIT", - "ABS" - }; - -/* A few declaration that should be in vexenv I believe, but I leave - * this kind of update to Mr Jacomme, master of these sources */ -/* A sharp '#' is used where an operator exists but has to be - * treated specifically. - * Quite a few VHDL operators have no equivalent in verilog for my - * current knowledge: NULL indicates that! */ - - char *VEX_OPER_VERILOG_NAME[ VEX_MAX_OPERATOR ] = - { - "," , /* VEX_CONCAT */ - "~" , /* VEX_NOT */ - "-" , /* VEX_NEG */ - NULL, /* VEX_EVENT */ - "|" , /* VEX_OR */ - "&" , /* VEX_AND */ - "^" , /* VEX_XOR */ - "#" , /* VEX_NOR */ - "#" , /* VEX_NAND */ - "#" , /* VEX_NXOR */ - "==", /* VEX_EQ */ - "!=", /* VEX_NE */ - "<" , /* VEX_LT */ - "<=", /* VEX_LE */ - ">" , /* VEX_GT */ - ">=", /* VEX_GE */ - "+" , /* VEX_ADD */ - "-" , /* VEX_SUB */ - "*" , /* VEX_MUL */ - "/" , /* VEX_DIV */ - "**", /* VEX_EXP */ - "%" , /* VEX_MOD */ - "%" , /* VEX_REM */ - NULL, /* VEX_TO */ - NULL, /* VEX_DOWNTO */ - NULL, /* VEX_INDEX */ - NULL, /* VEX_LEFT */ - NULL, /* VEX_RIGHT */ - NULL, /* VEX_LOW */ - NULL, /* VEX_HIGH */ - NULL, /* VEX_LENGTH */ - NULL, /* VEX_RANGE */ - NULL, /* VEX_REV_RANGE */ - NULL, /* VEX_DRIVER */ - "IFT", /* VEX_IFT */ - NULL , /* VEX_ARRAY */ - NULL , /* VEX_INDEX_N */ - NULL , /* VEX_OTHERS */ - NULL , /* VEX_NUM_BIT */ - NULL /* VEX_ABS */ - }; - - char VEX_LITERAL_BY_ID[ VEX_MAX_ID ] = - { - 'u', 'x', '0', '1', 'z', 'w', 'l', 'h', '-' - }; - - char *VEX_TYPE_NAME[ VEX_MAX_TYPE ] = - { - "SEVERITY", - "BOOLEAN", - "CHARACTER", - "STRING", - "BIT", - "INTEGER", - "NATURAL", - "BIT_VECTOR", - "STD_ULOGIC", - "STD_LOGIC", - "STD_ULOGIC_VECTOR", - "STD_LOGIC_VECTOR", - "X01", - "X01Z", - "UX01", - "UX01Z", - "UNSIGNED", - "SIGNED", - "SMALL_INT", - "REG_BIT", - "REG_VECTOR", - "MUX_BIT", - "MUX_VECTOR", - "WOR_BIT", - "WOR_VECTOR", - "ENUMERATE", - "ARRAY" - }; - - char *VEX_STD_FUNC_UPPER_NAME[ VEX_MAX_STD_FUNC ] = - { - "TO_BIT", - "TO_BITVECTOR", - "TO_STDULOGIC", - "TO_STDLOGICVECTOR", - "TO_STDULOGICVECTOR", - "TO_X01", - "TO_X01Z", - "TO_UX01", - "RISING_EDGE", - "FALLING_EDGE", - "IS_X", - "ABS", - "SHL", - "SHR", - "CONV_INTEGER", - "CONV_UNSIGNED", - "CONV_SIGNED", - "CONV_STD_LOGIC_VECTOR", - "EXT", - "SXT", - "SHIFT_LEFT", - "SHIFT_RIGHT", - "ROTATE_LEFT", - "ROTATE_RIGHT", - "RESIZE", - "TO_INTEGER", - "TO_UNSIGNED", - "TO_SIGNED", - "STD_LOGIC_VECTOR", - "STD_ULOGIC_VECTOR", - "SIGNED", - "UNSIGNED" - }; - - char *VEX_ATOM_BY_ID[ VEX_MAX_ID ]; - char *VEX_OPER_NAME[ VEX_MAX_OPERATOR ]; - char *VEX_STD_FUNC_NAME[ VEX_MAX_STD_FUNC ]; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Vex Env | -| | -\------------------------------------------------------------*/ - -void vexenv() -{ - char Buffer[ 16 ]; - int Index; - - for ( Index = 0; Index < VEX_MAX_ID; Index++ ) - { - sprintf( Buffer, "'%c'", VEX_LITERAL_BY_ID[ Index ] ); - VEX_ATOM_BY_ID[ Index ] = namealloc( Buffer ); - } - - for ( Index = 0; Index < VEX_MAX_OPERATOR; Index++ ) - { - VEX_OPER_NAME[ Index ] = namealloc( VEX_OPER_UPPER_NAME[ Index ] ); - } - - for ( Index = 0; Index < VEX_MAX_STD_FUNC; Index++ ) - { - VEX_STD_FUNC_NAME[ Index ] = namealloc( VEX_STD_FUNC_UPPER_NAME[ Index ] ); - } -} diff --git a/alliance/src/vex/src/vexenv.h b/alliance/src/vex/src/vexenv.h deleted file mode 100644 index f3ca1b12..00000000 --- a/alliance/src/vex/src/vexenv.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexenv.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_ENV_H -# define VEX_ENV_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexerror.c b/alliance/src/vex/src/vexerror.c deleted file mode 100644 index 5ecd072a..00000000 --- a/alliance/src/vex/src/vexerror.c +++ /dev/null @@ -1,113 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : Vex Errors | -| | -| Authors : Jacomme Ludovic | -| | -| Date : 03.12.96 | -| | -\------------------------------------------------------------*/ - -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include -# include -# include "mut.h" -# include "aut.h" -# include "vex.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -void vex_error( Error, Text, File, Line ) - - int Error; - char *Text; - char *File; - long Line; -{ - char *Name; - - Name = mbkstrdup( File ); - Name[ strlen( File ) - 1 ] = '\0'; - - fprintf( stderr, "%s%ld ", Name, Line ); - - switch( Error ) - { - case VEX_OPERATOR_ERROR : - - fprintf( stderr, "bad operator %ld !\n", (long)Text ); - - break; - - case VEX_NOT_UNARY_ERROR : - - fprintf( stderr, "not unary operator %ld !\n", (long)Text ); - - break; - - case VEX_NOT_LITERAL_ERROR : - - fprintf( stderr, "not literal atom !\n" ); - - break; - - default : - - fprintf( stderr, "unknown internal error %d !\n", Error ); - } - - autexit( 1 ); -} diff --git a/alliance/src/vex/src/vexerror.h b/alliance/src/vex/src/vexerror.h deleted file mode 100644 index 53a99816..00000000 --- a/alliance/src/vex/src/vexerror.h +++ /dev/null @@ -1,85 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : Vex Errors | -| | -| Authors : Jacomme Ludovic | -| | -| Date : 03.12.96 | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_ERROR_H -# define VEX_ERROR_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# define VEX_OPERATOR_ERROR 0 -# define VEX_NOT_UNARY_ERROR 1 -# define VEX_NOT_LITERAL_ERROR 2 - -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Macros | -| | -\------------------------------------------------------------*/ - -# define vexerror( E, V ) (vex_error( (int)(E), (char*)(long)(V), __FILE__, __LINE__ )) - -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - - extern void vex_error __P((int Error, char *Text, char *File, long Line)); - -# endif diff --git a/alliance/src/vex/src/vexeval.c b/alliance/src/vex/src/vexeval.c deleted file mode 100644 index abb81e82..00000000 --- a/alliance/src/vex/src/vexeval.c +++ /dev/null @@ -1,303 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexeval.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include -# include "vexeval.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - char VexNotLiteral[ VEX_MAX_ID ] = - { -/* ------------------------------------------ */ -/* U X 0 1 Z W L H - */ -/* ------------------------------------------ */ - 'u', 'x', '1', '0', 'x', 'x', '1', '0', 'x' - }; - - char VexAndLiteral[ VEX_MAX_ID ][ VEX_MAX_ID ] = - { -/* ------------------------------------------ */ -/* U X 0 1 Z W L H - */ -/* ------------------------------------------ */ - { 'u', 'u', '0', 'u', 'u', 'u', '0', 'u', 'u' }, /* | u | */ - { 'u', 'x', '0', 'x', 'x', 'x', '0', 'x', 'x' }, /* | x | */ - { '0', '0', '0', '0', '0', '0', '0', '0', '0' }, /* | 0 | */ - { 'u', 'x', '0', '1', 'x', 'x', '0', '1', 'x' }, /* | 1 | */ - { 'u', 'x', '0', 'x', 'x', 'x', '0', 'x', 'x' }, /* | z | */ - { 'u', 'x', '0', 'x', 'x', 'x', '0', 'x', 'x' }, /* | w | */ - { '0', '0', '0', '0', '0', '0', '0', '0', '0' }, /* | l | */ - { 'u', 'x', '0', '1', 'x', 'x', '0', '1', 'x' }, /* | h | */ - { 'u', 'x', '0', 'x', 'x', 'x', '0', 'x', 'x' } /* | - | */ - }; - - char VexOrLiteral[ VEX_MAX_ID ][ VEX_MAX_ID ] = - { -/* ------------------------------------------ */ -/* U X 0 1 Z W L H - */ -/* ------------------------------------------ */ - { 'u', 'u', 'u', '1', 'u', 'u', 'u', '1', 'u' }, /* | u | */ - { 'u', 'x', 'x', '1', 'x', 'x', 'x', '1', 'x' }, /* | x | */ - { 'u', 'x', '0', '1', 'x', 'x', '0', '1', 'x' }, /* | 0 | */ - { '1', '1', '1', '1', '1', '1', '1', '1', '1' }, /* | 1 | */ - { 'u', 'x', 'x', '1', 'x', 'x', 'x', '1', 'x' }, /* | z | */ - { 'u', 'x', 'x', '1', 'x', 'x', 'x', '1', 'x' }, /* | w | */ - { 'u', 'x', '0', '1', 'x', 'x', '0', '1', 'x' }, /* | l | */ - { '1', '1', '1', '1', '1', '1', '1', '1', '1' }, /* | h | */ - { 'u', 'x', 'x', '1', 'x', 'x', 'x', '1', 'x' } /* | - | */ - }; - - char VexXorLiteral[ VEX_MAX_ID ][ VEX_MAX_ID ] = - { -/* ------------------------------------------ */ -/* U X 0 1 Z W L H - */ -/* ------------------------------------------ */ - { 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u' }, /* | u | */ - { 'u', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' }, /* | x | */ - { 'u', 'x', '0', '1', 'x', 'x', '0', '1', 'x' }, /* | 0 | */ - { 'u', 'x', '1', '0', 'x', 'x', '1', '0', 'x' }, /* | 1 | */ - { 'u', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' }, /* | z | */ - { 'u', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' }, /* | w | */ - { 'u', 'x', '0', '1', 'x', 'x', '0', '1', 'x' }, /* | l | */ - { 'u', 'x', '1', '0', 'x', 'x', '1', '0', 'x' }, /* | h | */ - { 'u', 'x', 'x', 'x', 'x', 'x', 'x', 'x', 'x' } /* | - | */ - }; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Eval Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Eval Vex Atom Long | -| | -\------------------------------------------------------------*/ - -int evalvexatomlong( Expr, PLong ) - - vexexpr *Expr; - long *PLong; -{ - char *Literal; - long Value; - int Index; - int IndexStep; - int IndexMax; - int Error; - - if ( ( ! IsVexNodeAtom( Expr ) ) || - ( ! IsVexAtomLiteral( Expr ) ) ) - { - return( -1 ); - } - - Literal = GetVexAtomValue( Expr ); - Error = 0; - - Index = 1; - IndexStep = 1; - IndexMax = Expr->WIDTH + 1; - - if ( ( IsVexNodeSigned( Expr ) ) && - ( Literal[ Index ] == '1' ) ) Value = -1; - else Value = 0; - - do - { - Value = Value << 1; - - if ( Literal[ Index ] == '1' ) - { - Value |= 1; - } - else - if ( Literal[ Index ] != '0' ) - { - Error = -1; - } - - Index += IndexStep; - } - while ( Index != IndexMax ); - - *PLong = Value; - - return( Error ); -} - -/*------------------------------------------------------------\ -| | -| Eval Vex Not Literal | -| | -\------------------------------------------------------------*/ - -int evalvexnotliteral( Literal, PChar ) - - char Literal; - char *PChar; -{ - int Index; - - Index = getvexliteralid( Literal ); - - if ( Index == -1 ) - { - return( -1 ); - } - - *PChar = VexNotLiteral[ Index ]; - - return( 0 ); -} - -/*------------------------------------------------------------\ -| | -| Eval Vex And Literal | -| | -\------------------------------------------------------------*/ - -int evalvexandliteral( Literal1, Literal2, PChar ) - - char Literal1; - char Literal2; - char *PChar; -{ - int Index1; - int Index2; - - Index1 = getvexliteralid( Literal1 ); - Index2 = getvexliteralid( Literal2 ); - - if ( ( Index1 == -1 ) || - ( Index2 == -1 ) ) - { - return( -1 ); - } - - *PChar = VexAndLiteral[ Index1 ][ Index2 ]; - - return( 0 ); -} - -/*------------------------------------------------------------\ -| | -| Eval Vex Or Literal | -| | -\------------------------------------------------------------*/ - -int evalvexorliteral( Literal1, Literal2, PChar ) - - char Literal1; - char Literal2; - char *PChar; -{ - int Index1; - int Index2; - - Index1 = getvexliteralid( Literal1 ); - Index2 = getvexliteralid( Literal2 ); - - if ( ( Index1 == -1 ) || - ( Index2 == -1 ) ) - { - return( -1 ); - } - - *PChar = VexOrLiteral[ Index1 ][ Index2 ]; - - return( 0 ); -} - -/*------------------------------------------------------------\ -| | -| Eval Vex Xor Literal | -| | -\------------------------------------------------------------*/ - -int evalvexxorliteral( Literal1, Literal2, PChar ) - - char Literal1; - char Literal2; - char *PChar; -{ - int Index1; - int Index2; - - Index1 = getvexliteralid( Literal1 ); - Index2 = getvexliteralid( Literal2 ); - - if ( ( Index1 == -1 ) || - ( Index2 == -1 ) ) - { - return( -1 ); - } - - *PChar = VexXorLiteral[ Index1 ][ Index2 ]; - - return( 0 ); -} diff --git a/alliance/src/vex/src/vexeval.h b/alliance/src/vex/src/vexeval.h deleted file mode 100644 index 09c9bba8..00000000 --- a/alliance/src/vex/src/vexeval.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexeval.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_EVAL_H -# define VEX_EVAL_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexextend.c b/alliance/src/vex/src/vexextend.c deleted file mode 100644 index 84cf581b..00000000 --- a/alliance/src/vex/src/vexextend.c +++ /dev/null @@ -1,261 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexextend.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include -# include "vexextend.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Extend Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Extend Vex Atom Sign | -| | -\------------------------------------------------------------*/ - -vexexpr *extendvexatomsign( Expr, Width ) - - vexexpr *Expr; - short Width; -{ - char *Value; - vexexpr *Atom; - vexexpr *Result; - char Buffer[ 128 ]; - int Index; - int Target; - int Extend; - char Sign; - char Limit; - - if ( IsVexNodeAtom( Expr ) ) - { - Value = GetVexAtomValue( Expr ); - - if ( IsVexAtomLiteral( Expr ) ) - { - if ( Expr->WIDTH < Width ) - { -/* -** "1xxxx" -> "1111xxxx" -*/ - Extend = Width - Expr->WIDTH; - - if ( IsVexNodeSigned( Expr ) ) Sign = Value[ 1 ]; - else Sign = '0'; - - Target = 0; - Buffer[ Target++ ] = '"'; - - for ( Index = 1; Index <= Extend; Index++ ) - { - Buffer[ Target++ ] = Sign; - } - - for ( Index = 1; Index <= Expr->WIDTH; Index++ ) - { - Buffer[ Target++ ] = Value[ Index ]; - } - - Buffer[ Target++ ] = '"'; - Buffer[ Target++ ] = '\0'; - - SetVexAtomValue( Expr, namealloc( Buffer ) ); - - Expr->WIDTH = Width; - Expr->LEFT = Width - 1; - Expr->RIGHT = 0; - } - else - if ( Expr->WIDTH > Width ) - { -/* -** "1111xxxx" -> "1xxxx" -*/ - Extend = (Expr->WIDTH + 1) - Width; - - if ( IsVexNodeSigned( Expr ) ) Sign = Value[ 1 ]; - else Sign = '0'; - - Target = 0; - - if ( Width > 1 ) Limit = '"'; - else Limit = '\''; - - Buffer[ Target++ ] = Limit; - - for ( Index = 1; Index <= Extend; Index++ ) - { - if ( Value[ Index ] != Sign ) return( (vexexpr *)0 ); - } - - for ( Index = Extend; Index <= Expr->WIDTH; Index++ ) - { - Buffer[ Target++ ] = Value[ Index ]; - } - - Buffer[ Target++ ] = Limit; - Buffer[ Target++ ] = '\0'; - - SetVexAtomValue( Expr, namealloc( Buffer ) ); - - Expr->WIDTH = Width; - Expr->LEFT = Width - 1; - Expr->RIGHT = 0; - } - - return( Expr ); - } - else - { - if ( Expr->WIDTH < Width ) - { -/* -** "1xxxx" -> "1111xxxx" -*/ - Extend = Width - Expr->WIDTH; - - if ( IsVexNodeSigned( Expr ) ) - { - Value = GetVexAtomValue( Expr ); - Result = createvexoper( VEX_CONCAT, Width ); - - addvexhexpr( Result, Expr ); - - for ( Index = 1; Index <= Extend; Index++ ) - { - if ( IsVexAtomVector( Expr ) ) - { - Atom = createvexatomvec( Value, Expr->LEFT, Expr->LEFT ); - } - else - { - Atom = createvexatombit( Value ); - } - - addvexhexpr( Result, Atom ); - } - - Expr = Result; - - Expr->WIDTH = Width; - Expr->LEFT = Width - 1; - Expr->RIGHT = 0; - - SetVexNodeSigned( Expr ); - } - else - { - Target = 0; - - if ( Extend > 1 ) Limit = '"'; - else Limit = '\''; - - Buffer[ Target++ ] = Limit; - - for ( Index = 1; Index <= Extend; Index++ ) - { - Buffer[ Target++ ] = '0'; - } - - Buffer[ Target++ ] = Limit; - Buffer[ Target++ ] = '\0'; - - Atom = createvexatomlit( Buffer ); - Expr = createvexbinexpr( VEX_CONCAT, 0, Atom, Expr ); - - Expr->LEFT = Width - 1; - Expr->RIGHT = 0; - Expr->WIDTH = Width; - } - - return( Expr ); - } - else - { - Expr->WIDTH = Width; - - if ( IsVexAtomDown( Expr ) ) - { - Expr->LEFT = Expr->RIGHT + Width - 1; - } - else - { - Expr->LEFT = Expr->RIGHT - Width + 1; - } - - return( Expr ); - } - } - } - - return( (vexexpr *)0 ); -} diff --git a/alliance/src/vex/src/vexextend.h b/alliance/src/vex/src/vexextend.h deleted file mode 100644 index 3e7b7733..00000000 --- a/alliance/src/vex/src/vexextend.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexextend.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_EXTEND_H -# define VEX_EXTEND_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexfree.c b/alliance/src/vex/src/vexfree.c deleted file mode 100644 index b4d551f3..00000000 --- a/alliance/src/vex/src/vexfree.c +++ /dev/null @@ -1,119 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexfree.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include -# include "vexfree.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Vex Free Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Vex Free Node | -| | -\------------------------------------------------------------*/ - -void freevexnode( Node ) - - vexexpr *Node; -{ - autfreeheap( Node, sizeof( vexexpr ) ); -} - -/*------------------------------------------------------------\ -| | -| Vex Free Expr | -| | -\------------------------------------------------------------*/ - -void freevexexpr( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - - if ( Expr != (vexexpr *)0 ) - { - if ( ! IsVexNodeAtom( Expr ) ) - { - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - freevexexpr( GetVexOperand( ScanOper ) ); - } - - freechain( Expr->OPERAND ); - } - - freevexnode( Expr ); - } -} diff --git a/alliance/src/vex/src/vexfree.h b/alliance/src/vex/src/vexfree.h deleted file mode 100644 index dcca5603..00000000 --- a/alliance/src/vex/src/vexfree.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexfree.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_FREE_H -# define VEX_FREE_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexget.c b/alliance/src/vex/src/vexget.c deleted file mode 100644 index 76b46545..00000000 --- a/alliance/src/vex/src/vexget.c +++ /dev/null @@ -1,1151 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexget.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include -# include -# include "vexget.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - long VEX_NOT_OPER[ VEX_MAX_OPERATOR ] = - { - -1, /* VEX_CONCAT */ - -1, /* VEX_NOT */ - -1, /* VEX_NEG */ - -1, /* VEX_EVENT */ - VEX_NOR, /* VEX_OR */ - VEX_NAND, /* VEX_AND */ - VEX_NXOR, /* VEX_XOR */ - VEX_OR, /* VEX_NOR */ - VEX_AND, /* VEX_NAND */ - VEX_XOR, /* VEX_NXOR */ - VEX_NE, /* VEX_EQ */ - VEX_EQ, /* VEX_NE */ - VEX_GE, /* VEX_LT */ - VEX_GT, /* VEX_LE */ - VEX_LE, /* VEX_GT */ - VEX_LT, /* VEX_GE */ - -1, /* VEX_ADD */ - -1, /* VEX_SUB */ - -1, /* VEX_MUL */ - -1, /* VEX_DIV */ - -1, /* VEX_EXP */ - -1, /* VEX_MOD */ - -1, /* VEX_REM */ - -1, /* VEX_TO */ - -1, /* VEX_DOWNTO */ - -1, /* VEX_INDEX */ - -1, /* VEX_LEFT */ - -1, /* VEX_RIGHT */ - -1, /* VEX_LOW */ - -1, /* VEX_HIGH */ - -1, /* VEX_LENGTH */ - -1, /* VEX_RANGE */ - -1, /* VEX_REV_RANGE */ - -1, /* VEX_DRIVER */ - -1, /* VEX_IFT */ - -1, /* VEX_ARRAY */ - -1, /* VEX_INDEX_N */ - -1, /* VEX_OTHERS */ - -1, /* VEX_NUM_BIT */ - -1 /* VEX_ABS */ - }; - - short VexTypeScalar[ VEX_MAX_TYPE ] = - { - VEX_TYPE_SEVERITY , /* SEVERITY */ - VEX_TYPE_BOOLEAN , /* BOOLEAN */ - VEX_TYPE_CHARACTER , /* CHARACTER */ - VEX_TYPE_CHARACTER , /* STRING */ - VEX_TYPE_BIT , /* BIT */ - VEX_TYPE_INTEGER , /* INTEGER */ - VEX_TYPE_NATURAL , /* NATURAL */ - VEX_TYPE_BIT , /* BIT_VECTOR */ - VEX_TYPE_STD_ULOGIC , /* STD_ULOGIC */ - VEX_TYPE_STD_LOGIC , /* STD_LOGIC */ - VEX_TYPE_STD_ULOGIC , /* STD_ULOGIC_VECTOR */ - VEX_TYPE_STD_LOGIC , /* STD_LOGIC_VECTOR */ - VEX_TYPE_X01 , /* X01 */ - VEX_TYPE_X01Z , /* X01Z */ - VEX_TYPE_UX01 , /* UX01 */ - VEX_TYPE_UX01Z , /* UX01Z */ - VEX_TYPE_UNSIGNED , /* UNSIGNED */ - VEX_TYPE_SIGNED , /* SIGNED */ - VEX_TYPE_SMALL_INT , /* SMALL_INT */ - VEX_TYPE_REG_BIT , /* REG_BIT */ - VEX_TYPE_REG_BIT , /* REG_VECTOR */ - VEX_TYPE_MUX_BIT , /* MUX_BIT */ - VEX_TYPE_MUX_BIT , /* MUX_VECTOR */ - VEX_TYPE_WOR_BIT , /* WOR_BIT */ - VEX_TYPE_WOR_BIT , /* WOR_VECTOR */ - VEX_TYPE_ENUMERATE , /* ENUMERATE */ - VEX_TYPE_ARRAY /* ARRAY */ - }; - - static chain_list *VexGetHeadChain = (chain_list *)0; - static ptype_list *VexGetHeadPtype = (ptype_list *)0; - static char VexBuffer[ 128 ]; - - static authtable *VexHashStdFunc = (authtable *)0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Get Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Get Vex Int Number Bit | -| | -\------------------------------------------------------------*/ - -int getvexintnumbit( Size ) - - long Size; -{ - long Mask; - int NumberBit; - - if ( Size < 0 ) return( 0 ); - if ( Size == 0 ) return( 1 ); - - Mask = 1L << 31; - - for ( NumberBit = 32; NumberBit > 0; NumberBit-- ) - { - if ( Mask & Size ) break; - - Mask = Mask >> 1; - } - - return( NumberBit ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Interval Number Bits | -| | -\------------------------------------------------------------*/ - -int getvexintervalnumbit( Left, Right ) - - long Left; - long Right; -{ - long NumberBit; - long Swap; - long Max; - - if ( Left > Right ) - { - Swap = Left; - Left = Right; - Right = Swap; - } - - if ( Left >= 0 ) - { - NumberBit = 0; - Max = Right; - } - else - { - NumberBit = 1; - Max = - Left; - - if ( Max < Right ) Max = Right; - } - - NumberBit += getvexintnumbit( Max ); - - return( NumberBit ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Type Scalar | -| | -\------------------------------------------------------------*/ - -int getvextypescalar( Type ) - - int Type; -{ - if ( ( Type < 0 ) || - ( Type >= VEX_MAX_TYPE ) ) - { - return( -1 ); - } - - return( VexTypeScalar[ Type ] ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Vector Name | -| | -\------------------------------------------------------------*/ - -char *getvexvectorname( Vector, Index ) - - char *Vector; - long *Index; -{ - char *LeftParen; - char *RightParen; - - if ( Vector == (char *)0 ) - { - return( (char *)0 ); - } - - strcpy( VexBuffer, Vector ); - LeftParen = strchr( VexBuffer, '(' ); - - if ( LeftParen == (char *)0 ) - { - return( (char *)0 ); - } - - *LeftParen = '\0'; - RightParen = strchr( LeftParen + 1, ')' ); - - if ( RightParen == (char *)0 ) - { - return( (char *)0 ); - } - - *RightParen = '\0'; - - if ( *(LeftParen + 1) == '?' ) - { - *Index = -1; - } - else - { - *Index = atoi( LeftParen + 1 ); - } - - Vector = namealloc( VexBuffer ); - - return( Vector ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Atom Bit Name | -| | -\------------------------------------------------------------*/ - -chain_list *getvexatombitname( Expr ) - - vexexpr *Expr; -{ - chain_list *HeadList; - chain_list *NewChain; - chain_list **PrevChain; - char *ScanChar; - char *Name; - long Index; - long Step; - long Width; - - if ( ! IsVexNodeAtom( Expr ) ) - { - return( (chain_list *)0 ); - } - - Name = GetVexAtomValue( Expr ); - - if ( IsVexNodeBit( Expr ) ) - { - HeadList = addchain( (chain_list *)0, Name ); - } - else - { - if ( Expr->LEFT > Expr->RIGHT ) Step = -1; - else Step = 1; - - Index = Expr->LEFT; - - if ( IsVexAtomLiteral( Expr ) ) - { - VexBuffer[ 0 ] = '\''; - VexBuffer[ 2 ] = '\''; - VexBuffer[ 3 ] = '\0'; - - ScanChar = &VexBuffer[ 1 ]; - } - else - { - strcpy( VexBuffer, Name ); - ScanChar = VexBuffer + strlen( VexBuffer ); - } - - PrevChain = &HeadList; - - for ( Width = Expr->WIDTH; Width > 0; Width-- ) - { - if ( IsVexAtomLiteral( Expr ) ) - { - if ( Step > 0 ) *ScanChar = Name[ Width ]; - else *ScanChar = Name[ Expr->WIDTH - Width ]; - } - else - if ( IsVexNodeVarWidth( Expr ) ) - { - strcpy( ScanChar, "(??)" ); - } - else - { - sprintf( ScanChar, "(%ld)", Index ); - } - - NewChain = addchain( (chain_list *)0, namealloc( VexBuffer ) ); - *PrevChain = NewChain; - PrevChain = &NewChain->NEXT; - - Index += Step; - } - } - - return( HeadList ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Atom Bit Name Ptype | -| | -\------------------------------------------------------------*/ - -ptype_list *getvexatombitnameptype( Expr ) - - vexexpr *Expr; -{ - ptype_list *HeadList; - ptype_list *NewChain; - ptype_list **PrevChain; - char *Name; - long Index; - long Step; - long Width; - - if ( ( ! IsVexNodeAtom( Expr ) ) || - ( IsVexAtomLiteral( Expr ) ) ) - { - return( (ptype_list *)0 ); - } - - Name = GetVexAtomValue( Expr ); - - if ( IsVexNodeBit( Expr ) ) - { - HeadList = addptype( (ptype_list *)0, -1, Name ); - } - else - { - if ( Expr->LEFT > Expr->RIGHT ) Step = -1; - else Step = 1; - - Index = Expr->LEFT; - - PrevChain = &HeadList; - - for ( Width = Expr->WIDTH; Width > 0; Width-- ) - { - NewChain = addptype( (ptype_list *)0, Index, Name ); - *PrevChain = NewChain; - PrevChain = &NewChain->NEXT; - - Index += Step; - } - } - - return( HeadList ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Operator Name | -| | -\------------------------------------------------------------*/ - -char *getvexopername( Oper ) - - long Oper; -{ - if ( ( Oper < 0 ) || - ( Oper >= VEX_MAX_OPERATOR ) ) - { - return( (char *)0 ); - } - - return( VEX_OPER_NAME[ Oper ] ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Verilog Operator Name | -| | -\------------------------------------------------------------*/ - -char *getvexoperverilogname( Oper ) - - long Oper; -{ - if ( ( Oper < 0 ) || - ( Oper >= VEX_MAX_OPERATOR ) ) - { - return( (char *)0 ); - } - - return( VEX_OPER_VERILOG_NAME[ Oper ] ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Upper Operator Name | -| | -\------------------------------------------------------------*/ - -char *getvexoperuppername( Oper ) - - long Oper; -{ - if ( ( Oper < 0 ) || - ( Oper >= VEX_MAX_OPERATOR ) ) - { - return( (char *)0 ); - } - - return( VEX_OPER_UPPER_NAME[ Oper ] ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Operator By Name | -| | -\------------------------------------------------------------*/ - -long getvexoperbyname( Name ) - - char *Name; -{ - int Oper; - - Name = namealloc( Name ); - - for ( Oper = 0; Oper < VEX_MAX_OPERATOR; Oper++ ) - { - if ( VEX_OPER_NAME[ Oper ] == Name ) - { - return( Oper ); - } - } - - return( -1 ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Expr Depth | -| | -\------------------------------------------------------------*/ - -long getvexexprdepth( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - long MaxDepth; - long CarDepth; - - if ( IsVexNodeAtom( Expr ) ) - { - return( 0 ); - } - - MaxDepth = 0; - - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - CarDepth = getvexexprdepth( GetVexOperand( ScanOper ) ); - if ( CarDepth > MaxDepth ) MaxDepth = CarDepth; - } - - return( MaxDepth + 1 ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Expr Number Node | -| | -\------------------------------------------------------------*/ - -long getvexexprnumnode( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - long NumNode; - - if ( IsVexNodeAtom( Expr ) ) - { - return( 1 ); - } - - NumNode = 1; - - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - NumNode += getvexexprnumnode( GetVexOperand( ScanOper ) ); - } - - return( NumNode ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Not Operator | -| | -\------------------------------------------------------------*/ - -long getvexnotoper( Oper ) - - long Oper; -{ - if ( ( Oper < 0 ) || - ( Oper >= VEX_MAX_OPERATOR ) ) - { - return( -1 ); - } - - return( VEX_NOT_OPER[ Oper ] ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Atom Support | -| | -\------------------------------------------------------------*/ - -static void loc_getvexsupportatom( Expr ) - - vexexpr *Expr; -{ - chain_list *BitList; - chain_list *ScanChain; - chain_list *ScanName; - chain_list **PrevName; - - if ( ! IsVexAtomLiteral( Expr ) ) - { - BitList = getvexatombitname( Expr ); - - for ( ScanChain = BitList; - ScanChain != (chain_list *)0; - ScanChain = ScanChain->NEXT ) - { - PrevName = &VexGetHeadChain; - - for ( ScanName = VexGetHeadChain; - ScanName != (chain_list *)0; - ScanName = ScanName->NEXT ) - { - if ( ScanName->DATA == ScanChain->DATA ) break; - - PrevName = &ScanName->NEXT; - } - - if ( ScanName == (chain_list *)0 ) - { - *PrevName = addchain( (chain_list *)0, ScanChain->DATA ); - } - } - - freechain( BitList ); - } -} - -/*------------------------------------------------------------\ -| | -| Get Vex Expr Support | -| | -\------------------------------------------------------------*/ - -static void loc_getvexsupport( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - - if ( IsVexNodeAtom( Expr ) ) - { - loc_getvexsupportatom( Expr ); - } - else - { - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - loc_getvexsupport( GetVexOperand( ScanOper ) ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Get Vex Expr Support | -| | -\------------------------------------------------------------*/ - -chain_list *getvexexprsupport( Expr ) - - vexexpr *Expr; -{ - VexGetHeadChain = (chain_list *)0; - - if ( Expr != (vexexpr *)0 ) loc_getvexsupport( Expr ); - - return( VexGetHeadChain ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Atom Support Ptype | -| | -\------------------------------------------------------------*/ - -static void loc_getvexsupportatomptype( Expr ) - - vexexpr *Expr; -{ - ptype_list *BitList; - ptype_list *ScanChain; - ptype_list *ScanName; - ptype_list **PrevName; - - if ( ! IsVexAtomLiteral( Expr ) ) - { - BitList = getvexatombitnameptype( Expr ); - - for ( ScanChain = BitList; - ScanChain != (ptype_list *)0; - ScanChain = ScanChain->NEXT ) - { - PrevName = &VexGetHeadPtype; - - for ( ScanName = VexGetHeadPtype; - ScanName != (ptype_list *)0; - ScanName = ScanName->NEXT ) - { - if ( ( ScanName->DATA == ScanChain->DATA ) && - ( ScanName->TYPE == ScanChain->TYPE ) ) break; - - PrevName = &ScanName->NEXT; - } - - if ( ScanName == (ptype_list *)0 ) - { - *PrevName = addptype( (ptype_list *)0, ScanChain->TYPE, ScanChain->DATA ); - } - } - - freeptype( BitList ); - } -} - -/*------------------------------------------------------------\ -| | -| Get Vex Expr Support Ptype | -| | -\------------------------------------------------------------*/ - -static void loc_getvexsupportptype( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - - if ( IsVexNodeAtom( Expr ) ) - { - loc_getvexsupportatomptype( Expr ); - } - else - { - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - loc_getvexsupportptype( GetVexOperand( ScanOper ) ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Get Vex Expr Support Ptype | -| | -\------------------------------------------------------------*/ - -ptype_list *getvexexprsupportptype( Expr ) - - vexexpr *Expr; -{ - VexGetHeadPtype = (ptype_list *)0; - - if ( Expr != (vexexpr *)0 ) loc_getvexsupportptype( Expr ); - - return( VexGetHeadPtype ); -} - -/*------------------------------------------------------------\ -| | -| Union Vex Expr Support Ptype | -| | -\------------------------------------------------------------*/ - -ptype_list *unionvexexprsupportptype( Support, Expr ) - - ptype_list *Support; - vexexpr *Expr; -{ - VexGetHeadPtype = Support; - - if ( Expr != (vexexpr *)0 ) loc_getvexsupportptype( Expr ); - - return( VexGetHeadPtype ); -} - - -/*------------------------------------------------------------\ -| | -| Get Vex Expr Support | -| | -\------------------------------------------------------------*/ - -chain_list *unionvexexprsupport( Support, Expr ) - - chain_list *Support; - vexexpr *Expr; -{ - VexGetHeadChain = Support; - - if ( Expr != (vexexpr *)0 ) loc_getvexsupport( Expr ); - - return( VexGetHeadChain ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Atom All Name | -| | -\------------------------------------------------------------*/ - -static void loc_getvexallnameatom( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanName; - char *AtomName; - - if ( ! IsVexAtomLiteral( Expr ) ) - { - AtomName = GetVexAtomValue( Expr ); - - for ( ScanName = VexGetHeadChain; - ScanName != (chain_list *)0; - ScanName = ScanName->NEXT ) - { - if ( ScanName->DATA == AtomName ) return; - } - - VexGetHeadChain = addchain( VexGetHeadChain, AtomName ); - } -} - -/*------------------------------------------------------------\ -| | -| Get Vex Expr All Name | -| | -\------------------------------------------------------------*/ - -static void loc_getvexallname( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - - if ( IsVexNodeAtom( Expr ) ) - { - loc_getvexallnameatom( Expr ); - } - else - { - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - loc_getvexallname( GetVexOperand( ScanOper ) ); - } - } -} - -/*------------------------------------------------------------\ -| | -| Get Vex Expr All Name | -| | -\------------------------------------------------------------*/ - -chain_list *getvexexprallname( Expr ) - - vexexpr *Expr; -{ - VexGetHeadChain = (chain_list *)0; - - if ( Expr != (vexexpr *)0 ) loc_getvexallname( Expr ); - - return( VexGetHeadChain ); -} - -/*------------------------------------------------------------\ -| | -| Union Vex Expr Support | -| | -\------------------------------------------------------------*/ - -chain_list *unionvexexprallname( AllName, Expr ) - - chain_list *AllName; - vexexpr *Expr; -{ - VexGetHeadChain = AllName; - - if ( Expr != (vexexpr *)0 ) loc_getvexallname( Expr ); - - return( VexGetHeadChain ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Atom Name | -| | -\------------------------------------------------------------*/ - -char *getvexatomname( Expr ) - - vexexpr *Expr; -{ - long Oper; - - if ( IsVexNodeAtom( Expr ) ) - { - return( GetVexAtomValue( Expr ) ); - } - else - if ( IsVexNodeOper( Expr ) ) - { - Oper = GetVexOperValue( Expr ); - - if ( ( Oper == VEX_ARRAY ) || - ( Oper == VEX_INDEX ) || - ( Oper == VEX_INDEX_N ) || - ( Oper == VEX_DOWNTO ) || - ( Oper == VEX_TO ) ) - { - return( getvexatomname( GetVexOperand( Expr->OPERAND ) ) ); - } - } - - return( (char *)0 ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Literal Id | -| | -\------------------------------------------------------------*/ - -int getvexliteralid( Literal ) - - char Literal; -{ - int Index; - - for ( Index = 0; Index < VEX_MAX_ID; Index++ ) - { - if ( Literal == VEX_LITERAL_BY_ID[ Index ] ) break; - } - - if ( Index == VEX_MAX_ID ) Index = -1; - - return( Index ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Vector Position | -| | -\------------------------------------------------------------*/ - -int getvexvectorpos( Vector, Index ) - - vexexpr *Vector; - short Index; -{ - int Bound; - - if ( IsVexNodeBit( Vector ) ) - { - return( 0 ); - } - - Bound = Vector->WIDTH - 1; - - if ( IsVexNodeDown( Vector ) ) - { - if ( ( Index <= Vector->LEFT ) && - ( Index >= Vector->RIGHT ) ) - { - Index -= Vector->RIGHT; - - return( Bound - Index ); - } - } - else - { - if ( ( Index >= Vector->LEFT ) && - ( Index <= Vector->RIGHT ) ) - { - Index -= Vector->LEFT; - - return( Index ); - } - } - - return( -1 ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Vector Index | -| | -\------------------------------------------------------------*/ - -int getvexvectorindex( Atom, Position ) - - vexexpr *Atom; - short Position; -{ - if ( Position < Atom->WIDTH ) - { - if ( IsVexNodeDown( Atom ) ) return( Atom->LEFT - Position ); - else return( Atom->LEFT + Position ); - } - - return( -1 ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Vector Min | -| | -\------------------------------------------------------------*/ - -int getvexvectormin( Expr ) - - vexexpr *Expr; -{ - if ( IsVexNodeDown( Expr ) ) return( Expr->RIGHT ); - - return( Expr->LEFT ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Vector Max | -| | -\------------------------------------------------------------*/ - -int getvexvectormax( Expr ) - - vexexpr *Expr; -{ - if ( IsVexNodeDown( Expr ) ) return( Expr->LEFT ); - - return( Expr->RIGHT ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Std Func Id | -| | -\------------------------------------------------------------*/ - -int getvexstdfuncid( FuncName ) - - char *FuncName; -{ - authelem *Element; - long Index; - - if ( VexHashStdFunc == (authtable *)0 ) - { - VexHashStdFunc = createauthtable( VEX_MAX_STD_FUNC << 1 ); - - for ( Index = 0; Index < VEX_MAX_STD_FUNC; Index++ ) - { - addauthelem( VexHashStdFunc, VEX_STD_FUNC_NAME[ Index ], Index ); - } - } - - Element = searchauthelem( VexHashStdFunc, FuncName ); - - if ( Element != (authelem *)0 ) return( Element->VALUE ); - - return( -1 ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Array Name | -| | -\------------------------------------------------------------*/ - -char *getvexarrayname( Atom ) - - vexexpr *Atom; -{ - char *Name; - long Oper; - - Name = (char *)0; - - if ( IsVexNodeAtom( Atom ) ) - { - Name = GetVexAtomValue( Atom ); - } - else - if ( IsVexNodeOper( Atom ) ) - { - Oper = GetVexOperValue( Atom ); - - if ( ( Oper == VEX_ARRAY ) || - ( Oper == VEX_DOWNTO ) || - ( Oper == VEX_TO ) ) - { - Atom = GetVexOperand( Atom->OPERAND ); - Name = getvexarrayname( Atom ); - } - } - - return( Name ); -} - -/*------------------------------------------------------------\ -| | -| Get Vex Array Atom | -| | -\------------------------------------------------------------*/ - -vexexpr *getvexarrayatom( Expr ) - - vexexpr *Expr; -{ - vexexpr *Atom; - long Oper; - - Atom = (vexexpr *)0; - - if ( IsVexNodeAtom( Expr ) ) - { - Atom = Expr; - } - else - if ( IsVexNodeOper( Expr ) ) - { - Oper = GetVexOperValue( Expr ); - - if ( ( Oper == VEX_ARRAY ) || - ( Oper == VEX_DOWNTO ) || - ( Oper == VEX_TO ) ) - { - Expr = GetVexOperand( Expr->OPERAND ); - Atom = getvexarrayatom( Expr ); - } - } - - return( Atom ); -} - - diff --git a/alliance/src/vex/src/vexget.h b/alliance/src/vex/src/vexget.h deleted file mode 100644 index ce7a817a..00000000 --- a/alliance/src/vex/src/vexget.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexget.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_GET_H -# define VEX_GET_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexis.c b/alliance/src/vex/src/vexis.c deleted file mode 100644 index e5534ffa..00000000 --- a/alliance/src/vex/src/vexis.c +++ /dev/null @@ -1,634 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexis.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include "vexis.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ - - short VexOperBinary[ VEX_MAX_OPERATOR ] = - { - 3, /* VEX_CONCAT */ - 0, /* VEX_NOT */ - 0, /* VEX_NEG */ - 0, /* VEX_EVENT */ - 3, /* VEX_OR */ - 3, /* VEX_AND */ - 3, /* VEX_XOR */ - 3, /* VEX_NOR */ - 3, /* VEX_NAND */ - 3, /* VEX_NXOR */ - 2, /* VEX_EQ */ - 2, /* VEX_NE */ - 2, /* VEX_LT */ - 2, /* VEX_LE */ - 2, /* VEX_GT */ - 2, /* VEX_GE */ - 3, /* VEX_ADD */ - 2, /* VEX_SUB */ - 3, /* VEX_MUL */ - 2, /* VEX_DIV */ - 2, /* VEX_EXP */ - 2, /* VEX_MOD */ - 2, /* VEX_REM */ - 3, /* VEX_TO */ - 3, /* VEX_DOWNTO */ - 2, /* VEX_INDEX */ - 0, /* VEX_LEFT */ - 0, /* VEX_RIGHT */ - 0, /* VEX_LOW */ - 0, /* VEX_HIGH */ - 0, /* VEX_LENGTH */ - 0, /* VEX_RANGE */ - 0, /* VEX_REV_RANGE */ - 0, /* VEX_DRIVER */ - 2, /* VEX_IFT */ - 4, /* VEX_ARRAY */ - 3, /* VEX_INDEX_N */ - 0, /* VEX_OTHERS */ - 2, /* VEX_NUM_BIT */ - 0 /* VEX_ABS */ - }; - - short VexOperArith[ VEX_MAX_OPERATOR ] = - { - 0, /* VEX_CONCAT */ - 0, /* VEX_NOT */ - 1, /* VEX_NEG */ - 0, /* VEX_EVENT */ - 0, /* VEX_OR */ - 0, /* VEX_AND */ - 0, /* VEX_XOR */ - 0, /* VEX_NOR */ - 0, /* VEX_NAND */ - 0, /* VEX_NXOR */ - 1, /* VEX_EQ */ - 1, /* VEX_NE */ - 1, /* VEX_LT */ - 1, /* VEX_LE */ - 1, /* VEX_GT */ - 1, /* VEX_GE */ - 1, /* VEX_ADD */ - 1, /* VEX_SUB */ - 1, /* VEX_MUL */ - 1, /* VEX_DIV */ - 1, /* VEX_EXP */ - 1, /* VEX_MOD */ - 1, /* VEX_REM */ - 0, /* VEX_TO */ - 0, /* VEX_DOWNTO */ - 0, /* VEX_INDEX */ - 0, /* VEX_LEFT */ - 0, /* VEX_RIGHT */ - 0, /* VEX_LOW */ - 0, /* VEX_HIGH */ - 0, /* VEX_LENGTH */ - 0, /* VEX_RANGE */ - 0, /* VEX_REV_RANGE */ - 0, /* VEX_DRIVER */ - 0, /* VEX_IFT */ - 0, /* VEX_ARRAY */ - 0, /* VEX_INDEX_N */ - 1, /* VEX_OTHERS */ - 0, /* VEX_NUM_BIT */ - 1 /* VEX_ABS */ - }; - - short VexOperNegative[ VEX_MAX_OPERATOR ] = - { - 0, /* VEX_CONCAT */ - 1, /* VEX_NOT */ - 0, /* VEX_NEG */ - 0, /* VEX_EVENT */ - 0, /* VEX_OR */ - 0, /* VEX_AND */ - 0, /* VEX_XOR */ - 1, /* VEX_NOR */ - 1, /* VEX_NAND */ - 1, /* VEX_NXOR */ - 0, /* VEX_EQ */ - 0, /* VEX_NE */ - 0, /* VEX_LT */ - 0, /* VEX_LE */ - 0, /* VEX_GT */ - 0, /* VEX_GE */ - 0, /* VEX_ADD */ - 0, /* VEX_SUB */ - 0, /* VEX_MUL */ - 0, /* VEX_DIV */ - 0, /* VEX_EXP */ - 0, /* VEX_MOD */ - 0, /* VEX_REM */ - 0, /* VEX_TO */ - 0, /* VEX_DOWNTO */ - 0, /* VEX_INDEX */ - 0, /* VEX_LEFT */ - 0, /* VEX_RIGHT */ - 0, /* VEX_LOW */ - 0, /* VEX_HIGH */ - 0, /* VEX_LENGTH */ - 0, /* VEX_RANGE */ - 0, /* VEX_REV_RANGE */ - 0, /* VEX_DRIVER */ - 0, /* VEX_IFT */ - 0, /* VEX_ARRAY */ - 0, /* VEX_INDEX_N */ - 0, /* VEX_OTHERS */ - 0, /* VEX_NUM_BIT */ - 0, /* VEX_ABS */ - }; - - short VexTypeDivisible[ VEX_MAX_TYPE ] = - { - 0, /* SEVERITY */ - 0, /* BOOLEAN */ - 0, /* CHARACTER */ - 1, /* STRING */ - 0, /* BIT */ - 0, /* INTEGER */ - 0, /* NATURAL */ - 1, /* BIT_VECTOR */ - 0, /* STD_ULOGIC */ - 0, /* STD_LOGIC */ - 1, /* STD_ULOGIC_VECTOR */ - 1, /* STD_LOGIC_VECTOR */ - 0, /* X01 */ - 0, /* X01Z */ - 0, /* UX01 */ - 0, /* UX01Z */ - 1, /* UNSIGNED */ - 1, /* SIGNED */ - 0, /* SMALL_INT */ - 0, /* REG_BIT */ - 1, /* REG_VECTOR */ - 0, /* MUX_BIT */ - 1, /* MUX_VECTOR */ - 0, /* WOR_BIT */ - 1, /* WOR_VECTOR */ - 0, /* ENUMERATE */ - 1 /* ARRAY */ - }; - - short VexTypeVector[ VEX_MAX_TYPE ] = - { - 0, /* SEVERITY */ - 0, /* BOOLEAN */ - 0, /* CHARACTER */ - 1, /* STRING */ - 0, /* BIT */ - 1, /* INTEGER */ - 1, /* NATURAL */ - 1, /* BIT_VECTOR */ - 0, /* STD_ULOGIC */ - 0, /* STD_LOGIC */ - 1, /* STD_ULOGIC_VECTOR */ - 1, /* STD_LOGIC_VECTOR */ - 0, /* X01 */ - 0, /* X01Z */ - 0, /* UX01 */ - 0, /* UX01Z */ - 1, /* UNSIGNED */ - 1, /* SIGNED */ - 0, /* SMALL_INT */ - 0, /* REG_BIT */ - 1, /* REG_VECTOR */ - 0, /* MUX_BIT */ - 1, /* MUX_VECTOR */ - 0, /* WOR_BIT */ - 1, /* WOR_VECTOR */ - 1, /* ENUMERATE */ - 1 /* ARRAY */ - }; - - static char *VexIsName = (char *)0; - static long VexIsOper = (long )0; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Is Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Is Vex Type Vector | -| | -\------------------------------------------------------------*/ - -int isvextypevector( Type ) - - int Type; -{ - if ( ( Type < 0 ) || - ( Type >= VEX_MAX_TYPE ) ) - { - return( -1 ); - } - - return( VexTypeVector[ Type ] ); -} - -/*------------------------------------------------------------\ -| | -| Is Vex Type Divisible | -| | -\------------------------------------------------------------*/ - -int isvextypedivisible( Type ) - - int Type; -{ - if ( ( Type < 0 ) || - ( Type >= VEX_MAX_TYPE ) ) - { - return( -1 ); - } - - return( VexTypeDivisible[ Type ] ); -} - -/*------------------------------------------------------------\ -| | -| Is Vex Positive Operator | -| | -\------------------------------------------------------------*/ - -int isvexpositiveoper( Oper ) - - long Oper; -{ - if ( ( Oper < 0 ) || - ( Oper >= VEX_MAX_OPERATOR ) ) - { - return( -1 ); - } - - return( ! VexOperNegative[ Oper ] ); -} - -/*------------------------------------------------------------\ -| | -| Is Vex Negative Operator | -| | -\------------------------------------------------------------*/ - -int isvexnegativeoper( Oper ) - - long Oper; -{ - if ( ( Oper < 0 ) || - ( Oper >= VEX_MAX_OPERATOR ) ) - { - return( -1 ); - } - - return( VexOperNegative[ Oper ] ); -} - -/*------------------------------------------------------------\ -| | -| Is Vex Unary Operator | -| | -\------------------------------------------------------------*/ - -int isvexunaryoper( Oper ) - - long Oper; -{ - if ( ( Oper < 0 ) || - ( Oper >= VEX_MAX_OPERATOR ) ) - { - return( -1 ); - } - - return( ! VexOperBinary[ Oper ] ); -} - -/*------------------------------------------------------------\ -| | -| Is Vex Binary Operator | -| | -\------------------------------------------------------------*/ - -int isvexbinaryoper( Oper ) - - long Oper; -{ - if ( ( Oper < 0 ) || - ( Oper >= VEX_MAX_OPERATOR ) ) - { - return( -1 ); - } - - return( VexOperBinary[ Oper ] ); -} - -/*------------------------------------------------------------\ -| | -| Is Vex Ternary Operator | -| | -\------------------------------------------------------------*/ - -int isvexternaryoper( Oper ) - - long Oper; -{ - if ( ( Oper < 0 ) || - ( Oper >= VEX_MAX_OPERATOR ) ) - { - return( -1 ); - } - - return( VexOperBinary[ Oper ] == 3 ); -} - -/*------------------------------------------------------------\ -| | -| Is Local Operator In Expr | -| | -\------------------------------------------------------------*/ - -static int loc_isvexoperinexpr( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - - if ( IsVexNodeAtom( Expr ) ) - { - return( 0 ); - } - - if ( IsVexNodeOper( Expr ) ) - { - if ( GetVexOperValue( Expr ) == VexIsOper ) - { - return( 1 ); - } - } - - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - if ( loc_isvexoperinexpr( GetVexOperand( ScanOper ) ) ) - { - return( 1 ); - } - } - - return( 0 ); -} - -/*------------------------------------------------------------\ -| | -| Is Vex Operator In Expr | -| | -\------------------------------------------------------------*/ - -int isvexoperinexpr( Expr, Oper ) - - vexexpr *Expr; - long Oper; -{ - VexIsOper = Oper; - - return( loc_isvexoperinexpr( Expr ) ); -} - -/*------------------------------------------------------------\ -| | -| Is Local Arithmetic Operator In Expr | -| | -\------------------------------------------------------------*/ - -static int loc_isvexarithoperinexpr( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - vexexpr *Operand1; - vexexpr *Operand2; - long Oper; - - if ( IsVexNodeAtom( Expr ) ) - { - return( 0 ); - } - - if ( IsVexNodeOper( Expr ) ) - { - Oper = GetVexOperValue( Expr ); - - if ( VexOperArith[ Oper ] ) - { - if ( ( Oper == VEX_EQ ) || - ( Oper == VEX_NE ) ) - { - Operand1 = GetVexOperand( Expr->OPERAND ); - Operand2 = GetVexOperand( Expr->OPERAND->NEXT ); - - if ( Operand1->WIDTH == Operand2->WIDTH ) - { - return( 0 ); - } - } - - return( 1 ); - } - } - - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - if ( loc_isvexarithoperinexpr( GetVexOperand( ScanOper ) ) ) - { - return( 1 ); - } - } - - return( 0 ); -} - -/*------------------------------------------------------------\ -| | -| Is Vex Arithmetic Operator In Expr | -| | -\------------------------------------------------------------*/ - -int isvexarithoperinexpr( Expr ) - - vexexpr *Expr; -{ - return( loc_isvexarithoperinexpr( Expr ) ); -} - - -/*------------------------------------------------------------\ -| | -| Is Local Name In Expr | -| | -\------------------------------------------------------------*/ - -static int loc_isvexnameinexpr( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - - if ( IsVexNodeAtom( Expr ) ) - { - if ( GetVexAtomValue( Expr ) == VexIsName ) return( 1 ); - - return( 0 ); - } - - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - if ( loc_isvexnameinexpr( GetVexOperand( ScanOper ) ) ) - { - return( 1 ); - } - } - - return( 0 ); -} - -/*------------------------------------------------------------\ -| | -| Is Vex Name In Expr | -| | -\------------------------------------------------------------*/ - -int isvexnameinexpr( Expr, Name ) - - vexexpr *Expr; - char *Name; -{ - VexIsName = namealloc( Name ); - - return( loc_isvexnameinexpr( Expr ) ); -} - -/*------------------------------------------------------------\ -| | -| Is Vex Equal Expr | -| | -\------------------------------------------------------------*/ - -int isvexequalexpr( Expr1, Expr2 ) - - vexexpr *Expr1; - vexexpr *Expr2; -{ - chain_list *ScanOper1; - chain_list *ScanOper2; - - if ( ( Expr1 == (vexexpr *)0 ) || - ( Expr2 == (vexexpr *)0 ) ) - { - return( 0 ); - } - - if ( ( Expr1->VALUE != Expr2->VALUE ) || - ( Expr1->TYPE != Expr2->TYPE ) || - ( Expr1->LEFT != Expr2->LEFT ) || - ( Expr1->RIGHT != Expr2->RIGHT ) ) - { - return( 0 ); - } - - - if ( ! IsVexNodeAtom( Expr1 ) ) - { - ScanOper1 = Expr1->OPERAND; - ScanOper2 = Expr2->OPERAND; - - while ( ( ScanOper1 != (chain_list *)0 ) && - ( ScanOper2 != (chain_list *)0 ) ) - { - if ( ! isvexequalexpr( GetVexOperand( ScanOper1 ), - GetVexOperand( ScanOper2 ) ) ) - { - return( 0 ); - } - - ScanOper1 = ScanOper1->NEXT; - ScanOper2 = ScanOper2->NEXT; - } - - if ( ( ScanOper1 != (chain_list *)0 ) || - ( ScanOper2 != (chain_list *)0 ) ) - { - return( 0 ); - } - } - - return( 1 ); -} diff --git a/alliance/src/vex/src/vexis.h b/alliance/src/vex/src/vexis.h deleted file mode 100644 index a3c2191e..00000000 --- a/alliance/src/vex/src/vexis.h +++ /dev/null @@ -1,79 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexis.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_IS_H -# define VEX_IS_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ - - extern short VexOperBinary[ VEX_MAX_OPERATOR ]; - extern short VexOperNegative[ VEX_MAX_OPERATOR ]; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexoptim.c b/alliance/src/vex/src/vexoptim.c deleted file mode 100644 index 172d21cc..00000000 --- a/alliance/src/vex/src/vexoptim.c +++ /dev/null @@ -1,218 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexoptim.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include "vexoptim.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Optim Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Optim Vex Not Expr | -| | -\------------------------------------------------------------*/ - -vexexpr *optimvexnotexpr( Expr ) - - vexexpr *Expr; -{ - vexexpr *Expr1; - char *Value; - char Buffer[ 128 ]; - short Index; - long Oper; - long NotOper; - - if ( IsVexNodeAtom( Expr ) ) - { - if ( IsVexAtomLiteral( Expr ) ) - { - Value = GetVexAtomValue( Expr ); - - Buffer[ 0 ] = Value[ 0 ]; - - for ( Index = 1; Index <= Expr->WIDTH; Index++ ) - { - evalvexnotliteral( Value[ Index ], &Buffer[ Index ] ); - } - - Buffer[ Index++ ] = Value[ 0 ]; - Buffer[ Index++ ] = '\0'; - - SetVexAtomValue( Expr, namealloc( Buffer ) ); - - return( Expr ); - } - } - else - if ( IsVexNodeOper( Expr ) ) - { - Oper = GetVexOperValue( Expr ); - NotOper = getvexnotoper( Oper ); - - if ( Oper == VEX_NOT ) - { - Expr1 = GetVexOperand( Expr->OPERAND ); - SetVexOperand( Expr->OPERAND, (vexexpr *)0 ); - freevexexpr( Expr ); - - return( Expr1 ); - } - else - if ( NotOper != -1 ) - { - SetVexOperValue( Expr, NotOper ); - - return( Expr ); - } - } - - Expr1 = createvexoper( VEX_NOT, Expr->WIDTH ); - addvexhexpr( Expr1, Expr ); - - return( Expr1 ); -} - -/*------------------------------------------------------------\ -| | -| Optim Vex Bin Expr | -| | -\------------------------------------------------------------*/ - -vexexpr *optimvexbinexpr( Oper, Width, Expr1, Expr2 ) - - long Oper; - short Width; - vexexpr *Expr1; - vexexpr *Expr2; -{ - vexexpr *Expr; - chain_list *ScanOper; - long Oper1; - long Oper2; - int Binary; - int Negative; - - Binary = isvexbinaryoper( Oper ); - - if ( ! Binary ) - { - vexerror( VEX_OPERATOR_ERROR, Oper ); - } - - Negative = isvexnegativeoper( Oper ); - - if ( IsVexNodeOper( Expr1 ) ) Oper1 = GetVexOperValue( Expr1 ); - else Oper1 = -1; - - if ( IsVexNodeOper( Expr2 ) ) Oper2 = GetVexOperValue( Expr2 ); - else Oper2 = -1; - - if ( ( Negative ) || - ( Binary == 2 ) || - ( Oper2 != Oper ) || - ( ( Expr2->WIDTH != Width ) && - ( Oper != VEX_CONCAT ) ) ) - { - Expr = createvexoper( Oper, Width ); - addvexhexpr( Expr, Expr2 ); - } - else - { - Expr = Expr2; - } - - if ( ( Negative ) || - ( Binary == 2 ) || - ( Oper1 != Oper ) || - ( ( Expr2->WIDTH != Width ) && - ( Oper != VEX_CONCAT ) ) ) - { - addvexhexpr( Expr, Expr1 ); - } - else - { - ScanOper = Expr1->OPERAND; - - while ( ScanOper->NEXT != (chain_list *)0 ) - { - ScanOper = ScanOper->NEXT; - } - - ScanOper->NEXT = Expr->OPERAND; - Expr->OPERAND = Expr1->OPERAND; - Expr1->OPERAND = (chain_list *)0; - - freevexexpr( Expr1 ); - } - - return( Expr ); -} diff --git a/alliance/src/vex/src/vexoptim.h b/alliance/src/vex/src/vexoptim.h deleted file mode 100644 index 31769458..00000000 --- a/alliance/src/vex/src/vexoptim.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexoptim.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_OPTIM_H -# define VEX_OPTIM_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexshift.c b/alliance/src/vex/src/vexshift.c deleted file mode 100644 index 27f491b2..00000000 --- a/alliance/src/vex/src/vexshift.c +++ /dev/null @@ -1,240 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexshift.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include -# include "vexshift.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Shift Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Shift Vex Atom Left | -| | -\------------------------------------------------------------*/ - -vexexpr *shiftvexatomleft( Expr, Count ) - - vexexpr *Expr; - short Count; -{ - char *Value; - vexexpr *VexZero; - short Width; - - if ( IsVexNodeAtom( Expr ) ) - { - Value = GetVexAtomValue( Expr ); - Width = Expr->WIDTH; - - if ( Count >= Width ) - { -/* -** "xxxx...x" -> "0000...0" -*/ - VexZero = createvexatomveclit( VEX_ZERO, Width ); - freevexexpr( Expr ); - - Expr = VexZero; - } - else - if ( Count >= 1 ) - { -/* -** "xxxx...x" -> "xxxx...0" -*/ - VexZero = createvexatomveclit( VEX_ZERO, Count ); - - if ( IsVexAtomDown( Expr ) ) - { - Expr = slicevexatomvec( Expr, Expr->LEFT - Count, Expr->RIGHT ); - } - else - { - Expr = slicevexatomvec( Expr, Expr->LEFT + Count, Expr->RIGHT ); - } - - Expr = createvexbinexpr( VEX_CONCAT, Width, Expr, VexZero ); - Expr = simpvexexpr( Expr ); - } - - return( Expr ); - } - - return( (vexexpr *)0 ); -} - -/*------------------------------------------------------------\ -| | -| Shift Vex Atom Right | -| | -\------------------------------------------------------------*/ - -vexexpr *shiftvexatomright( Expr, Count ) - - vexexpr *Expr; - short Count; -{ - char *Value; - vexexpr *VexSign; - vexexpr *VexSignBit; - short Width; - short Index; - - if ( IsVexNodeAtom( Expr ) ) - { - Value = GetVexAtomValue( Expr ); - Width = Expr->WIDTH; - - if ( Count >= Width ) - { - if ( IsVexAtomSigned( Expr ) ) - { -/* -** "sxxx...x" -> "ssss...s" -*/ - if ( IsVexAtomLiteral( Expr ) ) - { - VexSign = createvexatomveclit( Value[ 1 ], Width ); - } - else - { - VexSignBit = createvexatomvec( Value, Expr->LEFT, Expr->LEFT ); - VexSign = VexSignBit; - - for ( Index = 1; Index < Width; Index++ ) - { - VexSign = createvexbinexpr( VEX_CONCAT, VexSign->WIDTH + 1, - VexSign, dupvexexpr( VexSignBit ) ); - } - } - } - else - { -/* -** "xxxx...x" -> "0000...0" -*/ - VexSign = createvexatomveclit( VEX_ZERO, Width ); - freevexexpr( Expr ); - } - - Expr = VexSign; - } - else - if ( Count >= 1 ) - { - if ( IsVexAtomSigned( Expr ) ) - { -/* -** "sxxx...x" -> "ss..xxxx" -*/ - if ( IsVexAtomLiteral( Expr ) ) - { - VexSign = createvexatomveclit( Value[ 1 ], Count ); - } - else - { - VexSignBit = createvexatomvec( Value, Expr->LEFT, Expr->LEFT ); - VexSign = VexSignBit; - - for ( Index = 1; Index < Count; Index++ ) - { - VexSign = createvexbinexpr( VEX_CONCAT, VexSign->WIDTH + 1, - VexSign, dupvexexpr( VexSignBit ) ); - } - } - } - else - { -/* -** "xxxx...x" -> "00..xxxx" -*/ - VexSign = createvexatomveclit( VEX_ZERO, Count ); - } - - if ( IsVexAtomDown( Expr ) ) - { - Expr = slicevexatomvec( Expr, Expr->LEFT, Expr->RIGHT + Count ); - } - else - { - Expr = slicevexatomvec( Expr, Expr->LEFT, Expr->RIGHT - Count ); - } - - Expr = createvexbinexpr( VEX_CONCAT, Width, VexSign, Expr ); - Expr = simpvexexpr( Expr ); - } - - return( Expr ); - } - - return( (vexexpr *)0 ); -} diff --git a/alliance/src/vex/src/vexshift.h b/alliance/src/vex/src/vexshift.h deleted file mode 100644 index 10936f65..00000000 --- a/alliance/src/vex/src/vexshift.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexshift.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_SHIFT_H -# define VEX_SHIFT_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexsimp.c b/alliance/src/vex/src/vexsimp.c deleted file mode 100644 index a0471495..00000000 --- a/alliance/src/vex/src/vexsimp.c +++ /dev/null @@ -1,1449 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexoptim.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include -# include "vexoptim.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static char SimpBuffer[ 512 ]; - static int SimpVexEqual = 0; - - static vexexpr *loc_simpvexconcat(); - static vexexpr *loc_simpvexnot(); - static vexexpr *loc_simpvexconcat(); - static vexexpr *loc_simpvexneg(); - static vexexpr *loc_simpvexabs(); - static vexexpr *loc_simpvexbool3(); - static vexexpr *loc_simpvexequal2(); - static vexexpr *loc_simpvexcomp2(); - static vexexpr *loc_simpvexarith3(); - static vexexpr *loc_simpvexarith2(); - static vexexpr *loc_simpvexslice(); - static vexexpr *loc_simpvexift(); - static vexexpr *loc_simpvexnop(); - static vexexpr *loc_simpvexnumbit(); - - static vexexpr *(*SimpFuncArray[ VEX_MAX_OPERATOR ])() = - { - loc_simpvexconcat, /* VEX_CONCAT */ - loc_simpvexnot, /* VEX_NOT */ - loc_simpvexneg, /* VEX_NEG */ - loc_simpvexnop, /* VEX_EVENT */ - loc_simpvexbool3, /* VEX_OR */ - loc_simpvexbool3, /* VEX_AND */ - loc_simpvexbool3, /* VEX_XOR */ - loc_simpvexbool3, /* VEX_NOR */ - loc_simpvexbool3, /* VEX_NAND */ - loc_simpvexbool3, /* VEX_NXOR */ - loc_simpvexequal2, /* VEX_EQ */ - loc_simpvexequal2, /* VEX_NE */ - loc_simpvexcomp2, /* VEX_LT */ - loc_simpvexcomp2, /* VEX_LE */ - loc_simpvexcomp2, /* VEX_GT */ - loc_simpvexcomp2, /* VEX_GE */ - loc_simpvexarith3, /* VEX_ADD */ - loc_simpvexarith2, /* VEX_SUB */ - loc_simpvexarith3, /* VEX_MUL */ - loc_simpvexarith2, /* VEX_DIV */ - loc_simpvexarith2, /* VEX_EXP */ - loc_simpvexarith2, /* VEX_MOD */ - loc_simpvexarith2, /* VEX_REM */ - loc_simpvexslice, /* VEX_TO */ - loc_simpvexslice, /* VEX_DOWNTO */ - loc_simpvexslice, /* VEX_INDEX */ - loc_simpvexnop, /* VEX_LEFT */ - loc_simpvexnop, /* VEX_RIGHT */ - loc_simpvexnop, /* VEX_LOW */ - loc_simpvexnop, /* VEX_HIGH */ - loc_simpvexnop, /* VEX_LENGTH */ - loc_simpvexnop, /* VEX_RANGE */ - loc_simpvexnop, /* VEX_REV_RANGE */ - loc_simpvexnop, /* VEX_DRIVER */ - loc_simpvexift, /* VEX_IFT */ - loc_simpvexnop, /* VEX_ARRAY */ - loc_simpvexnop, /* VEX_INDEX_N */ - loc_simpvexnop, /* VEX_OTHERS */ - loc_simpvexnumbit, /* VEX_NUM_BIT */ - loc_simpvexabs /* VEX_ABS */ - }; - - static short SimpBool3Table[ 3 ][ 3 ] = - { - /* Scotch Neutral Polarity */ - - { VEX_ONE_ID, VEX_ZERO_ID, -1 }, /* VEX_OR */ - { VEX_ZERO_ID, VEX_ONE_ID, -1 }, /* VEX_AND */ - { VEX_UNINIT_ID, VEX_ZERO_ID, VEX_ONE_ID } /* VEX_XOR */ - }; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Simplify Vex Nop | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexnop( Expr ) - - vexexpr *Expr; -{ - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Concat | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexconcat( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - chain_list *DelOper; - chain_list **PrevOper; - vexexpr *Operand1; - vexexpr *Operand2; - char *Value1; - char *Value2; - long Left1; - long Left2; - long Right1; - long Right2; - int Width; - int Index; - - Operand1 = (vexexpr *)0; - - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - Operand2 = GetVexOperand( ScanOper ); - - if ( ( IsVexNodeAtom( Operand2 ) ) && - ( ( IsVexAtomVector( Operand2 ) ) || - ( IsVexAtomLiteral( Operand2 ) ) ) ) - { - if ( Operand1 == (vexexpr *)0 ) - { - Operand1 = Operand2; - } - else -/* -** Verify Operand1 and Operand2 -*/ - if ( ( IsVexAtomLiteral( Operand1 ) ) && - ( IsVexAtomLiteral( Operand2 ) ) ) - { -/* -** Literal concatenation -*/ - Width = 1; - SimpBuffer[ 0 ] = '"'; - - Value1 = GetVexAtomValue( Operand1 ); - - for ( Index = 1; Index <= Operand1->WIDTH; Index++ ) - { - SimpBuffer[ Width++ ] = Value1[ Index ]; - } - - Value2 = GetVexAtomValue( Operand2 ); - - for ( Index = 1; Index <= Operand2->WIDTH; Index++ ) - { - SimpBuffer[ Width++ ] = Value2[ Index ]; - } - - SimpBuffer[ Width++ ] = '"'; - SimpBuffer[ Width ] = '\0'; - - Width = Width - 2; - - SetVexAtomValue( Operand1, namealloc( SimpBuffer ) ); - Operand1->WIDTH = Width; - Operand1->LEFT = 0; - Operand1->RIGHT = Width - 1; - - SetVexNodeTag( Operand2 ); - } - else - if ( ( ! IsVexAtomLiteral( Operand1 ) ) && - ( ! IsVexAtomLiteral( Operand2 ) ) ) - { -/* -** Vector concatenation -*/ - Value1 = GetVexAtomValue( Operand1 ); - Value2 = GetVexAtomValue( Operand2 ); - - if ( Value1 == Value2 ) - { - Left1 = Operand1->LEFT; - Right1 = Operand1->RIGHT; - Left2 = Operand2->LEFT; - Right2 = Operand2->RIGHT; - - if ( ( ( Right1 - 1 ) == Left2 ) && - ( Left1 >= Right1 ) && - ( Right1 >= Right2 ) ) - { - Operand1->LEFT = Left1; - Operand1->RIGHT = Right2; - Operand1->WIDTH = (Left1 - Right2) + 1; - - SetVexAtomDown( Operand1 ); - SetVexNodeTag( Operand2 ); - } - else - if ( ( ( Right1 + 1 ) == Left2 ) && - ( Left1 <= Right1 ) && - ( Right1 <= Right2 ) ) - { - Operand1->LEFT = Left1; - Operand1->RIGHT = Right2; - Operand1->WIDTH = (Right2 - Left1) + 1; - - SetVexAtomUp( Operand1 ); - SetVexNodeTag( Operand2 ); - } - else - { - Operand1 = Operand2; - } - } - else - { - Operand1 = Operand2; - } - } - else - { - Operand1 = Operand2; - } - } - else - { - Operand1 = (vexexpr *)0; - } - } - - PrevOper = &Expr->OPERAND; - ScanOper = Expr->OPERAND; - - while ( ScanOper != (chain_list *)0 ) - { - Operand1 = GetVexOperand( ScanOper ); - - if ( IsVexNodeTag( Operand1 ) ) - { - *PrevOper = ScanOper->NEXT; - DelOper = ScanOper; - ScanOper = ScanOper->NEXT; - - DelOper->NEXT = (chain_list *)0; - freechain( DelOper ); - - freevexexpr( Operand1 ); - } - else - { - PrevOper = &ScanOper->NEXT; - ScanOper = ScanOper->NEXT; - } - } - - if ( Expr->OPERAND->NEXT == (chain_list *)0 ) - { - Operand1 = GetVexOperand( Expr->OPERAND ); - SetVexOperand( Expr->OPERAND, (vexexpr *)0 ); - - freevexexpr( Expr ); - Expr = Operand1; - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Not | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexnot( Expr ) - - vexexpr *Expr; -{ - vexexpr *Operand; - vexexpr *Operand2; - char *Value; - long Oper; - int Index; - - Operand = GetVexOperand( Expr->OPERAND ); - - if ( ( IsVexNodeAtom( Operand ) ) && - ( IsVexAtomLiteral( Operand ) ) ) - { - Value = GetVexAtomValue( Operand ); - - SimpBuffer[ 0 ] = Value[ 0 ]; - - for ( Index = 1; Index <= Operand->WIDTH; Index++ ) - { - evalvexnotliteral( Value[ Index ], &SimpBuffer[ Index ] ); - } - - SimpBuffer[ Index++ ] = Value[ 0 ]; - SimpBuffer[ Index++ ] = '\0'; - - SetVexAtomValue( Operand, namealloc( SimpBuffer ) ); - SetVexOperand( Expr->OPERAND, (vexexpr *)0 ); - freevexexpr( Expr ); - - Expr = Operand; - } - else - if ( IsVexNodeOper( Operand ) ) - { - Oper = GetVexOperValue( Operand ); - - if ( Oper == VEX_NOT ) - { - Operand2 = GetVexOperand( Operand->OPERAND ); - SetVexOperand( Operand->OPERAND, (vexexpr *)0 ); - freevexexpr( Expr ); - - Expr = Operand2; - } - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Abs | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexabs( Expr ) - - vexexpr *Expr; -{ - vexexpr *Operand; - long Value; - - Operand = GetVexOperand( Expr->OPERAND ); - - if ( evalvexatomlong( Operand, &Value ) != -1 ) - { - if ( Value < 0 ) Value = - Value; - freevexexpr( Expr ); - - Expr = createvexatomlong( Value, 0, 1 ); - } - - return( Expr ); -} - - -/*------------------------------------------------------------\ -| | -| Simplify Vex Neg | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexneg( Expr ) - - vexexpr *Expr; -{ - vexexpr *Operand; - long Value; - - Operand = GetVexOperand( Expr->OPERAND ); - - if ( evalvexatomlong( Operand, &Value ) != -1 ) - { - Value = - Value; - freevexexpr( Expr ); - - Expr = createvexatomlong( Value, 0, 1 ); - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Is Operand Same Width | -| | -\------------------------------------------------------------*/ - -static int loc_isoperandsamewidth( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - vexexpr *Operand; - int Width; - - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - Operand = GetVexOperand( ScanOper ); - - if ( ScanOper == Expr->OPERAND ) - { - Width = Operand->WIDTH; - } - else - if ( Width != Operand->WIDTH ) - { - return( 0 ); - } - } - - return( 1 ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Boolean 3 | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexbool3( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - chain_list **PrevOper; - chain_list *DelOper; - vexexpr *Operand; - vexexpr *VexSum; - int NumOper; - int NumSum; - int Index; - int AllSame; - int Negative; - int LiteralId; - char Literal; - long Oper; - char *Sum; - char *Value; - - Oper = GetVexOperValue( Expr ); - - NumOper = 0; - NumSum = 0; - Sum = 0; - VexSum = (vexexpr *)0; - - if ( ! loc_isoperandsamewidth( Expr ) ) - { - return( Expr ); - } - - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - Operand = GetVexOperand( ScanOper ); - NumOper++; - - if ( ( IsVexNodeAtom( Operand ) ) && - ( IsVexAtomLiteral( Operand ) ) ) - { - Value = GetVexAtomValue( Operand ); - SetVexNodeTag( Operand ); - - if ( NumSum == 0 ) - { - Sum = Value; - VexSum = Operand; - } - else - { - SimpBuffer[ 0 ] = Value[ 0 ]; - - for ( Index = 1; Index <= Operand->WIDTH; Index++ ) - { - if ( ( Oper == VEX_AND ) || ( Oper == VEX_NAND ) ) - evalvexandliteral( Sum[ Index ], Value[ Index ], &SimpBuffer[ Index ] ); - else - if ( ( Oper == VEX_OR ) || ( Oper == VEX_NOR ) ) - evalvexorliteral( Sum[ Index ], Value[ Index ], &SimpBuffer[ Index ] ); - else - if ( ( Oper == VEX_XOR ) || ( Oper == VEX_NXOR ) ) - evalvexxorliteral( Sum[ Index ], Value[ Index ], &SimpBuffer[ Index ] ); - else - vexerror( VEX_OPERATOR_ERROR, Oper ); - } - - SimpBuffer[ Index++ ] = Value[ 0 ]; - SimpBuffer[ Index++ ] = '\0'; - - Sum = namealloc( SimpBuffer ); - } - - NumSum++; - } - } - - if ( NumSum > 1 ) - { - VexSum = dupvexnode( VexSum ); - ClearVexNodeTag( VexSum ); - SetVexAtomValue( VexSum, Sum ); - - if ( NumSum == NumOper ) - { - if ( isvexnegativeoper( Oper ) ) - { - VexSum = optimvexnotexpr( VexSum ); - } - - freevexexpr( Expr ); - - Expr = VexSum; - } - else - { - PrevOper = &Expr->OPERAND; - ScanOper = Expr->OPERAND; - - while ( ScanOper != (chain_list *)0 ) - { - Operand = GetVexOperand( ScanOper ); - - if ( IsVexNodeTag( Operand ) ) - { - *PrevOper = ScanOper->NEXT; - DelOper = ScanOper; - ScanOper = ScanOper->NEXT; - - DelOper->NEXT = (chain_list *)0; - freechain( DelOper ); - - freevexexpr( Operand ); - } - else - { - PrevOper = &ScanOper->NEXT; - ScanOper = ScanOper->NEXT; - } - } - - addvexhexpr( Expr, VexSum ); - } - } - else - if ( NumSum == 1 ) - { - ClearVexNodeTag( VexSum ); - } - - if ( NumSum > 0 ) - { - NumSum = 0; - Negative = isvexnegativeoper( Oper ); - - if ( Negative ) - { - Oper = getvexnotoper( Oper ); - SetVexOperValue( Expr, Oper ); - } - - Oper = Oper - VEX_OR; - ScanOper = Expr->OPERAND; - PrevOper = &Expr->OPERAND; - - while ( ScanOper != (chain_list *)0 ) - { - Operand = GetVexOperand( ScanOper ); - - if ( ( IsVexNodeAtom( Operand ) ) && - ( IsVexAtomLiteral( Operand ) ) ) - { - Value = GetVexAtomValue( Operand ); - Literal = Value[ 1 ]; - AllSame = 1; - - for ( Index = 2; Index <= Operand->WIDTH; Index++ ) - { - if ( Literal != Value[ Index ] ) - { - AllSame = 0; break; - } - } - - if ( AllSame ) - { - LiteralId = getvexliteralid( Literal ); -/* -** The literal is equal to the "scotch" literal -*/ - if ( SimpBool3Table[ Oper ][ 0 ] == LiteralId ) - { - SetVexOperand( ScanOper, (vexexpr *)0 ); - freevexexpr( Expr ); - - if ( Negative ) - { - Operand = optimvexnotexpr( Operand ); - } - - return( Operand ); - } -/* -** The literal is equal to the neutral or polarity inverse literal -*/ - if ( ( SimpBool3Table[ Oper ][ 1 ] == LiteralId ) || - ( SimpBool3Table[ Oper ][ 2 ] == LiteralId ) ) - { - *PrevOper = ScanOper->NEXT; - DelOper = ScanOper; - ScanOper = ScanOper->NEXT; - - DelOper->NEXT = (chain_list *)0; - freechain( DelOper ); - - freevexexpr( Operand ); - - if ( SimpBool3Table[ Oper ][ 2 ] == LiteralId ) - { - Negative = ! Negative; - } - - continue; - } - } - } - - NumSum++; - - PrevOper = &ScanOper->NEXT; - ScanOper = ScanOper->NEXT; - } - - if ( NumSum == 1 ) - { - Operand = GetVexOperand( Expr->OPERAND ); - SetVexOperand( Expr->OPERAND, (vexexpr *)0 ); - freevexexpr( Expr ); - - Expr = Operand; - } - - if ( Negative ) - { - Expr = optimvexnotexpr( Expr ); - } - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Ift | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexift( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanCond; - chain_list *ScanData; - vexexpr *VexCond; - vexexpr *VexData; - char *Value; - int Index; - int LiteralId; - int AllSame; - char Literal; - - ScanCond = Expr->OPERAND; - VexCond = GetVexOperand( ScanCond ); - ScanData = ScanCond->NEXT; - VexData = GetVexOperand( ScanData ); - - if ( VexData->WIDTH != Expr->WIDTH ) return( Expr ); - - if ( ( IsVexNodeAtom( VexCond ) ) && - ( IsVexAtomLiteral( VexCond ) ) ) - { - Value = GetVexAtomValue( VexCond ); - Literal = Value[ 1 ]; - LiteralId = getvexliteralid( Literal ); - - if ( LiteralId == VEX_ONE_ID ) - { - SetVexOperand( ScanData, (vexexpr *)0 ); - freevexexpr( Expr ); - - return( VexData ); - } - else - if ( LiteralId == VEX_ZERO_ID ) - { - SimpBuffer[ 0 ] = Value[ 0 ]; - - for ( Index = 1; Index <= Expr->WIDTH; Index++ ) - { - SimpBuffer[ Index ] = VEX_ZERO; - } - - SimpBuffer[ Index++ ] = Value[ 0 ]; - SimpBuffer[ Index++ ] = '\0'; - - freevexexpr( Expr ); - VexData = createvexatomlit( SimpBuffer ); - - return( VexData ); - } - } - - if ( ( IsVexNodeAtom( VexData ) ) && - ( IsVexAtomLiteral( VexData ) ) ) - { - Value = GetVexAtomValue( VexData ); - Literal = Value[ 1 ]; - - AllSame = 1; - - for ( Index = 2; Index <= VexData->WIDTH; Index++ ) - { - if ( Literal != Value[ Index ] ) - { - AllSame = 0; break; - } - } - - if ( AllSame ) - { - LiteralId = getvexliteralid( Literal ); - - if ( LiteralId == VEX_ZERO_ID ) - { - SetVexOperand( ScanData, (vexexpr *)0 ); - freevexexpr( Expr ); - - return( VexData ); - } - - if ( ( LiteralId == VEX_ONE_ID ) && - ( VexData->WIDTH == 1 ) ) - { - SetVexOperand( ScanCond, (vexexpr *)0 ); - freevexexpr( Expr ); - - return( VexCond ); - } - } - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Compare 2 | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexcomp2( Expr ) - - vexexpr *Expr; -{ - vexexpr *Operand1; - vexexpr *Operand2; - long Value1; - long Value2; - long Value; - long Oper; - - Oper = GetVexOperValue( Expr ); - Value = 0; - - Operand1 = GetVexOperand( Expr->OPERAND ); - Operand2 = GetVexOperand( Expr->OPERAND->NEXT ); - - if ( ( evalvexatomlong( Operand1, &Value1 ) != -1 ) && - ( evalvexatomlong( Operand2, &Value2 ) != -1 ) ) - { - if ( Oper == VEX_LT ) Value = (Value1 < Value2); - else - if ( Oper == VEX_LE ) Value = (Value1 <= Value2); - else - if ( Oper == VEX_GT ) Value = (Value1 > Value2); - else - if ( Oper == VEX_GE ) Value = (Value1 >= Value2); - else - vexerror( VEX_OPERATOR_ERROR, Oper ); - - freevexexpr( Expr ); - - if ( Value ) Expr = createvexatombit( VEX_ATOM_ONE ); - else Expr = createvexatombit( VEX_ATOM_ZERO ); - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Equal 2 | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexequal2( Expr ) - - vexexpr *Expr; -{ - vexexpr *Operand1; - vexexpr *Operand2; - vexexpr *NewExpr; - vexexpr *Atom1; - vexexpr *Atom2; - vexexpr *XorExpr; - char *Value1; - char *Value2; - int ScanPos; - int Index1; - int Index2; - int NumSum; - char Literal; - long Value; - long Oper; - - Oper = GetVexOperValue( Expr ); - - Operand1 = GetVexOperand( Expr->OPERAND ); - Operand2 = GetVexOperand( Expr->OPERAND->NEXT ); - - if ( ( IsVexNodeAtom( Operand1 ) ) && - ( IsVexAtomLiteral( Operand1 ) ) && - ( IsVexNodeAtom( Operand2 ) ) && - ( IsVexAtomLiteral( Operand2 ) ) ) - { - if ( Operand1->WIDTH != Operand2->WIDTH ) - { - if ( Operand1->WIDTH > Operand2->WIDTH ) - { - extendvexatomsign( Operand2, Operand1->WIDTH ); - } - else - { - extendvexatomsign( Operand1, Operand2->WIDTH ); - } - } - - Value1 = GetVexAtomValue( Operand1 ); - Value2 = GetVexAtomValue( Operand2 ); - - Value = ! strcmp( Value1, Value2 ); - - if ( Oper == VEX_NE ) Value = ! Value; - else - if ( Oper != VEX_EQ ) vexerror( VEX_OPERATOR_ERROR, Oper ); - - freevexexpr( Expr ); - - if ( Value ) Expr = createvexatombit( VEX_ATOM_ONE ); - else Expr = createvexatombit( VEX_ATOM_ZERO ); - } - else - if ( ( SimpVexEqual ) && - ( ! IsVexNodeVarWidth( Operand1 ) ) && - ( ! IsVexNodeVarWidth( Operand2 ) ) ) - { - if ( ( Operand1->WIDTH == 1 ) && - ( Operand2->WIDTH == 1 ) ) - { - if ( Oper == VEX_EQ ) SetVexOperValue( Expr, VEX_NXOR ); - else SetVexOperValue( Expr, VEX_XOR ); - - Expr = loc_simpvexbool3( Expr ); - } - else - if ( ( IsVexNodeAtom( Operand1 ) ) && - ( IsVexNodeAtom( Operand2 ) ) ) - { - if ( ( Operand1->WIDTH == Operand2->WIDTH ) || - ( IsVexAtomLiteral( Operand1 ) ) || - ( IsVexAtomLiteral( Operand2 ) ) ) - { - if ( IsVexAtomLiteral( Operand2 ) ) - { - NewExpr = Operand1; - Operand1 = Operand2; - Operand2 = NewExpr; - } - - if ( Operand1->WIDTH != Operand2->WIDTH ) - { - extendvexatomsign( Operand1, Operand2->WIDTH ); - } - - Value1 = GetVexAtomValue( Operand1 ); - Value2 = GetVexAtomValue( Operand2 ); - - if ( Oper == VEX_EQ ) NewExpr = createvexoper( VEX_AND, 1 ); - else NewExpr = createvexoper( VEX_OR , 1 ); - - NumSum = 0; - - for ( ScanPos = 0; ScanPos < Operand2->WIDTH; ScanPos++ ) - { - Index2 = getvexvectorindex( Operand2, ScanPos ); - Atom2 = createvexatomvec( Value2, Index2, Index2 ); - - if ( IsVexAtomLiteral( Operand1 ) ) - { - Literal = Value1[ ScanPos + 1 ]; - - if ( Literal == VEX_DC ) continue; - - XorExpr = Atom2; - - if ( Literal != VEX_ONE ) - { - XorExpr = optimvexnotexpr( XorExpr ); - } - } - else - { - Index1 = getvexvectorindex( Operand1, ScanPos ); - Atom1 = createvexatomvec( Value1, Index1, Index1 ); - - XorExpr = createvexbinexpr( VEX_NXOR, 1, Atom1, Atom2 ); - } - - addvexhexpr( NewExpr, XorExpr ); - - NumSum++; - } - - freevexexpr( Expr ); - - if ( NumSum == 0 ) - { - freevexexpr( NewExpr ); - - if ( Oper == VEX_EQ ) Expr = createvexatomlit( VEX_ATOM_ONE ); - else Expr = createvexatomlit( VEX_ATOM_ZERO ); - } - else - if ( NumSum == 1 ) - { - Expr = GetVexOperand( NewExpr->OPERAND ); - - SetVexOperand( NewExpr->OPERAND, (vexexpr *)0 ); - freevexexpr( NewExpr ); - } - else - { - Expr = NewExpr; - } - } - } - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Arithmetic > 2 Operand | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexarith3( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - chain_list **PrevOper; - chain_list *DelOper; - vexexpr *Operand; - vexexpr *VexInt; - int NumOper; - int NumSum; - long Oper; - long Sum; - long Value; - - Oper = GetVexOperValue( Expr ); - - NumOper = 0; - NumSum = 0; - Sum = 0; - VexInt = (vexexpr *)0; - - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - Operand = GetVexOperand( ScanOper ); - NumOper++; - - if ( evalvexatomlong( Operand, &Value ) != -1 ) - { - SetVexNodeTag( Operand ); - - if ( NumSum == 0 ) - { - Sum = Value; - VexInt = Operand; - } - else - { - if ( Oper == VEX_ADD ) Sum += Value; - else - if ( Oper == VEX_MUL ) Sum *= Value; - else - vexerror( VEX_OPERATOR_ERROR, Oper ); - } - - NumSum++; - } - } - - if ( NumSum > 1 ) - { - VexInt = createvexatomlong( Sum, 0, IsVexAtomSigned( Expr ) ); - - if ( NumSum == NumOper ) - { - freevexexpr( Expr ); - - Expr = VexInt; - } - else - { - PrevOper = &Expr->OPERAND; - ScanOper = Expr->OPERAND; - - while ( ScanOper != (chain_list *)0 ) - { - Operand = GetVexOperand( ScanOper ); - - if ( IsVexNodeTag( Operand ) ) - { - *PrevOper = ScanOper->NEXT; - DelOper = ScanOper; - ScanOper = ScanOper->NEXT; - - DelOper->NEXT = (chain_list *)0; - freechain( DelOper ); - - freevexexpr( Operand ); - } - else - { - PrevOper = &ScanOper->NEXT; - ScanOper = ScanOper->NEXT; - } - } - - addvexhexpr( Expr, VexInt ); - } - } - else - if ( NumSum == 1 ) - { - ClearVexNodeTag( VexInt ); - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Arithmetic 2 Operands | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexarith2( Expr ) - - vexexpr *Expr; -{ - vexexpr *Operand1; - vexexpr *Operand2; - vexexpr *VexInt; - long Value1; - long Value2; - long Value; - long Oper; - - Oper = GetVexOperValue( Expr ); - Value = 0; - - Operand1 = GetVexOperand( Expr->OPERAND ); - Operand2 = GetVexOperand( Expr->OPERAND->NEXT ); - - if ( ( evalvexatomlong( Operand1, &Value1 ) != -1 ) && - ( evalvexatomlong( Operand2, &Value2 ) != -1 ) ) - { - if ( Oper == VEX_SUB ) - { - Value = Value1 - Value2; - } - else - if ( Oper == VEX_EXP ) - { - if ( Value1 != 2 ) vexerror( VEX_OPERATOR_ERROR, Oper ); - - if ( Value2 == 0 ) Value = 1; - else - if ( Value2 < 0 ) Value = 0; - else - Value = 2L << (Value2 - 1); - } - else - if ( Oper == VEX_MOD ) - { - if ( ( ( Value1 > 0 ) && - ( Value2 > 0 ) ) || - ( ( Value1 < 0 ) && - ( Value2 < 0 ) ) ) - { - Value = Value1 % Value2; - } - else - if ( Value1 < 0 ) - { - Value = -((-Value1) % Value2); - } - else - { - Value = -(Value1 % (-Value2)); - } - } - else - if ( Oper == VEX_REM ) - { - Value = Value1 % Value2; - } - else - if ( Oper == VEX_DIV ) - { - if ( Value2 == 0 ) vexerror( VEX_OPERATOR_ERROR, Oper ); - - Value = Value1 / Value2; - } - else vexerror( VEX_OPERATOR_ERROR, Oper ); - - VexInt = createvexatomlong( Value, 0, IsVexAtomSigned( Expr ) ); - - freevexexpr( Expr ); Expr = VexInt; - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Number Bit | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexnumbit( Expr ) - - vexexpr *Expr; -{ - vexexpr *Operand1; - vexexpr *Operand2; - long Value1; - long Value2; - int Size; - - Operand1 = GetVexOperand( Expr->OPERAND ); - Operand2 = GetVexOperand( Expr->OPERAND->NEXT ); - - if ( ( evalvexatomlong( Operand1, &Value1 ) != -1 ) && - ( evalvexatomlong( Operand2, &Value2 ) != -1 ) ) - { - Size = getvexintervalnumbit( Value1, Value2 ); - - freevexexpr( Expr ); - Expr = createvexatomlong( Size - 1, 0, 0 ); - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Slice | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexslice( Expr ) - - vexexpr *Expr; -{ - vexexpr *Atom; - vexexpr *Operand1; - vexexpr *Operand2; - long Oper; - long Value1; - long Value2; - char *Value; - - Oper = GetVexOperValue( Expr ); - Atom = GetVexOperand( Expr->OPERAND ); - Operand1 = GetVexOperand( Expr->OPERAND->NEXT ); - - if ( Oper != VEX_INDEX ) - { - Operand2 = GetVexOperand( Expr->OPERAND->NEXT->NEXT ); - } - else - { - Operand2 = Operand1; - } - - if ( ( IsVexNodeAtom( Atom ) ) && - ( evalvexatomlong( Operand1, &Value1 ) != -1 ) && - ( evalvexatomlong( Operand2, &Value2 ) != -1 ) ) - { - if ( ( Oper == VEX_TO ) || - ( Oper == VEX_DOWNTO ) || - ( Oper == VEX_INDEX ) ) - { - if ( ( Value1 < 0 ) || - ( Value2 < 0 ) ) - { - vexerror( VEX_OPERATOR_ERROR, Oper ); - } - - if ( ( ( Oper == VEX_TO ) && - ( Value1 > Value2 ) ) || - ( ( Oper == VEX_DOWNTO ) && - ( Value1 < Value2 ) ) ) - { - vexerror( VEX_OPERATOR_ERROR, Oper ); - } - - Value = GetVexAtomValue( Atom ); - freevexexpr( Expr ); - Expr = createvexatomvec( Value, Value1, Value2 ); - } - else vexerror( VEX_OPERATOR_ERROR, Oper ); - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Expr | -| | -\------------------------------------------------------------*/ - -static vexexpr *loc_simpvexexpr( Expr ) - - vexexpr *Expr; -{ - vexexpr *Operand; - chain_list *ScanOper; - long Oper; - - if ( ! IsVexNodeAtom( Expr ) ) - { - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - Operand = loc_simpvexexpr( GetVexOperand( ScanOper ) ); - SetVexOperand( ScanOper, Operand ); - } - - if ( IsVexNodeOper( Expr ) ) - { - Oper = GetVexOperValue( Expr ); - - if ( Oper < VEX_MAX_OPERATOR ) - { - Expr = (*SimpFuncArray[ Oper ])( Expr ); - } - else - vexerror( VEX_OPERATOR_ERROR, Oper ); - } - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Expr | -| | -\------------------------------------------------------------*/ - -vexexpr *simpvexexpr( Expr ) - - vexexpr *Expr; -{ - if ( Expr != (vexexpr *)0 ) - { - Expr = loc_simpvexexpr( Expr ); - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Expr Equal | -| | -\------------------------------------------------------------*/ - -vexexpr *simpvexexpreq( Expr ) - - vexexpr *Expr; -{ - if ( Expr != (vexexpr *)0 ) - { - SimpVexEqual = 1; - Expr = loc_simpvexexpr( Expr ); - SimpVexEqual = 0; - } - - return( Expr ); -} - -/*------------------------------------------------------------\ -| | -| Simplify Vex Expr Others | -| | -\------------------------------------------------------------*/ - -vexexpr *simpvexexprothers( Expr, Width ) - - vexexpr *Expr; - short Width; -{ - vexexpr *Operand; - vexexpr *VexAtom; - chain_list *ScanOper; - char *Value; - short ScanWidth; - long Oper; - - if ( ( Width >= 0 ) && - ( Expr != (vexexpr *)0 ) ) - { - if ( IsVexNodeOper( Expr ) ) - { - Oper = GetVexOperValue( Expr ); - - if ( Oper == VEX_OTHERS ) - { - Operand = GetVexOperand( Expr->OPERAND ); - - if ( ( IsVexNodeAtom( Operand ) ) && - ( IsVexAtomLiteral( Operand ) ) ) - { - Value = GetVexAtomValue( Operand ); - VexAtom = createvexatomveclit( Value[ 1 ], Width ); - - freevexexpr( Expr ); - Expr = VexAtom; - } - } - else - if ( Oper == VEX_CONCAT ) - { - ScanWidth = 0; - - for ( ScanOper = Expr->OPERAND; - ScanOper->NEXT != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - Operand = GetVexOperand( ScanOper ); - ScanWidth += Operand->WIDTH; - } - - Operand = GetVexOperand( ScanOper ); - Operand = simpvexexprothers( Operand, Width - ScanWidth ); - SetVexOperand( ScanOper, Operand ); - } - } - } - - return( Expr ); -} diff --git a/alliance/src/vex/src/vexsimp.h b/alliance/src/vex/src/vexsimp.h deleted file mode 100644 index 424ad293..00000000 --- a/alliance/src/vex/src/vexsimp.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexsimp.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef ABL_SIMP_H -# define ABL_SIMP_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexslice.c b/alliance/src/vex/src/vexslice.c deleted file mode 100644 index 3d1eecdb..00000000 --- a/alliance/src/vex/src/vexslice.c +++ /dev/null @@ -1,162 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexslice.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include -# include "vexslice.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static char VexBuffer[ 128 ]; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Slice Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Slice Vex Atom Vector | -| | -\------------------------------------------------------------*/ - -vexexpr *slicevexatomvec( Expr, Left, Right ) - - vexexpr *Expr; - short Left; - short Right; -{ - short Width; - short PosLeft; - short PosRight; - short PosMin; - short PosMax; - char Separ; - -/*\ -fprintf( stdout, "slicevexatomvec %d %d\n", Left, Right ); -viewvexexprbound( Expr ); -fprintf( stdout, " --> " ); -\*/ - - if ( ( IsVexNodeAtom( Expr ) ) && - ( IsVexAtomVector( Expr ) ) ) - { - PosLeft = getvexvectorpos( Expr, Left ); - PosRight = getvexvectorpos( Expr, Right ); - - if ( ( PosLeft >= 0 ) && - ( PosRight >= 0 ) ) - { - if ( Left < Right ) - { - Width = 1 + Right - Left; - SetVexAtomUp( Expr ); - } - else - { - Width = 1 + Left - Right; - SetVexAtomDown( Expr ); - } - - if ( IsVexAtomLiteral( Expr ) ) - { - if ( Width == 1 ) Separ = '\''; - else Separ = '"'; - - if ( PosLeft > PosRight ) - { - PosMin = PosRight; - PosMax = PosLeft; - } - else - { - PosMin = PosLeft; - PosMax = PosRight; - } - - strcpy( VexBuffer, GetVexAtomValue( Expr ) ); - VexBuffer[ PosMin ] = Separ; - VexBuffer[ PosMax + 2 ] = Separ; - VexBuffer[ PosMax + 3 ] = '\0'; - - SetVexAtomValue( Expr, namealloc( &VexBuffer[ PosMin ] ) ); - } - - Expr->LEFT = Left; - Expr->RIGHT = Right; - Expr->WIDTH = Width; -/*\ -viewvexexprbound( Expr ); -fprintf( stdout, "\n" ); -\*/ - return( Expr ); - } - } - - return( (vexexpr *)0 ); -} diff --git a/alliance/src/vex/src/vexslice.h b/alliance/src/vex/src/vexslice.h deleted file mode 100644 index ba50f7a8..00000000 --- a/alliance/src/vex/src/vexslice.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexslice.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_SLICE_H -# define VEX_SLICE_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexunflat.c b/alliance/src/vex/src/vexunflat.c deleted file mode 100644 index e5fad9d5..00000000 --- a/alliance/src/vex/src/vexunflat.c +++ /dev/null @@ -1,142 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexunflat.c | -| | -| Date : 03.12.99 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include "vexunflat.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Unflat Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Unflat Vex Expr | -| | -\------------------------------------------------------------*/ - -vexexpr *unflatvexexpr( Expr ) - - vexexpr *Expr; -{ - vexexpr *ScanExpr; - chain_list *ScanChain; - long Oper; - - if ( ( Expr == (vexexpr *)0 ) || - ( IsVexNodeAtom( Expr ) ) ) - { - return( Expr ); - } - - - if ( IsVexNodeOper( Expr ) ) - { - Oper = GetVexOperValue( Expr ); - - if ( ( Oper == VEX_OR ) || - ( Oper == VEX_AND ) || - ( Oper == VEX_XOR ) || - ( Oper == VEX_NOR ) || - ( Oper == VEX_NAND ) || - ( Oper == VEX_NXOR ) || - ( Oper == VEX_ADD ) || - ( Oper == VEX_MUL ) ) - { - if ( Expr->OPERAND->NEXT->NEXT != (chain_list *)0 ) - { - if ( isvexnegativeoper( Oper ) ) - { - Oper = getvexnotoper( Oper ); - SetVexOperValue( Expr, Oper ); - - ScanExpr = createvexoper( VEX_NOT, Expr->WIDTH ); - addvexhexpr( ScanExpr, Expr ); - Expr = ScanExpr; - } - else - { - ScanExpr = createvexoper( Oper, Expr->WIDTH ); - ScanExpr->OPERAND = Expr->OPERAND->NEXT; - Expr->OPERAND->NEXT = addchain( (chain_list *)0, (void *)ScanExpr ); - } - } - } - } - - for ( ScanChain = Expr->OPERAND; - ScanChain != (chain_list *)0; - ScanChain = ScanChain->NEXT ) - { - ScanExpr = GetVexOperand( ScanChain ); - ScanExpr = unflatvexexpr( ScanExpr ); - SetVexOperand( ScanChain, ScanExpr ); - } - - return( Expr ); -} diff --git a/alliance/src/vex/src/vexunflat.h b/alliance/src/vex/src/vexunflat.h deleted file mode 100644 index 0f996715..00000000 --- a/alliance/src/vex/src/vexunflat.h +++ /dev/null @@ -1,75 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexunflat.h | -| | -| Date : 03.12.99 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_UNFLAT_H -# define VEX_UNFLAT_H - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif diff --git a/alliance/src/vex/src/vexview.c b/alliance/src/vex/src/vexview.c deleted file mode 100644 index 936a1486..00000000 --- a/alliance/src/vex/src/vexview.c +++ /dev/null @@ -1,586 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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 : Vex | -| | -| File : vexview.c | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -| Modified: Frédéric Pétrot | -| Add support for Verilog expressions | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Include Files | -| | -\------------------------------------------------------------*/ - -# include "mut.h" -# include "aut.h" -# include "vex.h" - -# include -# include -# include "vexview.h" -# include "vexerror.h" - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Variables | -| | -\------------------------------------------------------------*/ - - static FILE *VexViewFile = (FILE *)0; - static int VexViewLength = 0; - static void (*VexViewFunction)(); - - static char *VexStringBuffer = (char *)0; - static int VexStringSize = 0; - static int VexStringLength = 0; - static int VexViewBound = 0; - static int VexViewLanguage = VEX_VIEW_VHDL; - -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| View Functions | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| View Local Vex File | -| | -\------------------------------------------------------------*/ - -static void loc_viewvexfile( String, Length ) - - char *String; - int Length; -{ - VexViewLength += Length; - - if ( VexViewLength >= VEX_VIEW_MAX_LENGTH ) - { - fprintf( VexViewFile, "\n" ); - VexViewLength = 0; - } - - if ( *String ) - { - fwrite( String, sizeof( char ), Length, VexViewFile ); - } -} - -/*------------------------------------------------------------\ -| | -| View Local Vex String | -| | -\------------------------------------------------------------*/ - -static void loc_viewvexstr( String, Length ) - - char *String; - int Length; -{ - char *Buffer; - - if ( ( VexStringLength + Length ) >= VexStringSize ) - { - VexStringSize = VexStringSize << 1; - Buffer = (char *)autallocblock( VexStringSize ); - strcpy( Buffer, VexStringBuffer ); - autfreeblock( VexStringBuffer ); - VexStringBuffer = Buffer; - } - - VexViewLength += Length; - - if ( VexViewLength >= VEX_VIEW_MAX_LENGTH ) - { - VexViewLength = 0; - loc_viewvexstr( "\n", 1 ); - } - - strcpy( VexStringBuffer + VexStringLength, String ); - VexStringLength += Length; -} - -/*------------------------------------------------------------\ -| | -| View Local Expr Vhdl All | -| | -\------------------------------------------------------------*/ - -static void loc_viewvexexprbound( Expr ) - - vexexpr *Expr; -{ - char Buffer[ 32 ]; - char Signed; - - if ( IsVexNodeSigned( Expr ) ) Signed = 's'; - else Signed = 'u'; - - if ( IsVexNodeVarWidth( Expr ) ) - { - sprintf( Buffer, "{?:?:?:%c}", Signed ); - } - else - { - sprintf( Buffer, "{%d:%d:%d:%c}", Expr->LEFT, Expr->RIGHT, Expr->WIDTH, Signed ); - } - - (*VexViewFunction)( Buffer, strlen( Buffer ) ); -} - -/*------------------------------------------------------------\ -| | -| View Local Expr Vhdl Atom | -| | -\------------------------------------------------------------*/ - -static void loc_viewvexatom( Expr ) - - vexexpr *Expr; -{ - char *String; - char Buffer[ 32 ]; - int Index; - - switch (VexViewLanguage) - { - case VEX_VIEW_VHDL: - String = GetVexAtomValue( Expr ); - (*VexViewFunction)( String, strlen( String ) ); - break; - - case VEX_VIEW_VERILOG: - String = GetVexAtomValue( Expr ); - if ( IsVexAtomLiteral ( Expr ) ) - { - sprintf( Buffer, "%d'b", Expr->WIDTH ); - (*VexViewFunction)( Buffer, strlen( Buffer ) ); - - for ( Index = 1; - Index < strlen ( String ) - 1; - Index++ ) - { - if ( String[ Index ] == '-' ) - { - (*VexViewFunction)( "?", 1 ); - } - else - { - (*VexViewFunction)( String + Index, 1 ); - } - } - } - else - { - (*VexViewFunction)( String, strlen( String ) ); - } - break; - } - - if ( VexViewBound ) - { - loc_viewvexexprbound( Expr ); - } - - if ( ( IsVexAtomVector( Expr ) ) && - ( ! IsVexAtomLiteral( Expr ) ) ) - { - if ( IsVexNodeVarWidth( Expr ) ) - { - switch (VexViewLanguage) - { - case VEX_VIEW_VHDL: - strcpy( Buffer, "(??)" ); - break; - - case VEX_VIEW_VERILOG: - strcpy( Buffer, "[??]" ); - break; - } - } - else - if ( Expr->LEFT == Expr->RIGHT ) - { - switch (VexViewLanguage) - { - case VEX_VIEW_VHDL: - sprintf( Buffer, "(%d)", Expr->LEFT ); - break; - - case VEX_VIEW_VERILOG: - sprintf( Buffer, "[%d]", Expr->LEFT ); - break; - } - } - else - { - switch (VexViewLanguage) - { - case VEX_VIEW_VHDL: - if ( Expr->LEFT < Expr->RIGHT ) - { - sprintf( Buffer, "(%d to %d)", Expr->LEFT, Expr->RIGHT ); - } - else - { - sprintf( Buffer, "(%d downto %d)", Expr->LEFT, Expr->RIGHT ); - } - break; - - case VEX_VIEW_VERILOG: - sprintf( Buffer, "[%d:%d]", Expr->LEFT, Expr->RIGHT ); - break; - } - } - - (*VexViewFunction)( Buffer, strlen( Buffer ) ); - } -} - -/*------------------------------------------------------------\ -| | -| View Local Expr Vhdl | -| | -\------------------------------------------------------------*/ - -static void loc_viewvex( Expr ) - - vexexpr *Expr; -{ - chain_list *ScanOper; - long Oper; - char *String; - int Length; - - if ( IsVexNodeAtom( Expr ) ) - { - loc_viewvexatom( Expr ); - } - else - if ( IsVexNodeOper( Expr ) ) - { - Oper = GetVexOperValue( Expr ); - String = (char *)0; - - switch (VexViewLanguage) - { - case VEX_VIEW_VHDL: - String = getvexoperuppername( Oper ); - break; - - case VEX_VIEW_VERILOG: - String = getvexoperverilogname( Oper ); - break; - } - - if ( String == (char *)0 ) - { - vexerror( VEX_OPERATOR_ERROR, Oper ); - } - - Length = strlen( String ); - - if ( VexViewBound ) - { - loc_viewvexexprbound( Expr ); - } - - if ( isvexunaryoper( Oper ) ) - { - if ( ( Oper == VEX_EVENT ) || - ( Oper == VEX_DRIVER ) ) - { - (*VexViewFunction)( "(", 1 ); - - loc_viewvex( GetVexOperand( Expr->OPERAND ) ); - - (*VexViewFunction)( "'", 1 ); - (*VexViewFunction)( String, Length ); - } - else - { - (*VexViewFunction)( String, Length ); - (*VexViewFunction)( "(", 1 ); - - loc_viewvex( GetVexOperand( Expr->OPERAND ) ); - } - } - else - { - if ( ( VexViewBound ) || - ( isvexpositiveoper( Oper ) ) ) - { - if ( Oper == VEX_CONCAT && VexViewLanguage == VEX_VIEW_VERILOG ) - { - (*VexViewFunction)( "{", 1 ); - } - else - { - (*VexViewFunction)( "(", 1 ); - } - } - else - { - switch (VexViewLanguage) - { - case VEX_VIEW_VHDL: - (*VexViewFunction)( "NOT(", 4 ); - String = getvexoperuppername( getvexnotoper( Oper ) ); - break; - - case VEX_VIEW_VERILOG: - (*VexViewFunction)( "~(", 2 ); - String = getvexoperverilogname( getvexnotoper( Oper ) ); - break; - } - Length = strlen( String ); - } - - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - loc_viewvex( GetVexOperand( ScanOper ) ); - - if ( ScanOper->NEXT != (chain_list *)0 ) - { - (*VexViewFunction)( " ", 1 ); - (*VexViewFunction)( String, Length ); - (*VexViewFunction)( " ", 1 ); - } - } - } - - if ( Oper == VEX_CONCAT && VexViewLanguage == VEX_VIEW_VERILOG ) - { - (*VexViewFunction)( "}", 1 ); - } - else - { - (*VexViewFunction)( ")", 1 ); - } - } - else - { - String = GetVexFuncValue( Expr ); - Length = strlen( String ); - - if ( VexViewBound ) - { - if ( getvexstdfuncid( String ) != -1 ) - { - (*VexViewFunction)( "(std)", 5 ); - } - - loc_viewvexexprbound( Expr ); - } - - (*VexViewFunction)( String, Length ); - (*VexViewFunction)( "(", 1 ); - - for ( ScanOper = Expr->OPERAND; - ScanOper != (chain_list *)0; - ScanOper = ScanOper->NEXT ) - { - loc_viewvex( GetVexOperand( ScanOper ) ); - - if ( ScanOper->NEXT != (chain_list *)0 ) - { - (*VexViewFunction)( ",", 1 ); - } - } - - (*VexViewFunction)( ")", 1 ); - } -} - -/*------------------------------------------------------------\ -| | -| View Vex Expr File | -| | -\------------------------------------------------------------*/ - -void viewvexexprfile( VexFile, Expr ) - - FILE *VexFile; - vexexpr *Expr; -{ - VexViewFile = VexFile; - VexViewLength = 0; - VexViewFunction = loc_viewvexfile; - - if ( Expr != (vexexpr *)0 ) loc_viewvex( Expr ); -} - -/*------------------------------------------------------------\ -| | -| View Vex Expr | -| | -\------------------------------------------------------------*/ - -void viewvexexpr( Expr ) - - vexexpr *Expr; -{ - viewvexexprfile( stdout, Expr ); -} - -/*------------------------------------------------------------\ -| | -| View Vex Expr NewLine | -| | -\------------------------------------------------------------*/ - -void viewvexexprln( Expr ) - - vexexpr *Expr; -{ - viewvexexprfile( stdout, Expr ); - fprintf( stdout, "\n" ); -} - -/*------------------------------------------------------------\ -| | -| View Vex Expr Bound | -| | -\------------------------------------------------------------*/ - -void viewvexexprbound( Expr ) - - vexexpr *Expr; -{ - VexViewBound = 1; - viewvexexprfile( stdout, Expr ); - VexViewBound = 0; -} - -/*------------------------------------------------------------\ -| | -| View Vex Expr Bound NewLine | -| | -\------------------------------------------------------------*/ - -void viewvexexprboundln( Expr ) - - vexexpr *Expr; -{ - VexViewBound = 1; - viewvexexprfile( stdout, Expr ); - fprintf( stdout, "\n" ); - VexViewBound = 0; -} - -/*------------------------------------------------------------\ -| | -| View Vex Expr String | -| | -\------------------------------------------------------------*/ - -char *viewvexexprstr( Expr ) - - vexexpr *Expr; -{ - if ( VexStringBuffer == (char *)0 ) - { - VexStringBuffer = (char *)autallocblock( VEX_STRING_BUFFER_SIZE ); - VexStringSize = VEX_STRING_BUFFER_SIZE; - } - - VexStringLength = 0; - VexStringBuffer[ 0 ] = '\0'; - - VexViewLength = 0; - VexViewFunction = loc_viewvexstr; - - if ( Expr != (vexexpr *)0 ) loc_viewvex( Expr ); - - return( VexStringBuffer ); -} - -/*------------------------------------------------------------\ -| | -| View Vex Expr String Bound | -| | -\------------------------------------------------------------*/ - -char *viewvexexprstrbound( Expr ) - - vexexpr *Expr; -{ - VexViewBound = 1; - viewvexexprstr( Expr ); - VexViewBound = 0; - - return( VexStringBuffer ); -} - -/*------------------------------------------------------------\ -| | -| Set View Mode | -| | -\------------------------------------------------------------*/ - -void setvexviewmode( Mode ) - - int Mode; -{ - VexViewLanguage = Mode; -} - -/*------------------------------------------------------------\ -| | -| Get View Mode | -| | -\------------------------------------------------------------*/ - -int getvexviewmode() -{ - return( VexViewLanguage ); -} diff --git a/alliance/src/vex/src/vexview.h b/alliance/src/vex/src/vexview.h deleted file mode 100644 index 9437bb4d..00000000 --- a/alliance/src/vex/src/vexview.h +++ /dev/null @@ -1,79 +0,0 @@ -/*------------------------------------------------------------\ -| | -| This file is part of the Alliance CAD System Copyright | -| (C) Laboratoire LIP6 - Département ASIM Universite P&M 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 Library 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. | -| | -\------------------------------------------------------------*/ -#ifndef __P -# if defined(__STDC__) || defined(__GNUC__) -# define __P(x) x -# else -# define __P(x) () -# endif -#endif -/*------------------------------------------------------------\ -| | -| Tool : Vex | -| | -| File : vexview.h | -| | -| Date : 03.12.96 | -| | -| Author : Jacomme Ludovic | -| | -\------------------------------------------------------------*/ - -# ifndef VEX_VIEW_H -# define VEX_VIEW_H - -/*------------------------------------------------------------\ -| | -| Constants | -| | -\------------------------------------------------------------*/ - -# define VEX_VIEW_MAX_LENGTH 80 -# define VEX_STRING_BUFFER_SIZE 512 - -/*------------------------------------------------------------\ -| | -| Macro | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Types | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Varivexes | -| | -\------------------------------------------------------------*/ -/*------------------------------------------------------------\ -| | -| Functions | -| | -\------------------------------------------------------------*/ - -# endif