From 69af127fa0ee2aa2e631cb1b36002ae4dfda70c5 Mon Sep 17 00:00:00 2001 From: Ludovic Jacomme Date: Thu, 21 Mar 2002 12:23:28 +0000 Subject: [PATCH] Hello --- alliance/src/rtn/Makefile.am | 1 + alliance/src/rtn/configure.in | 45 ++ alliance/src/rtn/src/Makefile.am | 8 + alliance/src/rtn/src/main.c | 164 ++++++++ alliance/src/rtn/src/rtn.h | 542 ++++++++++++++++++++++++ alliance/src/rtn/src/rtnadd.c | 685 +++++++++++++++++++++++++++++++ alliance/src/rtn/src/rtnadd.h | 75 ++++ alliance/src/rtn/src/rtnalloc.c | 227 ++++++++++ alliance/src/rtn/src/rtnalloc.h | 75 ++++ alliance/src/rtn/src/rtndel.c | 365 ++++++++++++++++ alliance/src/rtn/src/rtndel.h | 75 ++++ alliance/src/rtn/src/rtnerror.c | 150 +++++++ alliance/src/rtn/src/rtnerror.h | 92 +++++ alliance/src/rtn/src/rtnfree.c | 260 ++++++++++++ alliance/src/rtn/src/rtnfree.h | 75 ++++ alliance/src/rtn/src/rtnget.c | 125 ++++++ alliance/src/rtn/src/rtnget.h | 75 ++++ alliance/src/rtn/src/rtnsearch.c | 288 +++++++++++++ alliance/src/rtn/src/rtnsearch.h | 75 ++++ alliance/src/rtn/src/rtnview.c | 648 +++++++++++++++++++++++++++++ alliance/src/rtn/src/rtnview.h | 75 ++++ 21 files changed, 4125 insertions(+) create mode 100644 alliance/src/rtn/Makefile.am create mode 100644 alliance/src/rtn/configure.in create mode 100644 alliance/src/rtn/src/Makefile.am create mode 100644 alliance/src/rtn/src/main.c create mode 100644 alliance/src/rtn/src/rtn.h create mode 100644 alliance/src/rtn/src/rtnadd.c create mode 100644 alliance/src/rtn/src/rtnadd.h create mode 100644 alliance/src/rtn/src/rtnalloc.c create mode 100644 alliance/src/rtn/src/rtnalloc.h create mode 100644 alliance/src/rtn/src/rtndel.c create mode 100644 alliance/src/rtn/src/rtndel.h create mode 100644 alliance/src/rtn/src/rtnerror.c create mode 100644 alliance/src/rtn/src/rtnerror.h create mode 100644 alliance/src/rtn/src/rtnfree.c create mode 100644 alliance/src/rtn/src/rtnfree.h create mode 100644 alliance/src/rtn/src/rtnget.c create mode 100644 alliance/src/rtn/src/rtnget.h create mode 100644 alliance/src/rtn/src/rtnsearch.c create mode 100644 alliance/src/rtn/src/rtnsearch.h create mode 100644 alliance/src/rtn/src/rtnview.c create mode 100644 alliance/src/rtn/src/rtnview.h diff --git a/alliance/src/rtn/Makefile.am b/alliance/src/rtn/Makefile.am new file mode 100644 index 00000000..af437a64 --- /dev/null +++ b/alliance/src/rtn/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = src diff --git a/alliance/src/rtn/configure.in b/alliance/src/rtn/configure.in new file mode 100644 index 00000000..ca718075 --- /dev/null +++ b/alliance/src/rtn/configure.in @@ -0,0 +1,45 @@ +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/21 12:23:28 ludo Exp $ +dnl +dnl +AC_INIT(src/rtn.h) +AM_INIT_AUTOMAKE(rtn, 1.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/rtn/src/Makefile.am b/alliance/src/rtn/src/Makefile.am new file mode 100644 index 00000000..393269b4 --- /dev/null +++ b/alliance/src/rtn/src/Makefile.am @@ -0,0 +1,8 @@ +CFLAGS = @CFLAGS@ \ + -DALLIANCE_TOP=\"${ALLIANCE_TOP}\" +lib_LIBRARIES = libRtn.a +include_HEADERS = rtn.h +libRtn_a_SOURCES = \ +rtnadd.h rtndel.c rtnerror.h rtnget.c rtnsearch.h \ +rtn.h rtnalloc.c rtndel.h rtnfree.c rtnget.h rtnview.c \ +rtnadd.c rtnalloc.h rtnerror.c rtnfree.h rtnsearch.c rtnview.h diff --git a/alliance/src/rtn/src/main.c b/alliance/src/rtn/src/main.c new file mode 100644 index 00000000..aa6739b2 --- /dev/null +++ b/alliance/src/rtn/src/main.c @@ -0,0 +1,164 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtn | +| | +| File : main.c | +| | +| Date : 08.02.95 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include + +# include "mut.h" +# include "aut.h" +# include "vex.h" +# include "rtn.h" +# include "rtd.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Usage | +| | +\------------------------------------------------------------*/ + +void RtlUsage() +{ + fprintf( stderr, "\t\trtntest [Options] Input_name [Output_name]\n\n" ); + fprintf( stdout, "\t\tOptions : -V Sets Verbose mode on\n" ); + fprintf( stdout, "\t\t -S Saves Rtl figure\n" ); + fprintf( stdout, "\n" ); + + exit( 1 ); +} + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +int main( argc, argv ) + + int argc; + char *argv[]; +{ + rtlfig_list *RtlFigure; + char *InputFileName; + char *OutputFileName; + int Number; + int Index; + char Option; + + int FlagVerbose = 0; + int FlagSave = 0; + + mbkenv(); + autenv(); + vexenv(); + rtlenv(); + + InputFileName = (char *)0; + OutputFileName = (char *)0; + + if ( argc < 2 ) RtlUsage(); + + InputFileName = (char *)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 'V' : FlagVerbose = 1; + break; + case 'S' : FlagSave = 1; + break; + default : RtlUsage(); + } + } + } + else + if ( InputFileName == (char *)0 ) InputFileName = argv[ Number ]; + else + if ( OutputFileName == (char *)0 ) OutputFileName = argv[ Number ]; + else + RtlUsage(); + } + + if ( InputFileName == (char *)0 ) RtlUsage(); + if ( OutputFileName == (char *)0 ) OutputFileName = InputFileName; + + if ( ( FlagSave ) && ( InputFileName == OutputFileName ) ) + { + RtlUsage(); + } + + RtlFigure = getrtlfig( InputFileName ); + + if ( FlagVerbose ) viewrtlfig( RtlFigure ); + + if ( FlagSave ) + { + RtlFigure->NAME = namealloc( OutputFileName ); + savertlfig( RtlFigure ); + } + + delrtlfig( RtlFigure->NAME ); + + return( 0 ); +} diff --git a/alliance/src/rtn/src/rtn.h b/alliance/src/rtn/src/rtn.h new file mode 100644 index 00000000..e99f7235 --- /dev/null +++ b/alliance/src/rtn/src/rtn.h @@ -0,0 +1,542 @@ +/*------------------------------------------------------------\ +| | +| 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 : RTL | +| | +| File : rtn101.h | +| | +| Author : Jacomme Ludovic | +| | +| Date : 25.08.97 | +| | +\------------------------------------------------------------*/ + +# ifndef RTN_101_H +# define RTN_101_H + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl Direction | +| | +\------------------------------------------------------------*/ + +# define RTL_DIR_IN 0 +# define RTL_DIR_OUT 1 +# define RTL_DIR_INOUT 2 +# define RTL_MAX_DIR_TYPE 3 + +/*------------------------------------------------------------\ +| | +| Rtl Kind | +| | +\------------------------------------------------------------*/ + +# define RTL_KIND_NONE 0 +# define RTL_KIND_BUS 1 +# define RTL_KIND_REGISTER 2 +# define RTL_MAX_KIND_TYPE 3 + +/*------------------------------------------------------------\ +| | +| Rtl Declar Type | +| | +\------------------------------------------------------------*/ + +# define RTL_DECLAR_PORT 0 +# define RTL_DECLAR_SIGNAL 1 +# define RTL_DECLAR_CONSTANT 2 +# define RTL_DECLAR_GENERIC 3 +# define RTL_MAX_DECLAR_TYPE 4 + +/*------------------------------------------------------------\ +| | +| Rtl Assgin Type | +| | +\------------------------------------------------------------*/ + +# define RTL_ASG_COMBINATORIAL 0 +# define RTL_ASG_MULTIPLEXOR 1 +# define RTL_ASG_CONDITIONAL 2 +# define RTL_ASG_REGISTER 3 +# define RTL_ASG_TRISTATE 4 +# define RTL_ASG_PULL_UP 5 +# define RTL_ASG_PULL_DOWN 6 +# define RTL_MAX_ASG_TYPE 7 + +/*------------------------------------------------------------\ +| | +| Rtl Assgin Register Type | +| | +\------------------------------------------------------------*/ + +# define RTL_ASG_REGISTER_NONE 0 +# define RTL_ASG_REGISTER_SYNC 1 +# define RTL_ASG_REGISTER_ASYNC 2 +# define RTL_ASG_REGISTER_MIXED 3 +# define RTL_MAX_ASG_REGISTER_TYPE 4 + +/*------------------------------------------------------------\ +| | +| Rtl Bi Vex Type | +| | +\------------------------------------------------------------*/ + +# define RTL_BIVEX_NONE 0 +# define RTL_BIVEX_FALLING_EDGE 1 +# define RTL_BIVEX_RISING_EDGE 2 +# define RTL_BIVEX_ASYNC_RESET 3 +# define RTL_BIVEX_ASYNC_SET 4 +# define RTL_BIVEX_ASYNC_WEN 5 +# define RTL_BIVEX_SYNC_RESET 6 +# define RTL_BIVEX_SYNC_SET 7 +# define RTL_BIVEX_SYNC_WEN 8 +# define RTL_BIVEX_MULTIPLEXOR 9 +# define RTL_BIVEX_CONDITIONAL 10 +# define RTL_MAX_BIVEX_TYPE 11 + +/*------------------------------------------------------------\ +| | +| Rtl Fsm Type | +| | +\------------------------------------------------------------*/ + +# define RTL_FSM_STANDARD 0 +# define RTL_FSM_REGOUT 1 +# define RTL_MAX_FSM_TYPE 2 + +/*------------------------------------------------------------\ +| | +| Macro | +| | +\------------------------------------------------------------*/ + +# define GetRtlFsmTrans( C ) ((rtlfsmtrans_list *)((C)->DATA)) + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl Symbol | +| | +\------------------------------------------------------------*/ + + typedef struct rtlsym + { + char *NAME; + struct rtldecl_list *DECL; + short INDEX; + unsigned char INIT; + unsigned char DRIVE; + unsigned char EFFEC; + unsigned char EVENT; + long FLAGS; + void *USER; + + } rtlsym; + +/*------------------------------------------------------------\ +| | +| Rtl Declaration | +| | +\------------------------------------------------------------*/ + + typedef struct rtldecl_list + { + struct rtldecl_list *NEXT; + vexexpr *VEX_ATOM; + vexexpr *VEX_INIT; + rtlsym *DECL_SYM; + unsigned char DIR; + unsigned char TYPE; + unsigned char KIND; + unsigned char BASE; + long FLAGS; + void *USER; + + } rtldecl_list; + +/*------------------------------------------------------------\ +| | +| Rtl Bi Vex | +| | +\------------------------------------------------------------*/ + + typedef struct rtlbivex_list + { + struct rtlbivex_list *NEXT; + unsigned char TYPE; + vexexpr *VEX_COND; + vexexpr *VEX_DATA; + long FLAGS; + void *USER; + + } rtlbivex_list; + +/*------------------------------------------------------------\ +| | +| Rtl Assignment | +| | +\------------------------------------------------------------*/ + + typedef struct rtlasg_list + { + struct rtlasg_list *NEXT; + struct rtlasg_list **PREV; + vexexpr *VEX_ATOM; + vexexpr *VEX_DATA; + rtlbivex_list *BIVEX; + rtlbivex_list **LAST_BIVEX; + unsigned char TYPE; + unsigned char REG_TYPE; + long FLAGS; + void *USER; + + } rtlasg_list; + +/*------------------------------------------------------------\ +| | +| Rtl Fsm Assignment | +| | +\------------------------------------------------------------*/ + + typedef struct rtlfsmasg_list + { + struct rtlfsmasg_list *NEXT; + vexexpr *VEX_ATOM; + vexexpr *VEX_DATA; + long FLAGS; + void *USER; + + } rtlfsmasg_list; + +/*------------------------------------------------------------\ +| | +| Rtl Fsm State | +| | +\------------------------------------------------------------*/ + + typedef struct rtlfsmstate_list + { + struct rtlfsmstate_list *NEXT; + char *NAME; + chain_list *FROM; + chain_list *TO; + rtlfsmasg_list *ASSIGN; + long FLAGS; + void *USER; + + } rtlfsmstate_list; + +/*------------------------------------------------------------\ +| | +| Rtl Fsm Transition | +| | +\------------------------------------------------------------*/ + + typedef struct rtlfsmtrans_list + { + struct rtlfsmtrans_list *NEXT; + struct rtlfsmstate_list *FROM; + struct rtlfsmstate_list *TO; + rtlfsmasg_list *ASSIGN; + vexexpr *VEX_COND; + long FLAGS; + void *USER; + + } rtlfsmtrans_list; + +/*------------------------------------------------------------\ +| | +| Rtl Fsm | +| | +\------------------------------------------------------------*/ + + typedef struct rtlfsm_list + { + struct rtlfsm_list *NEXT; + char *NAME; + rtlfsmstate_list *STATE; + rtlfsmtrans_list *TRANS; + authtable *HASH_STATE; + rtlbivex_list *BIVEX; + rtlbivex_list **LAST_BIVEX; + unsigned char TYPE; + long FLAGS; + void *USER; + + } rtlfsm_list; + +/*------------------------------------------------------\ +| | +| Rtl Model | +| | +\------------------------------------------------------*/ + + typedef struct rtlgen_list + { + struct rtlgen_list *NEXT; + vexexpr *VEX_ATOM; + vexexpr *VEX_EXPR; + unsigned char BASE; + long FLAGS; + void *USER; + + } rtlgen_list; + + typedef struct rtlport_list + { + struct rtlport_list *NEXT; + vexexpr *VEX_ATOM; + unsigned char DIR; + unsigned char BASE; + long FLAGS; + void *USER; + + } rtlport_list; + + typedef struct rtlmod_list + { + struct rtlmod_list *NEXT; + char *NAME; + rtlport_list *PORT; + rtlgen_list *GENERIC; + long FLAGS; + void *USER; + + } rtlmod_list; + +/*------------------------------------------------------\ +| | +| Rtl Instance | +| | +\------------------------------------------------------*/ + + typedef struct rtlmap_list + { + struct rtlmap_list *NEXT; + vexexpr *VEX_FORMAL; + vexexpr *VEX_ACTUAL; + long FLAGS; + void *USER; + + } rtlmap_list; + + typedef struct rtlins_list + { + struct rtlins_list *NEXT; + char *NAME; + rtlmod_list *MODEL; + rtlmap_list *MAP; + rtlgen_list *GENERIC; + long FLAGS; + void *USER; + + } rtlins_list; + + +/*------------------------------------------------------------\ +| | +| Rtl Figure | +| | +\------------------------------------------------------------*/ + + typedef struct rtlfig_list + { + struct rtlfig_list *NEXT; + char *NAME; + rtlasg_list *ASSIGN; + rtlfsm_list *FSM; + rtlmod_list *MODEL; + rtlins_list *INSTANCE; + rtldecl_list *DECLAR[ RTL_MAX_DECLAR_TYPE ]; + authtable *HASH_DECLAR; + authtable *HASH_MODEL; + authtable *HASH_INSTANCE; + long FLAGS; + void *USER; + + } rtlfig_list; + +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + extern rtlfig_list *HEAD_RTLFIG; + + extern char *RTL_DECLAR_TYPE[ RTL_MAX_DECLAR_TYPE ]; + extern char *RTL_KIND_TYPE[ RTL_MAX_KIND_TYPE ]; + extern char *RTL_DIR_TYPE[ RTL_MAX_DIR_TYPE ]; + extern char *RTL_BIVEX_TYPE[ RTL_MAX_BIVEX_TYPE ]; + extern char *RTL_ASG_TYPE[ RTL_MAX_ASG_TYPE ]; + extern char *RTL_ASG_REGISTER_TYPE[ RTL_MAX_ASG_REGISTER_TYPE ]; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Alloc Functions | +| | +\------------------------------------------------------------*/ + + extern rtlfig_list *allocrtlfig __P(()); + extern rtldecl_list *allocrtldecl __P(()); + extern rtlsym *allocrtlsym __P((unsigned int Width)); + extern rtlasg_list *allocrtlasg __P(()); + extern rtlbivex_list *allocrtlbivex __P(()); + extern rtlfsm_list *allocrtlfsm __P(()); + extern rtlfsmtrans_list *allocrtlfsmtrans __P(()); + extern rtlfsmstate_list *allocrtlfsmstate __P(()); + extern rtlfsmasg_list *allocrtlfsmasg __P(()); + + extern rtlmod_list *allocrtlmod __P(()); + extern rtlins_list *allocrtlins __P(()); + extern rtlport_list *allocrtlport __P(()); + extern rtlmap_list *allocrtlmap __P(()); + extern rtlgen_list *allocrtlgen __P(()); + +/*------------------------------------------------------------\ +| | +| Free Functions | +| | +\------------------------------------------------------------*/ + + extern void freertlfig __P((rtlfig_list *Figure)); + extern void freertlasg __P((rtlasg_list *Asg)); + extern void freertlbivex __P((rtlbivex_list *BiVex)); + extern void freertldecl __P((rtldecl_list *Decl)); + extern void freertlsym __P((rtlsym *Sym)); + extern void freertlfsmasg __P((rtlfsmasg_list *FsmAsg)); + extern void freertlfsmstate __P((rtlfsmstate_list *fsmstate)); + extern void freertlfsmtrans __P((rtlfsmtrans_list *fsmtrans)); + extern void freertlfsm __P((rtlfsm_list *Fsm)); + + extern void freertlmod __P((rtlmod_list *Model)); + extern void freertlins __P((rtlins_list *Instance)); + extern void freertlport __P((rtlport_list *Port)); + extern void freertlmap __P((rtlmap_list *Map)); + extern void freertlgen __P((rtlgen_list *Generic)); + +/*------------------------------------------------------------\ +| | +| Add Functions | +| | +\------------------------------------------------------------*/ + + extern rtlfig_list *addrtlfig __P((char *Name)); + extern rtldecl_list *addrtldecl __P((rtlfig_list *Figure, vexexpr *Atom, int Type)); + extern rtlasg_list *addrtlasg __P((rtlfig_list *Figure, vexexpr *VexAtom, int Type)); + extern rtlasg_list *addrtlasgafter __P((rtlfig_list *Figure, rtlasg_list *PrevAssign, vexexpr *VexAtom, int Type)); + extern rtlbivex_list *addrtlasgbivex __P((rtlfig_list *Figure, rtlasg_list *Assign, vexexpr *VexCond, vexexpr *VexData, int Type)); + + extern rtlfsmasg_list *addrtlfsmstateasg __P((rtlfig_list *Figure, rtlfsm_list *Fsm, rtlfsmstate_list *State, vexexpr *VexAtom, vexexpr *VexData)); + extern rtlfsmasg_list *addrtlfsmtransasg __P((rtlfig_list *Figure, rtlfsm_list *Fsm, rtlfsmtrans_list *Trans, vexexpr *VexAtom, vexexpr *VexData)); + extern rtlfsmtrans_list *addrtlfsmtrans __P((rtlfig_list *Figure, rtlfsm_list *Fsm, rtlfsmstate_list *StateFrom, rtlfsmstate_list *StateTo, vexexpr *VexCond)); + extern rtlfsmstate_list *addrtlfsmstate __P((rtlfig_list *Figure, rtlfsm_list *Fsm, char *Name)); + extern rtlfsm_list *addrtlfsm __P((rtlfig_list *Figure, char *Name)); + extern rtlbivex_list *addrtlfsmbivex __P((rtlfig_list *Figure, rtlfsm_list *Fsm, vexexpr *VexCond, vexexpr *VexData, int Type)); + + extern rtlmod_list *addrtlmod __P((rtlfig_list *Figure, char *Name)); + extern rtlport_list *addrtlmodport __P((rtlfig_list *Figure, rtlmod_list *Model, vexexpr *Atom, unsigned char Base, unsigned char Dir )); + extern rtlgen_list *addrtlmodgen __P((rtlfig_list *Figure, rtlmod_list *Model, vexexpr *Atom, vexexpr *Expr, unsigned char Base )); + extern rtlins_list *addrtlins __P((rtlfig_list *Figure, char *Name, rtlmod_list *Model)); + extern rtlmap_list *addrtlinsmap __P((rtlfig_list *Figure, rtlins_list *Instance, vexexpr *Formal, vexexpr *Actual )); + extern rtlgen_list *addrtlinsgen __P((rtlfig_list *Figure, rtlins_list *Instance, vexexpr *Atom, vexexpr *Expr )); + +/*------------------------------------------------------------\ +| | +| Del Functions | +| | +\------------------------------------------------------------*/ + + extern int delrtlfig __P((char *Name)); + extern int delrtlasg __P((rtlfig_list *Figure, rtlasg_list *Assign)); + +/*------------------------------------------------------------\ +| | +| Search Functions | +| | +\------------------------------------------------------------*/ + + extern rtlfig_list *searchrtlfig __P((char *Name)); + extern rtldecl_list *searchrtldecl __P((rtlfig_list *Figure, char *Name)); + extern rtlsym *searchrtlsym __P((rtlfig_list *Figure, char *Name, short Index)); + extern rtlfsmstate_list *searchrtlfsmstate __P((rtlfig_list *Figure, rtlfsm_list *Fsm, char *Name)); + + extern rtlmod_list *searchrtlmod __P((rtlfig_list *Figure, char *Name)); + extern rtlins_list *searchrtlins __P((rtlfig_list *Figure, char *Name)); + extern rtlport_list *searchrtlmodport __P((rtlfig_list *Figure, rtlmod_list *Model, char *Name)); + +/*------------------------------------------------------------\ +| | +| Get Functions | +| | +\------------------------------------------------------------*/ + + extern rtlsym *getrtlsymdecl __P((rtldecl_list *Declar, short Index)); + extern rtlsym *getrtlsymdeclpos __P((rtldecl_list *Declar, int Position)); + +/*------------------------------------------------------------\ +| | +| View Functions | +| | +\------------------------------------------------------------*/ + + extern void viewrtlsym __P((rtlsym *Symbol)); + extern void viewrtldecl __P((rtldecl_list *Decl)); + extern void viewrtlbivex __P((rtlbivex_list *BiVex)); + extern void viewrtlasg __P((rtlasg_list *Asg)); + extern void viewrtlfig __P((rtlfig_list *Figure)); + extern void viewrtlfsm __P((rtlfsm_list *Fsm)); + + extern void viewrtlins __P((rtlins_list *Instance)); + extern void viewrtlmod __P((rtlmod_list *Model)); + extern void viewrtlport __P((rtlport_list *Port)); + extern void viewrtlmap __P((rtlmap_list *Map)); + extern void viewrtlgen __P((rtlgen_list *Generic)); + +# endif diff --git a/alliance/src/rtn/src/rtnadd.c b/alliance/src/rtn/src/rtnadd.c new file mode 100644 index 00000000..f19420c4 --- /dev/null +++ b/alliance/src/rtn/src/rtnadd.c @@ -0,0 +1,685 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtl | +| | +| File : rtnadd.c | +| | +| Date : 04.07.96 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include "mut.h" +# include "aut.h" +# include "vex.h" +# include "rtn.h" + +# include +# include "rtnadd.h" +# include "rtnerror.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ + + rtlfig_list *HEAD_RTLFIG = (rtlfig_list *)0; + + char *RTL_DECLAR_TYPE[ RTL_MAX_DECLAR_TYPE ] = + { + "PORT", + "SIGNAL", + "CONSTANT", + "GENERIC" + }; + + char *RTL_KIND_TYPE[ RTL_MAX_KIND_TYPE ] = + { + "NONE", + "BUS", + "REGISTER" + }; + + char *RTL_DIR_TYPE[ RTL_MAX_DIR_TYPE ] = + { + "IN", + "OUT", + "INOUT" + }; + + char *RTL_BIVEX_TYPE[ RTL_MAX_BIVEX_TYPE ] = + { + "NONE", + "FALLING_EDGE", + "RISING_EDGE", + "ASYNC_RESET", + "ASYNC_SET", + "ASYNC_WEN", + "SYNC_RESET", + "SYNC_SET", + "SYNC_WEN", + "MULTIPLEXOR", + "CONDITIONAL" + }; + + char *RTL_ASG_TYPE[ RTL_MAX_ASG_TYPE ] = + { + "COMBINATORIAL", + "MULTIPLEXOR", + "CONDITIONAL", + "REGISTER", + "TRISTATE", + "PULL_UP", + "PULL_DOWN" + }; + + char *RTL_ASG_REGISTER_TYPE[ RTL_MAX_ASG_REGISTER_TYPE ] = + { + "NONE", + "SYNC", + "ASYNC", + "MIXED" + }; + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl Add Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl Add Figure | +| | +\------------------------------------------------------------*/ + +rtlfig_list *addrtlfig( Name ) + + char *Name; +{ + rtlfig_list *Figure; + + Name = namealloc( Name ); + Figure = allocrtlfig(); + + Figure->NAME = Name; + Figure->HASH_DECLAR = createauthtable( 50 ); + Figure->HASH_MODEL = createauthtable( 50 ); + Figure->HASH_INSTANCE = createauthtable( 50 ); + + Figure->NEXT = HEAD_RTLFIG; + HEAD_RTLFIG = Figure; + + return( Figure ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Declaration | +| | +\------------------------------------------------------------*/ + +rtldecl_list *addrtldecl( Figure, Atom, Type ) + + rtlfig_list *Figure; + vexexpr *Atom; + int Type; +{ + rtldecl_list *Decl; + rtldecl_list **PrevDecl; + rtlsym *Sym; + char *Name; + int Width; + int Index; + int IndexStep; + int Scan; + + Name = GetVexAtomValue( Atom ); + Decl = searchrtldecl( Figure, Name ); + + if ( Decl != (rtldecl_list *)0 ) + { + rtlerror( RTL_DECLAR_EXIST_ERROR, Name, 0 ); + } + + if ( ( Type < 0 ) || + ( Type >= RTL_MAX_DECLAR_TYPE ) ) + { + rtlerror( RTL_UNKNOWN_DECLAR_TYPE, Type, Name ); + } + + Decl = allocrtldecl(); + + Width = Atom->WIDTH; + Sym = allocrtlsym( Width ); + + if ( ( ! IsVexNodeVarWidth( Atom ) ) && + ( IsVexAtomVector( Atom ) ) ) + { + Index = Atom->LEFT; + IndexStep = IsVexAtomDown( Atom ) ? -1 : 1; + } + else + { + Index = -1; + IndexStep = 0; + } + + for ( Scan = 0; Scan < Width; Scan++ ) + { + Sym[ Scan ].NAME = Name; + Sym[ Scan ].INDEX = Index; + Sym[ Scan ].DECL = Decl; + + Index += IndexStep; + } + + PrevDecl = &Figure->DECLAR[ Type ]; + + Decl->VEX_ATOM = Atom; + Decl->DECL_SYM = Sym; + Decl->TYPE = Type; + + Decl->NEXT = Figure->DECLAR[ Type ]; + Figure->DECLAR[ Type ] = Decl; + + addauthelem( Figure->HASH_DECLAR, Name, (long)Decl ); + + return( Decl ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Assign | +| | +\------------------------------------------------------------*/ + +rtlasg_list *addrtlasg( Figure, VexAtom, Type ) + + rtlfig_list *Figure; + vexexpr *VexAtom; + int Type; +{ + rtlasg_list *Assign; + + Assign = allocrtlasg(); + + Assign->VEX_ATOM = VexAtom; + Assign->TYPE = Type; + Assign->LAST_BIVEX = &Assign->BIVEX; + + Assign->NEXT = Figure->ASSIGN; + Assign->PREV = &Figure->ASSIGN; + + if ( Figure->ASSIGN != (rtlasg_list *)0 ) + { + Figure->ASSIGN->PREV = &Assign->NEXT; + } + + Figure->ASSIGN = Assign; + + return( Assign ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Assign After | +| | +\------------------------------------------------------------*/ + +rtlasg_list *addrtlasgafter( Figure, PrevAssign, VexAtom, Type ) + + rtlfig_list *Figure; + rtlasg_list *PrevAssign; + vexexpr *VexAtom; + int Type; +{ + rtlasg_list *NextAssign; + rtlasg_list *Assign; + + Assign = allocrtlasg(); + + Assign->VEX_ATOM = VexAtom; + Assign->TYPE = Type; + Assign->LAST_BIVEX = &Assign->BIVEX; + + if ( PrevAssign == (rtlasg_list *)0 ) + { + NextAssign = Figure->ASSIGN; + Figure->ASSIGN = Assign; + Assign->PREV = &Figure->ASSIGN; + } + else + { + NextAssign = PrevAssign->NEXT; + PrevAssign->NEXT = Assign; + Assign->PREV = &PrevAssign->NEXT; + } + + Assign->NEXT = NextAssign; + + if ( NextAssign != (rtlasg_list *)0 ) + { + NextAssign->PREV = &Assign->NEXT; + } + + return( Assign ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Assign Bi Vex | +| | +\------------------------------------------------------------*/ + +rtlbivex_list *addrtlasgbivex( Figure, Assign, VexCond, VexData, Type ) + + rtlfig_list *Figure; + rtlasg_list *Assign; + vexexpr *VexCond; + vexexpr *VexData; + int Type; +{ + rtlbivex_list *BiVex; + + BiVex = allocrtlbivex(); + + BiVex->VEX_COND = VexCond; + BiVex->VEX_DATA = VexData; + BiVex->TYPE = Type; + + *Assign->LAST_BIVEX = BiVex; + Assign->LAST_BIVEX = &BiVex->NEXT; + + return( BiVex ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Fsm State Assign | +| | +\------------------------------------------------------------*/ + +rtlfsmasg_list *addrtlfsmstateasg( Figure, Fsm, State, VexAtom, VexData ) + + rtlfig_list *Figure; + rtlfsm_list *Fsm; + rtlfsmstate_list *State; + vexexpr *VexAtom; + vexexpr *VexData; +{ + rtlfsmasg_list *Assign; + + Assign = allocrtlfsmasg(); + + Assign->VEX_ATOM = VexAtom; + Assign->VEX_DATA = VexData; + + Assign->NEXT = State->ASSIGN; + State->ASSIGN = Assign; + + return( Assign ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Fsm Trans Assign | +| | +\------------------------------------------------------------*/ + +rtlfsmasg_list *addrtlfsmtransasg( Figure, Fsm, Trans, VexAtom, VexData ) + + rtlfig_list *Figure; + rtlfsm_list *Fsm; + rtlfsmtrans_list *Trans; + vexexpr *VexAtom; + vexexpr *VexData; +{ + rtlfsmasg_list *Assign; + + Assign = allocrtlfsmasg(); + + Assign->VEX_ATOM = VexAtom; + Assign->VEX_DATA = VexData; + + Assign->NEXT = Trans->ASSIGN; + Trans->ASSIGN = Assign; + + return( Assign ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Fsm Trans | +| | +\------------------------------------------------------------*/ + +rtlfsmtrans_list *addrtlfsmtrans( Figure, Fsm, StateFrom, StateTo, VexCond ) + + rtlfig_list *Figure; + rtlfsm_list *Fsm; + rtlfsmstate_list *StateFrom; + rtlfsmstate_list *StateTo; + vexexpr *VexCond; +{ + rtlfsmtrans_list *Trans; + + Trans = allocrtlfsmtrans(); + + Trans->FROM = StateFrom; + Trans->TO = StateTo; + Trans->VEX_COND = VexCond; + + StateFrom->FROM = addchain( StateFrom->FROM, (void *)Trans ); + StateTo->TO = addchain( StateTo->TO , (void *)Trans ); + + Trans->NEXT = Fsm->TRANS; + Fsm->TRANS = Trans; + + return( Trans ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Fsm State | +| | +\------------------------------------------------------------*/ + +rtlfsmstate_list *addrtlfsmstate( Figure, Fsm, Name ) + + rtlfig_list *Figure; + rtlfsm_list *Fsm; + char *Name; +{ + rtlfsmstate_list *State; + + Name = namealloc( Name ); + State = allocrtlfsmstate(); + + State->NAME = Name; + + addauthelem( Fsm->HASH_STATE, Name, (long)State ); + + State->NEXT = Fsm->STATE; + Fsm->STATE = State; + + return( State ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Fsm Bi Vex | +| | +\------------------------------------------------------------*/ + +rtlbivex_list *addrtlfsmbivex( Figure, Fsm, VexCond, VexData, Type ) + + rtlfig_list *Figure; + rtlfsm_list *Fsm; + vexexpr *VexCond; + vexexpr *VexData; + int Type; +{ + rtlbivex_list *BiVex; + + BiVex = allocrtlbivex(); + + BiVex->VEX_COND = VexCond; + BiVex->VEX_DATA = VexData; + BiVex->TYPE = Type; + + *Fsm->LAST_BIVEX = BiVex; + Fsm->LAST_BIVEX = &BiVex->NEXT; + + return( BiVex ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Fsm | +| | +\------------------------------------------------------------*/ + +rtlfsm_list *addrtlfsm( Figure, Name ) + + rtlfig_list *Figure; + char *Name; +{ + rtlfsm_list *Fsm; + + Name = namealloc( Name ); + Fsm = allocrtlfsm(); + + Fsm->NAME = Name; + Fsm->HASH_STATE = createauthtable( 50 ); + Fsm->LAST_BIVEX = &Fsm->BIVEX; + + Fsm->NEXT = Figure->FSM; + Figure->FSM = Fsm; + + return( Fsm ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Model | +| | +\------------------------------------------------------------*/ + +rtlmod_list *addrtlmod( Figure, Name ) + + rtlfig_list *Figure; + char *Name; +{ + rtlmod_list *Model; + + Name = namealloc( Name ); + Model = searchrtlmod( Figure, Name ); + + if ( Model != (rtlmod_list *)0 ) + { + rtlerror( RTL_MOD_EXIST_ERROR, Name, 0 ); + } + + Model = allocrtlmod(); + + Model->NAME = Name; + + Model->NEXT = Figure->MODEL; + Figure->MODEL = Model; + + addauthelem( Figure->HASH_MODEL, Name, (long)Model ); + + return( Model ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Model Port | +| | +\------------------------------------------------------------*/ + +rtlport_list *addrtlmodport( Figure, Model, Atom, Base, Dir ) + + rtlfig_list *Figure; + rtlmod_list *Model; + vexexpr *Atom; + unsigned char Base; + unsigned char Dir; +{ + rtlport_list *Port; + + Port = allocrtlport(); + + Port->VEX_ATOM = Atom; + Port->DIR = Dir; + Port->BASE = Base; + + + Port->NEXT = Model->PORT; + Model->PORT = Port; + + return( Port ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Model Generic | +| | +\------------------------------------------------------------*/ + +rtlgen_list *addrtlmodgen( Figure, Model, Atom, Expr, Base ) + + rtlfig_list *Figure; + rtlmod_list *Model; + vexexpr *Atom; + vexexpr *Expr; + unsigned char Base; +{ + rtlgen_list *Generic; + + Generic = allocrtlgen(); + + Generic->VEX_ATOM = Atom; + Generic->VEX_EXPR = Expr; + Generic->BASE = Base; + + Generic->NEXT = Model->GENERIC; + Model->GENERIC = Generic; + + return( Generic ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Instance | +| | +\------------------------------------------------------------*/ + +rtlins_list *addrtlins( Figure, Name, Model ) + + rtlfig_list *Figure; + char *Name; + rtlmod_list *Model; +{ + rtlins_list *Instance; + + Name = namealloc( Name ); + Instance = searchrtlins( Figure, Name ); + + if ( Instance != (rtlins_list *)0 ) + { + rtlerror( RTL_INS_EXIST_ERROR, Name, 0 ); + } + + Instance = allocrtlins(); + + Instance->NAME = Name; + Instance->MODEL = Model; + + Instance->NEXT = Figure->INSTANCE; + Figure->INSTANCE = Instance; + + addauthelem( Figure->HASH_INSTANCE, Name, (long)Instance ); + + return( Instance ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Instance Map | +| | +\------------------------------------------------------------*/ + +rtlmap_list *addrtlinsmap( Figure, Instance, Formal, Actual ) + + rtlfig_list *Figure; + rtlins_list *Instance; + vexexpr *Formal; + vexexpr *Actual; +{ + rtlmap_list *Map; + + Map = allocrtlmap(); + + Map->VEX_FORMAL = Formal; + Map->VEX_ACTUAL = Actual; + + Map->NEXT = Instance->MAP; + Instance->MAP = Map; + + return( Map ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Add Instance Generic | +| | +\------------------------------------------------------------*/ + +rtlgen_list *addrtlinsgen( Figure, Instance, Atom, Expr ) + + rtlfig_list *Figure; + rtlins_list *Instance; + vexexpr *Atom; + vexexpr *Expr; +{ + rtlgen_list *Generic; + + Generic = allocrtlgen(); + + Generic->VEX_ATOM = Atom; + Generic->VEX_EXPR = Expr; + + Generic->NEXT = Instance->GENERIC; + Instance->GENERIC = Generic; + + return( Generic ); +} diff --git a/alliance/src/rtn/src/rtnadd.h b/alliance/src/rtn/src/rtnadd.h new file mode 100644 index 00000000..fc15305e --- /dev/null +++ b/alliance/src/rtn/src/rtnadd.h @@ -0,0 +1,75 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtl | +| | +| File : rtladd.h | +| | +| Date : 04.07.96 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef RTL_ADD_H +# define RTL_ADD_H + +/*------------------------------------------------------------\ +| | +| Macro | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/rtn/src/rtnalloc.c b/alliance/src/rtn/src/rtnalloc.c new file mode 100644 index 00000000..e0e3ce4e --- /dev/null +++ b/alliance/src/rtn/src/rtnalloc.c @@ -0,0 +1,227 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtl | +| | +| File : rtnalloc.c | +| | +| Date : 04.07.96 | +| | +| Rtlhor : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include "mut.h" +# include "aut.h" +# include "vex.h" +# include "rtn.h" + +# include +# include "rtnalloc.h" +# include "rtnerror.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl Alloc Figure | +| | +\------------------------------------------------------------*/ + +rtlfig_list *allocrtlfig() +{ + return( (rtlfig_list *)autallocblock( sizeof( rtlfig_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Alloc Declaration | +| | +\------------------------------------------------------------*/ + +rtldecl_list *allocrtldecl() +{ + return( (rtldecl_list *)autallocheap( sizeof( rtldecl_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Alloc Assign | +| | +\------------------------------------------------------------*/ + +rtlasg_list *allocrtlasg() +{ + return( (rtlasg_list *)autallocheap( sizeof( rtlasg_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Alloc Bi Vex | +| | +\------------------------------------------------------------*/ + +rtlbivex_list *allocrtlbivex() +{ + return( (rtlbivex_list *)autallocheap( sizeof( rtlbivex_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Alloc Fsm | +| | +\------------------------------------------------------------*/ + +rtlfsm_list *allocrtlfsm() +{ + return( (rtlfsm_list *)autallocblock( sizeof( rtlfsm_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Alloc Fsm Trans | +| | +\------------------------------------------------------------*/ + +rtlfsmtrans_list *allocrtlfsmtrans() +{ + return( (rtlfsmtrans_list *)autallocheap( sizeof( rtlfsmtrans_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Alloc Fsm State | +| | +\------------------------------------------------------------*/ + +rtlfsmstate_list *allocrtlfsmstate() +{ + return( (rtlfsmstate_list *)autallocheap( sizeof( rtlfsmstate_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Alloc Fsm Assign | +| | +\------------------------------------------------------------*/ + +rtlfsmasg_list *allocrtlfsmasg() +{ + return( (rtlfsmasg_list *)autallocheap( sizeof( rtlfsmasg_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Alloc Symbol | +| | +\------------------------------------------------------------*/ + +rtlsym *allocrtlsym( Width ) + + unsigned int Width; +{ + return( (rtlsym *)autallocblock( sizeof( rtlsym ) * Width ) ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Alloc Model | +| | +\------------------------------------------------------------*/ + +rtlmod_list *allocrtlmod() +{ + return( (rtlmod_list *)autallocheap( sizeof( rtlmod_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Alloc Instance | +| | +\------------------------------------------------------------*/ + +rtlins_list *allocrtlins() +{ + return( (rtlins_list *)autallocheap( sizeof( rtlins_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Alloc Port | +| | +\------------------------------------------------------------*/ + +rtlport_list *allocrtlport() +{ + return( (rtlport_list *)autallocheap( sizeof( rtlport_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Alloc Map | +| | +\------------------------------------------------------------*/ + +rtlmap_list *allocrtlmap() +{ + return( (rtlmap_list *)autallocheap( sizeof( rtlmap_list ) ) ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Alloc Map | +| | +\------------------------------------------------------------*/ + +rtlgen_list *allocrtlgen() +{ + return( (rtlgen_list *)autallocheap( sizeof( rtlgen_list ) ) ); +} diff --git a/alliance/src/rtn/src/rtnalloc.h b/alliance/src/rtn/src/rtnalloc.h new file mode 100644 index 00000000..ddec91a9 --- /dev/null +++ b/alliance/src/rtn/src/rtnalloc.h @@ -0,0 +1,75 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtl | +| | +| File : rtlalloc.h | +| | +| Date : 04.07.96 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef RTL_ALLOC_H +# define RTL_ALLOC_H + +/*------------------------------------------------------------\ +| | +| Macro | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/rtn/src/rtndel.c b/alliance/src/rtn/src/rtndel.c new file mode 100644 index 00000000..4a0f324f --- /dev/null +++ b/alliance/src/rtn/src/rtndel.c @@ -0,0 +1,365 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtl | +| | +| File : rtndel.c | +| | +| Date : 04.07.96 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include "mut.h" +# include "aut.h" +# include "vex.h" +# include "rtn.h" + +# include +# include "rtndel.h" +# include "rtnerror.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl Del All Port | +| | +\------------------------------------------------------------*/ + +static void loc_delallrtlport( ScanPort ) + + rtlport_list *ScanPort; +{ + rtlport_list *Delete; + + while ( ScanPort != (rtlport_list *)0 ) + { + Delete = ScanPort; + ScanPort = ScanPort->NEXT; + + freevexexpr( Delete->VEX_ATOM ); + + freertlport( Delete ); + } +} + +/*------------------------------------------------------------\ +| | +| Rtl Del All Map | +| | +\------------------------------------------------------------*/ + +static void loc_delallrtlmap( ScanMap ) + + rtlmap_list *ScanMap; +{ + rtlmap_list *Delete; + + while ( ScanMap != (rtlmap_list *)0 ) + { + Delete = ScanMap; + ScanMap = ScanMap->NEXT; + + freevexexpr( Delete->VEX_FORMAL ); + freevexexpr( Delete->VEX_ACTUAL ); + + freertlmap( Delete ); + } +} + +/*------------------------------------------------------------\ +| | +| Rtl Del All Generic | +| | +\------------------------------------------------------------*/ + +static void loc_delallrtlgen( ScanGeneric ) + + rtlgen_list *ScanGeneric; +{ + rtlgen_list *Delete; + + while ( ScanGeneric != (rtlgen_list *)0 ) + { + Delete = ScanGeneric; + ScanGeneric = ScanGeneric->NEXT; + + freevexexpr( Delete->VEX_ATOM ); + freevexexpr( Delete->VEX_EXPR ); + + freertlgen( Delete ); + } +} + +/*------------------------------------------------------------\ +| | +| Rtl Del Functions | +| | +\------------------------------------------------------------*/ + +static void loc_delallbivex( ScanBiVex ) + + rtlbivex_list *ScanBiVex; +{ + rtlbivex_list *Delete; + + while ( ScanBiVex != (rtlbivex_list *)0 ) + { + freevexexpr( ScanBiVex->VEX_COND ); + freevexexpr( ScanBiVex->VEX_DATA ); + + Delete = ScanBiVex; + ScanBiVex = ScanBiVex->NEXT; + + freertlbivex( Delete ); + } +} + +/*------------------------------------------------------------\ +| | +| Rtl Del Assign | +| | +\------------------------------------------------------------*/ + +int delrtlasg( Figure, Assign ) + + rtlfig_list *Figure; + rtlasg_list *Assign; +{ + *Assign->PREV = Assign->NEXT; + + if ( Assign->NEXT != (rtlasg_list *)0 ) + { + Assign->NEXT->PREV = Assign->PREV; + } + + freevexexpr( Assign->VEX_ATOM ); + freevexexpr( Assign->VEX_DATA ); + + loc_delallbivex( Assign->BIVEX ); + + freertlasg( Assign ); + + return( 1 ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Del Figure | +| | +\------------------------------------------------------------*/ + +int delrtlfig( Name ) + + char *Name; +{ + rtlfig_list *Figure; + rtlfig_list **Previous; + rtldecl_list *ScanDecl; + rtlasg_list *ScanAsg; + rtlfsm_list *ScanFsm; + rtlfsmstate_list *ScanState; + rtlfsmtrans_list *ScanTrans; + rtlfsmasg_list *ScanFsmAsg; + rtlmod_list *ScanModel; + rtlins_list *ScanInstance; + void *Delete; + int Type; + + Name = namealloc( Name ); + Previous = &HEAD_RTLFIG; + + for ( Figure = HEAD_RTLFIG; + Figure != (rtlfig_list *)0; + Figure = Figure->NEXT ) + { + if ( Figure->NAME == Name ) break; + + Previous = &Figure->NEXT; + } + + if ( Figure == (rtlfig_list *)0 ) return( 0 ); + + *Previous = Figure->NEXT; + + for ( Type = 0; Type < RTL_MAX_DECLAR_TYPE; Type++ ) + { + ScanDecl = Figure->DECLAR[ Type ]; + + while ( ScanDecl != (rtldecl_list *)0 ) + { + freevexexpr( ScanDecl->VEX_ATOM ); + freevexexpr( ScanDecl->VEX_INIT ); + freertlsym( ScanDecl->DECL_SYM ); + + Delete = (void *)( ScanDecl ); + ScanDecl = ScanDecl->NEXT; + + freertldecl( Delete ); + } + } + + destroyauthtable( Figure->HASH_DECLAR ); + destroyauthtable( Figure->HASH_MODEL ); + destroyauthtable( Figure->HASH_INSTANCE ); + + ScanModel = Figure->MODEL; + + while ( ScanModel != (rtlmod_list *)0 ) + { + loc_delallrtlport( ScanModel->PORT ); + loc_delallrtlgen( ScanModel->GENERIC ); + + Delete = (void *)( ScanModel ); + ScanModel = ScanModel->NEXT; + + freertlmod( Delete ); + } + + ScanInstance = Figure->INSTANCE; + + while ( ScanInstance != (rtlins_list *)0 ) + { + loc_delallrtlmap( ScanInstance->MAP ); + loc_delallrtlgen( ScanInstance->GENERIC ); + + Delete = (void *)( ScanInstance ); + ScanInstance = ScanInstance->NEXT; + + freertlins( Delete ); + } + + ScanAsg = Figure->ASSIGN; + + while ( ScanAsg != (rtlasg_list *)0 ) + { + freevexexpr( ScanAsg->VEX_ATOM ); + freevexexpr( ScanAsg->VEX_DATA ); + + loc_delallbivex( ScanAsg->BIVEX ); + + Delete = (void *)( ScanAsg ); + ScanAsg = ScanAsg->NEXT; + + freertlasg( Delete ); + } + + ScanFsm = Figure->FSM; + + while ( ScanFsm != (rtlfsm_list *)0 ) + { + ScanState = ScanFsm->STATE; + + while ( ScanState != (rtlfsmstate_list *)0 ) + { + freechain( ScanState->FROM ); + freechain( ScanState->TO ); + + ScanFsmAsg = ScanState->ASSIGN; + + while ( ScanFsmAsg != (rtlfsmasg_list *)0 ) + { + freevexexpr( ScanFsmAsg->VEX_ATOM ); + freevexexpr( ScanFsmAsg->VEX_DATA ); + + Delete = (void *)ScanFsmAsg; + ScanFsmAsg = ScanFsmAsg->NEXT; + + freertlfsmasg( Delete ); + } + + Delete = (void *)ScanState; + ScanState = ScanState->NEXT; + + freertlfsmstate( Delete ); + } + + ScanTrans = ScanFsm->TRANS; + + while ( ScanTrans != (rtlfsmtrans_list *)0 ) + { + freevexexpr( ScanTrans->VEX_COND ); + + ScanFsmAsg = ScanTrans->ASSIGN; + + while ( ScanFsmAsg != (rtlfsmasg_list *)0 ) + { + freevexexpr( ScanFsmAsg->VEX_ATOM ); + freevexexpr( ScanFsmAsg->VEX_DATA ); + + Delete = (void *)ScanFsmAsg; + ScanFsmAsg = ScanFsmAsg->NEXT; + + freertlfsmasg( Delete ); + } + + Delete = (void *)ScanTrans; + ScanTrans = ScanTrans->NEXT; + + freertlfsmtrans( Delete ); + } + + loc_delallbivex( ScanFsm->BIVEX ); + + destroyauthtable( ScanFsm->HASH_STATE ); + + Delete = (void *)( ScanFsm ); + ScanFsm = ScanFsm->NEXT; + + freertlfsm( Delete ); + } + + freertlfig( Figure ); + + return( 1 ); +} diff --git a/alliance/src/rtn/src/rtndel.h b/alliance/src/rtn/src/rtndel.h new file mode 100644 index 00000000..a9be4577 --- /dev/null +++ b/alliance/src/rtn/src/rtndel.h @@ -0,0 +1,75 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtl | +| | +| File : rtldel.h | +| | +| Date : 04.07.96 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef RTL_DEL_H +# define RTL_DEL_H + +/*------------------------------------------------------------\ +| | +| Macro | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/rtn/src/rtnerror.c b/alliance/src/rtn/src/rtnerror.c new file mode 100644 index 00000000..4819d366 --- /dev/null +++ b/alliance/src/rtn/src/rtnerror.c @@ -0,0 +1,150 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtn | +| | +| File : Rtn Errors | +| | +| Authors : Jacomme Ludovic | +| | +| Date : 04.07.96 | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include +# include +# include +# include +# include "mut.h" +# include "aut.h" +# include "vex.h" +# include "rtn.h" +# include "rtnerror.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl Error Function | +| | +\------------------------------------------------------------*/ + +void rtl_error( Error, Text1, Text2, File, Line ) + + int Error; + char *Text1; + char *Text2; + char *File; + long Line; +{ + char *Name; + + Name = mbkstrdup( File ); + Name[ strlen( File ) - 1 ] = '\0'; + + fprintf( stderr, "%s%ld ", Name, Line ); + + switch( Error ) + { + case RTL_DECLAR_EXIST_ERROR : + fprintf( stderr, "symbol %s already declared\n", Text1 ); + break; + case RTL_MOD_EXIST_ERROR : + fprintf( stderr, "model %s already declared\n", Text1 ); + break; + case RTL_INS_EXIST_ERROR : + fprintf( stderr, "instance %s already declared\n", Text1 ); + break; + case RTL_ILLEGAL_POSITION_ERROR : + fprintf( stderr, "illegal position for symbol %s %ld\n", Text1, (long)Text2 ); + break; + case RTL_ILLEGAL_INDEX_ERROR : + fprintf( stderr, "illegal index for symbol %s %ld\n", Text1, (long)Text2 ); + break; + case RTL_UNKNOWN_DECLAR_TYPE : + fprintf( stderr, "unknown declar type %ld for %s\n", (long)Text1, Text2 ); + break; + default : + + fprintf( stderr, "unknown internal error %d !\n", Error ); + } + + autexit( 1 ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Warning Function | +| | +\------------------------------------------------------------*/ + +void rtl_warning( Warning, Text1, Text2, File, Line ) + + int Warning; + char *Text1; + char *Text2; + 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 warning %d !\n", Warning ); + } +} diff --git a/alliance/src/rtn/src/rtnerror.h b/alliance/src/rtn/src/rtnerror.h new file mode 100644 index 00000000..9f18137e --- /dev/null +++ b/alliance/src/rtn/src/rtnerror.h @@ -0,0 +1,92 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtl | +| | +| File : Rtl Errors | +| | +| Rtlhors : Jacomme Ludovic | +| | +| Date : 04.07.96 | +| | +\------------------------------------------------------------*/ + +# ifndef RTL_ERROR_H +# define RTL_ERROR_H + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# define RTL_DECLAR_EXIST_ERROR 0 +# define RTL_MOD_EXIST_ERROR 1 +# define RTL_INS_EXIST_ERROR 2 +# define RTL_ILLEGAL_POSITION_ERROR 3 +# define RTL_ILLEGAL_INDEX_ERROR 4 +# define RTL_UNKNOWN_DECLAR_TYPE 5 + +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Macros | +| | +\------------------------------------------------------------*/ + +# define rtlerror( E, V1, V2 ) \ + (rtl_error( (int)(E), (char*)(long)(V1), (char*)(long)(V2), __FILE__, __LINE__ )) +# define rtlwarning( E, V1, V2 ) \ + (rtl_warning( (int)(E), (char*)(long)(V1), (char*)(long)(V2), __FILE__, __LINE__ )) + +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + + extern void rtl_error __P((int Error, char *Text1, char *Text2, char *File, long Line)); + extern void rtl_warning __P((int Warning, char *Text1, char *Text2, char *File, long Line)); + +# endif diff --git a/alliance/src/rtn/src/rtnfree.c b/alliance/src/rtn/src/rtnfree.c new file mode 100644 index 00000000..16d845a0 --- /dev/null +++ b/alliance/src/rtn/src/rtnfree.c @@ -0,0 +1,260 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtn | +| | +| File : rtnfree.c | +| | +| Date : 04.07.96 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include "mut.h" +# include "aut.h" +# include "vex.h" +# include "rtn.h" + +# include +# include +# include "rtnfree.h" +# include "rtnalloc.h" +# include "rtnerror.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl Free Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl Free Figure | +| | +\------------------------------------------------------------*/ + +void freertlfig( Figure ) + + rtlfig_list *Figure; +{ + autfreeblock( (char *)Figure ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Free Assign | +| | +\------------------------------------------------------------*/ + +void freertlasg( Asg ) + + rtlasg_list *Asg; +{ + autfreeheap( (char *)Asg, sizeof( rtlasg_list )); +} + +/*------------------------------------------------------------\ +| | +| Rtl Free Register | +| | +\------------------------------------------------------------*/ + +void freertlbivex( BiVex ) + + rtlbivex_list *BiVex; +{ + autfreeheap( (char *)BiVex, sizeof( rtlbivex_list )); +} + +/*------------------------------------------------------------\ +| | +| Rtl Free Declaration | +| | +\------------------------------------------------------------*/ + +void freertldecl( Decl ) + + rtldecl_list *Decl; +{ + autfreeheap( (char *)Decl, sizeof( rtldecl_list )); +} + +/*------------------------------------------------------------\ +| | +| Rtl Free Fsm Assign | +| | +\------------------------------------------------------------*/ + +void freertlfsmasg( FsmAsg ) + + rtlfsmasg_list *FsmAsg; +{ + autfreeheap( (char *)FsmAsg, sizeof( rtlfsmasg_list )); +} + +/*------------------------------------------------------------\ +| | +| Rtl Free Fsm State | +| | +\------------------------------------------------------------*/ + +void freertlfsmstate( fsmstate ) + + rtlfsmstate_list *fsmstate; +{ + autfreeheap( (char *)fsmstate, sizeof( rtlfsmstate_list )); +} + +/*------------------------------------------------------------\ +| | +| Rtl Free Fsm Trans | +| | +\------------------------------------------------------------*/ + +void freertlfsmtrans( fsmtrans ) + + rtlfsmtrans_list *fsmtrans; +{ + autfreeheap( (char *)fsmtrans, sizeof( rtlfsmtrans_list )); +} + +/*------------------------------------------------------------\ +| | +| Rtl Free Fsm | +| | +\------------------------------------------------------------*/ + +void freertlfsm( Fsm ) + + rtlfsm_list *Fsm; +{ + autfreeblock( (char *)Fsm ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Free Symbol | +| | +\------------------------------------------------------------*/ + +void freertlsym( Sym ) + + rtlsym *Sym; +{ + autfreeblock( (char *)Sym ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Free Model | +| | +\------------------------------------------------------------*/ + +void freertlmod( Model ) + + rtlmod_list *Model; +{ + autfreeheap( (char *)Model, sizeof( rtlmod_list )); +} + +/*------------------------------------------------------------\ +| | +| Rtl Free Instance | +| | +\------------------------------------------------------------*/ + +void freertlins( Instance ) + + rtlins_list *Instance; +{ + autfreeheap( (char *)Instance, sizeof( rtlins_list )); +} + +/*------------------------------------------------------------\ +| | +| Rtl Free Port | +| | +\------------------------------------------------------------*/ + +void freertlport( Port ) + + rtlport_list *Port; +{ + autfreeheap( (char *)Port, sizeof( rtlport_list )); +} + +/*------------------------------------------------------------\ +| | +| Rtl Free Map | +| | +\------------------------------------------------------------*/ + +void freertlmap( Map ) + + rtlmap_list *Map; +{ + autfreeheap( (char *)Map, sizeof( rtlmap_list )); +} + +/*------------------------------------------------------------\ +| | +| Rtl Free Generic | +| | +\------------------------------------------------------------*/ + +void freertlgen( Generic ) + + rtlgen_list *Generic; +{ + autfreeheap( (char *)Generic, sizeof( rtlgen_list )); +} diff --git a/alliance/src/rtn/src/rtnfree.h b/alliance/src/rtn/src/rtnfree.h new file mode 100644 index 00000000..a0df528f --- /dev/null +++ b/alliance/src/rtn/src/rtnfree.h @@ -0,0 +1,75 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtl | +| | +| File : rtlfree.h | +| | +| Date : 04.07.96 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef RTL_FREE_H +# define RTL_FREE_H + +/*------------------------------------------------------------\ +| | +| Macro | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/rtn/src/rtnget.c b/alliance/src/rtn/src/rtnget.c new file mode 100644 index 00000000..3a790099 --- /dev/null +++ b/alliance/src/rtn/src/rtnget.c @@ -0,0 +1,125 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtl | +| | +| File : rtnget.c | +| | +| Date : 04.07.96 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include "mut.h" +# include "aut.h" +# include "vex.h" +# include "rtn.h" + +# include +# include "rtnget.h" +# include "rtnerror.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl Get Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Get Rtl Symbol From Declaration | +| | +\------------------------------------------------------------*/ + +rtlsym *getrtlsymdecl( Declar, Index ) + + rtldecl_list *Declar; + short Index; +{ + vexexpr *Atom; + int Position; + + Atom = Declar->VEX_ATOM; + Position = getvexvectorpos( Atom, Index ); + + if ( Position == -1 ) + { + rtlerror( RTL_ILLEGAL_INDEX_ERROR, GetVexAtomValue( Atom ), Index ); + } + + return( &Declar->DECL_SYM[ Position ] ); +} + +/*------------------------------------------------------------\ +| | +| Get Rtl Symbol From Declaration | +| | +\------------------------------------------------------------*/ + +rtlsym *getrtlsymdeclpos( Declar, Position ) + + rtldecl_list *Declar; + int Position; +{ + vexexpr *Atom; + + Atom = Declar->VEX_ATOM; + + if ( ( Position >= Atom->WIDTH ) || + ( Position < 0 ) ) + { + rtlerror( RTL_ILLEGAL_POSITION_ERROR, GetVexAtomValue( Atom ), Position ); + } + + return( &Declar->DECL_SYM[ Position ] ); +} diff --git a/alliance/src/rtn/src/rtnget.h b/alliance/src/rtn/src/rtnget.h new file mode 100644 index 00000000..9fedfaf6 --- /dev/null +++ b/alliance/src/rtn/src/rtnget.h @@ -0,0 +1,75 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtn | +| | +| File : rtnget.h | +| | +| Date : 04.07.96 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef RTL_GET_H +# define RTL_GET_H + +/*------------------------------------------------------------\ +| | +| Macro | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/rtn/src/rtnsearch.c b/alliance/src/rtn/src/rtnsearch.c new file mode 100644 index 00000000..1f00bc4e --- /dev/null +++ b/alliance/src/rtn/src/rtnsearch.c @@ -0,0 +1,288 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtn | +| | +| File : rtnsearch.c | +| | +| Date : 04.07.96 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include "mut.h" +# include "aut.h" +# include "vex.h" +# include "rtn.h" + +# include +# include "rtnsearch.h" +# include "rtnerror.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl Search Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl Search Figure | +| | +\------------------------------------------------------------*/ + +rtlfig_list *searchrtlfig( Name ) + + char *Name; +{ + rtlfig_list *Figure; + + Name = namealloc( Name ); + + for ( Figure = HEAD_RTLFIG; + Figure != (rtlfig_list *)0; + Figure = Figure->NEXT ) + { + if ( Figure->NAME == Name ) break; + } + + return( Figure ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Search Fsm State | +| | +\------------------------------------------------------------*/ + +rtlfsmstate_list *searchrtlfsmstate( Figure, Fsm, Name ) + + rtlfig_list *Figure; + rtlfsm_list *Fsm; + char *Name; +{ + authelem *Element; + + Name = namealloc( Name ); + Element = searchauthelem( Fsm->HASH_STATE, Name ); + + if ( Element != (authelem *)0 ) + { + return( (rtlfsmstate_list *)Element->VALUE ); + } + + return( (rtlfsmstate_list *)0 ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Search Declar | +| | +\------------------------------------------------------------*/ + +rtldecl_list *searchrtldecl( Figure, Name ) + + rtlfig_list *Figure; + char *Name; +{ + authelem *Element; + + Name = namealloc( Name ); + Element = searchauthelem( Figure->HASH_DECLAR, Name ); + + if ( Element != (authelem *)0 ) + { + return( (rtldecl_list *)Element->VALUE ); + } + + return( (rtldecl_list *)0 ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Search Symbol | +| | +\------------------------------------------------------------*/ + +rtlsym *searchrtlsym( Figure, Name, Index ) + + rtlfig_list *Figure; + char *Name; + short Index; +{ + authtable *HashTable; + authelem *Element; + vexexpr *Atom; + rtldecl_list *Decl; + short Bound; + + Name = namealloc( Name ); + HashTable = Figure->HASH_DECLAR; + Element = searchauthelem( HashTable, Name ); + + if ( Element != (authelem *)0 ) + { + Decl = (rtldecl_list *)( Element->VALUE ); + Atom = Decl->VEX_ATOM; + Bound = Atom->WIDTH - 1; + + if ( Index == -1 ) + { + if ( Bound == 0 ) return( Decl->DECL_SYM ); + } + else + { + if ( IsVexAtomDown( Atom ) ) + { + if ( ( Index <= Atom->LEFT ) && + ( Index >= Atom->RIGHT ) ) + { + Index -= Atom->RIGHT; + + return( &Decl->DECL_SYM[ Bound - Index ] ); + } + } + else + { + if ( ( Index >= Atom->LEFT ) && + ( Index <= Atom->RIGHT ) ) + { + Index -= Atom->LEFT; + + return( &Decl->DECL_SYM[ Index ] ); + } + } + } + } + + return( (rtlsym *)0 ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Search Model | +| | +\------------------------------------------------------------*/ + +rtlmod_list *searchrtlmod( Figure, Name ) + + rtlfig_list *Figure; + char *Name; +{ + authelem *Element; + + Name = namealloc( Name ); + Element = searchauthelem( Figure->HASH_MODEL, Name ); + + if ( Element != (authelem *)0 ) + { + return( (rtlmod_list *)( Element->VALUE ) ); + } + + return( (rtlmod_list *)0 ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Search Model Port | +| | +\------------------------------------------------------------*/ + +rtlport_list *searchrtlmodport( Figure, Model, Name ) + + rtlfig_list *Figure; + rtlmod_list *Model; + char *Name; +{ + rtlport_list *RtlPort; + char *Value; + + + Name = namealloc( Name ); + + for ( RtlPort = Model->PORT; + RtlPort != (rtlport_list *)0; + RtlPort = RtlPort->NEXT ) + { + Value = getvexarrayname( RtlPort->VEX_ATOM ); + + if ( Value == Name ) break; + } + + return( RtlPort ); +} + +/*------------------------------------------------------------\ +| | +| Rtl Search Instance | +| | +\------------------------------------------------------------*/ + +rtlins_list *searchrtlins( Figure, Name ) + + rtlfig_list *Figure; + char *Name; +{ + authelem *Element; + + Name = namealloc( Name ); + Element = searchauthelem( Figure->HASH_INSTANCE, Name ); + + if ( Element != (authelem *)0 ) + { + return( (rtlins_list *)( Element->VALUE ) ); + } + + return( (rtlins_list *)0 ); +} + diff --git a/alliance/src/rtn/src/rtnsearch.h b/alliance/src/rtn/src/rtnsearch.h new file mode 100644 index 00000000..96314750 --- /dev/null +++ b/alliance/src/rtn/src/rtnsearch.h @@ -0,0 +1,75 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtl | +| | +| File : rtlsearch.h | +| | +| Date : 04.07.96 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef RTL_SEARCH_H +# define RTL_SEARCH_H + +/*------------------------------------------------------------\ +| | +| Macro | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif diff --git a/alliance/src/rtn/src/rtnview.c b/alliance/src/rtn/src/rtnview.c new file mode 100644 index 00000000..22589b10 --- /dev/null +++ b/alliance/src/rtn/src/rtnview.c @@ -0,0 +1,648 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtl | +| | +| File : rtnview.c | +| | +| Date : 28.08.96 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Include Files | +| | +\------------------------------------------------------------*/ + +# include "mut.h" +# include "aut.h" +# include "vex.h" +# include "rtn.h" + +# include +# include "rtnview.h" +# include "rtnerror.h" + +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl View Functions | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Rtl View Symbol | +| | +\------------------------------------------------------------*/ + +void viewrtlsym( Symbol ) + + rtlsym *Symbol; +{ + fprintf( stdout, "\n--> Symbol" ); + fprintf( stdout, "\n\t\tNAME : %s", Symbol->NAME ); + + fprintf( stdout, "\n\t\tDECL : " ); + viewvexexprbound( Symbol->DECL->VEX_ATOM ); + + fprintf( stdout, "\n\t\tINDEX : %d", (int)Symbol->INDEX ); + fprintf( stdout, "\n\t\tINIT : '%c'", Symbol->INIT ); + fprintf( stdout, "\n\t\tEFFEC : '%c'", Symbol->EFFEC ); + fprintf( stdout, "\n\t\tDRIVE : '%c'", Symbol->DRIVE ); + fprintf( stdout, "\n\t\tEVENT : %d" , Symbol->EVENT ); + + fprintf( stdout, "\n\t\tFLAGS : %lx", Symbol->FLAGS ); + fprintf( stdout, "\n\t\tUSER : %lx", (long)Symbol->USER ); + fprintf( stdout, "\n<-- Symbol" ); +} + +/*------------------------------------------------------------\ +| | +| Rtl View Declaration | +| | +\------------------------------------------------------------*/ + +void viewrtldecl( Decl ) + + rtldecl_list *Decl; +{ + rtlsym *DeclSym; + int Scan; + int Width; + + fprintf( stdout, "\n--> Declaration" ); + + fprintf( stdout, "\n\t\tVEX_ATOM : " ); + viewvexexprbound( Decl->VEX_ATOM ); + + fprintf( stdout, "\n\t\tVEX_INIT : " ); + viewvexexprbound( Decl->VEX_INIT ); + + fprintf( stdout, "\n\t\tDECL_SYM :\n" ); + + DeclSym = Decl->DECL_SYM; + Width = Decl->VEX_ATOM->WIDTH; + + for ( Scan = 0; Scan < Width; Scan++ ) + { + viewrtlsym( &DeclSym[ Scan ] ); + } + + if ( Decl->DIR >= RTL_MAX_DIR_TYPE ) + { + fprintf( stdout, "\n\t\tDIR : %d", (int)Decl->DIR ); + } + else + { + fprintf( stdout, "\n\t\tDIR : %s", RTL_DIR_TYPE[ Decl->DIR ] ); + } + + if ( Decl->TYPE >= RTL_MAX_DECLAR_TYPE ) + { + fprintf( stdout, "\n\t\tTYPE : %d", Decl->TYPE ); + } + else + { + fprintf( stdout, "\n\t\tTYPE : %s", RTL_DECLAR_TYPE[ Decl->TYPE ] ); + } + + if ( Decl->BASE >= VEX_MAX_TYPE ) + { + fprintf( stdout, "\n\t\tBASE : %d", Decl->BASE ); + } + else + { + fprintf( stdout, "\n\t\tBASE : %s", VEX_TYPE_NAME[ Decl->BASE ] ); + } + + if ( Decl->KIND >= RTL_MAX_KIND_TYPE ) + { + fprintf( stdout, "\n\t\tKIND : %d", Decl->KIND ); + } + else + { + fprintf( stdout, "\n\t\tKIND : %s", RTL_KIND_TYPE[ Decl->KIND ] ); + } + + fprintf( stdout, "\n\t\tFLAGS : %lx", Decl->FLAGS ); + fprintf( stdout, "\n\t\tUSER : %lx", (long)Decl->USER ); + fprintf( stdout, "\n<-- Declaration" ); +} + +/*------------------------------------------------------------\ +| | +| Rtl View BiVex | +| | +\------------------------------------------------------------*/ + +void viewrtlbivex( BiVex ) + + rtlbivex_list *BiVex; +{ + fprintf( stdout, "\n--> BiVex" ); + + fprintf( stdout, "\n\t\tVEX_COND : " ); + + viewvexexprbound( BiVex->VEX_COND ); + + fprintf( stdout, "\n\t\tVEX_DATA : \n" ); + + viewvexexprbound( BiVex->VEX_DATA ); + + if ( BiVex->TYPE >= RTL_MAX_BIVEX_TYPE ) + { + fprintf( stdout, "\n\t\tTYPE : %d", BiVex->TYPE ); + } + else + { + fprintf( stdout, "\n\t\tTYPE : %s", RTL_BIVEX_TYPE[ BiVex->TYPE ] ); + } + + fprintf( stdout, "\n\t\tFLAGS : %lx", BiVex->FLAGS ); + fprintf( stdout, "\n\t\tUSER : %lx", (long)BiVex->USER ); + fprintf( stdout, "\n<-- BiVex" ); +} + +/*------------------------------------------------------------\ +| | +| Rtl View Assign | +| | +\------------------------------------------------------------*/ + +void viewrtlasg( Asg ) + + rtlasg_list *Asg; +{ + rtlbivex_list *BiVex; + + fprintf( stdout, "\n--> Assign" ); + + if ( Asg->TYPE >= RTL_MAX_ASG_TYPE ) + { + fprintf( stdout, "\n\t\tTYPE : %d", Asg->TYPE ); + } + else + { + fprintf( stdout, "\n\t\tTYPE : %s", RTL_ASG_TYPE[ Asg->TYPE ] ); + } + + if ( Asg->REG_TYPE >= RTL_MAX_ASG_REGISTER_TYPE ) + { + fprintf( stdout, "\n\t\tREG_TYPE : %d", Asg->REG_TYPE ); + } + else + { + fprintf( stdout, "\n\t\tREG_TYPE : %s", RTL_ASG_REGISTER_TYPE[ Asg->REG_TYPE ] ); + } + + fprintf( stdout, "\n\t\tVEX_ATOM : " ); + + viewvexexprbound( Asg->VEX_ATOM ); + + fprintf( stdout, "\n\t\tVEX_DATA : \n" ); + + viewvexexprbound( Asg->VEX_DATA ); + + fprintf( stdout, "\n\t\tBIVEX : \n" ); + + for ( BiVex = Asg->BIVEX; + BiVex != (rtlbivex_list *)0; + BiVex = BiVex->NEXT ) + { + viewrtlbivex( BiVex ); + } + + fprintf( stdout, "\n\t\tFLAGS : %lx", Asg->FLAGS ); + fprintf( stdout, "\n\t\tUSER : %lx", (long)Asg->USER ); + + fprintf( stdout, "\n<-- Assign" ); +} + +/*------------------------------------------------------------\ +| | +| Rtl View Fsm Assign | +| | +\------------------------------------------------------------*/ + +void viewrtlfsmasg( Asg ) + + rtlfsmasg_list *Asg; +{ + fprintf( stdout, "\n--> Fsm Assign" ); + + fprintf( stdout, "\n\t\tVEX_ATOM : " ); + + viewvexexprbound( Asg->VEX_ATOM ); + + fprintf( stdout, "\n\t\tVEX_DATA : \n" ); + + viewvexexprbound( Asg->VEX_DATA ); + + fprintf( stdout, "\n\t\tFLAGS : %lx", Asg->FLAGS ); + fprintf( stdout, "\n\t\tUSER : %lx", (long)Asg->USER ); + + fprintf( stdout, "\n<-- Fsm Assign" ); +} + +/*------------------------------------------------------------\ +| | +| Rtl View Fsm State | +| | +\------------------------------------------------------------*/ + +void viewrtlfsmstate( State ) + + rtlfsmstate_list *State; +{ + rtlfsmasg_list *FsmAsg; + + fprintf( stdout, "\n--> State" ); + fprintf( stdout, "\n\tNAME : %s", State->NAME ); + + for ( FsmAsg = State->ASSIGN; + FsmAsg != (rtlfsmasg_list *)0; + FsmAsg = FsmAsg->NEXT ) + { + viewrtlfsmasg( FsmAsg ); + } + + fprintf( stdout, "\n\tFLAGS : %lx", State->FLAGS ); + fprintf( stdout, "\n\tUSER : %lx", (long)State->USER ); +} + +/*------------------------------------------------------------\ +| | +| Rtl View Fsm Trans | +| | +\------------------------------------------------------------*/ + +void viewrtlfsmtrans( Trans ) + + rtlfsmtrans_list *Trans; +{ + rtlfsmasg_list *FsmAsg; + + fprintf( stdout, "\n--> Trans" ); + + if ( Trans->FROM != (rtlfsmstate_list *)0 ) + { + fprintf( stdout, "\n\tFROM : %s", Trans->FROM->NAME ); + } + + if ( Trans->TO != (rtlfsmstate_list *)0 ) + { + fprintf( stdout, "\n\tTO : %s", Trans->TO->NAME ); + } + + fprintf( stdout, "\n\t\tVEX_COND : " ); + + viewvexexprbound( Trans->VEX_COND ); + + for ( FsmAsg = Trans->ASSIGN; + FsmAsg != (rtlfsmasg_list *)0; + FsmAsg = FsmAsg->NEXT ) + { + viewrtlfsmasg( FsmAsg ); + } + + fprintf( stdout, "\n\tFLAGS : %lx", Trans->FLAGS ); + fprintf( stdout, "\n\tUSER : %lx", (long)Trans->USER ); +} + +/*------------------------------------------------------------\ +| | +| Rtl View Fsm | +| | +\------------------------------------------------------------*/ + +void viewrtlfsm( Fsm ) + + rtlfsm_list *Fsm; +{ + rtlfsmtrans_list *FsmTrans; + rtlfsmstate_list *FsmState; + + fprintf( stdout, "\n--> Fsm" ); + fprintf( stdout, "\n\tNAME : %s", Fsm->NAME ); + + fprintf( stdout, "\n\tSTATE : " ); + + for ( FsmState = Fsm->STATE; + FsmState != (rtlfsmstate_list *)0; + FsmState = FsmState->NEXT ) + { + viewrtlfsmstate( FsmState ); + } + + fprintf( stdout, "\n\tTRANS : " ); + + for ( FsmTrans = Fsm->TRANS; + FsmTrans != (rtlfsmtrans_list *)0; + FsmTrans = FsmTrans->NEXT ) + { + viewrtlfsmtrans( FsmTrans ); + } + + fprintf( stdout, "\n\tFLAGS : %lx", Fsm->FLAGS ); + fprintf( stdout, "\n\tUSER : %lx", (long)Fsm->USER ); + + fprintf( stdout, "\n<-- Fsm" ); +} + +/*------------------------------------------------------------\ +| | +| Rtl View Port | +| | +\------------------------------------------------------------*/ + +void viewrtlport( Port ) + + rtlport_list *Port; +{ + fprintf( stdout, "\n--> Port" ); + + fprintf( stdout, "\n\t\tVEX_ATOM : " ); + viewvexexprbound( Port->VEX_ATOM ); + + if ( Port->DIR >= RTL_MAX_DIR_TYPE ) + { + fprintf( stdout, "\n\t\tDIR : %d", (int)Port->DIR ); + } + else + { + fprintf( stdout, "\n\t\tDIR : %s", RTL_DIR_TYPE[ Port->DIR ] ); + } + + if ( Port->BASE >= VEX_MAX_TYPE ) + { + fprintf( stdout, "\n\t\tBASE : %d", Port->BASE ); + } + else + { + fprintf( stdout, "\n\t\tBASE : %s", VEX_TYPE_NAME[ Port->BASE ] ); + } + + fprintf( stdout, "\n\t\tFLAGS : %lx", Port->FLAGS ); + fprintf( stdout, "\n\t\tUSER : %lx", (long)Port->USER ); + fprintf( stdout, "\n<-- Port" ); +} + +/*------------------------------------------------------------\ +| | +| Rtl View Map | +| | +\------------------------------------------------------------*/ + +void viewrtlmap( Map ) + + rtlmap_list *Map; +{ + fprintf( stdout, "\n--> Map" ); + + fprintf( stdout, "\n\t\tFORMAL : " ); + + viewvexexprbound( Map->VEX_FORMAL ); + + fprintf( stdout, "\n\t\tACTUAL : " ); + + viewvexexprbound( Map->VEX_ACTUAL ); + + fprintf( stdout, "\n\t\tFLAGS : %lx", Map->FLAGS ); + fprintf( stdout, "\n\t\tUSER : %lx", (long)Map->USER ); + fprintf( stdout, "\n<-- Map" ); +} + +/*------------------------------------------------------------\ +| | +| Vpn View Generic | +| | +\------------------------------------------------------------*/ + +void viewrtlgen( Generic ) + + rtlgen_list *Generic; +{ + fprintf( stdout, "\n--> Generic" ); + + fprintf( stdout, "\n\t\tATOM : " ); + + viewvexexprbound( Generic->VEX_ATOM ); + + fprintf( stdout, "\n\t\tEXPR : " ); + + viewvexexprbound( Generic->VEX_EXPR ); + + if ( Generic->BASE >= VEX_MAX_TYPE ) + { + fprintf( stdout, "\n\t\tBASE : %d", Generic->BASE ); + } + else + { + fprintf( stdout, "\n\t\tBASE : %s", VEX_TYPE_NAME[ Generic->BASE ] ); + } + + fprintf( stdout, "\n\t\tFLAGS : %lx", Generic->FLAGS ); + fprintf( stdout, "\n\t\tUSER : %lx", (long)Generic->USER ); + fprintf( stdout, "\n<-- Generic" ); +} + +/*------------------------------------------------------------\ +| | +| Rtl View Model | +| | +\------------------------------------------------------------*/ + +void viewrtlmod( Model ) + + rtlmod_list *Model; +{ + rtlport_list *ScanPort; + rtlgen_list *ScanGeneric; + + fprintf( stdout, "\n--> Model" ); + + fprintf( stdout, "\n\t\tNAME : %s", Model->NAME ); + + fprintf( stdout, "\n\t\tPORT :" ); + + for ( ScanPort = Model->PORT; + ScanPort != (rtlport_list *)0; + ScanPort = ScanPort->NEXT ) + { + viewrtlport( ScanPort ); + } + + fprintf( stdout, "\n\t\tGENERIC:" ); + + for ( ScanGeneric = Model->GENERIC; + ScanGeneric != (rtlgen_list *)0; + ScanGeneric = ScanGeneric->NEXT ) + { + viewrtlgen( ScanGeneric ); + } + + fprintf( stdout, "\n\t\tFLAGS : %lx", Model->FLAGS ); + fprintf( stdout, "\n\t\tUSER : %lx", (long)Model->USER ); + fprintf( stdout, "\n<-- Model" ); +} + +/*------------------------------------------------------------\ +| | +| Rtl View Instance | +| | +\------------------------------------------------------------*/ + +void viewrtlins( Instance ) + + rtlins_list *Instance; +{ + rtlmap_list *ScanMap; + rtlgen_list *ScanGeneric; + + fprintf( stdout, "\n--> Instance" ); + + fprintf( stdout, "\n\t\tNAME : %s", Instance->NAME ); + fprintf( stdout, "\n\t\tMODEL : %s", Instance->MODEL->NAME ); + + fprintf( stdout, "\n\t\tMAP :" ); + + for ( ScanMap = Instance->MAP; + ScanMap != (rtlmap_list *)0; + ScanMap = ScanMap->NEXT ) + { + viewrtlmap( ScanMap ); + } + + fprintf( stdout, "\n\t\tGENERIC:" ); + + for ( ScanGeneric = Instance->GENERIC; + ScanGeneric != (rtlgen_list *)0; + ScanGeneric = ScanGeneric->NEXT ) + { + viewrtlgen( ScanGeneric ); + } + + + fprintf( stdout, "\n\t\tFLAGS : %lx", Instance->FLAGS ); + fprintf( stdout, "\n\t\tUSER : %lx", (long)Instance->USER ); + fprintf( stdout, "\n<-- Model" ); +} + +/*------------------------------------------------------------\ +| | +| Rtl View Figure | +| | +\------------------------------------------------------------*/ + +void viewrtlfig( Figure ) + + rtlfig_list *Figure; +{ + rtlmod_list *Model; + rtlins_list *Instance; + rtldecl_list *Decl; + rtlasg_list *Assign; + rtlfsm_list *Fsm; + int Type; + + fprintf( stdout, "\n--> Figure" ); + fprintf( stdout, "\n\tNAME : %s", Figure->NAME ); + + for ( Type = 0; Type < RTL_MAX_DECLAR_TYPE; Type++ ) + { + fprintf( stdout, "\n\tDECLARATION %s : ", RTL_DECLAR_TYPE[ Type ] ); + + for ( Decl = Figure->DECLAR[ Type ]; + Decl != (rtldecl_list *)0; + Decl = Decl->NEXT ) + { + viewrtldecl( Decl ); + } + } + + fprintf( stdout, "\n\tMODEL :" ); + + for ( Model = Figure->MODEL; + Model != (rtlmod_list *)0; + Model = Model->NEXT ) + { + viewrtlmod( Model ); + } + + fprintf( stdout, "\n\tINSTANCE :" ); + + for ( Instance = Figure->INSTANCE; + Instance != (rtlins_list *)0; + Instance = Instance->NEXT ) + { + viewrtlins( Instance ); + } + + fprintf( stdout, "\n\tASSIGN : " ); + + for ( Assign = Figure->ASSIGN; + Assign != (rtlasg_list *)0; + Assign = Assign->NEXT ) + { + viewrtlasg( Assign ); + } + + fprintf( stdout, "\n\tFSM : " ); + + for ( Fsm = Figure->FSM; + Fsm != (rtlfsm_list *)0; + Fsm = Fsm->NEXT ) + { + viewrtlfsm( Fsm ); + } + + fprintf( stdout, "\n\tFLAGS : %lx", Figure->FLAGS ); + fprintf( stdout, "\n\tUSER : %lx", (long)Figure->USER ); + fprintf( stdout, "\n<-- Figure\n" ); +} diff --git a/alliance/src/rtn/src/rtnview.h b/alliance/src/rtn/src/rtnview.h new file mode 100644 index 00000000..c1cf0898 --- /dev/null +++ b/alliance/src/rtn/src/rtnview.h @@ -0,0 +1,75 @@ +/*------------------------------------------------------------\ +| | +| 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 : Rtn | +| | +| File : rtnview.h | +| | +| Date : 04.07.96 | +| | +| Author : Jacomme Ludovic | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Constants | +| | +\------------------------------------------------------------*/ + +# ifndef RTL_VIEW_H +# define RTL_VIEW_H + +/*------------------------------------------------------------\ +| | +| Macro | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Types | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Variables | +| | +\------------------------------------------------------------*/ +/*------------------------------------------------------------\ +| | +| Functions | +| | +\------------------------------------------------------------*/ + +# endif