Hello
This commit is contained in:
parent
3d8c01051e
commit
d4e08ddcaf
|
@ -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/03/20 14:37:03 ludo Exp $
|
||||
dnl
|
||||
dnl
|
||||
AC_INIT(src/fsm.h)
|
||||
AM_INIT_AUTOMAKE(fsm, 1.4)
|
||||
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,6 @@
|
|||
CFLAGS = @CFLAGS@ \
|
||||
-DALLIANCE_TOP=\"${ALLIANCE_TOP}\"
|
||||
lib_LIBRARIES = libFtl.a
|
||||
include_HEADERS = ftl.h
|
||||
libFtl_a_SOURCES = \
|
||||
ftl.h ftlacces.c ftlacces.h ftlerror.c ftlerror.h
|
|
@ -0,0 +1,81 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 FTL |
|
||||
| |
|
||||
| Date : 28.01.95 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
# ifndef FTL_104_H
|
||||
# define FTL_104_H
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Structures |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Global Variables |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
extern char *FSM_IN;
|
||||
extern char *FSM_OUT;
|
||||
|
||||
extern char *FSM_KISS_FORMAT;
|
||||
extern char *FSM_VHDL_FORMAT;
|
||||
|
||||
/*------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------*/
|
||||
|
||||
|
||||
extern void fsmenv __P(());
|
||||
extern fsmfig_list * getfsmfig __P((char *Name));
|
||||
extern void loadfsmfig __P((fsmfig_list *Figure, char *Name));
|
||||
extern void savefsmfig __P((fsmfig_list *Figure));
|
||||
|
||||
# endif
|
|
@ -0,0 +1,195 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : Ftl |
|
||||
| |
|
||||
| File : ftlacces.c |
|
||||
| |
|
||||
| Date : 04.12.96 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "bdd.h"
|
||||
# include "fsm.h"
|
||||
# include "ftl.h"
|
||||
|
||||
# include "ftlacces.h"
|
||||
# include "ftlerror.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
char *FSM_IN;
|
||||
char *FSM_OUT;
|
||||
|
||||
char *FSM_KISS_FORMAT = (char *)0;
|
||||
char *FSM_VHDL_FORMAT = (char *)0;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| fsmenv |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void fsmenv()
|
||||
{
|
||||
FSM_IN = namealloc( mbkgetenv( "FSM_IN") );
|
||||
|
||||
if ( FSM_IN == (char *)0 )
|
||||
{
|
||||
FSM_IN = namealloc( FTL_DEFAULT_IN );
|
||||
}
|
||||
|
||||
FSM_OUT = namealloc( mbkgetenv( "FSM_OUT") );
|
||||
|
||||
if ( FSM_OUT == (char *)0 )
|
||||
{
|
||||
FSM_OUT = namealloc( FTL_DEFAULT_OUT );
|
||||
}
|
||||
|
||||
FSM_KISS_FORMAT = namealloc( "kiss2" );
|
||||
FSM_VHDL_FORMAT = namealloc( "fsm" );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| loadfsmfig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void loadfsmfig( Figure, Name )
|
||||
|
||||
fsmfig_list *Figure;
|
||||
char *Name;
|
||||
{
|
||||
if ( FSM_IN == FSM_KISS_FORMAT )
|
||||
{
|
||||
kissloadfsmfig( Figure, Name );
|
||||
}
|
||||
else
|
||||
if ( FSM_IN == FSM_VHDL_FORMAT )
|
||||
{
|
||||
vhdlloadfsmfig( Figure, Name );
|
||||
}
|
||||
else
|
||||
{
|
||||
ftlerror( FTL_UNKNOWN_FSM_IN, FSM_IN );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| savefsmfig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void savefsmfig( Figure )
|
||||
|
||||
fsmfig_list *Figure;
|
||||
{
|
||||
if ( FSM_OUT == FSM_KISS_FORMAT )
|
||||
{
|
||||
kisssavefsmfig( Figure );
|
||||
}
|
||||
else
|
||||
if ( FSM_OUT == FSM_VHDL_FORMAT )
|
||||
{
|
||||
vhdlsavefsmfig( Figure );
|
||||
}
|
||||
else
|
||||
{
|
||||
ftlerror( FTL_UNKNOWN_FSM_OUT, FSM_OUT );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| getfsmfig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
fsmfig_list *getfsmfig( Name )
|
||||
|
||||
char *Name;
|
||||
{
|
||||
fsmfig_list *Figure;
|
||||
|
||||
Name = namealloc( Name );
|
||||
|
||||
for ( Figure = HEAD_FSMFIG;
|
||||
Figure != (fsmfig_list *)0;
|
||||
Figure = Figure->NEXT )
|
||||
{
|
||||
if ( Figure->NAME == Name ) break;
|
||||
}
|
||||
|
||||
if ( Figure == (fsmfig_list *)0 )
|
||||
{
|
||||
Figure = addfsmfig( Name );
|
||||
|
||||
loadfsmfig( Figure, Name );
|
||||
}
|
||||
|
||||
return( Figure );
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : Ftl |
|
||||
| |
|
||||
| File : ftlacces.h |
|
||||
| |
|
||||
| Date : 04.12.96 |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef FTL_ACCES_H
|
||||
# define FTL_ACCES_H
|
||||
|
||||
# define FTL_DEFAULT_IN "fsm"
|
||||
# define FTL_DEFAULT_OUT "fsm"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void kissloadfsmfig();
|
||||
extern void kisssavefsmfig();
|
||||
extern void vhdlloadfsmfig();
|
||||
extern void vhdlsavefsmfig();
|
||||
|
||||
# endif
|
|
@ -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. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Tool : Ftl |
|
||||
| |
|
||||
| File : Ftl Errors |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 04.12.96 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "bdd.h"
|
||||
# include "fsm.h"
|
||||
# include "ftl.h"
|
||||
|
||||
# include "ftlerror.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void ftl_error( Error, Text, File, Line )
|
||||
|
||||
char Error;
|
||||
char *Text;
|
||||
char *File;
|
||||
long Line;
|
||||
{
|
||||
char *Name;
|
||||
|
||||
Name = mbkstrdup( File );
|
||||
Name[ strlen( File ) - 1 ] = '\0';
|
||||
|
||||
fprintf( stderr, "%s%ld ", Name, Line );
|
||||
|
||||
switch( Error )
|
||||
{
|
||||
case FTL_UNKNOWN_FSM_OUT :
|
||||
|
||||
fprintf( stderr, "Unknown fsm output format %s\n", Text );
|
||||
|
||||
break;
|
||||
|
||||
case FTL_UNKNOWN_FSM_IN :
|
||||
|
||||
fprintf( stderr, "Unknown fsm input format %s\n", Text );
|
||||
|
||||
break;
|
||||
|
||||
default :
|
||||
|
||||
fprintf( stderr, "unknown internal error %d !\n", Error );
|
||||
}
|
||||
|
||||
autexit( 1 );
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : Ftl |
|
||||
| |
|
||||
| File : Ftl Errors |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 04.12.96 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef FTL_ERROR_H
|
||||
# define FTL_ERROR_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define FTL_UNKNOWN_FSM_IN 0
|
||||
# define FTL_UNKNOWN_FSM_OUT 1
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macros |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define ftlerror( E, V ) (ftl_error( (E), (V), __FILE__, __LINE__ ))
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void ftl_error __P((char Error, char *Text, char *File, long Line));
|
||||
|
||||
# endif
|
|
@ -0,0 +1 @@
|
|||
SUBDIRS = src
|
|
@ -0,0 +1,47 @@
|
|||
dnl
|
||||
/*
|
||||
dnl This file is part of the Alliance CAD System
|
||||
dnl Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
dnl Universite Pierre et Marie Curie
|
||||
dnl
|
||||
dnl Home page : http://www-asim.lip6.fr/alliance/
|
||||
dnl E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or modify it
|
||||
dnl under the terms of the GNU Library General Public License as published
|
||||
dnl by the Free Software Foundation; either version 2 of the License, or (at
|
||||
dnl your option) any later version.
|
||||
dnl
|
||||
dnl Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
dnl Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License along
|
||||
dnl with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
dnl Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
dnl
|
||||
dnl Purpose : Auto stuffing Alliance
|
||||
dnl Almost ten years since I wrote this stuff, I just can't
|
||||
dnl believe it
|
||||
dnl Date : 01/02/2002
|
||||
dnl Author : Frederic Petrot <Frederic.Petrot@lip6.fr>
|
||||
dnl $Id: configure.in,v 1.1 2002/03/20 14:33:38 ludo Exp $
|
||||
dnl
|
||||
dnl
|
||||
AC_INIT(src/fvh.h)
|
||||
AM_INIT_AUTOMAKE(fvh, 1.4)
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_CC
|
||||
AC_PROG_YACC
|
||||
AM_PROG_LEX
|
||||
AC_HEADER_STDC
|
||||
AC_C_CONST
|
||||
AC_PROG_RANLIB
|
||||
|
||||
AM_ALLIANCE
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
src/Makefile
|
||||
])
|
|
@ -0,0 +1,14 @@
|
|||
lib_LIBRARIES = libFvh.a
|
||||
libFvh_a_SOURCES = fbl_bcomp.y fbl_bcomp.l \
|
||||
fbh_add.c fbh_rmv.c fbl_blex.h fbl_drive.h fvh.h fvhfbh2fsm.c \
|
||||
fbh_del.c fbh_typ.c fbl_bspec.c fbl_utdef.h fvhdrive.c fvhfbh2fsm.h \
|
||||
fbh_env.c fbh_uti.c fbl_bspec.h fbl_util.c fvhdrive.h fvhparse.c \
|
||||
fbh_fre.c fbh_view.c fbl_byacc.h fbl_util.h fvherror.c fvhparse.h \
|
||||
fbh_rin.c fbl_bedef.h fbl_drive.c fbl_utype.h fvherror.h
|
||||
|
||||
CLEANFILES = fbl_bcompyac.c fbl_bcompyac.h fbl_bcomplex.c
|
||||
|
||||
fbl_bcompyac.c fbl_bcompyac.h : $(srcdir)/fbl_bcomp.y
|
||||
$(YACC) -d $(YFLAGS) $(srcdir)/fbl_bcomp.y && sed -e "s/yy/fbl_y_/g" -e "s/YY/FBL_Y_/g" y.tab.c > fbl_bcompyac.c && sed -e "s/yy/fbl_y_/g" -e "s/YY/FBL_Y_/g" y.tab.h > fbl_bcompyac.h
|
||||
fbl_bcomplex.c : $(srcdir)/fbl_bcomp.l fbl_bcompyac.h
|
||||
$(LEX) -t $(srcdir)/fbl_bcomp.l | sed -e "s/yy/fbl_y_/g" -e "s/YY/FBL_Y_/g" > fbl_bcomplex.c
|
|
@ -0,0 +1,629 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbh_addfbasg.c */
|
||||
/* date : Aug 28 1992 */
|
||||
/* version : v102 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* content : contains a specific function used to create a */
|
||||
/* fbhaviour data structure */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "bdd.h"
|
||||
#include "fvh.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbasg */
|
||||
/* description : create a BEASG structure at the top the list */
|
||||
/* called func. : addptype, mbkalloc, namealloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct ptype *fbh_addfbasg (lastptype, name, abl, type)
|
||||
|
||||
struct ptype *lastptype; /* pointer on the last ptype structure */
|
||||
char *name; /* signal's name */
|
||||
struct chain *abl; /* condition's expression */
|
||||
unsigned char type; /* signal's type (cannot be 0) */
|
||||
|
||||
{
|
||||
struct ptype *ptptype;
|
||||
struct fbasg *ptfbasg;
|
||||
|
||||
name = namealloc (name);
|
||||
|
||||
ptfbasg = (struct fbasg *) mbkalloc (sizeof(struct fbasg));
|
||||
ptfbasg->NAME = name;
|
||||
ptfbasg->ABL = abl;
|
||||
ptfbasg->TYPE = type;
|
||||
|
||||
ptptype = addptype (lastptype, FBH_BEASG, (void *)ptfbasg);
|
||||
|
||||
return (ptptype);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbaux */
|
||||
/* description : create a BEAUX structure at the top the list */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbaux *fbh_addfbaux (lastfbaux, name, abl_expr, bdd_expr, type)
|
||||
|
||||
struct fbaux *lastfbaux; /* pointer on the last fbaux structure */
|
||||
char *name; /* signal's name */
|
||||
struct chain *abl_expr; /* signal's expression (ABL) */
|
||||
bddnode *bdd_expr; /* signal's expression (BDD) */
|
||||
unsigned char type; /* signal's type */
|
||||
|
||||
{
|
||||
struct fbaux *ptaux;
|
||||
|
||||
name = namealloc (name);
|
||||
|
||||
ptaux = (struct fbaux *) mbkalloc (sizeof(struct fbaux));
|
||||
ptaux->NAME = name;
|
||||
ptaux->ABL = abl_expr;
|
||||
ptaux->NODE = bdd_expr;
|
||||
ptaux->TYPE = type;
|
||||
ptaux->NEXT = lastfbaux;
|
||||
|
||||
return (ptaux);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbbus */
|
||||
/* description : create a BEBUS structure at the top the list */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbbus *fbh_addfbbus (lastfbbus, name, biabl, binode, type)
|
||||
|
||||
struct fbbus *lastfbbus; /* pointer on the last fbbus structure */
|
||||
char *name; /* port's name */
|
||||
struct biabl *biabl; /* port's drivers (ABL) */
|
||||
struct binode *binode; /* port's drivers (BDD) */
|
||||
char type; /* port type mark (M or W) */
|
||||
|
||||
{
|
||||
struct fbbus *ptbus;
|
||||
|
||||
name = namealloc (name);
|
||||
|
||||
ptbus = (struct fbbus *) mbkalloc (sizeof(struct fbbus));
|
||||
ptbus->NAME = name;
|
||||
ptbus->BIABL = biabl;
|
||||
ptbus->BINODE = binode;
|
||||
ptbus->TYPE = type;
|
||||
ptbus->NEXT = lastfbbus;
|
||||
|
||||
return (ptbus);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbbux */
|
||||
/* description : create a BEBUX structure at the top the list */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbbux *fbh_addfbbux (lastfbbux, name, biabl, binode, type)
|
||||
|
||||
struct fbbux *lastfbbux; /* pointer on the last fbbux structure */
|
||||
char *name; /* signal's name */
|
||||
struct biabl *biabl; /* signal's expression (ABL) */
|
||||
struct binode *binode; /* signal's expression (BDD) */
|
||||
char type; /* signal's type mark (M or W) */
|
||||
|
||||
{
|
||||
struct fbbux *ptbux;
|
||||
|
||||
name = namealloc (name);
|
||||
|
||||
ptbux = (struct fbbux *) mbkalloc (sizeof(struct fbbux));
|
||||
ptbux->NAME = name;
|
||||
ptbux->BIABL = biabl;
|
||||
ptbux->BINODE = binode;
|
||||
ptbux->TYPE = type;
|
||||
ptbux->NEXT = lastfbbux;
|
||||
|
||||
return (ptbux);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbcas */
|
||||
/* description : create a BECAS structure at the top the list */
|
||||
/* called func. : addptype, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct ptype *fbh_addfbcas (lastptype, abl,type)
|
||||
|
||||
struct ptype *lastptype; /* pointer on the last ptype structure */
|
||||
struct chain *abl; /* condition's expression */
|
||||
unsigned char type; /* expression's type i */
|
||||
|
||||
{
|
||||
struct ptype *ptptype;
|
||||
struct fbcas *ptfbcas;
|
||||
|
||||
ptfbcas = (struct fbcas *) mbkalloc (sizeof(struct fbcas));
|
||||
ptfbcas->ABL = abl;
|
||||
ptfbcas->CHOICE = 0;
|
||||
ptfbcas->USER = 0;
|
||||
ptfbcas->SIZE = 0;
|
||||
ptfbcas->TYPE = type;
|
||||
|
||||
ptptype = addptype (lastptype, FBH_BECAS, (void *)ptfbcas);
|
||||
|
||||
return (ptptype);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbfig */
|
||||
/* description : create an empty BEFIG structure at the top of the list*/
|
||||
/* The FBH_HEDFIG list is not modified. */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbfig *fbh_addfbfig (lastfbfig, name)
|
||||
|
||||
struct fbfig *lastfbfig; /* pointer on the last fbfig structure */
|
||||
char *name; /* figure's name */
|
||||
|
||||
{
|
||||
struct fbfig *ptfig;
|
||||
|
||||
name = namealloc (name);
|
||||
|
||||
ptfig = (struct fbfig *) mbkalloc (sizeof(struct fbfig));
|
||||
ptfig->NAME = name;
|
||||
ptfig->BEREG = 0;
|
||||
ptfig->BEMSG = 0;
|
||||
ptfig->BERIN = 0;
|
||||
ptfig->BEOUT = 0;
|
||||
ptfig->BEBUS = 0;
|
||||
ptfig->BEAUX = 0;
|
||||
ptfig->BEDLY = 0;
|
||||
ptfig->BEBUX = 0;
|
||||
ptfig->BEPOR = 0;
|
||||
ptfig->BEPCS = 0;
|
||||
ptfig->BETYP = 0;
|
||||
ptfig->BEPGM = 0;
|
||||
ptfig->CIRCUI = 0;
|
||||
ptfig->USER = 0;
|
||||
ptfig->FLAG = 0;
|
||||
ptfig->NEXT = lastfbfig;
|
||||
|
||||
return (ptfig);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbgen */
|
||||
/* description : create a BEGEN structure at the top the list */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbgen *fbh_addfbgen (lastfbgen, name, type, value)
|
||||
|
||||
struct fbgen *lastfbgen; /* pointer on the last fbgen structure */
|
||||
char *name; /* generic's name */
|
||||
char *type; /* generic's type */
|
||||
void *value; /* generic's value */
|
||||
|
||||
{
|
||||
|
||||
struct fbgen *ptgen;
|
||||
|
||||
name = namealloc (name);
|
||||
|
||||
ptgen = (struct fbgen *) mbkalloc (sizeof(struct fbgen));
|
||||
ptgen->NAME = name;
|
||||
ptgen->TYPE = type;
|
||||
ptgen->VALUE = value;
|
||||
ptgen->NEXT = lastfbgen;
|
||||
|
||||
return (ptgen);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbifs */
|
||||
/* description : create a BEIFS structure at the top the list */
|
||||
/* called func. : addptype, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct ptype *fbh_addfbifs (lastptype, abl)
|
||||
|
||||
struct ptype *lastptype; /* pointer on the last ptype structure */
|
||||
struct chain *abl; /* condition's expression */
|
||||
|
||||
{
|
||||
struct ptype *ptptype;
|
||||
struct fbifs *ptfbifs;
|
||||
|
||||
ptfbifs = (struct fbifs *) mbkalloc (sizeof(struct fbifs));
|
||||
ptfbifs->CND = abl;
|
||||
ptfbifs->CNDTRUE = 0;
|
||||
ptfbifs->CNDFALSE = 0;
|
||||
ptptype = addptype (lastptype, FBH_BEIFS, (void *)ptfbifs);
|
||||
|
||||
return (ptptype);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbmsg */
|
||||
/* description : create BEMSG structure at the top the list */
|
||||
/* called func. : mbkalloc, namealloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbmsg *fbh_addfbmsg (lastfbmsg,label,level,message,abl_expr,bdd_expr)
|
||||
|
||||
struct fbmsg *lastfbmsg; /* pointer on the last fbmsg structure */
|
||||
char *label; /* assert's label */
|
||||
char level; /* severity level (E or W) */
|
||||
char *message; /* reported message */
|
||||
struct chain *abl_expr; /* assert's condition (ABL) */
|
||||
bddnode *bdd_expr; /* assert's condition (BDD) */
|
||||
|
||||
{
|
||||
|
||||
struct fbmsg *ptmsg;
|
||||
|
||||
label = namealloc (label);
|
||||
|
||||
ptmsg = (struct fbmsg *) mbkalloc (sizeof(struct fbmsg));
|
||||
ptmsg->LABEL = label;
|
||||
ptmsg->LEVEL = level;
|
||||
ptmsg->MESSAGE = message;
|
||||
ptmsg->ABL = abl_expr;
|
||||
ptmsg->NODE = bdd_expr;
|
||||
ptmsg->NEXT = lastfbmsg;
|
||||
|
||||
return (ptmsg);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbout */
|
||||
/* description : create a BEOUT structure at the top the list */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbout *fbh_addfbout (lastfbout, name, abl_expr, bdd_expr,type)
|
||||
|
||||
struct fbout *lastfbout; /* pointer on the last fbout structure */
|
||||
char *name; /* port's name */
|
||||
struct chain *abl_expr; /* port's expression (ABL) */
|
||||
bddnode *bdd_expr; /* port's expression (BDD) */
|
||||
unsigned char type; /* port's type */
|
||||
|
||||
{
|
||||
struct fbout *ptout;
|
||||
|
||||
name = namealloc (name);
|
||||
|
||||
ptout = (struct fbout *) mbkalloc (sizeof(struct fbout));
|
||||
ptout->NAME = name;
|
||||
ptout->ABL = abl_expr;
|
||||
ptout->NODE = bdd_expr;
|
||||
ptout->TYPE = type;
|
||||
ptout->NEXT = lastfbout;
|
||||
|
||||
return (ptout);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbpcs */
|
||||
/* description : create a BEPCS structure at the top the list */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbpcs *fbh_addfbpcs (lastfbpcs, label, sens, inst, outs, flag)
|
||||
|
||||
struct fbpcs *lastfbpcs; /* pointer on the last fbpcs structure */
|
||||
char *label; /* process's label */
|
||||
struct chain *sens; /* sensitivity list */
|
||||
struct ptype *inst; /* list of instructions */
|
||||
struct chain *outs; /* list of outputs */
|
||||
char flag; /* flag */
|
||||
|
||||
{
|
||||
struct fbpcs *ptfbpcs;
|
||||
|
||||
label = namealloc (label);
|
||||
|
||||
ptfbpcs = (struct fbpcs *) mbkalloc (sizeof(struct fbpcs));
|
||||
ptfbpcs->LABEL = label;
|
||||
ptfbpcs->SENSITIVITY = sens;
|
||||
ptfbpcs->OUTPUTS = outs;
|
||||
ptfbpcs->INSTRUCTION = inst;
|
||||
ptfbpcs->FLAG = flag;
|
||||
|
||||
ptfbpcs->NEXT = lastfbpcs;
|
||||
|
||||
return (ptfbpcs);
|
||||
}
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbpgm */
|
||||
/* description : add an BEPGM structure at the top of a list */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbpgm *fbh_addfbpgm (lastfbpgm, type , name , value)
|
||||
struct fbpgm *lastfbpgm; /* pointer on the last fbpgm */
|
||||
char *type; /* pragma's type */
|
||||
char *name; /* pragma's name */
|
||||
void *value; /* pragma's content */
|
||||
{
|
||||
struct fbpgm *ptfbpgm;
|
||||
|
||||
if(type)
|
||||
type = namealloc (type);
|
||||
if(name)
|
||||
name = namealloc (name);
|
||||
|
||||
ptfbpgm = (struct fbpgm *) mbkalloc (sizeof(struct fbpgm));
|
||||
|
||||
ptfbpgm->TYPE = type;
|
||||
ptfbpgm->NAME = name;
|
||||
ptfbpgm->VALUE = value;
|
||||
|
||||
ptfbpgm->NEXT = lastfbpgm;
|
||||
|
||||
return (ptfbpgm);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbpor */
|
||||
/* description : create a BEPOR structure at the top the list */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbpor *fbh_addfbpor (lastfbpor, name, dir, type)
|
||||
|
||||
struct fbpor *lastfbpor; /* pointer on the last fbpor structure */
|
||||
char *name; /* signal's name */
|
||||
char dir; /* signal's mode (I, O, B, Z, or T) */
|
||||
unsigned char type; /* signal's type (M or W) */
|
||||
|
||||
{
|
||||
struct fbpor *ptfbpor;
|
||||
|
||||
name = namealloc (name);
|
||||
|
||||
ptfbpor = (struct fbpor *) mbkalloc (sizeof(struct fbpor));
|
||||
ptfbpor->NAME = name;
|
||||
ptfbpor->DIRECTION = dir;
|
||||
ptfbpor->TYPE = type;
|
||||
ptfbpor->NEXT = lastfbpor;
|
||||
|
||||
return (ptfbpor);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbreg */
|
||||
/* description : create a BEREG structure at the top the list */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbreg *fbh_addfbreg (lastfbreg, name, biabl, binode)
|
||||
|
||||
struct fbreg *lastfbreg; /* pointer on the last fbreg structure */
|
||||
char *name; /* register's name */
|
||||
struct biabl *biabl; /* register's drivers (ABL) */
|
||||
struct binode *binode; /* register's drivers (BDD) */
|
||||
/*unsigned char type; register's type */
|
||||
|
||||
{
|
||||
struct fbreg *ptreg;
|
||||
|
||||
name = namealloc (name);
|
||||
|
||||
ptreg = (struct fbreg *) mbkalloc (sizeof(struct fbreg));
|
||||
ptreg->NAME = name;
|
||||
ptreg->BIABL = biabl;
|
||||
ptreg->BINODE = binode;
|
||||
ptreg->NEXT = lastfbreg;
|
||||
|
||||
return (ptreg);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbrin */
|
||||
/* description : create a BERIN structure at the top the list */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbrin *fbh_addfbrin (lastfbrin, name)
|
||||
|
||||
struct fbrin *lastfbrin; /* pointer on the last fbrin structure */
|
||||
char *name; /* signal's name */
|
||||
|
||||
{
|
||||
struct fbrin *ptrin;
|
||||
|
||||
name = namealloc (name);
|
||||
|
||||
ptrin = (struct fbrin *) mbkalloc (sizeof(struct fbrin));
|
||||
ptrin->NAME = name;
|
||||
ptrin->NEXT = lastfbrin;
|
||||
|
||||
return (ptrin);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addfbtyp */
|
||||
/* description : add an BETYP structure at the top of a list */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbtyp *fbh_addfbtyp (lastfbtyp, name , left , right , value ,
|
||||
size , byte , base , index, resolv, class)
|
||||
|
||||
struct fbtyp *lastfbtyp; /* pointer on the last fbtyp */
|
||||
char *name; /* type's name */
|
||||
int left; /* left bound */
|
||||
int right; /* right bound */
|
||||
char **value; /* list of values */
|
||||
unsigned int size; /* number of values */
|
||||
unsigned int byte; /* number of bytes needed to code values*/
|
||||
unsigned char base; /* the base type or element's type */
|
||||
unsigned char index; /* the type of the index for an array */
|
||||
unsigned char resolv; /* index of resolution function */
|
||||
char class; /* type's class (E, I, A, S) */
|
||||
|
||||
{
|
||||
struct fbtyp *ptfbtyp;
|
||||
|
||||
name = namealloc (name);
|
||||
|
||||
ptfbtyp = (struct fbtyp *) mbkalloc (sizeof(struct fbtyp));
|
||||
|
||||
ptfbtyp->CLASS = class;
|
||||
ptfbtyp->NAME = name;
|
||||
ptfbtyp->LEFT = left;
|
||||
ptfbtyp->RIGHT = right;
|
||||
ptfbtyp->VALUE = value;
|
||||
ptfbtyp->SIZE = size;
|
||||
ptfbtyp->BYTE = byte;
|
||||
ptfbtyp->BASE = base;
|
||||
ptfbtyp->INDEX = index;
|
||||
ptfbtyp->RESOLV = resolv;
|
||||
|
||||
ptfbtyp->NEXT = lastfbtyp;
|
||||
|
||||
return (ptfbtyp);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addbiabl */
|
||||
/* description : create a BIABL structure at the top the list */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct biabl *fbh_addbiabl (lastbiabl, label, condition, value)
|
||||
|
||||
struct biabl *lastbiabl; /* pointer on the last biabl structure */
|
||||
char *label; /* block's label */
|
||||
struct chain *condition; /* guard expression (ABL) */
|
||||
struct chain *value; /* value expression (ABL) */
|
||||
|
||||
{
|
||||
struct biabl *ptbiabl;
|
||||
|
||||
ptbiabl = (struct biabl *) mbkalloc (sizeof(struct biabl));
|
||||
label = namealloc (label);
|
||||
|
||||
ptbiabl->LABEL = label;
|
||||
ptbiabl->CNDABL = condition;
|
||||
ptbiabl->VALABL = value;
|
||||
ptbiabl->NEXT = lastbiabl;
|
||||
|
||||
return (ptbiabl);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_addbinode */
|
||||
/* description : create a BINODE structure at the top the list */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct binode *fbh_addbinode (lastbinode, condition, value)
|
||||
|
||||
struct binode *lastbinode; /* pointer on the last binode structure */
|
||||
bddnode *condition; /* guard expression (BDD) */
|
||||
bddnode *value; /* value expression (BDD) */
|
||||
|
||||
{
|
||||
struct binode *ptbinode;
|
||||
|
||||
ptbinode = (struct binode *) mbkalloc (sizeof(struct binode));
|
||||
ptbinode->CNDNODE = condition;
|
||||
ptbinode->VALNODE = value;
|
||||
ptbinode->NEXT = lastbinode;
|
||||
|
||||
return (ptbinode);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_prdeftyp */
|
||||
/* description : create BETYPs for predefined types */
|
||||
/* called func. : fbh_addfbtyp, namealloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbtyp *fbh_prdeftyp ()
|
||||
|
||||
{
|
||||
static char *bit_vl[2];
|
||||
static char *boolean_vl[2];
|
||||
static char *severity_vl[2];
|
||||
struct fbtyp *t = 0;
|
||||
|
||||
boolean_vl[0] = namealloc ("false");
|
||||
boolean_vl[1] = namealloc ("true");
|
||||
|
||||
bit_vl[0] = namealloc ("'0'");
|
||||
bit_vl[1] = namealloc ("'1'");
|
||||
|
||||
severity_vl[0] = namealloc ("warning");
|
||||
severity_vl[1] = namealloc ("error");
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Enumeration types */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
t = fbh_addfbtyp (t,"severity_level",0,1,severity_vl,2,1,0,0,0,'E');
|
||||
t = fbh_addfbtyp (t,"boolean" ,0,1,boolean_vl ,2,1,0,0,0,'E');
|
||||
t = fbh_addfbtyp (t,"bit" ,0,1,bit_vl ,2,1,0,0,0,'E');
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Integer types */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
t = fbh_addfbtyp (t,"integer",0x80000000,0x7fffffff,0, 0,0,0,0,0,'I');
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Subtypes */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
t = fbh_addfbtyp (t,"mux_bit",0,1 ,0,0,1,2,0,1,'S');
|
||||
t = fbh_addfbtyp (t,"wor_bit",0,1 ,0,0,1,2,0,2,'S');
|
||||
t = fbh_addfbtyp (t,"reg_bit",0,1 ,0,0,1,2,0,3,'S');
|
||||
t = fbh_addfbtyp (t,"natural",0,0x7fffffff,0,0,1,3,0,0,'S');
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Unconstraint array types */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
t = fbh_addfbtyp (t,"bit_vector",0,0x7fffffff,0,0,1,2,7,0,'U');
|
||||
t = fbh_addfbtyp (t,"mux_vector",0,0x7fffffff,0,0,1,4,7,0,'U');
|
||||
t = fbh_addfbtyp (t,"wor_vector",0,0x7fffffff,0,0,1,5,7,0,'U');
|
||||
t = fbh_addfbtyp (t,"reg_vector",0,0x7fffffff,0,0,1,6,7,0,'U');
|
||||
|
||||
return (t);
|
||||
}
|
|
@ -0,0 +1,750 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbh_delfbaux.c */
|
||||
/* date : Aug 24 1992 */
|
||||
/* version : v102 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* content : contains a specific function used to delete a */
|
||||
/* fbhaviour data structure */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "bdd.h"
|
||||
#include "fvh.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_delfbaux */
|
||||
/* description : delete a BEAUX structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbaux *fbh_delfbaux (listfbaux, ptfbaux, mode)
|
||||
|
||||
struct fbaux *listfbaux; /* list of fbaux containing the object */
|
||||
struct fbaux *ptfbaux; /* pointer of the BEAUX to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbaux headaux;
|
||||
struct fbaux *ptlastaux;
|
||||
|
||||
if ((listfbaux != 0) && (ptfbaux != 0))
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headaux.NEXT = listfbaux;
|
||||
ptlastaux = &headaux;
|
||||
while ((ptlastaux != 0) && (ptlastaux->NEXT != ptfbaux))
|
||||
ptlastaux = ptlastaux->NEXT;
|
||||
|
||||
if (ptlastaux != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if (ptfbaux->ABL != 0)
|
||||
(void) fprintf (stderr,"FBH_warning : fbaux `%s` not empty\n",
|
||||
ptfbaux->NAME);
|
||||
}
|
||||
else
|
||||
delablexpr (ptfbaux->ABL);
|
||||
|
||||
ptlastaux->NEXT = ptfbaux->NEXT;
|
||||
mbkfree (ptfbaux);
|
||||
}
|
||||
|
||||
listfbaux = headaux.NEXT;
|
||||
}
|
||||
|
||||
return(listfbaux);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_delfbbus */
|
||||
/* description : delete a BEBUS structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbbus *fbh_delfbbus (listfbbus, ptfbbus, mode)
|
||||
|
||||
struct fbbus *listfbbus; /* list of fbbus containing the object */
|
||||
struct fbbus *ptfbbus; /* pointer of the BEBUS to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbbus headbus;
|
||||
struct fbbus *ptlastbus;
|
||||
|
||||
if ((listfbbus != 0) && (ptfbbus != 0))
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headbus.NEXT = listfbbus;
|
||||
ptlastbus = &headbus;
|
||||
while ((ptlastbus != 0) && (ptlastbus->NEXT != ptfbbus))
|
||||
ptlastbus = ptlastbus->NEXT;
|
||||
|
||||
if (ptlastbus != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if ((ptfbbus->BIABL != 0) || (ptfbbus->BINODE != 0))
|
||||
(void) fprintf (stderr,"FBH_warning : fbbus `%s` not empty\n",
|
||||
ptfbbus->NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
fbh_frebiabl (ptfbbus->BIABL);
|
||||
fbh_frebinode (ptfbbus->BINODE);
|
||||
}
|
||||
|
||||
ptlastbus->NEXT = ptfbbus->NEXT;
|
||||
mbkfree (ptfbbus);
|
||||
}
|
||||
|
||||
listfbbus = headbus.NEXT;
|
||||
}
|
||||
|
||||
return(listfbbus);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_delfbbux */
|
||||
/* description : delete a BEBUX structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbbux *fbh_delfbbux (listfbbux, ptfbbux, mode)
|
||||
|
||||
struct fbbux *listfbbux; /* list of fbbux containing the object */
|
||||
struct fbbux *ptfbbux; /* pointer of the BEBUX to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbbux headbux;
|
||||
struct fbbux *ptlastbux;
|
||||
|
||||
if ((listfbbux != 0) && (ptfbbux != 0))
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headbux.NEXT = listfbbux;
|
||||
ptlastbux = &headbux;
|
||||
while ((ptlastbux != 0) && (ptlastbux->NEXT != ptfbbux))
|
||||
ptlastbux = ptlastbux->NEXT;
|
||||
|
||||
if (ptlastbux != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if ((ptfbbux->BIABL != 0) || (ptfbbux->BINODE != 0))
|
||||
(void) fprintf (stderr,"FBH_warning : fbbux `%s` not empty\n",
|
||||
ptfbbux->NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
fbh_frebiabl (ptfbbux->BIABL);
|
||||
fbh_frebinode (ptfbbux->BINODE);
|
||||
}
|
||||
|
||||
ptlastbux->NEXT = ptfbbux->NEXT;
|
||||
mbkfree (ptfbbux);
|
||||
}
|
||||
|
||||
listfbbux = headbux.NEXT;
|
||||
}
|
||||
|
||||
return(listfbbux);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_delfbfig */
|
||||
/* description : delete a BEFIG structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N. */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbfig *fbh_delfbfig (listfbfig, ptfbfig, mode)
|
||||
|
||||
struct fbfig *listfbfig; /* list of fbfig containing the object */
|
||||
struct fbfig *ptfbfig; /* pointer of the BEFIG to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbfig headfig;
|
||||
struct fbfig *ptlastfig;
|
||||
struct ptype *ptptype;
|
||||
|
||||
if ((listfbfig != 0) && (ptfbfig != 0))
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headfig.NEXT = listfbfig;
|
||||
ptlastfig = &headfig;
|
||||
while ((ptlastfig != 0) && (ptlastfig->NEXT != ptfbfig))
|
||||
ptlastfig = ptlastfig->NEXT;
|
||||
|
||||
if (ptlastfig != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if ((ptfbfig->BEREG != 0) || (ptfbfig->BEMSG != 0) ||
|
||||
(ptfbfig->BERIN != 0) || (ptfbfig->BEOUT != 0) ||
|
||||
(ptfbfig->BEBUS != 0) || (ptfbfig->BEAUX != 0) ||
|
||||
(ptfbfig->BEDLY != 0) || (ptfbfig->BEBUX != 0) ||
|
||||
(ptfbfig->BEPOR != 0) || (ptfbfig->USER != 0))
|
||||
|
||||
(void) fprintf (stderr,"FBH_warning : fbfig `%s` not empty\n",
|
||||
ptfbfig->NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
fbh_frefbreg (ptfbfig->BEREG);
|
||||
fbh_frefbmsg (ptfbfig->BEMSG);
|
||||
fbh_frefbrin (ptfbfig->BERIN);
|
||||
fbh_frefbout (ptfbfig->BEOUT);
|
||||
fbh_frefbbus (ptfbfig->BEBUS);
|
||||
fbh_frefbaux (ptfbfig->BEAUX);
|
||||
fbh_frefbaux (ptfbfig->BEDLY);
|
||||
fbh_frefbbux (ptfbfig->BEBUX);
|
||||
fbh_frefbpor (ptfbfig->BEPOR);
|
||||
if ((ptptype = getptype (ptfbfig->USER,FBH_GENERIC)) != 0)
|
||||
fbh_frefbgen (ptptype->DATA);
|
||||
}
|
||||
|
||||
ptlastfig->NEXT = ptfbfig->NEXT;
|
||||
mbkfree (ptfbfig);
|
||||
}
|
||||
|
||||
listfbfig = headfig.NEXT;
|
||||
}
|
||||
|
||||
return(listfbfig);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_delfbgen */
|
||||
/* description : delete a BEGEN structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbgen *fbh_delfbgen (listfbgen, ptfbgen, mode)
|
||||
|
||||
struct fbgen *listfbgen; /* list of fbgen containing the object */
|
||||
struct fbgen *ptfbgen; /* pointer of the BEGEN to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbgen headgen;
|
||||
struct fbgen *ptlastgen;
|
||||
|
||||
if ((listfbgen != 0) && (ptfbgen != 0))
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headgen.NEXT = listfbgen;
|
||||
ptlastgen = &headgen;
|
||||
while ((ptlastgen != 0) && (ptlastgen->NEXT != ptfbgen))
|
||||
ptlastgen = ptlastgen->NEXT;
|
||||
|
||||
if (ptlastgen != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if (ptfbgen->VALUE != 0)
|
||||
(void) fprintf (stderr,"FBH_warning : fbgen `%s` not empty\n",
|
||||
ptfbgen->NAME);
|
||||
}
|
||||
else
|
||||
mbkfree (ptfbgen->VALUE);
|
||||
|
||||
ptlastgen->NEXT = ptfbgen->NEXT;
|
||||
mbkfree (ptfbgen);
|
||||
}
|
||||
|
||||
listfbgen = headgen.NEXT;
|
||||
}
|
||||
|
||||
return(listfbgen);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_delfbmsg */
|
||||
/* description : delete a BEMSG structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbmsg *fbh_delfbmsg (listfbmsg, ptfbmsg, mode)
|
||||
|
||||
struct fbmsg *listfbmsg; /* list of fbmsg containing the object */
|
||||
struct fbmsg *ptfbmsg; /* pointer of the BEMSG to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbmsg headmsg;
|
||||
struct fbmsg *ptlastmsg;
|
||||
|
||||
if ((listfbmsg != 0) && (ptfbmsg != 0))
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headmsg.NEXT = listfbmsg;
|
||||
ptlastmsg = &headmsg;
|
||||
while ((ptlastmsg != 0) && (ptlastmsg->NEXT != ptfbmsg))
|
||||
ptlastmsg = ptlastmsg->NEXT;
|
||||
|
||||
if (ptlastmsg != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if (ptfbmsg->ABL != 0)
|
||||
(void) fprintf (stderr,"FBH_warning : fbmsg `%s` not empty\n",
|
||||
ptfbmsg->LABEL);
|
||||
}
|
||||
else
|
||||
delablexpr (ptfbmsg->ABL);
|
||||
|
||||
ptlastmsg->NEXT = ptfbmsg->NEXT;
|
||||
mbkfree (ptfbmsg);
|
||||
}
|
||||
|
||||
listfbmsg = headmsg.NEXT;
|
||||
}
|
||||
|
||||
return(listfbmsg);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_delfbout */
|
||||
/* description : delete a BEOUT structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbout *fbh_delfbout (listfbout, ptfbout, mode)
|
||||
|
||||
struct fbout *listfbout; /* list of fbout containing the object */
|
||||
struct fbout *ptfbout; /* pointer of the BEOUT to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbout headout;
|
||||
struct fbout *ptlastout;
|
||||
|
||||
if ((listfbout != 0) && (ptfbout != 0))
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headout.NEXT = listfbout;
|
||||
ptlastout = &headout;
|
||||
while ((ptlastout != 0) && (ptlastout->NEXT != ptfbout))
|
||||
ptlastout = ptlastout->NEXT;
|
||||
|
||||
if (ptlastout != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if (ptfbout->ABL != 0)
|
||||
(void) fprintf (stderr,"FBH_warning : fbout `%s` not empty\n",
|
||||
ptfbout->NAME);
|
||||
}
|
||||
else
|
||||
delablexpr (ptfbout->ABL);
|
||||
|
||||
ptlastout->NEXT = ptfbout->NEXT;
|
||||
mbkfree (ptfbout);
|
||||
}
|
||||
|
||||
listfbout = headout.NEXT;
|
||||
}
|
||||
|
||||
return(listfbout);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_delfbpor */
|
||||
/* description : delete a BEPOR structure and return the pointer of */
|
||||
/* the next object. */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbpor *fbh_delfbpor (listfbpor, ptfbpor)
|
||||
|
||||
struct fbpor *listfbpor; /* list of fbpor containing the object */
|
||||
struct fbpor *ptfbpor; /* pointer of the BEPOR to be deleted */
|
||||
|
||||
{
|
||||
struct fbpor headpor;
|
||||
struct fbpor *ptlastpor;
|
||||
|
||||
if ((listfbpor != 0) && (ptfbpor != 0))
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headpor.NEXT = listfbpor;
|
||||
ptlastpor = &headpor;
|
||||
while ((ptlastpor != 0) && (ptlastpor->NEXT != ptfbpor))
|
||||
ptlastpor = ptlastpor->NEXT;
|
||||
|
||||
if (ptlastpor != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptlastpor->NEXT = ptfbpor->NEXT;
|
||||
mbkfree (ptfbpor);
|
||||
}
|
||||
|
||||
listfbpor = headpor.NEXT;
|
||||
}
|
||||
|
||||
return(listfbpor);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_delfbreg */
|
||||
/* description : delete a BEREG structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbreg *fbh_delfbreg (listfbreg, ptfbreg, mode)
|
||||
|
||||
struct fbreg *listfbreg; /* list of fbreg containing the object */
|
||||
struct fbreg *ptfbreg; /* pointer of the BEREG to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbreg headreg;
|
||||
struct fbreg *ptlastreg;
|
||||
|
||||
if ((listfbreg != 0) && (ptfbreg != 0))
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headreg.NEXT = listfbreg;
|
||||
ptlastreg = &headreg;
|
||||
while ((ptlastreg != 0) && (ptlastreg->NEXT != ptfbreg))
|
||||
ptlastreg = ptlastreg->NEXT;
|
||||
|
||||
if (ptlastreg != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if ((ptfbreg->BIABL != 0) || (ptfbreg->BINODE != 0))
|
||||
(void) fprintf (stderr,"FBH_warning : fbreg `%s` not empty\n",
|
||||
ptfbreg->NAME);
|
||||
}
|
||||
else
|
||||
{
|
||||
fbh_frebiabl (ptfbreg->BIABL);
|
||||
fbh_frebinode (ptfbreg->BINODE);
|
||||
}
|
||||
|
||||
ptlastreg->NEXT = ptfbreg->NEXT;
|
||||
mbkfree (ptfbreg);
|
||||
}
|
||||
|
||||
listfbreg = headreg.NEXT;
|
||||
}
|
||||
|
||||
return(listfbreg);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_delfbrin */
|
||||
/* description : delete a BERIN structure and return the pointer of */
|
||||
/* the next object. */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbrin *fbh_delfbrin (listfbrin, ptfbrin)
|
||||
|
||||
struct fbrin *listfbrin; /* list of fbrin containing the object */
|
||||
struct fbrin *ptfbrin; /* pointer of the BERIN to be deleted */
|
||||
|
||||
{
|
||||
struct fbrin headrin;
|
||||
struct fbrin *ptlastrin;
|
||||
|
||||
if ((listfbrin != 0) && (ptfbrin != 0))
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headrin.NEXT = listfbrin;
|
||||
ptlastrin = &headrin;
|
||||
while ((ptlastrin != 0) && (ptlastrin->NEXT != ptfbrin))
|
||||
ptlastrin = ptlastrin->NEXT;
|
||||
|
||||
if (ptlastrin != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptlastrin->NEXT = ptfbrin->NEXT;
|
||||
mbkfree (ptfbrin);
|
||||
}
|
||||
|
||||
listfbrin = headrin.NEXT;
|
||||
}
|
||||
|
||||
return(listfbrin);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_delbiabl */
|
||||
/* description : delete a BIABL structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct biabl *fbh_delbiabl (listbiabl, ptbiabl, mode)
|
||||
|
||||
struct biabl *listbiabl; /* list of biabl containing the object */
|
||||
struct biabl *ptbiabl; /* pointer of the BIABL to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct biabl headabl;
|
||||
struct biabl *ptlastabl;
|
||||
|
||||
if ((listbiabl != 0) && (ptbiabl != 0))
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headabl.NEXT = listbiabl;
|
||||
ptlastabl = &headabl;
|
||||
while ((ptlastabl != 0) && (ptlastabl->NEXT != ptbiabl))
|
||||
ptlastabl = ptlastabl->NEXT;
|
||||
|
||||
if (ptlastabl != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if ((ptbiabl->VALABL != 0) || (ptbiabl->CNDABL != 0))
|
||||
(void) fprintf (stderr,"FBH_warning : biabl not empty\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
delablexpr (ptbiabl->VALABL);
|
||||
delablexpr (ptbiabl->CNDABL);
|
||||
}
|
||||
|
||||
ptlastabl->NEXT = ptbiabl->NEXT;
|
||||
mbkfree (ptbiabl);
|
||||
}
|
||||
|
||||
listbiabl = headabl.NEXT;
|
||||
}
|
||||
|
||||
return(listbiabl);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_delbinode */
|
||||
/* description : delete a BINODE structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct binode *fbh_delbinode (listbinode, ptbinode, mode)
|
||||
|
||||
struct binode *listbinode; /* list of binode containing the object */
|
||||
struct binode *ptbinode; /* pointer of the BINODE to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct binode headnode;
|
||||
struct binode *ptlastnode;
|
||||
|
||||
if ((listbinode != 0) && (ptbinode != 0))
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headnode.NEXT = listbinode;
|
||||
ptlastnode = &headnode;
|
||||
while ((ptlastnode != 0) && (ptlastnode->NEXT != ptbinode))
|
||||
ptlastnode = ptlastnode->NEXT;
|
||||
|
||||
if (ptlastnode != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if ((ptbinode->VALNODE != 0) || (ptbinode->CNDNODE != 0))
|
||||
(void) fprintf (stderr,"FBH_warning : binode not empty\n");
|
||||
}
|
||||
|
||||
ptlastnode->NEXT = ptbinode->NEXT;
|
||||
mbkfree (ptbinode);
|
||||
}
|
||||
|
||||
listbinode = headnode.NEXT;
|
||||
}
|
||||
|
||||
return(listbinode);
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbh_getgenva.c */
|
||||
/* date : Aug 24 1992 */
|
||||
/* version : v102 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* content : contains a specific function used to acces to the */
|
||||
/* value of a fbhaviour data structure */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "bdd.h"
|
||||
#include "fvh.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_getgenval */
|
||||
/* description : Search an find a BEGEN structure (known from its name)*/
|
||||
/* then return its value field. If the BEGEN is not found*/
|
||||
/* a 0 pointer is returned */
|
||||
/* called func. : */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void *fbh_getgenval (listfbgen, fbgenname)
|
||||
|
||||
struct fbgen *listfbgen; /* head of BEGEN list */
|
||||
char *fbgenname; /* name of the structure */
|
||||
|
||||
{
|
||||
struct fbgen *ptfbgen;
|
||||
void *value = 0;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* searching the object */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptfbgen = listfbgen;
|
||||
while ((ptfbgen != 0) && (ptfbgen->NAME != fbgenname))
|
||||
ptfbgen = ptfbgen->NEXT;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if found return its value field */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (ptfbgen != 0)
|
||||
value = ptfbgen->VALUE;
|
||||
|
||||
return (value);
|
||||
}
|
|
@ -0,0 +1,465 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbh_frefbaux.c */
|
||||
/* date : Aug 24 1992 */
|
||||
/* version : v102 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* content : contains a specific function used to delete a list */
|
||||
/* of fbhaviour data structures */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "bdd.h"
|
||||
#include "fvh.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frefbaux */
|
||||
/* description : delete a list of BEAUX structures and all objects */
|
||||
/* pointed by any os BEAUXs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frefbaux (listfbaux)
|
||||
|
||||
struct fbaux *listfbaux; /* list of fbaux to be deleted */
|
||||
|
||||
{
|
||||
struct fbaux *ptfbaux;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list, first delete pointed objects */
|
||||
/* then, delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listfbaux != 0)
|
||||
{
|
||||
freeablexpr (listfbaux->ABL);
|
||||
|
||||
ptfbaux = listfbaux;
|
||||
listfbaux = listfbaux->NEXT;
|
||||
mbkfree (ptfbaux);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frefbbus */
|
||||
/* description : delete a list of BEBUS structures and all objects */
|
||||
/* pointed by any os BEBUSs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frefbbus (listfbbus)
|
||||
|
||||
struct fbbus *listfbbus; /* list of fbbus to be deleted */
|
||||
|
||||
{
|
||||
struct fbbus *ptfbbus;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list, first delete pointed objects */
|
||||
/* then, delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listfbbus != 0)
|
||||
{
|
||||
fbh_frebiabl (listfbbus->BIABL);
|
||||
fbh_frebinode (listfbbus->BINODE);
|
||||
|
||||
ptfbbus = listfbbus;
|
||||
listfbbus = listfbbus->NEXT;
|
||||
mbkfree (ptfbbus);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frefbbux */
|
||||
/* description : delete a list of BEBUX structures and all objects */
|
||||
/* pointed by any os BEBUXs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frefbbux (listfbbux)
|
||||
|
||||
struct fbbux *listfbbux; /* list of fbbux to be deleted */
|
||||
|
||||
{
|
||||
struct fbbux *ptfbbux;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list, first delete pointed objects */
|
||||
/* then, delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listfbbux != 0)
|
||||
{
|
||||
fbh_frebiabl (listfbbux->BIABL);
|
||||
fbh_frebinode (listfbbux->BINODE);
|
||||
|
||||
ptfbbux = listfbbux;
|
||||
listfbbux = listfbbux->NEXT;
|
||||
mbkfree (ptfbbux);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frefbfig */
|
||||
/* description : delete a list of BEFIG structures and all objects */
|
||||
/* pointed by any os BEFIGs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frefbfig (listfbfig)
|
||||
|
||||
struct fbfig *listfbfig; /* list of fbfig to be deleted */
|
||||
|
||||
{
|
||||
struct fbfig *ptfbfig;
|
||||
struct ptype *ptptype;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list, first delete pointed objects */
|
||||
/* then, delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listfbfig != 0)
|
||||
{
|
||||
fbh_frefbreg (ptfbfig->BEREG);
|
||||
fbh_frefbmsg (ptfbfig->BEMSG);
|
||||
fbh_frefbrin (ptfbfig->BERIN);
|
||||
fbh_frefbout (ptfbfig->BEOUT);
|
||||
fbh_frefbbus (ptfbfig->BEBUS);
|
||||
fbh_frefbaux (ptfbfig->BEAUX);
|
||||
fbh_frefbaux (ptfbfig->BEDLY);
|
||||
fbh_frefbbux (ptfbfig->BEBUX);
|
||||
fbh_frefbpor (ptfbfig->BEPOR);
|
||||
fbh_frefbpgm (ptfbfig->BEPGM);
|
||||
if ((ptptype = getptype (ptfbfig->USER,FBH_GENERIC)) != 0)
|
||||
fbh_frefbgen (ptptype->DATA);
|
||||
|
||||
ptfbfig = listfbfig;
|
||||
listfbfig = listfbfig->NEXT;
|
||||
mbkfree (ptfbfig);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frefbgen */
|
||||
/* description : delete a list of BEGEN structures and all objects */
|
||||
/* pointed by any os BEGENs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frefbgen (listfbgen)
|
||||
|
||||
struct fbgen *listfbgen; /* list of fbgen to be deleted */
|
||||
|
||||
{
|
||||
struct fbgen *ptfbgen;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list, first delete pointed objects */
|
||||
/* then, delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listfbgen != 0)
|
||||
{
|
||||
mbkfree (listfbgen->VALUE);
|
||||
|
||||
ptfbgen = listfbgen;
|
||||
listfbgen = listfbgen->NEXT;
|
||||
mbkfree (ptfbgen);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frefbmsg */
|
||||
/* description : delete a list of BEMSG structures and all objects */
|
||||
/* pointed by any os BEMSGs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frefbmsg (listfbmsg)
|
||||
|
||||
struct fbmsg *listfbmsg; /* list of fbmsg to be deleted */
|
||||
|
||||
{
|
||||
struct fbmsg *ptfbmsg;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list, first delete pointed objects */
|
||||
/* then, delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listfbmsg != 0)
|
||||
{
|
||||
freeablexpr (listfbmsg->ABL);
|
||||
|
||||
ptfbmsg = listfbmsg;
|
||||
listfbmsg = listfbmsg->NEXT;
|
||||
mbkfree (ptfbmsg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frefbmsg */
|
||||
/* description : delete a list of BEMSG structures and all objects */
|
||||
/* pointed by any os BEMSGs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frefbpgm (listfbpgm)
|
||||
|
||||
struct fbpgm *listfbpgm; /* list of fbpgm to be deleted */
|
||||
|
||||
{
|
||||
struct fbpgm *ptfbpgm;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list, first delete pointed objects */
|
||||
/* then, delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listfbpgm != 0)
|
||||
{
|
||||
ptfbpgm = listfbpgm;
|
||||
listfbpgm = listfbpgm->NEXT;
|
||||
mbkfree (ptfbpgm);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frefbout */
|
||||
/* description : delete a list of BEOUT structures and all objects */
|
||||
/* pointed by any os BEOUTs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frefbout (listfbout)
|
||||
|
||||
struct fbout *listfbout; /* list of fbout to be deleted */
|
||||
|
||||
{
|
||||
struct fbout *ptfbout;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list, first delete pointed objects */
|
||||
/* then, delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listfbout != 0)
|
||||
{
|
||||
freeablexpr (listfbout->ABL);
|
||||
|
||||
ptfbout = listfbout;
|
||||
listfbout = listfbout->NEXT;
|
||||
mbkfree (ptfbout);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frefbpor */
|
||||
/* description : delete a list of BEAUX structures and all objects */
|
||||
/* pointed by any os BEAUXs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frefbpor (listfbpor)
|
||||
|
||||
struct fbpor *listfbpor; /* list of fbpor to be deleted */
|
||||
|
||||
{
|
||||
struct fbpor *ptfbpor;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list, delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listfbpor != 0)
|
||||
{
|
||||
ptfbpor = listfbpor;
|
||||
listfbpor = listfbpor->NEXT;
|
||||
mbkfree (ptfbpor);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frefbreg */
|
||||
/* description : delete a list of BEAUX structures and all objects */
|
||||
/* pointed by any os BEAUXs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frefbreg (listfbreg)
|
||||
|
||||
struct fbreg *listfbreg; /* list of fbreg to be deleted */
|
||||
|
||||
{
|
||||
struct fbreg *ptfbreg;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list, first delete pointed objects */
|
||||
/* then, delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listfbreg != 0)
|
||||
{
|
||||
fbh_frebiabl (listfbreg->BIABL);
|
||||
fbh_frebinode (listfbreg->BINODE);
|
||||
|
||||
ptfbreg = listfbreg;
|
||||
listfbreg = listfbreg->NEXT;
|
||||
mbkfree (ptfbreg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frefbrin */
|
||||
/* description : delete a list of BEAUX structures and all objects */
|
||||
/* pointed by any os BEAUXs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frefbrin (listfbrin)
|
||||
|
||||
struct fbrin *listfbrin; /* list of fbrin to be deleted */
|
||||
|
||||
{
|
||||
struct fbrin *ptfbrin;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listfbrin != 0)
|
||||
{
|
||||
ptfbrin = listfbrin;
|
||||
listfbrin = listfbrin->NEXT;
|
||||
mbkfree (ptfbrin);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frefbtyp */
|
||||
/* description : delete a list of BETYP structures and all objects */
|
||||
/* pointed by any os BETYPs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frefbtyp (listfbtyp)
|
||||
|
||||
struct fbtyp *listfbtyp; /* list of fbtyp to be deleted */
|
||||
|
||||
{
|
||||
struct fbtyp *ptfbtyp;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listfbtyp != 0)
|
||||
{
|
||||
ptfbtyp = listfbtyp;
|
||||
listfbtyp = listfbtyp->NEXT;
|
||||
mbkfree (ptfbtyp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frebiabl */
|
||||
/* description : delete a list of BIABL structures and all objects */
|
||||
/* pointed by any os BIABLs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frebiabl (listbiabl)
|
||||
|
||||
struct biabl *listbiabl; /* list of biabl to be deleted */
|
||||
|
||||
{
|
||||
struct biabl *ptbiabl;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list, first delete pointed objects */
|
||||
/* then, delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listbiabl != 0)
|
||||
{
|
||||
freeablexpr (listbiabl->VALABL);
|
||||
freeablexpr (listbiabl->CNDABL);
|
||||
|
||||
ptbiabl = listbiabl;
|
||||
listbiabl = listbiabl->NEXT;
|
||||
mbkfree (ptbiabl);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_frebinode */
|
||||
/* description : delete a list of BINODE structures and all objects */
|
||||
/* pointed by any os BINODEs in the list */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void fbh_frebinode (listbinode)
|
||||
|
||||
struct binode *listbinode; /* list of binode to be deleted */
|
||||
|
||||
{
|
||||
struct binode *ptbinode;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for each object of the list, first delete pointed objects */
|
||||
/* then, delete the object itself */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
while (listbinode != 0)
|
||||
{
|
||||
ptbinode = listbinode;
|
||||
listbinode = listbinode->NEXT;
|
||||
mbkfree (ptbinode);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbh_crtfbrin.c */
|
||||
/* date : Aug 24 1992 */
|
||||
/* version : v102 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* content : contains a specific function used to create a */
|
||||
/* fbhaviour data structure */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "bdd.h"
|
||||
#include "fvh.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_crtfbrin */
|
||||
/* description : create an array of BETYPs from a list of BETYPs */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbrin *fbh_crtfbrin (listfbrin)
|
||||
|
||||
struct fbrin *listfbrin; /* pointer on the list of fbrins */
|
||||
|
||||
{
|
||||
struct fbrin *lclfbrin = listfbrin;
|
||||
struct fbrin *ptfbrin = 0;
|
||||
int size = 0;
|
||||
|
||||
while (lclfbrin != 0)
|
||||
{
|
||||
lclfbrin = lclfbrin->NEXT;
|
||||
size++;
|
||||
}
|
||||
|
||||
if (size != 0)
|
||||
{
|
||||
ptfbrin = (struct fbrin *) mbkalloc (size * sizeof(struct fbrin));
|
||||
lclfbrin = ptfbrin;
|
||||
|
||||
while (listfbrin != 0)
|
||||
{
|
||||
lclfbrin->NAME = listfbrin->NAME;
|
||||
lclfbrin->NEXT = lclfbrin + 1;
|
||||
|
||||
listfbrin = listfbrin->NEXT;
|
||||
lclfbrin++;
|
||||
}
|
||||
|
||||
(lclfbrin - 1)->NEXT = 0;
|
||||
}
|
||||
|
||||
return (ptfbrin);
|
||||
}
|
|
@ -0,0 +1,673 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbh_rmvfbaux.c */
|
||||
/* date : Aug 24 1992 */
|
||||
/* version : v102 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* content : contains a specific function used to delete a */
|
||||
/* fbhaviour data structure */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "bdd.h"
|
||||
#include "fvh.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_rmvfbaux */
|
||||
/* description : delete a BEAUX structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbaux *fbh_rmvfbaux (listfbaux, fbauxname, mode)
|
||||
|
||||
struct fbaux *listfbaux; /* list of fbaux containing the object */
|
||||
char *fbauxname; /* name of the BEAUX to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbaux headaux;
|
||||
struct fbaux *ptlastaux;
|
||||
struct fbaux *ptfbaux;
|
||||
|
||||
if (listfbaux != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headaux.NEXT = listfbaux;
|
||||
ptfbaux = &headaux;
|
||||
while ((ptfbaux != 0) && (ptfbaux->NAME != fbauxname))
|
||||
{
|
||||
ptlastaux = ptfbaux;
|
||||
ptfbaux = ptfbaux->NEXT;
|
||||
}
|
||||
|
||||
if (ptfbaux != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if (ptfbaux->ABL != 0)
|
||||
(void) fprintf (stderr,"FBH_warning : fbaux `%s` not empty\n",
|
||||
fbauxname);
|
||||
}
|
||||
else
|
||||
delablexpr (ptfbaux->ABL);
|
||||
|
||||
ptlastaux->NEXT = ptfbaux->NEXT;
|
||||
mbkfree (ptfbaux);
|
||||
}
|
||||
|
||||
listfbaux = headaux.NEXT;
|
||||
}
|
||||
|
||||
return(listfbaux);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_rmvfbbus */
|
||||
/* description : delete a BEBUS structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbbus *fbh_rmvfbbus (listfbbus, fbbusname, mode)
|
||||
|
||||
struct fbbus *listfbbus; /* list of fbbus containing the object */
|
||||
char *fbbusname; /* name of the BEBUS to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbbus headbus;
|
||||
struct fbbus *ptlastbus;
|
||||
struct fbbus *ptfbbus;
|
||||
|
||||
if (listfbbus != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headbus.NEXT = listfbbus;
|
||||
ptfbbus = &headbus;
|
||||
while ((ptfbbus != 0) && (ptfbbus->NAME != fbbusname))
|
||||
{
|
||||
ptlastbus = ptfbbus;
|
||||
ptfbbus = ptfbbus->NEXT;
|
||||
}
|
||||
|
||||
if (ptfbbus != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if ((ptfbbus->BIABL != 0) || (ptfbbus->BINODE != 0))
|
||||
(void) fprintf (stderr,"FBH_warning : fbbus `%s` not empty\n",
|
||||
fbbusname);
|
||||
}
|
||||
else
|
||||
{
|
||||
fbh_frebiabl (ptfbbus->BIABL);
|
||||
fbh_frebinode (ptfbbus->BINODE);
|
||||
}
|
||||
|
||||
ptlastbus->NEXT = ptfbbus->NEXT;
|
||||
mbkfree (ptfbbus);
|
||||
}
|
||||
|
||||
listfbbus = headbus.NEXT;
|
||||
}
|
||||
|
||||
return(listfbbus);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_rmvfbbux */
|
||||
/* description : delete a BEBUX structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbbux *fbh_rmvfbbux (listfbbux, fbbuxname, mode)
|
||||
|
||||
struct fbbux *listfbbux; /* list of fbbux containing the object */
|
||||
char *fbbuxname; /* name of the BEBUX to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbbux headbux;
|
||||
struct fbbux *ptlastbux;
|
||||
struct fbbux *ptfbbux;
|
||||
|
||||
if (listfbbux != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headbux.NEXT = listfbbux;
|
||||
ptfbbux = &headbux;
|
||||
while ((ptfbbux != 0) && (ptfbbux->NAME != fbbuxname))
|
||||
{
|
||||
ptlastbux = ptfbbux;
|
||||
ptfbbux = ptfbbux->NEXT;
|
||||
}
|
||||
|
||||
if (ptfbbux != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if ((ptfbbux->BIABL != 0) || (ptfbbux->BINODE != 0))
|
||||
(void) fprintf (stderr,"FBH_warning : fbbux `%s` not empty\n",
|
||||
fbbuxname);
|
||||
}
|
||||
else
|
||||
{
|
||||
fbh_frebiabl (ptfbbux->BIABL);
|
||||
fbh_frebinode (ptfbbux->BINODE);
|
||||
}
|
||||
|
||||
ptlastbux->NEXT = ptfbbux->NEXT;
|
||||
mbkfree (ptfbbux);
|
||||
}
|
||||
|
||||
listfbbux = headbux.NEXT;
|
||||
}
|
||||
|
||||
return(listfbbux);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_rmvfbfig */
|
||||
/* description : delete a BEFIG structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N. */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbfig *fbh_rmvfbfig (listfbfig, fbfigname, mode)
|
||||
|
||||
struct fbfig *listfbfig; /* list of fbfig containing the object */
|
||||
char *fbfigname; /* name of the BEFIG to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbfig headfig;
|
||||
struct fbfig *ptlastfig;
|
||||
struct fbfig *ptfbfig;
|
||||
struct ptype *ptptype;
|
||||
|
||||
if (listfbfig != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headfig.NEXT = listfbfig;
|
||||
ptfbfig = &headfig;
|
||||
while ((ptfbfig != 0) && (ptfbfig->NAME != fbfigname))
|
||||
{
|
||||
ptlastfig = ptfbfig;
|
||||
ptfbfig = ptfbfig->NEXT;
|
||||
}
|
||||
|
||||
if (ptfbfig != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if ((ptfbfig->BEREG != 0) || (ptfbfig->BEMSG != 0) ||
|
||||
(ptfbfig->BERIN != 0) || (ptfbfig->BEOUT != 0) ||
|
||||
(ptfbfig->BEBUS != 0) || (ptfbfig->BEAUX != 0) ||
|
||||
(ptfbfig->BEDLY !=0) || (ptfbfig->BEBUX != 0) ||
|
||||
(ptfbfig->BEPOR != 0) || (ptfbfig->USER != 0))
|
||||
|
||||
(void) fprintf (stderr,"FBH_warning : fbfig `%s` not empty\n",
|
||||
fbfigname);
|
||||
}
|
||||
else
|
||||
{
|
||||
fbh_frefbreg (ptfbfig->BEREG);
|
||||
fbh_frefbmsg (ptfbfig->BEMSG);
|
||||
fbh_frefbrin (ptfbfig->BERIN);
|
||||
fbh_frefbout (ptfbfig->BEOUT);
|
||||
fbh_frefbbus (ptfbfig->BEBUS);
|
||||
fbh_frefbaux (ptfbfig->BEAUX);
|
||||
fbh_frefbaux (ptfbfig->BEDLY);
|
||||
fbh_frefbbux (ptfbfig->BEBUX);
|
||||
fbh_frefbpor (ptfbfig->BEPOR);
|
||||
if ((ptptype = getptype (ptfbfig->USER,FBH_GENERIC)) != 0)
|
||||
fbh_frefbgen (ptptype->DATA);
|
||||
}
|
||||
|
||||
ptlastfig->NEXT = ptfbfig->NEXT;
|
||||
mbkfree (ptfbfig);
|
||||
}
|
||||
|
||||
listfbfig = headfig.NEXT;
|
||||
}
|
||||
|
||||
return(listfbfig);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_rmvfbgen */
|
||||
/* description : delete a BEGEN structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbgen *fbh_rmvfbgen (listfbgen, fbgenname, mode)
|
||||
|
||||
struct fbgen *listfbgen; /* list of fbgen containing the object */
|
||||
char *fbgenname; /* name of the BEGEN to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbgen headgen;
|
||||
struct fbgen *ptlastgen;
|
||||
struct fbgen *ptfbgen;
|
||||
|
||||
if (listfbgen != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headgen.NEXT = listfbgen;
|
||||
ptfbgen = &headgen;
|
||||
while ((ptfbgen != 0) && (ptfbgen->NAME != fbgenname))
|
||||
{
|
||||
ptlastgen = ptfbgen;
|
||||
ptfbgen = ptfbgen->NEXT;
|
||||
}
|
||||
|
||||
if (ptfbgen != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if (ptfbgen->VALUE != 0)
|
||||
(void) fprintf (stderr,"FBH_warning : fbgen `%s` not empty\n",
|
||||
fbgenname);
|
||||
}
|
||||
else
|
||||
mbkfree (ptfbgen->VALUE);
|
||||
|
||||
ptlastgen->NEXT = ptfbgen->NEXT;
|
||||
mbkfree (ptfbgen);
|
||||
}
|
||||
|
||||
listfbgen = headgen.NEXT;
|
||||
}
|
||||
|
||||
return(listfbgen);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_rmvfbmsg */
|
||||
/* description : delete a BEMSG structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbmsg *fbh_rmvfbmsg (listfbmsg, fbmsglabl, mode)
|
||||
|
||||
struct fbmsg *listfbmsg; /* list of fbmsg containing the object */
|
||||
char *fbmsglabl; /* label of the BEMSG to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbmsg headmsg;
|
||||
struct fbmsg *ptlastmsg;
|
||||
struct fbmsg *ptfbmsg;
|
||||
|
||||
if (listfbmsg != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headmsg.NEXT = listfbmsg;
|
||||
ptfbmsg = &headmsg;
|
||||
while ((ptfbmsg != 0) && (ptfbmsg->LABEL != fbmsglabl))
|
||||
{
|
||||
ptlastmsg = ptfbmsg;
|
||||
ptfbmsg = ptfbmsg->NEXT;
|
||||
}
|
||||
|
||||
if (ptfbmsg != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if (ptfbmsg->ABL != 0)
|
||||
(void) fprintf (stderr,"FBH_warning : fbmsg `%s` not empty\n",
|
||||
fbmsglabl);
|
||||
}
|
||||
else
|
||||
delablexpr (ptfbmsg->ABL);
|
||||
|
||||
ptlastmsg->NEXT = ptfbmsg->NEXT;
|
||||
mbkfree (ptfbmsg);
|
||||
}
|
||||
|
||||
listfbmsg = headmsg.NEXT;
|
||||
}
|
||||
|
||||
return(listfbmsg);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_rmvfbout */
|
||||
/* description : delete a BEOUT structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbout *fbh_rmvfbout (listfbout, fboutname, mode)
|
||||
|
||||
struct fbout *listfbout; /* list of fbout containing the object */
|
||||
char *fboutname; /* name of the BEOUT to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbout headout;
|
||||
struct fbout *ptlastout;
|
||||
struct fbout *ptfbout;
|
||||
|
||||
if (listfbout != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headout.NEXT = listfbout;
|
||||
ptfbout = &headout;
|
||||
while ((ptfbout != 0) && (ptfbout->NAME != fboutname))
|
||||
{
|
||||
ptlastout = ptfbout;
|
||||
ptfbout = ptfbout->NEXT;
|
||||
}
|
||||
|
||||
if (ptfbout != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if (ptfbout->ABL != 0)
|
||||
(void) fprintf (stderr,"FBH_warning : fbout `%s` not empty\n",
|
||||
fboutname);
|
||||
}
|
||||
else
|
||||
delablexpr (ptfbout->ABL);
|
||||
|
||||
ptlastout->NEXT = ptfbout->NEXT;
|
||||
mbkfree (ptfbout);
|
||||
}
|
||||
|
||||
listfbout = headout.NEXT;
|
||||
}
|
||||
|
||||
return(listfbout);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_rmvfbpor */
|
||||
/* description : delete a BEPOR structure and return the pointer of */
|
||||
/* the next object. */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbpor *fbh_rmvfbpor (listfbpor, fbporname)
|
||||
|
||||
struct fbpor *listfbpor; /* list of fbpor containing the object */
|
||||
char *fbporname; /* name of the BEPOR to be deleted */
|
||||
|
||||
{
|
||||
struct fbpor headpor;
|
||||
struct fbpor *ptlastpor;
|
||||
struct fbpor *ptfbpor;
|
||||
|
||||
if (listfbpor != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headpor.NEXT = listfbpor;
|
||||
ptfbpor = &headpor;
|
||||
while ((ptfbpor != 0) && (ptfbpor->NAME != fbporname))
|
||||
{
|
||||
ptlastpor = ptfbpor;
|
||||
ptfbpor = ptfbpor->NEXT;
|
||||
}
|
||||
|
||||
if (ptfbpor != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptlastpor->NEXT = ptfbpor->NEXT;
|
||||
mbkfree (ptfbpor);
|
||||
}
|
||||
|
||||
listfbpor = headpor.NEXT;
|
||||
}
|
||||
|
||||
return(listfbpor);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_rmvfbreg */
|
||||
/* description : delete a BEREG structure and return the pointer of */
|
||||
/* the next object. A warning is printed out if the */
|
||||
/* object to be deleted is not empty when the mode is N */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbreg *fbh_rmvfbreg (listfbreg, fbregname, mode)
|
||||
|
||||
struct fbreg *listfbreg; /* list of fbreg containing the object */
|
||||
char *fbregname; /* name of the BEREG to be deleted */
|
||||
char mode; /* recursive delete or not (Y or N) */
|
||||
|
||||
{
|
||||
struct fbreg headreg;
|
||||
struct fbreg *ptlastreg;
|
||||
struct fbreg *ptfbreg;
|
||||
|
||||
if (listfbreg != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headreg.NEXT = listfbreg;
|
||||
ptfbreg = &headreg;
|
||||
while ((ptfbreg != 0) && (ptfbreg->NAME != fbregname))
|
||||
{
|
||||
ptlastreg = ptfbreg;
|
||||
ptfbreg = ptfbreg->NEXT;
|
||||
}
|
||||
|
||||
if (ptfbreg != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* If the object has been found check the mode and, if asked */
|
||||
/* delete pointed objects recursively. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (mode == 'N')
|
||||
{
|
||||
if ((ptfbreg->BIABL != 0) || (ptfbreg->BINODE != 0))
|
||||
(void) fprintf (stderr,"FBH_warning : fbreg `%s` not empty\n",
|
||||
fbregname);
|
||||
}
|
||||
else
|
||||
{
|
||||
fbh_frebiabl (ptfbreg->BIABL);
|
||||
fbh_frebinode (ptfbreg->BINODE);
|
||||
}
|
||||
|
||||
ptlastreg->NEXT = ptfbreg->NEXT;
|
||||
mbkfree (ptfbreg);
|
||||
}
|
||||
|
||||
listfbreg = headreg.NEXT;
|
||||
}
|
||||
|
||||
return(listfbreg);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_rmvfbrin */
|
||||
/* description : delete a BERIN structure and return the pointer of */
|
||||
/* the next object. */
|
||||
/* called func. : mbkfree */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbrin *fbh_rmvfbrin (listfbrin, fbrinname)
|
||||
|
||||
struct fbrin *listfbrin; /* list of fbrin containing the object */
|
||||
char *fbrinname; /* name of the BERIN to be deleted */
|
||||
|
||||
{
|
||||
struct fbrin headrin;
|
||||
struct fbrin *ptlastrin;
|
||||
struct fbrin *ptfbrin;
|
||||
|
||||
if (listfbrin != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Search the object to be deleted */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
headrin.NEXT = listfbrin;
|
||||
ptfbrin = &headrin;
|
||||
while ((ptfbrin != 0) && (ptfbrin->NAME != fbrinname))
|
||||
{
|
||||
ptlastrin = ptfbrin;
|
||||
ptfbrin = ptfbrin->NEXT;
|
||||
}
|
||||
|
||||
if (ptfbrin != 0)
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the object doesn't exist return the list without */
|
||||
/* modification. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptlastrin->NEXT = ptfbrin->NEXT;
|
||||
mbkfree (ptfbrin);
|
||||
}
|
||||
|
||||
listfbrin = headrin.NEXT;
|
||||
}
|
||||
|
||||
return(listfbrin);
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbh_crtfbtyp.c */
|
||||
/* date : Aug 24 1992 */
|
||||
/* version : v102 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* content : contains a specific function used to create a */
|
||||
/* fbhaviour data structure */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "bdd.h"
|
||||
#include "fvh.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbh_crtfbtyp */
|
||||
/* description : create an array of BETYPs from a list of BETYPs */
|
||||
/* called func. : namealloc, mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct fbtyp *fbh_crtfbtyp (listfbtyp)
|
||||
|
||||
struct fbtyp *listfbtyp; /* pointer on the list of fbtyps */
|
||||
|
||||
{
|
||||
struct fbtyp *lclfbtyp = listfbtyp;
|
||||
struct fbtyp *ptfbtyp = 0;
|
||||
int size = 0;
|
||||
|
||||
while (lclfbtyp != 0)
|
||||
{
|
||||
lclfbtyp = lclfbtyp->NEXT;
|
||||
size++;
|
||||
}
|
||||
|
||||
if (size != 0)
|
||||
{
|
||||
ptfbtyp = (struct fbtyp *) mbkalloc (size * sizeof(struct fbtyp));
|
||||
lclfbtyp = ptfbtyp;
|
||||
|
||||
while (listfbtyp != 0)
|
||||
{
|
||||
lclfbtyp->NAME = listfbtyp->NAME;
|
||||
lclfbtyp->LEFT = listfbtyp->LEFT;
|
||||
lclfbtyp->RIGHT = listfbtyp->RIGHT;
|
||||
lclfbtyp->VALUE = listfbtyp->VALUE;
|
||||
lclfbtyp->SIZE = listfbtyp->SIZE;
|
||||
lclfbtyp->BYTE = listfbtyp->BYTE;
|
||||
lclfbtyp->BASE = listfbtyp->BASE;
|
||||
lclfbtyp->INDEX = listfbtyp->INDEX;
|
||||
lclfbtyp->RESOLV = listfbtyp->RESOLV;
|
||||
lclfbtyp->CLASS = listfbtyp->CLASS;
|
||||
|
||||
lclfbtyp->NEXT = lclfbtyp + 1;
|
||||
|
||||
listfbtyp = listfbtyp->NEXT;
|
||||
lclfbtyp++;
|
||||
}
|
||||
|
||||
(lclfbtyp - 1)->NEXT = 0;
|
||||
}
|
||||
|
||||
return (ptfbtyp);
|
||||
}
|
|
@ -0,0 +1,173 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/***************************************************************************
|
||||
* Fonctions utiles pour fbfig : optimisation des abl d'un fbfig, evaluation *
|
||||
* du cout . . . *
|
||||
* Le 01/09/92.
|
||||
****************************************************************************/
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "bdd.h"
|
||||
#include "fvh.h"
|
||||
|
||||
/*------------------------------------------------------------------------i
|
||||
fsp_mapCarExprFbh : applique une fonction de conversion sur chaque expression
|
||||
d'une fbfig
|
||||
---------------------------------------------------------------------------
|
||||
retour : un void.
|
||||
---------------------------------------------------------------------------*/
|
||||
void fsp_mapCarExprFbh(fbh,func)
|
||||
|
||||
fbfig_list *fbh;
|
||||
chain_list *(*func)();
|
||||
{
|
||||
fbout_list *out;
|
||||
fbreg_list *reg;
|
||||
fbbus_list *bus;
|
||||
fbbux_list *bux;
|
||||
biabl_list *biabl;
|
||||
fbaux_list *aux;
|
||||
|
||||
|
||||
aux = fbh->BEAUX;
|
||||
while (aux)
|
||||
{
|
||||
if (aux->ABL)
|
||||
{
|
||||
aux->ABL = (*func)(aux->ABL);
|
||||
}
|
||||
aux = aux->NEXT;
|
||||
}
|
||||
|
||||
out = fbh->BEOUT;
|
||||
while (out)
|
||||
{
|
||||
if (out->ABL)
|
||||
{
|
||||
out->ABL = (*func)(out->ABL);
|
||||
}
|
||||
out = out->NEXT;
|
||||
}
|
||||
|
||||
reg = fbh->BEREG;
|
||||
while (reg)
|
||||
{
|
||||
biabl = reg->BIABL;
|
||||
while (biabl)
|
||||
{
|
||||
if (biabl->CNDABL && biabl->VALABL)
|
||||
{
|
||||
biabl->CNDABL = (*func)(biabl->CNDABL);
|
||||
biabl->VALABL = (*func)(biabl->VALABL);
|
||||
}
|
||||
biabl = biabl->NEXT;
|
||||
}
|
||||
reg = reg->NEXT;
|
||||
}
|
||||
|
||||
bus = fbh->BEBUS;
|
||||
while (bus)
|
||||
{
|
||||
biabl = bus->BIABL;
|
||||
while (biabl)
|
||||
{
|
||||
if (biabl->CNDABL && biabl->VALABL)
|
||||
{
|
||||
biabl->CNDABL = (*func)(biabl->CNDABL);
|
||||
biabl->VALABL = (*func)(biabl->VALABL);
|
||||
}
|
||||
biabl = biabl->NEXT;
|
||||
}
|
||||
bus = bus->NEXT;
|
||||
}
|
||||
|
||||
bux = fbh->BEBUX;
|
||||
while (bux)
|
||||
{
|
||||
biabl = bux->BIABL;
|
||||
while (biabl)
|
||||
{
|
||||
if (biabl->CNDABL && biabl->VALABL)
|
||||
{
|
||||
biabl->CNDABL = (*func)(biabl->CNDABL);
|
||||
biabl->VALABL = (*func)(biabl->VALABL);
|
||||
}
|
||||
biabl = biabl->NEXT;
|
||||
}
|
||||
bux = bux->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
fbrinToChain_list : forme une chaine liste des entrees.
|
||||
prend l'odre d'apparition.
|
||||
-----------------------------------------------------------------------
|
||||
parametres : fbh.
|
||||
---------------------------------------------------------------------------
|
||||
retour : un pointeur de chain_list.
|
||||
---------------------------------------------------------------------------*/
|
||||
chain_list *fbrinToChain_list(fbh)
|
||||
fbfig_list *fbh;
|
||||
{
|
||||
fbrin_list *in;
|
||||
chain_list *lst;
|
||||
|
||||
in = fbh->BERIN; /* entrees primaires */
|
||||
lst = 0;
|
||||
|
||||
while (in)
|
||||
{
|
||||
lst = addchain(lst,(void *)in->NAME);
|
||||
in = in->NEXT;
|
||||
};
|
||||
|
||||
return(lst);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
fsp_countInputFbh : compte les entrees d'un circuit (fbrin)
|
||||
---------------------------------------------------------------------------
|
||||
retour : un int.
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
int fsp_countInputFbh(fbh)
|
||||
fbfig_list *fbh;
|
||||
{
|
||||
fbrin_list *in;
|
||||
int count = 0;
|
||||
|
||||
in = fbh->BERIN; /* entrees primaires */
|
||||
while (in)
|
||||
{
|
||||
in = in->NEXT;
|
||||
count++;
|
||||
};
|
||||
|
||||
return(count);
|
||||
}
|
|
@ -0,0 +1,249 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Tool : FBH |
|
||||
| |
|
||||
| File : fbh_view.c |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 09.11.99 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "bdd.h"
|
||||
#include "fvh.h"
|
||||
|
||||
static void loc_fbh_viewablexprln( Expr )
|
||||
|
||||
ablexpr *Expr;
|
||||
{
|
||||
if ( Expr == (ablexpr *)0 )
|
||||
{
|
||||
fprintf( stdout, "NULL\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
viewablexprln( Expr, ABL_VIEW_VHDL );
|
||||
}
|
||||
}
|
||||
|
||||
void fbh_viewbiabl( BiAbl )
|
||||
|
||||
biabl_list *BiAbl;
|
||||
{
|
||||
if ( BiAbl == (biabl_list *)0 )
|
||||
{
|
||||
fprintf( stdout, "NULL\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
while ( BiAbl != (biabl_list *)0 )
|
||||
{
|
||||
fprintf( stdout, "--> biabl_list\n" );
|
||||
fprintf( stdout, " LABEL : %s\n", BiAbl->LABEL );
|
||||
fprintf( stdout, " CNDABL : " );
|
||||
loc_fbh_viewablexprln( BiAbl->CNDABL );
|
||||
fprintf( stdout, " VALABL : " );
|
||||
loc_fbh_viewablexprln( BiAbl->VALABL );
|
||||
fprintf( stdout, "<-- biabl_list\n" );
|
||||
|
||||
BiAbl = BiAbl->NEXT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void fbh_viewfbreg( ScanReg )
|
||||
|
||||
fbreg_list *ScanReg;
|
||||
{
|
||||
if ( ScanReg != (fbreg_list *)0 )
|
||||
{
|
||||
fprintf( stdout, "--> fbreg_list\n" );
|
||||
fprintf( stdout, " NAME : %s\n", ScanReg->NAME );
|
||||
fprintf( stdout, " FLAG : %d\n", (int)ScanReg->FLAG );
|
||||
fprintf( stdout, " BIABL :\n" );
|
||||
fbh_viewbiabl( ScanReg->BIABL );
|
||||
fprintf( stdout, "<-- fbreg_list\n" );
|
||||
}
|
||||
}
|
||||
|
||||
void fbh_viewfbbux( ScanBux )
|
||||
|
||||
fbbux_list *ScanBux;
|
||||
{
|
||||
if ( ScanBux != (fbbux_list *)0 )
|
||||
{
|
||||
fprintf( stdout, "--> fbbux_list\n" );
|
||||
fprintf( stdout, " NAME : %s\n", ScanBux->NAME );
|
||||
fprintf( stdout, " TYPE : %d\n", (int)ScanBux->TYPE );
|
||||
fprintf( stdout, " FLAG : %d\n", (int)ScanBux->FLAG );
|
||||
fprintf( stdout, " BIABL :\n" );
|
||||
fbh_viewbiabl( ScanBux->BIABL );
|
||||
fprintf( stdout, "<-- fbbux_list\n" );
|
||||
}
|
||||
}
|
||||
|
||||
void fbh_viewfbbus( ScanBus )
|
||||
|
||||
fbbus_list *ScanBus;
|
||||
{
|
||||
if ( ScanBus != (fbbus_list *)0 )
|
||||
{
|
||||
fprintf( stdout, "--> fbbus_list\n" );
|
||||
fprintf( stdout, " NAME : %s\n", ScanBus->NAME );
|
||||
fprintf( stdout, " TYPE : %d\n", (int)ScanBus->TYPE );
|
||||
fprintf( stdout, " FLAG : %d\n", (int)ScanBus->FLAG );
|
||||
fprintf( stdout, " BIABL :\n" );
|
||||
fbh_viewbiabl( ScanBus->BIABL );
|
||||
fprintf( stdout, "<-- fbbus_list\n" );
|
||||
}
|
||||
}
|
||||
|
||||
void fbh_viewfbaux( ScanAux )
|
||||
|
||||
fbaux_list *ScanAux;
|
||||
{
|
||||
if ( ScanAux != (fbaux_list *)0 )
|
||||
{
|
||||
fprintf( stdout, "--> fbaux_list\n" );
|
||||
fprintf( stdout, " NAME : %s\n", ScanAux->NAME );
|
||||
fprintf( stdout, " TYPE : %d\n", (int)ScanAux->TYPE );
|
||||
fprintf( stdout, " FLAG : %d\n", (int)ScanAux->FLAG );
|
||||
fprintf( stdout, " ABL :" );
|
||||
loc_fbh_viewablexprln( ScanAux->ABL, ABL_VIEW_VHDL );
|
||||
fprintf( stdout, "<-- fbaux_list\n" );
|
||||
}
|
||||
}
|
||||
|
||||
void fbh_viewfbout( ScanOut )
|
||||
|
||||
fbout_list *ScanOut;
|
||||
{
|
||||
if ( ScanOut != (fbout_list *)0 )
|
||||
{
|
||||
fprintf( stdout, "--> fbout_list\n" );
|
||||
fprintf( stdout, " NAME : %s\n", ScanOut->NAME );
|
||||
fprintf( stdout, " TYPE : %d\n", (int)ScanOut->TYPE );
|
||||
fprintf( stdout, " FLAG : %d\n", (int)ScanOut->FLAG );
|
||||
fprintf( stdout, " ABL :" );
|
||||
loc_fbh_viewablexprln( ScanOut->ABL );
|
||||
fprintf( stdout, "<-- fbout_list\n" );
|
||||
}
|
||||
}
|
||||
|
||||
void fbh_viewfbpor( ScanPort )
|
||||
|
||||
fbpor_list *ScanPort;
|
||||
{
|
||||
if ( ScanPort != (fbpor_list *)0 )
|
||||
{
|
||||
fprintf( stdout, "--> fbpor_list\n" );
|
||||
fprintf( stdout, " NAME : %s\n", ScanPort->NAME );
|
||||
fprintf( stdout, " DIR : %c\n", ScanPort->DIRECTION );
|
||||
fprintf( stdout, " TYPE : %d\n", (int)ScanPort->TYPE );
|
||||
fprintf( stdout, "<-- fbpor_list\n" );
|
||||
}
|
||||
}
|
||||
|
||||
void fbh_viewfbfig( ScanFigure )
|
||||
|
||||
fbfig_list *ScanFigure;
|
||||
{
|
||||
fbpor_list *ScanPort;
|
||||
fbaux_list *ScanAux;
|
||||
fbbus_list *ScanBus;
|
||||
fbbux_list *ScanBux;
|
||||
fbreg_list *ScanReg;
|
||||
fbout_list *ScanOut;
|
||||
|
||||
if ( ScanFigure != (fbfig_list *)0 )
|
||||
{
|
||||
fprintf( stdout, "--> fbfig_list\n" );
|
||||
fprintf( stdout, " NAME : %s\n", ScanFigure->NAME );
|
||||
|
||||
fprintf( stdout, " BEPOR:\n" );
|
||||
|
||||
for ( ScanPort = ScanFigure->BEPOR;
|
||||
ScanPort != (fbpor_list *)0;
|
||||
ScanPort = ScanPort->NEXT )
|
||||
{
|
||||
fbh_viewfbpor( ScanPort );
|
||||
}
|
||||
|
||||
fprintf( stdout, " BEAUX:\n" );
|
||||
|
||||
for ( ScanAux = ScanFigure->BEAUX;
|
||||
ScanAux != (fbaux_list *)0;
|
||||
ScanAux = ScanAux->NEXT )
|
||||
{
|
||||
fbh_viewfbaux( ScanAux );
|
||||
}
|
||||
|
||||
fprintf( stdout, " BEBUS:\n" );
|
||||
|
||||
for ( ScanBus = ScanFigure->BEBUS;
|
||||
ScanBus != (fbbus_list *)0;
|
||||
ScanBus = ScanBus->NEXT )
|
||||
{
|
||||
fbh_viewfbbus( ScanBus );
|
||||
}
|
||||
|
||||
fprintf( stdout, " BEBUX:\n" );
|
||||
|
||||
for ( ScanBux = ScanFigure->BEBUX;
|
||||
ScanBux != (fbbux_list *)0;
|
||||
ScanBux = ScanBux->NEXT )
|
||||
{
|
||||
fbh_viewfbbux( ScanBux );
|
||||
}
|
||||
|
||||
fprintf( stdout, " BEREG:\n" );
|
||||
|
||||
for ( ScanReg = ScanFigure->BEREG;
|
||||
ScanReg != (fbreg_list *)0;
|
||||
ScanReg = ScanReg->NEXT )
|
||||
{
|
||||
fbh_viewfbreg( ScanReg );
|
||||
}
|
||||
|
||||
fprintf( stdout, " BEOUT:\n" );
|
||||
|
||||
for ( ScanOut = ScanFigure->BEOUT;
|
||||
ScanOut != (fbout_list *)0;
|
||||
ScanOut = ScanOut->NEXT )
|
||||
{
|
||||
fbh_viewfbout( ScanOut );
|
||||
}
|
||||
|
||||
fprintf( stdout, "<-- fbfig_list\n" );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,269 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
%{
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "bdd.h"
|
||||
#include "fvh.h"
|
||||
|
||||
typedef struct fbl_expr
|
||||
{
|
||||
char *IDENT; /* identifier or constant name */
|
||||
struct chain *LIST_ABL; /* pointer on fbl_abllst list */
|
||||
short WIDTH; /* width of bit vector */
|
||||
}
|
||||
fbl_ablstr;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *NAME; /* identifier name */
|
||||
short LEFT; /* vector's left index */
|
||||
short RIGHT; /* vector's right index */
|
||||
char FLAG;
|
||||
}
|
||||
fbl_name;
|
||||
|
||||
struct g_type
|
||||
{
|
||||
int VALU;
|
||||
char FLAG;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#include "fbl_y.tab.h"
|
||||
#include "fbl_bedef.h"
|
||||
#include "fbl_blex.h"
|
||||
|
||||
static el_mc tab_mc []=
|
||||
{
|
||||
{"abs" ,ABS},
|
||||
{"access" ,ACCESS},
|
||||
{"after" ,AFTER},
|
||||
{"alias" ,ALIAS},
|
||||
{"all" ,ALL},
|
||||
{"and" ,_AND},
|
||||
{"architecture" ,ARCHITECTURE},
|
||||
{"array" ,ARRAY},
|
||||
{"assert" ,ASSERT},
|
||||
{"attribute" ,ATTRIBUTE},
|
||||
{"begin" ,_BEGIN},
|
||||
{"block" ,_BLOCK},
|
||||
{"body" ,BODY},
|
||||
{"buffer" ,BUFFER},
|
||||
{"bus" ,BUS},
|
||||
{"case" ,CASE},
|
||||
{"component" ,COMPONENT},
|
||||
{"configuration" ,CONFIGURATION},
|
||||
{"constant" ,CONSTANT},
|
||||
{"disconnect" ,DISCONNECT},
|
||||
{"downto" ,DOWNTO},
|
||||
{"else" ,ELSE},
|
||||
{"elsif" ,ELSIF},
|
||||
{"end" ,_END},
|
||||
{"entity" ,ENTITY},
|
||||
{"error" ,ERROR},
|
||||
{"event" ,_EVENT},
|
||||
{"exit" ,_EXIT},
|
||||
{"file" ,_FILE},
|
||||
{"for" ,FOR},
|
||||
{"function" ,FUNCTION},
|
||||
{"generate" ,GENERATE},
|
||||
{"generic" ,GENERIC},
|
||||
{"guarded" ,GUARDED},
|
||||
{"if" ,IF},
|
||||
{"in" ,_IN},
|
||||
{"inout" ,_INOUT},
|
||||
{"is" ,IS},
|
||||
{"label" ,_LABEL},
|
||||
{"library" ,LIBRARY},
|
||||
{"linkage" ,_LINKAGE},
|
||||
{"loop" ,LOOP},
|
||||
{"map" ,MAP},
|
||||
{"mod" ,MOD},
|
||||
{"nand" ,_NAND},
|
||||
{"new" ,NEW},
|
||||
{"next" ,_NEXT},
|
||||
{"nor" ,_NOR},
|
||||
{"not" ,_NOT},
|
||||
{"null" ,_NULL},
|
||||
{"of" ,OF},
|
||||
{"on" ,ON},
|
||||
{"open" ,OPEN},
|
||||
{"or" ,_OR},
|
||||
{"others" ,OTHERS},
|
||||
{"out" ,_OUT},
|
||||
{"package" ,PACKAGE},
|
||||
{"port" ,PORT},
|
||||
{"procedure" ,PROCEDURE},
|
||||
{"process" ,PROCESS},
|
||||
{"range" ,RANGE},
|
||||
{"record" ,RECORD},
|
||||
{"register" ,REGISTER},
|
||||
{"rem" ,REM},
|
||||
{"report" ,REPORT},
|
||||
{"return" ,RETURN},
|
||||
{"select" ,SELECT},
|
||||
{"severity" ,SEVERITY},
|
||||
{"signal" ,SIGNAL},
|
||||
{"stable" ,_STABLE},
|
||||
{"subtype" ,SUBTYPE},
|
||||
{"then" ,THEN},
|
||||
{"to" ,TO},
|
||||
{"transport" ,TRANSPORT},
|
||||
{"type" ,FBHTYPE},
|
||||
{"units" ,UNITS},
|
||||
{"until" ,UNTIL},
|
||||
{"use" ,USE},
|
||||
{"variable" ,VARIABLE},
|
||||
{"wait" ,WAIT},
|
||||
{"warning" ,WARNING},
|
||||
{"when" ,WHEN},
|
||||
{"while" ,WHILE},
|
||||
{"with" ,WITH},
|
||||
{"xor" ,_XOR}
|
||||
};
|
||||
|
||||
static int find_mc(s)
|
||||
|
||||
char *s;
|
||||
{
|
||||
char *loc;
|
||||
el_mc *pt;
|
||||
|
||||
loc = namealloc(s);
|
||||
pt= (el_mc *) bsearch(loc, (char *)tab_mc,FBL_NB_MC,sizeof(el_mc),strcmp);
|
||||
if (pt==NULL) return(-1);
|
||||
return(pt->kval);
|
||||
}
|
||||
|
||||
|
||||
%}
|
||||
|
||||
upper_case_letter [A-Z]
|
||||
digit [0-9]
|
||||
special_character [\#\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\_\|]
|
||||
space_character [ \t]
|
||||
format_effector [\t\v\r\l\f]
|
||||
end_of_line \n
|
||||
lower_case_letter [a-z]
|
||||
other_special_character [\!\$\@\?\[\\\]\^\`\{\}\~]
|
||||
|
||||
graphic_character ({basic_graphic_character}|{lower_case_letter}|{other_special_character})
|
||||
basic_graphic_character ({upper_case_letter}|{digit}|{special_character}|{space_character})
|
||||
letter ({upper_case_letter}|{lower_case_letter})
|
||||
letter_or_digit ({letter}|{digit})
|
||||
decimal_literal {integer}(\.{integer})?({exponent})?
|
||||
integer {digit}(_?{digit})*
|
||||
exponent ([eE][-+]?{integer})
|
||||
base {integer}
|
||||
based_integer {extended_digit}(_?{extended_digit})*
|
||||
extended_digit ({digit}|[a-fA-F])
|
||||
base_specifier (B|b|O|o|X|x)
|
||||
|
||||
%%
|
||||
[ \t] ;
|
||||
\& { return(Ampersand); }
|
||||
\' { return(Apostrophe); }
|
||||
\( { return(LeftParen); }
|
||||
\) { return(RightParen); }
|
||||
"**" { return(DoubleStar); }
|
||||
\* { return(Star); }
|
||||
\+ { return(Plus); }
|
||||
\, { return(Comma); }
|
||||
\- { return(Minus); }
|
||||
":=" { return(VarAsgn); }
|
||||
\: { return(Colon); }
|
||||
\; { return(Semicolon); }
|
||||
"<=" { return(_LESym); }
|
||||
">=" { return(_GESym); }
|
||||
\< { return(_LTSym); }
|
||||
\> { return(_GTSym); }
|
||||
= { return(_EQSym); }
|
||||
\/= { return(_NESym); }
|
||||
"=>" { return(Arrow); }
|
||||
"<>" { return(Box); }
|
||||
\| { return(Bar); }
|
||||
! { return(Bar); }
|
||||
\. { return(Dot); }
|
||||
|
||||
{letter}(_?{letter_or_digit})* {
|
||||
int itoken;
|
||||
itoken=find_mc(yytext);
|
||||
if (itoken== -1)
|
||||
{
|
||||
yylval.text = namealloc(yytext);
|
||||
return ( Identifier );
|
||||
}
|
||||
else
|
||||
{
|
||||
return ( itoken );
|
||||
}
|
||||
}
|
||||
({decimal_literal})|({base}#{based_integer}(\.{based_integer})?#({exponent})?)|({base}:{based_integer}(\.{based_integer})?:({exponent})?) {
|
||||
yylval.text = mbkalloc((unsigned int)strlen(yytext)+1);
|
||||
strcpy(yylval.text,yytext);
|
||||
return ( AbstractLit );
|
||||
}
|
||||
'({graphic_character}|\"|\%)' {
|
||||
yylval.text = namealloc (yytext);
|
||||
return ( CharacterLit );
|
||||
}
|
||||
(\"({graphic_character}|(\"\")|\%)*\")|(\%({graphic_character}|(\%\%)|\")*\%) {
|
||||
yylval.text = namealloc (yytext);
|
||||
return ( StringLit );
|
||||
}
|
||||
{base_specifier}((\"{extended_digit}(_?{extended_digit})*\")|(\%{extended_digit}(_?{extended_digit})*\%)) {
|
||||
yylval.text = namealloc (yytext);
|
||||
return ( BitStringLit );
|
||||
}
|
||||
\n {
|
||||
/* end of line */
|
||||
FBL_LINNUM++;
|
||||
}
|
||||
\-\-{space_character}*[pP][rR][aA][gG][mM][aA].*$ {
|
||||
/* pragma */
|
||||
yylval.text = namealloc (yytext);
|
||||
return(Pragma);
|
||||
}
|
||||
\-\-.*$ {
|
||||
/* comment */
|
||||
/* nothing */
|
||||
}
|
||||
. {
|
||||
return (*yytext);
|
||||
}
|
||||
%%
|
||||
int yywrap()
|
||||
{
|
||||
return(1);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,123 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbl_bedef.h */
|
||||
/* date : Jun 15 1992 */
|
||||
/* version : v102 */
|
||||
/* author : P.BAZARGAN, M.HANAFI */
|
||||
/* content : declaration of define used by yacc */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#define FBL_LG_MC 15
|
||||
#define FBL_NB_MC ((tab_mc -1 + sizeof(tab_mc)/ (sizeof(tab_mc[0])) - tab_mc+1))
|
||||
|
||||
#define FBL_ICNDFN 1 /* input port */
|
||||
#define FBL_OCNDFN 2 /* output port */
|
||||
#define FBL_BCNDFN 3 /* inout port */
|
||||
#define FBL_CSTDFN 4 /* constant */
|
||||
#define FBL_TPEDFN 5 /* type */
|
||||
#define FBL_SGNDFN 6 /* signal */
|
||||
|
||||
/* LUDO #define FBL_STBDFN 7 stable's signal
|
||||
#define FBL_VARDFN 7 variable */
|
||||
|
||||
#define FBL_BITDFN 8 /* bit type */
|
||||
#define FBL_MUXDFN 16 /* mux_bit type */
|
||||
#define FBL_WORDFN 24 /* wor_bit type */
|
||||
#define FBL_RBIDFN 32 /* reg_bit type */
|
||||
#define FBL_BTVDFN 40 /* bit_vector type */
|
||||
#define FBL_MXVDFN 48 /* mux_vector type */
|
||||
#define FBL_WRVDFN 56 /* wor_vector type */
|
||||
#define FBL_RGVDFN 64 /* reg_vector type */
|
||||
#define FBL_NATDFN 88 /* natural type */
|
||||
#define FBL_NTVDFN 96 /* nat_vector type */
|
||||
|
||||
#define FBL_NORDFN 128 /* non guarded signal */
|
||||
#define FBL_BUSDFN 256 /* guarded signal (bus) */
|
||||
#define FBL_REGDFN 384 /* guarded signal (register)*/
|
||||
|
||||
#define FBL_MODDFN 0 /* mod_val field of dct_recrd */
|
||||
#define FBL_SIGDFN 1 /* sig_val field of dct_recrd */
|
||||
#define FBL_TYPDFN 2 /* type_val field of dct_recrd */
|
||||
#define FBL_USRDFN 3 /* user_val field of dct_recrd */
|
||||
#define FBL_LBLDFN 4 /* lbl_val field of dct_recrd */
|
||||
#define FBL_WMXDFN 5 /* wmx_val field of dct_recrd */
|
||||
#define FBL_WMNDFN 6 /* wmn_val field of dct_recrd */
|
||||
#define FBL_PNTDFN 7 /* pnt_val field of dct_recrd */
|
||||
|
||||
#define FBL_UPTDFN 1 /* direction is up */
|
||||
#define FBL_DWTDFN 0 /* direction is down */
|
||||
|
||||
#define SEVERITY_LEVEL FBH_TYPE_SEVERITY
|
||||
#define BOOLEAN FBH_TYPE_BOOLEAN
|
||||
#define BIT FBH_TYPE_BIT
|
||||
#define MUX_BIT FBH_TYPE_MUX_BIT
|
||||
#define WOR_BIT FBH_TYPE_WOR_BIT
|
||||
#define REG_BIT FBH_TYPE_REG_BIT
|
||||
#define BIT_VEC FBH_TYPE_BIT_VEC
|
||||
#define MUX_VEC FBH_TYPE_MUX_VEC
|
||||
#define WOR_VEC FBH_TYPE_WOR_VEC
|
||||
#define REG_VEC FBH_TYPE_REG_VEC
|
||||
#define NATURAL FBH_TYPE_NATURAL
|
||||
#define INTEGER FBH_TYPE_INTEGER
|
||||
|
||||
/* ###---------------------------------------------------------------### */
|
||||
|
||||
#define NE 109
|
||||
#define EQ 110
|
||||
#define GT 111
|
||||
#define GE 112
|
||||
#define LT 113
|
||||
#define LE 114
|
||||
#define NOPI 115
|
||||
#define NOPS 116
|
||||
#define ANDM 117
|
||||
#define CONC 118
|
||||
#define CONVRT 119
|
||||
#define SUBVAR 120
|
||||
|
||||
#define FBL_UNGDFN 0
|
||||
#define FBL_GRDDFN 1
|
||||
|
||||
#define FBL_STABLE 0
|
||||
#define FBL_EVENT 1
|
||||
|
||||
/* ###---------------------------------------------------------------### */
|
||||
|
||||
#define FBL_INTDFN 0 /* int_val field of dtc_recrd */
|
||||
|
||||
#define FBL_ALODFN 60 /* nbr of allocations */
|
||||
#define FBL_HSZDFN 97 /* size of dictionnary: entries */
|
|
@ -0,0 +1,55 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbl_blex.h */
|
||||
/* date : Jun 15 1992 */
|
||||
/* version : v102 */
|
||||
/* author : TABUSSE L.A. */
|
||||
/* content : declaration of functions and global variables used by */
|
||||
/* lex */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <unistd.h>
|
||||
#include "fbl_bedef.h"
|
||||
|
||||
extern int FBL_LINNUM; /* file's line number */
|
||||
|
||||
typedef struct
|
||||
{ char nom[FBL_LG_MC];
|
||||
int kval;
|
||||
} el_mc;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,67 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbl_bspec.h */
|
||||
/* date : Jun 15 1992 */
|
||||
/* author : TABUSSE L.A. */
|
||||
/* content : declaration of functions and global variables used by */
|
||||
/* fbl_bspec.c */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
typedef struct fbl_expr
|
||||
{
|
||||
char *IDENT; /* identifier or constant name */
|
||||
struct chain *LIST_ABL; /* pointer on fbl_abllst list */
|
||||
char TYPE;
|
||||
short WIDTH; /* width of bit vector */
|
||||
}
|
||||
fbl_ablstr;
|
||||
|
||||
extern fbl_ablstr FBL_EMPSTR;
|
||||
|
||||
extern ablexpr *bddToAbl () ;
|
||||
|
||||
extern struct chain * fbl_cpyabllst __P((struct chain *abllst));
|
||||
extern fbl_ablstr fbl_cpyablstr __P((fbl_ablstr ablstr));
|
||||
extern fbl_ablstr fbl_crtabl __P((short oper, fbl_ablstr expr1, fbl_ablstr expr2, int left, int right));
|
||||
extern char * fbl_numtobin __P((int num));
|
||||
extern int fbl_tobin __P((char *trg, char *src, int left, int right));
|
||||
extern void loc_fbl_error __P((int code, char *str1));
|
||||
extern void fbl_toolbug __P((int code, char *str1, char *str2, int nbr1));
|
||||
|
||||
# define fbl_error( C, S ) \
|
||||
fprintf( stderr, "%s.%d: ", __FILE__,__LINE__ ); loc_fbl_error( C, S );
|
|
@ -0,0 +1,123 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbl_byacc.h */
|
||||
/* date : Jun 15 1992 */
|
||||
/* version : v102 */
|
||||
/* author : Pirouz BAZARGAN SABET */
|
||||
/* content : declaration of external functions and global variables*/
|
||||
/* used by yacc */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
# if 0
|
||||
typedef struct fbl_expr
|
||||
{
|
||||
char *IDENT; /* identifier or constant name */
|
||||
struct chain *LIST_ABL; /* pointer on fbl_abllst list */
|
||||
char TYPE;
|
||||
short WIDTH; /* width of bit vector */
|
||||
}
|
||||
fbl_ablstr;
|
||||
# endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *NAME; /* identifier name */
|
||||
short LEFT; /* vector's left index */
|
||||
short RIGHT; /* vector's right index */
|
||||
char FLAG; /* scalar ('S') or array 'A' */
|
||||
char TYPE; /* scalar ('S') or array 'A' */
|
||||
}
|
||||
fbl_name;
|
||||
|
||||
struct g_type
|
||||
{
|
||||
int VALU;
|
||||
char FLAG;
|
||||
};
|
||||
|
||||
struct choice_chain
|
||||
{
|
||||
struct choice_chain* NEXT;
|
||||
char *VALUE;
|
||||
unsigned int SIZE;
|
||||
struct ptype *INSTRUCTION;
|
||||
};
|
||||
|
||||
char *FBL_MODNAM; /* curnennt model name */
|
||||
fbl_ablstr FBL_SLCEXP; /* structure filled with the */
|
||||
fbl_ablstr FBL_EMPSTR; /* empty structure used with NOT*/
|
||||
|
||||
struct bddnode *FBL_BDDPNT = NULL; /* BDD pointer */
|
||||
static char *FBL_LBLNAM = NULL; /* label */
|
||||
static int FBL_NUMTYP = 0; /* nombre de type */
|
||||
static struct chain *FBL_NM1LST = NULL; /* 1-st name liste */
|
||||
static struct chain *FBL_GRDLST = NULL; /* list of guard's ABL */
|
||||
static struct chain *FBL_CNDLST = NULL; /* list of conditions (ABL) */
|
||||
static struct chain *FBL_VALLST = NULL; /* list of waveforms (ABL) */
|
||||
static struct fbfig *FBL_BEFPNT = NULL; /* current BEFIG pointer */
|
||||
|
||||
static struct choice_chain *FBL_CASPNT = NULL;
|
||||
static struct ptype *FBL_OTHPNT = NULL;
|
||||
static struct ptype *FBL_PTYPE = NULL;
|
||||
|
||||
static struct dct_entry *FBL_DCEHED; /* free dct_entry's head */
|
||||
static struct dct_recrd *FBL_DCRHED; /* free dct_recrd's head */
|
||||
|
||||
static authtable *FBL_HASH_ASG_FSM = (authtable *)0;
|
||||
|
||||
extern char FBL_ERRFLG; /* set to 1 in case of error */
|
||||
extern struct fbfig *FBL_HEADFIG; /* head of fbfigs */
|
||||
extern int FBL_LINNUM;
|
||||
extern int FBL_NUMPTP;
|
||||
|
||||
|
||||
static struct dct_entry **hshtab;
|
||||
|
||||
extern struct fbgen * fbl_addgen __P((struct fbgen *lastgeneric, struct chain *nam_lst, struct chain *nat_lst, char *type, short left, short right));
|
||||
extern int val_type __P((char *name));
|
||||
|
||||
extern int fbl_tobin __P((char *trg, char *src, int left, int right));
|
||||
extern int fbl_bintonum __P((char *str));
|
||||
extern fbl_ablstr fbl_crtabl __P((short oper, fbl_ablstr expr1, fbl_ablstr expr2, int left, int right));
|
||||
extern fbl_ablstr fbl_cpyablstr __P((fbl_ablstr ablstr));
|
||||
extern void fbl_select();
|
||||
extern char * fbl_stostr __P((char *str));
|
||||
|
||||
extern void fbl_y_error __P((char *str));
|
||||
extern int fbl_y_lex __P(());
|
||||
|
|
@ -0,0 +1,588 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbl_drive.c */
|
||||
/* date : Nouv 05 1992 */
|
||||
/* version : v100 */
|
||||
/* author : VUONG H.N., M.HANAFI */
|
||||
/* description : This file contains VHDL drivers : */
|
||||
/* vhdlsavefbfig() */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "bdd.h"
|
||||
#include "fvh.h"
|
||||
#include "fbl_utype.h"
|
||||
#include "fbl_utdef.h"
|
||||
#include "fbl_drive.h"
|
||||
|
||||
FILE *FblDriveFile;
|
||||
static int synopsys = 0;
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : vhdlsavefbfig */
|
||||
/* description : print out a text file containing a data-flow VHDL */
|
||||
/* description */
|
||||
/* called func. : vhdlablname, mbkalloc, fbl_message, fbl_error , */
|
||||
/* fbl_toolbug , getptype, reverse , fbl_printablfile */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void vhdlsavefbdecl( pthedfbfig, synopsys )
|
||||
|
||||
fbfig_list *pthedfbfig;
|
||||
int synopsys;
|
||||
{
|
||||
char *type_mark;
|
||||
int left,right;
|
||||
char *name;
|
||||
|
||||
struct fbreg *ptfbreg = 0; /* current BEREG pointer */
|
||||
struct fbaux *ptfbaux = 0; /* current BEAUX pointer */
|
||||
struct fbbux *ptfbbux = 0; /* current BEBUX pointer */
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Treatment of the BEREG list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pthedfbfig->BEREG = (struct fbreg *)reverse( (chain_list *)pthedfbfig->BEREG);
|
||||
ptfbreg = pthedfbfig->BEREG;
|
||||
|
||||
while (ptfbreg != 0)
|
||||
{
|
||||
ptfbreg = (fbreg_list *)fbl_vectnam(ptfbreg,&left,&right,&name,2);
|
||||
if(left != -1)
|
||||
{
|
||||
if ( synopsys )
|
||||
(void)fprintf(FblDriveFile," SIGNAL %s : BIT_VECTOR(%d %s %d);\t-- %s\n",
|
||||
vhdlablname(name),left,(left>=right)?"DOWNTO":"TO",
|
||||
right,name);
|
||||
else
|
||||
(void)fprintf(FblDriveFile," SIGNAL %s : REG_VECTOR(%d %s %d) REGISTER;\t-- %s\n",
|
||||
vhdlablname(name),left,(left>=right)?"DOWNTO":"TO",
|
||||
right,name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( synopsys )
|
||||
(void) fprintf (FblDriveFile," SIGNAL %s : BIT;\t-- %s\n",
|
||||
vhdlablname(name),name);
|
||||
else
|
||||
(void) fprintf (FblDriveFile," SIGNAL %s : REG_BIT REGISTER;\t-- %s\n",
|
||||
vhdlablname(name),name);
|
||||
}
|
||||
ptfbreg = ptfbreg->NEXT;
|
||||
}
|
||||
|
||||
pthedfbfig->BEREG = (struct fbreg *)reverse( (chain_list *)pthedfbfig->BEREG);
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Treatment of the BEBUX list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pthedfbfig->BEBUX = (struct fbbux *)reverse( (chain_list *)pthedfbfig->BEBUX);
|
||||
ptfbbux = pthedfbfig->BEBUX;
|
||||
while (ptfbbux != 0)
|
||||
{
|
||||
ptfbbux = (fbbux_list *)fbl_vectnam(ptfbbux,&left,&right,&name,1);
|
||||
if(left != -1)
|
||||
{
|
||||
switch (ptfbbux->TYPE)
|
||||
{
|
||||
case FBH_TYPE_WOR_VEC :
|
||||
type_mark = namealloc("WOR_VECTOR");
|
||||
break;
|
||||
case FBH_TYPE_MUX_VEC :
|
||||
type_mark = namealloc("MUX_VECTOR");
|
||||
break;
|
||||
}
|
||||
(void)fprintf(FblDriveFile," SIGNAL %s : %s(%d %s %d) BUS;\t-- %s\n",
|
||||
vhdlablname(name),type_mark,left,(left>=right)?"DOWNTO":"TO",
|
||||
right,name);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (ptfbbux->TYPE)
|
||||
{
|
||||
case FBH_TYPE_WOR_BIT :
|
||||
type_mark = namealloc("WOR_BIT");
|
||||
break;
|
||||
case FBH_TYPE_MUX_BIT :
|
||||
type_mark = namealloc("MUX_BIT");
|
||||
break;
|
||||
}
|
||||
(void) fprintf (FblDriveFile," SIGNAL %s : %s BUS;\t\t-- %s\n",vhdlablname(name),
|
||||
type_mark,name);
|
||||
}
|
||||
ptfbbux = ptfbbux->NEXT;
|
||||
}
|
||||
pthedfbfig->BEBUX = (struct fbbux *)reverse( (chain_list *)pthedfbfig->BEBUX);
|
||||
|
||||
pthedfbfig->BEAUX = (struct fbaux *)reverse( (chain_list *)pthedfbfig->BEAUX);
|
||||
ptfbaux = pthedfbfig->BEAUX;
|
||||
while (ptfbaux != 0)
|
||||
{
|
||||
if ( ( ptfbaux->ABL != (chain_list *)0 ) ||
|
||||
( IsFbhAssignByFsm( ptfbaux ) ) )
|
||||
{
|
||||
ptfbaux = (fbaux_list *)fbl_vectnam(ptfbaux,&left,&right,&name,3);
|
||||
if(left != -1)
|
||||
{
|
||||
(void)fprintf(FblDriveFile," SIGNAL %s : BIT_VECTOR(%d %s %d);\t-- %s\n",
|
||||
vhdlablname(name),left,(left>=right)?"DOWNTO":"TO",
|
||||
right,name);
|
||||
}
|
||||
else
|
||||
{
|
||||
(void) fprintf (FblDriveFile," SIGNAL %s : BIT;\t\t-- %s\n",
|
||||
vhdlablname(name),name);
|
||||
}
|
||||
}
|
||||
ptfbaux = ptfbaux->NEXT;
|
||||
}
|
||||
pthedfbfig->BEAUX = (struct fbaux *)reverse( (chain_list *)pthedfbfig->BEAUX);
|
||||
|
||||
}
|
||||
|
||||
void vhdlsavefbport( pthedfbfig, synopsys )
|
||||
|
||||
fbfig_list *pthedfbfig;
|
||||
int synopsys;
|
||||
{
|
||||
char *mode;
|
||||
char *type_mark;
|
||||
int left,right;
|
||||
char *name;
|
||||
char *bus;
|
||||
|
||||
struct fbpor *ptfbpor = 0; /* correctly ordered port list */
|
||||
|
||||
ptfbpor = pthedfbfig->BEPOR;
|
||||
if (ptfbpor != 0)
|
||||
{
|
||||
(void) fprintf (FblDriveFile," PORT (\n");
|
||||
pthedfbfig->BEPOR = (struct fbpor *)reverse ( (chain_list *)pthedfbfig->BEPOR);
|
||||
|
||||
ptfbpor = pthedfbfig->BEPOR;
|
||||
while (ptfbpor != 0)
|
||||
{
|
||||
switch (ptfbpor->DIRECTION)
|
||||
{
|
||||
case 'I':
|
||||
mode = namealloc("IN");
|
||||
break;
|
||||
case 'O':
|
||||
case 'Z':
|
||||
mode = namealloc("OUT");
|
||||
break;
|
||||
case 'B':
|
||||
case 'T':
|
||||
mode = namealloc("INOUT");
|
||||
break;
|
||||
default :
|
||||
{
|
||||
fbl_error (69,0);
|
||||
}
|
||||
}
|
||||
ptfbpor = (fbpor_list *)fbl_vectnam(ptfbpor,&left,&right,&name,0);
|
||||
|
||||
if(left != -1)
|
||||
{
|
||||
switch (ptfbpor->TYPE)
|
||||
{
|
||||
case FBH_TYPE_BIT_VEC :
|
||||
type_mark = namealloc("BIT_VECTOR");
|
||||
bus = "";
|
||||
break;
|
||||
case FBH_TYPE_WOR_VEC :
|
||||
type_mark = namealloc("WOR_VECTOR");
|
||||
bus = namealloc("BUS");
|
||||
break;
|
||||
case FBH_TYPE_MUX_VEC :
|
||||
type_mark = namealloc("MUX_VECTOR");
|
||||
bus = namealloc("BUS");
|
||||
break;
|
||||
default :
|
||||
{
|
||||
fbl_error (68,0);
|
||||
}
|
||||
}
|
||||
(void)fprintf(FblDriveFile," %s : %s %s(%d %s %d) %s",vhdlablname(name), mode,
|
||||
type_mark, left, (left>=right)?"DOWNTO":"TO",right,bus);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (ptfbpor->TYPE)
|
||||
{
|
||||
case FBH_TYPE_BIT :
|
||||
type_mark = "BIT"; break;
|
||||
case FBH_TYPE_WOR_BIT :
|
||||
type_mark = "WOR_BIT BUS"; break;
|
||||
case FBH_TYPE_MUX_BIT :
|
||||
type_mark = "MUX_BIT BUS"; break;
|
||||
default :
|
||||
{
|
||||
fbl_error (68,0);
|
||||
}
|
||||
}
|
||||
|
||||
(void) fprintf (FblDriveFile," %s : %s %s",vhdlablname(name),
|
||||
mode,type_mark);
|
||||
}
|
||||
|
||||
if (ptfbpor->NEXT != 0)
|
||||
(void) fprintf (FblDriveFile,";\t-- %s\n",name);
|
||||
else
|
||||
(void) fprintf (FblDriveFile,"\t-- %s\n );\n",name);
|
||||
|
||||
ptfbpor = ptfbpor->NEXT;
|
||||
}
|
||||
|
||||
pthedfbfig->BEPOR = (struct fbpor *)reverse ( (chain_list *)pthedfbfig->BEPOR);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void vhdlsavefbarchi( pthedfbfig, synopsys )
|
||||
|
||||
fbfig_list *pthedfbfig;
|
||||
int synopsys;
|
||||
{
|
||||
int nrlabel = 0;
|
||||
struct fbreg *ptfbreg = 0; /* current BEREG pointer */
|
||||
struct fbmsg *ptfbmsg = 0; /* current BEMSG pointer */
|
||||
struct fbout *ptfbout = 0; /* current BEOUT pointer */
|
||||
struct fbbus *ptfbbus = 0; /* current BEBUS pointer */
|
||||
struct fbaux *ptfbaux = 0; /* current BEAUX pointer */
|
||||
struct fbbux *ptfbbux = 0; /* current BEBUX pointer */
|
||||
struct biabl *ptbiabl = 0; /* current BIABL pointer */
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Print out a concurrent assert statement for each BEMSG */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptfbmsg = pthedfbfig->BEMSG;
|
||||
while (ptfbmsg != 0)
|
||||
{
|
||||
if (ptfbmsg->LABEL != 0)
|
||||
(void)fprintf(FblDriveFile," %s :",ptfbmsg->LABEL);
|
||||
|
||||
(void) fprintf (FblDriveFile," ASSERT (" );
|
||||
fbl_printablfile(FblDriveFile, ptfbmsg->ABL );
|
||||
(void) fprintf (FblDriveFile," = '1')\n" );
|
||||
|
||||
if (ptfbmsg->MESSAGE != 0)
|
||||
(void) fprintf (FblDriveFile," REPORT \"%s\"\n",ptfbmsg->MESSAGE);
|
||||
|
||||
if (ptfbmsg->LEVEL == 'W')
|
||||
(void) fprintf (FblDriveFile," SEVERITY WARNING;");
|
||||
else
|
||||
(void) fprintf (FblDriveFile," SEVERITY ERROR;");
|
||||
|
||||
(void) fprintf (FblDriveFile,"\n\n");
|
||||
ptfbmsg = ptfbmsg->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Print out a concurrent signal assignment for each BEAUX */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptfbaux = pthedfbfig->BEAUX;
|
||||
|
||||
while (ptfbaux != 0)
|
||||
{
|
||||
if (ptfbaux->ABL != 0)
|
||||
{
|
||||
(void) fprintf (FblDriveFile," %s <= ",fbl_vectorize(ptfbaux->NAME));
|
||||
fbl_printablfile( FblDriveFile, ptfbaux->ABL);
|
||||
(void) fprintf (FblDriveFile,";\n");
|
||||
}
|
||||
/* LUDO
|
||||
else
|
||||
{
|
||||
fbl_error (40,ptfbaux->NAME);
|
||||
} */
|
||||
ptfbaux = ptfbaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Print out a block statement with one guarded concurrent */
|
||||
/* signal assignment for each BIABL of each BEREG */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptfbreg = pthedfbfig->BEREG;
|
||||
|
||||
while (ptfbreg != 0)
|
||||
{
|
||||
ptbiabl = ptfbreg->BIABL;
|
||||
while (ptbiabl != 0)
|
||||
{
|
||||
if ( synopsys )
|
||||
(void) fprintf (FblDriveFile," proc_%d : PROCESS ",nrlabel);
|
||||
else
|
||||
(void) fprintf (FblDriveFile," label%d : BLOCK ",nrlabel);
|
||||
if (ptbiabl->CNDABL != 0)
|
||||
{
|
||||
if ( ! synopsys )
|
||||
{
|
||||
(void) fprintf (FblDriveFile,"(" );
|
||||
fbl_printablfile( FblDriveFile, ptbiabl->CNDABL );
|
||||
(void) fprintf (FblDriveFile," = '1')\n" );
|
||||
}
|
||||
}
|
||||
else
|
||||
fbl_toolbug (19,"fbl_decomp",ptfbreg->NAME,0);
|
||||
|
||||
(void) fprintf (FblDriveFile," BEGIN\n" );
|
||||
|
||||
if ( synopsys )
|
||||
{
|
||||
(void) fprintf (FblDriveFile," WAIT UNTIL (" );
|
||||
fbl_printablfile( FblDriveFile, ptbiabl->CNDABL );
|
||||
(void) fprintf (FblDriveFile," = '1');\n" );
|
||||
}
|
||||
|
||||
(void) fprintf (FblDriveFile," %s <= %s ",
|
||||
fbl_vectorize(ptfbreg->NAME),
|
||||
( synopsys ) ? "" : "GUARDED" );
|
||||
if (ptbiabl->VALABL != 0)
|
||||
{
|
||||
fbl_printablfile( FblDriveFile, ptbiabl->VALABL );
|
||||
(void)fprintf (FblDriveFile,";\n" );
|
||||
}
|
||||
else
|
||||
fbl_toolbug (20,"fbl_decomp",ptfbreg->NAME,0);
|
||||
|
||||
if ( synopsys )
|
||||
(void) fprintf( FblDriveFile," END PROCESS proc_%d;\n",nrlabel);
|
||||
else
|
||||
(void) fprintf( FblDriveFile," END BLOCK label%d;\n",nrlabel);
|
||||
ptbiabl = ptbiabl->NEXT;
|
||||
nrlabel++;
|
||||
}
|
||||
|
||||
ptfbreg = ptfbreg->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Print out a block statement with one guarded concurrent */
|
||||
/* signal assignment for each BIABL of each BEBUX */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptfbbux = pthedfbfig->BEBUX;
|
||||
while (ptfbbux != 0)
|
||||
{
|
||||
ptbiabl = ptfbbux->BIABL;
|
||||
while (ptbiabl != 0)
|
||||
{
|
||||
(void) fprintf (FblDriveFile," label%d : BLOCK (",nrlabel);
|
||||
if (ptbiabl->CNDABL != 0)
|
||||
{
|
||||
fbl_printablfile( FblDriveFile, ptbiabl->CNDABL );
|
||||
(void) fprintf (FblDriveFile," = '1')\n" );
|
||||
}
|
||||
else
|
||||
fbl_toolbug (19,"fbl_decomp",ptfbbux->NAME,0);
|
||||
|
||||
(void) fprintf (FblDriveFile," BEGIN\n %s <= GUARDED ",
|
||||
fbl_vectorize(ptfbbux->NAME));
|
||||
if (ptbiabl->VALABL != 0)
|
||||
{
|
||||
fbl_printablfile( FblDriveFile, ptbiabl->VALABL );
|
||||
(void) fprintf (FblDriveFile,";\n" );
|
||||
}
|
||||
else
|
||||
fbl_toolbug (20,"fbl_decomp",ptfbbux->NAME,0);
|
||||
|
||||
(void) fprintf (FblDriveFile," END BLOCK label%d;\n",nrlabel);
|
||||
ptbiabl = ptbiabl->NEXT;
|
||||
nrlabel++;
|
||||
}
|
||||
|
||||
ptfbbux = ptfbbux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Print out a block statement with one guarded concurrent */
|
||||
/* signal assignment for each BIABL of each BEBUS */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptfbbus = pthedfbfig->BEBUS;
|
||||
while (ptfbbus != 0)
|
||||
{
|
||||
ptbiabl = ptfbbus->BIABL;
|
||||
while (ptbiabl != 0)
|
||||
{
|
||||
(void) fprintf (FblDriveFile,"\tlabel%d : BLOCK (",nrlabel);
|
||||
if (ptbiabl->CNDABL != 0)
|
||||
{
|
||||
fbl_printablfile ( FblDriveFile, ptbiabl->CNDABL );
|
||||
(void) fprintf (FblDriveFile," = '1')\n" );
|
||||
}
|
||||
else
|
||||
fbl_toolbug (19,"fbl_decomp",ptfbbus->NAME,0);
|
||||
|
||||
(void) fprintf (FblDriveFile,"\tBEGIN\n\t%s <= GUARDED ",fbl_vectorize(ptfbbus->NAME));
|
||||
if (ptbiabl->VALABL != 0)
|
||||
{
|
||||
fbl_printablfile( FblDriveFile, ptbiabl->VALABL );
|
||||
(void) fprintf (FblDriveFile,";\n" );
|
||||
}
|
||||
else
|
||||
fbl_toolbug (20,"fbl_decomp",ptfbbus->NAME,0);
|
||||
|
||||
(void) fprintf (FblDriveFile,"\tEND BLOCK label%d;\n",nrlabel);
|
||||
ptbiabl = ptbiabl->NEXT;
|
||||
nrlabel++;
|
||||
}
|
||||
|
||||
ptfbbus = ptfbbus->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Print out a concurrent signal assignment for each BEOUT */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptfbout = pthedfbfig->BEOUT;
|
||||
|
||||
while (ptfbout != 0)
|
||||
{
|
||||
if (ptfbout->ABL != 0)
|
||||
{
|
||||
(void) fprintf (FblDriveFile,"\n%s <= ",fbl_vectorize(ptfbout->NAME) );
|
||||
fbl_printablfile( FblDriveFile, ptfbout->ABL );
|
||||
(void) fprintf (FblDriveFile,";\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
fbl_error (40,ptfbout->NAME);
|
||||
}
|
||||
|
||||
ptfbout = ptfbout->NEXT;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void vhdlsavefbfig( pthedfbfig, FileName, synopsys )
|
||||
|
||||
fbfig_list *pthedfbfig;
|
||||
char *FileName;
|
||||
int synopsys;
|
||||
{
|
||||
time_t clock;
|
||||
|
||||
struct fbgen *ptgeneric = 0; /* current ptype pnt (generic) */
|
||||
struct ptype *ptptype = 0; /* current ptype pointer (USER) */
|
||||
|
||||
if (pthedfbfig == 0)
|
||||
fbl_toolbug (10,"fbl_decomp",0,0);
|
||||
|
||||
fbl_message (11,0,0);
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Opening result file */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((FblDriveFile = mbkfopen( FileName, ( synopsys ) ? "vhd" : "vbe",WRITE_TEXT)) == 0)
|
||||
{
|
||||
fbl_error (107,0);
|
||||
autexit (1);
|
||||
}
|
||||
|
||||
fbl_message (12,pthedfbfig->NAME,0);
|
||||
fbl_message (13,pthedfbfig->NAME,0);
|
||||
|
||||
time (&clock);
|
||||
(void) fprintf (FblDriveFile,"-- VHDL data flow description generated from `%s`\n",
|
||||
pthedfbfig->NAME);
|
||||
(void) fprintf (FblDriveFile,"--\t\tdate : %s\n\n",ctime(&clock));
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Entity declaration */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
(void) fprintf (FblDriveFile,"-- Entity Declaration\n\n");
|
||||
(void) fprintf (FblDriveFile,"ENTITY %s IS\n",vhdlablname(pthedfbfig->NAME));
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Generic declaration */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptptype = getptype (pthedfbfig->USER,FBH_GENERIC);
|
||||
if (ptptype != 0)
|
||||
{
|
||||
ptptype->DATA = (void *)reverse (ptptype->DATA);
|
||||
ptgeneric = (struct fbgen *)ptptype->DATA;
|
||||
(void) fprintf (FblDriveFile," GENERIC (\n");
|
||||
while (ptgeneric != 0)
|
||||
{
|
||||
(void) fprintf (FblDriveFile," CONSTANT %s : NATURAL := %ld",
|
||||
vhdlablname(ptgeneric->NAME),*((long *)ptgeneric->VALUE));
|
||||
if (ptgeneric->NEXT != 0)
|
||||
(void)fprintf(FblDriveFile,";\t-- %s\n",(char *)ptgeneric->NAME);
|
||||
else
|
||||
(void)fprintf(FblDriveFile,"\t-- %s\n",(char *)ptgeneric->NAME);
|
||||
|
||||
ptgeneric = ptgeneric->NEXT;
|
||||
}
|
||||
(void) fprintf (FblDriveFile," );\n");
|
||||
ptptype->DATA = (void *)reverse (ptptype->DATA);
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Port declaration */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
vhdlsavefbport( pthedfbfig, synopsys );
|
||||
|
||||
(void) fprintf (FblDriveFile,"END %s;\n\n\n",vhdlablname(pthedfbfig->NAME));
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Architecture declaration */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
(void) fprintf (FblDriveFile,"-- Architecture Declaration\n\n");
|
||||
(void) fprintf (FblDriveFile,"ARCHITECTURE VBE OF %s IS\n",
|
||||
vhdlablname(pthedfbfig->NAME));
|
||||
|
||||
vhdlsavefbdecl( pthedfbfig, synopsys );
|
||||
|
||||
(void) fprintf (FblDriveFile,"\nBEGIN\n");
|
||||
|
||||
vhdlsavefbarchi( pthedfbfig, synopsys );
|
||||
|
||||
(void) fprintf (FblDriveFile,"END;\n");
|
||||
fbl_message (14,pthedfbfig->NAME,0);
|
||||
(void) fclose (FblDriveFile);
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbl_drive.h */
|
||||
/* date : Nouv 05 1992 */
|
||||
/* version : v100 */
|
||||
/* author : VUONG H.N. */
|
||||
/* content : declaration of functions and global variables used by */
|
||||
/* the fbhavioural decompiler */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
|
||||
extern char *fbl_vhdlname();
|
||||
extern void fbl_printablfile __P((FILE *AblFile, ablexpr *Expr));
|
||||
extern char *fbl_printabl();
|
||||
extern void fbl_toolbug __P((int code, char *str1, char *str2, int nbr1));
|
||||
extern void fbl_message __P((int code, char *str1, int nmb1));
|
||||
extern void loc_fbl_error __P((int code, char *str1));
|
||||
extern void * fbl_vectnam __P((void *pt_list, int *left, int *right, char **name, char type));
|
||||
extern char * fbl_vectorize __P((char *Name));
|
||||
|
||||
# define fbl_error( C, S ) \
|
||||
fprintf( stderr, "%s.%d: ", __FILE__,__LINE__ ); loc_fbl_error( C, S )
|
|
@ -0,0 +1,85 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbl_utdef.h */
|
||||
/* date : Jun 18 1992 */
|
||||
/* version : v100 */
|
||||
/* author : L.A.TABUSSE */
|
||||
/* content : declaration of external functions and global variables */
|
||||
/* used by yacc */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
#define FBL_ICNDFN 1 /* input port */
|
||||
#define FBL_OCNDFN 2 /* output port */
|
||||
#define FBL_BCNDFN 3 /* inout port */
|
||||
#define FBL_CSTDFN 4 /* constant */
|
||||
#define FBL_TPEDFN 5 /* type */
|
||||
#define FBL_SGNDFN 6 /* signal */
|
||||
#define FBL_STBDFN 7 /* stable's signal */
|
||||
#define FBL_VARDFN 7 /* variable */
|
||||
|
||||
#define FBL_BITDFN 8 /* bit type */
|
||||
#define FBL_MUXDFN 16 /* mux_bit type */
|
||||
#define FBL_WORDFN 24 /* wor_bit type */
|
||||
#define FBL_RBIDFN 32 /* reg_bit type */
|
||||
#define FBL_BTVDFN 40 /* bit_vector type */
|
||||
#define FBL_MXVDFN 48 /* mux_vector type */
|
||||
#define FBL_WRVDFN 56 /* wor_vector type */
|
||||
#define FBL_RGVDFN 64 /* reg_vector type */
|
||||
#define FBL_NATDFN 88 /* natural type */
|
||||
#define FBL_NTVDFN 96 /* nat_vector type */
|
||||
|
||||
#define FBL_NORDFN 128 /* non guarded signal */
|
||||
#define FBL_BUSDFN 256 /* guarded signal (bus) */
|
||||
#define FBL_REGDFN 384 /* guarded signal (register)*/
|
||||
|
||||
#define FBL_MODDFN 0 /* mod_val field of dct_recrd */
|
||||
#define FBL_SIGDFN 1 /* sig_val field of dct_recrd */
|
||||
#define FBL_TYPDFN 2 /* type_val field of dct_recrd */
|
||||
#define FBL_USRDFN 3 /* user_val field of dct_recrd */
|
||||
#define FBL_LBLDFN 4 /* lbl_val field of dct_recrd */
|
||||
#define FBL_WMXDFN 5 /* wmx_val field of dct_recrd */
|
||||
#define FBL_WMNDFN 6 /* wmn_val field of dct_recrd */
|
||||
#define FBL_PNTDFN 7 /* pnt_val field of dct_recrd */
|
||||
|
||||
#define FBL_NAMDFN 0
|
||||
#define FBL_NEWDFN 1
|
||||
|
||||
#define FBL_ALODFN 60 /* minimal size of allocation */
|
||||
/* for dct_entry and dct_recrd */
|
||||
#define FBL_HSZDFN 97 /* number of entry points in the */
|
||||
/* dictionnary */
|
||||
#define FBL_MXRDFN 30
|
|
@ -0,0 +1,762 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbl_util.c */
|
||||
/* date : Sep 14 1992 */
|
||||
/* version : v100 */
|
||||
/* author : Pirouz BAZARGAN SABET, M.HANAFI */
|
||||
/* description : This file contains some utility functions : */
|
||||
/* fbl_error , fsp_y_error, fsp_toolbug, fsp_message, */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <malloc.h>
|
||||
|
||||
#include "mut.h"
|
||||
#include "abl.h"
|
||||
#include "aut.h"
|
||||
#include "bdd.h"
|
||||
#include "fvh.h"
|
||||
#include "fbl_utype.h"
|
||||
#include "fbl_util.h"
|
||||
#include "fbl_utdef.h"
|
||||
|
||||
char FBL_ERRFLG = 0; /* if = 1 no structure is made */
|
||||
int FBL_LINNUM = 1; /* file's line number */
|
||||
int FBL_NUMPTP = 0; /* file's line number */
|
||||
fbfig_list *FBL_HEADFIG = (fbfig_list *)0;
|
||||
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbl_toolbug */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
void fbl_toolbug (code,str1,str2,nbr1)
|
||||
|
||||
int code;
|
||||
char *str1;
|
||||
char *str2;
|
||||
int nbr1;
|
||||
|
||||
{
|
||||
(void) fprintf (stderr,"Fatal error %d executing `%s`: ", code,str1);
|
||||
switch (code)
|
||||
{
|
||||
case 1:
|
||||
(void) fprintf (stderr,"unknown operator\n");
|
||||
break;
|
||||
case 2:
|
||||
(void) fprintf (stderr,"cannot create empty atom\n");
|
||||
break;
|
||||
case 3:
|
||||
(void) fprintf (stderr,"cannot build NOT of empty expression\n");
|
||||
break;
|
||||
case 4:
|
||||
(void) fprintf (stderr,"cannot combine empty expressions\n");
|
||||
break;
|
||||
case 5:
|
||||
(void) fprintf (stderr,"cannot find terminal\n");
|
||||
break;
|
||||
case 6:
|
||||
(void) fprintf (stderr,"cannot make BDD of empty expression\n");
|
||||
break;
|
||||
case 7:
|
||||
(void) fprintf (stderr,"unknown type `%c` for IO `%s`\n",nbr1,str2);
|
||||
break;
|
||||
case 8:
|
||||
(void) fprintf (stderr,"illegal signal value : hex `%x`\n",nbr1);
|
||||
break;
|
||||
case 9:
|
||||
(void) fprintf (stderr,"unknown mode `%c` for IO `%s`\n",nbr1,str2);
|
||||
break;
|
||||
case 10:
|
||||
(void) fprintf (stderr,"decompiler called on empty fbfig\n");
|
||||
break;
|
||||
case 12:
|
||||
(void) fprintf (stderr,"illegal user value '%c' for IO\n",nbr1);
|
||||
break;
|
||||
case 13 :
|
||||
(void) fprintf (stderr,"cannot find model of `%s`\n",str2);
|
||||
break;
|
||||
case 14 :
|
||||
(void) fprintf (stderr,"cannot convert empty expression\n");
|
||||
break;
|
||||
case 15 :
|
||||
(void) fprintf (stderr,"illegal bit string value : `%c`\n",nbr1);
|
||||
break;
|
||||
case 16 :
|
||||
(void) fprintf (stderr,"the same expression cannot be used twice\n");
|
||||
break;
|
||||
case 17 :
|
||||
(void) fprintf (stderr,"unknown base specifier : `%c`\n",nbr1);
|
||||
break;
|
||||
case 18:
|
||||
(void) fprintf (stderr,"unknown mode `%c` for port `%s`\n",nbr1,str2);
|
||||
break;
|
||||
case 19:
|
||||
(void) fprintf (stderr,"empty guard expression: `%s`\n",str2);
|
||||
break;
|
||||
case 20:
|
||||
(void) fprintf (stderr,"empty waveform expression: `%s`\n",str2);
|
||||
break;
|
||||
case 21:
|
||||
(void) fprintf (stderr,"cannot find structural level\n");
|
||||
break;
|
||||
case 22:
|
||||
(void) fprintf (stderr,"`%s` : `%c` unknown resolution function\n",str2,nbr1);
|
||||
break;
|
||||
}
|
||||
autexit (1);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbl_message */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
void fbl_message (code,str1,nmb1)
|
||||
|
||||
int code;
|
||||
char *str1;
|
||||
int nmb1;
|
||||
|
||||
{
|
||||
switch (code)
|
||||
{
|
||||
case 1:
|
||||
(void) fprintf (stderr,"Usage : asimut <root> [<pattern> <result_file>] [-option]\n");
|
||||
(void) fprintf (stderr,"or asimut -help\n");
|
||||
break;
|
||||
case 2:
|
||||
(void) fprintf (stdout,"Initializing ...\n");
|
||||
break;
|
||||
case 3:
|
||||
(void) fprintf (stdout,"Compiling `%s` (Behaviour) ...\n",str1);
|
||||
break;
|
||||
case 4:
|
||||
(void) fprintf (stdout,"Compiling `%s` (Structural) ...\n\n",str1);
|
||||
break;
|
||||
case 5:
|
||||
(void) fprintf (stdout,"Searching `%s` ...\n",str1);
|
||||
break;
|
||||
case 8:
|
||||
(void) fprintf (stdout,"Compiling `%s` (Pattern) ...\n\n",str1);
|
||||
break;
|
||||
case 9:
|
||||
(void) fprintf (stdout,"Linking ...\n");
|
||||
break;
|
||||
case 10:
|
||||
(void) fprintf (stdout,"###----- processing pattern %d -----###\n",nmb1);
|
||||
break;
|
||||
case 11:
|
||||
/*\
|
||||
(void) fprintf (stdout,"Decompiling ...\n");
|
||||
\*/
|
||||
break;
|
||||
case 12:
|
||||
/*\
|
||||
(void) fprintf (stdout,"Generating the file '%s' ...\n",str1);
|
||||
\*/
|
||||
break;
|
||||
case 13:
|
||||
/*\
|
||||
(void) fprintf (stdout,"Saving '%s' in a vhdl file\n",str1);
|
||||
\*/
|
||||
break;
|
||||
case 14:
|
||||
/*\
|
||||
(void) fprintf (stdout,"File '%s' has been generated.\n",str1);
|
||||
\*/
|
||||
break;
|
||||
case 15:
|
||||
(void) fprintf (stdout,"Making Bdd ...\n\n");
|
||||
break;
|
||||
case 16:
|
||||
(void) fprintf (stdout,"Restoring ...\n\n");
|
||||
break;
|
||||
default:
|
||||
(void) fprintf (stderr,"fbl_message : code %d unknown.\n",code);
|
||||
}
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbl_error */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void loc_fbl_error (code,str1)
|
||||
|
||||
int code;
|
||||
char *str1;
|
||||
|
||||
{
|
||||
FBL_ERRFLG++;
|
||||
if (code < 100)
|
||||
(void)fprintf (stderr,"Error %d line %d :",code,FBL_LINNUM);
|
||||
else
|
||||
{
|
||||
if (code < 200)
|
||||
(void)fprintf (stderr,"Error %d :",code);
|
||||
}
|
||||
|
||||
switch (code)
|
||||
{
|
||||
case 1:
|
||||
(void) fprintf (stderr,"`%s` is incompatible with the entity name\n",str1);
|
||||
break;
|
||||
case 2:
|
||||
(void) fprintf (stderr,"bad entity declaration\n");
|
||||
break;
|
||||
case 3:
|
||||
(void) fprintf (stderr,"bad port clause declaration\n");
|
||||
break;
|
||||
case 4:
|
||||
(void) fprintf (stderr,"port `%s` already declared\n",str1);
|
||||
break;
|
||||
case 5:
|
||||
(void) fprintf (stderr,"illegal port declaration (mode, type, kind)\n");
|
||||
break;
|
||||
case 6:
|
||||
(void) fprintf (stderr,"bad port declaration\n");
|
||||
break;
|
||||
case 7:
|
||||
(void) fprintf (stderr,"`%s` is incompatible with the architecture name\n",str1);
|
||||
break;
|
||||
case 8:
|
||||
(void) fprintf (stderr,"bad architecture declaration\n");
|
||||
break;
|
||||
case 9:
|
||||
(void) fprintf (stderr,"illegal declaration\n");
|
||||
break;
|
||||
case 10:
|
||||
(void) fprintf (stderr,"signal `%s` already declared\n",str1);
|
||||
break;
|
||||
case 11:
|
||||
(void) fprintf (stderr,"illegal signal declaration (type, kind)\n");
|
||||
break;
|
||||
case 17:
|
||||
(void) fprintf (stderr,"`%s` unknown port or signal\n",str1);
|
||||
break;
|
||||
case 18:
|
||||
(void) fprintf (stderr,"illegal concurrent statement\n");
|
||||
break;
|
||||
case 19:
|
||||
(void) fprintf (stderr,"label `%s` already used\n",str1);
|
||||
break;
|
||||
case 20:
|
||||
(void) fprintf (stderr,"`%s` is incompatible with the block's label\n",str1);
|
||||
break;
|
||||
case 21:
|
||||
(void) fprintf (stderr,"input port `%s` cannot be assigned\n",str1);
|
||||
break;
|
||||
case 22:
|
||||
(void) fprintf (stderr,"unguarded signal `%s` assigned by guarded assignment\n",str1);
|
||||
break;
|
||||
case 23:
|
||||
(void) fprintf (stderr,"guarded signal `%s` assigned by unguarded assignment\n",str1);
|
||||
break;
|
||||
case 25:
|
||||
(void) fprintf (stderr,"some choices missing in the selected signal assignment\n");
|
||||
break;
|
||||
case 26:
|
||||
(void) fprintf (stderr,"output port `%s` cannot be read\n",str1);
|
||||
break;
|
||||
case 27:
|
||||
(void) fprintf (stderr," '%s' only variable can be assigned with ':=' \n",str1);
|
||||
break;
|
||||
case 28:
|
||||
(void) fprintf (stderr,"duplicate choice in selected signal assignment\n");
|
||||
break;
|
||||
case 30:
|
||||
(void) fprintf (stderr,"illegal use of OTHERS in selected signal assignment\n");
|
||||
break;
|
||||
case 31:
|
||||
(void) fprintf (stderr,"illegal use of OTHERS in case statement \n");
|
||||
break;
|
||||
case 32:
|
||||
(void) fprintf (stderr,"null array not supported\n");
|
||||
break;
|
||||
case 33:
|
||||
(void) fprintf (stderr,"incompatible constraint and type\n");
|
||||
break;
|
||||
case 35:
|
||||
(void) fprintf (stderr,"illegal assignment of `%s` (widths mismatch)\n",str1);
|
||||
break;
|
||||
case 36:
|
||||
(void) fprintf (stderr,"signal `%s` used out of declared range\n",str1);
|
||||
break;
|
||||
case 38:
|
||||
(void) fprintf (stderr,"width or/and type mismatch\n");
|
||||
break;
|
||||
case 39:
|
||||
(void) fprintf (stderr,"signal `%s` assigned more than once\n",str1);
|
||||
break;
|
||||
case 40:
|
||||
(void) fprintf (stderr,"signal `%s` never assigned\n",str1);
|
||||
break;
|
||||
|
||||
case 68:
|
||||
(void) fprintf (stderr,"BEPOR type is unknown\n");
|
||||
break;
|
||||
case 73:
|
||||
(void) fprintf (stderr,"`%s` is not a bit string litteral\n",str1);
|
||||
break;
|
||||
case 74:
|
||||
(void) fprintf (stderr,"bad generic declaration\n");
|
||||
break;
|
||||
case 75:
|
||||
(void) fprintf (stderr,"bad generic element\n");
|
||||
break;
|
||||
case 76:
|
||||
(void) fprintf (stderr,"`%s`: when expression must be a constant\n",str1);
|
||||
break;
|
||||
case 77:
|
||||
(void) fprintf (stderr,"illegal generic declaration (type, kind)\n");
|
||||
break;
|
||||
case 78:
|
||||
(void) fprintf (stderr,"illegal constant declaration (type, kind)\n");
|
||||
break;
|
||||
case 79:
|
||||
(void) fprintf (stderr,"illegal use of attribute STABLE on `%s`\n",str1);
|
||||
break;
|
||||
case 80:
|
||||
(void) fprintf (stderr,"variable `%s` already declared\n",str1);
|
||||
break;
|
||||
case 81:
|
||||
(void) fprintf (stderr,"internal signal not allowed `%s`\n",str1);
|
||||
break;
|
||||
case 82:
|
||||
(void) fprintf (stderr,"enumerate valu `%s` already declared\n",str1);
|
||||
break;
|
||||
case 83:
|
||||
(void) fprintf (stderr,"'%s' illegal index subtype definition \n",str1);
|
||||
break;
|
||||
case 84:
|
||||
(void) fprintf (stderr,"'%s' illegal type mark definition \n",str1);
|
||||
break;
|
||||
case 85:
|
||||
(void) fprintf (stderr,"when choice is empty in case statement \n");
|
||||
break;
|
||||
|
||||
case 100:
|
||||
(void) fprintf (stderr,"cannot find `%s`\n",str1);
|
||||
break;
|
||||
case 107:
|
||||
(void) fprintf (stderr,"Cannot open result file\n");
|
||||
break;
|
||||
case 112:
|
||||
(void) fprintf (stderr,"multiple driver on guarded signal `%s`\n",str1);
|
||||
break;
|
||||
|
||||
default:
|
||||
(void) fprintf (stderr,"syntax error\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (FBL_ERRFLG > FBL_MXRDFN)
|
||||
{
|
||||
(void) fprintf (stderr,"Too many errors. Cannot continue further more\n");
|
||||
(void) fprintf (stderr,"\n Have a nice day...\n");
|
||||
autexit (1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbl_y_error */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
void fbl_y_error (str)
|
||||
|
||||
char *str;
|
||||
{
|
||||
FBL_ERRFLG++;
|
||||
(void)fprintf (stderr,"Error line %d : %s\n",FBL_LINNUM,str);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbl_vectorize */
|
||||
/* content : put parenthesis for bused signals */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
char *fbl_vectorize( Name )
|
||||
|
||||
char *Name;
|
||||
{
|
||||
char *Blank;
|
||||
char *VhdlName;
|
||||
|
||||
static char Buffer[ 1024 ];
|
||||
|
||||
Blank = strchr( Name, ' ' );
|
||||
|
||||
if ( Blank != (char *)0 )
|
||||
{
|
||||
strcpy( Buffer, Name );
|
||||
Buffer[ Blank - Name ] = '\0';
|
||||
|
||||
VhdlName = vhdlablname( Buffer );
|
||||
|
||||
sprintf( Buffer, "%s(%s)", VhdlName, Blank + 1 );
|
||||
|
||||
Name = namealloc( Buffer );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( strchr( Name, '\'' ) == (char *)0 )
|
||||
{
|
||||
Name = vhdlablname( Name );
|
||||
}
|
||||
}
|
||||
|
||||
return( Name );
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbl_vectnam */
|
||||
/* analyze a list of signal and return the bounds of the vectorised */
|
||||
/* signals, if they occure. */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
void *fbl_vectnam(pt_list,left,right,name,type)
|
||||
|
||||
void *pt_list;
|
||||
int *left, *right;
|
||||
char **name;
|
||||
char type; /* If type = 0 fbpor_list, type = 1 fbbux_list */
|
||||
/* If type = 2 fbreg_list, type = 3 fbaux_list */
|
||||
|
||||
{
|
||||
char *blank_space;
|
||||
char *sig_name;
|
||||
char name_tmp[200];
|
||||
char number[200];
|
||||
fbpor_list *ptpor;
|
||||
fbbux_list *ptbux;
|
||||
fbaux_list *ptaux;
|
||||
fbreg_list *ptreg;
|
||||
char END = 0;
|
||||
|
||||
/* Case fbpor_list */
|
||||
if(type==0)
|
||||
{
|
||||
ptpor = (fbpor_list *)pt_list;
|
||||
*left = *right = -1;
|
||||
sig_name = ptpor->NAME;
|
||||
*name = (char*)mbkalloc(strlen(sig_name) + 1);
|
||||
strcpy(*name,sig_name);
|
||||
blank_space = strchr(*name,' ');
|
||||
if (blank_space != 0)
|
||||
{
|
||||
strcpy(number,blank_space);
|
||||
*left = atoi(number);
|
||||
*right = *left;
|
||||
*blank_space = '\0';
|
||||
}
|
||||
|
||||
while(!END)
|
||||
{
|
||||
if(ptpor->NEXT != 0)
|
||||
{
|
||||
strcpy(name_tmp,(ptpor->NEXT)->NAME);
|
||||
blank_space = strchr(name_tmp,' ');
|
||||
if(blank_space!=0)
|
||||
{
|
||||
strcpy(number,blank_space);
|
||||
*blank_space = '\0';
|
||||
if(!strcmp(*name,name_tmp))
|
||||
{
|
||||
*right = atoi(number);
|
||||
ptpor = ptpor->NEXT;
|
||||
}
|
||||
else
|
||||
END = 1;
|
||||
}
|
||||
else
|
||||
END = 1;
|
||||
}
|
||||
else
|
||||
END = 1;
|
||||
}
|
||||
return((void *)ptpor);
|
||||
}
|
||||
|
||||
/*case fbbux_list */
|
||||
if(type==1)
|
||||
{
|
||||
ptbux = (fbbux_list *)pt_list;
|
||||
/* Extract the name and number of an element */
|
||||
*left = *right = -1;
|
||||
sig_name = ptbux->NAME;
|
||||
*name = (char *)mbkalloc(strlen(sig_name) + 1);
|
||||
strcpy(*name,sig_name);
|
||||
blank_space = strchr(*name,' ');
|
||||
if (blank_space != 0)
|
||||
{
|
||||
strcpy(number,blank_space);
|
||||
*right = atoi(number);
|
||||
*left = *right;
|
||||
*blank_space = '\0';
|
||||
}
|
||||
|
||||
while(END != 1)
|
||||
{
|
||||
if(ptbux->NEXT != 0)
|
||||
{
|
||||
strcpy(name_tmp,ptbux->NEXT->NAME);
|
||||
blank_space = strchr(name_tmp,' ');
|
||||
if(blank_space!=0)
|
||||
{
|
||||
strcpy(number,blank_space);
|
||||
*blank_space = '\0';
|
||||
if(!strcmp(*name,name_tmp))
|
||||
{
|
||||
*right = atoi(number);
|
||||
ptbux = ptbux->NEXT;
|
||||
}
|
||||
else
|
||||
END = 1;
|
||||
}
|
||||
else
|
||||
END = 1;
|
||||
}
|
||||
else
|
||||
END = 1;
|
||||
}
|
||||
return((void *)ptbux);
|
||||
}
|
||||
|
||||
/*case fbreg_list */
|
||||
if(type==2)
|
||||
{
|
||||
ptreg = (fbreg_list *)pt_list;
|
||||
/* Extract the name and number of an element */
|
||||
*left = *right = -1;
|
||||
sig_name = ptreg->NAME;
|
||||
*name = (char *)mbkalloc(strlen(sig_name) + 1);
|
||||
strcpy(*name,sig_name);
|
||||
blank_space = strchr(*name,' ');
|
||||
if (blank_space != 0)
|
||||
{
|
||||
strcpy(number,blank_space);
|
||||
*right = atoi(number);
|
||||
*left = *right;
|
||||
*blank_space = '\0';
|
||||
}
|
||||
|
||||
while(END != 1)
|
||||
{
|
||||
if(ptreg->NEXT != 0)
|
||||
{
|
||||
strcpy(name_tmp,ptreg->NEXT->NAME);
|
||||
blank_space = strchr(name_tmp,' ');
|
||||
if(blank_space!=0)
|
||||
{
|
||||
strcpy(number,blank_space);
|
||||
*blank_space = '\0';
|
||||
if(!strcmp(*name,name_tmp))
|
||||
{
|
||||
*right = atoi(number);
|
||||
ptreg = ptreg->NEXT;
|
||||
}
|
||||
else
|
||||
END = 1;
|
||||
}
|
||||
else
|
||||
END = 1;
|
||||
}
|
||||
else
|
||||
END = 1;
|
||||
}
|
||||
return((void *)ptreg);
|
||||
}
|
||||
|
||||
/*case fbaux_list */
|
||||
if(type==3)
|
||||
{
|
||||
ptaux = (fbaux_list *)pt_list;
|
||||
/* Extract the name and number of an element */
|
||||
*left = *right = -1;
|
||||
sig_name = ptaux->NAME;
|
||||
*name = (char *)mbkalloc(strlen(sig_name) + 1);
|
||||
strcpy(*name,sig_name);
|
||||
blank_space = strchr(*name,' ');
|
||||
if (blank_space != 0)
|
||||
{
|
||||
strcpy(number,blank_space);
|
||||
*right = atoi(number);
|
||||
*left = *right;
|
||||
*blank_space = '\0';
|
||||
}
|
||||
|
||||
while(END != 1)
|
||||
{
|
||||
if(ptaux->NEXT != 0)
|
||||
{
|
||||
strcpy(name_tmp,ptaux->NEXT->NAME);
|
||||
blank_space = strchr(name_tmp,' ');
|
||||
if(blank_space!=0)
|
||||
{
|
||||
strcpy(number,blank_space);
|
||||
*blank_space = '\0';
|
||||
if(!strcmp(*name,name_tmp))
|
||||
{
|
||||
*right = atoi(number);
|
||||
ptaux = ptaux->NEXT;
|
||||
}
|
||||
else
|
||||
END = 1;
|
||||
}
|
||||
else
|
||||
END = 1;
|
||||
}
|
||||
else
|
||||
END = 1;
|
||||
}
|
||||
return((void *)ptaux);
|
||||
}
|
||||
return((void *)0);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : fbl_printabl */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
/*\
|
||||
void fbl_printabl( Expr )
|
||||
|
||||
chain_list *Expr;
|
||||
{
|
||||
int Oper;
|
||||
char *String;
|
||||
int Length;
|
||||
|
||||
if ( fbl_abllength > 80 )
|
||||
{
|
||||
fprintf( fbl_ablfile, "\n " );
|
||||
fbl_abllength = 0;
|
||||
}
|
||||
|
||||
if ( ABL_ATOM( Expr ) )
|
||||
{
|
||||
String = fbl_vectorize( ABL_ATOM_VALUE( Expr ) );
|
||||
fbl_abllength += strlen( String );
|
||||
fprintf( fbl_ablfile, String );
|
||||
}
|
||||
else
|
||||
{
|
||||
Oper = ABL_OPER( Expr );
|
||||
String = getablopername( Oper );
|
||||
Length = strlen( String );
|
||||
|
||||
if ( Oper == ABL_NOT )
|
||||
{
|
||||
fbl_abllength += Length + 1;
|
||||
fprintf( fbl_ablfile, "%s(", String );
|
||||
|
||||
fbl_printabl( ABL_CADR( Expr ) );
|
||||
|
||||
fprintf( fbl_ablfile, ")" );
|
||||
fbl_abllength += 1;
|
||||
}
|
||||
else
|
||||
if ( Oper == ABL_STABLE )
|
||||
{
|
||||
fbl_printabl( ABL_CADR( Expr ) );
|
||||
fbl_abllength += Length + 1;
|
||||
fprintf( fbl_ablfile, "'%s", String );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( Oper != ABL_NXOR )
|
||||
{
|
||||
fprintf( fbl_ablfile, "(" );
|
||||
fbl_abllength += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf( fbl_ablfile, "not(" );
|
||||
fbl_abllength += 4;
|
||||
|
||||
String = getablopername( ABL_XOR );
|
||||
Length = strlen( String );
|
||||
}
|
||||
|
||||
while ( ( Expr = ABL_CDR( Expr ) ) != (chain_list *)0 )
|
||||
{
|
||||
fbl_printabl( ABL_CAR( Expr ) );
|
||||
|
||||
if ( ABL_CDR( Expr ) )
|
||||
{
|
||||
fbl_abllength += Length + 2;
|
||||
fprintf( fbl_ablfile, " %s ", String );
|
||||
}
|
||||
}
|
||||
|
||||
fprintf( fbl_ablfile, ")" );
|
||||
fbl_abllength += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
\*/
|
||||
|
||||
void fbl_printablfile( AblFile, Expr )
|
||||
|
||||
FILE *AblFile;
|
||||
ablexpr *Expr;
|
||||
{
|
||||
viewablexprfile( AblFile, Expr, ABL_VIEW_VHDL );
|
||||
}
|
||||
|
||||
/*\
|
||||
|
||||
void fbl_printsens( AblFile, Expr )
|
||||
|
||||
FILE *AblFile;
|
||||
{
|
||||
chain_list *Support;
|
||||
chain_list *ScanSupport;
|
||||
int First;
|
||||
|
||||
Support = getablexprsupport( Expr, ABL_SUPPORT_CHAIN );
|
||||
First = 1;
|
||||
|
||||
for ( ScanSupport = Support;
|
||||
ScanSupport != (chain_list *)0;
|
||||
ScanSupport = ScanSupport->NEXT )
|
||||
{
|
||||
if ( First ) fprintf( AblFile, "( %s", fbl_vectorize( ScanSupport->DATA ) );
|
||||
else fprintf( AblFile, ", %s", fbl_vectorize( ScanSupport->DATA ) );
|
||||
|
||||
First = 0;
|
||||
}
|
||||
|
||||
freechain( Support );
|
||||
|
||||
if ( ! First ) (void) fprintf( AblFile, " )" );
|
||||
}
|
||||
|
||||
\*/
|
|
@ -0,0 +1,48 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbl_util.h */
|
||||
/* date : Jun 15 1992 */
|
||||
/* version : v100 */
|
||||
/* author : Pirouz BAZARGAN SABET */
|
||||
/* description : This file contains declaration of global and external */
|
||||
/* variables and, functions used in `fbl_util.c` */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
|
||||
extern int FBL_LINNUM; /* file's line number */
|
||||
extern char FBL_ERRFLG; /* Error flag */
|
||||
extern char FBL_CURFIL[]; /* current file name */
|
|
@ -0,0 +1,65 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fbl_utype.h */
|
||||
/* date : Jun 15 1992 */
|
||||
/* version : v100 */
|
||||
/* author : P.BAZARGAN L.A.TABUSSE VUONG H.N. */
|
||||
/* content : declaration of external functions and global variables */
|
||||
/* used by yacc */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct dct_entry
|
||||
{
|
||||
struct dct_entry *next;
|
||||
struct dct_recrd *data;
|
||||
char *key;
|
||||
};
|
||||
|
||||
struct dct_recrd
|
||||
{
|
||||
struct dct_recrd *next;
|
||||
char *key;
|
||||
short fd0_val;
|
||||
short fd1_val;
|
||||
short fd2_val;
|
||||
short fd3_val;
|
||||
short fd4_val;
|
||||
short fd5_val;
|
||||
short fd6_val;
|
||||
long pnt_val;
|
||||
};
|
|
@ -0,0 +1,387 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : fvh.h */
|
||||
/* date : Aug 28 1992 */
|
||||
/* version : 102 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* contents : defines and structure definitions used in FBH library */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#ifndef FBH_DEFINE
|
||||
#define FBH_DEFINE
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* defines */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
#define FBH_GENERIC 203698 /* generic ptype code */
|
||||
#define FBH_BEIFS 205635 /* if statement ptype code */
|
||||
#define FBH_BECAS 423240 /* case statement ptype code */
|
||||
#define FBH_BEMSG 153676 /* assert statement ptype code */
|
||||
#define FBH_BEASG 967324 /* assign statement ptype code */
|
||||
|
||||
#define FBH_TYPE_SEVERITY 1
|
||||
#define FBH_TYPE_BOOLEAN 2
|
||||
#define FBH_TYPE_BIT 3
|
||||
#define FBH_TYPE_INTEGER 4
|
||||
#define FBH_TYPE_MUX_BIT 5
|
||||
#define FBH_TYPE_WOR_BIT 6
|
||||
#define FBH_TYPE_REG_BIT 7
|
||||
#define FBH_TYPE_NATURAL 8
|
||||
#define FBH_TYPE_BIT_VEC 9
|
||||
#define FBH_TYPE_MUX_VEC 10
|
||||
#define FBH_TYPE_WOR_VEC 11
|
||||
#define FBH_TYPE_REG_VEC 12
|
||||
|
||||
# define FBH_ASSIGN_BY_FSM_MASK 0x1
|
||||
|
||||
# define SetFbhAssignByFsm( O ) ( (O)->FLAG |= FBH_ASSIGN_BY_FSM_MASK )
|
||||
# define ClearFbhAssignByFsm( O ) ( (O)->FLAG &= ~FBH_ASSIGN_BY_FSM_MASK )
|
||||
# define IsFbhAssignByFsm( O ) ( (O)->FLAG & FBH_ASSIGN_BY_FSM_MASK )
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* structure definitions */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
typedef struct fbfig /* fbhaviour figure */
|
||||
{
|
||||
struct fbfig *NEXT; /* next figure */
|
||||
char *NAME; /* figure's name */
|
||||
struct fbreg *BEREG; /* internal signals (REGISTER) */
|
||||
struct fbmsg *BEMSG; /* concurrent assert instructions */
|
||||
struct fbrin *BERIN; /* inputs (registers and ports) */
|
||||
struct fbout *BEOUT; /* output ports */
|
||||
struct fbbus *BEBUS; /* output ports (BUS) */
|
||||
struct fbaux *BEAUX; /* internal signals */
|
||||
struct fbaux *BEDLY; /* internal delayed signals */
|
||||
struct fbbux *BEBUX; /* internal signals (BUS) */
|
||||
struct fbpor *BEPOR; /* ports (reverse order of declaration) */
|
||||
struct fbpcs *BEPCS; /* list of processes */
|
||||
struct bddcircuit *CIRCUI; /* Circuit's pointer used for BDDs */
|
||||
struct ptype *USER; /* reserved for user's applications */
|
||||
unsigned char FLAG; /* error flags */
|
||||
unsigned char TYPE; /* type of the description (not used) */
|
||||
struct fbtyp *BETYP; /* list of declared types */
|
||||
struct fbpgm *BEPGM; /* list of pragmas */
|
||||
}
|
||||
fbfig_list;
|
||||
|
||||
typedef struct fbreg /* register */
|
||||
{
|
||||
struct fbreg *NEXT; /* next register */
|
||||
char *NAME; /* register's name */
|
||||
struct biabl *BIABL; /* list of drivers (ABL) */
|
||||
struct binode *BINODE; /* list of drivers (BDD) */
|
||||
unsigned char FLAG;
|
||||
void *USER;
|
||||
}
|
||||
fbreg_list;
|
||||
|
||||
typedef struct fbmsg /* assert instruction */
|
||||
{
|
||||
struct fbmsg *NEXT; /* next assertion */
|
||||
char LEVEL; /* severity level of the assertion */
|
||||
char *LABEL; /* instruction's label */
|
||||
char *MESSAGE; /* assertion's message */
|
||||
struct chain *ABL; /* assertion's condition (ABL) */
|
||||
bddnode *NODE; /* assertion's condition (BDD) */
|
||||
void *USER;
|
||||
}
|
||||
fbmsg_list;
|
||||
|
||||
typedef struct fbout /* output port */
|
||||
{
|
||||
struct fbout *NEXT; /* next output */
|
||||
char *NAME; /* port's name */
|
||||
struct chain *ABL; /* port's equation (ABL) */
|
||||
bddnode *NODE; /* port's equation (BDD) */
|
||||
unsigned char TYPE; /* port's type */
|
||||
unsigned char FLAG;
|
||||
void *USER;
|
||||
}
|
||||
fbout_list;
|
||||
|
||||
typedef struct fbbus /* output port (BUS) */
|
||||
{
|
||||
struct fbbus *NEXT; /* next bus port */
|
||||
char *NAME; /* port's name */
|
||||
struct biabl *BIABL; /* list of drivers (ABL) */
|
||||
struct binode *BINODE; /* list of drivers (BDD) */
|
||||
unsigned char TYPE; /* port's type : W or M */
|
||||
unsigned char FLAG;
|
||||
void *USER;
|
||||
}
|
||||
fbbus_list;
|
||||
|
||||
typedef struct fbaux /* auxiliary signal */
|
||||
{
|
||||
struct fbaux *NEXT; /* next signal */
|
||||
char *NAME; /* signal's name */
|
||||
struct chain *ABL; /* signal's equation (ABL) */
|
||||
bddnode *NODE; /* signal's equation (BDD) */
|
||||
unsigned char TYPE; /* signal's type */
|
||||
unsigned char FLAG;
|
||||
void *USER;
|
||||
}
|
||||
fbaux_list;
|
||||
|
||||
typedef struct fbbux /* internal signal (BUS) */
|
||||
{
|
||||
struct fbbux *NEXT; /* next signal */
|
||||
char *NAME; /* signal's name */
|
||||
struct biabl *BIABL; /* list of drivers (ABL) */
|
||||
struct binode *BINODE; /* list of drivers (BDD) */
|
||||
unsigned char TYPE; /* signal's type : W or M */
|
||||
unsigned char FLAG;
|
||||
void *USER;
|
||||
}
|
||||
fbbux_list;
|
||||
|
||||
typedef struct fbpor /* port */
|
||||
{
|
||||
struct fbpor *NEXT; /* next port */
|
||||
char *NAME; /* port's name */
|
||||
char DIRECTION; /* port's mode (same as LOCON) */
|
||||
unsigned char TYPE; /* port's type (B, M or W) */
|
||||
void *USER;
|
||||
}
|
||||
fbpor_list;
|
||||
|
||||
typedef struct biabl /* couple of ABL */
|
||||
{
|
||||
struct biabl *NEXT; /* next couple */
|
||||
char *LABEL; /* driver's label */
|
||||
struct chain *CNDABL; /* driver's connection condition (ABL) */
|
||||
struct chain *VALABL; /* equation of driven value (ABL) */
|
||||
void *USER;
|
||||
}
|
||||
biabl_list;
|
||||
|
||||
typedef struct binode /* couple of BDD */
|
||||
{
|
||||
struct binode *NEXT; /* next figure */
|
||||
bddnode *CNDNODE; /* driver's connection condition (BDD) */
|
||||
bddnode *VALNODE; /* equation of driven value (BDD) */
|
||||
void *USER;
|
||||
}
|
||||
binode_list;
|
||||
|
||||
typedef struct fbrin /* primary inputs */
|
||||
{
|
||||
struct fbrin *NEXT; /* next input */
|
||||
char *NAME; /* input's name */
|
||||
void *USER;
|
||||
}
|
||||
fbrin_list;
|
||||
|
||||
typedef struct fbgen /* generic */
|
||||
{
|
||||
struct fbgen *NEXT; /* next generic */
|
||||
char *NAME; /* generic's name */
|
||||
char *TYPE; /* generic type's name */
|
||||
void *VALUE; /* generic's value */
|
||||
void *USER;
|
||||
}
|
||||
fbgen_list;
|
||||
|
||||
typedef struct fbpcs /* process */
|
||||
{
|
||||
struct fbpcs *NEXT; /* next process */
|
||||
char *LABEL; /* process's label */
|
||||
struct chain *SENSITIVITY; /* list of sensitivity */
|
||||
struct ptype *INSTRUCTION; /* list of instructions */
|
||||
struct chain *OUTPUTS; /* list of assigned signals */
|
||||
unsigned char FLAG; /* flag (not used) */
|
||||
void *USER;
|
||||
}
|
||||
fbpcs_list;
|
||||
|
||||
typedef struct fbifs /* if statement */
|
||||
{
|
||||
struct chain *CND; /* condition (abl) */
|
||||
struct ptype *CNDTRUE; /* list of instructions when true */
|
||||
struct ptype *CNDFALSE; /* list of instructions when false */
|
||||
void *USER;
|
||||
}
|
||||
fbifs_list;
|
||||
|
||||
typedef struct fbasg /* signal assignment statement */
|
||||
{
|
||||
char *NAME; /* target's name */
|
||||
struct chain *ABL; /* condition (abl) */
|
||||
unsigned char TYPE; /* signal's type */
|
||||
void *USER;
|
||||
}
|
||||
fbasg_list;
|
||||
|
||||
typedef struct fbcas /* case statement */
|
||||
{
|
||||
struct chain *ABL; /* expression (ABL) */
|
||||
struct fbcho *CHOICE; /* table of choices */
|
||||
unsigned char TYPE; /* expression's type */
|
||||
unsigned int SIZE; /* size of choices' table */
|
||||
void *USER;
|
||||
}
|
||||
fbcas_list;
|
||||
|
||||
typedef struct fbcho /* a choice in a case instruction */
|
||||
{
|
||||
char *VALUE; /* the value of the choice */
|
||||
unsigned int SIZE; /* size of the value in byte */
|
||||
struct ptype *INSTRUCTION; /* list of instructions */
|
||||
void *USER;
|
||||
}
|
||||
fbcho_list;
|
||||
|
||||
typedef struct fbtyp /* type or subtype */
|
||||
{
|
||||
struct fbtyp *NEXT; /* next fbtyp */
|
||||
char *NAME; /* type's name */
|
||||
int LEFT; /* left bound */
|
||||
int RIGHT; /* right bound */
|
||||
char **VALUE; /* list of values */
|
||||
unsigned int SIZE; /* number of values */
|
||||
unsigned int BYTE; /* number of bytes needed to code values*/
|
||||
char CLASS; /* type's class (E, I, A, S) */
|
||||
unsigned char INDEX; /* the type of the index for an array */
|
||||
unsigned char BASE; /* the base type or element's type */
|
||||
unsigned char RESOLV; /* index of resolution function */
|
||||
void *USER;
|
||||
}
|
||||
fbtyp_list;
|
||||
|
||||
typedef struct fbpgm /* pragma */
|
||||
{
|
||||
struct fbpgm *NEXT; /* next pragma */
|
||||
char *TYPE; /* prgma's type */
|
||||
char *NAME; /* object's name */
|
||||
void *VALUE; /* prgma's content */
|
||||
void *USER;
|
||||
}
|
||||
fbpgm_list;
|
||||
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* low-level functions */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
extern fbfig_list *FBL_HEADFIG;
|
||||
|
||||
extern struct fbaux * fbh_addfbaux __P((struct fbaux *lastfbaux, char *name, struct chain *abl_expr, bddnode *bdd_expr, unsigned char type));
|
||||
extern struct fbbux * fbh_addfbbux __P((struct fbbux *lastfbbux, char *name, struct biabl *biabl, struct binode *binode, char type));
|
||||
extern struct fbbus * fbh_addfbbus __P((struct fbbus *lastfbbus, char *name, struct biabl *biabl, struct binode *binode, char type));
|
||||
extern struct fbfig * fbh_addfbfig __P((struct fbfig *lastfbfig, char *name));
|
||||
extern struct fbgen * fbh_addfbgen __P((struct fbgen *lastfbgen, char *name, char *type, void *value ));
|
||||
extern struct fbmsg * fbh_addfbmsg __P((struct fbmsg *lastfbmsg, char *label, char level, char *message, struct chain *abl_expr, bddnode *bdd_expr));
|
||||
extern struct fbout * fbh_addfbout __P((struct fbout *lastfbout, char *name, struct chain *abl_expr, bddnode *bdd_expr, unsigned char type));
|
||||
extern struct fbpor * fbh_addfbpor __P((struct fbpor *lastfbpor, char *name, char dir, unsigned char type));
|
||||
extern struct fbreg * fbh_addfbreg __P((struct fbreg *lastfbreg, char *name, struct biabl *biabl, struct binode *binode));
|
||||
extern struct fbrin * fbh_addfbrin __P((struct fbrin *lastfbrin, char *name));
|
||||
extern struct biabl * fbh_addbiabl __P((struct biabl *lastbiabl, char *label,struct chain *condition, struct chain *value));
|
||||
extern struct binode * fbh_addbinode __P((struct binode *lastbinode, bddnode *condition, bddnode *value));
|
||||
extern struct ptype * fbh_addfbifs __P((struct ptype *lastptype, struct chain *abl));
|
||||
extern struct ptype * fbh_addfbasg __P((struct ptype *lastptype, char *name, struct chain *abl, unsigned char type));
|
||||
extern struct ptype * fbh_addfbcas __P((struct ptype *lastptype, struct chain *abl, unsigned char type));
|
||||
extern struct fbpcs * fbh_addfbpcs __P((struct fbpcs *lastfbpcs, char *label, struct chain *sens, struct ptype *inst, struct chain *outs, char flag));
|
||||
extern struct fbtyp * fbh_addfbtyp __P((struct fbtyp *lastfbtyp, char *name, int left, int right, char **value, unsigned int size, unsigned int byte, unsigned char base, unsigned char index, unsigned char resolv, char class));
|
||||
extern struct fbpgm * fbh_addfbpgm __P((struct fbpgm *lastfbpgm, char *type, char *name, void *value));
|
||||
extern struct fbtyp * fbh_crtfbtyp __P((struct fbtyp *listfbtyp));
|
||||
extern struct fbaux * fbh_delfbaux __P((struct fbaux *listfbaux, struct fbaux *ptfbaux, char mode));
|
||||
extern struct fbbux * fbh_delfbbux __P((struct fbbux *listfbbux, struct fbbux *ptfbbux, char mode));
|
||||
extern struct fbbus * fbh_delfbbus __P((struct fbbus *listfbbus, struct fbbus *ptfbbus, char mode));
|
||||
extern struct fbfig * fbh_delfbfig __P((struct fbfig *listfbfig, struct fbfig *ptfbfig, char mode));
|
||||
extern struct fbgen * fbh_delfbgen __P((struct fbgen *listfbgen, struct fbgen *ptfbgen, char mode));
|
||||
extern struct fbmsg * fbh_delfbmsg __P((struct fbmsg *listfbmsg, struct fbmsg *ptfbmsg, char mode));
|
||||
extern struct fbout * fbh_delfbout __P((struct fbout *listfbout, struct fbout *ptfbout, char mode));
|
||||
extern struct fbpor * fbh_delfbpor __P((struct fbpor *listfbpor, struct fbpor *ptfbpor));
|
||||
extern struct fbreg * fbh_delfbreg __P((struct fbreg *listfbreg, struct fbreg *ptfbreg, char mode));
|
||||
extern struct fbrin * fbh_delfbrin __P((struct fbrin *listfbrin, struct fbrin *ptfbrin));
|
||||
extern struct biabl * fbh_delbiabl __P((struct biabl *listbiabl, struct biabl *ptbiabl, char mode));
|
||||
extern struct binode * fbh_delbinode __P((struct binode *listbinode, struct binode *ptbinode, char mode));
|
||||
extern void fbh_frefbaux __P((struct fbaux *listfbaux));
|
||||
extern void fbh_frefbbux __P((struct fbbux *listfbbux));
|
||||
extern void fbh_frefbbus __P((struct fbbus *listfbbus));
|
||||
extern void fbh_frefbfig __P((struct fbfig *listfbfig));
|
||||
extern void fbh_frefbgen __P((struct fbgen *listfbgen));
|
||||
extern void fbh_frefbmsg __P((struct fbmsg *listfbmsg));
|
||||
extern void fbh_frefbout __P((struct fbout *listfbout));
|
||||
extern void fbh_frefbpor __P((struct fbpor *listfbpor));
|
||||
extern void fbh_frefbreg __P((struct fbreg *listfbreg));
|
||||
extern void fbh_frefbrin __P((struct fbrin *listfbrin));
|
||||
extern void fbh_frefbpgm __P((struct fbpgm *listfbpgm));
|
||||
extern void fbh_frebiabl __P((struct biabl *listbiabl));
|
||||
extern void fbh_frebinode __P((struct binode *listbinode));
|
||||
extern void fbh_frefbtyp __P((struct fbtyp *listfbtyp));
|
||||
extern void * fbh_getgenval __P((struct fbgen *listfbgen, char *fbgenname));
|
||||
extern struct fbaux * fbh_rmvfbaux __P((struct fbaux *listfbaux, char *fbauxname, char mode));
|
||||
extern struct fbbux * fbh_rmvfbbux __P((struct fbbux *listfbbux, char *fbbuxname, char mode));
|
||||
extern struct fbbus * fbh_rmvfbbus __P((struct fbbus *listfbbus, char *fbbusname, char mode));
|
||||
extern struct fbfig * fbh_rmvfbfig __P((struct fbfig *listfbfig, char *fbfigname, char mode));
|
||||
extern struct fbgen * fbh_rmvfbgen __P((struct fbgen *listfbgen, char *fbgenname, char mode));
|
||||
extern struct fbmsg * fbh_rmvfbmsg __P((struct fbmsg *listfbmsg, char *fbmsglabl, char mode));
|
||||
extern struct fbout * fbh_rmvfbout __P((struct fbout *listfbout, char *fboutname, char mode));
|
||||
extern struct fbpor * fbh_rmvfbpor __P((struct fbpor *listfbpor, char *fbporname));
|
||||
extern struct fbreg * fbh_rmvfbreg __P((struct fbreg *listfbreg, char *fbregname, char mode));
|
||||
extern struct fbrin * fbh_rmvfbrin __P((struct fbrin *listfbrin, char *fbrinname));
|
||||
|
||||
extern struct fbtyp * fbh_prdeftyp __P(());
|
||||
/* ###------------------------------------------------------### */
|
||||
/* high-level functions */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
extern void fbh_debug ();
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* system-level functions */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
extern FILE *fbh_opnfile ();
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* parser-driver functions */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
extern struct fbfig *fbh_prsvhdl ();
|
||||
extern struct fbfig *vhdlloadfbfig();
|
||||
extern void vhdlsavefbfig __P((fbfig_list *pthedfbfig, char *FileName, int synopsys));
|
||||
|
||||
extern void vhdlsavefbdecl __P(( fbfig_list *pthedfbfig, int synopsys ));
|
||||
extern void vhdlsavefbport __P(( fbfig_list *pthedfbfig, int synopsys ));
|
||||
extern void vhdlsavefbarchi __P(( fbfig_list *pthedfbfig, int synopsys ));
|
||||
extern FILE *FblDriveFile;
|
||||
|
||||
#endif
|
|
@ -0,0 +1,650 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : FVH |
|
||||
| |
|
||||
| File : fvhdrive.c |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 04.12.96 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <time.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "bdd.h"
|
||||
# include "fsm.h"
|
||||
# include "fvh.h"
|
||||
|
||||
# include "fvherror.h"
|
||||
# include "fvhdrive.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static FILE *VhdlFile;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VhdlWriteHeader |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VhdlWriteHeader( FsmFigure )
|
||||
|
||||
fsmfig_list *FsmFigure;
|
||||
{
|
||||
time_t VhdlTime;
|
||||
|
||||
time( &VhdlTime );
|
||||
fprintf( VhdlFile, "-- VHDL FSM : `%s`\n", FsmFigure->NAME );
|
||||
fprintf( VhdlFile, "-- DATE : %s\n\n", ctime( &VhdlTime ) );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VhdlWriteEntity |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VhdlWriteEntity( FsmFigure )
|
||||
|
||||
fsmfig_list *FsmFigure;
|
||||
{
|
||||
fsmport_list *Port;
|
||||
fsmport_list *ScanPort;
|
||||
char *Name;
|
||||
char *Vector;
|
||||
char *NextVector;
|
||||
char *Direction;
|
||||
char *Type;
|
||||
char *Bus;
|
||||
long Index;
|
||||
long NextIndex;
|
||||
long Left;
|
||||
long Right;
|
||||
long Way;
|
||||
|
||||
Name = vhdlablname( FsmFigure->NAME );
|
||||
|
||||
fprintf( VhdlFile, "ENTITY %s IS\n", Name );
|
||||
|
||||
if ( IsFsmFigMixedRtl( FsmFigure ) )
|
||||
{
|
||||
vhdlsavefbport( (fbfig_list *)FsmFigure->FIGURE, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf( VhdlFile, "PORT\n(\n" );
|
||||
|
||||
Port = FsmFigure->PORT;
|
||||
|
||||
while ( Port != (fsmport_list *)0 )
|
||||
{
|
||||
Vector = vhdlablvector( Port->NAME, &Index );
|
||||
|
||||
if ( Port->DIR == FSM_DIR_IN ) Direction = "IN";
|
||||
else
|
||||
if ( Port->DIR == FSM_DIR_OUT ) Direction = "OUT";
|
||||
else Direction = "INOUT";
|
||||
|
||||
if ( Vector != (char *)0 )
|
||||
{
|
||||
Left = Right = Index;
|
||||
Way = -1;
|
||||
|
||||
for ( ScanPort = Port->NEXT;
|
||||
ScanPort != (fsmport_list *)0;
|
||||
ScanPort = ScanPort->NEXT )
|
||||
{
|
||||
NextVector = vhdlablvector( ScanPort->NAME, &NextIndex );
|
||||
|
||||
if ( NextVector != Vector ) break;
|
||||
|
||||
if ( Way == -1 )
|
||||
{
|
||||
if ( NextIndex < Left ) Way = 0; /* downto */
|
||||
else Way = 1; /* to */
|
||||
}
|
||||
|
||||
Right = NextIndex;
|
||||
}
|
||||
|
||||
if ( Port->TYPE == FSM_TYPE_BIT_VEC ) Type = "BIT_VECTOR";
|
||||
else
|
||||
if ( Port->TYPE == FSM_TYPE_WOR_VEC ) Type = "WOR_VECTOR";
|
||||
else Type = "MUX_VECTOR";
|
||||
|
||||
if ( Port->TYPE != FSM_TYPE_BIT_VEC ) Bus = "BUS";
|
||||
else Bus = "";
|
||||
|
||||
fprintf( VhdlFile, " %s : %s %s(%ld %s %ld) %s",
|
||||
vhdlablname( Vector ), Direction, Type, Left,
|
||||
( Way ) ? "TO" : "DOWNTO", Right, Bus );
|
||||
|
||||
Port = ScanPort;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( Port->TYPE == FSM_TYPE_BIT ) Type = "BIT";
|
||||
else
|
||||
if ( Port->TYPE == FSM_TYPE_WOR_BIT ) Type = "WOR_BIT BUS";
|
||||
else Type = "MUX_BIT BUS";
|
||||
|
||||
fprintf( VhdlFile, " %s : %s %s",
|
||||
vhdlablname( Port->NAME ), Direction, Type );
|
||||
|
||||
Port = Port->NEXT;
|
||||
}
|
||||
|
||||
if ( Port != (fsmport_list *)0 )
|
||||
{
|
||||
fprintf( VhdlFile, ";\n" );
|
||||
}
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, "\n);\n" );
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, "END %s;\n\n", Name );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VhdlWriteStack |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VhdlWriteStack( ScanState )
|
||||
|
||||
fsmstate_list *ScanState;
|
||||
{
|
||||
fsmstack_list *ScanStack;
|
||||
chain_list *ScanChain;
|
||||
|
||||
for ( ScanChain = ScanState->STACK;
|
||||
ScanChain != (chain_list *)0;
|
||||
ScanChain = ScanChain->NEXT )
|
||||
{
|
||||
ScanStack = (fsmstack_list *)ScanChain->DATA;
|
||||
|
||||
if ( IsFsmStarStack( ScanStack ) ) continue;
|
||||
|
||||
if ( ScanStack->ABL != (ablexpr *)0 )
|
||||
{
|
||||
fprintf( VhdlFile, " IF ( " );
|
||||
viewablexprfile( VhdlFile, ScanStack->ABL, ABL_VIEW_VHDL );
|
||||
fprintf( VhdlFile, " )\n THEN CONTROL <= %s;\n",
|
||||
FSM_CTRL_NAME[ (long)ScanStack->CTRL ] );
|
||||
|
||||
if ( ScanStack->CTRL == FSM_CTRL_PUSH )
|
||||
{
|
||||
fprintf( VhdlFile, " RETURN_STATE <= %s;\n",
|
||||
vhdlablname( ScanStack->RETURN->NAME ) );
|
||||
}
|
||||
else
|
||||
if ( ScanStack->CTRL == FSM_CTRL_POP )
|
||||
{
|
||||
fprintf( VhdlFile, " NEXT_STATE <= STACK_0;\n" );
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, " END IF;\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VhdlWriteLocout |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VhdlWriteLocout( ScanState )
|
||||
|
||||
fsmstate_list *ScanState;
|
||||
{
|
||||
fsmlocout_list *ScanLocout;
|
||||
|
||||
for ( ScanLocout = ScanState->LOCOUT;
|
||||
ScanLocout != (fsmlocout_list *)0;
|
||||
ScanLocout = ScanLocout->NEXT )
|
||||
{
|
||||
if ( ScanLocout->ABL != (ablexpr *)0 )
|
||||
{
|
||||
fprintf( VhdlFile, " %s <= ", vhdlablname( ScanLocout->OUT->NAME ) );
|
||||
viewablexprfile( VhdlFile, ScanLocout->ABL, ABL_VIEW_VHDL );
|
||||
fprintf( VhdlFile, ";\n" );
|
||||
}
|
||||
|
||||
if ( ScanLocout->ABL_DC != (ablexpr *)0 )
|
||||
{
|
||||
if ( ( ABL_ATOM( ScanLocout->ABL_DC ) ) &&
|
||||
( ABL_ATOM_VALUE( ScanLocout->ABL_DC ) == ABL_ATOM_NAME_ONE ) )
|
||||
{
|
||||
fprintf( VhdlFile, " %s <= 'd';\n",
|
||||
vhdlablname( ScanLocout->OUT->NAME ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf( VhdlFile, " IF ( " );
|
||||
viewablexprfile( VhdlFile, ScanLocout->ABL_DC, ABL_VIEW_VHDL );
|
||||
fprintf( VhdlFile, " )\n" );
|
||||
fprintf( VhdlFile, " THEN %s <= 'd';\n",
|
||||
vhdlablname( ScanLocout->OUT->NAME ) );
|
||||
fprintf( VhdlFile, " END IF;\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VhdlWriteArchitecture |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VhdlWriteArchitecture( FsmFigure )
|
||||
|
||||
fsmfig_list *FsmFigure;
|
||||
{
|
||||
fsmstate_list *ScanState;
|
||||
fsmtrans_list *ScanTrans;
|
||||
fsmtrans_list *NextTrans;
|
||||
fsmin_list *ScanIn;
|
||||
chain_list *ScanChain;
|
||||
chain_list *NextChain;
|
||||
char *Vector;
|
||||
char *LastVector;
|
||||
long NumberState;
|
||||
long Counter;
|
||||
long Index;
|
||||
int FirstOne;
|
||||
|
||||
FsmFigure->STATE = (fsmstate_list *)reverse( (chain_list *)FsmFigure->STATE );
|
||||
|
||||
fprintf( VhdlFile, "ARCHITECTURE FSM OF %s IS\n\n",
|
||||
vhdlablname( FsmFigure->NAME ) );
|
||||
|
||||
fprintf( VhdlFile, "TYPE STATE_TYPE IS\n( " );
|
||||
|
||||
if ( FsmFigure->STAR_STATE != (fsmstate_list *)0 )
|
||||
{
|
||||
NumberState = FsmFigure->NUMBER_STATE - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
NumberState = FsmFigure->NUMBER_STATE;
|
||||
}
|
||||
|
||||
if ( FsmFigure->FIRST_STATE != (fsmstate_list *)0 )
|
||||
{
|
||||
fprintf( VhdlFile, "\n %s", vhdlablname( FsmFigure->FIRST_STATE->NAME ) );
|
||||
|
||||
if ( NumberState > 1 )
|
||||
{
|
||||
fprintf( VhdlFile, "," );
|
||||
}
|
||||
|
||||
Counter = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Counter = 0;
|
||||
}
|
||||
|
||||
for ( ScanState = FsmFigure->STATE;
|
||||
ScanState != (fsmstate_list *)0;
|
||||
ScanState = ScanState->NEXT )
|
||||
{
|
||||
if ( ( IsFsmFirstState( ScanState ) ) ||
|
||||
( IsFsmStarState( ScanState ) ) ) continue;
|
||||
|
||||
Counter = Counter + 1;
|
||||
|
||||
if ( ! ( Counter & 0x7 ) )
|
||||
{
|
||||
fprintf( VhdlFile, "\n %s", vhdlablname( ScanState->NAME ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf( VhdlFile, "%s", vhdlablname( ScanState->NAME ) );
|
||||
}
|
||||
|
||||
if ( Counter < NumberState )
|
||||
{
|
||||
fprintf( VhdlFile, "," );
|
||||
}
|
||||
}
|
||||
|
||||
if ( Counter & 0x7 )
|
||||
{
|
||||
fprintf( VhdlFile, "\n" );
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, ");\n\n" );
|
||||
|
||||
if ( FsmFigure->STACK != (fsmstack_list *)0 )
|
||||
{
|
||||
fprintf( VhdlFile, "TYPE CONTROL_TYPE IS\n(\n" );
|
||||
|
||||
for ( Index = 0; Index < FSM_MAX_CTRL; Index++ )
|
||||
{
|
||||
if ( Index != 0 )
|
||||
{
|
||||
fprintf( VhdlFile, ", " );
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, "%s", FSM_CTRL_NAME[ Index ] );
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, "\n);\n\n" );
|
||||
fprintf( VhdlFile, "SIGNAL CONTROL : CONTROL_TYPE;\n\n" );
|
||||
fprintf( VhdlFile, "SIGNAL RETURN_STATE : STATE_TYPE;\n" );
|
||||
fprintf( VhdlFile, "SIGNAL STACK_0" );
|
||||
|
||||
for ( Index = 1; Index < FsmFigure->STACK_SIZE; Index++ )
|
||||
{
|
||||
fprintf( VhdlFile, ", STACK_%ld", Index );
|
||||
|
||||
if ( ! ( Index & 0x7 ) )
|
||||
{
|
||||
fprintf( VhdlFile, "\n" );
|
||||
}
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, " : STATE_TYPE;\n" );
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, "SIGNAL CURRENT_STATE, NEXT_STATE: STATE_TYPE;\n\n" );
|
||||
|
||||
if ( FsmFigure->FIRST_STATE != (fsmstate_list *)0 )
|
||||
{
|
||||
fprintf( VhdlFile, "--PRAGMA FIRST_STATE %s\n\n",
|
||||
vhdlablname( FsmFigure->FIRST_STATE->NAME ) );
|
||||
}
|
||||
|
||||
if ( FsmFigure->CLOCK != (char *)0 )
|
||||
{
|
||||
fprintf( VhdlFile, "--PRAGMA CLOCK %s\n\n",
|
||||
vhdlablname( FsmFigure->CLOCK ) );
|
||||
}
|
||||
|
||||
if ( IsFsmFigMixedRtl( FsmFigure ) )
|
||||
{
|
||||
vhdlsavefbdecl( (fbfig_list *)FsmFigure->FIGURE, 0 );
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, "BEGIN\n" );
|
||||
|
||||
fprintf( VhdlFile, " PROCESS( CURRENT_STATE" );
|
||||
|
||||
LastVector = (char *)0;
|
||||
|
||||
for ( ScanIn = FsmFigure->IN;
|
||||
ScanIn != (fsmin_list *)0;
|
||||
ScanIn = ScanIn->NEXT )
|
||||
{
|
||||
Vector = vhdlablvector( ScanIn->NAME, &Index );
|
||||
|
||||
if ( Vector == (char *)0 )
|
||||
{
|
||||
fprintf( VhdlFile, ", %s", vhdlablname( ScanIn->NAME ) );
|
||||
LastVector = (char *)0;
|
||||
}
|
||||
else
|
||||
if ( Vector != LastVector )
|
||||
{
|
||||
fprintf( VhdlFile, ", %s", vhdlablname( Vector ) );
|
||||
LastVector = Vector;
|
||||
}
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, ")\n BEGIN\n" );
|
||||
|
||||
Counter = 0;
|
||||
|
||||
if ( FsmFigure->STAR_STATE != (fsmstate_list *)0 )
|
||||
{
|
||||
for ( ScanChain = FsmFigure->STAR_STATE->FROM;
|
||||
ScanChain != (chain_list *)0;
|
||||
ScanChain = ScanChain->NEXT )
|
||||
{
|
||||
ScanTrans = (fsmtrans_list *)ScanChain->DATA;
|
||||
|
||||
if ( ScanTrans->ABL != (ablexpr *)0 )
|
||||
{
|
||||
if ( Counter > 0 ) fprintf( VhdlFile, " ELSE\n" );
|
||||
fprintf( VhdlFile, " IF (( " );
|
||||
viewablexprfile( VhdlFile, ScanTrans->ABL, ABL_VIEW_VHDL );
|
||||
fprintf( VhdlFile, ") = '1')\n THEN NEXT_STATE <= %s;\n",
|
||||
vhdlablname( ScanTrans->TO->NAME ) );
|
||||
|
||||
VhdlWriteLocout( FsmFigure->STAR_STATE );
|
||||
|
||||
Counter = Counter + 1;
|
||||
}
|
||||
}
|
||||
|
||||
while ( Counter > 1 )
|
||||
{
|
||||
fprintf( VhdlFile, " END IF;\n" );
|
||||
Counter = Counter - 1;
|
||||
}
|
||||
/*
|
||||
** Treat STACK in STAR_STATE, seems to be crazy
|
||||
*/
|
||||
}
|
||||
|
||||
if ( Counter > 0 ) fprintf( VhdlFile, " ELSE\n" );
|
||||
fprintf( VhdlFile, " CASE CURRENT_STATE IS\n" );
|
||||
|
||||
for ( ScanState = FsmFigure->STATE;
|
||||
ScanState != (fsmstate_list *)0;
|
||||
ScanState = ScanState->NEXT )
|
||||
{
|
||||
if ( IsFsmStarState( ScanState ) ) continue;
|
||||
|
||||
fprintf( VhdlFile, " WHEN %s =>\n", vhdlablname( ScanState->NAME ) );
|
||||
|
||||
/*
|
||||
** Treat TRANS
|
||||
*/
|
||||
FirstOne = 1;
|
||||
|
||||
for ( ScanChain = ScanState->FROM;
|
||||
ScanChain != (chain_list *)0;
|
||||
ScanChain = ScanChain->NEXT )
|
||||
{
|
||||
ScanTrans = (fsmtrans_list *)ScanChain->DATA;
|
||||
|
||||
if ( IsFsmStarTrans( ScanTrans ) ) continue;
|
||||
|
||||
for ( NextChain = ScanChain->NEXT;
|
||||
NextChain != (chain_list *)0;
|
||||
NextChain = NextChain->NEXT )
|
||||
{
|
||||
NextTrans = (fsmtrans_list *)ScanChain->DATA;
|
||||
if ( ! IsFsmStarTrans( NextTrans ) ) break;
|
||||
}
|
||||
|
||||
if ( ScanTrans->ABL != (ablexpr *)0 )
|
||||
{
|
||||
if ( FirstOne )
|
||||
{
|
||||
fprintf( VhdlFile, " IF (( " );
|
||||
viewablexprfile( VhdlFile, ScanTrans->ABL, ABL_VIEW_VHDL );
|
||||
fprintf( VhdlFile, ") = '1')\n THEN" );
|
||||
FirstOne = 0;
|
||||
}
|
||||
else
|
||||
if ( NextChain != (chain_list *)0 )
|
||||
{
|
||||
fprintf( VhdlFile, " ELSIF (( " );
|
||||
viewablexprfile( VhdlFile, ScanTrans->ABL, ABL_VIEW_VHDL );
|
||||
fprintf( VhdlFile, ") = '1')\n THEN" );
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf( VhdlFile, " ELSE" );
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, " NEXT_STATE <= %s;\n", vhdlablname( ScanTrans->TO->NAME ) );
|
||||
|
||||
if ( NextChain == (chain_list *)0 )
|
||||
{
|
||||
fprintf( VhdlFile, " END IF;\n" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VhdlWriteStack( ScanState );
|
||||
VhdlWriteLocout( ScanState );
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, " END CASE;\n" );
|
||||
if ( Counter > 0 ) fprintf( VhdlFile, " END IF;\n" );
|
||||
|
||||
fprintf( VhdlFile, " END PROCESS;\n\n" );
|
||||
|
||||
fprintf( VhdlFile, " PROCESS( %s )\n", FsmFigure->CLOCK );
|
||||
fprintf( VhdlFile, " BEGIN\n" );
|
||||
|
||||
fprintf( VhdlFile, " IF ( " );
|
||||
viewablexprfile( VhdlFile, FsmFigure->CLOCK_ABL, ABL_VIEW_VHDL );
|
||||
fprintf( VhdlFile, " )\n THEN CURRENT_STATE <= NEXT_STATE;\n" );
|
||||
|
||||
if ( FsmFigure->STACK != (fsmstack_list *)0 )
|
||||
{
|
||||
fprintf( VhdlFile, " CASE CONTROL IS\n" );
|
||||
|
||||
for ( Index = 0; Index < FSM_MAX_CTRL; Index++ )
|
||||
{
|
||||
fprintf( VhdlFile, " WHEN %s =>\n",
|
||||
FSM_CTRL_NAME[ Index ] );
|
||||
|
||||
if ( Index == FSM_CTRL_POP )
|
||||
{
|
||||
for ( Counter = 1; Counter < FsmFigure->STACK_SIZE; Counter++ )
|
||||
{
|
||||
fprintf( VhdlFile, " STACK_%ld <= STACK_%ld;\n",
|
||||
Counter - 1, Counter );
|
||||
}
|
||||
|
||||
if ( Counter == 1 )
|
||||
{
|
||||
fprintf( VhdlFile, " NULL;\n" );
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( Index == FSM_CTRL_PUSH )
|
||||
{
|
||||
fprintf( VhdlFile, " STACK_0 <= RETURN_STATE;\n" );
|
||||
|
||||
for ( Counter = 1; Counter < FsmFigure->STACK_SIZE; Counter++ )
|
||||
{
|
||||
fprintf( VhdlFile, " STACK_%ld <= STACK_%ld;\n",
|
||||
Counter, Counter - 1 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf( VhdlFile, " NULL;\n" );
|
||||
}
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, " END CASE;\n" );
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, " END IF;\n" );
|
||||
|
||||
fprintf( VhdlFile, " END PROCESS;\n" );
|
||||
|
||||
if ( IsFsmFigMixedRtl( FsmFigure ) )
|
||||
{
|
||||
vhdlsavefbarchi( (fbfig_list *)FsmFigure->FIGURE, 0 );
|
||||
}
|
||||
|
||||
fprintf( VhdlFile, "END;\n" );
|
||||
|
||||
FsmFigure->STATE = (fsmstate_list *)reverse( (chain_list *)FsmFigure->STATE );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| vhdlsavefsmfig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void vhdlsavefsmfig( FsmFigure )
|
||||
|
||||
fsmfig_list *FsmFigure;
|
||||
{
|
||||
VhdlFile = mbkfopen( FsmFigure->NAME, "fsm", "w" );
|
||||
FblDriveFile = VhdlFile;
|
||||
|
||||
if ( VhdlFile == (FILE *)0 )
|
||||
{
|
||||
fvherror( FVH_ERROR_OPEN_FILE, FsmFigure->NAME, 0 );
|
||||
}
|
||||
|
||||
VhdlWriteHeader( FsmFigure );
|
||||
VhdlWriteEntity( FsmFigure );
|
||||
VhdlWriteArchitecture( FsmFigure );
|
||||
|
||||
fclose( VhdlFile );
|
||||
}
|
|
@ -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 : FVH |
|
||||
| |
|
||||
| File : fksdrive.c |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 04.12.96 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef FVH_DRIVE_H
|
||||
# define FVH_DRIVE_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# endif
|
|
@ -0,0 +1,211 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : FVH |
|
||||
| |
|
||||
| File : fvherror.c |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 04.12.96 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "bdd.h"
|
||||
# include "fsm.h"
|
||||
|
||||
# include "fvherror.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void fvh_error( Error, Text, Value, File, Line )
|
||||
|
||||
char Error;
|
||||
char *Text;
|
||||
long Value;
|
||||
char *File;
|
||||
long Line;
|
||||
{
|
||||
char *Name;
|
||||
|
||||
Name = mbkstrdup( File );
|
||||
Name[ strlen( File ) - 1 ] = '\0';
|
||||
|
||||
fprintf( stderr, "%s%ld ", Name, Line );
|
||||
|
||||
switch( Error )
|
||||
{
|
||||
case FVH_ERROR_OPEN_FILE :
|
||||
fprintf( stderr, "Unable to open file \"%s\"\n", Text );
|
||||
break;
|
||||
case FVH_ERROR_PARSE_FILE :
|
||||
fprintf( stderr, "Unable to parse file \"%s\"\n", Text );
|
||||
break;
|
||||
case FVH_ERROR_SIGNAL_NOT_FOUND :
|
||||
fprintf( stderr, "Signal \"%s\" not found line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_ILLEGAL_DEFAULT_ASSIGN :
|
||||
fprintf( stderr, "Illegal default output assignation\n" );
|
||||
break;
|
||||
case FVH_ERROR_NO_STATE :
|
||||
fprintf( stderr, "Number of state is zero in \"%s\"\n", Text );
|
||||
break;
|
||||
case FVH_ERROR_CONTROL_TYPE :
|
||||
fprintf( stderr, "Bad control type size in \"%s\" line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_ILLEGAL_CASE :
|
||||
fprintf( stderr, "Illegal case condition, type \"%s\" line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_ILLEGAL_STATE :
|
||||
fprintf( stderr, "Illegal state name \"%s\" in case condition line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_ILLEGAL_CONTROL :
|
||||
fprintf( stderr, "Illegal control name \"%s\" in case condition line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_ILLEGAL_INSTRUCTION :
|
||||
fprintf( stderr, "Illegal instruction type %ld\n", (long)Text );
|
||||
break;
|
||||
case FVH_ERROR_ILLEGAL_STATE_ASSIGN :
|
||||
fprintf( stderr, "Illegal state name \"%s\" in assignation line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_ILLEGAL_STACK_ASSIGN :
|
||||
fprintf( stderr, "Illegal stack name \"%s\" in assignation line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_ILLEGAL_CONTROL_ASSIGN :
|
||||
fprintf( stderr, "Illegal control name \"%s\" in assignation line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_ILLEGAL_ASSIGNATION :
|
||||
fprintf( stderr, "Illegal use of \"%s\" in main process line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_MAIN_PROCESS :
|
||||
fprintf( stderr, "Illegal figure \"%s\" missing main process\n", Text );
|
||||
break;
|
||||
case FVH_ERROR_CLOCK_PROCESS :
|
||||
fprintf( stderr, "Illegal figure \"%s\" missing clock process\n", Text );
|
||||
break;
|
||||
case FVH_ERROR_PROCESS_SENSITIVITY :
|
||||
fprintf( stderr, "Illegal sensitivity list in the process \"%s\"\n", Text );
|
||||
break;
|
||||
case FVH_ERROR_MISSING_SIGNAL :
|
||||
fprintf( stderr, "\"%s\" must be in the sensitivity list line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_IN_MAIN_PROCESS :
|
||||
fprintf( stderr, "Illegal use of \"%s\" in main process line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_IN_CLOCK_PROCESS :
|
||||
fprintf( stderr, "Illegal use of \"%s\" in clock process line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_ILLEGAL_OUT_ASSIGN :
|
||||
fprintf( stderr, "Illegal output \"%s\" assignation line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_MISSING_CLOCK_PORT :
|
||||
fprintf( stderr, "Missing clock declaration in figure \"%s\"\n", Text );
|
||||
break;
|
||||
case FVH_ERROR_STACK_SIZE_ZERO :
|
||||
fprintf( stderr, "Size of stack is zero in \"%s\"\n", Text );
|
||||
break;
|
||||
case FVH_ERROR_MISSING_STACK_CONTROL :
|
||||
fprintf( stderr, "Missing stack control in figure \"%s\" line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_MISSING_STATE_CONTROL :
|
||||
fprintf( stderr, "Missing state control in figure \"%s\"\n", Text );
|
||||
break;
|
||||
case FVH_ERROR_NO_CONTROL_CONDITION :
|
||||
fprintf( stderr, "Missing control condition in figure \"%s\" line %ld\n", Text, Value );
|
||||
break;
|
||||
case FVH_ERROR_BAD_STACK_CONTROL :
|
||||
fprintf( stderr, "Bad stack control in figure \"%s\"\n", Text );
|
||||
break;
|
||||
case FVH_ERROR_ILLEGAL_IF_CONDITION :
|
||||
fprintf( stderr, "Illegal IF condition line %ld\n", Value );
|
||||
break;
|
||||
case FVH_ERROR_TWO_PROCESS :
|
||||
fprintf( stderr, "Should have two process in figure \"%s\"\n", Text );
|
||||
break;
|
||||
case FVH_ERROR_ILLEGAL_PROCESS_BODY :
|
||||
fprintf( stderr, "Illegal body structure for process \"%s\" line %ld\n", Text, Value );
|
||||
break;
|
||||
default :
|
||||
fprintf( stderr, "Internal error number %d\n", Error );
|
||||
}
|
||||
|
||||
autexit( 1 );
|
||||
}
|
||||
|
||||
void fvh_warning( Warning, Text, Value, File, Line )
|
||||
|
||||
char Warning;
|
||||
char *Text;
|
||||
long Value;
|
||||
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, "Internal warning number %d\n", Warning );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : FVH |
|
||||
| |
|
||||
| File : fvherror.c |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 04.12.96 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef FVH_ERROR_H
|
||||
# define FVH_ERROR_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define FVH_ERROR_OPEN_FILE 1
|
||||
# define FVH_ERROR_PARSE_FILE 2
|
||||
# define FVH_ERROR_SIGNAL_NOT_FOUND 3
|
||||
# define FVH_ERROR_ILLEGAL_DEFAULT_ASSIGN 4
|
||||
# define FVH_ERROR_NO_STATE 5
|
||||
# define FVH_ERROR_CONTROL_TYPE 6
|
||||
# define FVH_ERROR_ILLEGAL_CASE 7
|
||||
# define FVH_ERROR_ILLEGAL_STATE 8
|
||||
# define FVH_ERROR_ILLEGAL_CONTROL 9
|
||||
# define FVH_ERROR_ILLEGAL_INSTRUCTION 10
|
||||
# define FVH_ERROR_ILLEGAL_STATE_ASSIGN 11
|
||||
# define FVH_ERROR_ILLEGAL_STACK_ASSIGN 12
|
||||
# define FVH_ERROR_ILLEGAL_CONTROL_ASSIGN 13
|
||||
# define FVH_ERROR_ILLEGAL_ASSIGNATION 14
|
||||
# define FVH_ERROR_MAIN_PROCESS 15
|
||||
# define FVH_ERROR_PROCESS_SENSITIVITY 16
|
||||
# define FVH_ERROR_IN_MAIN_PROCESS 17
|
||||
# define FVH_ERROR_IN_CLOCK_PROCESS 18
|
||||
# define FVH_ERROR_ILLEGAL_OUT_ASSIGN 19
|
||||
# define FVH_ERROR_MISSING_CLOCK_PORT 22
|
||||
# define FVH_ERROR_STACK_SIZE_ZERO 23
|
||||
# define FVH_ERROR_MISSING_STACK_CONTROL 24
|
||||
# define FVH_ERROR_MISSING_STATE_CONTROL 25
|
||||
# define FVH_ERROR_NO_CONTROL_CONDITION 26
|
||||
# define FVH_ERROR_BAD_STACK_CONTROL 27
|
||||
# define FVH_ERROR_ILLEGAL_IF_CONDITION 28
|
||||
# define FVH_ERROR_TWO_PROCESS 29
|
||||
# define FVH_ERROR_CLOCK_PROCESS 30
|
||||
# define FVH_ERROR_MISSING_SIGNAL 31
|
||||
# define FVH_ERROR_ILLEGAL_PROCESS_BODY 32
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Warnings |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define fvherror( E, T, V ) (fvh_error((int)(E),(char *)(T),(long)(V),__FILE__,__LINE__))
|
||||
# define fvhwarning( E, T, V ) (fvh_warning((int)(E),(char *)(T),(long)(V),__FILE__,__LINE__))
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void fvh_error __P((char Error, char *Text, long Value, char *File, long Line));
|
||||
extern void fvh_warning __P((char Warning, char *Text, long Value, char *File, long Line));
|
||||
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,83 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : FVH |
|
||||
| |
|
||||
| File : fvhfbh2fsm.h |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 04.12.96 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef FVH_FBH2FSM_H
|
||||
# define FVH_FBH2FSM_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern fsmfig_list * FvhFbh2Fsm __P((fbfig_list *FbhFigure, fsmfig_list *FsmFigure));
|
||||
|
||||
extern void FvhFbhTreatInstruction __P((fbfig_list *FbhFigure, fsmfig_list *FsmFigure, ptype_list *Instruct, fsmstate_list *StateFrom, fsmstate_list *StateTo, fsmstate_list *Return, int Control, ablexpr *Equation));
|
||||
extern void FvhFbhTreatWhen __P((fbfig_list *FbhFigure, fsmfig_list *FsmFigure, fbcas_list *ScanCase, fsmstate_list **PStateFrom, fsmstate_list *StateTo, fsmstate_list *Return, int *PControl, ablexpr *Equation));
|
||||
extern void FvhFbhTreatIf __P((fbfig_list *FbhFigure, fsmfig_list *FsmFigure, fbifs_list *ScanIfs, fsmstate_list *StateFrom, fsmstate_list *StateTo, fsmstate_list *Return, int Control, ablexpr *Equation));
|
||||
extern void FvhFbhTreatAsg __P((fbfig_list *FbhFigure, fsmfig_list *FsmFigure, fbasg_list *ScanAsg, fsmstate_list **PStateFrom, fsmstate_list **PStateTo, fsmstate_list **PReturn, int *PControl, ablexpr *Equation));
|
||||
|
||||
# endif
|
|
@ -0,0 +1,145 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : FVH |
|
||||
| |
|
||||
| File : fvhparse.c |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 04.12.96 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "bdd.h"
|
||||
# include "fsm.h"
|
||||
# include "fvh.h"
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include "fvherror.h"
|
||||
# include "fvhfbh2fsm.h"
|
||||
# include "fvhparse.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern FILE *fbl_y_in;
|
||||
extern char FBL_ERRFLG;
|
||||
|
||||
bddcircuit *FblBddCircuit = (bddcircuit *)0;
|
||||
bddsystem *FblBddSystem = (bddsystem *)0;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| vhdlloadfsmfig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void loc_trap_signal()
|
||||
{
|
||||
fprintf( stderr, "fvh: Internal error !\n" );
|
||||
autexit( 1 );
|
||||
}
|
||||
|
||||
void vhdlloadfsmfig( FsmFigure, FigureName )
|
||||
|
||||
fsmfig_list *FsmFigure;
|
||||
char *FigureName;
|
||||
{
|
||||
bddsystem *SaveBddSystem;
|
||||
bddcircuit *SaveBddCircuit;
|
||||
int Error;
|
||||
void (*PreviousHandler)();
|
||||
|
||||
fbl_y_in = mbkfopen( FigureName, "fsm", "r" );
|
||||
|
||||
if ( fbl_y_in == (FILE *)0 )
|
||||
{
|
||||
fvherror( FVH_ERROR_OPEN_FILE, FigureName, 0 );
|
||||
}
|
||||
|
||||
SaveBddSystem = BddLocalSystem;
|
||||
SaveBddCircuit = BddLocalCircuit;
|
||||
|
||||
if ( FblBddSystem == (bddsystem *)0 )
|
||||
{
|
||||
FblBddSystem = createbddsystem( 50, 1000, 200, 50000000 );
|
||||
FblBddCircuit = createbddcircuit( "-select-", 200, 0, FblBddSystem );
|
||||
}
|
||||
|
||||
BddLocalSystem = FblBddSystem;
|
||||
BddLocalCircuit = FblBddCircuit;
|
||||
|
||||
PreviousHandler = signal( SIGSEGV, loc_trap_signal );
|
||||
Error = fbl_y_parse();
|
||||
signal( SIGSEGV, PreviousHandler );
|
||||
|
||||
BddLocalSystem = SaveBddSystem;
|
||||
BddLocalCircuit = SaveBddCircuit;
|
||||
|
||||
if ( ( Error ) ||
|
||||
( FBL_ERRFLG ) )
|
||||
{
|
||||
fvherror( FVH_ERROR_PARSE_FILE, FigureName, 0 );
|
||||
}
|
||||
|
||||
FvhFbh2Fsm( FBL_HEADFIG, FsmFigure );
|
||||
|
||||
if ( ! IsFsmFigMixedRtl( FsmFigure ) )
|
||||
{
|
||||
fbh_delfbfig( FBL_HEADFIG, FBL_HEADFIG, 'Y' );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 : FVH |
|
||||
| |
|
||||
| File : fksparse.c |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 04.12.96 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef FVH_PARSE_H
|
||||
# define FVH_PARSE_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern int fbl_y_nerrs;int fbl_y_parse __P(());
|
||||
|
||||
# endif
|
Loading…
Reference in New Issue