Librairie CTL
This commit is contained in:
parent
de55a57c94
commit
8f70ec4cd5
|
@ -0,0 +1 @@
|
|||
SUBDIRS = src
|
|
@ -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 <Frederic.Petrot@lip6.fr>
|
||||
dnl $Id: configure.in,v 1.1 2002/04/18 15:24:28 ludo Exp $
|
||||
dnl
|
||||
dnl
|
||||
AC_INIT(src/ctl.h)
|
||||
AM_INIT_AUTOMAKE(ctl, 1.1)
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_CC
|
||||
AC_HEADER_STDC
|
||||
AC_C_CONST
|
||||
AC_PROG_RANLIB
|
||||
|
||||
AM_ALLIANCE
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
src/Makefile
|
||||
])
|
|
@ -0,0 +1,7 @@
|
|||
AM_CFLAGS = @ALLIANCE_CFLAGS@
|
||||
lib_LIBRARIES = libCtl.a
|
||||
include_HEADERS = ctl.h
|
||||
libCtl_a_SOURCES = \
|
||||
ctladd.c ctlalloc.h ctlenv.c ctlerror.h ctl.h ctlview.c \
|
||||
ctladd.h ctldel.c ctlenv.h ctlfree.c ctlsearch.c ctlview.h \
|
||||
ctlalloc.c ctldel.h ctlerror.c ctlfree.h ctlsearch.h
|
|
@ -0,0 +1,436 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
#ifndef __P
|
||||
# if defined(__STDC__) || defined(__GNUC__)
|
||||
# define __P(x) x
|
||||
# else
|
||||
# define __P(x) ()
|
||||
# endif
|
||||
#endif
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Title : Structures and fonctions for CTL |
|
||||
| |
|
||||
| Date : 04.18.2002 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
# ifndef CTL_H
|
||||
# define CTL_H
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Direction |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
# define CTL_DIR_IN 0
|
||||
# define CTL_DIR_OUT 1
|
||||
# define CTL_DIR_INOUT 2
|
||||
# define CTL_MAX_DIR_TYPE 3
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Kind |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
# define CTL_KIND_NONE 0
|
||||
# define CTL_KIND_BUS 1
|
||||
# define CTL_KIND_REGISTER 2
|
||||
# define CTL_MAX_KIND_TYPE 3
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Declar Type |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
# define CTL_DECLAR_ALL 0
|
||||
# define CTL_DECLAR_PORT 1
|
||||
# define CTL_DECLAR_SIGNAL 2
|
||||
# define CTL_DECLAR_VARIABLE 3
|
||||
# define CTL_DECLAR_DEFINE 4
|
||||
# define CTL_DECLAR_CONSTANT 5
|
||||
# define CTL_MAX_DECLAR_TYPE 6
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Macros |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Get Symbol |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
# define GetCtlSymbol( C ) ((ctlsym *)( (C)->DATA ))
|
||||
# define GetCtlDeclar( C ) ((ctldecl_list *)( (C)->DATA ))
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Get Arc |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
# define GetCtlArc( C ) \
|
||||
((ctlarc *)( (C)->DATA ))
|
||||
|
||||
# define GetCtlArcTargetPlace( A ) \
|
||||
((ctlplace_list *)( (ctlarc *)(A)->TARGET ))
|
||||
|
||||
# define GetCtlArcSourcePlace( A ) \
|
||||
((ctlplace_list *)( (ctlarc *)(A)->SOURCE ))
|
||||
|
||||
# define GetCtlArcTargetTrans( A ) \
|
||||
((ctltrans_list *)( (ctlarc *)(A)->TARGET ))
|
||||
|
||||
# define GetCtlArcSourceTrans( A ) \
|
||||
((ctltrans_list *)( (ctlarc *)(A)->SOURCE ))
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Add Arc |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
# define addctlarctrans( F, T, P ) \
|
||||
(addctlarc( (F), (T), (P), CTL_ARC_TRANS_PLACE ))
|
||||
|
||||
# define addctlarcplace( F, P, T ) \
|
||||
(addctlarc( (F), (P), (T), CTL_ARC_PLACE_TRANS ))
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Add Action |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
# define addctlactcall( F, T, E ) \
|
||||
(addctlact( (F), (T), (vexexpr *)0, (E), CTL_ACT_CALL ))
|
||||
|
||||
# define addctlactreturn( F, T, E ) \
|
||||
(addctlact( (F), (T), (vexexpr *)0, (E), CTL_ACT_RETURN ))
|
||||
|
||||
# define addctlactcallafter( F, T, P, E ) \
|
||||
(addctlactafter( (F), (T), (P), (vexexpr *)0, (E), CTL_ACT_CALL ))
|
||||
|
||||
# define addctlactreturnafter( F, T, P, E ) \
|
||||
(addctlactafter( (F), (T), (P), (vexexpr *)0, (E), CTL_ACT_RETURN ))
|
||||
|
||||
# define addctlactcallbefore( F, T, P, E ) \
|
||||
(addctlactbefore( (F), (T), (P), (vexexpr *)0, (E), CTL_ACT_CALL ))
|
||||
|
||||
# define addctlactreturnbefore( F, T, P, E ) \
|
||||
(addctlactafter( (F), (T), (P), (vexexpr *)0, (E), CTL_ACT_RETURN ))
|
||||
|
||||
# define addctlactcallfirst( F, T, E ) \
|
||||
(addctlactfirst( (F), (T), (vexexpr *)0, (E), CTL_ACT_CALL ))
|
||||
|
||||
# define addctlactreturnfirst( F, T, E ) \
|
||||
(addctlactfirst( (F), (T), (vexexpr *)0, (E), CTL_ACT_RETURN ))
|
||||
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Get Number |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
# define GetCtlNumProc( F ) ((F)->HASH_PROCESS->NUMBER_ELEM)
|
||||
# define GetCtlNumFunc( F ) ((F)->HASH_FUNCTION->NUMBER_ELEM)
|
||||
# define GetCtlNumTrans( F ) ((F)->HASH_TRANS->NUMBER_ELEM)
|
||||
# define GetCtlNumPlace( F ) ((F)->HASH_PLACE->NUMBER_ELEM)
|
||||
# define GetCtlNumArc( F ) ((F)->HASH_ARC->NUMBER_ELEM)
|
||||
|
||||
# define GetCtlNumDecl( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_ALL ]->NUMBER_ELEM)
|
||||
# define GetCtlNumDeclPort( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_PORT ]->NUMBER_ELEM)
|
||||
# define GetCtlNumDeclSig( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_SIGNAL ]->NUMBER_ELEM)
|
||||
# define GetCtlNumDeclVar( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_VARIABLE ]->NUMBER_ELEM)
|
||||
# define GetCtlNumDeclCst( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_CONSTANT ]->NUMBER_ELEM)
|
||||
# define GetCtlNumDeclDef( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_DEFINE ]->NUMBER_ELEM)
|
||||
# define GetCtlNumDeclArg( F ) ((F)->HASH_DECLAR[ CTL_DECLAR_ARGUMENT ]->NUMBER_ELEM)
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Search Symbol |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
# define searchctlsymport( F, N, I ) \
|
||||
(searchctlsym( (F), (N), (I), CTL_DECLAR_PORT ))
|
||||
# define searchctlsymsig( F, N, I ) \
|
||||
(searchctlsym( (F), (N), (I), CTL_DECLAR_SIGNAL ))
|
||||
# define searchctlsymvar( F, N, I ) \
|
||||
(searchctlsym( (F), (N), (I), CTL_DECLAR_VARIABLE ))
|
||||
# define searchctlsymcst( F, N, I ) \
|
||||
(searchctlsym( (F), (N), (I), CTL_DECLAR_CONSTANT ))
|
||||
# define searchctlsymdef( F, N, I ) \
|
||||
(searchctlsym( (F), (N), (I), CTL_DECLAR_DEFINE ))
|
||||
# define searchctlsymarg( F, N, I ) \
|
||||
(searchctlsym( (F), (N) (I), CTL_DECLAR_ARGUMENT ))
|
||||
# define searchctlsymgen( F, N, I ) \
|
||||
(searchctlsym( (F), (N), (I), CTL_DECLAR_GENERIC ))
|
||||
# define searchctlsymall( F, N, I ) \
|
||||
(searchctlsym( (F), (N), (I), CTL_DECLAR_ALL ))
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Search Declar |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
# define searchctldeclport( F, N ) \
|
||||
(searchctldecl( (F), (N), CTL_DECLAR_PORT ))
|
||||
# define searchctldeclsig( F, N ) \
|
||||
(searchctldecl( (F), (N), CTL_DECLAR_SIGNAL ))
|
||||
# define searchctldeclvar( F, N ) \
|
||||
(searchctldecl( (F), (N), CTL_DECLAR_VARIABLE ))
|
||||
# define searchctldeclcst( F, N ) \
|
||||
(searchctldecl( (F), (N), CTL_DECLAR_CONSTANT ))
|
||||
# define searchctldecldef( F, N ) \
|
||||
(searchctldecl( (F), (N), CTL_DECLAR_DEFINE ))
|
||||
# define searchctldeclarg( F, N ) \
|
||||
(searchctldecl( (F), (N), CTL_DECLAR_ARGUMENT ))
|
||||
# define searchctldeclgen( F, N ) \
|
||||
(searchctldecl( (F), (N), CTL_DECLAR_GENERIC ))
|
||||
# define searchctldeclall( F, N ) \
|
||||
(searchctldecl( (F), (N), CTL_DECLAR_ALL ))
|
||||
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Type |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Line |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
typedef struct ctlline_list
|
||||
{
|
||||
struct ctlline_list *NEXT;
|
||||
char *NAME;
|
||||
long LINE;
|
||||
|
||||
} ctlline_list;
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Symbol |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
typedef struct ctlsym
|
||||
{
|
||||
char *NAME;
|
||||
struct ctldecl_list *DECL;
|
||||
short INDEX;
|
||||
long FLAGS;
|
||||
void *USER;
|
||||
|
||||
} ctlsym;
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Declaration |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
typedef struct ctldecl_list
|
||||
{
|
||||
struct ctldecl_list *NEXT;
|
||||
struct ctldecl_list **PREV;
|
||||
vexexpr *VEX_ATOM;
|
||||
vexexpr *VEX_INIT;
|
||||
ctlsym *DECL_SYM;
|
||||
unsigned char DIR;
|
||||
unsigned char TYPE;
|
||||
unsigned char KIND;
|
||||
unsigned char BASE;
|
||||
ctlline_list *LINE;
|
||||
long FLAGS;
|
||||
void *USER;
|
||||
|
||||
} ctldecl_list;
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Formulae |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
typedef struct ctlform_list
|
||||
{
|
||||
struct ctlform_list *NEXT;
|
||||
struct ctlform_list **PREV;
|
||||
char *NAME;
|
||||
vexexpr *VEX_EXPR;
|
||||
ctlline_list *LINE;
|
||||
long FLAGS;
|
||||
void *USER;
|
||||
|
||||
} ctlform_list;
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Figure |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
typedef struct ctlfig_list
|
||||
{
|
||||
struct ctlfig_list *NEXT;
|
||||
char *NAME;
|
||||
ctlform_list *FORM;
|
||||
ctldecl_list *DECLAR[ CTL_MAX_DECLAR_TYPE ];
|
||||
authtable *HASH_DECLAR[ CTL_MAX_DECLAR_TYPE ];
|
||||
void *CIRCUIT;
|
||||
long FLAGS;
|
||||
void *USER;
|
||||
|
||||
} ctlfig_list;
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Global Variables |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
extern ctlfig_list *HEAD_CTLFIG;
|
||||
|
||||
extern char *CTL_DECLAR_TYPE [ CTL_MAX_DECLAR_TYPE ];
|
||||
extern char *CTL_DIR_TYPE [ CTL_MAX_DIR_TYPE ];
|
||||
extern char *CTL_KIND_TYPE [ CTL_MAX_KIND_TYPE ];
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Env Functions |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
extern void ctlenv __P(());
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Alloc Functions |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
extern ctlfig_list *allocctlfig __P(());
|
||||
extern ctlform_list *allocctlform __P(());
|
||||
extern ctldecl_list *allocctldecl __P(());
|
||||
extern ctlsym *allocctlsym __P((unsigned int Width));
|
||||
extern ctlline_list *allocctlline __P(());
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Free Functions |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
extern void freectlfig __P((ctlfig_list *Figure));
|
||||
extern void freectlform __P((ctlform_list *Form));
|
||||
extern void freectldecl __P((ctldecl_list *Decl));
|
||||
extern void freectlsym __P((ctlsym *Sym));
|
||||
extern void freectlline __P((ctlline_list *Line));
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Add Functions |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
extern ctlfig_list *addctlfig __P((char *Name));
|
||||
extern ctlform_list *addctlform __P((ctlfig_list *Figure, char *Name, vexexpr *Expr));
|
||||
|
||||
extern ctldecl_list *addctldecl __P((ctlfig_list *Figure, vexexpr *Atom, unsigned char Type, unsigned char Base));
|
||||
extern ctldecl_list *addctldeclport __P((ctlfig_list *Figure, vexexpr *Atom, unsigned char Base, unsigned char Dir, unsigned char Kind));
|
||||
extern ctldecl_list *addctldeclsig __P((ctlfig_list *Figure, vexexpr *Atom, unsigned char Base, unsigned char Kind));
|
||||
extern ctldecl_list *addctldeclcst __P((ctlfig_list *Figure, vexexpr *Atom, unsigned char Base));
|
||||
|
||||
extern ctlline_list *addctlline __P((ctlfig_list *Figure, ctlline_list **HeadLine, long Line));
|
||||
extern ctlline_list *addctlfileline __P((ctlfig_list *Figure, ctlline_list **HeadLine, char *File, long Line));
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Get Functions |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
extern ctlsym *getctlsymdecl __P((ctldecl_list *Declar, short Index));
|
||||
extern ctlsym *getctlsymdeclpos __P((ctldecl_list *Declar, int Position));
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Search Functions |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
extern ctlfig_list *searchctlfig __P((char *Name));
|
||||
extern ctlform_list *searchctlform __P((ctlfig_list *Figure, char *Name));
|
||||
extern ctlsym *searchctlsym __P((ctlfig_list *Figure, char *Name, short Index, unsigned char Type));
|
||||
extern ctldecl_list *searchctldecl __P((ctlfig_list *Figure, char *Name, unsigned char Type));
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Delete Functions |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
extern int delctlfig __P((char *Name));
|
||||
extern int delctlline __P((ctlfig_list *Figure, ctlline_list **PrevLine, ctlline_list *Line));
|
||||
extern int delctlform __P((ctlfig_list *Figure, ctlform_list *Form));
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| View Functions |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
extern void viewctlfig __P((ctlfig_list *Figure));
|
||||
extern void viewctlsym __P((ctlsym *Symbol));
|
||||
extern void viewctldecl __P((ctldecl_list *Decl));
|
||||
extern void viewctlform __P((ctlform_list *Form));
|
||||
extern void viewctlline __P((ctlline_list *Line));
|
||||
|
||||
# endif
|
|
@ -0,0 +1,426 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : Ctl |
|
||||
| |
|
||||
| File : ctladd.c |
|
||||
| |
|
||||
| Date : 18.04.02 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "ctl.h"
|
||||
|
||||
# include <stdio.h>
|
||||
# include "ctladd.h"
|
||||
# include "ctlerror.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctlfig_list *HEAD_CTLFIG = (ctlfig_list *)0;
|
||||
|
||||
char *CTL_DECLAR_TYPE[ CTL_MAX_DECLAR_TYPE ] =
|
||||
{
|
||||
"ALL",
|
||||
"PORT",
|
||||
"SIGNAL",
|
||||
"CONSTANT"
|
||||
};
|
||||
|
||||
char *CTL_KIND_TYPE[ CTL_MAX_KIND_TYPE ] =
|
||||
{
|
||||
"NONE",
|
||||
"BUS",
|
||||
"REGISTER"
|
||||
};
|
||||
|
||||
char *CTL_DIR_TYPE[ CTL_MAX_DIR_TYPE ] =
|
||||
{
|
||||
"IN",
|
||||
"OUT",
|
||||
"INOUT"
|
||||
};
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Add Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Add Figure |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctlfig_list *addctlfig( Name )
|
||||
|
||||
char *Name;
|
||||
{
|
||||
ctlfig_list *Figure;
|
||||
int Type;
|
||||
|
||||
Figure = allocctlfig();
|
||||
|
||||
Figure->NAME = namealloc( Name );
|
||||
Figure->NEXT = HEAD_CTLFIG;
|
||||
HEAD_CTLFIG = Figure;
|
||||
|
||||
for ( Type = 0; Type < CTL_MAX_DECLAR_TYPE; Type++ )
|
||||
{
|
||||
Figure->HASH_DECLAR[ Type ] = createauthtable( 50 );
|
||||
}
|
||||
|
||||
return( Figure );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Add Declaration |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static ctldecl_list *loc_addctldecl( Figure, Expr, Type, Base )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
vexexpr *Expr;
|
||||
unsigned char Type;
|
||||
unsigned char Base;
|
||||
{
|
||||
ctldecl_list *Decl;
|
||||
ctldecl_list **PrevDecl;
|
||||
vexexpr *Atom;
|
||||
ctlsym *Sym;
|
||||
char *Name;
|
||||
int Width;
|
||||
int Index;
|
||||
int IndexStep;
|
||||
int Scan;
|
||||
|
||||
if ( ! IsVexNodeAtom( Expr ) )
|
||||
{
|
||||
Atom = getvexarrayatom( Expr );
|
||||
}
|
||||
else
|
||||
{
|
||||
Atom = Expr;
|
||||
}
|
||||
|
||||
Name = GetVexAtomValue( Atom );
|
||||
|
||||
if ( ( Type <= CTL_DECLAR_ALL ) ||
|
||||
( Type >= CTL_MAX_DECLAR_TYPE ) )
|
||||
{
|
||||
ctlerror( CTL_UNKNOWN_DECLAR_TYPE, Type, Name );
|
||||
}
|
||||
|
||||
Decl = allocctldecl();
|
||||
|
||||
Width = Atom->WIDTH;
|
||||
Sym = allocctlsym( 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 = Expr;
|
||||
Decl->DECL_SYM = Sym;
|
||||
Decl->TYPE = Type;
|
||||
Decl->BASE = Base;
|
||||
Decl->PREV = &Figure->DECLAR[ Type ];
|
||||
Decl->NEXT = *(Decl->PREV);
|
||||
|
||||
if ( Decl->NEXT != (ctldecl_list *)0 )
|
||||
{
|
||||
Decl->NEXT->PREV = &Decl->NEXT;
|
||||
}
|
||||
|
||||
*(Decl->PREV) = Decl;
|
||||
|
||||
addauthelem( Figure->HASH_DECLAR[ Type ], Name, (long)Decl );
|
||||
addauthelem( Figure->HASH_DECLAR[ CTL_DECLAR_ALL ], Name, (long)Decl );
|
||||
|
||||
return( Decl );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Add Declaration |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctldecl_list *addctldecl( Figure, Atom, Type, Base )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
vexexpr *Atom;
|
||||
unsigned char Type;
|
||||
unsigned char Base;
|
||||
{
|
||||
ctldecl_list *Decl;
|
||||
char *Name;
|
||||
|
||||
if ( ! IsVexNodeAtom( Atom ) ) Name = getvexarrayname( Atom );
|
||||
else Name = GetVexAtomValue( Atom );
|
||||
|
||||
Decl = searchctldeclall( Figure, Name );
|
||||
|
||||
if ( Decl != (ctldecl_list *)0 )
|
||||
{
|
||||
ctlerror( CTL_DECLAR_EXIST_ERROR, Name, 0 );
|
||||
}
|
||||
|
||||
Decl = loc_addctldecl( Figure, Atom, Type, Base );
|
||||
|
||||
return( Decl );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Add Declaration Port |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctldecl_list *addctldeclport( Figure, Atom, Base, Dir, Kind )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
vexexpr *Atom;
|
||||
unsigned char Base;
|
||||
unsigned char Dir;
|
||||
unsigned char Kind;
|
||||
{
|
||||
ctldecl_list *Port;
|
||||
char *Name;
|
||||
|
||||
if ( ! IsVexNodeAtom( Atom ) ) Name = getvexarrayname( Atom );
|
||||
else Name = GetVexAtomValue( Atom );
|
||||
|
||||
Port = searchctldeclall( Figure, Name );
|
||||
|
||||
if ( Port != (ctldecl_list *)0 )
|
||||
{
|
||||
ctlerror( CTL_PORT_EXIST_ERROR, Name, 0 );
|
||||
}
|
||||
|
||||
Port = loc_addctldecl( Figure, Atom, CTL_DECLAR_PORT, Base );
|
||||
Port->DIR = Dir;
|
||||
Port->KIND = Kind;
|
||||
|
||||
return( Port );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Add Declaration Signal |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctldecl_list *addctldeclsig( Figure, Atom, Base, Kind )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
vexexpr *Atom;
|
||||
unsigned char Base;
|
||||
unsigned char Kind;
|
||||
{
|
||||
ctldecl_list *Signal;
|
||||
char *Name;
|
||||
|
||||
if ( ! IsVexNodeAtom( Atom ) ) Name = getvexarrayname( Atom );
|
||||
else Name = GetVexAtomValue( Atom );
|
||||
|
||||
Signal = searchctldeclall( Figure, Name );
|
||||
|
||||
if ( Signal != (ctldecl_list *)0 )
|
||||
{
|
||||
ctlerror( CTL_SIGNAL_EXIST_ERROR, Name, 0 );
|
||||
}
|
||||
|
||||
Signal = loc_addctldecl( Figure, Atom, CTL_DECLAR_SIGNAL, Base );
|
||||
Signal->DIR = CTL_DIR_INOUT;
|
||||
Signal->KIND = Kind;
|
||||
|
||||
return( Signal );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Add Declaration Constant |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctldecl_list *addctldeclcst( Figure, Atom, Base )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
vexexpr *Atom;
|
||||
unsigned char Base;
|
||||
{
|
||||
ctldecl_list *Constant;
|
||||
char *Name;
|
||||
|
||||
if ( ! IsVexNodeAtom( Atom ) ) Name = getvexarrayname( Atom );
|
||||
else Name = GetVexAtomValue( Atom );
|
||||
|
||||
Constant = searchctldeclall( Figure, Name );
|
||||
|
||||
if ( Constant != (ctldecl_list *)0 )
|
||||
{
|
||||
ctlerror( CTL_CONSTANT_EXIST_ERROR, Name, 0 );
|
||||
}
|
||||
|
||||
Constant = loc_addctldecl( Figure, Atom, CTL_DECLAR_CONSTANT, Base );
|
||||
Constant->DIR = CTL_DIR_IN;
|
||||
|
||||
return( Constant );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Add File Line |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctlline_list *addctlfileline( Figure, HeadLine, File, Line )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
ctlline_list **HeadLine;
|
||||
char *File;
|
||||
long Line;
|
||||
{
|
||||
ctlline_list **PrevLine;
|
||||
ctlline_list *CtlLine;
|
||||
|
||||
File = autnamealloc( File );
|
||||
|
||||
PrevLine = HeadLine;
|
||||
|
||||
for ( CtlLine = *PrevLine;
|
||||
CtlLine != (ctlline_list *)0;
|
||||
CtlLine = CtlLine->NEXT )
|
||||
{
|
||||
if ( CtlLine->NAME == File )
|
||||
{
|
||||
if ( CtlLine->LINE == Line ) return( CtlLine );
|
||||
if ( CtlLine->LINE < Line ) PrevLine = &CtlLine->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
CtlLine = allocctlline();
|
||||
|
||||
CtlLine->LINE = Line;
|
||||
CtlLine->NAME = File;
|
||||
CtlLine->NEXT = *PrevLine;
|
||||
*PrevLine = CtlLine;
|
||||
|
||||
return( CtlLine );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Add Line |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctlline_list *addctlline( Figure, HeadLine, Line )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
ctlline_list **HeadLine;
|
||||
long Line;
|
||||
{
|
||||
return( addctlfileline( Figure, HeadLine, (char *)0, Line ) );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Add Form |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctlform_list *addctlform( Figure, Name, Expr )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
char *Name;
|
||||
vexexpr *Expr;
|
||||
{
|
||||
ctlform_list *Form;
|
||||
|
||||
Form = allocctlform();
|
||||
|
||||
Form->NAME = namealloc( Name );;
|
||||
Form->VEX_EXPR = Expr;
|
||||
|
||||
Form->NEXT = Figure->FORM;
|
||||
Figure->FORM = Form;
|
||||
|
||||
return( Form );
|
||||
}
|
|
@ -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 : Ctl |
|
||||
| |
|
||||
| File : ctladd.h |
|
||||
| |
|
||||
| Date : 04.07.96 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef CTL_ADD_H
|
||||
# define CTL_ADD_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# endif
|
|
@ -0,0 +1,129 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : Ctl |
|
||||
| |
|
||||
| File : ctlalloc.c |
|
||||
| |
|
||||
| Date : 04.18.02 |
|
||||
| |
|
||||
| Ctlhor : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "ctl.h"
|
||||
|
||||
# include <stdio.h>
|
||||
# include "ctlalloc.h"
|
||||
# include "ctlerror.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Alloc Figure |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctlfig_list *allocctlfig()
|
||||
{
|
||||
return( (ctlfig_list *)autallocblock( sizeof( ctlfig_list ) ) );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Alloc Process |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctlform_list *allocctlform()
|
||||
{
|
||||
return( (ctlform_list *)autallocheap( sizeof( ctlform_list ) ) );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Alloc Symbol |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctlsym *allocctlsym( Width )
|
||||
|
||||
unsigned int Width;
|
||||
{
|
||||
return( (ctlsym *)autallocblock( sizeof( ctlsym ) * Width ) );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Alloc Declaration |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctldecl_list *allocctldecl()
|
||||
{
|
||||
return( (ctldecl_list *)autallocheap( sizeof( ctldecl_list ) ) );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Alloc Line |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctlline_list *allocctlline()
|
||||
{
|
||||
return( (ctlline_list *)autallocheap( sizeof( ctlline_list ) ) );
|
||||
}
|
||||
|
|
@ -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 : Ctl |
|
||||
| |
|
||||
| File : ctlalloc.h |
|
||||
| |
|
||||
| Date : 04.07.96 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef CTL_ALLOC_H
|
||||
# define CTL_ALLOC_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# endif
|
|
@ -0,0 +1,233 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : Ctl |
|
||||
| |
|
||||
| File : ctldel.c |
|
||||
| |
|
||||
| Date : 04.07.96 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "ctl.h"
|
||||
|
||||
# include <stdio.h>
|
||||
# include "ctldel.h"
|
||||
# include "ctlerror.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Del Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Del All Line |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void loc_delallctlline( ScanLine )
|
||||
|
||||
ctlline_list *ScanLine;
|
||||
{
|
||||
ctlline_list *Delete;
|
||||
|
||||
while ( ScanLine != (ctlline_list *)0 )
|
||||
{
|
||||
Delete = ScanLine;
|
||||
ScanLine = ScanLine->NEXT;
|
||||
|
||||
freectlline( Delete );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Del Declar |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void loc_delctldecl( Figure, Declar )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
ctldecl_list *Declar;
|
||||
{
|
||||
char *Name;
|
||||
|
||||
*Declar->PREV = Declar->NEXT;
|
||||
|
||||
if ( Declar->NEXT != (ctldecl_list *)0 )
|
||||
{
|
||||
Declar->NEXT->PREV = Declar->PREV;
|
||||
}
|
||||
|
||||
Name = Declar->DECL_SYM->NAME;
|
||||
delauthelem( Figure->HASH_DECLAR[ Declar->TYPE ], Name );
|
||||
delauthelem( Figure->HASH_DECLAR[ CTL_DECLAR_ALL ], Name );
|
||||
|
||||
freectlsym( Declar->DECL_SYM );
|
||||
freevexexpr( Declar->VEX_ATOM );
|
||||
freevexexpr( Declar->VEX_INIT );
|
||||
freectldecl( Declar );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Del Figure |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
int delctlfig( Name )
|
||||
|
||||
char *Name;
|
||||
{
|
||||
ctlfig_list *Figure;
|
||||
ctlfig_list **Previous;
|
||||
ctlform_list *ScanForm;
|
||||
ctldecl_list *ScanDecl;
|
||||
void *Delete;
|
||||
int Type;
|
||||
|
||||
Name = namealloc( Name );
|
||||
Previous = &HEAD_CTLFIG;
|
||||
|
||||
for ( Figure = HEAD_CTLFIG;
|
||||
Figure != (ctlfig_list *)0;
|
||||
Figure = Figure->NEXT )
|
||||
{
|
||||
if ( Figure->NAME == Name ) break;
|
||||
|
||||
Previous = &Figure->NEXT;
|
||||
}
|
||||
|
||||
if ( Figure == (ctlfig_list *)0 ) return( 0 );
|
||||
|
||||
*Previous = Figure->NEXT;
|
||||
|
||||
for ( Type = 0; Type < CTL_MAX_DECLAR_TYPE; Type++ )
|
||||
{
|
||||
destroyauthtable( Figure->HASH_DECLAR[ Type ] );
|
||||
}
|
||||
|
||||
ScanForm = Figure->FORM;
|
||||
|
||||
while ( ScanForm != (ctlform_list *)0 )
|
||||
{
|
||||
freevexexpr( ScanForm->VEX_EXPR );
|
||||
|
||||
Delete = (void *)( ScanForm );
|
||||
ScanForm = ScanForm->NEXT;
|
||||
|
||||
freectlform( Delete );
|
||||
}
|
||||
|
||||
for ( Type = 0; Type < CTL_MAX_DECLAR_TYPE; Type++ )
|
||||
{
|
||||
ScanDecl = Figure->DECLAR[ Type ];
|
||||
|
||||
while ( ScanDecl != (ctldecl_list *)0 )
|
||||
{
|
||||
loc_delallctlline( ScanDecl->LINE );
|
||||
|
||||
freevexexpr( ScanDecl->VEX_ATOM );
|
||||
freevexexpr( ScanDecl->VEX_INIT );
|
||||
freectlsym( ScanDecl->DECL_SYM );
|
||||
|
||||
Delete = (void *)( ScanDecl );
|
||||
ScanDecl = ScanDecl->NEXT;
|
||||
|
||||
freectldecl( Delete );
|
||||
}
|
||||
}
|
||||
|
||||
freectlfig( Figure );
|
||||
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Del Line |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
int delctlline( Figure, PrevLine, Line )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
ctlline_list **PrevLine;
|
||||
ctlline_list *Line;
|
||||
{
|
||||
ctlline_list *ScanLine;
|
||||
|
||||
for ( ScanLine = *PrevLine;
|
||||
ScanLine != (ctlline_list *)0;
|
||||
ScanLine = Line->NEXT )
|
||||
{
|
||||
if ( ScanLine == Line )
|
||||
{
|
||||
*PrevLine = Line->NEXT;
|
||||
freectlline( Line );
|
||||
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
PrevLine = &ScanLine->NEXT;
|
||||
}
|
||||
|
||||
return( 0 );
|
||||
}
|
|
@ -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 : Ctl |
|
||||
| |
|
||||
| File : ctldel.h |
|
||||
| |
|
||||
| Date : 04.07.96 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef CTL_DEL_H
|
||||
# define CTL_DEL_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# endif
|
|
@ -0,0 +1,88 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : Ctl |
|
||||
| |
|
||||
| File : ctlenv.c |
|
||||
| |
|
||||
| Date : 04.07.96 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "ctl.h"
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <unistd.h>
|
||||
# include "ctlenv.h"
|
||||
# include "ctlerror.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| ctlenv |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void ctlenv()
|
||||
{
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : Ctl |
|
||||
| |
|
||||
| File : ctlenv.h |
|
||||
| |
|
||||
| Date : 04.07.96 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef CTL_ENV_H
|
||||
# define CTL_ENV_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define CTL_DEFAULT_IN "vhdl"
|
||||
# define CTL_DEFAULT_OUT "vhdl"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# endif
|
|
@ -0,0 +1,207 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : Ctl |
|
||||
| |
|
||||
| File : Ctl Errors |
|
||||
| |
|
||||
| Ctlhors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 04.07.96 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <signal.h>
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "ctl.h"
|
||||
# include "ctlerror.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Error Function |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void ctl_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 CTL_PROC_EXIST_ERROR :
|
||||
fprintf( stderr, "process %s exists already\n", Text1 );
|
||||
break;
|
||||
case CTL_FUNC_EXIST_ERROR :
|
||||
fprintf( stderr, "function %s exists already\n", Text1 );
|
||||
break;
|
||||
case CTL_PLACE_EXIST_ERROR :
|
||||
fprintf( stderr, "place %s exists already\n", Text1 );
|
||||
break;
|
||||
case CTL_TRANS_EXIST_ERROR :
|
||||
fprintf( stderr, "transition %s exists already\n", Text1 );
|
||||
break;
|
||||
case CTL_PORT_EXIST_ERROR :
|
||||
fprintf( stderr, "port %s exists already\n", Text1 );
|
||||
break;
|
||||
case CTL_ARC_PLACE_EXIST_ERROR :
|
||||
fprintf( stderr, "arc place %s to %s exists already\n", Text1, Text2 );
|
||||
break;
|
||||
case CTL_ARC_TRANS_EXIST_ERROR :
|
||||
fprintf( stderr, "arc trans %s to %s exists already\n", Text1, Text2 );
|
||||
break;
|
||||
case CTL_UNKNOWN_DECLAR_TYPE :
|
||||
fprintf( stderr, "unknown declar type %ld for %s\n", (long)Text1, Text2 );
|
||||
break;
|
||||
case CTL_SIGNAL_EXIST_ERROR :
|
||||
fprintf( stderr, "signal %s exists already\n", Text1 );
|
||||
break;
|
||||
case CTL_VARIABLE_EXIST_ERROR :
|
||||
fprintf( stderr, "variable %s exists already\n", Text1 );
|
||||
break;
|
||||
case CTL_DEFINE_EXIST_ERROR :
|
||||
fprintf( stderr, "define %s exists already\n", Text1 );
|
||||
break;
|
||||
case CTL_ARGUMENT_EXIST_ERROR :
|
||||
fprintf( stderr, "argument %s exists already\n", Text1 );
|
||||
break;
|
||||
case CTL_CONSTANT_EXIST_ERROR :
|
||||
fprintf( stderr, "constant %s exists already\n", Text1 );
|
||||
break;
|
||||
case CTL_DEL_ARC_PLACE_ERROR :
|
||||
fprintf( stderr, "unable to delete arc from place %s\n", Text1 );
|
||||
break;
|
||||
case CTL_DEL_ARC_TRANS_ERROR :
|
||||
fprintf( stderr, "unable to delete arc from trans %s\n", Text1 );
|
||||
break;
|
||||
case CTL_TRANS_FATHER_UNKNOWN :
|
||||
fprintf( stderr, "unknown father type %ld for transition %s\n", (long)Text1, Text2 );
|
||||
break;
|
||||
case CTL_DECLAR_EXIST_ERROR :
|
||||
fprintf( stderr, "symbol %s already declared\n", Text1 );
|
||||
break;
|
||||
case CTL_BAD_DECLAR_TYPE :
|
||||
fprintf( stderr, "bad declaration type %ld\n", (long)Text1 );
|
||||
break;
|
||||
case CTL_BAD_ASSIGN_TYPE :
|
||||
fprintf( stderr, "bad assign %s, type %ld\n", Text1, (long)Text2 );
|
||||
break;
|
||||
case CTL_UNDECLARED_SYMBOL :
|
||||
fprintf( stderr, "undeclared symbol %s\n", Text1 );
|
||||
break;
|
||||
case CTL_ILLEGAL_POSITION_ERROR :
|
||||
fprintf( stderr, "illegal position for symbol %s %ld\n", Text1, (long)Text2 );
|
||||
break;
|
||||
case CTL_ILLEGAL_INDEX_ERROR :
|
||||
fprintf( stderr, "illegal index for symbol %s %ld\n", Text1, (long)Text2 );
|
||||
break;
|
||||
case CTL_MOD_EXIST_ERROR :
|
||||
fprintf( stderr, "model %s exists already\n", Text1 );
|
||||
break;
|
||||
case CTL_INS_EXIST_ERROR :
|
||||
fprintf( stderr, "instance %s exists already\n", Text1 );
|
||||
break;
|
||||
case CTL_GENERIC_EXIST_ERROR :
|
||||
fprintf( stderr, "generic %s exists already\n", Text1 );
|
||||
break;
|
||||
default :
|
||||
|
||||
fprintf( stderr, "unknown internal error %d !\n", Error );
|
||||
}
|
||||
|
||||
autexit( 1 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Warning Function |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void ctl_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 );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,112 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : Ctl |
|
||||
| |
|
||||
| File : Ctl Errors |
|
||||
| |
|
||||
| Ctlhors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 04.07.96 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef CTL_ERROR_H
|
||||
# define CTL_ERROR_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define CTL_PLACE_EXIST_ERROR 0
|
||||
# define CTL_TRANS_EXIST_ERROR 1
|
||||
# define CTL_PORT_EXIST_ERROR 2
|
||||
# define CTL_ARC_PLACE_EXIST_ERROR 3
|
||||
# define CTL_ARC_TRANS_EXIST_ERROR 4
|
||||
# define CTL_SIGNAL_EXIST_ERROR 6
|
||||
# define CTL_VARIABLE_EXIST_ERROR 7
|
||||
# define CTL_DEFINE_EXIST_ERROR 8
|
||||
# define CTL_CONSTANT_EXIST_ERROR 9
|
||||
# define CTL_TRANS_FATHER_UNKNOWN 10
|
||||
# define CTL_PROC_EXIST_ERROR 11
|
||||
# define CTL_DEL_ARC_PLACE_ERROR 12
|
||||
# define CTL_DEL_ARC_TRANS_ERROR 13
|
||||
# define CTL_FUNC_EXIST_ERROR 14
|
||||
# define CTL_UNKNOWN_DECLAR_TYPE 15
|
||||
# define CTL_ARGUMENT_EXIST_ERROR 16
|
||||
# define CTL_UNDECLARED_SYMBOL 17
|
||||
# define CTL_DECLAR_EXIST_ERROR 18
|
||||
# define CTL_BAD_DECLAR_TYPE 19
|
||||
# define CTL_BAD_ASSIGN_TYPE 20
|
||||
# define CTL_ILLEGAL_INDEX_ERROR 21
|
||||
# define CTL_ILLEGAL_POSITION_ERROR 22
|
||||
# define CTL_INS_EXIST_ERROR 23
|
||||
# define CTL_MOD_EXIST_ERROR 24
|
||||
# define CTL_GENERIC_EXIST_ERROR 25
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macros |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define ctlerror( E, V1, V2 ) \
|
||||
(ctl_error((int)(E),(char*)(long)(V1),(char*)(long)(V2),__FILE__,__LINE__))
|
||||
|
||||
# define ctlwarning( E, V1, V2 ) \
|
||||
(ctl_warning( (int)(E),(char*)(long)(V1),(char*)(long)(V2),__FILE__,__LINE__))
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void ctl_error __P((int Error, char *Text1, char *Text2, char *File, long Line));
|
||||
extern void ctl_warning __P((int Warning, char *Text1, char *Text2, char *File, long Line));
|
||||
|
||||
# endif
|
|
@ -0,0 +1,144 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : Ctl |
|
||||
| |
|
||||
| File : ctlfree.c |
|
||||
| |
|
||||
| Date : 04.18.02 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "ctl.h"
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
# include "ctlfree.h"
|
||||
# include "ctlalloc.h"
|
||||
# include "ctlerror.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Free Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Free Figure |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void freectlfig( Figure )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
{
|
||||
autfreeblock( (char *)Figure );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Free Form |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void freectlform( Form )
|
||||
|
||||
ctlform_list *Form;
|
||||
{
|
||||
autfreeheap( (char *)Form, sizeof( ctlform_list ));
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Free Symbol |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void freectlsym( Sym )
|
||||
|
||||
ctlsym *Sym;
|
||||
{
|
||||
autfreeblock( (char *)Sym );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Free Declaration |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void freectldecl( Decl )
|
||||
|
||||
ctldecl_list *Decl;
|
||||
{
|
||||
autfreeheap( (char *)Decl, sizeof( ctldecl_list ));
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Free Line |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void freectlline( Line )
|
||||
|
||||
ctlline_list *Line;
|
||||
{
|
||||
autfreeheap( (char *)Line, sizeof( ctlline_list ));
|
||||
}
|
||||
|
|
@ -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 : Ctl |
|
||||
| |
|
||||
| File : ctlfree.h |
|
||||
| |
|
||||
| Date : 04.07.96 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef CTL_FREE_H
|
||||
# define CTL_FREE_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# endif
|
|
@ -0,0 +1,226 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : Ctl |
|
||||
| |
|
||||
| File : ctlsearch.c |
|
||||
| |
|
||||
| Date : 04.18.02 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "ctl.h"
|
||||
|
||||
# include <stdio.h>
|
||||
# include "ctlsearch.h"
|
||||
# include "ctlerror.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Search Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Search Figure |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctlfig_list *searchctlfig( Name )
|
||||
|
||||
char *Name;
|
||||
{
|
||||
ctlfig_list *Figure;
|
||||
|
||||
Name = namealloc( Name );
|
||||
|
||||
for ( Figure = HEAD_CTLFIG;
|
||||
Figure != (ctlfig_list *)0;
|
||||
Figure = Figure->NEXT )
|
||||
{
|
||||
if ( Figure->NAME == Name ) break;
|
||||
}
|
||||
|
||||
return( Figure );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Local Ctl Search Symbol |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctlsym *searchctlsym( Figure, Name, Index, Type )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
char *Name;
|
||||
short Index;
|
||||
unsigned char Type;
|
||||
{
|
||||
authtable *HashTable;
|
||||
authelem *Element;
|
||||
vexexpr *Atom;
|
||||
ctldecl_list *Decl;
|
||||
short Bound;
|
||||
|
||||
if ( Type >= CTL_MAX_DECLAR_TYPE )
|
||||
{
|
||||
ctlerror( CTL_UNKNOWN_DECLAR_TYPE, Type, Name );
|
||||
}
|
||||
|
||||
Name = namealloc( Name );
|
||||
HashTable = Figure->HASH_DECLAR[ Type ];
|
||||
Element = searchauthelem( HashTable, Name );
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
Decl = (ctldecl_list *)( Element->VALUE );
|
||||
Atom = Decl->VEX_ATOM;
|
||||
|
||||
if ( ! IsVexNodeAtom( Atom ) )
|
||||
{
|
||||
Atom = getvexarrayatom( 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( (ctlsym *)0 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Search Declaration |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctldecl_list *searchctldecl( Figure, Name, Type )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
char *Name;
|
||||
unsigned char Type;
|
||||
{
|
||||
authtable *HashTable;
|
||||
authelem *Element;
|
||||
|
||||
HashTable = Figure->HASH_DECLAR[ Type ];
|
||||
|
||||
Name = namealloc( Name );
|
||||
Element = searchauthelem( HashTable, Name );
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
return( (ctldecl_list *)( Element->VALUE ) );
|
||||
}
|
||||
|
||||
return( (ctldecl_list *)0 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl Search Form |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
ctlform_list *searchctlform( Figure, Name )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
char *Name;
|
||||
{
|
||||
ctlform_list *Form;
|
||||
|
||||
Name = namealloc( Name );
|
||||
|
||||
for ( Form = Figure->FORM;
|
||||
Form != (ctlform_list *)0;
|
||||
Form = Form->NEXT )
|
||||
{
|
||||
if ( Form->NAME == Name ) break;
|
||||
}
|
||||
|
||||
return( Form );
|
||||
}
|
||||
|
|
@ -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 : Ctl |
|
||||
| |
|
||||
| File : ctlsearch.h |
|
||||
| |
|
||||
| Date : 04.07.96 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef CTL_SEARCH_H
|
||||
# define CTL_SEARCH_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# endif
|
|
@ -0,0 +1,286 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : Ctl |
|
||||
| |
|
||||
| File : ctlview.c |
|
||||
| |
|
||||
| Date : 28.08.96 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "ctl.h"
|
||||
|
||||
# include <stdio.h>
|
||||
# include "ctlview.h"
|
||||
# include "ctlerror.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl View Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl View Line |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void viewctlline( Line )
|
||||
|
||||
ctlline_list *Line;
|
||||
{
|
||||
char *File;
|
||||
|
||||
fprintf( stdout, "\n--> Line" );
|
||||
fprintf( stdout, "\n\t\tLINE : " );
|
||||
|
||||
File = (char *)0;
|
||||
|
||||
while ( Line != (ctlline_list *)0 )
|
||||
{
|
||||
if ( Line->NAME != File )
|
||||
{
|
||||
File = Line->NAME;
|
||||
fprintf( stdout, " %s [%ld]", Line->NAME, Line->LINE );
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf( stdout, " [%ld]", Line->LINE );
|
||||
}
|
||||
|
||||
Line = Line->NEXT;
|
||||
}
|
||||
|
||||
fprintf( stdout, "\n<-- Line" );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl View Symbol |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void viewctlsym( Symbol )
|
||||
|
||||
ctlsym *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\tFLAGS : %lx", Symbol->FLAGS );
|
||||
fprintf( stdout, "\n\t\tUSER : %lx", (long)Symbol->USER );
|
||||
fprintf( stdout, "\n<-- Symbol" );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl View Declaration |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void viewctldecl( Decl )
|
||||
|
||||
ctldecl_list *Decl;
|
||||
{
|
||||
ctlsym *DeclSym;
|
||||
int Scan;
|
||||
int Width;
|
||||
|
||||
fprintf( stdout, "\n--> Declaration" );
|
||||
|
||||
viewctlline( Decl->LINE );
|
||||
|
||||
if ( *Decl->PREV != Decl )
|
||||
{
|
||||
fprintf( stdout, "\n\t\tPREV : ERROR" );
|
||||
}
|
||||
|
||||
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++ )
|
||||
{
|
||||
viewctlsym( &DeclSym[ Scan ] );
|
||||
}
|
||||
|
||||
if ( Decl->DIR >= CTL_MAX_DIR_TYPE )
|
||||
{
|
||||
fprintf( stdout, "\n\t\tDIR : %d", (int)Decl->DIR );
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf( stdout, "\n\t\tDIR : %s", CTL_DIR_TYPE[ Decl->DIR ] );
|
||||
}
|
||||
|
||||
if ( Decl->TYPE >= CTL_MAX_DECLAR_TYPE )
|
||||
{
|
||||
fprintf( stdout, "\n\t\tTYPE : %d", Decl->TYPE );
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf( stdout, "\n\t\tTYPE : %s", CTL_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 >= CTL_MAX_KIND_TYPE )
|
||||
{
|
||||
fprintf( stdout, "\n\t\tKIND : %d", Decl->KIND );
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf( stdout, "\n\t\tKIND : %s", CTL_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" );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl View Form |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void viewctlact( Form )
|
||||
|
||||
ctlform_list *Form;
|
||||
{
|
||||
fprintf( stdout, "\n--> Form" );
|
||||
|
||||
viewctlline( Form->LINE );
|
||||
|
||||
if ( *Form->PREV != Form )
|
||||
{
|
||||
fprintf( stdout, "\n\t\tPREV : ERROR" );
|
||||
}
|
||||
|
||||
fprintf( stdout, "\n\t\tNAME : %s", Form->NAME );
|
||||
|
||||
fprintf( stdout, "\n\t\tVEX_EXPR : \n" );
|
||||
|
||||
viewvexexprbound( Form->VEX_EXPR );
|
||||
|
||||
fprintf( stdout, "\n\t\tFLAGS : %lx", Form->FLAGS );
|
||||
fprintf( stdout, "\n\t\tUSER : %lx", (long)Form->USER );
|
||||
fprintf( stdout, "\n<-- Form" );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Ctl View Figure |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void viewctlfig( Figure )
|
||||
|
||||
ctlfig_list *Figure;
|
||||
{
|
||||
ctlform_list *Form;
|
||||
ctldecl_list *Decl;
|
||||
int Type;
|
||||
|
||||
fprintf( stdout, "\n--> Figure" );
|
||||
fprintf( stdout, "\n\tNAME : %s", Figure->NAME );
|
||||
|
||||
for ( Type = 0; Type < CTL_MAX_DECLAR_TYPE; Type++ )
|
||||
{
|
||||
fprintf( stdout, "\n\tDECLARATION %s : ", CTL_DECLAR_TYPE[ Type ] );
|
||||
|
||||
for ( Decl = Figure->DECLAR[ Type ];
|
||||
Decl != (ctldecl_list *)0;
|
||||
Decl = Decl->NEXT )
|
||||
{
|
||||
viewctldecl( Decl );
|
||||
}
|
||||
}
|
||||
|
||||
fprintf( stdout, "\n\tFORM : " );
|
||||
|
||||
for ( Form = Figure->FORM;
|
||||
Form != (ctlform_list *)0;
|
||||
Form = Form->NEXT )
|
||||
{
|
||||
viewctlform( Form );
|
||||
}
|
||||
|
||||
fprintf( stdout, "\n\tFLAGS : %lx", Figure->FLAGS );
|
||||
fprintf( stdout, "\n\tUSER : %lx", (long)Figure->USER );
|
||||
fprintf( stdout, "\n<-- Figure\n" );
|
||||
}
|
|
@ -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 : Ctl |
|
||||
| |
|
||||
| File : ctlview.h |
|
||||
| |
|
||||
| Date : 04.07.96 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef CTL_VIEW_H
|
||||
# define CTL_VIEW_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# endif
|
Loading…
Reference in New Issue