This commit is contained in:
parent
571d8fabd9
commit
ce3b048f56
|
@ -1,11 +1 @@
|
|||
lib_LIBRARIES = libAbv.a
|
||||
libAbv_a_SOURCES = bvl_bcomp.y bvl_bcomp.l \
|
||||
abv.h bvl_bspec.c bvl_drive.c bvl_parse.h bvl_util.h \
|
||||
bvl_bedef.h bvl_bspec.h bvl_drive.h bvl_utdef.h bvl_utype.h \
|
||||
bvl_blex.h bvl_byacc.h bvl_parse.c bvl_util.c
|
||||
CLEANFILES = bvl_bcompyac.c bvl_bcompyac.h bvl_bcomplex.c
|
||||
|
||||
bvl_bcompyac.c bvl_bcompyac.h : $(srcdir)/bvl_bcomp.y
|
||||
$(YACC) -d $(YFLAGS) $(srcdir)/bvl_bcomp.y && sed -e "s/yy/bvl_y_/g" -e "s/YY/BVL_Y_/g" y.tab.c > bvl_bcompyac.c && sed -e "s/yy/bvl_y_/g" -e "s/YY/BVL_Y_/g" y.tab.h > bvl_bcompyac.h
|
||||
bvl_bcomplex.c : $(srcdir)/bvl_bcomp.l bvl_bcompyac.h
|
||||
$(LEX) -t $(srcdir)/bvl_bcomp.l | sed -e "s/yy/bvl_y_/g" -e "s/YY/BVL_Y_/g" > bvl_bcomplex.c
|
||||
SUBDIRS = src
|
||||
|
|
|
@ -1,51 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : abv201.h */
|
||||
/* date : Feb 10 1995 */
|
||||
/* version : v201 */
|
||||
/* contents : defines and structure definitions used in BVL library */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#ifndef ABV_BVLDEF
|
||||
#define ABV_BVLDEF
|
||||
|
||||
#define ABV_TRACE_MASK 0x00000001 /* print messages when parsing */
|
||||
#define ABV_KEEP_AUX_MASK 0x00000002 /* keep internal signals */
|
||||
#define ABV_SYNTH_MASK 0x00000004 /* special mode for synthesis */
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* functions */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
extern struct befig *vhdlloadbefig ();
|
||||
extern void vhdlsavebefig ();
|
||||
|
||||
#endif
|
|
@ -1,383 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
%{
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include "mut.h"
|
||||
#include "abl.h"
|
||||
#include "abe.h"
|
||||
|
||||
typedef struct bvl_expr
|
||||
{
|
||||
char *IDENT; /* identifier or constant name */
|
||||
struct chain *LIST_ABL; /* pointer on bvl_abllst list */
|
||||
short WIDTH; /* width of bit vector */
|
||||
}
|
||||
bvl_ablstr;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *NAME; /* identifier name */
|
||||
short LEFT; /* vector's left index */
|
||||
short RIGHT; /* vector's right index */
|
||||
char FLAG;
|
||||
}
|
||||
bvl_name;
|
||||
|
||||
struct g_type
|
||||
{
|
||||
int VALU;
|
||||
char FLAG;
|
||||
};
|
||||
|
||||
#include "bvl_bcompyac.h"
|
||||
#include "bvl_blex.h"
|
||||
|
||||
%}
|
||||
|
||||
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)
|
||||
|
||||
%%
|
||||
\n {
|
||||
/*printf ("Newline\n");*/
|
||||
BVL_LINNUM++;
|
||||
}
|
||||
[ \t] {
|
||||
/*printf ("space\n");*/
|
||||
}
|
||||
\& {
|
||||
/*printf ("Ampersand\n");*/
|
||||
return(Ampersand);
|
||||
}
|
||||
\' {
|
||||
/*printf ("Apostrophe\n");*/
|
||||
return(Apostrophe);
|
||||
}
|
||||
\( {
|
||||
/*printf ("LeftParen\n");*/
|
||||
return(LeftParen);
|
||||
}
|
||||
\) {
|
||||
/*printf ("RightParen\n");*/
|
||||
return(RightParen);
|
||||
}
|
||||
"**" {
|
||||
/*printf ("DoubleStar\n");*/
|
||||
return(DoubleStar);
|
||||
}
|
||||
\* {
|
||||
/*printf ("Star\n");*/
|
||||
return(Star);
|
||||
}
|
||||
\+ {
|
||||
/*printf ("Plus\n");*/
|
||||
return(Plus);
|
||||
}
|
||||
\, {
|
||||
/*printf ("Comma\n");*/
|
||||
return(Comma);
|
||||
}
|
||||
\- {
|
||||
/*printf ("Minus\n");*/
|
||||
return(Minus);
|
||||
}
|
||||
":=" {
|
||||
/*printf ("VarAsgn\n");*/
|
||||
return(VarAsgn);
|
||||
}
|
||||
\: {
|
||||
/*printf ("Colon\n");*/
|
||||
return(Colon);
|
||||
}
|
||||
\; {
|
||||
/*printf ("Semicolon\n");*/
|
||||
return(Semicolon);
|
||||
}
|
||||
"<=" {
|
||||
/*printf ("_LESym\n");*/
|
||||
return(_LESym);
|
||||
}
|
||||
">=" {
|
||||
/*printf ("_GESym\n");*/
|
||||
return(_GESym);
|
||||
}
|
||||
\< {
|
||||
/*printf ("_LTSym\n");*/
|
||||
return(_LTSym);
|
||||
}
|
||||
\> {
|
||||
/*printf ("_GTSym\n");*/
|
||||
return(_GTSym);
|
||||
}
|
||||
= {
|
||||
/*printf ("_EQSym\n");*/
|
||||
return(_EQSym);
|
||||
}
|
||||
\/= {
|
||||
/*printf ("_NESym\n");*/
|
||||
return(_NESym);
|
||||
}
|
||||
"=>" {
|
||||
/*printf ("Arrow\n");*/
|
||||
return(Arrow);
|
||||
}
|
||||
"<>" {
|
||||
/*printf ("Box\n");*/
|
||||
return(Box);
|
||||
}
|
||||
\| {
|
||||
/*printf ("Bar\n");*/
|
||||
return(Bar);
|
||||
}
|
||||
! {
|
||||
/*printf ("Bar\n");*/
|
||||
return(Bar);
|
||||
}
|
||||
\. {
|
||||
/*printf ("Dot\n");*/
|
||||
return(Dot);
|
||||
}
|
||||
\/ {
|
||||
/*printf ("Slash\n");*/
|
||||
return(Slash);
|
||||
}
|
||||
|
||||
{letter}(_?{letter_or_digit})* {
|
||||
int itoken;
|
||||
|
||||
itoken = search (yytext);
|
||||
if (itoken == EMPTYHT)
|
||||
{
|
||||
yylval.text = namealloc (yytext);
|
||||
/*printf ("Identifier : %s\n", yytext);*/
|
||||
return (Identifier);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*printf ("Key word : %s\n", yytext);*/
|
||||
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);
|
||||
}
|
||||
|
||||
\-\-{space_character}*[pP][rR][aA][gG][mM][aA].*$ {
|
||||
yylval.text = namealloc(yytext); return( PRAGMA );
|
||||
}
|
||||
|
||||
\-\-.*$
|
||||
{
|
||||
}
|
||||
|
||||
. {
|
||||
return (*yytext);
|
||||
}
|
||||
%%
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : yywrap */
|
||||
/* description : return 1 */
|
||||
/* called func. : none */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
int yywrap ()
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : search */
|
||||
/* description : check that an identifier is a reserved word or not */
|
||||
/* called func. : addht, addhtitem, gethtitem, namealloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
static int search (key)
|
||||
|
||||
char *key;
|
||||
|
||||
{
|
||||
static ht *pt_hash = NULL;
|
||||
|
||||
if (pt_hash == NULL)
|
||||
{
|
||||
pt_hash = addht (107);
|
||||
|
||||
addhtitem (pt_hash, namealloc("abs") , ABS );
|
||||
addhtitem (pt_hash, namealloc("access") , ACCESS );
|
||||
addhtitem (pt_hash, namealloc("after") , AFTER );
|
||||
addhtitem (pt_hash, namealloc("alias") , ALIAS );
|
||||
addhtitem (pt_hash, namealloc("all") , ALL );
|
||||
addhtitem (pt_hash, namealloc("and") , _AND );
|
||||
addhtitem (pt_hash, namealloc("architecture") , ARCHITECTURE );
|
||||
addhtitem (pt_hash, namealloc("array") , ARRAY );
|
||||
addhtitem (pt_hash, namealloc("assert") , ASSERT );
|
||||
addhtitem (pt_hash, namealloc("attribute") , ATTRIBUTE );
|
||||
|
||||
addhtitem (pt_hash, namealloc("begin") , _BEGIN );
|
||||
addhtitem (pt_hash, namealloc("bit") , BIT );
|
||||
addhtitem (pt_hash, namealloc("bit_vector") , BIT_VECTOR );
|
||||
addhtitem (pt_hash, namealloc("block") , _BLOCK );
|
||||
addhtitem (pt_hash, namealloc("body") , BODY );
|
||||
addhtitem (pt_hash, namealloc("buffer") , BUFFER );
|
||||
addhtitem (pt_hash, namealloc("bus") , BUS );
|
||||
|
||||
addhtitem (pt_hash, namealloc("case") , CASE );
|
||||
addhtitem (pt_hash, namealloc("component") , COMPONENT );
|
||||
addhtitem (pt_hash, namealloc("configuration"), CONFIGURATION);
|
||||
addhtitem (pt_hash, namealloc("constant") , CONSTANT );
|
||||
|
||||
addhtitem (pt_hash, namealloc("disconnect") , DISCONNECT );
|
||||
addhtitem (pt_hash, namealloc("downto") , DOWNTO );
|
||||
|
||||
addhtitem (pt_hash, namealloc("else") , ELSE );
|
||||
addhtitem (pt_hash, namealloc("elsif") , ELSIF );
|
||||
addhtitem (pt_hash, namealloc("end") , _END );
|
||||
addhtitem (pt_hash, namealloc("entity") , ENTITY );
|
||||
addhtitem (pt_hash, namealloc("error") , ERROR );
|
||||
addhtitem (pt_hash, namealloc("exit") , _EXIT );
|
||||
|
||||
addhtitem (pt_hash, namealloc("file") , _FILE );
|
||||
addhtitem (pt_hash, namealloc("for") , FOR );
|
||||
addhtitem (pt_hash, namealloc("function") , FUNCTION );
|
||||
|
||||
addhtitem (pt_hash, namealloc("generate") , GENERATE );
|
||||
addhtitem (pt_hash, namealloc("generic") , GENERIC );
|
||||
addhtitem (pt_hash, namealloc("guarded") , GUARDED );
|
||||
|
||||
addhtitem (pt_hash, namealloc("if") , IF );
|
||||
addhtitem (pt_hash, namealloc("in") , _IN );
|
||||
addhtitem (pt_hash, namealloc("inout") , _INOUT );
|
||||
addhtitem (pt_hash, namealloc("is") , IS );
|
||||
|
||||
addhtitem (pt_hash, namealloc("label") , _LABEL );
|
||||
addhtitem (pt_hash, namealloc("library") , LIBRARY );
|
||||
addhtitem (pt_hash, namealloc("linkage") , _LINKAGE );
|
||||
addhtitem (pt_hash, namealloc("loop") , LOOP );
|
||||
|
||||
addhtitem (pt_hash, namealloc("map") , MAP );
|
||||
addhtitem (pt_hash, namealloc("mod") , MOD );
|
||||
addhtitem (pt_hash, namealloc("ms") , _MS );
|
||||
addhtitem (pt_hash, namealloc("mux_bit") , MUX_BIT );
|
||||
addhtitem (pt_hash, namealloc("mux_vector") , MUX_VECTOR );
|
||||
|
||||
addhtitem (pt_hash, namealloc("nand") , _NAND );
|
||||
addhtitem (pt_hash, namealloc("natural") , NATURAL );
|
||||
addhtitem (pt_hash, namealloc("new") , NEW );
|
||||
addhtitem (pt_hash, namealloc("next") , _NEXT );
|
||||
addhtitem (pt_hash, namealloc("nor") , _NOR );
|
||||
addhtitem (pt_hash, namealloc("not") , _NOT );
|
||||
addhtitem (pt_hash, namealloc("ns") , _NS );
|
||||
addhtitem (pt_hash, namealloc("null") , _NULL );
|
||||
|
||||
addhtitem (pt_hash, namealloc("of") , OF );
|
||||
addhtitem (pt_hash, namealloc("on") , ON );
|
||||
addhtitem (pt_hash, namealloc("open") , OPEN );
|
||||
addhtitem (pt_hash, namealloc("or") , _OR );
|
||||
addhtitem (pt_hash, namealloc("others") , OTHERS );
|
||||
addhtitem (pt_hash, namealloc("out") , _OUT );
|
||||
|
||||
addhtitem (pt_hash, namealloc("package") , PACKAGE );
|
||||
addhtitem (pt_hash, namealloc("port") , PORT );
|
||||
addhtitem (pt_hash, namealloc("procedure") , PROCEDURE );
|
||||
addhtitem (pt_hash, namealloc("process") , PROCESS );
|
||||
addhtitem (pt_hash, namealloc("ps") , _PS );
|
||||
|
||||
addhtitem (pt_hash, namealloc("range") , RANGE );
|
||||
addhtitem (pt_hash, namealloc("record") , RECORD );
|
||||
addhtitem (pt_hash, namealloc("reg_bit") , REG_BIT );
|
||||
addhtitem (pt_hash, namealloc("reg_vector") , REG_VECTOR );
|
||||
addhtitem (pt_hash, namealloc("register") , REGISTER );
|
||||
addhtitem (pt_hash, namealloc("rem") , REM );
|
||||
addhtitem (pt_hash, namealloc("report") , REPORT );
|
||||
addhtitem (pt_hash, namealloc("return") , RETURN );
|
||||
|
||||
addhtitem (pt_hash, namealloc("select") , SELECT );
|
||||
addhtitem (pt_hash, namealloc("severity") , SEVERITY );
|
||||
addhtitem (pt_hash, namealloc("signal") , SIGNAL );
|
||||
addhtitem (pt_hash, namealloc("stable") , _STABLE );
|
||||
addhtitem (pt_hash, namealloc("subtype") , SUBTYPE );
|
||||
|
||||
addhtitem (pt_hash, namealloc("then") , THEN );
|
||||
addhtitem (pt_hash, namealloc("to") , TO );
|
||||
addhtitem (pt_hash, namealloc("transport") , TRANSPORT );
|
||||
addhtitem (pt_hash, namealloc("type") , _TYPE );
|
||||
|
||||
addhtitem (pt_hash, namealloc("units") , UNITS );
|
||||
addhtitem (pt_hash, namealloc("until") , UNTIL );
|
||||
addhtitem (pt_hash, namealloc("us") , _US );
|
||||
addhtitem (pt_hash, namealloc("use") , USE );
|
||||
|
||||
addhtitem (pt_hash, namealloc("variable") , VARIABLE );
|
||||
|
||||
addhtitem (pt_hash, namealloc("wait") , WAIT );
|
||||
addhtitem (pt_hash, namealloc("warning") , WARNING );
|
||||
addhtitem (pt_hash, namealloc("when") , WHEN );
|
||||
addhtitem (pt_hash, namealloc("while") , WHILE );
|
||||
addhtitem (pt_hash, namealloc("with") , WITH );
|
||||
addhtitem (pt_hash, namealloc("wor_bit") , WOR_BIT );
|
||||
addhtitem (pt_hash, namealloc("wor_vector") , WOR_VECTOR );
|
||||
|
||||
addhtitem (pt_hash, namealloc("xor") , _XOR );
|
||||
}
|
||||
|
||||
return (gethtitem (pt_hash, namealloc(key)));
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,84 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : bvl_bedef.h */
|
||||
/* date : Jan 18 1993 */
|
||||
/* version : v106 */
|
||||
/* author : P.BAZARGAN, L.A.TABUSSE, VUONG H.N. */
|
||||
/* content : declaration of define used by yacc */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#define BVL_ICNDFN 1 /* input port */
|
||||
#define BVL_OCNDFN 2 /* output port */
|
||||
#define BVL_BCNDFN 3 /* inout port */
|
||||
#define BVL_CSTDFN 4 /* constant */
|
||||
|
||||
#define BVL_BITDFN 8 /* bit type */
|
||||
#define BVL_MUXDFN 16 /* mux_bit type */
|
||||
#define BVL_WORDFN 24 /* wor_bit type */
|
||||
#define BVL_RBIDFN 32 /* reg_bit type */
|
||||
#define BVL_BTVDFN 40 /* bit_vector type */
|
||||
#define BVL_MXVDFN 48 /* mux_vector type */
|
||||
#define BVL_WRVDFN 56 /* wor_vector type */
|
||||
#define BVL_RGVDFN 64 /* reg_vector type */
|
||||
#define BVL_NATDFN 88 /* natural type */
|
||||
#define BVL_NTVDFN 96 /* nat_vector type */
|
||||
|
||||
#define BVL_NORDFN 128 /* non guarded signal */
|
||||
#define BVL_BUSDFN 256 /* guarded signal (bus) */
|
||||
#define BVL_REGDFN 384 /* guarded signal (register)*/
|
||||
|
||||
#define BVL_MODDFN 0 /* field # 0 of dictionnary */
|
||||
#define BVL_SIGDFN 1 /* field # 1 of dictionnary */
|
||||
#define BVL_STBDFN 3 /* field # 3 of dictionnary */
|
||||
#define BVL_LBLDFN 4 /* field # 4 of dictionnary */
|
||||
#define BVL_WMXDFN 5 /* field # 5 of dictionnary */
|
||||
#define BVL_WMNDFN 6 /* field # 6 of dictionnary */
|
||||
#define BVL_PNTDFN 7 /* field # 7 of dictionnary */
|
||||
|
||||
#define BVL_UPTDFN 1 /* direction is up */
|
||||
#define BVL_DWTDFN 0 /* direction is down */
|
||||
|
||||
/* ###---------------------------------------------------------------### */
|
||||
|
||||
#define NE 9
|
||||
#define EQ 10
|
||||
#define NOPI 11
|
||||
#define NOPS 12
|
||||
#define ANDM 13
|
||||
#define CONC 14
|
||||
#define CONVRT 15
|
||||
|
||||
#define BVL_UNGDFN 0
|
||||
#define BVL_GRDDFN 1
|
||||
|
||||
/* ###---------------------------------------------------------------### */
|
||||
|
||||
/* #define BVL_INTDFN 0 */ /* int_val field of dtc_recrd */
|
|
@ -1,40 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : bvl_blex.h */
|
||||
/* date : Oct 4 1992 */
|
||||
/* version : v108 */
|
||||
/* author : TABUSSE L.A. */
|
||||
/* content : declaration of functions and global variables used by */
|
||||
/* lex */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
extern int BVL_LINNUM; /* file's line number */
|
||||
static int search ();
|
File diff suppressed because it is too large
Load Diff
|
@ -1,46 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : bvl_bspec.h */
|
||||
/* date : Jun 15 1992 */
|
||||
/* author : TABUSSE L.A. */
|
||||
/* content : declaration of functions and global variables used by */
|
||||
/* bvl_bspec.c */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
extern bvl_ablstr BVL_EMPSTR;
|
||||
|
||||
struct begen *bvl_addgen ();
|
||||
struct chain *bvl_cpyabllst ();
|
||||
bvl_ablstr bvl_cpyablstr ();
|
||||
bvl_ablstr bvl_crtabl ();
|
||||
void bvl_select ();
|
||||
extern void bvl_error();
|
||||
extern int bvl_tobin();
|
|
@ -1,90 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : bvl_byacc.h */
|
||||
/* date : Oct 4 1993 */
|
||||
/* version : v108 */
|
||||
/* author : Pirouz BAZARGAN SABET */
|
||||
/* content : declaration of external functions and global variables*/
|
||||
/* used by yacc */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
typedef struct bvl_expr
|
||||
{
|
||||
char *IDENT; /* identifier or constant name */
|
||||
struct chain *LIST_ABL; /* pointer on bvl_abllst list */
|
||||
short WIDTH; /* width of bit vector */
|
||||
}
|
||||
bvl_ablstr;
|
||||
|
||||
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' */
|
||||
}
|
||||
bvl_name;
|
||||
|
||||
struct g_type
|
||||
{
|
||||
int VALU;
|
||||
char FLAG;
|
||||
};
|
||||
|
||||
struct bddnode *BVL_BDDPNT; /* BDD pointer */
|
||||
char *BVL_MODNAM; /* curnennt model name */
|
||||
bvl_ablstr BVL_SLCEXP; /* structure filled with the */
|
||||
bvl_ablstr BVL_EMPSTR; /* empty structure used with NOT*/
|
||||
|
||||
extern int BVL_AUXMOD; /* simplify internal sig (= 1) */
|
||||
|
||||
static char *BVL_LBLNAM = NULL; /* label */
|
||||
static struct chain *BVL_NM1LST = NULL; /* 1-st name liste */
|
||||
static struct chain *BVL_GRDLST = NULL; /* list of guard's ABL */
|
||||
static struct chain *BVL_CNDLST = NULL; /* list of conditions (ABL) */
|
||||
static struct chain *BVL_VALLST = NULL; /* list of waveforms (ABL) */
|
||||
static struct befig *BVL_BEFPNT = NULL; /* current BEFIG pointer */
|
||||
|
||||
static struct beden **dic = NULL; /* dictionary */
|
||||
|
||||
struct chain *BVL_INTLST = NULL;
|
||||
struct begen *BVL_GENPNT = NULL;
|
||||
|
||||
extern char BVL_ERRFLG; /* set to 1 in case of error */
|
||||
extern struct befig *BVL_HEDFIG; /* head of befigs */
|
||||
|
||||
extern struct begen *bvl_addgen();
|
||||
|
||||
extern bvl_ablstr bvl_crtabl();
|
||||
extern bvl_ablstr bvl_cpyablstr();
|
||||
extern void bvl_select();
|
||||
extern void bvl_error();
|
||||
extern void *addstr ();
|
|
@ -1,553 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : bvl_drive.c */
|
||||
/* date : May 31 1994 */
|
||||
/* version : v109 */
|
||||
/* author : VUONG H.N. */
|
||||
/* description : This file contains VHDL drivers : */
|
||||
/* vhdlsavebefig() */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "abe.h"
|
||||
#include "abv.h"
|
||||
#include "bvl_utype.h"
|
||||
#include "bvl_utdef.h"
|
||||
#include "bvl_drive.h"
|
||||
#include "bvl_util.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : vhdlsavebefig */
|
||||
/* description : print out a text file containing a data-flow VHDL */
|
||||
/* description */
|
||||
/* called func. : vhdlablname, mbkalloc, beh_message, beh_error , */
|
||||
/* beh_toolbug , getptype, reverse , bvl_abl2str */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void vhdlsavebefig (pthedbefig, trace_mode)
|
||||
|
||||
struct befig *pthedbefig;
|
||||
int trace_mode;
|
||||
|
||||
{
|
||||
char *suffix;
|
||||
char *str;
|
||||
char *mode;
|
||||
char *type_mark;
|
||||
int nrlabel = 0;
|
||||
FILE *fd;
|
||||
time_t clock;
|
||||
int left,right;
|
||||
char *name;
|
||||
char *bus;
|
||||
|
||||
struct begen *ptgeneric = NULL; /* current ptype pnt (generic) */
|
||||
struct bereg *ptbereg = NULL; /* current BEREG pointer */
|
||||
struct bemsg *ptbemsg = NULL; /* current BEMSG pointer */
|
||||
struct beout *ptbeout = NULL; /* current BEOUT pointer */
|
||||
struct bebus *ptbebus = NULL; /* current BEBUS pointer */
|
||||
struct beaux *ptbeaux = NULL; /* current BEAUX pointer */
|
||||
struct bebux *ptbebux = NULL; /* current BEBUX pointer */
|
||||
struct bepor *ptbepor = NULL; /* correctly ordered port list */
|
||||
struct biabl *ptbiabl = NULL; /* current BIABL pointer */
|
||||
|
||||
if (pthedbefig == NULL)
|
||||
beh_toolbug (10,"bvl_decomp",NULL,0);
|
||||
|
||||
if ((str = mbkgetenv ("VH_BEHSFX")) != NULL)
|
||||
suffix = strtok (str, ":");
|
||||
else
|
||||
suffix = "vbe";
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Opening result file */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((fd = mbkfopen (pthedbefig->NAME, suffix, WRITE_TEXT)) == NULL)
|
||||
{
|
||||
beh_error (107, NULL);
|
||||
autexit (1);
|
||||
}
|
||||
|
||||
if (trace_mode & ABV_TRACE_MASK)
|
||||
beh_message (13, pthedbefig->NAME);
|
||||
|
||||
time (&clock);
|
||||
(void) fprintf (fd,"-- VHDL data flow description generated from `%s`\n",
|
||||
pthedbefig->NAME);
|
||||
(void) fprintf (fd, "--\t\tdate : %s\n\n", ctime(&clock));
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Entity declaration */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
(void) fprintf (fd,"-- Entity Declaration\n\n");
|
||||
(void) fprintf (fd,"ENTITY %s IS\n",vhdlablname(pthedbefig->NAME));
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Generic declaration */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((ptgeneric = pthedbefig->BEGEN) != NULL)
|
||||
{
|
||||
ptgeneric = (struct begen *) reverse ((chain_list *)ptgeneric);
|
||||
|
||||
(void) fprintf (fd," GENERIC (\n");
|
||||
while (ptgeneric != NULL)
|
||||
{
|
||||
(void)fprintf (fd," CONSTANT %s : NATURAL := %ld",
|
||||
vhdlablname(ptgeneric->NAME),*((long *)ptgeneric->VALUE));
|
||||
if (ptgeneric->NEXT != NULL)
|
||||
(void)fprintf(fd,";\t-- %s\n",(char *)ptgeneric->NAME);
|
||||
else
|
||||
(void)fprintf(fd,"\t-- %s\n",(char *)ptgeneric->NAME);
|
||||
|
||||
ptgeneric = ptgeneric->NEXT;
|
||||
}
|
||||
(void) fprintf (fd," );\n");
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Port declaration */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptbepor = pthedbefig->BEPOR;
|
||||
if (ptbepor != NULL)
|
||||
{
|
||||
(void) fprintf (fd," PORT (\n");
|
||||
pthedbefig->BEPOR = (struct bepor *)reverse ((chain_list *)pthedbefig->BEPOR);
|
||||
|
||||
ptbepor = pthedbefig->BEPOR;
|
||||
while (ptbepor != NULL)
|
||||
{
|
||||
switch (ptbepor->DIRECTION)
|
||||
{
|
||||
case 'I':
|
||||
mode = namealloc("IN");
|
||||
break;
|
||||
case 'O':
|
||||
case 'Z':
|
||||
mode = namealloc("OUT");
|
||||
break;
|
||||
case 'B':
|
||||
case 'T':
|
||||
mode = namealloc("INOUT");
|
||||
break;
|
||||
default :
|
||||
beh_error (69, ptbepor->NAME);
|
||||
}
|
||||
ptbepor = (bepor_list *) bvl_vectnam (ptbepor,&left,&right,&name,0);
|
||||
|
||||
if(left != -1)
|
||||
{
|
||||
switch (ptbepor->TYPE)
|
||||
{
|
||||
case 'B':
|
||||
type_mark = namealloc("BIT_VECTOR");
|
||||
bus = "";
|
||||
break;
|
||||
case 'W':
|
||||
type_mark = namealloc("WOR_VECTOR");
|
||||
bus = namealloc("BUS");
|
||||
break;
|
||||
case 'M':
|
||||
type_mark = namealloc("MUX_VECTOR");
|
||||
bus = namealloc("BUS");
|
||||
break;
|
||||
default :
|
||||
beh_error (68, ptbepor->NAME);
|
||||
}
|
||||
(void)fprintf(fd," %s : %s %s(%d %s %d) %s",vhdlablname(name), mode,
|
||||
type_mark, left, (left>=right)?"DOWNTO":"TO",right,bus);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (ptbepor->TYPE)
|
||||
{
|
||||
case 'B':
|
||||
type_mark = "BIT"; break;
|
||||
case 'W':
|
||||
type_mark = "WOR_BIT BUS"; break;
|
||||
case 'M':
|
||||
type_mark = "MUX_BIT BUS"; break;
|
||||
default :
|
||||
beh_error (68, ptbepor->NAME);
|
||||
}
|
||||
|
||||
(void) fprintf (fd," %s : %s %s",vhdlablname(name),
|
||||
mode,type_mark);
|
||||
}
|
||||
|
||||
if (ptbepor->NEXT != NULL)
|
||||
(void) fprintf (fd,";\t-- %s\n",name);
|
||||
else
|
||||
(void) fprintf (fd,"\t-- %s\n );\n",name);
|
||||
|
||||
ptbepor = ptbepor->NEXT;
|
||||
}
|
||||
|
||||
pthedbefig->BEPOR = (struct bepor *)reverse ((chain_list *)pthedbefig->BEPOR);
|
||||
}
|
||||
|
||||
(void) fprintf (fd,"END %s;\n\n\n",vhdlablname(pthedbefig->NAME));
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Architecture declaration */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
(void) fprintf (fd,"-- Architecture Declaration\n\n");
|
||||
(void) fprintf (fd,"ARCHITECTURE behaviour_data_flow OF %s IS\n",
|
||||
vhdlablname(pthedbefig->NAME));
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Treatment of the BEREG list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pthedbefig->BEREG = (struct bereg *)reverse((chain_list *)pthedbefig->BEREG);
|
||||
ptbereg = pthedbefig->BEREG;
|
||||
while (ptbereg != NULL)
|
||||
{
|
||||
ptbereg = (bereg_list *)bvl_vectnam(ptbereg,&left,&right,&name,2);
|
||||
if(left != -1)
|
||||
{
|
||||
(void)fprintf(fd," SIGNAL %s : REG_VECTOR(%d %s %d) REGISTER;\t-- %s\n",
|
||||
vhdlablname(name),left,(left>=right)?"DOWNTO":"TO",
|
||||
right,name);
|
||||
}
|
||||
else
|
||||
{
|
||||
(void) fprintf (fd," SIGNAL %s : REG_BIT REGISTER;\t-- %s\n",
|
||||
vhdlablname(name),name);
|
||||
}
|
||||
ptbereg = ptbereg->NEXT;
|
||||
}
|
||||
pthedbefig->BEREG = (struct bereg *)reverse((chain_list *)pthedbefig->BEREG);
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Treatment of the BEBUX list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pthedbefig->BEBUX = (struct bebux *)reverse((chain_list *)pthedbefig->BEBUX);
|
||||
ptbebux = pthedbefig->BEBUX;
|
||||
while (ptbebux != NULL)
|
||||
{
|
||||
ptbebux = (bebux_list *)bvl_vectnam(ptbebux,&left,&right,&name,1);
|
||||
if(left != -1)
|
||||
{
|
||||
switch (ptbebux->TYPE)
|
||||
{
|
||||
case 'W':
|
||||
type_mark = namealloc("WOR_VECTOR");
|
||||
break;
|
||||
case 'M':
|
||||
type_mark = namealloc("MUX_VECTOR");
|
||||
break;
|
||||
}
|
||||
(void)fprintf(fd," SIGNAL %s : %s(%d %s %d) BUS;\t-- %s\n",
|
||||
vhdlablname(name),type_mark,left,(left>=right)?"DOWNTO":"TO",
|
||||
right,name);
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (ptbebux->TYPE)
|
||||
{
|
||||
case 'W':
|
||||
type_mark = namealloc("WOR_BIT");
|
||||
break;
|
||||
case 'M':
|
||||
type_mark = namealloc("MUX_BIT");
|
||||
break;
|
||||
}
|
||||
(void) fprintf (fd," SIGNAL %s : %s BUS;\t\t-- %s\n",vhdlablname(name),
|
||||
type_mark,name);
|
||||
}
|
||||
ptbebux = ptbebux->NEXT;
|
||||
}
|
||||
pthedbefig->BEBUX = (struct bebux *)reverse((chain_list *)pthedbefig->BEBUX);
|
||||
|
||||
pthedbefig->BEAUX = (struct beaux *)reverse((chain_list *)pthedbefig->BEAUX);
|
||||
ptbeaux = pthedbefig->BEAUX;
|
||||
while (ptbeaux != NULL)
|
||||
{
|
||||
ptbeaux = (beaux_list *)bvl_vectnam(ptbeaux,&left,&right,&name,3);
|
||||
if(left != -1)
|
||||
{
|
||||
(void)fprintf(fd," SIGNAL %s : BIT_VECTOR(%d %s %d);\t-- %s\n",
|
||||
vhdlablname(name),left,(left>=right)?"DOWNTO":"TO",
|
||||
right,name);
|
||||
}
|
||||
else
|
||||
{
|
||||
(void) fprintf (fd," SIGNAL %s : BIT;\t\t-- %s\n",
|
||||
vhdlablname(name),name);
|
||||
}
|
||||
ptbeaux = ptbeaux->NEXT;
|
||||
}
|
||||
pthedbefig->BEAUX = (struct beaux *)reverse((chain_list *)pthedbefig->BEAUX);
|
||||
|
||||
(void) fprintf (fd,"\nBEGIN\n");
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Print out a concurrent assert statement for each BEMSG */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptbemsg = pthedbefig->BEMSG;
|
||||
while (ptbemsg != NULL)
|
||||
{
|
||||
if (ptbemsg->LABEL != NULL)
|
||||
(void)fprintf(fd," %s :", ptbemsg->LABEL);
|
||||
|
||||
(void) fprintf (fd," ASSERT (" );
|
||||
bvl_printablfile(fd, ptbemsg->ABL );
|
||||
(void) fprintf (fd," = '1')\n" );
|
||||
|
||||
/*\
|
||||
buffer = bvl_abl2str (ptbemsg->ABL,buffer,&buff_size);
|
||||
(void) fprintf (fd," ASSERT (%s = '1')\n", bvl_printabl(buffer));
|
||||
buffer[0] = '\0';
|
||||
\*/
|
||||
|
||||
if (ptbemsg->MESSAGE != NULL)
|
||||
(void) fprintf (fd," REPORT %s\n",ptbemsg->MESSAGE);
|
||||
|
||||
if (ptbemsg->LEVEL == 'W')
|
||||
(void) fprintf (fd," SEVERITY WARNING;");
|
||||
else
|
||||
(void) fprintf (fd," SEVERITY ERROR;");
|
||||
|
||||
(void) fprintf (fd,"\n\n");
|
||||
ptbemsg = ptbemsg->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Print out a concurrent signal assignment for each BEAUX */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptbeaux = pthedbefig->BEAUX;
|
||||
while (ptbeaux != NULL)
|
||||
{
|
||||
if (ptbeaux->ABL != NULL)
|
||||
{
|
||||
(void) fprintf (fd," %s <= ",bvl_vectorize(ptbeaux->NAME));
|
||||
bvl_printablfile( fd, ptbeaux->ABL);
|
||||
(void) fprintf (fd,";\n");
|
||||
|
||||
/*\
|
||||
buffer = bvl_abl2str (ptbeaux->ABL,buffer,&buff_size);
|
||||
(void) fprintf (fd," %s <= %s;\n",bvl_vectorize(ptbeaux->NAME),bvl_printabl(buffer));
|
||||
buffer[0] = '\0';
|
||||
\*/
|
||||
}
|
||||
else
|
||||
beh_error (40, ptbeaux->NAME);
|
||||
ptbeaux = ptbeaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Print out a block statement with one guarded concurrent */
|
||||
/* signal assignment for each BIABL of each BEREG */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptbereg = pthedbefig->BEREG;
|
||||
while (ptbereg != NULL)
|
||||
{
|
||||
ptbiabl = ptbereg->BIABL;
|
||||
while (ptbiabl != NULL)
|
||||
{
|
||||
(void) fprintf (fd," label%d : BLOCK ",nrlabel);
|
||||
if (ptbiabl->CNDABL != NULL)
|
||||
{
|
||||
(void) fprintf (fd,"(" );
|
||||
bvl_printablfile( fd, ptbiabl->CNDABL );
|
||||
(void) fprintf (fd," = '1')\n" );
|
||||
|
||||
/*\
|
||||
buffer = bvl_abl2str (ptbiabl->CNDABL,buffer,&buff_size);
|
||||
(void) fprintf (fd,"(%s = '1')\n",bvl_printabl(buffer));
|
||||
buffer[0] = '\0';
|
||||
\*/
|
||||
}
|
||||
else
|
||||
beh_toolbug (19,"bvl_decomp",ptbereg->NAME,0);
|
||||
|
||||
(void) fprintf (fd," BEGIN\n %s <= GUARDED ",bvl_vectorize(ptbereg->NAME));
|
||||
if (ptbiabl->VALABL != NULL)
|
||||
{
|
||||
bvl_printablfile( fd, ptbiabl->VALABL );
|
||||
(void)fprintf (fd,";\n" );
|
||||
/*\
|
||||
buffer = bvl_abl2str (ptbiabl->VALABL,buffer,&buff_size);
|
||||
(void) fprintf (fd,"%s;\n",bvl_printabl(buffer));
|
||||
buffer[0] = '\0';
|
||||
\*/
|
||||
}
|
||||
else
|
||||
beh_toolbug (20,"bvl_decomp",ptbereg->NAME,0);
|
||||
|
||||
(void) fprintf ( fd," END BLOCK label%d;\n",nrlabel);
|
||||
ptbiabl = ptbiabl->NEXT;
|
||||
nrlabel++;
|
||||
}
|
||||
|
||||
ptbereg = ptbereg->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Print out a block statement with one guarded concurrent */
|
||||
/* signal assignment for each BIABL of each BEBUX */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptbebux = pthedbefig->BEBUX;
|
||||
while (ptbebux != NULL)
|
||||
{
|
||||
ptbiabl = ptbebux->BIABL;
|
||||
while (ptbiabl != NULL)
|
||||
{
|
||||
(void) fprintf (fd," label%d : BLOCK (",nrlabel);
|
||||
if (ptbiabl->CNDABL != NULL)
|
||||
{
|
||||
bvl_printablfile( fd, ptbiabl->CNDABL );
|
||||
(void) fprintf (fd," = '1')\n" );
|
||||
|
||||
/*\
|
||||
buffer = bvl_abl2str (ptbiabl->CNDABL,buffer,&buff_size);
|
||||
(void) fprintf (fd,"%s = '1')\n",bvl_printabl(buffer));
|
||||
buffer[0] = '\0';
|
||||
\*/
|
||||
}
|
||||
else
|
||||
beh_toolbug (19,"bvl_decomp",ptbebux->NAME,0);
|
||||
|
||||
(void) fprintf (fd," BEGIN\n %s <= GUARDED ",
|
||||
bvl_vectorize(ptbebux->NAME));
|
||||
if (ptbiabl->VALABL != NULL)
|
||||
{
|
||||
bvl_printablfile( fd, ptbiabl->VALABL );
|
||||
(void) fprintf (fd,";\n" );
|
||||
/*\
|
||||
buffer = bvl_abl2str (ptbiabl->VALABL,buffer,&buff_size);
|
||||
(void) fprintf (fd,"%s;\n",bvl_printabl(buffer));
|
||||
buffer[0] = '\0';
|
||||
\*/
|
||||
}
|
||||
else
|
||||
beh_toolbug (20,"bvl_decomp",ptbebux->NAME,0);
|
||||
|
||||
(void) fprintf (fd," END BLOCK label%d;\n",nrlabel);
|
||||
ptbiabl = ptbiabl->NEXT;
|
||||
nrlabel++;
|
||||
}
|
||||
|
||||
ptbebux = ptbebux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Print out a block statement with one guarded concurrent */
|
||||
/* signal assignment for each BIABL of each BEBUS */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptbebus = pthedbefig->BEBUS;
|
||||
while (ptbebus != NULL)
|
||||
{
|
||||
ptbiabl = ptbebus->BIABL;
|
||||
while (ptbiabl != NULL)
|
||||
{
|
||||
(void) fprintf (fd,"\tlabel%d : BLOCK (",nrlabel);
|
||||
if (ptbiabl->CNDABL != NULL)
|
||||
{
|
||||
bvl_printablfile ( fd, ptbiabl->CNDABL );
|
||||
(void) fprintf (fd," = '1')\n" );
|
||||
/*\
|
||||
buffer = bvl_abl2str (ptbiabl->CNDABL,buffer,&buff_size);
|
||||
(void) fprintf (fd,"%s = '1')\n",bvl_printabl(buffer));
|
||||
buffer[0] = '\0';
|
||||
\*/
|
||||
}
|
||||
else
|
||||
beh_toolbug (19,"bvl_decomp",ptbebus->NAME,0);
|
||||
|
||||
(void) fprintf (fd,"\tBEGIN\n\t%s <= GUARDED ",bvl_vectorize(ptbebus->NAME));
|
||||
if (ptbiabl->VALABL != NULL)
|
||||
{
|
||||
bvl_printablfile( fd, ptbiabl->VALABL );
|
||||
(void) fprintf (fd,";\n" );
|
||||
|
||||
/*\
|
||||
buffer = bvl_abl2str (ptbiabl->VALABL,buffer,&buff_size);
|
||||
(void) fprintf (fd,"%s;\n",bvl_printabl(buffer));
|
||||
buffer[0] = '\0';
|
||||
\*/
|
||||
}
|
||||
else
|
||||
beh_toolbug (20,"bvl_decomp",ptbebus->NAME,0);
|
||||
|
||||
(void) fprintf (fd,"\tEND BLOCK label%d;\n",nrlabel);
|
||||
ptbiabl = ptbiabl->NEXT;
|
||||
nrlabel++;
|
||||
}
|
||||
|
||||
ptbebus = ptbebus->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Print out a concurrent signal assignment for each BEOUT */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptbeout = pthedbefig->BEOUT;
|
||||
while (ptbeout != NULL)
|
||||
{
|
||||
if (ptbeout->ABL != NULL)
|
||||
{
|
||||
(void) fprintf (fd,"\n%s <= ",bvl_vectorize(ptbeout->NAME) );
|
||||
bvl_printablfile( fd, ptbeout->ABL );
|
||||
(void) fprintf (fd,";\n" );
|
||||
/*\
|
||||
buffer = bvl_abl2str(ptbeout->ABL,buffer,&buff_size);
|
||||
(void) fprintf (fd,"\n%s <= %s;\n",bvl_vectorize(ptbeout->NAME), bvl_printabl(buffer));
|
||||
buffer[0] = '\0';
|
||||
\*/
|
||||
}
|
||||
else
|
||||
beh_error (40, ptbeout->NAME);
|
||||
|
||||
ptbeout = ptbeout->NEXT;
|
||||
}
|
||||
|
||||
(void) fprintf (fd,"END;\n");
|
||||
(void) fclose (fd);
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : bvl_drive.h */
|
||||
/* date : may 31 1994 */
|
||||
/* version : v109 */
|
||||
/* author : VUONG H.N. */
|
||||
/* content : declaration of functions and global variables used by */
|
||||
/* the behavioural decompiler */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
|
||||
extern char *bvl_vhdlname();
|
||||
extern char *bvl_abl2str();
|
||||
extern char *bvl_printabl();
|
||||
extern void bvl_message();
|
||||
extern char *bvl_vectorize ();
|
||||
extern void *bvl_vectnam ();
|
|
@ -1,156 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : bvl_parse.c */
|
||||
/* date : jun 15 1994 */
|
||||
/* version : v109 */
|
||||
/* author : L.A TABUSSE & H.N. VUONG & P. BAZARGAN-SABET */
|
||||
/* description : Parser VHDL --> BEH */
|
||||
/* called Func. : mbkalloc */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "bdd.h"
|
||||
#include "abe.h"
|
||||
#include "abv.h"
|
||||
#include "bvl_utype.h"
|
||||
#include "bvl_utdef.h"
|
||||
#include "bvl_parse.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* Function : vhdlloadbefig */
|
||||
/* Content : Parse a .vbe file to produce a befig */
|
||||
/* Return : a pointer on a befig */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
bddcircuit *BvlBddCircuit = (bddcircuit *)0;
|
||||
bddsystem *BvlBddSystem = (bddsystem *)0;
|
||||
|
||||
struct befig *vhdlloadbefig (pt_befig, figname, trace_mode)
|
||||
|
||||
struct befig *pt_befig;
|
||||
char *figname;
|
||||
int trace_mode;
|
||||
|
||||
{
|
||||
char *tok;
|
||||
char *str;
|
||||
struct chain *behsfx_lst = NULL;
|
||||
struct chain *suffix = NULL;
|
||||
static unsigned int call_nbr = 0;
|
||||
bddsystem *SaveBddSystem;
|
||||
bddcircuit *SaveBddCircuit;
|
||||
|
||||
SaveBddSystem = BddLocalSystem;
|
||||
SaveBddCircuit = BddLocalCircuit;
|
||||
|
||||
if ( BvlBddSystem == (bddsystem *)0 )
|
||||
{
|
||||
BvlBddSystem = createbddsystem( 50, 1000, 200, 50000000 );
|
||||
BvlBddCircuit = createbddcircuit( "-select-", 200, 0, BvlBddSystem );
|
||||
}
|
||||
|
||||
BddLocalSystem = BvlBddSystem;
|
||||
BddLocalCircuit = BvlBddCircuit;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Create list of suffix for behavioural files from the */
|
||||
/* environment variable VH_BEHSFX */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((str = mbkgetenv ("VH_BEHSFX")) != NULL)
|
||||
{
|
||||
tok = strtok (str, ":");
|
||||
while (tok != NULL)
|
||||
{
|
||||
behsfx_lst = addchain (behsfx_lst, tok);
|
||||
tok = strtok (NULL, ":");
|
||||
}
|
||||
behsfx_lst = (struct chain *) reverse (behsfx_lst);
|
||||
}
|
||||
else
|
||||
behsfx_lst = addchain (NULL, "vbe");
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Searching the root file */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
suffix = behsfx_lst;
|
||||
while (suffix != NULL)
|
||||
{
|
||||
if ((bvl_y_in = mbkfopen (figname, suffix->DATA, READ_TEXT)) != NULL)
|
||||
{
|
||||
sprintf (BVL_CURFIL, "%s.%s", figname, (char *)suffix->DATA);
|
||||
break;
|
||||
}
|
||||
suffix = suffix->NEXT;
|
||||
}
|
||||
|
||||
if (bvl_y_in == NULL)
|
||||
{
|
||||
beh_error (100, figname);
|
||||
autexit (1);
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* Running the behavioural compiler on the current file */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((trace_mode & ABV_TRACE_MASK) != 0)
|
||||
beh_message (3, BVL_CURFIL);
|
||||
|
||||
if ((trace_mode & ABV_KEEP_AUX_MASK) == 0)
|
||||
BVL_AUXMOD = 0;
|
||||
else
|
||||
BVL_AUXMOD = 1;
|
||||
|
||||
BVL_LINNUM = 1;
|
||||
|
||||
if (call_nbr != 0)
|
||||
bvl_y_restart (bvl_y_in);
|
||||
call_nbr++;
|
||||
|
||||
bvl_y_parse ();
|
||||
fclose (bvl_y_in);
|
||||
bvl_y_in = NULL;
|
||||
|
||||
/*\
|
||||
resetbddcircuit( BvlBddCircuit );
|
||||
resetbddsystem( BvlBddSystem );
|
||||
\*/
|
||||
|
||||
BddLocalSystem = SaveBddSystem;
|
||||
BddLocalCircuit = SaveBddCircuit;
|
||||
|
||||
return (BVL_HEDFIG);
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : bvl_parse.h */
|
||||
/* date : May 31 1994 */
|
||||
/* version : v109 */
|
||||
/* author : L.A. TABUSSE & H.G. VUONG & P. BAZARGAN-SABET */
|
||||
/* description : */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
char BVL_ERRFLG = 0; /* if = 1 no structure is made */
|
||||
int BVL_LINNUM = 1; /* file's line number */
|
||||
int BVL_AUXMOD; /* simplify internal sig (= 1) */
|
||||
char BVL_CURFIL[200]; /* current file's name */
|
||||
befig_list *BVL_HEDFIG = NULL;
|
||||
|
||||
extern FILE *bvl_y_in;
|
||||
extern int bvl_y_parse();
|
||||
extern void bvl_y_restart();
|
||||
|
||||
extern char *getenv();
|
|
@ -1,64 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : bvl_utdef.h */
|
||||
/* date : Jun 18 1992 */
|
||||
/* version : v103 */
|
||||
/* author : L.A.TABUSSE */
|
||||
/* content : declaration of external functions and global variables*/
|
||||
/* used by yacc */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#define BVL_ICNDFN 1 /* input port */
|
||||
#define BVL_OCNDFN 2 /* output port */
|
||||
#define BVL_BCNDFN 3 /* inout port */
|
||||
|
||||
#define BVL_BITDFN 8 /* bit type */
|
||||
#define BVL_MUXDFN 16 /* mux_bit type */
|
||||
#define BVL_WORDFN 24 /* wor_bit type */
|
||||
#define BVL_RBIDFN 32 /* reg_bit type */
|
||||
|
||||
#define BVL_NORDFN 128 /* non guarded signal */
|
||||
#define BVL_BUSDFN 256 /* guarded signal (bus) */
|
||||
#define BVL_REGDFN 384 /* guarded signal (register)*/
|
||||
|
||||
#define BVL_NAMDFN 0
|
||||
#define BVL_NEWDFN 1
|
||||
|
||||
#define BVL_MODDFN 0 /* mod_val field of dct_recrd */
|
||||
#define BVL_SIGDFN 1 /* sig_val field of dct_recrd */
|
||||
#define BVL_CCNDFN 2 /* ccn_val field of dct_recrd */
|
||||
#define BVL_RNGDFN 3 /* rng_val field of dct_recrd */
|
||||
#define BVL_LBLDFN 4 /* lbl_val field of dct_recrd */
|
||||
#define BVL_WMXDFN 5 /* wmx_val field of dct_recrd */
|
||||
#define BVL_WMNDFN 6 /* wmn_val field of dct_recrd */
|
||||
#define BVL_PNTDFN 7 /* pnt_val field of dct_recrd */
|
||||
|
||||
#define BVL_MXRDFN 30
|
|
@ -1,706 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : bvl_util.c */
|
||||
/* date : Jan 18 1993 */
|
||||
/* version : v106 */
|
||||
/* author : Pirouz BAZARGAN SABET */
|
||||
/* description : This file contains some utility functions : */
|
||||
/* bvl_error , bvl_y_error */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include "mut.h"
|
||||
#include "aut.h"
|
||||
#include "abl.h"
|
||||
#include "abe.h"
|
||||
#include "bvl_utype.h"
|
||||
#include "bvl_util.h"
|
||||
#include "bvl_utdef.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : bvl_error */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void bvl_error (code, str1)
|
||||
|
||||
int code;
|
||||
char *str1;
|
||||
|
||||
{
|
||||
BVL_ERRFLG++;
|
||||
(void)fprintf (stderr,"`%s` Error %d line %d :",BVL_CURFIL,code,BVL_LINNUM);
|
||||
|
||||
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 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 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;
|
||||
|
||||
default:
|
||||
(void) fprintf (stderr,"syntax error\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (BVL_ERRFLG > BVL_MXRDFN)
|
||||
{
|
||||
(void) fprintf (stderr,"Too many errors. Cannot continue further more\n");
|
||||
(void) fprintf (stderr,"\n Have a nice day...\n");
|
||||
autexit (1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : bvl_y_error */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
void bvl_y_error (str)
|
||||
|
||||
char *str;
|
||||
{
|
||||
BVL_ERRFLG++;
|
||||
(void)fprintf (stderr,"`%s` Error line %d : %s\n",BVL_CURFIL,BVL_LINNUM,str);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : vhdlablname */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
/*\
|
||||
char *vhdlablname (name)
|
||||
|
||||
char *name;
|
||||
|
||||
{
|
||||
char *new_name;
|
||||
char *prv_name;
|
||||
char *tmp_name;
|
||||
char buffer[200];
|
||||
int i,j,flag,number;
|
||||
static struct beden **namtab=NULL;
|
||||
static char *keywrd [] = {
|
||||
"abs" , "access" ,
|
||||
"after" , "alias" ,
|
||||
"all" , "and" ,
|
||||
"architecture", "array" ,
|
||||
"assert" , "attribute" ,
|
||||
"begin" , "bit" ,
|
||||
"bit_vector" , "block" ,
|
||||
"body" , "buffer" ,
|
||||
"bus" , "case" ,
|
||||
"component" , "configuration",
|
||||
"constant" , "disconnect" ,
|
||||
"downto" , "else" ,
|
||||
"elsif" , "end" ,
|
||||
"entity" , "error" ,
|
||||
"exit" , "file" ,
|
||||
"for" , "function" ,
|
||||
"generate" , "generic" ,
|
||||
"guarded" , "if" ,
|
||||
"in" , "inout" ,
|
||||
"is" , "label" ,
|
||||
"library" , "linkage" ,
|
||||
"loop" , "map" ,
|
||||
"mod" , "mux_bit" ,
|
||||
"mux_vector" , "nand" ,
|
||||
"natural" , "new" ,
|
||||
"next" , "nor" ,
|
||||
"not" , "null" ,
|
||||
"of" , "on" ,
|
||||
"open" , "or" ,
|
||||
"others" , "out" ,
|
||||
"package" , "port" ,
|
||||
"procedure" , "process" ,
|
||||
"range" , "record" ,
|
||||
"reg_bit" , "reg_vector" ,
|
||||
"register" , "rem" ,
|
||||
"report" , "return" ,
|
||||
"select" , "severity" ,
|
||||
"signal" , "stable" ,
|
||||
"subtype" , "then" ,
|
||||
"to" , "transport" ,
|
||||
"type" , "units" ,
|
||||
"until" , "use" ,
|
||||
"variable" , "wait" ,
|
||||
"warning" , "when" ,
|
||||
"while" , "with" ,
|
||||
"wor_bit" , "wor_vector" ,
|
||||
"xor"
|
||||
};
|
||||
|
||||
if (namtab == NULL)
|
||||
{
|
||||
namtab = beh_initab ();
|
||||
for (i=0 ; i<93 ; i++)
|
||||
beh_addtab (namtab, namealloc (keywrd [i]), NULL, BVL_NEWDFN , 1);
|
||||
}
|
||||
|
||||
tmp_name = namealloc (name);
|
||||
new_name = (char *) beh_chktab (namtab,tmp_name,NULL,BVL_PNTDFN);
|
||||
|
||||
if (beh_chktab (namtab,tmp_name,NULL,BVL_NAMDFN) == 0)
|
||||
{
|
||||
i = 0;
|
||||
j = 0;
|
||||
number = 0;
|
||||
flag = 1;
|
||||
while (tmp_name[i] != '\0')
|
||||
{
|
||||
buffer[j] = tmp_name[i];
|
||||
if ( ((tmp_name[i] >= 'a') && (tmp_name[i] <= 'z')) ||
|
||||
((tmp_name[i] >= 'A') && (tmp_name[i] <= 'Z')) ||
|
||||
((tmp_name[i] >= '0') && (tmp_name[i] <= '9') && (i != 0)))
|
||||
flag = 0;
|
||||
else
|
||||
{
|
||||
if (flag == 1)
|
||||
buffer[j++] = 'v';
|
||||
buffer[j] = '_';
|
||||
flag = 1;
|
||||
}
|
||||
i++;
|
||||
j++;
|
||||
}
|
||||
if (buffer[j-1] == '_')
|
||||
buffer[j++] = '0';
|
||||
buffer[j] = '\0';
|
||||
new_name = namealloc (buffer);
|
||||
|
||||
prv_name = new_name;
|
||||
while (beh_chktab (namtab,new_name,NULL,BVL_NEWDFN) != 0)
|
||||
{
|
||||
new_name = prv_name;
|
||||
sprintf (buffer,"%s_%d",new_name,number++);
|
||||
prv_name = new_name;
|
||||
new_name = namealloc (buffer);
|
||||
}
|
||||
beh_addtab (namtab,new_name,NULL,BVL_NEWDFN,1);
|
||||
beh_addtab (namtab,tmp_name,NULL,BVL_PNTDFN,(long)new_name);
|
||||
beh_addtab (namtab,tmp_name,NULL,BVL_NAMDFN,1);
|
||||
}
|
||||
|
||||
return (new_name);
|
||||
}
|
||||
\*/
|
||||
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : bvl_vectorize */
|
||||
/* description : put parenthesis on element of bussed signals */
|
||||
/* called func. : mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
char *bvl_vectorize(name)
|
||||
|
||||
char *name;
|
||||
{
|
||||
char *new_name ;
|
||||
char tmp1 [256];
|
||||
int i = 0;
|
||||
static struct beden **tab = NULL;
|
||||
|
||||
if (tab == NULL)
|
||||
tab = beh_initab ();
|
||||
|
||||
if ((new_name = (char *) beh_chktab (tab, name, NULL, BVL_PNTDFN)) == NULL)
|
||||
{
|
||||
strcpy (tmp1, name);
|
||||
|
||||
while ((name [i] != '\0') && (name [i] != ' ' ) && (name [i] != '\''))
|
||||
i ++;
|
||||
|
||||
tmp1 [i] = '\0';
|
||||
new_name = vhdlablname (tmp1);
|
||||
|
||||
if (name [i] != '\0')
|
||||
{
|
||||
if (name [i] == ' ')
|
||||
sprintf (tmp1, "%s (%s)", new_name, &name[i+1]);
|
||||
else
|
||||
sprintf (tmp1, "%s'%s" , new_name, &name[i+1]);
|
||||
new_name = namealloc (tmp1);
|
||||
}
|
||||
beh_addtab (tab, name, NULL, BVL_PNTDFN, new_name);
|
||||
}
|
||||
|
||||
return (new_name);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : bvl_vectnam */
|
||||
/* analyze a list of signal and return the bounds of the vectorised */
|
||||
/* signals, if they occure. */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void *bvl_vectnam(pt_list,left,right,name,type)
|
||||
|
||||
void *pt_list;
|
||||
int *left, *right;
|
||||
char **name;
|
||||
char type; /* If type = 0 bepor_list, type = 1 bebux_list */
|
||||
/* If type = 2 bereg_list, type = 3 beaux_list */
|
||||
|
||||
{
|
||||
char *blank_space;
|
||||
char *sig_name;
|
||||
char name_tmp[200];
|
||||
char number[200];
|
||||
bepor_list *ptpor;
|
||||
bebux_list *ptbux;
|
||||
beaux_list *ptaux;
|
||||
bereg_list *ptreg;
|
||||
char END = 0;
|
||||
|
||||
/* Case bepor_list */
|
||||
if(type==0)
|
||||
{
|
||||
ptpor = (bepor_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 != NULL)
|
||||
{
|
||||
strcpy(number,blank_space);
|
||||
*left = atoi(number);
|
||||
*right = *left;
|
||||
*blank_space = '\0';
|
||||
}
|
||||
|
||||
while(!END)
|
||||
{
|
||||
if(ptpor->NEXT != NULL)
|
||||
{
|
||||
strcpy(name_tmp,(ptpor->NEXT)->NAME);
|
||||
blank_space = strchr(name_tmp,' ');
|
||||
if(blank_space!=NULL)
|
||||
{
|
||||
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(ptpor);
|
||||
}
|
||||
|
||||
/*case bebux_list */
|
||||
if(type==1)
|
||||
{
|
||||
ptbux = (bebux_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 != NULL)
|
||||
{
|
||||
strcpy(number,blank_space);
|
||||
*right = atoi(number);
|
||||
*left = *right;
|
||||
*blank_space = '\0';
|
||||
}
|
||||
|
||||
while(END != 1)
|
||||
{
|
||||
if(ptbux->NEXT != NULL)
|
||||
{
|
||||
strcpy(name_tmp,ptbux->NEXT->NAME);
|
||||
blank_space = strchr(name_tmp,' ');
|
||||
if(blank_space!=NULL)
|
||||
{
|
||||
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(ptbux);
|
||||
}
|
||||
|
||||
/*case bereg_list */
|
||||
if(type==2)
|
||||
{
|
||||
ptreg = (bereg_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 != NULL)
|
||||
{
|
||||
strcpy(number,blank_space);
|
||||
*right = atoi(number);
|
||||
*left = *right;
|
||||
*blank_space = '\0';
|
||||
}
|
||||
|
||||
while(END != 1)
|
||||
{
|
||||
if(ptreg->NEXT != NULL)
|
||||
{
|
||||
strcpy(name_tmp,ptreg->NEXT->NAME);
|
||||
blank_space = strchr(name_tmp,' ');
|
||||
if(blank_space!=NULL)
|
||||
{
|
||||
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(ptreg);
|
||||
}
|
||||
|
||||
/*case beaux_list */
|
||||
if(type==3)
|
||||
{
|
||||
ptaux = (beaux_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 != NULL)
|
||||
{
|
||||
strcpy(number,blank_space);
|
||||
*right = atoi(number);
|
||||
*left = *right;
|
||||
*blank_space = '\0';
|
||||
}
|
||||
|
||||
while(END != 1)
|
||||
{
|
||||
if(ptaux->NEXT != NULL)
|
||||
{
|
||||
strcpy(name_tmp,ptaux->NEXT->NAME);
|
||||
blank_space = strchr(name_tmp,' ');
|
||||
if(blank_space!=NULL)
|
||||
{
|
||||
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(ptaux);
|
||||
}
|
||||
return( (void *)0 );
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : bvl_printabl */
|
||||
/* content : put a \n for a better presentation of an abl */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/*\
|
||||
char *bvl_printabl(chaine)
|
||||
char *chaine;
|
||||
{
|
||||
char *chaine_tmp = NULL;
|
||||
char *blanc = NULL;
|
||||
|
||||
chaine_tmp = chaine;
|
||||
while(strlen(chaine_tmp)>60)
|
||||
{
|
||||
chaine_tmp = &chaine_tmp[60];
|
||||
blanc = strchr(chaine_tmp,' ');
|
||||
if(blanc != NULL)
|
||||
{
|
||||
*blanc = '\n';
|
||||
chaine_tmp = blanc;
|
||||
}
|
||||
}
|
||||
return(chaine);
|
||||
}
|
||||
\*/
|
||||
|
||||
void bvl_printablfile( AblFile, Expr )
|
||||
|
||||
FILE *AblFile;
|
||||
chain_list *Expr;
|
||||
{
|
||||
viewablexprfile( AblFile, Expr, ABL_VIEW_VHDL );
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : bvl_abl2str */
|
||||
/* description : return a string corresponding to an expression */
|
||||
/* called func. : */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
char *bvl_abl2str (expr, chaine, size_pnt)
|
||||
|
||||
struct chain *expr; /* expression */
|
||||
char *chaine; /* target string */
|
||||
int *size_pnt; /* size of available space */
|
||||
|
||||
{
|
||||
int operator;
|
||||
char *oper ;
|
||||
struct chain *operand ;
|
||||
static char *str_z = NULL;
|
||||
static char *str_o = NULL;
|
||||
static char *str_d = NULL;
|
||||
|
||||
if (str_z == NULL)
|
||||
{
|
||||
str_z = namealloc ("'0'");
|
||||
str_o = namealloc ("'1'");
|
||||
str_d = namealloc ("'d'");
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if there is not enough space left allocate a bigger block */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (*size_pnt < (strlen (chaine) + 50))
|
||||
{
|
||||
*size_pnt = *size_pnt + 256;
|
||||
chaine = (char *) realloc (chaine, *size_pnt);
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if the expression is a terminal (atom) add its name to */
|
||||
/* the previous string */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (expr->NEXT == NULL)
|
||||
{
|
||||
if ((expr->DATA == (void *) str_z) ||
|
||||
(expr->DATA == (void *) str_o) ||
|
||||
(expr->DATA == (void *) str_d) )
|
||||
strcat (chaine, expr->DATA);
|
||||
else
|
||||
strcat (chaine, bvl_vectorize (expr->DATA));
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if the expression is not a terminal : */
|
||||
/* - for unary operators (not, stable) add */
|
||||
/* "operator ( operand )" to the previous string */
|
||||
/* */
|
||||
/* - for binary operators (and, or, nor, xor, ...) add */
|
||||
/* "(operand operator operand operator operand ...)" */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
operator = (int) ((struct chain *) expr->DATA)->DATA;
|
||||
operand = (struct chain *)expr->NEXT->DATA;
|
||||
|
||||
if (operator == ABL_STABLE)
|
||||
{
|
||||
strcat (chaine, bvl_vectorize (operand->DATA));
|
||||
strcat (chaine, "'STABLE");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (operator == ABL_NOT)
|
||||
{
|
||||
strcat (chaine, "not (");
|
||||
chaine = bvl_abl2str (operand, chaine, size_pnt);
|
||||
}
|
||||
else
|
||||
{
|
||||
oper = getablopername (operator);
|
||||
strcat (chaine,"(");
|
||||
while ( (expr = expr->NEXT) != NULL )
|
||||
{
|
||||
chaine = bvl_abl2str (expr->DATA, chaine, size_pnt);
|
||||
if (expr->NEXT)
|
||||
{
|
||||
strcat (chaine, " ");
|
||||
strcat (chaine, oper);
|
||||
strcat (chaine, " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
strcat (chaine, ")");
|
||||
}
|
||||
}
|
||||
|
||||
return (chaine);
|
||||
}
|
|
@ -1,43 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : bvl_util.h */
|
||||
/* date : Jun 15 1992 */
|
||||
/* version : v102 */
|
||||
/* author : Pirouz BAZARGAN SABET */
|
||||
/* description : This file contains declaration of global and external */
|
||||
/* variables and, functions used in `bvl_util.c` */
|
||||
/* */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
extern int BVL_LINNUM; /* file's line number */
|
||||
extern char BVL_ERRFLG; /* Error flag */
|
||||
extern char BVL_CURFIL[]; /* current file name */
|
||||
|
||||
extern void bvl_printablfile();
|
||||
extern void *bvl_vectnam();
|
|
@ -1,58 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* */
|
||||
/* file : bvl_utype.h */
|
||||
/* date : Jun 15 1992 */
|
||||
/* version : v102 */
|
||||
/* 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;
|
||||
int pnt_val;
|
||||
};
|
|
@ -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 13:46:44 ludo Exp $
|
||||
dnl
|
||||
dnl
|
||||
AC_INIT(src/abv.h)
|
||||
AM_INIT_AUTOMAKE(abv, 2.1)
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_CC
|
||||
AC_HEADER_STDC
|
||||
AC_C_CONST
|
||||
AC_PROG_RANLIB
|
||||
|
||||
AM_ALLIANCE
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
src/Makefile
|
||||
])
|
|
@ -1,109 +0,0 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| This file is part of the Alliance CAD System Copyright |
|
||||
| (C) Laboratoire LIP6 - Département ASIM Universite P&M Curie|
|
||||
| |
|
||||
| Home page : http://www-asim.lip6.fr/alliance/ |
|
||||
| E-mail support : mailto:alliance-support@asim.lip6.fr |
|
||||
| |
|
||||
| This progam is free software; you can redistribute it |
|
||||
| and/or modify it under the terms of the GNU Library General|
|
||||
| Public License as published by the Free Software Foundation |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with the GNU C Library; see the file COPYING. |
|
||||
| If not, write to the Free Software Foundation, Inc., |
|
||||
| 675 Mass Ave, Cambridge, MA 02139, USA. |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
# include <stdio.h>
|
||||
# include <malloc.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "abe.h"
|
||||
# include "abv.h"
|
||||
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Usage |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void BvlUsage()
|
||||
{
|
||||
fprintf( stderr, "\t\tabvtest [Options] Input_name\n\n" );
|
||||
fprintf( stdout, "\t\tOptions : -V Sets Verbose mode on\n" );
|
||||
fprintf( stdout, "\n" );
|
||||
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
int main( argc, argv )
|
||||
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
befig_list *Figure;
|
||||
char *InputFileName;
|
||||
int Number;
|
||||
int Index;
|
||||
char Option;
|
||||
long Value;
|
||||
|
||||
int FlagVerbose = 0;
|
||||
|
||||
mbkenv();
|
||||
autenv();
|
||||
ablenv();
|
||||
|
||||
InputFileName = (char *)0;
|
||||
|
||||
if ( argc < 2 ) BvlUsage();
|
||||
|
||||
InputFileName = (char *)0;
|
||||
|
||||
for ( Number = 1; Number < argc; Number++ )
|
||||
{
|
||||
if ( argv[ Number ][ 0 ] == '-' )
|
||||
{
|
||||
for ( Index = 1; argv[ Number ][ Index ] != '\0'; Index++ )
|
||||
{
|
||||
Option = argv[ Number ][ Index ];
|
||||
|
||||
switch ( Option )
|
||||
{
|
||||
case 'V' : FlagVerbose = 1;
|
||||
break;
|
||||
default : BvlUsage();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( InputFileName == (char *)0 ) InputFileName = argv[ Number ];
|
||||
else
|
||||
BvlUsage();
|
||||
}
|
||||
|
||||
if ( InputFileName == (char *)0 ) BvlUsage();
|
||||
|
||||
Figure = vhdlloadbefig( NULL, InputFileName, 0);
|
||||
|
||||
beh_frebefig( Figure );
|
||||
}
|
Loading…
Reference in New Issue