This commit is contained in:
parent
bc70b3838d
commit
5a1da1d295
|
@ -0,0 +1 @@
|
|||
SUBDIRS = src man1 man5
|
|
@ -0,0 +1,36 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(src/vasy_main.c)
|
||||
|
||||
VASY_MAJOR_VERSION=1
|
||||
VASY_MINOR_VERSION=5
|
||||
VASY_VERSION=$VASY_MAJOR_VERSION.$VASY_MINOR_VERSION
|
||||
|
||||
AC_SUBST(VASY_MAJOR_VERSION)
|
||||
AC_SUBST(VASY_MINOR_VERSION)
|
||||
AC_SUBST(VASY_VERSION)
|
||||
|
||||
# For automake.
|
||||
VERSION=$VASY_VERSION
|
||||
PACKAGE=vasy
|
||||
|
||||
dnl Initialize automake stuff
|
||||
AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
AM_PROG_LEX
|
||||
AC_PROG_YACC
|
||||
AC_PROG_RANLIB
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
|
||||
AM_ALLIANCE
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
man1/Makefile
|
||||
man5/Makefile
|
||||
src/Makefile
|
||||
])
|
|
@ -0,0 +1,2 @@
|
|||
man_MANS = vasy.1
|
||||
EXTRA_DIST = $(man_MANS)
|
|
@ -0,0 +1,114 @@
|
|||
.\" $Id: vasy.1,v 1.1 2002/03/26 15:17:15 ludo Exp $
|
||||
.\" @(#)Labo.l 2.2 95/09/24 UPMC; Author: Jacomme L.
|
||||
.pl -.4
|
||||
.TH VASY 1 "November 26, 1999" "ASIM/LIP6" "CAO\-VLSI Reference Manual"
|
||||
.SH NAME
|
||||
.TP
|
||||
VASY \- VHDL Analyzer for Synthesis
|
||||
.so man1/alc_origin.1
|
||||
.SH SYNOPSIS
|
||||
.TP
|
||||
\f4vasy [\-VpavsoipSHL] [\-C num] [\-E num] [\-I format] [\-P file] filename [outname]
|
||||
.br
|
||||
.SH DESCRIPTION
|
||||
.br
|
||||
\fBVASY\fp is a hierarchical VHDL Analyzer for Synthesis.
|
||||
\fBVASY\fp performs a semantic analysis of a VHDL RTL description
|
||||
\fBfilename\fP, with a VHDL subset much more extended than the Alliance one
|
||||
(see vasy(5) for more details), and identifies with precision all the
|
||||
memorizing elements and tristate buffers.
|
||||
.br
|
||||
During its analysis, \fBVASY\fp expands generic parameters, executes generic map
|
||||
and generate statements, and also unrolls static FOR loops.
|
||||
.br
|
||||
At the end, \fBVASY\fp drives an equivalent description
|
||||
\fBoutname\fP (in Verilog or VHDL format) accepted by most of
|
||||
synthesis tools.
|
||||
.br
|
||||
|
||||
.SH ENVIRONMENT VARIABLES
|
||||
.br
|
||||
.TP 10
|
||||
\f4MBK_WORK_LIB\fR(1)
|
||||
indicates the path to the read/write directory for the session.
|
||||
.br
|
||||
|
||||
.SH OPTIONS
|
||||
.TP 10
|
||||
\f4\-V\fP
|
||||
Verbose mode on.
|
||||
Each step of the analysis is displayed on the standard output.
|
||||
.TP 10
|
||||
\f4\-v\fP
|
||||
Drives an equivalent description in \fBVerilog\fP format.
|
||||
.TP 10
|
||||
\f4\-a\fP
|
||||
Drives an equivalent description in Alliance VHDL format \fBvbe\fP(5) and/or
|
||||
\fBvst\fP(5).
|
||||
We can note that with this option, all arithmetic operators are expanded in an
|
||||
equivalent set of boolean expressions, because these operators don't belong to
|
||||
the Alliance VHDL subset.
|
||||
.TP 10
|
||||
\f4\-s\fP
|
||||
Drives an equivalent VHDL description (with the extention \fB.vhd\fP)
|
||||
accepted by most of industrial synthesis tools.
|
||||
.TP 10
|
||||
\f4\-S\fP
|
||||
Uses Std_logic instead of Bit (taken into account only with option -s).
|
||||
.TP 10
|
||||
\f4\-i\fP
|
||||
Drives initial signal values (taken into account only with option -s).
|
||||
.TP 10
|
||||
\f4\-I format\fP
|
||||
Specifies the VHDL input format such as Alliance VHDL format \fBvbe\fP(5),
|
||||
\fBvst\fP(5) or industrial VHDL format \fBvhd\fP or \fBvhdl\fP.
|
||||
.TP 10
|
||||
\f4\-H\fP
|
||||
In a structural description, all model of instances are recursively analyzed.
|
||||
(By default \fBVASY\fp analyzes only models with generic parameters)
|
||||
The leaves cells are defined by a file called CATAL (see catal(5) for details).
|
||||
.TP 10
|
||||
\f4\-o\fP
|
||||
Authorizes to overwrite existing files.
|
||||
.TP 10
|
||||
\f4\-p\fP
|
||||
Adds power supply connectors (vdd and vss). Usefull option to enter in Alliance.
|
||||
.TP 10
|
||||
\f4\-C num\fP
|
||||
When the size of the adder is greater or equal to \fBnum\fP a Carry Look Ahead
|
||||
adder is generated, instead of a Ripple Carry adder.
|
||||
(taken into account only with option -a).
|
||||
.TP 10
|
||||
\f4\-E num\fP
|
||||
Comparators are expanded in an equivalent set of boolean expressions, when their
|
||||
size is greater than \fBnum\fP
|
||||
(taken into account only with option -a).
|
||||
.TP 10
|
||||
\f4\-L\fP
|
||||
A file .lax (see lax(5) for details) is generated. This file contains the list of
|
||||
all signals that must be kept during the synthesis step, using \fBbop\fP (see
|
||||
bop(1) for details). (taken into account only with option -a).
|
||||
.TP 10
|
||||
\f4\-P file\fP
|
||||
Specifies a file containing a list of logical and physical package name:
|
||||
.nf
|
||||
# Example
|
||||
work.constants.all : pkg_constants
|
||||
work.components.all : pkg_components
|
||||
.fi
|
||||
.ti 7
|
||||
|
||||
.SH SEE ALSO
|
||||
.BR vasy (5),
|
||||
.BR vbe (5),
|
||||
.BR vhdl (5),
|
||||
.BR catal (5).
|
||||
.BR lax (5).
|
||||
.BR asimut (1),
|
||||
.BR bop (1),
|
||||
.BR MBK_WORK_LIB (1).
|
||||
.BR MBK_CATA_LIB (1).
|
||||
.BR MBK_CATAL_NAME (1).
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
man_MANS = vasy.5
|
||||
EXTRA_DIST = $(man_MANS)
|
|
@ -0,0 +1,261 @@
|
|||
.\" $Id: vasy.5,v 1.1 2002/03/26 15:17:16 ludo Exp $
|
||||
.\" @(#)VASY.5 1.0 Jan 28 1992 UPMC ; Ludovic Jacomme
|
||||
.TH VASY 5 "December 11, 1999" "ASIM/LIP6" "VHDL subset of VASY."
|
||||
|
||||
.SH NAME
|
||||
.PP
|
||||
\fBvasy\fP VHDL RTL subset.
|
||||
|
||||
.so man1/alc_origin.1
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
This document describes the VHDL subset accepted by VASY for RTL descriptions.
|
||||
|
||||
.PP
|
||||
\fBCONCURRENT STATEMENTS\fP
|
||||
.br
|
||||
In an RTL architecture most of the concurrent statements are supported.
|
||||
|
||||
.PP
|
||||
Allowed concurrent statements are:
|
||||
.RS
|
||||
block
|
||||
.br
|
||||
concurrent assertion
|
||||
.br
|
||||
process
|
||||
.br
|
||||
concurrent signal assignment
|
||||
.br
|
||||
component instantiation statement
|
||||
.RE
|
||||
generate statement
|
||||
.RE
|
||||
|
||||
.PP
|
||||
\fBSEQUENTIAL STATEMENTS\fP
|
||||
.br
|
||||
Inside a process, all sequential statements including loops, signal assignment,
|
||||
variable assignment are supported.
|
||||
|
||||
.PP
|
||||
\fBTYPE\fP
|
||||
.br
|
||||
All types usefull for synthesis are accepted (IEEE-1164 and IEEE-1076.3), and
|
||||
all types defined in the VHDL Alliance subset (see vbe(5) for more details).
|
||||
|
||||
.PP
|
||||
\fBOPERATORS\fP
|
||||
.br
|
||||
All operators usefull for synthesis are accepted, such as arithmetic, logical and relationnal operators (IEEE-1164 and IEEE-1076.3), and those defined in the VHDL Alliance subset
|
||||
(see vbe(5) for more details).
|
||||
|
||||
.PP
|
||||
\fBHARDWARE DESCRIPTION EXAMPLES\fP
|
||||
.br
|
||||
.PP
|
||||
A MULTIPLEXER may be described as follow:
|
||||
.nf
|
||||
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
entity mux is
|
||||
port(
|
||||
sel,a,b : in std_logic;
|
||||
mux_out : out std_logic );
|
||||
end mux;
|
||||
|
||||
architecture rtl_1 of mux is
|
||||
begin
|
||||
process( sel,a,b )
|
||||
begin
|
||||
if (sel='1') then mux_out <= a;
|
||||
else mux_out <= b;
|
||||
end if;
|
||||
end process;
|
||||
end rtl_1;
|
||||
|
||||
architecture rtl_2 of mux is
|
||||
begin
|
||||
mux_out <= a when sel='1' else b;
|
||||
end rtl_2;
|
||||
.fi
|
||||
|
||||
.PP
|
||||
A LATCH may be described as follow:
|
||||
.nf
|
||||
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
entity latch is
|
||||
port(
|
||||
en,a : in std_logic;
|
||||
latch_out : out std_logic );
|
||||
end latch;
|
||||
|
||||
architecture rtl_1 of latch is
|
||||
begin
|
||||
process( en, a )
|
||||
begin
|
||||
if (en='1') then latch_out <= a;
|
||||
end if;
|
||||
end process;
|
||||
end rtl_1;
|
||||
.fi
|
||||
|
||||
.PP
|
||||
A D-FLIP-FLOP may be described as follow:
|
||||
.nf
|
||||
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
entity d_ff is
|
||||
port(
|
||||
ck,a : in std_logic;
|
||||
d_ff_out : out std_logic );
|
||||
end d_ff;
|
||||
|
||||
architecture rtl_1 of d_ff is
|
||||
begin
|
||||
process( ck )
|
||||
begin
|
||||
if (ck='1') then d_ff_out <= a;
|
||||
end if;
|
||||
end process;
|
||||
end rtl_1;
|
||||
|
||||
architecture rtl_2 of d_ff is
|
||||
begin
|
||||
process( ck )
|
||||
begin
|
||||
if (ck='1' and ck'event)
|
||||
then d_ff_out <= a;
|
||||
end if;
|
||||
end process;
|
||||
end rtl_2;
|
||||
|
||||
architecture rtl_3 of d_ff is
|
||||
begin
|
||||
process
|
||||
begin
|
||||
wait until ck='1';
|
||||
d_ff_out <= a;
|
||||
end process;
|
||||
end rtl_3;
|
||||
.fi
|
||||
|
||||
.PP
|
||||
A TRISTATE BUFFER may be described as follow:
|
||||
.nf
|
||||
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
entity trs is
|
||||
port(
|
||||
en,a : in std_logic;
|
||||
trs_out : out std_logic );
|
||||
end trs;
|
||||
|
||||
architecture rtl_1 of trs is
|
||||
begin
|
||||
process( en,a )
|
||||
begin
|
||||
if (en='1') then trs_out <= a;
|
||||
else trs_out <= 'Z';
|
||||
end if;
|
||||
end process;
|
||||
end rtl_1;
|
||||
|
||||
architecture rtl_2 of d_ff is
|
||||
begin
|
||||
trs_out <= a when en='1' else 'Z';
|
||||
end rtl_2;
|
||||
.fi
|
||||
|
||||
.PP
|
||||
A RAM may be described as follow:
|
||||
.nf
|
||||
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
use IEEE.numeric_std.all;
|
||||
|
||||
entity ram is
|
||||
port( clk,wr : in std_logic;
|
||||
adr : std_logic_vector(1 downto 0);
|
||||
i0 : in std_logic_vector(3 downto 0);
|
||||
o0 : out std_logic_vector(3 downto 0)
|
||||
);
|
||||
end ram;
|
||||
|
||||
architecture rtl_1 of ram is
|
||||
type my_array is array (0 to 3) of std_logic_vector(3 downto 0);
|
||||
signal s : my_array;
|
||||
begin
|
||||
process
|
||||
begin
|
||||
wait until (clk='0' and clk'event);
|
||||
if (wr='1')
|
||||
then s(to_integer(unsigned(adr))) <= I0;
|
||||
end if;
|
||||
end process;
|
||||
o0 <= s(to_integer(unsigned(adr)));
|
||||
end rtl_1;
|
||||
.fi
|
||||
|
||||
.PP
|
||||
A ROM may be described as follow:
|
||||
.nf
|
||||
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
use IEEE.numeric_std.all;
|
||||
|
||||
entity rom is
|
||||
port( adr : in std_logic_vector(1 downto 0);
|
||||
o0 : out std_logic_vector(3 downto 0)
|
||||
);
|
||||
end rom;
|
||||
|
||||
architecture rtl_1 of rom is
|
||||
subtype my_word is std_logic_vector(3 downto 0);
|
||||
type my_array is array (0 to 3) of my_word;
|
||||
constant s : my_array := ( "0000", "0001", "0010", "0011" );
|
||||
begin
|
||||
o0 <= s(to_integer(unsigned(adr)));
|
||||
end rtl_1;
|
||||
.fi
|
||||
|
||||
.PP
|
||||
A PRIORITY DECODER may be described as follow:
|
||||
.nf
|
||||
|
||||
library IEEE;
|
||||
use IEEE.std_logic_1164.all;
|
||||
use IEEE.numeric_std.all;
|
||||
|
||||
entity decod is
|
||||
port( A : in std_logic_vector(3 downto 0);
|
||||
B : out std_logic_vector(2 downto 0));
|
||||
end decod;
|
||||
architecture rtl_1 of decod is
|
||||
begin
|
||||
process( a )
|
||||
begin
|
||||
b <= "111";
|
||||
for i in a'range -- Static For Loop are unrolled !
|
||||
loop
|
||||
exit when a(i)='1';
|
||||
b <= std_logic_vector(to_unsigned(i,3));
|
||||
end loop;
|
||||
end process;
|
||||
end rtl_1;
|
||||
.fi
|
||||
|
||||
.SH SEE ALSO
|
||||
.PP
|
||||
vasy(1), vbe(5), vhdl(5), vst(5), bop(1), glop(1), scmap(1), c4map(1), asimut(1), proof(1), yagle(1)
|
||||
|
||||
|
||||
.so man1/alc_bug_report.1
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
bin_PROGRAMS = vasy
|
||||
|
||||
vasy_LDADD = @LIBS@ \
|
||||
-lRtd -lRtn -lVtl -lVvh -lVpd -lVpn -lVbl -lVbh \
|
||||
-lVex -lBdd -lAbl -lAut -lMut \
|
||||
|
||||
vasy_SOURCES = \
|
||||
vasy_analys.c vasy_drvvlog.h vasy_mulwait.c vasy_redwait.h \
|
||||
vasy_analys.h vasy_elabo.c vasy_mulwait.h vasy_shared.c \
|
||||
vasy_array.c vasy_elabo.h vasy_onewait.c vasy_shared.h \
|
||||
vasy_array.h vasy_error.c vasy_onewait.h vasy_simprtl.c \
|
||||
vasy_debug.c vasy_error.h vasy_parse.c vasy_simprtl.h \
|
||||
vasy_debug.h vasy_func.c vasy_parse.h vasy_simul.c \
|
||||
vasy_drvalc.c vasy_func.h vasy_preanal.c vasy_simul.h \
|
||||
vasy_drvalc.h vasy_generate.c vasy_preanal.h vasy_support.c \
|
||||
vasy_drvrtl.c vasy_generate.h vasy_redact.c vasy_support.h \
|
||||
vasy_drvrtl.h vasy_generic.c vasy_redact.h vasy_synth.c \
|
||||
vasy_drvsyn.c vasy_generic.h vasy_redinst.c vasy_synth.h \
|
||||
vasy_drvsyn.h vasy_loop.c vasy_redinst.h vasy_vexbdd.c \
|
||||
vasy_drvvex.c vasy_loop.h vasy_reduce.c vasy_vexbdd.h \
|
||||
vasy_drvvex.h vasy_main.c vasy_reduce.h \
|
||||
vasy_drvvlog.c vasy_main.h vasy_redwait.c
|
|
@ -0,0 +1,256 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_analys.c |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "bdd.h"
|
||||
# include "vex.h"
|
||||
# include "vpn.h"
|
||||
# include "vtl.h"
|
||||
# include "rtn.h"
|
||||
|
||||
# include "vasy_error.h"
|
||||
# include "vasy_debug.h"
|
||||
# include "vasy_shared.h"
|
||||
# include "vasy_onewait.h"
|
||||
# include "vasy_mulwait.h"
|
||||
# include "vasy_synth.h"
|
||||
# include "vasy_analys.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyAnalysisVpnProc |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyAnalysisVpnProc( VpnFigure, RtlFigure, VpnProc )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
rtlfig_list *RtlFigure;
|
||||
vpnproc_list *VpnProc;
|
||||
{
|
||||
vpntrans_list *VpnTrans;
|
||||
vpnact_list *VpnAction;
|
||||
vasyprocinfo *ProcInfo;
|
||||
vexexpr *VexAtom;
|
||||
long NumberWait;
|
||||
long NumberAction;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, " --> VasyAnalysisVpnProc %s\n", VpnProc->NAME );
|
||||
}
|
||||
|
||||
ProcInfo = GetVasyVpnProcInfo( VpnProc );
|
||||
|
||||
NumberWait = 0;
|
||||
NumberAction = 0;
|
||||
|
||||
for ( VpnTrans = VpnProc->TRANS;
|
||||
VpnTrans != (vpntrans_list *)0;
|
||||
VpnTrans = VpnTrans->NEXT )
|
||||
{
|
||||
if ( VpnTrans->TYPE == VPN_TRANS_INF_WAIT ) NumberWait++;
|
||||
else
|
||||
if ( ( VpnTrans->TYPE == VPN_TRANS_ACT_EXEC ) ||
|
||||
( VpnTrans->TYPE == VPN_TRANS_ACT_GUARDED ) ) NumberAction++;
|
||||
|
||||
for ( VpnAction = VpnTrans->ACT;
|
||||
VpnAction != (vpnact_list *)0;
|
||||
VpnAction = VpnAction->NEXT )
|
||||
{
|
||||
if ( ( VpnAction->TYPE == VPN_ACT_CALL ) ||
|
||||
( VpnAction->TYPE == VPN_ACT_RETURN ) )
|
||||
{
|
||||
VasyErrorLine( VASY_NOT_YET_IMPLEMENTED_ERROR, VpnAction->LINE, "Call/Return" );
|
||||
}
|
||||
|
||||
VexAtom = VpnAction->VEX_ATOM;
|
||||
|
||||
if ( ! IsVexNodeAtom( VexAtom ) )
|
||||
{
|
||||
VasyErrorLine( VASY_NOT_YET_IMPLEMENTED_ERROR, VpnAction->LINE, "Indirect assignment" );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ProcInfo->NUMBER_WAIT = NumberWait;
|
||||
ProcInfo->NUMBER_ACTION = NumberAction;
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ Proc %s NumWait : %ld\n", VpnProc->NAME, NumberWait );
|
||||
VasyPrintf( stdout, " +++ Proc %s NumAction : %ld\n", VpnProc->NAME, NumberAction );
|
||||
}
|
||||
/*
|
||||
** No action in process, nothing more to do !
|
||||
*/
|
||||
if ( ProcInfo->NUMBER_ACTION == 0 )
|
||||
{
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ No action in process nothing to do\n" );
|
||||
}
|
||||
|
||||
ProcInfo->TYPE = VASY_PROC_UNUSED;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ProcInfo->NUMBER_WAIT != 1 )
|
||||
{
|
||||
VasyMultiWaitVpnProc( VpnFigure, RtlFigure, VpnProc );
|
||||
}
|
||||
else
|
||||
{
|
||||
VasyOneWaitVpnProc( VpnFigure, RtlFigure, VpnProc );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, " <-- VasyAnalysisVpnProc %s\n", VpnProc->NAME );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyAnalysisVpnFig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
rtlfig_list *VasyAnalysisVpnFig( VpnFigure )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
{
|
||||
rtlfig_list *RtlFigure;
|
||||
rtlasg_list *RtlAssign;
|
||||
vpnproc_list *VpnProc;
|
||||
long NumberReg;
|
||||
long NumberTrs;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyAnalysisVpnFig %s\n", VpnFigure->NAME );
|
||||
}
|
||||
|
||||
RtlFigure = addrtlfig( VpnFigure->NAME );
|
||||
|
||||
VasySynthesisVpnDecl( VpnFigure, RtlFigure );
|
||||
VasySynthesisVpnModel( VpnFigure, RtlFigure );
|
||||
VasySynthesisVpnInstance( VpnFigure, RtlFigure );
|
||||
|
||||
if ( IsVasyDebugStatistics() )
|
||||
{
|
||||
VasyDebugStartChrono(1);
|
||||
}
|
||||
|
||||
for ( VpnProc = VpnFigure->PROCESS;
|
||||
VpnProc != (vpnproc_list *)0;
|
||||
VpnProc = VpnProc->NEXT )
|
||||
{
|
||||
if ( IsVasyVpnProcToAnalyse( VpnProc ) )
|
||||
{
|
||||
VasyAnalysisVpnProc( VpnFigure, RtlFigure, VpnProc );
|
||||
}
|
||||
else
|
||||
{
|
||||
VasySynthesisCombinatorialVpnProc( VpnFigure, RtlFigure, VpnProc );
|
||||
}
|
||||
}
|
||||
|
||||
if ( IsVasyDebugStatistics() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> Semantic Analysis : %ld sec\n",
|
||||
VasyDebugReadChrono(1) );
|
||||
|
||||
NumberReg = 0;
|
||||
NumberTrs = 0;
|
||||
|
||||
for ( RtlAssign = RtlFigure->ASSIGN;
|
||||
RtlAssign != (rtlasg_list *)0;
|
||||
RtlAssign = RtlAssign->NEXT )
|
||||
{
|
||||
if ( RtlAssign->TYPE == RTL_ASG_REGISTER ) NumberReg++;
|
||||
else
|
||||
if ( ( RtlAssign->TYPE == RTL_ASG_TRISTATE ) ||
|
||||
( RtlAssign->TYPE == RTL_ASG_PULL_UP ) ||
|
||||
( RtlAssign->TYPE == RTL_ASG_PULL_DOWN ) ) NumberTrs++;
|
||||
}
|
||||
|
||||
VasyPrintf( stdout, "--> Number Register : %ld\n", NumberReg );
|
||||
VasyPrintf( stdout, "--> Number Tristate : %ld\n", NumberTrs );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyAnalysisVpnFig %s\n\n", VpnFigure->NAME );
|
||||
}
|
||||
|
||||
return( RtlFigure );
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_analys.h |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_ANALYS_H
|
||||
# define VASY_ANALYS_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern rtlfig_list *VasyAnalysisVpnFig();
|
||||
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_array.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 13.12.99 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
|
||||
# ifndef VASY_ARRAY_H
|
||||
# define VASY_ARRAY_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_VBH_TYPE_ARRAY_MASK 0x1
|
||||
# define VASY_VBH_TYPE_VECTOR_MASK 0x2
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define IsVasyVbhTypeArray( T ) ((T)->FLAGS & VASY_VBH_TYPE_ARRAY_MASK)
|
||||
# define SetVasyVbhTypeArray( T ) ((T)->FLAGS |= VASY_VBH_TYPE_ARRAY_MASK)
|
||||
# define ClearVasyVbhTypeArray( T ) ((T)->FLAGS &= ~VASY_VBH_TYPE_ARRAY_MASK)
|
||||
|
||||
# define IsVasyVbhTypeVector( T ) ((T)->FLAGS & VASY_VBH_TYPE_VECTOR_MASK)
|
||||
# define SetVasyVbhTypeVector( T ) ((T)->FLAGS |= VASY_VBH_TYPE_VECTOR_MASK)
|
||||
# define ClearVasyVbhTypeVector( T ) ((T)->FLAGS &= ~VASY_VBH_TYPE_VECTOR_MASK)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyExpandArrayVbhFig();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,309 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_debug.c |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "vpn.h"
|
||||
# include "vtl.h"
|
||||
|
||||
# include "vasy_error.h"
|
||||
# include "vasy_debug.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
int VasyDebugFlag = 0;
|
||||
int VasyDebugOption = 0;
|
||||
time_t VasyDebugChrono[ VASY_DEBUG_MAX_CHRONO ];
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Private variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static char *VasyDebugItemName[ ] =
|
||||
{
|
||||
"vasy_analys.c",
|
||||
"vasy_array.c",
|
||||
"vasy_debug.c",
|
||||
"vasy_drvalc.c",
|
||||
"vasy_drvrtl.c",
|
||||
"vasy_drvsyn.c",
|
||||
"vasy_drvvlog.c",
|
||||
"vasy_elabo.c",
|
||||
"vasy_error.c",
|
||||
"vasy_func.c",
|
||||
"vasy_generate.c",
|
||||
"vasy_generic.c",
|
||||
"vasy_loop.c",
|
||||
"vasy_main.c",
|
||||
"vasy_mulwait.c",
|
||||
"vasy_onewait.c",
|
||||
"vasy_parse.c",
|
||||
"vasy_preanal.c",
|
||||
"vasy_redact.c",
|
||||
"vasy_redinst.c",
|
||||
"vasy_reduce.c",
|
||||
"vasy_redwait.c",
|
||||
"vasy_shared.c",
|
||||
"vasy_simprtl.c",
|
||||
"vasy_simul.c",
|
||||
"vasy_support.c",
|
||||
"vasy_synth.c",
|
||||
"vasy_vexbdd.c",
|
||||
(char *)0
|
||||
};
|
||||
|
||||
static char *VasyDebugItemFlag = (char *)0;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDebugSetOption |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
int VasyDebugSetOption( Name )
|
||||
|
||||
char *Name;
|
||||
{
|
||||
if ( ! strcmp( Name, "no_redinst" ) )
|
||||
{
|
||||
SetVasyDebugNoRedInst(); return( 1 );
|
||||
}
|
||||
else
|
||||
if ( ! strcmp( Name, "stat" ) )
|
||||
{
|
||||
SetVasyDebugStatistics(); return( 1 );
|
||||
}
|
||||
else
|
||||
if ( ! strcmp( Name, "stdout" ) )
|
||||
{
|
||||
SetVasyDebugDriveStdout(); return( 1 );
|
||||
}
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDebugAddItem |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
int VasyDebugAddItem( Name, Mode )
|
||||
|
||||
char *Name;
|
||||
int Mode;
|
||||
{
|
||||
char Buffer[ 64 ];
|
||||
char *Item;
|
||||
int Index;
|
||||
|
||||
if ( VasyDebugItemFlag == (char *)0 )
|
||||
{
|
||||
Index = 0;
|
||||
|
||||
while ( VasyDebugItemName[ Index ] != (char *)0 )
|
||||
{
|
||||
VasyDebugItemName[ Index ] = namealloc( VasyDebugItemName[ Index ] );
|
||||
|
||||
Index++;
|
||||
}
|
||||
|
||||
VasyDebugItemFlag = autallocblock( Index );
|
||||
}
|
||||
|
||||
if ( ! strcmp( Name, "all" ) )
|
||||
{
|
||||
VasyDebugFlag |= Mode;
|
||||
|
||||
Index = 0;
|
||||
|
||||
while ( VasyDebugItemName[ Index ] != (char *)0 )
|
||||
{
|
||||
VasyDebugItemFlag[ Index ] |= Mode;
|
||||
|
||||
Index++;
|
||||
}
|
||||
|
||||
return( 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( Buffer, "vasy_%s.c", Name );
|
||||
Item = namealloc( Buffer );
|
||||
Index = 0;
|
||||
|
||||
while ( VasyDebugItemName[ Index ] != (char *)0 )
|
||||
{
|
||||
if ( Item == VasyDebugItemName[ Index ] )
|
||||
{
|
||||
VasyDebugItemFlag[ Index ] |= Mode;
|
||||
VasyDebugFlag |= Mode;
|
||||
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
Index++;
|
||||
}
|
||||
}
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDebugSearchItem |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
int VasyDebugSearchItem( Item, Mode )
|
||||
|
||||
char *Item;
|
||||
int Mode;
|
||||
{
|
||||
int Index;
|
||||
|
||||
if ( ( Mode & VasyDebugFlag ) == Mode )
|
||||
{
|
||||
Item = namealloc( Item );
|
||||
Index = 0;
|
||||
|
||||
while ( VasyDebugItemName[ Index ] != (char *)0 )
|
||||
{
|
||||
if ( Item == VasyDebugItemName[ Index ] )
|
||||
{
|
||||
return( ( VasyDebugItemFlag[ Index ] & Mode ) == Mode );
|
||||
}
|
||||
|
||||
Index++;
|
||||
}
|
||||
}
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDebugLocSaveVpnFig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyDebugLocSaveVpnFig( VpnFigure, FileName, Line )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
char *FileName;
|
||||
int Line;
|
||||
{
|
||||
static char Buffer[ 32 ];
|
||||
static int Number = 0;
|
||||
|
||||
char *Name;
|
||||
char *VpnOut;
|
||||
int Length;
|
||||
|
||||
Name = VpnFigure->NAME;
|
||||
VpnOut = VPN_OUT;
|
||||
|
||||
sprintf( Buffer, "%03d_%04d", Number++, Line );
|
||||
Length = strlen( Buffer );
|
||||
|
||||
FileName = FileName + 4;
|
||||
strcpy( Buffer + Length, FileName );
|
||||
Length += strlen( FileName );
|
||||
Buffer[ Length - 2 ] = '\0';
|
||||
|
||||
VpnFigure->NAME = namealloc( Buffer );
|
||||
VPN_OUT = namealloc( "vpn" );
|
||||
|
||||
fprintf( stdout, " +++ VasyDebugSaveVpnFig %s.vpn\n", VpnFigure->NAME );
|
||||
savevpnfig( VpnFigure );
|
||||
|
||||
VpnFigure->NAME = Name;
|
||||
VPN_OUT = VpnOut;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDebugPrint |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyDebugPrint( FileName, Line )
|
||||
|
||||
char *FileName;
|
||||
int Line;
|
||||
{
|
||||
char Buffer[ 32 ];
|
||||
int Length;
|
||||
|
||||
FileName = FileName + 5;
|
||||
Length = strlen( FileName );
|
||||
strcpy( Buffer, FileName );
|
||||
Buffer[ Length - 2 ] = '\0';
|
||||
|
||||
fprintf( stdout, "%-8s%4d ", Buffer, Line );
|
||||
}
|
|
@ -0,0 +1,163 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_debug.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_DEBUG_H
|
||||
# define VASY_DEBUG_H
|
||||
|
||||
# include <time.h>
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Debug Mode |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_DEBUG_LEVEL0 0x01
|
||||
# define VASY_DEBUG_LEVEL1 0x03
|
||||
# define VASY_DEBUG_LEVEL2 0x07
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Debug Option |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_DEBUG_NO_RED_INST 0x01
|
||||
# define VASY_DEBUG_STATISTICS 0x02
|
||||
# define VASY_DEBUG_DRIVE_STDOUT 0x04
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Chrono |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_DEBUG_MAX_CHRONO 10
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Save Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VasyDebugSaveVpnFig( F ) \
|
||||
\
|
||||
(VasyDebugLocSaveVpnFig( (F), __FILE__, __LINE__ ))
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Debug Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define IsVasyDebugLevel0() (VasyDebugSearchItem( __FILE__, VASY_DEBUG_LEVEL0))
|
||||
# define IsVasyDebugLevel1() (VasyDebugSearchItem( __FILE__, VASY_DEBUG_LEVEL1))
|
||||
# define IsVasyDebugLevel2() (VasyDebugSearchItem( __FILE__, VASY_DEBUG_LEVEL2))
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Print Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VasyPrintf VasyDebugPrint( __FILE__, __LINE__ ); fprintf
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Debug Option Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define IsVasyDebugNoRedInst() (VasyDebugOption & VASY_DEBUG_NO_RED_INST)
|
||||
# define SetVasyDebugNoRedInst() (VasyDebugOption |= VASY_DEBUG_NO_RED_INST)
|
||||
# define IsVasyDebugStatistics() (VasyDebugOption & VASY_DEBUG_STATISTICS)
|
||||
# define SetVasyDebugStatistics() (VasyDebugOption |= VASY_DEBUG_STATISTICS)
|
||||
# define IsVasyDebugDriveStdout() (VasyDebugOption & VASY_DEBUG_DRIVE_STDOUT)
|
||||
# define SetVasyDebugDriveStdout() (VasyDebugOption |= VASY_DEBUG_DRIVE_STDOUT)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Time Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VasyDebugStartChrono(N) (void)time(&VasyDebugChrono[(N)])
|
||||
# define VasyDebugReadChrono(N) (time((void *)0) - VasyDebugChrono[(N)])
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern int VasyDebugFlag;
|
||||
extern int VasyDebugOption;
|
||||
extern time_t VasyDebugChrono[ VASY_DEBUG_MAX_CHRONO ];
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern int VasyDebugSearchItem();
|
||||
extern int VasyDebugAddItem();
|
||||
|
||||
extern int VasyDebugSetOption();
|
||||
|
||||
extern void VasyDebugLocSaveVpnFig();
|
||||
extern void VasyDebugPrint();
|
||||
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,72 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_drvalc.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
|
||||
# ifndef VASY_DRVALC_H
|
||||
# define VASY_DRVALC_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyDriveAllianceRtlFig();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,131 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_drvrtl.c |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "bdd.h"
|
||||
# include "vex.h"
|
||||
# include "vpn.h"
|
||||
# include "vtl.h"
|
||||
# include "rtn.h"
|
||||
# include "rtd.h"
|
||||
|
||||
# include "vasy_debug.h"
|
||||
# include "vasy_error.h"
|
||||
# include "vasy_simprtl.h"
|
||||
# include "vasy_shared.h"
|
||||
# include "vasy_drvrtl.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Private variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDriveRtlCheck |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyDriveRtlCheck( RtlFigure )
|
||||
|
||||
rtlfig_list *RtlFigure;
|
||||
{
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDriveRtlRtlFig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyDriveRtlRtlFig( RtlFigure, FileName )
|
||||
|
||||
rtlfig_list *RtlFigure;
|
||||
char *FileName;
|
||||
{
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyDriveRtlRtlFig %s\n", FileName );
|
||||
}
|
||||
|
||||
RtlFigure->NAME = namealloc( FileName );
|
||||
|
||||
VasyDriveRtlCheck( RtlFigure );
|
||||
savertlfig( RtlFigure );
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
viewrtlfig( RtlFigure );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyDriveRtlRtlFig %s\n\n", FileName );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_drvrtl.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_DRVRTL_H
|
||||
# define VASY_DRVRTL_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyDriveRtlRtlFig();
|
||||
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_drvsyn.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_DRVSYN_H
|
||||
# define VASY_DRVSYN_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_TYPE_ERROR -1
|
||||
# define VASY_TYPE_BOOLEAN 0
|
||||
# define VASY_TYPE_BIT 1
|
||||
# define VASY_TYPE_LOGIC 2
|
||||
# define VASY_TYPE_SIGNED 3
|
||||
# define VASY_TYPE_UNSIGNED 4
|
||||
|
||||
# define VASY_MAX_TYPE 5
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyDriveSynopsysRtlFig();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,351 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_drvvex.c |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "bdd.h"
|
||||
# include "vex.h"
|
||||
# include "vpn.h"
|
||||
# include "vtl.h"
|
||||
# include "rtn.h"
|
||||
|
||||
# include "vasy_debug.h"
|
||||
# include "vasy_error.h"
|
||||
# include "vasy_simprtl.h"
|
||||
# include "vasy_shared.h"
|
||||
# include "vasy_drvvex.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Private variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static FILE *VasyFile = (FILE *)0;
|
||||
static rtlfig_list *VasyFigure = (rtlfig_list *)0;
|
||||
static long VasyDriveLength = 0;
|
||||
static int VasyVerilog = 0;
|
||||
|
||||
static int VasyDriveVexAtomLock = 0;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDriveVexFile |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyDriveVexFile( String, Length )
|
||||
|
||||
char *String;
|
||||
int Length;
|
||||
{
|
||||
VasyDriveLength += Length;
|
||||
|
||||
if ( ( ! VasyDriveVexAtomLock ) &&
|
||||
( VasyDriveLength >= VASY_DRIVE_VEX_LENGTH ) )
|
||||
{
|
||||
fprintf( VasyFile, "\n" );
|
||||
VasyDriveLength = 0;
|
||||
}
|
||||
|
||||
if ( *String )
|
||||
{
|
||||
fwrite( String, sizeof(char), Length, VasyFile );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDriveVexAtom |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyDriveVexAtom( Expr )
|
||||
|
||||
vexexpr *Expr;
|
||||
{
|
||||
rtldecl_list *RtlDeclar;
|
||||
vexexpr *RtlAtom;
|
||||
char *String;
|
||||
char Buffer[32];
|
||||
int Index;
|
||||
int Length;
|
||||
|
||||
VasyDriveVexAtomLock = 1;
|
||||
|
||||
String = GetVexAtomValue( Expr );
|
||||
Length = strlen( String );
|
||||
|
||||
if ( ( VasyVerilog ) &&
|
||||
( IsVexAtomLiteral ( Expr ) ) )
|
||||
{
|
||||
sprintf( Buffer, "%d'b", Expr->WIDTH );
|
||||
VasyDriveVexFile( Buffer, strlen( Buffer ) );
|
||||
|
||||
for ( Index = 1; Index < Length - 1; Index++ )
|
||||
{
|
||||
if ( ( String[ Index ] == '-' ) ||
|
||||
( String[ Index ] == 'd' ) ) VasyDriveVexFile( "?", 1 );
|
||||
else VasyDriveVexFile( String + Index, 1 );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VasyDriveVexFile( String, Length );
|
||||
}
|
||||
|
||||
if ( ( IsVexAtomVector( Expr ) ) &&
|
||||
( ! IsVexAtomLiteral( Expr ) ) )
|
||||
{
|
||||
if ( Expr->LEFT == Expr->RIGHT )
|
||||
{
|
||||
if ( VasyVerilog ) sprintf( Buffer, "[%d]", Expr->LEFT );
|
||||
else sprintf( Buffer, "(%d)", Expr->LEFT );
|
||||
}
|
||||
else
|
||||
{
|
||||
RtlDeclar = searchrtldecl( VasyFigure, String );
|
||||
|
||||
if ( RtlDeclar != (rtldecl_list *)0 )
|
||||
{
|
||||
RtlAtom = RtlDeclar->VEX_ATOM;
|
||||
|
||||
if ( ( Expr->LEFT == RtlAtom->LEFT ) &&
|
||||
( Expr->RIGHT == RtlAtom->RIGHT ) ) return;
|
||||
}
|
||||
|
||||
if ( VasyVerilog )
|
||||
{
|
||||
sprintf( Buffer, "[%d:%d]", Expr->LEFT, Expr->RIGHT );
|
||||
}
|
||||
else
|
||||
if ( Expr->LEFT < Expr->RIGHT )
|
||||
{
|
||||
sprintf( Buffer, "(%d to %d)", Expr->LEFT, Expr->RIGHT );
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf( Buffer, "(%d downto %d)", Expr->LEFT, Expr->RIGHT );
|
||||
}
|
||||
}
|
||||
|
||||
VasyDriveVexFile( Buffer, strlen( Buffer ) );
|
||||
}
|
||||
|
||||
VasyDriveVexAtomLock = 0;
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDriveVexExpr |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void loc_VasyDriveVexExpr( Expr )
|
||||
|
||||
vexexpr *Expr;
|
||||
{
|
||||
chain_list *ScanOper;
|
||||
long Oper;
|
||||
char *String;
|
||||
int Length;
|
||||
|
||||
if ( IsVexNodeAtom( Expr ) )
|
||||
{
|
||||
VasyDriveVexAtom( Expr );
|
||||
}
|
||||
else
|
||||
if ( IsVexNodeOper( Expr ) )
|
||||
{
|
||||
Oper = GetVexOperValue( Expr );
|
||||
|
||||
if ( VasyVerilog ) String = getvexoperverilogname( Oper );
|
||||
else String = getvexoperuppername( Oper );
|
||||
|
||||
if ( String == (char *)0 )
|
||||
{
|
||||
VasyError( VASY_ERROR_IN_DRVVEX, Oper );
|
||||
}
|
||||
|
||||
Length = strlen( String );
|
||||
|
||||
if ( isvexunaryoper( Oper ) )
|
||||
{
|
||||
if ( ( Oper == VEX_EVENT ) ||
|
||||
( Oper == VEX_DRIVER ) )
|
||||
{
|
||||
VasyDriveVexFile( "(", 1 );
|
||||
|
||||
loc_VasyDriveVexExpr( GetVexOperand( Expr->OPERAND ) );
|
||||
|
||||
VasyDriveVexFile( "'", 1 );
|
||||
VasyDriveVexFile( String, Length );
|
||||
}
|
||||
else
|
||||
if ( Oper == VEX_NEG )
|
||||
{
|
||||
VasyDriveVexFile( "(-", 2 );
|
||||
loc_VasyDriveVexExpr( GetVexOperand( Expr->OPERAND ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
VasyDriveVexFile( String, Length );
|
||||
VasyDriveVexFile( "(", 1 );
|
||||
loc_VasyDriveVexExpr( GetVexOperand( Expr->OPERAND ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( isvexpositiveoper( Oper ) )
|
||||
{
|
||||
if ( ( VasyVerilog ) &&
|
||||
( Oper == VEX_CONCAT ) ) VasyDriveVexFile( "{", 1 );
|
||||
else VasyDriveVexFile( "(", 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( VasyVerilog )
|
||||
{
|
||||
VasyDriveVexFile( "~(", 2 );
|
||||
String = getvexoperverilogname( getvexnotoper( Oper ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
VasyDriveVexFile( "NOT(", 4 );
|
||||
String = getvexoperuppername( getvexnotoper( Oper ) );
|
||||
}
|
||||
|
||||
Length = strlen( String );
|
||||
}
|
||||
|
||||
for ( ScanOper = Expr->OPERAND;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
loc_VasyDriveVexExpr( GetVexOperand( ScanOper ) );
|
||||
|
||||
if ( ScanOper->NEXT != (chain_list *)0 )
|
||||
{
|
||||
VasyDriveVexFile( " ", 1 );
|
||||
VasyDriveVexFile( String, Length );
|
||||
VasyDriveVexFile( " ", 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ( VasyVerilog ) &&
|
||||
( Oper == VEX_CONCAT ) ) VasyDriveVexFile( "}", 1 );
|
||||
else VasyDriveVexFile( ")", 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
String = GetVexFuncValue( Expr );
|
||||
Length = strlen( String );
|
||||
|
||||
VasyDriveVexFile( String, Length );
|
||||
VasyDriveVexFile( "(", 1 );
|
||||
|
||||
for ( ScanOper = Expr->OPERAND;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
loc_VasyDriveVexExpr( GetVexOperand( ScanOper ) );
|
||||
|
||||
if ( ScanOper->NEXT != (chain_list *)0 )
|
||||
{
|
||||
VasyDriveVexFile( ",", 1 );
|
||||
}
|
||||
}
|
||||
|
||||
VasyDriveVexFile( ")", 1 );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDriveVexExpr |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyDriveVexExpr( File, RtlFigure, Expr, Verilog )
|
||||
|
||||
FILE *File;
|
||||
rtlfig_list *RtlFigure;
|
||||
vexexpr *Expr;
|
||||
int Verilog;
|
||||
{
|
||||
if ( Expr != (vexexpr *)0 )
|
||||
{
|
||||
VasyFigure = RtlFigure;
|
||||
VasyFile = File;
|
||||
VasyDriveLength = 0;
|
||||
VasyVerilog = Verilog;
|
||||
|
||||
loc_VasyDriveVexExpr( Expr );
|
||||
}
|
||||
}
|
|
@ -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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_drvvex.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_DRVVEX_H
|
||||
# define VASY_DRVVEX_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_DRIVE_VEX_LENGTH 80
|
||||
|
||||
# define VASY_DRIVE_VEX_VECTOR_MASK VEX_NODE_USER1_MASK
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VasyDriveVexExprVhdl( F, R, E ) (VasyDriveVexExpr( (F), (R), (E), 0 ))
|
||||
# define VasyDriveVexExprVerilog( F, R, E ) (VasyDriveVexExpr( (F), (R), (E), 1 ))
|
||||
|
||||
# define IsVasyDriveVexVector( N ) ( (N)->TYPE & VASY_DRIVE_VEX_VECTOR_MASK )
|
||||
# define SetVasyDriveVexVector( N ) ( (N)->TYPE |= VASY_DRIVE_VEX_VECTOR_MASK )
|
||||
# define ClearVasyDriveVexVector( N ) ( (N)->TYPE &= ~VASY_DRIVE_VEX_VECTOR_MASK )
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyDriveVexExpr();
|
||||
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,87 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_drvvlog.h |
|
||||
| |
|
||||
| Authors : Frédéric Pétrot |
|
||||
| This file is a basic modification of vasy_drvsyn |
|
||||
| Modified by Ludovic Jacomme |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_DRVVLOG_H
|
||||
# define VASY_DRVVLOG_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_VERILOG_SENS_NOEDGE 0
|
||||
# define VASY_VERILOG_SENS_NEGEDGE 1
|
||||
# define VASY_VERILOG_SENS_POSEDGE 2
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Rtl Assign Sens |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyRtlAsgVerilogSens( A, S ) ((A)->USER = (void *)(S))
|
||||
# define GetVasyRtlAsgVerilogSens( A ) ((ptype_list *)(A)->USER)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyDriveVerilogRtlFig();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,208 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_elabo.c |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "vpn.h"
|
||||
# include "vtl.h"
|
||||
|
||||
# include "vasy_elabo.h"
|
||||
# include "vasy_simul.h"
|
||||
# include "vasy_debug.h"
|
||||
# include "vasy_error.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyElaborateVpnFig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyElaborateVpnFig( VpnFigure )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
{
|
||||
vpnproc_list *VpnProc;
|
||||
vpndecl_list *VpnDeclar;
|
||||
vpnsym *VpnSymbol;
|
||||
vexexpr *DeclAtom;
|
||||
vexexpr *DeclInit;
|
||||
vasysimul *SimulInit;
|
||||
char *SimulValue;
|
||||
char Buffer[ 2048 ];
|
||||
int LiteralId;
|
||||
short Width;
|
||||
short Position;
|
||||
short Type;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyElaborateVpnFig %s\n", VpnFigure->NAME );
|
||||
}
|
||||
|
||||
SimulInit = (vasysimul *)0;
|
||||
/*
|
||||
** For all declarations set initial value
|
||||
*/
|
||||
for ( Type = 0; Type < VPN_MAX_DECLAR_TYPE; Type++ )
|
||||
{
|
||||
for ( VpnDeclar = VpnFigure->DECLAR[ Type ];
|
||||
VpnDeclar != (vpndecl_list *)0;
|
||||
VpnDeclar = VpnDeclar->NEXT )
|
||||
{
|
||||
DeclAtom = VpnDeclar->VEX_ATOM;
|
||||
DeclInit = VpnDeclar->VEX_INIT;
|
||||
Width = DeclAtom->WIDTH;
|
||||
|
||||
if ( DeclInit != (vexexpr *)0 )
|
||||
{
|
||||
if ( IsVasyDebugLevel2() )
|
||||
{
|
||||
VasyPrintf( stdout, " --> Initial value of " );
|
||||
viewvexexprboundln( DeclAtom );
|
||||
}
|
||||
|
||||
SimulInit = VasySimulateVexExpr( VpnFigure, DeclAtom, DeclInit );
|
||||
SimulValue = SimulInit->VALUE;
|
||||
|
||||
if ( IsVasyDebugLevel2() )
|
||||
{
|
||||
VasyPrintf( stdout, " <-- Initial value\n" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SimulValue = (char *)0;
|
||||
}
|
||||
|
||||
for ( Position = 0; Position < Width; Position++ )
|
||||
{
|
||||
VpnSymbol = &VpnDeclar->DECL_SYM[ Position ];
|
||||
|
||||
if ( SimulValue != (char *)0 ) VpnSymbol->INIT = SimulValue[ Position ];
|
||||
else VpnSymbol->INIT = VEX_ZERO_ID;
|
||||
|
||||
VpnSymbol->EFFEC = VpnSymbol->INIT;
|
||||
VpnSymbol->DRIVE = VpnSymbol->INIT;
|
||||
VpnSymbol->EVENT = 1;
|
||||
}
|
||||
|
||||
if ( SimulValue != (char *)0 ) VasySimulateDelSimul( SimulInit );
|
||||
}
|
||||
}
|
||||
/*
|
||||
** For all process make elaboration
|
||||
*/
|
||||
for ( VpnProc = VpnFigure->PROCESS;
|
||||
VpnProc != (vpnproc_list *)0;
|
||||
VpnProc = VpnProc->NEXT )
|
||||
{
|
||||
VasySimulateVpnProc( VpnFigure, VpnProc );
|
||||
}
|
||||
/*
|
||||
** For all declarations set new init value
|
||||
*/
|
||||
for ( Type = 0; Type < VPN_MAX_DECLAR_TYPE; Type++ )
|
||||
{
|
||||
for ( VpnDeclar = VpnFigure->DECLAR[ Type ];
|
||||
VpnDeclar != (vpndecl_list *)0;
|
||||
VpnDeclar = VpnDeclar->NEXT )
|
||||
{
|
||||
DeclAtom = VpnDeclar->VEX_ATOM;
|
||||
Width = DeclAtom->WIDTH;
|
||||
|
||||
for ( Position = 0; Position < Width; Position++ )
|
||||
{
|
||||
VpnSymbol = &VpnDeclar->DECL_SYM[ Position ];
|
||||
|
||||
if ( ( VpnDeclar->TYPE == VPN_DECLAR_DEFINE ) ||
|
||||
( VpnDeclar->TYPE == VPN_DECLAR_VARIABLE ) ) LiteralId = VpnSymbol->EFFEC;
|
||||
else LiteralId = VpnSymbol->DRIVE;
|
||||
|
||||
Buffer[ Position + 1 ] = VEX_LITERAL_BY_ID[ LiteralId ];
|
||||
}
|
||||
|
||||
Position++;
|
||||
|
||||
if ( IsVexAtomVector( DeclAtom ) )
|
||||
{
|
||||
Buffer[ 0 ] = '\"';
|
||||
Buffer[ Position ] = '\"';
|
||||
}
|
||||
else
|
||||
{
|
||||
Buffer[ 0 ] = '\'';
|
||||
Buffer[ Position ] = '\'';
|
||||
}
|
||||
|
||||
Buffer[ Position + 1 ] = '\0';
|
||||
|
||||
freevexexpr( VpnDeclar->VEX_INIT );
|
||||
VpnDeclar->VEX_INIT = createvexatomlit( Buffer );
|
||||
}
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyElaborateVpnFig %s\n", VpnFigure->NAME );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_elabo.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_ELABO_H
|
||||
# define VASY_ELABO_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Tag |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_ELABORATE_TAG_MASK (long)0x01
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyElaborateTag( O ) ((O)->FLAGS |= VASY_ELABORATE_TAG_MASK)
|
||||
# define ClearVasyElaborateTag( O ) ((O)->FLAGS &= ~VASY_ELABORATE_TAG_MASK)
|
||||
# define IsVasyElaborateTag( O ) ((O)->FLAGS & VASY_ELABORATE_TAG_MASK)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
typedef struct vasyelab
|
||||
{
|
||||
char *VALUE;
|
||||
unsigned short WIDTH;
|
||||
unsigned short SIGNED;
|
||||
|
||||
} vasyelab;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyElaborateVpnFig();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,221 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_error.c |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "bdd.h"
|
||||
# include "vex.h"
|
||||
# include "vpn.h"
|
||||
# include "vtl.h"
|
||||
|
||||
# include "vasy_error.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Private variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Local Display Lines |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyDisplayLines( VpnLine )
|
||||
|
||||
vpnline_list *VpnLine;
|
||||
{
|
||||
if ( VpnLine != (vpnline_list *)0 )
|
||||
{
|
||||
fprintf( stderr, " in line [" );
|
||||
|
||||
while ( VpnLine != (vpnline_list *)0 )
|
||||
{
|
||||
fprintf( stderr, "%ld", VpnLine->LINE );
|
||||
|
||||
if ( VpnLine->NEXT != (vpnline_list *)0 )
|
||||
{
|
||||
fprintf( stderr, "," );
|
||||
}
|
||||
|
||||
VpnLine = VpnLine->NEXT;
|
||||
}
|
||||
|
||||
fprintf( stderr, "]" );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDisplayError |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyDisplayError( File, Line, Error, VpnLine, Text )
|
||||
|
||||
char *File;
|
||||
int Line;
|
||||
int Error;
|
||||
vpnline_list *VpnLine;
|
||||
char *Text;
|
||||
{
|
||||
char *Name;
|
||||
|
||||
Name = mbkstrdup( File );
|
||||
Name[ strlen( File ) - 1 ] = '\0';
|
||||
|
||||
fprintf( stderr, "%s%d ", Name, Line );
|
||||
mbkfree( Name );
|
||||
|
||||
switch( Error )
|
||||
{
|
||||
case VASY_ILLEGAL_ASSIGN_ERROR :
|
||||
fprintf( stderr, "Illegal dynamic assignation of symbol %s", Text );
|
||||
break;
|
||||
case VASY_NO_WAIT_IN_PROCESS_ERROR :
|
||||
fprintf( stderr, "No wait in process %s", Text );
|
||||
break;
|
||||
case VASY_NOT_YET_IMPLEMENTED_ERROR :
|
||||
fprintf( stderr, "%s not yet implemented", Text );
|
||||
break;
|
||||
case VASY_LOOP_IN_SIMULATION :
|
||||
fprintf( stderr, "Loop in elaborate place %s", Text );
|
||||
break;
|
||||
case VASY_ERROR_IN_SIMULATION :
|
||||
fprintf( stderr, "Elaborate error %s", Text );
|
||||
break;
|
||||
case VASY_ERROR_IN_SUPPORT :
|
||||
fprintf( stderr, "Support error bad operator %s", Text );
|
||||
break;
|
||||
case VASY_ERROR_IN_VEX2BDD :
|
||||
fprintf( stderr, "Vex2Bdd error bad operator %s", Text );
|
||||
break;
|
||||
case VASY_ERROR_IN_ABL2VEX :
|
||||
fprintf( stderr, "Abl2Vex error bad operator %s", Text );
|
||||
break;
|
||||
case VASY_ERROR_IN_DRVVEX :
|
||||
fprintf( stderr, "DrvVex error bad operator %ld", (long)Text );
|
||||
break;
|
||||
case VASY_ERROR_OPERATOR_NOT_SUPPORTED :
|
||||
fprintf( stderr, "SimpRtl error bad operator %s", Text );
|
||||
break;
|
||||
case VASY_ERROR_IN_UNROLL_LOOP :
|
||||
fprintf( stderr, "Non static range in FOR loop" );
|
||||
break;
|
||||
case VASY_LOOP_IN_REDUCTION :
|
||||
fprintf( stderr, "Loop in reduction transition %s", Text );
|
||||
break;
|
||||
case VASY_ERROR_ILLEGAL_USE_OF :
|
||||
fprintf( stderr, "Illegale use of %s", Text );
|
||||
break;
|
||||
case VASY_ERROR_CONVERT_WRONG_TYPE :
|
||||
fprintf( stderr, "Unable to convert, wrong type %s", Text );
|
||||
return;
|
||||
break;
|
||||
|
||||
default : fprintf( stderr, "Internal error number %d", Error );
|
||||
}
|
||||
|
||||
VasyDisplayLines( VpnLine );
|
||||
fprintf( stderr, "\n" );
|
||||
|
||||
autexit( 1 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDisplayWarning |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyDisplayWarning( File, Line, Warning, VpnLine, Text )
|
||||
|
||||
char *File;
|
||||
int Line;
|
||||
int Warning;
|
||||
vpnline_list *VpnLine;
|
||||
char *Text;
|
||||
{
|
||||
char *Name;
|
||||
|
||||
Name = mbkstrdup( File );
|
||||
Name[ strlen( File ) - 1 ] = '\0';
|
||||
|
||||
fprintf( stderr, "%s%d ", Name, Line );
|
||||
|
||||
switch ( Warning )
|
||||
{
|
||||
case VASY_WARNING_IN_SIMULATION :
|
||||
fprintf( stderr, "Elaborate warning %s", Text );
|
||||
break;
|
||||
default : fprintf( stderr, "Internal warning number %d", Warning );
|
||||
}
|
||||
|
||||
VasyDisplayLines( VpnLine );
|
||||
fprintf( stderr, "\n" );
|
||||
}
|
|
@ -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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_error.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_ERROR_H
|
||||
# define VASY_ERROR_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Errors |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_ILLEGAL_ASSIGN_ERROR 0
|
||||
# define VASY_NO_WAIT_IN_PROCESS_ERROR 1
|
||||
# define VASY_NOT_YET_IMPLEMENTED_ERROR 2
|
||||
# define VASY_LOOP_IN_SIMULATION 3
|
||||
# define VASY_ERROR_IN_SIMULATION 4
|
||||
# define VASY_ERROR_IN_SUPPORT 5
|
||||
# define VASY_ERROR_IN_VEX2BDD 6
|
||||
# define VASY_ERROR_IN_ABL2VEX 7
|
||||
# define VASY_ERROR_IN_DRVVEX 8
|
||||
# define VASY_ERROR_OPERATOR_NOT_SUPPORTED 9
|
||||
# define VASY_ERROR_IN_UNROLL_LOOP 10
|
||||
# define VASY_LOOP_IN_REDUCTION 11
|
||||
# define VASY_ERROR_ILLEGAL_USE_OF 12
|
||||
# define VASY_ERROR_CONVERT_WRONG_TYPE 13
|
||||
|
||||
# define VASY_WARNING_IN_SIMULATION 1
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Warnings |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VasyError( E, T ) \
|
||||
\
|
||||
VasyDisplayError( __FILE__, __LINE__, (E), (vpnline_list *)0, (T) )
|
||||
|
||||
# define VasyWarning( W, T ) \
|
||||
\
|
||||
VasyDisplayWarning( __FILE__, __LINE__, (W), (vpnline_list *)0, (T) )
|
||||
|
||||
# define VasyErrorLine( E, L, T ) \
|
||||
\
|
||||
VasyDisplayError( __FILE__, __LINE__, (E), (vpnline_list *)(L), (T) )
|
||||
|
||||
# define VasyWarningLine( W, L, T ) \
|
||||
\
|
||||
VasyDisplayWarning( __FILE__, __LINE__, (W), (vpnline_list *)(L), (T) )
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyDisplayError();
|
||||
extern void VasyDisplayWarning();
|
||||
extern void VasyDisplayLines();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,454 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_func.c |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "vpn.h"
|
||||
# include "vtl.h"
|
||||
|
||||
# include "vasy_func.h"
|
||||
# include "vasy_redact.h"
|
||||
# include "vasy_debug.h"
|
||||
# include "vasy_error.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vpnline_list *VasyVpnLine = (vpnline_list *)0;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Private variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# if 0
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyFuncAddVpnDefine |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vpndecl_list *VasyFuncAddVpnDefine( VpnFigure, VpnProc, Width, DefBase )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
vpnproc_list *VpnProc;
|
||||
unsigned short Width;
|
||||
unsigned char DefBase;
|
||||
{
|
||||
vpndecl_list *DefDeclar;
|
||||
vexexpr *DefAtom;
|
||||
char *FatherName;
|
||||
char Buffer[ 128 ];
|
||||
unsigned char NewBase;
|
||||
long Number;
|
||||
|
||||
FatherName = VpnProc->NAME;
|
||||
Number = GetVpnNumDeclDef( VpnFigure );
|
||||
|
||||
sprintf( Buffer, "%s_std_%ld", FatherName, Number );
|
||||
|
||||
NewBase = getvextypescalar( DefBase );
|
||||
|
||||
if ( ( isvextypevector( DefBase ) ) &&
|
||||
( ( Width > 1 ) ||
|
||||
( NewBase == DefBase ) ) )
|
||||
{
|
||||
DefAtom = createvexatomvec( Buffer, Width - 1, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
DefAtom = createvexatombit( Buffer );
|
||||
DefBase = NewBase;
|
||||
}
|
||||
|
||||
DefDeclar = addvpndeclprocdef( VpnFigure, VpnProc, DefAtom, DefBase );
|
||||
|
||||
return( DefDeclar );
|
||||
}
|
||||
# endif
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyFuncSubstVexStdFunc |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vexexpr *VasyFuncSubstVexStdFunc( Expr )
|
||||
|
||||
vexexpr *Expr;
|
||||
{
|
||||
vexexpr *Operand;
|
||||
vexexpr *VexInt;
|
||||
chain_list *ScanChain;
|
||||
long Length;
|
||||
int FuncId;
|
||||
char *FuncName;
|
||||
|
||||
if ( ( IsVexNodeOper( Expr ) ) ||
|
||||
( IsVexNodeFunc( Expr ) ) )
|
||||
{
|
||||
for ( ScanChain = Expr->OPERAND;
|
||||
ScanChain != (chain_list *)0;
|
||||
ScanChain = ScanChain->NEXT )
|
||||
{
|
||||
Operand = GetVexOperand( ScanChain );
|
||||
Operand = VasyFuncSubstVexStdFunc( Operand );
|
||||
SetVexOperand( ScanChain, Operand );
|
||||
}
|
||||
|
||||
if ( IsVexNodeFunc( Expr ) )
|
||||
{
|
||||
FuncName = GetVexFuncValue( Expr );
|
||||
|
||||
FuncId = getvexstdfuncid( FuncName );
|
||||
|
||||
if ( FuncId != -1 )
|
||||
{
|
||||
switch ( FuncId )
|
||||
{
|
||||
case VEX_STD_TO_BIT :
|
||||
case VEX_STD_TO_BITVECTOR :
|
||||
case VEX_STD_TO_STDULOGIC :
|
||||
case VEX_STD_TO_STDLOGICVECTOR :
|
||||
case VEX_STD_TO_STDULOGICVECTOR :
|
||||
case VEX_STD_TO_X01 :
|
||||
case VEX_STD_TO_X01Z :
|
||||
case VEX_STD_TO_UX01 :
|
||||
case VEX_STD_CONV_INTEGER :
|
||||
case VEX_STD_RISING_EDGE :
|
||||
case VEX_STD_FALLING_EDGE :
|
||||
case VEX_STD_STD_LOGIC_VECTOR :
|
||||
case VEX_STD_STD_ULOGIC_VECTOR :
|
||||
case VEX_STD_SIGNED :
|
||||
case VEX_STD_UNSIGNED :
|
||||
case VEX_STD_TO_INTEGER :
|
||||
|
||||
Operand = GetVexOperand( Expr->OPERAND );
|
||||
SetVexOperand( Expr->OPERAND, (vexexpr *)0 );
|
||||
freevexexpr( Expr );
|
||||
|
||||
if ( FuncId == VEX_STD_FALLING_EDGE )
|
||||
{
|
||||
Expr = createvexunaryexpr( VEX_EVENT, 1, dupvexexpr( Operand ) );
|
||||
Operand = createvexunaryexpr( VEX_NOT , 1, Operand );
|
||||
Expr = createvexbinexpr( VEX_AND , 1, Expr, Operand );
|
||||
}
|
||||
else
|
||||
if ( FuncId == VEX_STD_RISING_EDGE )
|
||||
{
|
||||
Expr = createvexunaryexpr( VEX_EVENT, 1, dupvexexpr( Operand ) );
|
||||
Expr = createvexbinexpr( VEX_AND , 1, Expr, Operand );
|
||||
}
|
||||
else
|
||||
{
|
||||
Expr = Operand;
|
||||
|
||||
if ( FuncId == VEX_STD_SIGNED )
|
||||
{
|
||||
SetVexNodeSigned( Expr );
|
||||
}
|
||||
else
|
||||
if ( FuncId == VEX_STD_UNSIGNED )
|
||||
{
|
||||
ClearVexNodeSigned( Expr );
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case VEX_STD_ABS :
|
||||
|
||||
SetVexNodeOper( Expr );
|
||||
SetVexOperValue( Expr, VEX_ABS );
|
||||
|
||||
break;
|
||||
|
||||
case VEX_STD_TO_UNSIGNED :
|
||||
case VEX_STD_TO_SIGNED :
|
||||
case VEX_STD_CONV_UNSIGNED :
|
||||
case VEX_STD_CONV_SIGNED :
|
||||
case VEX_STD_CONV_STD_LOGIC_VECTOR :
|
||||
case VEX_STD_EXT :
|
||||
case VEX_STD_SXT :
|
||||
case VEX_STD_RESIZE :
|
||||
|
||||
Operand = GetVexOperand( Expr->OPERAND );
|
||||
VexInt = GetVexOperand( Expr->OPERAND->NEXT );
|
||||
|
||||
if ( evalvexatomlong( VexInt, &Length ) )
|
||||
{
|
||||
VasyErrorLine( VASY_ERROR_ILLEGAL_USE_OF,
|
||||
VasyVpnLine, GetVexFuncValue( Expr ) );
|
||||
}
|
||||
|
||||
if ( ( Operand->WIDTH != Length ) &&
|
||||
( IsVexNodeAtom( Operand ) ) )
|
||||
{
|
||||
if ( FuncId == VEX_STD_SXT ) SetVexNodeSigned( Operand );
|
||||
|
||||
Operand = extendvexatomsign( Operand, Length );
|
||||
}
|
||||
|
||||
if ( Operand->WIDTH == Length )
|
||||
{
|
||||
SetVexOperand( Expr->OPERAND, (vexexpr *)0 );
|
||||
freevexexpr( Expr );
|
||||
|
||||
Expr = Operand;
|
||||
}
|
||||
else
|
||||
{
|
||||
VasyErrorLine( VASY_ERROR_ILLEGAL_USE_OF,
|
||||
VasyVpnLine, GetVexFuncValue( Expr ) );
|
||||
}
|
||||
|
||||
|
||||
if ( ( FuncId == VEX_STD_TO_SIGNED ) ||
|
||||
( FuncId == VEX_STD_CONV_SIGNED ) )
|
||||
{
|
||||
SetVexNodeSigned( Expr );
|
||||
}
|
||||
else
|
||||
if ( FuncId != VEX_STD_RESIZE )
|
||||
{
|
||||
ClearVexNodeSigned( Expr );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case VEX_STD_SHL :
|
||||
case VEX_STD_SHIFT_LEFT :
|
||||
case VEX_STD_SHR :
|
||||
case VEX_STD_SHIFT_RIGHT :
|
||||
|
||||
Operand = GetVexOperand( Expr->OPERAND );
|
||||
VexInt = GetVexOperand( Expr->OPERAND->NEXT );
|
||||
|
||||
if ( evalvexatomlong( VexInt, &Length ) )
|
||||
{
|
||||
VasyErrorLine( VASY_ERROR_ILLEGAL_USE_OF,
|
||||
VasyVpnLine, GetVexFuncValue( Expr ) );
|
||||
}
|
||||
|
||||
if ( IsVexNodeAtom( Operand ) )
|
||||
{
|
||||
if ( ( FuncId == VEX_STD_SHL ) ||
|
||||
( FuncId == VEX_STD_SHIFT_LEFT ) )
|
||||
{
|
||||
Operand = shiftvexatomleft( Operand, Length );
|
||||
}
|
||||
else
|
||||
{
|
||||
Operand = shiftvexatomright( Operand, Length );
|
||||
}
|
||||
|
||||
SetVexOperand( Expr->OPERAND, (vexexpr *)0 );
|
||||
freevexexpr( Expr );
|
||||
|
||||
Expr = Operand;
|
||||
}
|
||||
else
|
||||
{
|
||||
VasyErrorLine( VASY_ERROR_ILLEGAL_USE_OF,
|
||||
VasyVpnLine, GetVexFuncValue( Expr ) );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default :
|
||||
|
||||
VasyErrorLine( VASY_NOT_YET_IMPLEMENTED_ERROR, VasyVpnLine, "standard function" );
|
||||
|
||||
/* VEX_STD_IS_X
|
||||
VEX_STD_ROTATE_LEFT
|
||||
VEX_STD_ROTATE_RIGHT
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return( Expr );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyFuncVpnProc |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyFuncVpnProc( VpnFigure, VpnProc )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
vpnproc_list *VpnProc;
|
||||
{
|
||||
vpntrans_list *VpnTrans;
|
||||
vpnact_list *VpnAction;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, " --> VasyFuncVpnProc %s\n", VpnProc->NAME );
|
||||
}
|
||||
|
||||
for ( VpnTrans = VpnProc->TRANS;
|
||||
VpnTrans != (vpntrans_list *)0;
|
||||
VpnTrans = VpnTrans->NEXT )
|
||||
{
|
||||
for ( VpnAction = VpnTrans->ACT;
|
||||
VpnAction != (vpnact_list *)0;
|
||||
VpnAction = VpnAction->NEXT )
|
||||
{
|
||||
VasyVpnLine = VpnAction->LINE;
|
||||
VpnAction->VEX_EXPR = VasyFuncSubstVexStdFunc( VpnAction->VEX_EXPR );
|
||||
}
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, " <-- VasyFuncVpnProc %s\n", VpnProc->NAME );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyFuncVpnInst |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyFuncVpnInst( VpnFigure, VpnInst )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
vpnins_list *VpnInst;
|
||||
{
|
||||
vpnmap_list *VpnMap;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, " --> VasyFuncVpnInst %s\n", VpnInst->NAME );
|
||||
}
|
||||
|
||||
for ( VpnMap = VpnInst->MAP;
|
||||
VpnMap != (vpnmap_list *)0;
|
||||
VpnMap = VpnMap->NEXT )
|
||||
{
|
||||
VasyVpnLine = VpnMap->LINE;
|
||||
VpnMap->VEX_ACTUAL = VasyFuncSubstVexStdFunc( VpnMap->VEX_ACTUAL );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, " <-- VasyFuncVpnInst %s\n", VpnInst->NAME );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyFuncVpnFig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyFuncVpnFig( VpnFigure )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
{
|
||||
vpnproc_list *VpnProc;
|
||||
vpnins_list *VpnInst;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyFuncVpnFig %s\n", VpnFigure->NAME );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyDebugSaveVpnFig( VpnFigure );
|
||||
}
|
||||
|
||||
for ( VpnProc = VpnFigure->PROCESS;
|
||||
VpnProc != (vpnproc_list *)0;
|
||||
VpnProc = VpnProc->NEXT )
|
||||
{
|
||||
VasyFuncVpnProc( VpnFigure, VpnProc );
|
||||
}
|
||||
|
||||
for ( VpnInst = VpnFigure->INSTANCE;
|
||||
VpnInst != (vpnins_list *)0;
|
||||
VpnInst = VpnInst->NEXT )
|
||||
{
|
||||
VasyFuncVpnInst( VpnFigure, VpnInst );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyDebugSaveVpnFig( VpnFigure );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyFuncVpnFig %s\n\n", VpnFigure->NAME );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_func.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
|
||||
# ifndef VASY_FUNC_H
|
||||
# define VASY_FUNC_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyFuncVpnFig();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,970 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_generate.c |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.02.00 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "vpn.h"
|
||||
# include "vbh.h"
|
||||
|
||||
# include "vasy_generate.h"
|
||||
# include "vasy_debug.h"
|
||||
# include "vasy_error.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Private variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static authtable *VasyHashConstant = (authtable *)0;
|
||||
static authtable *VasyHashGeneric = (authtable *)0;
|
||||
static authtable *VasyHashForIndex = (authtable *)0;
|
||||
|
||||
static char *VasyGenerateLabel = (char *)0;
|
||||
|
||||
static char VasyBuffer[ 512 ];
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenerateSubstAllConst |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyGenerateSubstAllConst( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
chain_list *ScanOper;
|
||||
vbcst_list *VbhConst;
|
||||
vbgen_list *VbhGen;
|
||||
char *AtomValue;
|
||||
vexexpr *VexConst;
|
||||
authelem *Element;
|
||||
/* ICI BIG BUG !!
|
||||
short Signed;
|
||||
*/
|
||||
|
||||
if ( IsVexNodeAtom( VexExpr ) )
|
||||
{
|
||||
if ( ! IsVexAtomLiteral( VexExpr ) )
|
||||
{
|
||||
AtomValue = GetVexAtomValue( VexExpr );
|
||||
Element = searchauthelem( VasyHashConstant, AtomValue );
|
||||
|
||||
if ( Element == (authelem *)0 )
|
||||
{
|
||||
Element = searchauthelem( VasyHashGeneric, AtomValue );
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
VbhGen = (vbgen_list *)Element->VALUE;
|
||||
|
||||
VasyGenerateSubstAllConst( VbhGen->VEX );
|
||||
VbhGen->VEX = simpvexexpr( VbhGen->VEX );
|
||||
|
||||
VexConst = VbhGen->VEX;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VbhConst = (vbcst_list *)Element->VALUE;
|
||||
|
||||
VasyGenerateSubstAllConst( VbhConst->VEX );
|
||||
VbhConst->VEX = simpvexexpr( VbhConst->VEX );
|
||||
|
||||
VexConst = VbhConst->VEX;
|
||||
}
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
/* ICI BIG BUG !!
|
||||
if ( IsVexNodeSigned( VexExpr ) ) Signed = 1;
|
||||
else Signed = 0;
|
||||
*/
|
||||
|
||||
VexExpr->VALUE = VexConst->VALUE;
|
||||
VexExpr->TYPE = VexConst->TYPE;
|
||||
VexExpr->WIDTH = VexConst->WIDTH;
|
||||
VexExpr->LEFT = VexConst->LEFT;
|
||||
VexExpr->RIGHT = VexConst->RIGHT;
|
||||
|
||||
/* ICI BIG BUG !!
|
||||
if ( Signed ) SetVexNodeSigned( VexExpr );
|
||||
else ClearVexNodeSigned( VexExpr );
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( ScanOper = VexExpr->OPERAND;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
VasyGenerateSubstAllConst( GetVexOperand( ScanOper ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenerateSubstConst |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyGenerateSubstConst( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
chain_list *ScanOper;
|
||||
vbcst_list *VbhConst;
|
||||
vbgen_list *VbhGen;
|
||||
char *AtomValue;
|
||||
vexexpr *VexConst;
|
||||
authelem *Element;
|
||||
/* ICI BIG BUG !!
|
||||
short Signed;
|
||||
*/
|
||||
|
||||
if ( IsVexNodeAtom( VexExpr ) )
|
||||
{
|
||||
if ( ! IsVexAtomLiteral( VexExpr ) )
|
||||
{
|
||||
AtomValue = GetVexAtomValue( VexExpr );
|
||||
Element = searchauthelem( VasyHashConstant, AtomValue );
|
||||
|
||||
if ( Element == (authelem *)0 )
|
||||
{
|
||||
Element = searchauthelem( VasyHashGeneric, AtomValue );
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
VbhGen = (vbgen_list *)Element->VALUE;
|
||||
VexConst = VbhGen->VEX;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VbhConst = (vbcst_list *)Element->VALUE;
|
||||
VexConst = VbhConst->VEX;
|
||||
}
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
/* ICI BIG BUG !!
|
||||
if ( IsVexNodeSigned( VexExpr ) ) Signed = 1;
|
||||
else Signed = 0;
|
||||
*/
|
||||
|
||||
VexExpr->VALUE = VexConst->VALUE;
|
||||
VexExpr->TYPE = VexConst->TYPE;
|
||||
VexExpr->WIDTH = VexConst->WIDTH;
|
||||
VexExpr->LEFT = VexConst->LEFT;
|
||||
VexExpr->RIGHT = VexConst->RIGHT;
|
||||
|
||||
/* ICI BIG BUG !!
|
||||
if ( Signed ) SetVexNodeSigned( VexExpr );
|
||||
else ClearVexNodeSigned( VexExpr );
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( ScanOper = VexExpr->OPERAND;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
VasyGenerateSubstConst( GetVexOperand( ScanOper ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenerateVexExpr |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vexexpr *VasyGenerateVexExpr( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
authelem *Element;
|
||||
chain_list *ScanOper;
|
||||
vexexpr *Operand;
|
||||
char *Name;
|
||||
int Width;
|
||||
|
||||
if ( IsVexNodeAtom( VexExpr ) )
|
||||
{
|
||||
if ( ! IsVexAtomLiteral( VexExpr ) )
|
||||
{
|
||||
Name = GetVexAtomValue( VexExpr );
|
||||
Element = searchauthelem( VasyHashForIndex, Name );
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
Width = VexExpr->WIDTH;
|
||||
freevexexpr( VexExpr );
|
||||
|
||||
VexExpr = createvexatomlong( Element->VALUE, Width, 2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( ScanOper = VexExpr->OPERAND;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
Operand = GetVexOperand( ScanOper );
|
||||
Operand = VasyGenerateVexExpr( Operand );
|
||||
SetVexOperand( ScanOper, Operand );
|
||||
}
|
||||
}
|
||||
|
||||
return( VexExpr );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenerateForVexExpr |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vexexpr *VasyGenerateForVexExpr( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
if ( VexExpr != (vexexpr *)0 )
|
||||
{
|
||||
VexExpr = dupvexexpr( VexExpr );
|
||||
VexExpr = VasyGenerateVexExpr( VexExpr );
|
||||
VexExpr = simpvexexpr( VexExpr );
|
||||
}
|
||||
|
||||
return( VexExpr );
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenerateIsVexCondTrue |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static int VasyGenerateIsVexCondTrue( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
char *AtomValue;
|
||||
|
||||
if ( ( IsVexNodeAtom( VexExpr ) ) &&
|
||||
( IsVexAtomLiteral( VexExpr ) ) )
|
||||
{
|
||||
AtomValue = GetVexAtomValue( VexExpr );
|
||||
|
||||
if ( AtomValue == VEX_ATOM_ONE ) return( 1 );
|
||||
if ( AtomValue == VEX_ATOM_ZERO ) return( 0 );
|
||||
}
|
||||
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenerateForRenameLabel |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static char *VasyGenerateForRenameLabel( Label )
|
||||
|
||||
char *Label;
|
||||
{
|
||||
sprintf( VasyBuffer, "%s_%s", VasyGenerateLabel, Label );
|
||||
Label = namealloc( VasyBuffer );
|
||||
|
||||
return( Label );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenerateForDupInst |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static ptype_list *VasyGenerateForDupInst( Instruction )
|
||||
|
||||
ptype_list *Instruction;
|
||||
{
|
||||
vbasg_list *ScanAsg;
|
||||
vbagr_list *ScanAgr;
|
||||
vbvar_list *ScanVar;
|
||||
vbwas_list *ScanWait;
|
||||
vbnxt_list *ScanNext;
|
||||
vbext_list *ScanExit;
|
||||
vbret_list *ScanReturn;
|
||||
vbcal_list *ScanCall;
|
||||
vbifs_list *ScanIfs;
|
||||
vbcas_list *ScanCase;
|
||||
vbcho_list *ScanChoice;
|
||||
vblop_list *ScanLoop;
|
||||
vbfor_list *ScanFor;
|
||||
vbwhi_list *ScanWhile;
|
||||
vbasg_list *NewAsg;
|
||||
vbagr_list *NewAgr;
|
||||
vbvar_list *NewVar;
|
||||
vbwas_list *NewWait;
|
||||
vbnxt_list *NewNext;
|
||||
vbext_list *NewExit;
|
||||
vbret_list *NewReturn;
|
||||
vbcal_list *NewCall;
|
||||
vbifs_list *NewIfs;
|
||||
vbcas_list *NewCase;
|
||||
vbcho_list *NewChoice;
|
||||
vblop_list *NewLoop;
|
||||
vbfor_list *NewFor;
|
||||
vbwhi_list *NewWhile;
|
||||
ptype_list *NewInstruction;
|
||||
chain_list *ScanChain;
|
||||
chain_list *ScanValue;
|
||||
void *Pointer;
|
||||
int InstType;
|
||||
int Offset;
|
||||
|
||||
NewInstruction = (ptype_list *)0;
|
||||
|
||||
while ( Instruction != (ptype_list *)0 )
|
||||
{
|
||||
InstType = Instruction->TYPE;
|
||||
Pointer = (void *)0;
|
||||
|
||||
switch ( InstType )
|
||||
{
|
||||
case VBH_BEASG :
|
||||
|
||||
ScanAsg = (vbasg_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbasg_list ) );
|
||||
NewAsg = (vbasg_list *)Pointer;
|
||||
|
||||
NewAsg->TARGET = VasyGenerateForVexExpr( ScanAsg->TARGET );
|
||||
NewAsg->VEX = VasyGenerateForVexExpr( ScanAsg->VEX );
|
||||
NewAsg->TYPE = ScanAsg->TYPE;
|
||||
NewAsg->LINE = ScanAsg->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEVAR :
|
||||
|
||||
ScanVar = (vbvar_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbvar_list ) );
|
||||
NewVar = (vbvar_list *)Pointer;
|
||||
|
||||
NewVar->TARGET = VasyGenerateForVexExpr( ScanVar->TARGET );
|
||||
NewVar->VEX = VasyGenerateForVexExpr( ScanVar->VEX );
|
||||
NewVar->TYPE = ScanVar->TYPE;
|
||||
NewVar->LINE = ScanVar->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BENXT :
|
||||
|
||||
ScanNext = (vbnxt_list *)Instruction->DATA;
|
||||
|
||||
Pointer = autallocheap( sizeof( vbnxt_list ) );
|
||||
NewNext = (vbnxt_list *)Pointer;
|
||||
|
||||
NewNext->LINE = ScanNext->LINE;
|
||||
NewNext->CND = VasyGenerateForVexExpr( ScanNext->CND );
|
||||
NewNext->LABEL = VasyGenerateForRenameLabel( ScanNext->LABEL );
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEEXT :
|
||||
|
||||
ScanExit = (vbext_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbext_list ) );
|
||||
NewExit = (vbext_list *)Pointer;
|
||||
|
||||
NewExit->LINE = ScanExit->LINE;
|
||||
NewExit->CND = VasyGenerateForVexExpr( ScanExit->CND );
|
||||
NewExit->LABEL = VasyGenerateForRenameLabel( ScanExit->LABEL );
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEWAS :
|
||||
|
||||
ScanWait = (vbwas_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbwas_list ) );
|
||||
NewWait = (vbwas_list *)Pointer;
|
||||
|
||||
for ( ScanChain = ScanWait->SEN;
|
||||
ScanChain != (chain_list *)0;
|
||||
ScanChain = ScanChain->NEXT )
|
||||
{
|
||||
NewWait->SEN = addchain( NewWait->SEN, ScanChain->DATA );
|
||||
}
|
||||
|
||||
NewWait->CND = VasyGenerateForVexExpr( ScanWait->CND );
|
||||
NewWait->TIME_UNIT = ScanWait->TIME_UNIT;
|
||||
NewWait->TIMEOUT = ScanWait->TIMEOUT;
|
||||
NewWait->LINE = ScanWait->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BERET :
|
||||
|
||||
ScanReturn = (vbret_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbret_list ) );
|
||||
NewReturn = (vbret_list *)Pointer;
|
||||
|
||||
NewReturn->RET = VasyGenerateForVexExpr( ScanReturn->RET );
|
||||
NewReturn->LINE = ScanReturn->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BECAL :
|
||||
|
||||
ScanCall = (vbcal_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbcal_list ) );
|
||||
NewCall = (vbcal_list *)Pointer;
|
||||
|
||||
NewCall->CALL = VasyGenerateForVexExpr( ScanCall->CALL );
|
||||
NewCall->LINE = ScanCall->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEAGR :
|
||||
|
||||
ScanAgr = (vbagr_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbagr_list ) );
|
||||
NewAgr = (vbagr_list *)Pointer;
|
||||
|
||||
NewAgr->ASSIGN = VasyGenerateForDupInst( ScanAgr->ASSIGN );
|
||||
NewAgr->LINE = ScanAgr->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEIFS :
|
||||
|
||||
ScanIfs = (vbifs_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbifs_list ) );
|
||||
NewIfs = (vbifs_list *)Pointer;
|
||||
|
||||
NewIfs->CND = VasyGenerateForVexExpr( ScanIfs->CND );
|
||||
NewIfs->CNDTRUE = VasyGenerateForDupInst( ScanIfs->CNDTRUE );
|
||||
NewIfs->CNDFALSE = VasyGenerateForDupInst( ScanIfs->CNDFALSE );
|
||||
NewIfs->LINE = ScanIfs->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BECAS :
|
||||
|
||||
ScanCase = (vbcas_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbcas_list ) );
|
||||
NewCase = (vbcas_list *)Pointer;
|
||||
|
||||
NewCase->VEX = VasyGenerateForVexExpr( ScanCase->VEX );
|
||||
NewCase->TYPE = ScanCase->TYPE;
|
||||
NewCase->LINE = ScanCase->LINE;
|
||||
|
||||
NewCase->SIZE = ScanCase->SIZE;
|
||||
NewCase->CHOICE = (vbcho_list *)autallocblock( ScanCase->SIZE * sizeof( vbcho_list ) );
|
||||
|
||||
for ( Offset = 0; Offset < ScanCase->SIZE; Offset++ )
|
||||
{
|
||||
ScanChoice = &ScanCase->CHOICE[ Offset ];
|
||||
NewChoice = &NewCase->CHOICE[ Offset ];
|
||||
|
||||
NewChoice->INSTRUCTION = VasyGenerateForDupInst( ScanChoice->INSTRUCTION );
|
||||
|
||||
NewChoice->VALUES = (chain_list *)0;
|
||||
|
||||
for ( ScanValue = ScanChoice->VALUES;
|
||||
ScanValue != (chain_list *)0;
|
||||
ScanValue = ScanValue->NEXT )
|
||||
{
|
||||
NewChoice->VALUES = addchain( NewChoice->VALUES, ScanValue->DATA );
|
||||
}
|
||||
|
||||
NewChoice->SIZE = ScanChoice->SIZE ;
|
||||
NewChoice->LINE = ScanChoice->LINE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEFOR :
|
||||
|
||||
ScanFor = (vbfor_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbfor_list ) );
|
||||
NewFor = (vbfor_list *)Pointer;
|
||||
|
||||
NewFor->INSTRUCTION = VasyGenerateForDupInst( ScanFor->INSTRUCTION );
|
||||
NewFor->LABEL = VasyGenerateForRenameLabel( ScanFor->LABEL );
|
||||
NewFor->VARIABLE = VasyGenerateForVexExpr( ScanFor->VARIABLE );
|
||||
NewFor->LEFT = VasyGenerateForVexExpr( ScanFor->LEFT );
|
||||
NewFor->RIGHT = VasyGenerateForVexExpr( ScanFor->RIGHT );
|
||||
NewFor->UP = ScanFor->UP;
|
||||
NewFor->LINE = ScanFor->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEWHI :
|
||||
|
||||
ScanWhile = (vbwhi_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbwhi_list ) );
|
||||
NewWhile = (vbwhi_list *)Pointer;
|
||||
|
||||
NewWhile->INSTRUCTION = VasyGenerateForDupInst( ScanWhile->INSTRUCTION );
|
||||
NewWhile->LABEL = VasyGenerateForRenameLabel( ScanWhile->LABEL );
|
||||
NewWhile->CND = VasyGenerateForVexExpr( ScanWhile->CND );
|
||||
NewWhile->LINE = ScanWhile->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BELOP :
|
||||
|
||||
ScanLoop = (vblop_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vblop_list ) );
|
||||
NewLoop = (vblop_list *)Pointer;
|
||||
|
||||
NewLoop->INSTRUCTION = VasyGenerateForDupInst( ScanLoop->INSTRUCTION );
|
||||
NewLoop->LABEL = VasyGenerateForRenameLabel( ScanLoop->LABEL );
|
||||
NewLoop->LINE = ScanLoop->LINE;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if ( Pointer != (void *)0 )
|
||||
{
|
||||
NewInstruction = addptype( NewInstruction, InstType, Pointer );
|
||||
}
|
||||
|
||||
Instruction = Instruction->NEXT;
|
||||
}
|
||||
|
||||
NewInstruction = (ptype_list *)reverse( (chain_list *)NewInstruction );
|
||||
|
||||
return( NewInstruction );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenerateForDupInstance |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyGenerateForDupInstance( VbhFigure, VbhGenerate )
|
||||
|
||||
|
||||
vbfig_list *VbhFigure;
|
||||
vbgnr_list *VbhGenerate;
|
||||
{
|
||||
vbins_list *ScanInstance;
|
||||
vbmap_list *ScanMap;
|
||||
vbins_list *NewInstance;
|
||||
|
||||
for ( ScanInstance = VbhGenerate->BEINS;
|
||||
ScanInstance != (vbins_list *)0;
|
||||
ScanInstance = ScanInstance->NEXT )
|
||||
{
|
||||
sprintf( VasyBuffer, "%s_%s", VasyGenerateLabel, ScanInstance->NAME );
|
||||
|
||||
VbhFigure->BEINS = vbh_addvbins( VbhFigure->BEINS,
|
||||
VasyBuffer, ScanInstance->MODEL, ScanInstance->LINE );
|
||||
|
||||
NewInstance = VbhFigure->BEINS;
|
||||
|
||||
for ( ScanMap = ScanInstance->PORT_MAP;
|
||||
ScanMap != (vbmap_list *)0;
|
||||
ScanMap = ScanMap->NEXT )
|
||||
{
|
||||
NewInstance->PORT_MAP = vbh_addvbmap( NewInstance->PORT_MAP,
|
||||
VasyGenerateForVexExpr( ScanMap->FORMAL ),
|
||||
VasyGenerateForVexExpr( ScanMap->ACTUAL ), ScanMap->LINE );
|
||||
}
|
||||
|
||||
for ( ScanMap = ScanInstance->GEN_MAP;
|
||||
ScanMap != (vbmap_list *)0;
|
||||
ScanMap = ScanMap->NEXT )
|
||||
{
|
||||
NewInstance->GEN_MAP = vbh_addvbmap( NewInstance->GEN_MAP,
|
||||
VasyGenerateForVexExpr( ScanMap->FORMAL ),
|
||||
VasyGenerateForVexExpr( ScanMap->ACTUAL ), ScanMap->LINE );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenerateForDupProcess |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyGenerateForDupProcess( VbhFigure, VbhGenerate )
|
||||
|
||||
|
||||
vbfig_list *VbhFigure;
|
||||
vbgnr_list *VbhGenerate;
|
||||
{
|
||||
vbpcs_list *ScanProcess;
|
||||
vbpcs_list *NewProcess;
|
||||
chain_list *NewSens;
|
||||
chain_list *ScanSens;
|
||||
|
||||
for ( ScanProcess = VbhGenerate->BEPCS;
|
||||
ScanProcess != (vbpcs_list *)0;
|
||||
ScanProcess = ScanProcess->NEXT )
|
||||
{
|
||||
sprintf( VasyBuffer, "%s_%s", VasyGenerateLabel, ScanProcess->LABEL );
|
||||
|
||||
VbhFigure->BEPCS = vbh_addvbpcs( VbhFigure->BEPCS,
|
||||
VasyBuffer, (chain_list *)0, (ptype_list *)0, ScanProcess->LINE );
|
||||
|
||||
NewProcess = VbhFigure->BEPCS;
|
||||
NewProcess->TYPE = ScanProcess->TYPE;
|
||||
/*
|
||||
** Process sensitivity list
|
||||
*/
|
||||
NewSens = (chain_list *)0;
|
||||
|
||||
for ( ScanSens = ScanProcess->SENSITIVITY;
|
||||
ScanSens != (chain_list *)0;
|
||||
ScanSens = ScanSens->NEXT )
|
||||
{
|
||||
NewSens = addchain( NewSens, ScanSens->DATA );
|
||||
}
|
||||
|
||||
NewProcess->SENSITIVITY = NewSens;
|
||||
/*
|
||||
** Process variables
|
||||
*/
|
||||
NewProcess->VARIABLE = VasyGenerateForDupInst( ScanProcess->VARIABLE );
|
||||
/*
|
||||
** Process instruction
|
||||
*/
|
||||
NewProcess->INSTRUCTION = VasyGenerateForDupInst( ScanProcess->INSTRUCTION );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenerateIf |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyGenerateFor();
|
||||
|
||||
static void VasyGenerateIf( VbhFigure, VbhGenerate )
|
||||
|
||||
vbfig_list *VbhFigure;
|
||||
vbgnr_list *VbhGenerate;
|
||||
{
|
||||
vbgnr_list *ScanGenerate;
|
||||
char *OldLabel;
|
||||
vexexpr *VexCond;
|
||||
int TrueFalse;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyGenerateIf %s\n", VbhGenerate->LABEL );
|
||||
}
|
||||
|
||||
VexCond = VbhGenerate->IF_COND;
|
||||
VasyGenerateSubstConst( VexCond );
|
||||
VexCond = simpvexexpr( VexCond );
|
||||
VbhGenerate->IF_COND = VexCond;
|
||||
|
||||
VexCond = VasyGenerateForVexExpr( VexCond );
|
||||
TrueFalse = VasyGenerateIsVexCondTrue( VexCond );
|
||||
|
||||
if ( TrueFalse == -1 )
|
||||
{
|
||||
viewvexexprboundln( VexCond );
|
||||
VasyError( VASY_ERROR_ILLEGAL_USE_OF, "if generate condition" );
|
||||
}
|
||||
else
|
||||
if ( TrueFalse == 1 )
|
||||
{
|
||||
OldLabel = VasyGenerateLabel;
|
||||
sprintf( VasyBuffer, "%s_%s_if", OldLabel, VbhGenerate->LABEL );
|
||||
VasyGenerateLabel = namealloc( VasyBuffer );
|
||||
|
||||
for ( ScanGenerate = VbhGenerate->BEGNR;
|
||||
ScanGenerate != (vbgnr_list *)0;
|
||||
ScanGenerate = ScanGenerate->NEXT )
|
||||
{
|
||||
if ( VbhGenerate->TYPE == VBH_GENERATE_FOR )
|
||||
{
|
||||
VasyGenerateFor( &VbhGenerate->BEPCS, &VbhGenerate->BEINS, ScanGenerate );
|
||||
}
|
||||
else
|
||||
{
|
||||
VasyGenerateIf( &VbhGenerate->BEPCS, &VbhGenerate->BEINS, ScanGenerate );
|
||||
}
|
||||
}
|
||||
|
||||
VasyGenerateForDupProcess( VbhFigure, VbhGenerate );
|
||||
VasyGenerateForDupInstance( VbhFigure, VbhGenerate );
|
||||
|
||||
VasyGenerateLabel = OldLabel;
|
||||
}
|
||||
|
||||
freevexexpr( VexCond );
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyGenerateIf %s\n", VbhGenerate->LABEL );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenerateFor |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyGenerateFor( VbhFigure, VbhGenerate )
|
||||
|
||||
vbfig_list *VbhFigure;
|
||||
vbgnr_list *VbhGenerate;
|
||||
{
|
||||
vbgnr_list *ScanGenerate;
|
||||
vexexpr *VexLeft;
|
||||
vexexpr *VexRight;
|
||||
vexexpr *VexAtom;
|
||||
char *OldLabel;
|
||||
char *IndexName;
|
||||
long IndexValue;
|
||||
long Left;
|
||||
long Right;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyGenerateFor %s\n", VbhGenerate->LABEL );
|
||||
}
|
||||
|
||||
VexAtom = VbhGenerate->FOR_VARIABLE;
|
||||
|
||||
VexLeft = VbhGenerate->FOR_LEFT;
|
||||
VasyGenerateSubstConst( VexLeft );
|
||||
VexLeft = simpvexexpr( VexLeft );
|
||||
VbhGenerate->FOR_LEFT = VexLeft;
|
||||
|
||||
VexRight = VbhGenerate->FOR_RIGHT;
|
||||
VasyGenerateSubstConst( VexRight );
|
||||
VexRight = simpvexexpr( VexRight );
|
||||
VbhGenerate->FOR_RIGHT = VexRight;
|
||||
|
||||
IndexName = GetVexAtomValue( VexAtom );
|
||||
|
||||
if ( ( evalvexatomlong( VexLeft, &Left ) ) ||
|
||||
( evalvexatomlong( VexRight, &Right ) ) )
|
||||
{
|
||||
VasyError( VASY_ERROR_IN_UNROLL_LOOP, (char *)0 );
|
||||
}
|
||||
|
||||
OldLabel = VasyGenerateLabel;
|
||||
IndexValue = Left;
|
||||
|
||||
while ( ( ( IndexValue <= Right ) && ( VbhGenerate->FOR_UP ) ) ||
|
||||
( ( IndexValue >= Right ) && ( ! VbhGenerate->FOR_UP ) ) )
|
||||
{
|
||||
sprintf( VasyBuffer, "%s_%s_%ld", OldLabel, VbhGenerate->LABEL, IndexValue );
|
||||
VasyGenerateLabel = namealloc( VasyBuffer );
|
||||
|
||||
addauthelem( VasyHashForIndex, IndexName, IndexValue );
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
fprintf( stdout, "%s = %ld\n", IndexName, IndexValue );
|
||||
}
|
||||
|
||||
for ( ScanGenerate = VbhGenerate->BEGNR;
|
||||
ScanGenerate != (vbgnr_list *)0;
|
||||
ScanGenerate = ScanGenerate->NEXT )
|
||||
{
|
||||
if ( ScanGenerate->TYPE == VBH_GENERATE_FOR )
|
||||
{
|
||||
VasyGenerateFor( VbhFigure, ScanGenerate );
|
||||
}
|
||||
else
|
||||
{
|
||||
VasyGenerateIf( VbhFigure, ScanGenerate );
|
||||
}
|
||||
}
|
||||
|
||||
VasyGenerateForDupInstance( VbhFigure, VbhGenerate );
|
||||
VasyGenerateForDupProcess( VbhFigure, VbhGenerate );
|
||||
|
||||
if ( VbhGenerate->FOR_UP ) IndexValue++;
|
||||
else IndexValue--;
|
||||
}
|
||||
|
||||
delauthelem( VasyHashForIndex, IndexName );
|
||||
|
||||
VasyGenerateLabel = OldLabel;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyGenerateFor %s\n", VbhGenerate->LABEL );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenerateVbhFig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyGenerateVbhFig( VbhFigure )
|
||||
|
||||
vbfig_list *VbhFigure;
|
||||
{
|
||||
vbgnr_list *VbhGenerate;
|
||||
vbgen_list *VbhGeneric;
|
||||
vbcst_list *VbhConstant;
|
||||
char *Name;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyGenerateVbhFig %s\n", VbhFigure->NAME );
|
||||
}
|
||||
|
||||
VasyHashConstant = createauthtable( 100 );
|
||||
VasyHashGeneric = createauthtable( 100 );
|
||||
VasyHashForIndex = createauthtable( 100 );
|
||||
|
||||
VasyGenerateLabel = VbhFigure->NAME;
|
||||
|
||||
for ( VbhGeneric = VbhFigure->BEGEN;
|
||||
VbhGeneric != (vbgen_list *)0;
|
||||
VbhGeneric = VbhGeneric->NEXT )
|
||||
{
|
||||
Name = getvexatomname( VbhGeneric->TARGET );
|
||||
addauthelem( VasyHashGeneric, Name, (long)VbhGeneric );
|
||||
VasyGenerateSubstConst( VbhGeneric->VEX );
|
||||
}
|
||||
|
||||
for ( VbhConstant = VbhFigure->BECST;
|
||||
VbhConstant != (vbcst_list *)0;
|
||||
VbhConstant = VbhConstant->NEXT )
|
||||
{
|
||||
Name = getvexatomname( VbhConstant->TARGET );
|
||||
addauthelem( VasyHashConstant, Name, (long)VbhConstant );
|
||||
}
|
||||
/*
|
||||
** Propagates all constants and generic values in their own declarations
|
||||
*/
|
||||
for ( VbhGeneric = VbhFigure->BEGEN;
|
||||
VbhGeneric != (vbgen_list *)0;
|
||||
VbhGeneric = VbhGeneric->NEXT )
|
||||
{
|
||||
VasyGenerateSubstAllConst( VbhGeneric->VEX );
|
||||
}
|
||||
|
||||
for ( VbhConstant = VbhFigure->BECST;
|
||||
VbhConstant != (vbcst_list *)0;
|
||||
VbhConstant = VbhConstant->NEXT )
|
||||
{
|
||||
VasyGenerateSubstAllConst( VbhConstant->VEX );
|
||||
}
|
||||
/*
|
||||
** Generate
|
||||
*/
|
||||
for ( VbhGenerate = VbhFigure->BEGNR;
|
||||
VbhGenerate != (vbgnr_list *)0;
|
||||
VbhGenerate = VbhGenerate->NEXT )
|
||||
{
|
||||
if ( VbhGenerate->TYPE == VBH_GENERATE_FOR )
|
||||
{
|
||||
VasyGenerateFor( VbhFigure, VbhGenerate );
|
||||
}
|
||||
else
|
||||
{
|
||||
VasyGenerateIf( VbhFigure, VbhGenerate );
|
||||
}
|
||||
}
|
||||
|
||||
vbh_frevbgnr( VbhFigure->BEGNR );
|
||||
VbhFigure->BEGNR = (vbgnr_list *)0;
|
||||
|
||||
destroyauthtable( VasyHashConstant );
|
||||
destroyauthtable( VasyHashGeneric );
|
||||
destroyauthtable( VasyHashForIndex );
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
vbh_viewvbfig( VbhFigure );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyGenerateVbhFig %s\n\n", VbhFigure->NAME );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_generate.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
|
||||
# ifndef VASY_GENERATE_H
|
||||
# define VASY_GENERATE_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyGenerateVbhFig();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,462 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_generic.c |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.02.00 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "vpn.h"
|
||||
# include "vbh.h"
|
||||
|
||||
# include "vasy_generic.h"
|
||||
# include "vasy_debug.h"
|
||||
# include "vasy_error.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Private variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static authtable *VasyHashGeneric = (authtable *)0;
|
||||
static authtable *VasyHashConstant = (authtable *)0;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenericSubstVexExprConst |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyGenericSubstVexExprConst( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
chain_list *ScanOper;
|
||||
char *AtomValue;
|
||||
vexexpr *VexConst;
|
||||
vexexpr *VexOperand;
|
||||
authelem *Element;
|
||||
long Oper;
|
||||
/* ICI BIG BUG !!
|
||||
short Signed;
|
||||
*/
|
||||
|
||||
if ( IsVexNodeAtom( VexExpr ) )
|
||||
{
|
||||
if ( ! IsVexAtomLiteral( VexExpr ) )
|
||||
{
|
||||
AtomValue = GetVexAtomValue( VexExpr );
|
||||
Element = searchauthelem( VasyHashGeneric, AtomValue );
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
VexConst = (vexexpr *)Element->VALUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
Element = searchauthelem( VasyHashConstant, AtomValue );
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
VexConst = (vexexpr *)Element->VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
if ( ( IsVexNodeAtom( VexConst ) ) &&
|
||||
( IsVexAtomLiteral( VexConst ) ) )
|
||||
{
|
||||
/* ICI BIG BUG !!!
|
||||
if ( IsVexNodeSigned( VexExpr ) ) Signed = 1;
|
||||
else Signed = 0;
|
||||
*/
|
||||
|
||||
VexExpr->VALUE = VexConst->VALUE;
|
||||
VexExpr->TYPE = VexConst->TYPE;
|
||||
VexExpr->WIDTH = VexConst->WIDTH;
|
||||
VexExpr->LEFT = VexConst->LEFT;
|
||||
VexExpr->RIGHT = VexConst->RIGHT;
|
||||
|
||||
/* ICI BIG BUG !!
|
||||
if ( Signed ) SetVexNodeSigned( VexExpr );
|
||||
else ClearVexNodeSigned( VexExpr );
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( IsVexNodeOper( VexExpr ) ) Oper = GetVexOperValue( VexExpr );
|
||||
else Oper = -1;
|
||||
|
||||
for ( ScanOper = VexExpr->OPERAND;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
VexOperand = GetVexOperand( ScanOper );
|
||||
|
||||
if ( ( Oper == VEX_INDEX ) ||
|
||||
( Oper == VEX_TO ) ||
|
||||
( Oper == VEX_DOWNTO ) )
|
||||
{
|
||||
if ( ( ScanOper != VexExpr->OPERAND ) ||
|
||||
( ! IsVexNodeAtom( VexOperand ) ) )
|
||||
{
|
||||
VasyGenericSubstVexExprConst( VexOperand );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VasyGenericSubstVexExprConst( VexOperand );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenericSubstVexExpr |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyGenericSubstVexExpr( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
chain_list *ScanOper;
|
||||
char *AtomValue;
|
||||
vexexpr *VexConst;
|
||||
vexexpr *VexOperand;
|
||||
authelem *Element;
|
||||
long Oper;
|
||||
/* ICI BIG BUG !!
|
||||
short Signed;
|
||||
*/
|
||||
|
||||
if ( IsVexNodeAtom( VexExpr ) )
|
||||
{
|
||||
if ( ! IsVexAtomLiteral( VexExpr ) )
|
||||
{
|
||||
AtomValue = GetVexAtomValue( VexExpr );
|
||||
Element = searchauthelem( VasyHashGeneric, AtomValue );
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
VexConst = (vexexpr *)Element->VALUE;
|
||||
|
||||
if ( ( IsVexNodeAtom( VexConst ) ) &&
|
||||
( IsVexAtomLiteral( VexConst ) ) )
|
||||
{
|
||||
/* ICI BIG BUG !!
|
||||
if ( IsVexNodeSigned( VexExpr ) ) Signed = 1;
|
||||
else Signed = 0;
|
||||
*/
|
||||
|
||||
VexExpr->VALUE = VexConst->VALUE;
|
||||
VexExpr->TYPE = VexConst->TYPE;
|
||||
VexExpr->WIDTH = VexConst->WIDTH;
|
||||
VexExpr->LEFT = VexConst->LEFT;
|
||||
VexExpr->RIGHT = VexConst->RIGHT;
|
||||
|
||||
/* ICI BIG BUG !!
|
||||
if ( Signed ) SetVexNodeSigned( VexExpr );
|
||||
else ClearVexNodeSigned( VexExpr );
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( IsVexNodeOper( VexExpr ) ) Oper = GetVexOperValue( VexExpr );
|
||||
else Oper = -1;
|
||||
|
||||
for ( ScanOper = VexExpr->OPERAND;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
VexOperand = GetVexOperand( ScanOper );
|
||||
|
||||
if ( ( ( Oper == VEX_INDEX ) ||
|
||||
( Oper == VEX_TO ) ||
|
||||
( Oper == VEX_DOWNTO ) ) &&
|
||||
( ( ScanOper != VexExpr->OPERAND ) ||
|
||||
( ! IsVexNodeAtom( VexOperand ) ) ) )
|
||||
{
|
||||
VasyGenericSubstVexExprConst( VexOperand );
|
||||
}
|
||||
else
|
||||
{
|
||||
VasyGenericSubstVexExpr( VexOperand );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenericSubstSimpConst |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vexexpr *VasyGenericSubstSimpVexConst( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
VasyGenericSubstVexExprConst( VexExpr );
|
||||
VexExpr = simpvexexpr( VexExpr );
|
||||
|
||||
return( VexExpr );
|
||||
}
|
||||
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenericSubstSimpVex |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vexexpr *VasyGenericSubstSimpVex( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
VasyGenericSubstVexExpr( VexExpr );
|
||||
VexExpr = simpvexexpr( VexExpr );
|
||||
|
||||
return( VexExpr );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenericSubstSimpTarget |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vexexpr *VasyGenericSubstSimpTarget( VexTarget )
|
||||
|
||||
vexexpr *VexTarget;
|
||||
{
|
||||
if ( ! IsVexNodeAtom( VexTarget ) )
|
||||
{
|
||||
VasyGenericSubstVexExprConst( VexTarget );
|
||||
VexTarget = simpvexexpr( VexTarget );
|
||||
}
|
||||
|
||||
return( VexTarget );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenericVbhInstance |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyGenericVbhInstance( VbhFigure )
|
||||
|
||||
vbfig_list *VbhFigure;
|
||||
{
|
||||
vbins_list *VbhInstance;
|
||||
vbmap_list *VbhGenMap;
|
||||
vbmap_list *VbhPortMap;
|
||||
char *Name;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyGenericVbhInstance %s\n", VbhFigure->NAME );
|
||||
}
|
||||
|
||||
for ( VbhInstance = VbhFigure->BEINS;
|
||||
VbhInstance != (vbins_list *)0;
|
||||
VbhInstance = VbhInstance->NEXT )
|
||||
{
|
||||
for ( VbhGenMap = VbhInstance->GEN_MAP;
|
||||
VbhGenMap != (vbmap_list *)0;
|
||||
VbhGenMap = VbhGenMap->NEXT )
|
||||
{
|
||||
if ( IsVexNodeAtom( VbhGenMap->ACTUAL ) )
|
||||
{
|
||||
Name = GetVexAtomValue( VbhGenMap->FORMAL );
|
||||
addauthelem( VasyHashGeneric, Name, (long)VbhGenMap->ACTUAL );
|
||||
}
|
||||
}
|
||||
|
||||
for ( VbhPortMap = VbhInstance->PORT_MAP;
|
||||
VbhPortMap != (vbmap_list *)0;
|
||||
VbhPortMap = VbhPortMap->NEXT )
|
||||
{
|
||||
if ( VbhPortMap->FORMAL != (vexexpr *)0 )
|
||||
{
|
||||
VbhPortMap->FORMAL = VasyGenericSubstSimpTarget( VbhPortMap->FORMAL );
|
||||
}
|
||||
|
||||
if ( VbhPortMap->ACTUAL != (vexexpr *)0 )
|
||||
{
|
||||
VbhPortMap->ACTUAL = VasyGenericSubstSimpVex( VbhPortMap->ACTUAL );
|
||||
}
|
||||
}
|
||||
|
||||
for ( VbhGenMap = VbhInstance->GEN_MAP;
|
||||
VbhGenMap != (vbmap_list *)0;
|
||||
VbhGenMap = VbhGenMap->NEXT )
|
||||
{
|
||||
if ( IsVexNodeAtom( VbhGenMap->ACTUAL ) )
|
||||
{
|
||||
Name = GetVexAtomValue( VbhGenMap->ACTUAL );
|
||||
delauthelem( VasyHashGeneric, Name );
|
||||
}
|
||||
}
|
||||
|
||||
vbh_frevbmap( VbhInstance->GEN_MAP );
|
||||
VbhInstance->GEN_MAP = (vbmap_list *)0;
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyGenericVbhInstance %s\n\n", VbhFigure->NAME );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyGenericVbhFig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyGenericVbhFig( VbhFigure )
|
||||
|
||||
vbfig_list *VbhFigure;
|
||||
{
|
||||
vbgen_list *VbhGeneric;
|
||||
vbcst_list *VbhConstant;
|
||||
char *Name;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyGenericVbhFig %s\n", VbhFigure->NAME );
|
||||
}
|
||||
|
||||
VasyHashGeneric = createauthtable( 100 );
|
||||
VasyHashConstant = createauthtable( 100 );
|
||||
|
||||
VasyGenericVbhInstance( VbhFigure );
|
||||
|
||||
for ( VbhConstant = VbhFigure->BECST;
|
||||
VbhConstant != (vbcst_list *)0;
|
||||
VbhConstant = VbhConstant->NEXT )
|
||||
{
|
||||
VbhConstant->TARGET = VasyGenericSubstSimpTarget( VbhConstant->TARGET );
|
||||
Name = getvexatomname( VbhConstant->TARGET );
|
||||
VbhConstant->VEX = VasyGenericSubstSimpVex( VbhConstant->VEX );
|
||||
|
||||
addauthelem( VasyHashConstant, Name, (long)VbhConstant->VEX );
|
||||
}
|
||||
|
||||
for ( VbhGeneric = VbhFigure->BEGEN;
|
||||
VbhGeneric != (vbgen_list *)0;
|
||||
VbhGeneric = VbhGeneric->NEXT )
|
||||
{
|
||||
VbhGeneric->TARGET = VasyGenericSubstSimpTarget( VbhGeneric->TARGET );
|
||||
|
||||
if ( VbhGeneric->VEX != (vexexpr *)0 )
|
||||
{
|
||||
VbhGeneric->VEX = VasyGenericSubstSimpVex( VbhGeneric->VEX );
|
||||
|
||||
if ( IsVexNodeAtom( VbhGeneric->TARGET ) )
|
||||
{
|
||||
Name = GetVexAtomValue( VbhGeneric->TARGET );
|
||||
addauthelem( VasyHashGeneric, Name, (long)VbhGeneric->VEX );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( VbhConstant = VbhFigure->BECST;
|
||||
VbhConstant != (vbcst_list *)0;
|
||||
VbhConstant = VbhConstant->NEXT )
|
||||
{
|
||||
VbhConstant->TARGET = VasyGenericSubstSimpTarget( VbhConstant->TARGET );
|
||||
Name = getvexatomname( VbhConstant->TARGET );
|
||||
VbhConstant->VEX = VasyGenericSubstSimpVex( VbhConstant->VEX );
|
||||
|
||||
addauthelem( VasyHashConstant, Name, (long)VbhConstant->VEX );
|
||||
}
|
||||
|
||||
vbh_forallvexvbfig( VbhFigure, VasyGenericSubstSimpTarget,
|
||||
VasyGenericSubstSimpVexConst );
|
||||
|
||||
destroyauthtable( VasyHashGeneric );
|
||||
destroyauthtable( VasyHashConstant );
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
vbh_viewvbfig( VbhFigure );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyGenericVbhFig %s\n\n", VbhFigure->NAME );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_generic.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
|
||||
# ifndef VASY_GENERIC_H
|
||||
# define VASY_GENERIC_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyGenericVbhFig();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,959 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_loop.c |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "vpn.h"
|
||||
# include "vbh.h"
|
||||
|
||||
# include "vasy_loop.h"
|
||||
# include "vasy_debug.h"
|
||||
# include "vasy_error.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Private variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static char *VasyForIndexName = (char *)0;
|
||||
static long VasyForIndexValue = 0;
|
||||
static short VasyForIndexSigned = 0;
|
||||
static char *VasyForLabel = (char *)0;
|
||||
static char *VasyForLabelNext = (char *)0;
|
||||
static char *VasyForLabelExit = (char *)0;
|
||||
static short VasyForFoundExit = 0;
|
||||
static short VasyForFoundNext = 0;
|
||||
static long VasyForEnterNewLoop = 0;
|
||||
|
||||
static authtable *VasyHashLabel = (authtable *)0;
|
||||
static authtable *VasyHashConstant = (authtable *)0;
|
||||
static authtable *VasyHashGeneric = (authtable *)0;
|
||||
|
||||
static char VasyBuffer[ 512 ];
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyUnrollSubstConst |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyUnrollSubstConst( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
chain_list *ScanOper;
|
||||
vbcst_list *VbhConst;
|
||||
vbgen_list *VbhGen;
|
||||
char *AtomValue;
|
||||
vexexpr *VexConst;
|
||||
authelem *Element;
|
||||
|
||||
if ( IsVexNodeAtom( VexExpr ) )
|
||||
{
|
||||
if ( ! IsVexAtomLiteral( VexExpr ) )
|
||||
{
|
||||
AtomValue = GetVexAtomValue( VexExpr );
|
||||
Element = searchauthelem( VasyHashConstant, AtomValue );
|
||||
|
||||
if ( Element == (authelem *)0 )
|
||||
{
|
||||
Element = searchauthelem( VasyHashGeneric, AtomValue );
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
VbhGen = (vbgen_list *)Element->VALUE;
|
||||
VexConst = VbhGen->VEX;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VbhConst = (vbcst_list *)Element->VALUE;
|
||||
VexConst = VbhConst->VEX;
|
||||
}
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
VexExpr->VALUE = VexConst->VALUE;
|
||||
VexExpr->TYPE = VexConst->TYPE;
|
||||
VexExpr->WIDTH = VexConst->WIDTH;
|
||||
VexExpr->LEFT = VexConst->LEFT;
|
||||
VexExpr->RIGHT = VexConst->RIGHT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( ScanOper = VexExpr->OPERAND;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
VasyUnrollSubstConst( GetVexOperand( ScanOper ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyUnrollForAddLabel |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static char *VasyUnrollForAddLabel( Label )
|
||||
|
||||
char *Label;
|
||||
{
|
||||
char *NewLabel;
|
||||
|
||||
if ( Label != (char *)0 )
|
||||
{
|
||||
sprintf( VasyBuffer, "unroll_%s_%ld", Label, VasyForIndexValue );
|
||||
NewLabel = namealloc( VasyBuffer );
|
||||
addauthelem( VasyHashLabel, Label, (long)NewLabel );
|
||||
}
|
||||
else
|
||||
{
|
||||
NewLabel = (char *)0;
|
||||
}
|
||||
|
||||
return( NewLabel );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyUnrollForDelLabel |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyUnrollForDelLabel( Label )
|
||||
|
||||
char *Label;
|
||||
{
|
||||
if ( Label != (char *)0 )
|
||||
{
|
||||
delauthelem( VasyHashLabel, Label );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyUnrollForRenameLabel |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static char *VasyUnrollForRenameLabel( Label )
|
||||
|
||||
char *Label;
|
||||
{
|
||||
authelem *Element;
|
||||
|
||||
if ( Label != (char *)0 )
|
||||
{
|
||||
Element = searchauthelem( VasyHashLabel, Label );
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
Label = (char *)Element->VALUE;
|
||||
}
|
||||
}
|
||||
|
||||
return( Label );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyUnrollVexExpr |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vexexpr *VasyUnrollVexExpr( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
chain_list *ScanOper;
|
||||
vexexpr *Operand;
|
||||
char *Name;
|
||||
int Width;
|
||||
|
||||
if ( IsVexNodeAtom( VexExpr ) )
|
||||
{
|
||||
if ( ! IsVexAtomLiteral( VexExpr ) )
|
||||
{
|
||||
Name = GetVexAtomValue( VexExpr );
|
||||
|
||||
if ( Name == VasyForIndexName )
|
||||
{
|
||||
Width = VexExpr->WIDTH;
|
||||
freevexexpr( VexExpr );
|
||||
|
||||
VexExpr = createvexatomlong( VasyForIndexValue, Width, VasyForIndexSigned );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( ScanOper = VexExpr->OPERAND;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
Operand = GetVexOperand( ScanOper );
|
||||
Operand = VasyUnrollVexExpr( Operand );
|
||||
SetVexOperand( ScanOper, Operand );
|
||||
}
|
||||
}
|
||||
|
||||
return( VexExpr );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyUnrollIsVexCondTrueFalse |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static int VasyUnrollIsVexCondTrueFalse( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
char *AtomValue;
|
||||
|
||||
if ( VexExpr == (vexexpr *)0 ) return( 1 );
|
||||
|
||||
if ( ( IsVexNodeAtom( VexExpr ) ) &&
|
||||
( IsVexAtomLiteral( VexExpr ) ) )
|
||||
{
|
||||
AtomValue = GetVexAtomValue( VexExpr );
|
||||
|
||||
if ( AtomValue == VEX_ATOM_ONE ) return( 1 );
|
||||
if ( AtomValue == VEX_ATOM_ZERO ) return( 0 );
|
||||
}
|
||||
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyUnrollForBodyVexExpr |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vexexpr *VasyUnrollForBodyVexExpr( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
if ( VexExpr != (vexexpr *)0 )
|
||||
{
|
||||
VexExpr = dupvexexpr( VexExpr );
|
||||
VexExpr = VasyUnrollVexExpr( VexExpr );
|
||||
VexExpr = simpvexexpr( VexExpr );
|
||||
}
|
||||
|
||||
return( VexExpr );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyUnrollForBody |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static ptype_list *VasyUnrollForBody( Instruction )
|
||||
|
||||
ptype_list *Instruction;
|
||||
{
|
||||
vbasg_list *ScanAsg;
|
||||
vbagr_list *ScanAgr;
|
||||
vbvar_list *ScanVar;
|
||||
vbwas_list *ScanWait;
|
||||
vbnxt_list *ScanNext;
|
||||
vbext_list *ScanExit;
|
||||
vbret_list *ScanReturn;
|
||||
vbcal_list *ScanCall;
|
||||
vbifs_list *ScanIfs;
|
||||
vbcas_list *ScanCase;
|
||||
vbcho_list *ScanChoice;
|
||||
vblop_list *ScanLoop;
|
||||
vbfor_list *ScanFor;
|
||||
vbwhi_list *ScanWhile;
|
||||
vbasg_list *NewAsg;
|
||||
vbagr_list *NewAgr;
|
||||
vbvar_list *NewVar;
|
||||
vbwas_list *NewWait;
|
||||
vbnxt_list *NewNext;
|
||||
vbext_list *NewExit;
|
||||
vbret_list *NewReturn;
|
||||
vbcal_list *NewCall;
|
||||
vbifs_list *NewIfs;
|
||||
vbcas_list *NewCase;
|
||||
vbcho_list *NewChoice;
|
||||
vblop_list *NewLoop;
|
||||
vbfor_list *NewFor;
|
||||
vbwhi_list *NewWhile;
|
||||
ptype_list *NewInstruction;
|
||||
chain_list *ScanChain;
|
||||
chain_list *ScanValue;
|
||||
void *Pointer;
|
||||
int InstType;
|
||||
int Offset;
|
||||
int TrueFalse;
|
||||
|
||||
NewInstruction = (ptype_list *)0;
|
||||
|
||||
while ( Instruction != (ptype_list *)0 )
|
||||
{
|
||||
InstType = Instruction->TYPE;
|
||||
Pointer = (void *)0;
|
||||
|
||||
switch ( InstType )
|
||||
{
|
||||
case VBH_BEASG :
|
||||
|
||||
ScanAsg = (vbasg_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbasg_list ) );
|
||||
NewAsg = (vbasg_list *)Pointer;
|
||||
|
||||
NewAsg->TARGET = VasyUnrollForBodyVexExpr( ScanAsg->TARGET );
|
||||
NewAsg->VEX = VasyUnrollForBodyVexExpr( ScanAsg->VEX );
|
||||
NewAsg->TYPE = ScanAsg->TYPE;
|
||||
NewAsg->LINE = ScanAsg->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEVAR :
|
||||
|
||||
ScanVar = (vbvar_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbvar_list ) );
|
||||
NewVar = (vbvar_list *)Pointer;
|
||||
|
||||
NewVar->TARGET = VasyUnrollForBodyVexExpr( ScanVar->TARGET );
|
||||
NewVar->VEX = VasyUnrollForBodyVexExpr( ScanVar->VEX );
|
||||
NewVar->TYPE = ScanVar->TYPE;
|
||||
NewVar->LINE = ScanVar->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BENXT :
|
||||
|
||||
ScanNext = (vbnxt_list *)Instruction->DATA;
|
||||
/*
|
||||
** Special treatments for NEXT instruction
|
||||
*/
|
||||
if ( ( ScanNext->LABEL == VasyForLabel ) ||
|
||||
( ( ScanNext->LABEL == (char *)0 ) &&
|
||||
( VasyForEnterNewLoop == 0 ) ) )
|
||||
{
|
||||
InstType = VBH_BEEXT;
|
||||
|
||||
ScanExit = (vbext_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbext_list ) );
|
||||
NewExit = (vbext_list *)Pointer;
|
||||
|
||||
NewExit->LINE = ScanNext->LINE;
|
||||
NewExit->CND = VasyUnrollForBodyVexExpr( ScanNext->CND );
|
||||
|
||||
TrueFalse = VasyUnrollIsVexCondTrueFalse( NewExit->CND );
|
||||
|
||||
if ( TrueFalse == 0 )
|
||||
{
|
||||
freevexexpr( NewExit->CND );
|
||||
autfreeheap( Pointer, sizeof( vbext_list ) );
|
||||
Pointer = (void *)0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( TrueFalse == 1 )
|
||||
{
|
||||
freevexexpr( NewExit->CND );
|
||||
NewExit->CND = (vexexpr *)0;
|
||||
}
|
||||
|
||||
NewExit->LABEL = VasyForLabelNext;
|
||||
}
|
||||
|
||||
VasyForFoundNext = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
Pointer = autallocheap( sizeof( vbnxt_list ) );
|
||||
NewNext = (vbnxt_list *)Pointer;
|
||||
|
||||
NewNext->LINE = ScanNext->LINE;
|
||||
NewNext->CND = VasyUnrollForBodyVexExpr( ScanNext->CND );
|
||||
|
||||
TrueFalse = VasyUnrollIsVexCondTrueFalse( NewNext->CND );
|
||||
|
||||
if ( TrueFalse == 0 )
|
||||
{
|
||||
freevexexpr( NewNext->CND );
|
||||
autfreeheap( Pointer, sizeof( vbnxt_list ) );
|
||||
Pointer = (void *)0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( TrueFalse == 1 )
|
||||
{
|
||||
freevexexpr( NewNext->CND );
|
||||
NewNext->CND = (vexexpr *)0;
|
||||
}
|
||||
|
||||
NewNext->LABEL = VasyUnrollForRenameLabel( ScanNext->LABEL );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEEXT :
|
||||
/*
|
||||
** Special treatments for EXIT instruction
|
||||
*/
|
||||
ScanExit = (vbext_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbext_list ) );
|
||||
NewExit = (vbext_list *)Pointer;
|
||||
|
||||
NewExit->LINE = ScanExit->LINE;
|
||||
NewExit->CND = VasyUnrollForBodyVexExpr( ScanExit->CND );
|
||||
|
||||
if ( ( ScanExit->LABEL == VasyForLabel ) ||
|
||||
( ( ScanExit->LABEL == (char *)0 ) &&
|
||||
( VasyForEnterNewLoop == 0 ) ) )
|
||||
{
|
||||
VasyForFoundExit = 1;
|
||||
NewExit->LABEL = VasyForLabelExit;
|
||||
}
|
||||
else
|
||||
{
|
||||
NewExit->LABEL = VasyUnrollForRenameLabel( ScanExit->LABEL );
|
||||
}
|
||||
|
||||
TrueFalse = VasyUnrollIsVexCondTrueFalse( NewExit->CND );
|
||||
|
||||
if ( TrueFalse == 0 )
|
||||
{
|
||||
freevexexpr( NewExit->CND );
|
||||
autfreeheap( Pointer, sizeof( vbext_list ) );
|
||||
Pointer = (void *)0;
|
||||
}
|
||||
else
|
||||
if ( TrueFalse == 1 )
|
||||
{
|
||||
freevexexpr( NewExit->CND );
|
||||
NewExit->CND = (vexexpr *)0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEWAS :
|
||||
|
||||
ScanWait = (vbwas_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbwas_list ) );
|
||||
NewWait = (vbwas_list *)Pointer;
|
||||
|
||||
for ( ScanChain = ScanWait->SEN;
|
||||
ScanChain != (chain_list *)0;
|
||||
ScanChain = ScanChain->NEXT )
|
||||
{
|
||||
NewWait->SEN = addchain( NewWait->SEN, ScanChain->DATA );
|
||||
}
|
||||
|
||||
NewWait->CND = VasyUnrollForBodyVexExpr( ScanWait->CND );
|
||||
NewWait->TIME_UNIT = ScanWait->TIME_UNIT;
|
||||
NewWait->TIMEOUT = ScanWait->TIMEOUT;
|
||||
NewWait->LINE = ScanWait->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BERET :
|
||||
|
||||
ScanReturn = (vbret_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbret_list ) );
|
||||
NewReturn = (vbret_list *)Pointer;
|
||||
|
||||
NewReturn->RET = VasyUnrollForBodyVexExpr( ScanReturn->RET );
|
||||
NewReturn->LINE = ScanReturn->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BECAL :
|
||||
|
||||
ScanCall = (vbcal_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbcal_list ) );
|
||||
NewCall = (vbcal_list *)Pointer;
|
||||
|
||||
NewCall->CALL = VasyUnrollForBodyVexExpr( ScanCall->CALL );
|
||||
NewCall->LINE = ScanCall->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEAGR :
|
||||
|
||||
ScanAgr = (vbagr_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbagr_list ) );
|
||||
NewAgr = (vbagr_list *)Pointer;
|
||||
|
||||
NewAgr->ASSIGN = VasyUnrollForBody( ScanAgr->ASSIGN );
|
||||
NewAgr->LINE = ScanAgr->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEIFS :
|
||||
|
||||
ScanIfs = (vbifs_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbifs_list ) );
|
||||
NewIfs = (vbifs_list *)Pointer;
|
||||
|
||||
NewIfs->CND = VasyUnrollForBodyVexExpr( ScanIfs->CND );
|
||||
NewIfs->CNDTRUE = VasyUnrollForBody( ScanIfs->CNDTRUE );
|
||||
NewIfs->CNDFALSE = VasyUnrollForBody( ScanIfs->CNDFALSE );
|
||||
NewIfs->LINE = ScanIfs->LINE;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BECAS :
|
||||
|
||||
ScanCase = (vbcas_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbcas_list ) );
|
||||
NewCase = (vbcas_list *)Pointer;
|
||||
|
||||
NewCase->VEX = VasyUnrollForBodyVexExpr( ScanCase->VEX );
|
||||
NewCase->TYPE = ScanCase->TYPE;
|
||||
NewCase->LINE = ScanCase->LINE;
|
||||
|
||||
NewCase->SIZE = ScanCase->SIZE;
|
||||
NewCase->CHOICE = (vbcho_list *)autallocblock( ScanCase->SIZE * sizeof( vbcho_list ) );
|
||||
|
||||
for ( Offset = 0; Offset < ScanCase->SIZE; Offset++ )
|
||||
{
|
||||
ScanChoice = &ScanCase->CHOICE[ Offset ];
|
||||
NewChoice = &NewCase->CHOICE[ Offset ];
|
||||
|
||||
NewChoice->INSTRUCTION = VasyUnrollForBody( ScanChoice->INSTRUCTION );
|
||||
|
||||
NewChoice->VALUES = (chain_list *)0;
|
||||
|
||||
for ( ScanValue = ScanChoice->VALUES;
|
||||
ScanValue != (chain_list *)0;
|
||||
ScanValue = ScanValue->NEXT )
|
||||
{
|
||||
NewChoice->VALUES = addchain( NewChoice->VALUES, ScanValue->DATA );
|
||||
}
|
||||
|
||||
NewChoice->SIZE = ScanChoice->SIZE ;
|
||||
NewChoice->LINE = ScanChoice->LINE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEFOR :
|
||||
|
||||
ScanFor = (vbfor_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbfor_list ) );
|
||||
NewFor = (vbfor_list *)Pointer;
|
||||
|
||||
VasyUnrollForAddLabel( ScanFor->LABEL );
|
||||
|
||||
VasyForEnterNewLoop++;
|
||||
NewFor->INSTRUCTION = VasyUnrollForBody( ScanFor->INSTRUCTION );
|
||||
VasyForEnterNewLoop--;
|
||||
|
||||
NewFor->LABEL = VasyUnrollForRenameLabel( ScanFor->LABEL );
|
||||
NewFor->VARIABLE = VasyUnrollForBodyVexExpr( ScanFor->VARIABLE );
|
||||
NewFor->LEFT = VasyUnrollForBodyVexExpr( ScanFor->LEFT );
|
||||
NewFor->RIGHT = VasyUnrollForBodyVexExpr( ScanFor->RIGHT );
|
||||
NewFor->UP = ScanFor->UP;
|
||||
NewFor->LINE = ScanFor->LINE;
|
||||
|
||||
VasyUnrollForDelLabel( ScanFor->LABEL );
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEWHI :
|
||||
|
||||
ScanWhile = (vbwhi_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vbwhi_list ) );
|
||||
NewWhile = (vbwhi_list *)Pointer;
|
||||
|
||||
VasyUnrollForAddLabel( ScanWhile->LABEL );
|
||||
|
||||
VasyForEnterNewLoop++;
|
||||
NewWhile->INSTRUCTION = VasyUnrollForBody( ScanWhile->INSTRUCTION );
|
||||
VasyForEnterNewLoop--;
|
||||
|
||||
NewWhile->LABEL = VasyUnrollForRenameLabel( ScanWhile->LABEL );
|
||||
NewWhile->CND = VasyUnrollForBodyVexExpr( ScanWhile->CND );
|
||||
NewWhile->LINE = ScanWhile->LINE;
|
||||
|
||||
VasyUnrollForDelLabel( ScanWhile->LABEL );
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BELOP :
|
||||
|
||||
ScanLoop = (vblop_list *)Instruction->DATA;
|
||||
Pointer = autallocheap( sizeof( vblop_list ) );
|
||||
NewLoop = (vblop_list *)Pointer;
|
||||
|
||||
VasyUnrollForAddLabel( ScanLoop->LABEL );
|
||||
|
||||
VasyForEnterNewLoop++;
|
||||
NewLoop->INSTRUCTION = VasyUnrollForBody( ScanLoop->INSTRUCTION );
|
||||
VasyForEnterNewLoop--;
|
||||
|
||||
NewLoop->LABEL = VasyUnrollForRenameLabel( ScanLoop->LABEL );
|
||||
NewLoop->LINE = ScanLoop->LINE;
|
||||
|
||||
VasyUnrollForDelLabel( ScanLoop->LABEL );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
if ( Pointer != (void *)0 )
|
||||
{
|
||||
NewInstruction = addptype( NewInstruction, InstType, Pointer );
|
||||
}
|
||||
|
||||
Instruction = Instruction->NEXT;
|
||||
}
|
||||
|
||||
NewInstruction = (ptype_list *)reverse( (chain_list *)NewInstruction );
|
||||
|
||||
return( NewInstruction );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyUnrollForInstruction |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static ptype_list *VasyUnrollForInstruction( Instruction )
|
||||
|
||||
ptype_list *Instruction;
|
||||
{
|
||||
ptype_list *NewBody;
|
||||
ptype_list **PrevPType;
|
||||
ptype_list **PrevPType2;
|
||||
ptype_list *ScanPType;
|
||||
vblop_list *NewLoop;
|
||||
ptype_list *NewExit;
|
||||
vbfor_list *ScanFor;
|
||||
vexexpr *VexLeft;
|
||||
vexexpr *VexRight;
|
||||
vexexpr *VexAtom;
|
||||
ptype_list *HeadBody;
|
||||
long Left;
|
||||
long Right;
|
||||
|
||||
ScanFor = (vbfor_list *)Instruction->DATA;
|
||||
VexAtom = ScanFor->VARIABLE;
|
||||
|
||||
VexLeft = ScanFor->LEFT;
|
||||
VasyUnrollSubstConst( VexLeft );
|
||||
VexLeft = simpvexexpr( VexLeft );
|
||||
ScanFor->LEFT = VexLeft;
|
||||
|
||||
VexRight = ScanFor->RIGHT;
|
||||
VasyUnrollSubstConst( VexRight );
|
||||
VexRight = simpvexexpr( VexRight );
|
||||
ScanFor->RIGHT = VexRight;
|
||||
|
||||
VasyForIndexName = GetVexAtomValue( VexAtom );
|
||||
|
||||
if ( ( evalvexatomlong( VexLeft, &Left ) ) ||
|
||||
( evalvexatomlong( VexRight, &Right ) ) )
|
||||
{
|
||||
viewvexexprln( VexLeft ); viewvexexprln( VexRight );
|
||||
VasyError( VASY_ERROR_IN_UNROLL_LOOP, (char *)0 );
|
||||
}
|
||||
|
||||
if ( ( Left < 0 ) ||
|
||||
( Right < 0 ) ) VasyForIndexSigned = 1;
|
||||
else VasyForIndexSigned = 0;
|
||||
|
||||
VasyForIndexValue = Left;
|
||||
VasyForFoundNext = 0;
|
||||
VasyForFoundExit = 0;
|
||||
VasyForLabel = ScanFor->LABEL;
|
||||
|
||||
PrevPType = &HeadBody;
|
||||
HeadBody = (ptype_list *)0;
|
||||
|
||||
sprintf( VasyBuffer, "%s_exit", ScanFor->LABEL );
|
||||
VasyForLabelExit = namealloc( VasyBuffer );
|
||||
|
||||
while ( ( ( VasyForIndexValue <= Right ) && ( ScanFor->UP ) ) ||
|
||||
( ( VasyForIndexValue >= Right ) && ( ! ScanFor->UP ) ) )
|
||||
{
|
||||
sprintf( VasyBuffer, "%s_next_%ld", ScanFor->LABEL, VasyForIndexValue );
|
||||
VasyForLabelNext = namealloc( VasyBuffer );
|
||||
|
||||
NewBody = VasyUnrollForBody( ScanFor->INSTRUCTION );
|
||||
|
||||
if ( VasyForFoundNext )
|
||||
{
|
||||
ScanPType = vbh_addvblop( (ptype_list *)0, VasyForLabelNext, ScanFor->LINE );
|
||||
NewLoop = (vblop_list *)ScanPType->DATA;
|
||||
NewLoop->INSTRUCTION = NewBody;
|
||||
|
||||
*PrevPType = ScanPType;
|
||||
PrevPType = &ScanPType->NEXT;
|
||||
|
||||
PrevPType2 = &NewBody;
|
||||
|
||||
for ( ScanPType = NewBody;
|
||||
ScanPType != (ptype_list *)0;
|
||||
ScanPType = ScanPType->NEXT )
|
||||
{
|
||||
PrevPType2 = &ScanPType->NEXT;
|
||||
}
|
||||
|
||||
NewExit = addptype( (ptype_list *)0, VBH_BEEXT,
|
||||
vbh_addvbext( VasyForLabelNext, (vexexpr *)0, ScanFor->LINE ) );
|
||||
*PrevPType2 = NewExit;
|
||||
}
|
||||
else
|
||||
{
|
||||
*PrevPType = NewBody;
|
||||
|
||||
for ( ScanPType = NewBody;
|
||||
ScanPType != (ptype_list *)0;
|
||||
ScanPType = ScanPType->NEXT )
|
||||
{
|
||||
PrevPType = &ScanPType->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
if ( ScanFor->UP ) VasyForIndexValue++;
|
||||
else VasyForIndexValue--;
|
||||
}
|
||||
|
||||
if ( VasyForFoundExit )
|
||||
{
|
||||
NewExit = addptype( (ptype_list *)0, VBH_BEEXT,
|
||||
vbh_addvbext( VasyForLabelExit, (vexexpr *)0, ScanFor->LINE ) );
|
||||
*PrevPType = NewExit;
|
||||
|
||||
ScanPType = vbh_addvblop( (ptype_list *)0, VasyForLabelExit, ScanFor->LINE );
|
||||
NewLoop = (vblop_list *)ScanPType->DATA;
|
||||
NewLoop->INSTRUCTION = HeadBody;
|
||||
|
||||
HeadBody = ScanPType;
|
||||
PrevPType = &ScanPType->NEXT;
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel2() )
|
||||
{
|
||||
vbh_viewvbinst( HeadBody );
|
||||
}
|
||||
|
||||
*PrevPType = Instruction->NEXT;
|
||||
|
||||
Instruction->NEXT = (ptype_list *)0;
|
||||
vbh_frevbinst( Instruction );
|
||||
|
||||
return( HeadBody );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyUnrollScanInstruction |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static ptype_list *VasyUnrollScanInstruction( Instruction )
|
||||
|
||||
ptype_list *Instruction;
|
||||
{
|
||||
ptype_list *ScanPType;
|
||||
ptype_list **PrevPType;
|
||||
vbifs_list *ScanIfs;
|
||||
vbcas_list *ScanCase;
|
||||
vbcho_list *ScanChoice;
|
||||
vblop_list *ScanLoop;
|
||||
vbwhi_list *ScanWhile;
|
||||
int Offset;
|
||||
|
||||
ScanPType = Instruction;
|
||||
PrevPType = &Instruction;
|
||||
|
||||
while ( ScanPType != (ptype_list *)0 )
|
||||
{
|
||||
switch ( ScanPType->TYPE )
|
||||
{
|
||||
case VBH_BEIFS :
|
||||
|
||||
ScanIfs = (vbifs_list *)ScanPType->DATA;
|
||||
ScanIfs->CNDTRUE = VasyUnrollScanInstruction( ScanIfs->CNDTRUE );
|
||||
ScanIfs->CNDFALSE = VasyUnrollScanInstruction( ScanIfs->CNDFALSE );
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BECAS :
|
||||
|
||||
ScanCase = (vbcas_list *)ScanPType->DATA;
|
||||
for ( Offset = 0; Offset < ScanCase->SIZE; Offset++ )
|
||||
{
|
||||
ScanChoice = &ScanCase->CHOICE[ Offset ];
|
||||
ScanChoice->INSTRUCTION = VasyUnrollScanInstruction( ScanChoice->INSTRUCTION );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEFOR :
|
||||
|
||||
ScanPType = VasyUnrollForInstruction( ScanPType );
|
||||
*PrevPType = ScanPType;
|
||||
|
||||
continue;
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BEWHI :
|
||||
|
||||
ScanWhile = (vbwhi_list *)ScanPType->DATA;
|
||||
ScanWhile->INSTRUCTION = VasyUnrollScanInstruction( ScanWhile->INSTRUCTION );
|
||||
|
||||
break;
|
||||
|
||||
case VBH_BELOP :
|
||||
|
||||
ScanLoop = (vblop_list *)ScanPType->DATA;
|
||||
ScanLoop->INSTRUCTION = VasyUnrollScanInstruction( ScanLoop->INSTRUCTION );
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
PrevPType = &ScanPType->NEXT;
|
||||
ScanPType = ScanPType->NEXT;
|
||||
}
|
||||
|
||||
return( Instruction );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyUnrollLoopVbhFig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyUnrollLoopVbhFig( VbhFigure )
|
||||
|
||||
vbfig_list *VbhFigure;
|
||||
{
|
||||
vbpcs_list *VbhProcess;
|
||||
vbgen_list *VbhGeneric;
|
||||
vbcst_list *VbhConstant;
|
||||
char *Name;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyUnrollLoopVbhFig %s\n", VbhFigure->NAME );
|
||||
}
|
||||
|
||||
VasyHashLabel = createauthtable( 100 );
|
||||
VasyHashConstant = createauthtable( 100 );
|
||||
VasyHashGeneric = createauthtable( 100 );
|
||||
|
||||
for ( VbhGeneric = VbhFigure->BEGEN;
|
||||
VbhGeneric != (vbgen_list *)0;
|
||||
VbhGeneric = VbhGeneric->NEXT )
|
||||
{
|
||||
Name = getvexatomname( VbhGeneric->TARGET );
|
||||
addauthelem( VasyHashGeneric, Name, (long)VbhGeneric );
|
||||
}
|
||||
|
||||
for ( VbhConstant = VbhFigure->BECST;
|
||||
VbhConstant != (vbcst_list *)0;
|
||||
VbhConstant = VbhConstant->NEXT )
|
||||
{
|
||||
Name = getvexatomname( VbhConstant->TARGET );
|
||||
addauthelem( VasyHashConstant, Name, (long)VbhConstant );
|
||||
}
|
||||
|
||||
for ( VbhProcess = VbhFigure->BEPCS;
|
||||
VbhProcess != (vbpcs_list *)0;
|
||||
VbhProcess = VbhProcess->NEXT )
|
||||
{
|
||||
if ( ! IsVbhProcSequential( VbhProcess ) ) continue;
|
||||
|
||||
VbhProcess->INSTRUCTION = VasyUnrollScanInstruction( VbhProcess->INSTRUCTION );
|
||||
}
|
||||
|
||||
destroyauthtable( VasyHashLabel );
|
||||
destroyauthtable( VasyHashConstant );
|
||||
destroyauthtable( VasyHashGeneric );
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
vbh_viewvbfig( VbhFigure );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyUnrollLoopVbhFig %s\n\n", VbhFigure->NAME );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_loop.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
|
||||
# ifndef VASY_LOOP_H
|
||||
# define VASY_LOOP_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyUnrollLoopVbhFig();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,461 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_main.c |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "vex.h"
|
||||
# include "bdd.h"
|
||||
# include "vbh.h"
|
||||
# include "vbl.h"
|
||||
# include "vpn.h"
|
||||
# include "vtl.h"
|
||||
# include "rtn.h"
|
||||
|
||||
# include "vasy_error.h"
|
||||
# include "vasy_debug.h"
|
||||
# include "vasy_shared.h"
|
||||
# include "vasy_parse.h"
|
||||
# include "vasy_preanal.h"
|
||||
# include "vasy_func.h"
|
||||
# include "vasy_elabo.h"
|
||||
# include "vasy_reduce.h"
|
||||
# include "vasy_analys.h"
|
||||
# include "vasy_simprtl.h"
|
||||
# include "vasy_drvalc.h"
|
||||
# include "vasy_drvsyn.h"
|
||||
# include "vasy_drvvlog.h"
|
||||
# include "vasy_drvrtl.h"
|
||||
# include "vasy_main.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Vasy Usage |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyUsage()
|
||||
{
|
||||
fprintf( stderr, " vasy [Options] Input_name Output_name\n\n" );
|
||||
|
||||
fprintf( stdout, " Options : -D [Level] [File] Sets Debug mode on\n" );
|
||||
fprintf( stdout, " -V Sets Verbose mode on\n" );
|
||||
fprintf( stdout, " -I Extention Input file format\n" );
|
||||
fprintf( stdout, " -H Sets Hierarchical mode on\n" );
|
||||
fprintf( stdout, " -P File Specifies package list file\n" );
|
||||
fprintf( stdout, " -v Verilog output\n" );
|
||||
fprintf( stdout, " -a Alliance output\n" );
|
||||
fprintf( stdout, " -s Standard VHDL output\n" );
|
||||
fprintf( stdout, " -r Rtl output\n" );
|
||||
fprintf( stdout, " -o Overwrites existing files\n" );
|
||||
fprintf( stdout, " -i Drives initials values\n" );
|
||||
fprintf( stdout, " -p Adds power supply connectors\n" );
|
||||
fprintf( stdout, " -S Uses Std_logic instead of Bit\n" );
|
||||
fprintf( stdout, " -C Number_bit Uses CLA adder (with -a only)\n" );
|
||||
fprintf( stdout, " -E Number_bit Expands equal operator (with -a only)\n" );
|
||||
fprintf( stdout, " -L Drives a .lax file (with -a only)\n" );
|
||||
fprintf( stdout, " -B Drives a .boom file (with -a only)\n" );
|
||||
fprintf( stdout, "\n" );
|
||||
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyMainTreatModel |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
vbfig_list *VasyMainTreatModel( InputFileName, OutputFileName, GenMap, Deep )
|
||||
|
||||
char *InputFileName;
|
||||
char *OutputFileName;
|
||||
vbmap_list *GenMap;
|
||||
int Deep;
|
||||
{
|
||||
vbfig_list *VbhFigure;
|
||||
vpnfig_list *VpnFigure;
|
||||
rtlfig_list *RtlFigure;
|
||||
int Index;
|
||||
char Tab[ 32 ];
|
||||
|
||||
if ( Deep > 30 ) Deep = 30;
|
||||
|
||||
Tab[ 0 ] = '\t';
|
||||
|
||||
for ( Index = 1; Index < Deep; Index++ )
|
||||
{
|
||||
Tab[ Index ] = ' ';
|
||||
}
|
||||
|
||||
Tab[ Index ] = '\0';
|
||||
|
||||
fprintf( stdout, "%s--> Run VHDL Compiler\n", Tab );
|
||||
fprintf( stdout, "%s--> Compile file %s\n", Tab, InputFileName );
|
||||
|
||||
VbhFigure = VasyParseVbhFig( InputFileName, GenMap, Deep );
|
||||
|
||||
if ( VasyFlagVerbose )
|
||||
{
|
||||
fprintf( stdout, "%s--> Translate to VPN\n", Tab );
|
||||
}
|
||||
|
||||
VpnFigure = VasyParseVbh2VpnFig( VbhFigure );
|
||||
|
||||
if ( VasyFlagVerbose )
|
||||
{
|
||||
fprintf( stdout, "%s--> Preliminary Analysis\n", Tab );
|
||||
}
|
||||
|
||||
VasyPreAnalysisVpnFig( VpnFigure );
|
||||
|
||||
if ( VasyFlagVerbose )
|
||||
{
|
||||
fprintf( stdout, "%s--> In-Line function\n", Tab );
|
||||
}
|
||||
|
||||
VasyFuncVpnFig( VpnFigure );
|
||||
|
||||
if ( VasyFlagVerbose )
|
||||
{
|
||||
fprintf( stdout, "%s--> Elaboration\n", Tab );
|
||||
}
|
||||
|
||||
VasyElaborateVpnFig( VpnFigure );
|
||||
|
||||
if ( VasyFlagVerbose )
|
||||
{
|
||||
fprintf( stdout, "%s--> Petri Net Reduction\n", Tab );
|
||||
}
|
||||
|
||||
VasyReduceVpnFig( VpnFigure );
|
||||
|
||||
if ( VasyFlagVerbose )
|
||||
{
|
||||
fprintf( stdout, "%s--> Analysis and Synthesis\n", Tab );
|
||||
}
|
||||
|
||||
RtlFigure = VasyAnalysisVpnFig( VpnFigure );
|
||||
|
||||
if ( VasyFlagVerbose )
|
||||
{
|
||||
fprintf( stdout, "%s--> Simplify RTL figure\n", Tab );
|
||||
}
|
||||
|
||||
VasySimplifyRtlFig( RtlFigure );
|
||||
|
||||
RtlFigure->NAME = namealloc( OutputFileName );
|
||||
|
||||
if ( VasyFlagDrive == 0 )
|
||||
{
|
||||
fprintf( stdout, "%s--> Drive Verilog file %s\n", Tab, OutputFileName );
|
||||
|
||||
VasyDriveVerilogRtlFig( RtlFigure, OutputFileName );
|
||||
}
|
||||
else
|
||||
if ( VasyFlagDrive == 1 )
|
||||
{
|
||||
fprintf( stdout, "%s--> Drive Alliance file %s\n", Tab, OutputFileName );
|
||||
|
||||
VasyDriveAllianceRtlFig( RtlFigure, OutputFileName );
|
||||
}
|
||||
else
|
||||
if ( VasyFlagDrive == 2 )
|
||||
{
|
||||
fprintf( stdout, "%s--> Drive Standard VHDL file %s\n", Tab, OutputFileName );
|
||||
|
||||
VasyDriveSynopsysRtlFig( RtlFigure, OutputFileName, VasyFlagStdLogic, VasyFlagInitial, VasyFlagOver );
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf( stdout, "%s--> Drive Rtl file %s\n", Tab, OutputFileName );
|
||||
|
||||
VasyDriveRtlRtlFig( RtlFigure, OutputFileName );
|
||||
}
|
||||
|
||||
return( VbhFigure );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Main |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
int main( argc, argv )
|
||||
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
char *InputFileName;
|
||||
char *OutputFileName;
|
||||
char *PackageFileName;
|
||||
char *InputFormat;
|
||||
char Option;
|
||||
int Number;
|
||||
int Index;
|
||||
|
||||
|
||||
alliancebanner_with_contrib(
|
||||
"VASY", VASY_VERSION, "VHDL Analyzer for SYnthesis",
|
||||
"2000", ALLIANCE_VERSION, "Ludovic Jacomme", "Frederic Petrot" );
|
||||
|
||||
mbkenv();
|
||||
autenv();
|
||||
ablenv();
|
||||
bddenv();
|
||||
vexenv();
|
||||
vpnenv();
|
||||
|
||||
if ( argc < 2 ) VasyUsage();
|
||||
|
||||
InputFileName = (char *)0;
|
||||
OutputFileName = (char *)0;
|
||||
PackageFileName = (char *)0;
|
||||
|
||||
for ( Number = 1; Number < argc; Number++ )
|
||||
{
|
||||
if ( argv[ Number ][ 0 ] == '-' )
|
||||
{
|
||||
for ( Index = 1; argv[ Number ][ Index ] != '\0'; Index++ )
|
||||
{
|
||||
Option = argv[ Number ][ Index ];
|
||||
|
||||
if ( VasyFlagDebug )
|
||||
{
|
||||
if ( ! VasyDebugAddItem( &argv[ Number ][ Index ], VasyFlagDebug ) )
|
||||
{
|
||||
VasyUsage();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
if ( VasyFlagOption )
|
||||
{
|
||||
if ( ! VasyDebugSetOption( &argv[ Number ][ Index ] ) )
|
||||
{
|
||||
VasyUsage();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( Option == 'I' )
|
||||
{
|
||||
Number = Number + 1;
|
||||
|
||||
if ( Number < argc )
|
||||
{
|
||||
if ( argv[ Number ][ 0 ] == '.' )
|
||||
{
|
||||
InputFormat = &argv[ Number ][ 1 ];
|
||||
}
|
||||
else
|
||||
{
|
||||
InputFormat = argv[ Number ];
|
||||
}
|
||||
|
||||
VPN_IN = namealloc( InputFormat );
|
||||
}
|
||||
else VasyUsage();
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
if ( Option == 'P' )
|
||||
{
|
||||
Number = Number + 1;
|
||||
|
||||
if ( Number < argc )
|
||||
{
|
||||
PackageFileName = argv[ Number ];
|
||||
}
|
||||
else VasyUsage();
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
if ( Option == 'C' )
|
||||
{
|
||||
Number = Number + 1;
|
||||
|
||||
if ( Number < argc )
|
||||
{
|
||||
VasyFlagCLA = atoi( argv[ Number ] );
|
||||
}
|
||||
else VasyUsage();
|
||||
|
||||
break;
|
||||
}
|
||||
else
|
||||
if ( Option == 'E' )
|
||||
{
|
||||
Number = Number + 1;
|
||||
|
||||
if ( Number < argc )
|
||||
{
|
||||
VasyFlagEqual = atoi( argv[ Number ] );
|
||||
}
|
||||
else VasyUsage();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
switch ( Option )
|
||||
{
|
||||
case 'V' : VasyFlagVerbose = 1;
|
||||
break;
|
||||
case 'L' : VasyFlagLax = 1;
|
||||
break;
|
||||
case 'B' : VasyFlagBoom = 1;
|
||||
break;
|
||||
case 'H' : VasyFlagHier = 1;
|
||||
break;
|
||||
case 'S' : VasyFlagStdLogic = 1;
|
||||
break;
|
||||
case 'p' : VasyFlagPower = 1;
|
||||
break;
|
||||
case 'i' : VasyFlagInitial = 1;
|
||||
break;
|
||||
case 'o' : VasyFlagOver = 1;
|
||||
break;
|
||||
case 'v' : VasyFlagDrive = 0;
|
||||
break;
|
||||
case 'a' : VasyFlagDrive = 1;
|
||||
break;
|
||||
case 's' : VasyFlagDrive = 2;
|
||||
break;
|
||||
case 'r' : VasyFlagDrive = 3;
|
||||
break;
|
||||
case 'D' :
|
||||
|
||||
Index = Index + 1;
|
||||
Option = argv[ Number ][ Index ];
|
||||
|
||||
if ( Option == '0' ) VasyFlagDebug = VASY_DEBUG_LEVEL0;
|
||||
else
|
||||
if ( Option == '1' ) VasyFlagDebug = VASY_DEBUG_LEVEL1;
|
||||
else
|
||||
if ( Option == '2' ) VasyFlagDebug = VASY_DEBUG_LEVEL2;
|
||||
else
|
||||
VasyUsage();
|
||||
break;
|
||||
|
||||
case 'O' :
|
||||
VasyFlagOption = 1;
|
||||
break;
|
||||
|
||||
default : VasyUsage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VasyFlagDebug = 0;
|
||||
VasyFlagOption = 0;
|
||||
}
|
||||
else
|
||||
if ( InputFileName == (char *)0 ) InputFileName = argv[ Number ];
|
||||
else
|
||||
if ( OutputFileName == (char *)0 ) OutputFileName = argv[ Number ];
|
||||
else
|
||||
VasyUsage();
|
||||
}
|
||||
|
||||
if ( InputFileName == (char *)0 ) VasyUsage();
|
||||
|
||||
InputFileName = autbasename( InputFileName, VPN_IN );
|
||||
|
||||
if ( OutputFileName == (char *)0 )
|
||||
{
|
||||
OutputFileName = InputFileName;
|
||||
}
|
||||
|
||||
if ( IsVasyDebugStatistics() ) VasyDebugStartChrono(0);
|
||||
|
||||
if ( PackageFileName != (char *)0 )
|
||||
{
|
||||
VasyParsePackage( PackageFileName );
|
||||
}
|
||||
|
||||
VasyMainTreatModel( InputFileName, OutputFileName, (vbmap_list *)0, 1 );
|
||||
|
||||
vbh_frevbfig( VBL_HEADFIG );
|
||||
|
||||
if ( IsVasyDebugStatistics() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> Total time : %ld sec\n", VasyDebugReadChrono(0) );
|
||||
}
|
||||
|
||||
fprintf( stdout, "\n" );
|
||||
|
||||
|
||||
return( 0 );
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_main.h |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_MAIN_H
|
||||
# define VASY_MAIN_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern vbfig_list *VasyMainTreatModel();
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,71 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_mulwait.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_MULWAIT_H
|
||||
# define VASY_MULWAIT_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyMultiWaitVpnProc();
|
||||
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,71 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_onewait.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_ONEWAIT_H
|
||||
# define VASY_ONEWAIT_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyOneWaitVpnProc();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,971 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_parse.c |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "bdd.h"
|
||||
# include "vex.h"
|
||||
# include "vbh.h"
|
||||
# include "vbl.h"
|
||||
# include "vpn.h"
|
||||
# include "vtl.h"
|
||||
|
||||
# include "vasy_shared.h"
|
||||
# include "vasy_parse.h"
|
||||
# include "vasy_debug.h"
|
||||
# include "vasy_generic.h"
|
||||
# include "vasy_generate.h"
|
||||
# include "vasy_loop.h"
|
||||
# include "vasy_array.h"
|
||||
# include "vasy_error.h"
|
||||
# include "vasy_main.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Private variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static char VasyBuffer[ 512 ];
|
||||
static authtable *VasyHashTreatedModel = (authtable *)0;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyParseVerifyVexWidth |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyParseVerifyVexWidth( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
chain_list *ScanOper;
|
||||
char *FuncName;
|
||||
vexexpr *VexOperand;
|
||||
int FuncId;
|
||||
short Width;
|
||||
long Oper;
|
||||
|
||||
if ( IsVexNodeAtom( VexExpr ) )
|
||||
{
|
||||
if ( IsVexNodeVarWidth( VexExpr ) )
|
||||
{
|
||||
VasyPrintf( stdout, "ERROR size of atom %s should be static\n",
|
||||
GetVexAtomValue( VexExpr ) );
|
||||
autexit( 1 );
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( IsVexNodeFunc( VexExpr ) )
|
||||
{
|
||||
for ( ScanOper = VexExpr->OPERAND;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
VasyParseVerifyVexWidth( GetVexOperand( ScanOper ) );
|
||||
}
|
||||
|
||||
FuncName = GetVexFuncValue( VexExpr );
|
||||
FuncId = getvexstdfuncid( FuncName );
|
||||
|
||||
if ( FuncId != -1 )
|
||||
{
|
||||
switch ( FuncId )
|
||||
{
|
||||
case VEX_STD_TO_BIT :
|
||||
case VEX_STD_TO_BITVECTOR :
|
||||
case VEX_STD_TO_STDULOGIC :
|
||||
case VEX_STD_TO_STDLOGICVECTOR :
|
||||
case VEX_STD_TO_STDULOGICVECTOR :
|
||||
case VEX_STD_TO_X01 :
|
||||
case VEX_STD_TO_X01Z :
|
||||
case VEX_STD_TO_UX01 :
|
||||
case VEX_STD_CONV_INTEGER :
|
||||
case VEX_STD_RISING_EDGE :
|
||||
case VEX_STD_FALLING_EDGE :
|
||||
case VEX_STD_STD_LOGIC_VECTOR :
|
||||
case VEX_STD_STD_ULOGIC_VECTOR :
|
||||
case VEX_STD_SIGNED :
|
||||
case VEX_STD_UNSIGNED :
|
||||
case VEX_STD_TO_INTEGER :
|
||||
|
||||
VexOperand = GetVexOperand( VexExpr->OPERAND );
|
||||
VexExpr->WIDTH = VexOperand->WIDTH;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Oper = GetVexOperValue( VexExpr );
|
||||
VexOperand = GetVexOperand( VexExpr->OPERAND );
|
||||
VasyParseVerifyVexWidth( VexOperand );
|
||||
|
||||
if ( ( Oper == VEX_EVENT ) ||
|
||||
( Oper == VEX_NOT ) ||
|
||||
( Oper == VEX_NEG ) ||
|
||||
( Oper == VEX_ABS ) )
|
||||
{
|
||||
VexExpr->WIDTH = VexOperand->WIDTH;
|
||||
ClearVexNodeVarWidth( VexExpr );
|
||||
}
|
||||
else
|
||||
if ( ( Oper == VEX_OR ) ||
|
||||
( Oper == VEX_AND ) ||
|
||||
( Oper == VEX_XOR ) ||
|
||||
( Oper == VEX_NOR ) ||
|
||||
( Oper == VEX_NAND ) ||
|
||||
( Oper == VEX_NXOR ) )
|
||||
{
|
||||
Width = VexOperand->WIDTH;
|
||||
|
||||
VexExpr->WIDTH = VexOperand->WIDTH;
|
||||
ClearVexNodeVarWidth( VexExpr );
|
||||
|
||||
for ( ScanOper = VexExpr->OPERAND->NEXT;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
VexOperand = GetVexOperand( ScanOper );
|
||||
VasyParseVerifyVexWidth( VexOperand );
|
||||
|
||||
if ( VexOperand->WIDTH != Width )
|
||||
{
|
||||
viewvexexprln( VexExpr );
|
||||
VasyPrintf( stdout, "ERROR illegal use of %s, different size width operands\n",
|
||||
getvexopername( Oper ) );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( ( Oper == VEX_CONCAT ) ||
|
||||
( Oper == VEX_MUL ) )
|
||||
{
|
||||
Width = VexOperand->WIDTH;
|
||||
|
||||
for ( ScanOper = VexExpr->OPERAND->NEXT;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
VexOperand = GetVexOperand( ScanOper );
|
||||
VasyParseVerifyVexWidth( VexOperand );
|
||||
|
||||
Width += VexOperand->WIDTH;
|
||||
}
|
||||
|
||||
ClearVexNodeVarWidth( VexExpr );
|
||||
VexExpr->WIDTH = Width;
|
||||
}
|
||||
else
|
||||
if ( ( Oper == VEX_EQ ) ||
|
||||
( Oper == VEX_NE ) ||
|
||||
( Oper == VEX_LT ) ||
|
||||
( Oper == VEX_LE ) ||
|
||||
( Oper == VEX_GT ) ||
|
||||
( Oper == VEX_GE ) )
|
||||
{
|
||||
for ( ScanOper = VexExpr->OPERAND->NEXT;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
VexOperand = GetVexOperand( ScanOper );
|
||||
VasyParseVerifyVexWidth( VexOperand );
|
||||
}
|
||||
|
||||
ClearVexNodeVarWidth( VexExpr );
|
||||
VexExpr->WIDTH = 1;
|
||||
}
|
||||
else
|
||||
if ( ( Oper == VEX_ADD ) ||
|
||||
( Oper == VEX_SUB ) )
|
||||
{
|
||||
Width = VexOperand->WIDTH;
|
||||
|
||||
for ( ScanOper = VexExpr->OPERAND->NEXT;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
VexOperand = GetVexOperand( ScanOper );
|
||||
VasyParseVerifyVexWidth( VexOperand );
|
||||
|
||||
if ( VexOperand->WIDTH > Width ) Width = VexOperand->WIDTH;
|
||||
}
|
||||
|
||||
ClearVexNodeVarWidth( VexExpr );
|
||||
VexExpr->WIDTH = Width;
|
||||
}
|
||||
else
|
||||
if ( Oper == VEX_DIV )
|
||||
{
|
||||
Width = VexOperand->WIDTH;
|
||||
|
||||
for ( ScanOper = VexExpr->OPERAND->NEXT;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
VexOperand = GetVexOperand( ScanOper );
|
||||
VasyParseVerifyVexWidth( VexOperand );
|
||||
}
|
||||
|
||||
ClearVexNodeVarWidth( VexExpr );
|
||||
VexExpr->WIDTH = Width;
|
||||
}
|
||||
else
|
||||
if ( Oper != VEX_MOD )
|
||||
{
|
||||
viewvexexprln( VexExpr );
|
||||
VasyPrintf( stdout, "ERROR operator %s not supported !\n",
|
||||
getvexopername( Oper ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyParseVerifyVex |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
vexexpr *VasyParseVerifyVex( VexExpr )
|
||||
|
||||
vexexpr *VexExpr;
|
||||
{
|
||||
VasyParseVerifyVexWidth( VexExpr );
|
||||
|
||||
return( VexExpr );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyParseVerifyVbhFig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyParseVerifyVbhFig( VbhFigure )
|
||||
|
||||
vbfig_list *VbhFigure;
|
||||
{
|
||||
vbpor_list *VbhPort;
|
||||
vbaux_list *VbhAux;
|
||||
vbcst_list *VbhCst;
|
||||
vbmod_list *VbhMod;
|
||||
vbins_list *VbhIns;
|
||||
vbmap_list *VbhMap;
|
||||
vexexpr *VexTarget;
|
||||
vexexpr *VexExpr;
|
||||
int Error;
|
||||
|
||||
Error = 0;
|
||||
|
||||
for ( VbhPort = VbhFigure->BEPOR;
|
||||
VbhPort != (vbpor_list *)0;
|
||||
VbhPort = VbhPort->NEXT )
|
||||
{
|
||||
VexTarget = VbhPort->TARGET;
|
||||
VexExpr = VbhPort->VEX;
|
||||
|
||||
if ( ( ! IsVexNodeAtom( VexTarget ) ) ||
|
||||
( ( VexExpr != (vexexpr *)0 ) &&
|
||||
( ( ! IsVexNodeAtom( VexExpr ) ) ||
|
||||
( ! IsVexAtomLiteral( VexExpr ) ) ) ) )
|
||||
{
|
||||
fprintf( stdout, "ERROR size of port %s should be static\n",
|
||||
getvexatomname( VexTarget ) );
|
||||
Error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
for ( VbhCst = VbhFigure->BECST;
|
||||
VbhCst != (vbcst_list *)0;
|
||||
VbhCst = VbhCst->NEXT )
|
||||
{
|
||||
VexTarget = VbhCst->TARGET;
|
||||
VexExpr = VbhCst->VEX;
|
||||
|
||||
if ( ( ! IsVexNodeAtom( VexTarget ) ) ||
|
||||
( ( VexExpr != (vexexpr *)0 ) &&
|
||||
( ( ! IsVexNodeAtom( VexExpr ) ) ||
|
||||
( ! IsVexAtomLiteral( VexExpr ) ) ) ) )
|
||||
{
|
||||
fprintf( stdout, "ERROR size of constant %s should be static\n",
|
||||
getvexatomname( VexTarget ) );
|
||||
Error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
for ( VbhAux = VbhFigure->BEAUX;
|
||||
VbhAux != (vbaux_list *)0;
|
||||
VbhAux = VbhAux->NEXT )
|
||||
{
|
||||
VexTarget = VbhAux->TARGET;
|
||||
VexExpr = VbhAux->VEX;
|
||||
|
||||
if ( ( ! IsVexNodeAtom( VexTarget ) ) ||
|
||||
( ( VexExpr != (vexexpr *)0 ) &&
|
||||
( ( ! IsVexNodeAtom( VexExpr ) ) ||
|
||||
( ! IsVexAtomLiteral( VexExpr ) ) ) ) )
|
||||
{
|
||||
fprintf( stdout, "ERROR size of signal %s should be static\n",
|
||||
getvexatomname( VexTarget ) );
|
||||
Error = 1;
|
||||
}
|
||||
}
|
||||
|
||||
for ( VbhMod = VbhFigure->BEMOD;
|
||||
VbhMod != (vbmod_list *)0;
|
||||
VbhMod = VbhMod->NEXT )
|
||||
{
|
||||
for ( VbhPort = VbhMod->BEPOR;
|
||||
VbhPort != (vbpor_list *)0;
|
||||
VbhPort = VbhPort->NEXT )
|
||||
{
|
||||
VexTarget = VbhPort->TARGET;
|
||||
VexExpr = VbhPort->VEX;
|
||||
|
||||
if ( ( ! IsVexNodeAtom( VexTarget ) ) ||
|
||||
( ( VexExpr != (vexexpr *)0 ) &&
|
||||
( ! IsVexNodeAtom( VexExpr ) ) ) )
|
||||
{
|
||||
fprintf( stdout, "ERROR size of port %s in model %s should be static\n",
|
||||
getvexatomname( VexTarget ), VbhMod->NAME );
|
||||
Error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for ( VbhIns = VbhFigure->BEINS;
|
||||
VbhIns != (vbins_list *)0;
|
||||
VbhIns = VbhIns->NEXT )
|
||||
{
|
||||
for ( VbhMap = VbhIns->PORT_MAP;
|
||||
VbhMap != (vbmap_list *)0;
|
||||
VbhMap = VbhMap->NEXT )
|
||||
{
|
||||
VexTarget = VbhMap->FORMAL;
|
||||
VexExpr = VbhMap->ACTUAL;
|
||||
|
||||
if ( ! IsVexNodeAtom( VexTarget ) )
|
||||
{
|
||||
fprintf( stdout, "ERROR size of port map %s in instance %s should be static\n",
|
||||
getvexatomname( VexTarget ), VbhIns->NAME );
|
||||
Error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( Error ) autexit( 1 );
|
||||
|
||||
vbh_forallvexvbfig( VbhFigure, simpvexexpr, VasyParseVerifyVex );
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
vbh_viewvbfig( VbhFigure );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyParseVbhInstanceAddPower |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyParseVbhInstanceAddPower( VbhFigure )
|
||||
|
||||
vbfig_list *VbhFigure;
|
||||
{
|
||||
vbins_list *VbhInstance;
|
||||
vbmap_list *VbhMap;
|
||||
vbtyp_list *VbhType;
|
||||
vexexpr *VexFormal;
|
||||
vexexpr *VexActual;
|
||||
char *Name;
|
||||
int AddVdd;
|
||||
int AddVss;
|
||||
|
||||
VbhType = vbh_getvbtyp( VbhFigure, "bit" );
|
||||
|
||||
for ( VbhInstance = VbhFigure->BEINS;
|
||||
VbhInstance != (vbins_list *)0;
|
||||
VbhInstance = VbhInstance->NEXT )
|
||||
{
|
||||
AddVdd = 1;
|
||||
AddVss = 1;
|
||||
|
||||
for ( VbhMap = VbhInstance->PORT_MAP;
|
||||
VbhMap != (vbmap_list *)0;
|
||||
VbhMap = VbhMap->NEXT )
|
||||
{
|
||||
Name = getvexarrayname( VbhMap->FORMAL );
|
||||
|
||||
if ( Name == VasyPowerVdd ) AddVdd = 0;
|
||||
else
|
||||
if ( Name == VasyPowerVss ) AddVss = 0;
|
||||
}
|
||||
|
||||
if ( AddVdd )
|
||||
{
|
||||
VexFormal = createvexatombit( VasyPowerVdd );
|
||||
VexActual = dupvexexpr( VexFormal );
|
||||
|
||||
VbhInstance->PORT_MAP = vbh_addvbmap( VbhInstance->PORT_MAP, VexFormal, VexActual, 0 );
|
||||
}
|
||||
|
||||
if ( AddVss )
|
||||
{
|
||||
VexFormal = createvexatombit( VasyPowerVss );
|
||||
VexActual = dupvexexpr( VexFormal );
|
||||
|
||||
VbhInstance->PORT_MAP = vbh_addvbmap( VbhInstance->PORT_MAP, VexFormal, VexActual, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyParseVbhPortAddPower |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vbpor_list *VasyParseVbhPortAddPower( VbhFigure, HeadPort, ModelName )
|
||||
|
||||
vbfig_list *VbhFigure;
|
||||
vbpor_list *HeadPort;
|
||||
char *ModelName;
|
||||
{
|
||||
vbpor_list *VbhPort;
|
||||
vbtyp_list *VbhType;
|
||||
vexexpr *VexAtom;
|
||||
char *Name;
|
||||
int CreateVdd;
|
||||
int CreateVss;
|
||||
|
||||
CreateVdd = 1;
|
||||
CreateVss = 1;
|
||||
|
||||
VbhType = vbh_getvbtyp( VbhFigure, "bit" );
|
||||
|
||||
for ( VbhPort = HeadPort;
|
||||
VbhPort != (vbpor_list *)0;
|
||||
VbhPort = VbhPort->NEXT )
|
||||
{
|
||||
Name = getvexarrayname( VbhPort->TARGET );
|
||||
|
||||
if ( Name == VasyPowerVdd )
|
||||
{
|
||||
CreateVdd = 0;
|
||||
VasyPrintf( stdout, "WARNING connector vdd already exists in model %s\n", ModelName );
|
||||
}
|
||||
else
|
||||
if ( Name == VasyPowerVss )
|
||||
{
|
||||
CreateVss = 0;
|
||||
|
||||
VasyPrintf( stdout, "WARNING connector vss already exists in model %s\n", ModelName );
|
||||
}
|
||||
}
|
||||
|
||||
if ( CreateVdd )
|
||||
{
|
||||
VexAtom = createvexatombit( VasyPowerVdd );
|
||||
HeadPort = vbh_addvbpor( HeadPort, VexAtom, (vexexpr *)0, 'I', 0, VbhType, 0 );
|
||||
}
|
||||
|
||||
if ( CreateVss )
|
||||
{
|
||||
VexAtom = createvexatombit( VasyPowerVss );
|
||||
HeadPort = vbh_addvbpor( HeadPort, VexAtom, (vexexpr *)0, 'I', 0, VbhType, 0 );
|
||||
}
|
||||
|
||||
return( HeadPort );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyParseAddPower |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyParseAddPower( VbhFigure )
|
||||
|
||||
vbfig_list *VbhFigure;
|
||||
{
|
||||
vbmod_list *VbhModel;
|
||||
|
||||
if ( VasyPowerVdd == (char *)0 )
|
||||
{
|
||||
VasyPowerVdd = namealloc( "vdd" );
|
||||
VasyPowerVss = namealloc( "vss" );
|
||||
}
|
||||
|
||||
VbhFigure->BEPOR = VasyParseVbhPortAddPower( VbhFigure, VbhFigure->BEPOR, VbhFigure->NAME );
|
||||
|
||||
for ( VbhModel = VbhFigure->BEMOD;
|
||||
VbhModel != (vbmod_list *)0;
|
||||
VbhModel = VbhModel->NEXT )
|
||||
{
|
||||
VbhModel->BEPOR = VasyParseVbhPortAddPower( VbhFigure, VbhModel->BEPOR, VbhModel->NAME );
|
||||
}
|
||||
|
||||
VasyParseVbhInstanceAddPower( VbhFigure );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyParseVbhFig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
vbfig_list *VasyParseVbhFig( FileName, GenMap, Deep )
|
||||
|
||||
char *FileName;
|
||||
vbmap_list *GenMap;
|
||||
int Deep;
|
||||
{
|
||||
authtable *HashModel;
|
||||
authelem *Element;
|
||||
vbfig_list *VbhFigure;
|
||||
vbfig_list *VbhNewFigure;
|
||||
vbmod_list **PrevModel;
|
||||
vbmod_list *VbhModel;
|
||||
vbgen_list *VbhGen;
|
||||
vbmod_list *DelModel;
|
||||
vbmod_list *VbhNewModel;
|
||||
vbins_list *VbhInstance;
|
||||
vbmap_list *VbhGenMap;
|
||||
vbtyp_list *VbhType;
|
||||
vbpor_list *VbhPort;
|
||||
char *InstanceName;
|
||||
char *ModelName;
|
||||
char *NewModelName;
|
||||
char *Name;
|
||||
char *GenName;
|
||||
int Generic;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyParseVbhFig %s\n", FileName );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugStatistics() )
|
||||
{
|
||||
VasyDebugStartChrono(1);
|
||||
}
|
||||
|
||||
VbhFigure = getvbfiggenmap( FileName, VPN_IN, GenMap );
|
||||
|
||||
if ( VasyHashTreatedModel == (authtable *)0 )
|
||||
{
|
||||
VasyHashTreatedModel = createauthtable( 100 );
|
||||
}
|
||||
|
||||
HashModel = createauthtable( 100 );
|
||||
|
||||
for ( VbhModel = VbhFigure->BEMOD;
|
||||
VbhModel != (vbmod_list *)0;
|
||||
VbhModel = VbhModel->NEXT )
|
||||
{
|
||||
addauthelem( HashModel, VbhModel->NAME, (long)VbhModel );
|
||||
}
|
||||
|
||||
for ( VbhInstance = VbhFigure->BEINS;
|
||||
VbhInstance != (vbins_list *)0;
|
||||
VbhInstance = VbhInstance->NEXT )
|
||||
{
|
||||
ModelName = VbhInstance->MODEL;
|
||||
Element = searchauthelem( HashModel, ModelName );
|
||||
|
||||
if ( Element == (authelem *)0 )
|
||||
{
|
||||
VasyPrintf( stdout, "ERROR unknown model %s for instance %s\n",
|
||||
ModelName, VbhInstance->NAME );
|
||||
autexit( 1 );
|
||||
}
|
||||
}
|
||||
|
||||
for ( VbhInstance = VbhFigure->BEINS;
|
||||
VbhInstance != (vbins_list *)0;
|
||||
VbhInstance = VbhInstance->NEXT )
|
||||
{
|
||||
Element = searchauthelem( HashModel, VbhInstance->MODEL );
|
||||
VbhModel = (vbmod_list *)Element->VALUE;
|
||||
|
||||
if ( ( VbhInstance->GEN_MAP != (vbmap_list *)0 ) ||
|
||||
( VbhModel->BEGEN != (vbgen_list *)0 ) ) Generic = 1;
|
||||
else Generic = 0;
|
||||
|
||||
if ( ( Generic ) ||
|
||||
( ( VasyFlagHier ) &&
|
||||
( ! incatalog( VbhInstance->MODEL ) ) ) )
|
||||
{
|
||||
InstanceName = VbhInstance->NAME;
|
||||
ModelName = VbhInstance->MODEL;
|
||||
|
||||
if ( Generic )
|
||||
{
|
||||
sprintf( VasyBuffer, "%s_%s", ModelName, InstanceName );
|
||||
NewModelName = namealloc( VasyBuffer );
|
||||
|
||||
VbhInstance->MODEL = NewModelName;
|
||||
}
|
||||
else
|
||||
{
|
||||
NewModelName = ModelName;
|
||||
}
|
||||
|
||||
Element = searchauthelem( VasyHashTreatedModel, NewModelName );
|
||||
|
||||
if ( ( Generic ) ||
|
||||
( Element == (authelem *)0 ) )
|
||||
{
|
||||
for ( VbhGen = VbhModel->BEGEN;
|
||||
VbhGen != (vbgen_list *)0;
|
||||
VbhGen = VbhGen->NEXT )
|
||||
{
|
||||
if ( ( IsVexNodeAtom( VbhGen->TARGET ) ) &&
|
||||
( VbhGen->VEX != (vexexpr *)0 ) )
|
||||
{
|
||||
GenName = GetVexAtomValue( VbhGen->TARGET );
|
||||
|
||||
for ( VbhGenMap = VbhInstance->GEN_MAP;
|
||||
VbhGenMap != (vbmap_list *)0;
|
||||
VbhGenMap = VbhGenMap->NEXT )
|
||||
{
|
||||
if ( IsVexNodeAtom( VbhGenMap->FORMAL ) )
|
||||
{
|
||||
Name = GetVexAtomValue( VbhGenMap->FORMAL );
|
||||
|
||||
if ( Name == GenName ) break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( VbhGenMap == (vbmap_list *)0 )
|
||||
{
|
||||
VbhInstance->GEN_MAP = vbh_addvbmap( VbhInstance->GEN_MAP,
|
||||
dupvexexpr( VbhGen->TARGET ), dupvexexpr( VbhGen->VEX ), VbhGen->LINE );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VbhNewFigure = VasyMainTreatModel( ModelName, NewModelName,
|
||||
VbhInstance->GEN_MAP, Deep + 1 );
|
||||
|
||||
addauthelem( VasyHashTreatedModel, NewModelName, (long)VbhNewFigure );
|
||||
|
||||
if ( Generic )
|
||||
{
|
||||
VbhFigure->BEMOD = vbh_addvbmod( VbhFigure->BEMOD, NewModelName, 0 );
|
||||
VbhNewModel = VbhFigure->BEMOD;
|
||||
|
||||
for ( VbhPort = VbhNewFigure->BEPOR;
|
||||
VbhPort != (vbpor_list *)0;
|
||||
VbhPort = VbhPort->NEXT )
|
||||
{
|
||||
VbhType = vbh_getvbtyp( VbhFigure, VbhPort->TYPE->NAME );
|
||||
|
||||
VbhNewModel->BEPOR = vbh_addvbpor( VbhNewModel->BEPOR,
|
||||
dupvexexpr( VbhPort->TARGET ),
|
||||
dupvexexpr( VbhPort->VEX ),
|
||||
VbhPort->DIR, VbhPort->KIND, VbhType, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resetauthtable( HashModel );
|
||||
|
||||
VasyGenerateVbhFig( VbhFigure );
|
||||
VasyGenericVbhFig( VbhFigure );
|
||||
/*
|
||||
** Hash used model !
|
||||
*/
|
||||
for ( VbhInstance = VbhFigure->BEINS;
|
||||
VbhInstance != (vbins_list *)0;
|
||||
VbhInstance = VbhInstance->NEXT )
|
||||
{
|
||||
ModelName = VbhInstance->MODEL;
|
||||
addauthelem( HashModel, ModelName, 0 );
|
||||
}
|
||||
|
||||
VbhModel = VbhFigure->BEMOD;
|
||||
PrevModel = &VbhFigure->BEMOD;
|
||||
/*
|
||||
** Delete all unused model !
|
||||
*/
|
||||
while ( VbhModel != (vbmod_list *)0 )
|
||||
{
|
||||
Element = searchauthelem( HashModel, VbhModel->NAME );
|
||||
|
||||
if ( Element == (authelem *)0 )
|
||||
{
|
||||
*PrevModel = VbhModel->NEXT;
|
||||
DelModel = VbhModel;
|
||||
VbhModel = VbhModel->NEXT;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "Delete model %s\n", DelModel->NAME );
|
||||
}
|
||||
|
||||
DelModel->NEXT = (vbmod_list *)0;
|
||||
|
||||
vbh_frevbmod( DelModel );
|
||||
}
|
||||
else
|
||||
{
|
||||
PrevModel = &VbhModel->NEXT;
|
||||
VbhModel = VbhModel->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
destroyauthtable( HashModel );
|
||||
|
||||
if ( VasyFlagPower )
|
||||
{
|
||||
VasyParseAddPower( VbhFigure );
|
||||
}
|
||||
|
||||
VasyUnrollLoopVbhFig( VbhFigure );
|
||||
VasyExpandArrayVbhFig( VbhFigure );
|
||||
|
||||
VasyParseVerifyVbhFig( VbhFigure );
|
||||
|
||||
if ( IsVasyDebugStatistics() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> Compilation : %ld sec\n", VasyDebugReadChrono(1) );
|
||||
VasyDebugStartChrono(1);
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyParseVbhFig %s\n\n", FileName );
|
||||
}
|
||||
|
||||
return( VbhFigure );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyParseVbh2VpnFig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
vpnfig_list *VasyParseVbh2VpnFig( VbhFigure )
|
||||
|
||||
vbfig_list *VbhFigure;
|
||||
{
|
||||
vpnfig_list *VpnFigure;
|
||||
vpnproc_list *VpnProc;
|
||||
vpntrans_list *VpnTrans;
|
||||
vpntrans_list *AsgTrans;
|
||||
vpnplace_list *VpnPlace;
|
||||
vpnplace_list *AsgPlace;
|
||||
vpnarc *VpnArc;
|
||||
vpnact_list *VpnAction;
|
||||
vpndecl_list *VpnDeclar;
|
||||
vexexpr *VexAtom;
|
||||
vexexpr *VexExpr;
|
||||
char *Value;
|
||||
long NumberBus;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyParseVbh2VpnFig %s\n", VbhFigure->NAME );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugStatistics() )
|
||||
{
|
||||
VasyDebugStartChrono(1);
|
||||
}
|
||||
|
||||
VpnFigure = addvpnfig( VbhFigure->NAME );
|
||||
|
||||
VvhVbh2Vpn( VbhFigure, VpnFigure, 1 );
|
||||
|
||||
if ( IsVasyDebugStatistics() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> Translation : %ld sec\n", VasyDebugReadChrono(1) );
|
||||
}
|
||||
|
||||
if ( VpnFigure->FUNCTION != (vpnfunc_list *)0 )
|
||||
{
|
||||
VasyErrorLine( VASY_NOT_YET_IMPLEMENTED_ERROR, VpnFigure->FUNCTION->LINE, "Function" );
|
||||
}
|
||||
|
||||
NumberBus = 0;
|
||||
/*
|
||||
** Modify all guarded bus process
|
||||
*/
|
||||
for ( VpnProc = VpnFigure->PROCESS;
|
||||
VpnProc != (vpnproc_list *)0;
|
||||
VpnProc = VpnProc->NEXT )
|
||||
{
|
||||
if ( IsVpnProcGuarded( VpnProc ) )
|
||||
{
|
||||
/*
|
||||
** Check if it's guarded bus assignment
|
||||
*/
|
||||
for ( VpnTrans = VpnProc->TRANS;
|
||||
VpnTrans != (vpntrans_list *)0;
|
||||
VpnTrans = VpnTrans->NEXT )
|
||||
{
|
||||
for ( VpnAction = VpnTrans->ACT;
|
||||
VpnAction != (vpnact_list *)0;
|
||||
VpnAction = VpnAction->NEXT )
|
||||
{
|
||||
VexAtom = VpnAction->VEX_ATOM;
|
||||
|
||||
if ( VexAtom != (vexexpr *)0 )
|
||||
{
|
||||
Value = getvexatomname( VexAtom );
|
||||
VpnDeclar = searchvpndeclall( VpnFigure, Value );
|
||||
|
||||
if ( VpnDeclar->KIND == VPN_KIND_BUS ) break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( VpnAction != (vpnact_list *)0 ) break;
|
||||
}
|
||||
|
||||
if ( VpnAction == (vpnact_list *)0 ) continue;
|
||||
/*
|
||||
** Add a new assignment : VexAtom <= (others => 'Z');
|
||||
*/
|
||||
VpnTrans = VpnProc->FIRST;
|
||||
VpnArc = GetVpnArc( VpnTrans->PLACE_OUT );
|
||||
VpnPlace = GetVpnArcTargetPlace( VpnArc );
|
||||
|
||||
delvpnarc( VpnFigure, VpnArc );
|
||||
|
||||
sprintf( VasyBuffer, "asg_bus_%ld", NumberBus++ );
|
||||
AsgPlace = addvpnprocplace( VpnFigure, VpnProc, VasyBuffer );
|
||||
AsgPlace->TYPE = VPN_PLACE_ASSIGN;
|
||||
AsgTrans = addvpnproctrans( VpnFigure, VpnProc, VasyBuffer );
|
||||
AsgTrans->TYPE = VPN_TRANS_ACT_EXEC;
|
||||
|
||||
VexAtom = dupvexexpr( VexAtom );
|
||||
VexExpr = createvexatomveclit( VEX_TRISTATE, VexAtom->WIDTH );
|
||||
VpnAction = addvpnactasg( VpnFigure, AsgTrans, VexAtom, VexExpr );
|
||||
|
||||
addvpnarctrans( VpnFigure, VpnTrans, AsgPlace );
|
||||
addvpnarcplace( VpnFigure, AsgPlace, AsgTrans );
|
||||
addvpnarctrans( VpnFigure, AsgTrans, VpnPlace );
|
||||
}
|
||||
}
|
||||
|
||||
for ( VpnProc = VpnFigure->PROCESS;
|
||||
VpnProc != (vpnproc_list *)0;
|
||||
VpnProc = VpnProc->NEXT )
|
||||
{
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, "+++ VasyAddProcInfo %s\n", VpnProc->NAME );
|
||||
}
|
||||
|
||||
VasyAddVpnProcInfo( VpnProc );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyDebugSaveVpnFig( VpnFigure );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyParseVbh2VpnFig %s\n\n", VbhFigure->NAME );
|
||||
}
|
||||
|
||||
return( VpnFigure );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyParsePackage |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyParsePackage( FileName )
|
||||
|
||||
char *FileName;
|
||||
{
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyParsePackage %s\n\n", FileName );
|
||||
}
|
||||
|
||||
if ( FileName == (char *)0 ) return;
|
||||
|
||||
getvbpkg( FileName, VPN_IN );
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyParsePackage %s\n\n", FileName );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_parse.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
|
||||
# ifndef VASY_PARSE_H
|
||||
# define VASY_PARSE_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyParsePackage();
|
||||
extern vbfig_list *VasyParseVbhFig();
|
||||
extern vpnfig_list *VasyParseVbh2VpnFig();
|
||||
|
||||
extern vpnfig_list *VvhVbh2Vpn();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,281 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_preanal.c |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| Seb Leon |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "bdd.h"
|
||||
# include "vex.h"
|
||||
# include "vbh.h"
|
||||
# include "vbl.h"
|
||||
# include "vpn.h"
|
||||
# include "vtl.h"
|
||||
|
||||
# include "vasy_shared.h"
|
||||
# include "vasy_preanal.h"
|
||||
# include "vasy_debug.h"
|
||||
# include "vasy_error.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Private variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static authtable *VasyHashName = (authtable *)0;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyPreAnalysisVexExpr |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static int VasyPreAnalysisVexExpr( Expr )
|
||||
|
||||
vexexpr *Expr;
|
||||
{
|
||||
chain_list *ScanOper;
|
||||
authelem *Element;
|
||||
char *Name;
|
||||
int FuncId;
|
||||
int Index;
|
||||
char Literal;
|
||||
|
||||
if ( IsVexNodeAtom( Expr ) )
|
||||
{
|
||||
Name = GetVexAtomValue( Expr );
|
||||
|
||||
if ( ! IsVexAtomLiteral( Expr ) )
|
||||
{
|
||||
Element = searchauthelem( VasyHashName, Name );
|
||||
|
||||
if ( Element != (authelem *)0 ) return( 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( Index = 0; Index < Expr->WIDTH; Index++ )
|
||||
{
|
||||
Literal = Name[ Index + 1 ];
|
||||
|
||||
if ( ( Literal == VEX_TRISTATE ) ||
|
||||
( Literal == VEX_WEAK_ZERO ) ||
|
||||
( Literal == VEX_WEAK_ONE ) ) return( 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( IsVexNodeFunc( Expr ) )
|
||||
{
|
||||
Name = GetVexFuncValue( Expr );
|
||||
FuncId = getvexstdfuncid( Name );
|
||||
|
||||
if ( FuncId == -1 ) return( 1 );
|
||||
}
|
||||
|
||||
for ( ScanOper = Expr->OPERAND;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
if ( VasyPreAnalysisVexExpr( GetVexOperand( ScanOper ) ) )
|
||||
{
|
||||
return( 1 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyPreAnalysisVpnProc |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyPreAnalysisVpnProc( VpnFigure, VpnProc )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
vpnproc_list *VpnProc;
|
||||
{
|
||||
vpntrans_list *VpnTrans;
|
||||
vpnact_list *VpnAct;
|
||||
vexexpr *VexAtom;
|
||||
char *Name;
|
||||
int ToAnalyse;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, " --> VasyPreAnalysisVpnProc %s\n", VpnProc->NAME );
|
||||
}
|
||||
|
||||
if ( ( IsVpnProcSequential( VpnProc ) ) ||
|
||||
( IsVpnProcGuarded( VpnProc ) ) )
|
||||
{
|
||||
SetVasyVpnProcToAnalyse( VpnProc );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( VasyHashName == (authtable *)0 )
|
||||
{
|
||||
VasyHashName = createauthtable( 50 );
|
||||
}
|
||||
|
||||
for ( VpnTrans = VpnProc->TRANS;
|
||||
VpnTrans != (vpntrans_list *)0;
|
||||
VpnTrans = VpnTrans->NEXT )
|
||||
{
|
||||
for ( VpnAct = VpnTrans->ACT;
|
||||
VpnAct != (vpnact_list *)0;
|
||||
VpnAct = VpnAct->NEXT )
|
||||
{
|
||||
if ( ( VpnAct->TYPE == VPN_ACT_ASG_PORT ) ||
|
||||
( VpnAct->TYPE == VPN_ACT_ASG_SIGNAL ) )
|
||||
{
|
||||
VexAtom = VpnAct->VEX_ATOM;
|
||||
Name = GetVexAtomValue( VexAtom );
|
||||
addauthelem( VasyHashName, Name, 0 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ToAnalyse = 0;
|
||||
|
||||
for ( VpnTrans = VpnProc->TRANS;
|
||||
VpnTrans != (vpntrans_list *)0;
|
||||
VpnTrans = VpnTrans->NEXT )
|
||||
{
|
||||
if ( ( VpnTrans->TYPE == VPN_TRANS_INF_WAIT ) ||
|
||||
( VpnTrans->TYPE == VPN_TRANS_SUP_WAIT ) ) continue;
|
||||
|
||||
if ( ( VpnTrans->VEX_GUARD != (vexexpr *)0 ) &&
|
||||
( VasyPreAnalysisVexExpr( VpnTrans->VEX_GUARD ) ) )
|
||||
{
|
||||
ToAnalyse = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
for ( VpnAct = VpnTrans->ACT;
|
||||
VpnAct != (vpnact_list *)0;
|
||||
VpnAct = VpnAct->NEXT )
|
||||
{
|
||||
if ( VasyPreAnalysisVexExpr( VpnAct->VEX_EXPR ) )
|
||||
{
|
||||
ToAnalyse = 1; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( ToAnalyse )
|
||||
{
|
||||
SetVasyVpnProcToAnalyse( VpnProc ); break;
|
||||
}
|
||||
}
|
||||
|
||||
resetauthtable( VasyHashName );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
if ( IsVasyVpnProcToAnalyse( VpnProc ) )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ Should Analyse Process %s\n", VpnProc->NAME );
|
||||
}
|
||||
|
||||
VasyPrintf( stdout, " <-- VasyPreAnalysisVpnProc %s\n", VpnProc->NAME );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyPreAnalysisVpnFig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyPreAnalysisVpnFig( VpnFigure )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
{
|
||||
vpnproc_list *VpnProc;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyPreAnalysisVpnFig %s\n", VpnFigure->NAME );
|
||||
}
|
||||
|
||||
for ( VpnProc = VpnFigure->PROCESS;
|
||||
VpnProc != (vpnproc_list *)0;
|
||||
VpnProc = VpnProc->NEXT )
|
||||
{
|
||||
VasyPreAnalysisVpnProc( VpnFigure, VpnProc );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "<-- VasyPreAnalysisVpnFig %s\n\n", VpnFigure->NAME );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_preanal.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
|
||||
# ifndef VASY_PREANAL_H
|
||||
# define VASY_PREANAL_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyPreAnalysisVpnFig();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,837 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_redact.c |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "vex.h"
|
||||
# include "vpn.h"
|
||||
# include "vtl.h"
|
||||
|
||||
# include "vasy_redact.h"
|
||||
# include "vasy_debug.h"
|
||||
# include "vasy_error.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vpnfig_list *VasyFigure = (vpnfig_list *)0;
|
||||
static vpnproc_list *VasyProcess = (vpnproc_list *)0;
|
||||
|
||||
static authtable *VasyHashAssign = (authtable *)0;
|
||||
static authtable *VasyHashBitVecAsg = (authtable *)0;
|
||||
|
||||
static authtable *VasyHashVariable = (authtable *)0;
|
||||
static authtable *VasyHashBitVecVar = (authtable *)0;
|
||||
|
||||
static authtable *VasyHashDriver = (authtable *)0;
|
||||
static authtable *VasyHashBitVecDrv = (authtable *)0;
|
||||
|
||||
static vpntrans_list *VasySubstTrans = (vpntrans_list *)0;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyRedActAddVpnDefine |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
vpndecl_list *VasyRedActAddVpnDefine( VpnFigure, VpnProc, Width, DefBase )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
vpnproc_list *VpnProc;
|
||||
unsigned short Width;
|
||||
unsigned char DefBase;
|
||||
{
|
||||
vpndecl_list *DefDeclar;
|
||||
vexexpr *DefAtom;
|
||||
char *FatherName;
|
||||
char Buffer[ 128 ];
|
||||
unsigned char NewBase;
|
||||
long Number;
|
||||
|
||||
FatherName = VpnProc->NAME;
|
||||
Number = GetVpnNumDeclDef( VpnFigure );
|
||||
|
||||
sprintf( Buffer, "%s_reddef_%ld", FatherName, Number );
|
||||
|
||||
if ( ( DefBase == VEX_TYPE_REG_BIT ) ||
|
||||
( DefBase == VEX_TYPE_MUX_BIT ) ||
|
||||
( DefBase == VEX_TYPE_WOR_BIT ) )
|
||||
{
|
||||
DefBase = VEX_TYPE_BIT;
|
||||
}
|
||||
else
|
||||
if ( ( DefBase == VEX_TYPE_REG_VECTOR ) ||
|
||||
( DefBase == VEX_TYPE_MUX_VECTOR ) ||
|
||||
( DefBase == VEX_TYPE_WOR_VECTOR ) )
|
||||
{
|
||||
DefBase = VEX_TYPE_BIT_VECTOR;
|
||||
}
|
||||
|
||||
NewBase = getvextypescalar( DefBase );
|
||||
|
||||
if ( ( isvextypevector( DefBase ) ) &&
|
||||
( ( Width > 1 ) ||
|
||||
( NewBase == DefBase ) ) )
|
||||
{
|
||||
DefAtom = createvexatomvec( Buffer, Width - 1, 0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
DefAtom = createvexatombit( Buffer );
|
||||
DefBase = NewBase;
|
||||
}
|
||||
|
||||
DefDeclar = addvpndeclprocdef( VpnFigure, VpnProc, DefAtom, DefBase );
|
||||
|
||||
return( DefDeclar );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyRedActSubstVexAtom |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vexexpr *VasyRedActSubstVexAtom( Expr, SubstDriver )
|
||||
|
||||
vexexpr *Expr;
|
||||
short SubstDriver;
|
||||
{
|
||||
authtable *HashBitVec;
|
||||
char *AtomValue;
|
||||
char *DefName;
|
||||
authelem *Element;
|
||||
vexexpr *SubstExpr;
|
||||
vexexpr *DefAtom;
|
||||
vexexpr *AsgAtom;
|
||||
vexexpr *AsgExpr;
|
||||
vpnact_list *ScanAsg;
|
||||
vpnact_list *NewAct;
|
||||
vpndecl_list *ScanDeclar;
|
||||
vpndecl_list *DefDeclar;
|
||||
vpnsym *ScanSym;
|
||||
int DefIndex;
|
||||
int DefPos;
|
||||
int Scan;
|
||||
int Index;
|
||||
int Width;
|
||||
int Step;
|
||||
|
||||
SubstExpr = (vexexpr *)0;
|
||||
AtomValue = GetVexAtomValue( Expr );
|
||||
|
||||
if ( SubstDriver )
|
||||
{
|
||||
Element = searchauthelem( VasyHashDriver, AtomValue );
|
||||
HashBitVec = VasyHashBitVecDrv;
|
||||
}
|
||||
else
|
||||
{
|
||||
Element = searchauthelem( VasyHashVariable, AtomValue );
|
||||
HashBitVec = VasyHashBitVecVar;
|
||||
}
|
||||
|
||||
ScanDeclar = searchvpndeclall( VasyFigure, AtomValue );
|
||||
/*
|
||||
** Check if symbol should be substituted
|
||||
*/
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
if ( ! isvextypedivisible( ScanDeclar->BASE ) )
|
||||
{
|
||||
/*
|
||||
** Symbol is not a bit_vector, just replace vex
|
||||
*/
|
||||
ScanAsg = (vpnact_list *)Element->VALUE;
|
||||
|
||||
freevexexpr( Expr );
|
||||
Expr = dupvexexpr( ScanAsg->VEX_EXPR );
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
** Symbol is a bit_vector, make a concatenation
|
||||
*/
|
||||
if ( Expr->LEFT > Expr->RIGHT ) Step = -1;
|
||||
else Step = 1;
|
||||
|
||||
Index = Expr->LEFT;
|
||||
Width = Expr->WIDTH;
|
||||
|
||||
if ( Width > 1 ) SubstExpr = createvexoper( VEX_CONCAT, Width );
|
||||
|
||||
for ( Scan = 0; Scan < Width; Scan++ )
|
||||
{
|
||||
ScanSym = getvpnsymdecl( ScanDeclar, Index );
|
||||
Element = searchauthelem( HashBitVec, (char *)ScanSym );
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
ScanAsg = (vpnact_list *)Element->VALUE;
|
||||
AsgExpr = ScanAsg->VEX_EXPR;
|
||||
AsgAtom = ScanAsg->VEX_ATOM;
|
||||
|
||||
if ( ( ! IsVexNodeAtom( AsgExpr ) ) ||
|
||||
( IsVexAtomLiteral( AsgExpr ) ) )
|
||||
{
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ Substitute assign is not atomic, create define !\n" );
|
||||
}
|
||||
|
||||
DefDeclar = VasyRedActAddVpnDefine( VasyFigure, VasyProcess,
|
||||
AsgAtom->WIDTH, ScanDeclar->BASE );
|
||||
|
||||
DefAtom = dupvexnode( DefDeclar->VEX_ATOM );
|
||||
ScanAsg->VEX_EXPR = dupvexnode( DefAtom );
|
||||
|
||||
NewAct = addvpnactasgbefore( VasyFigure, VasySubstTrans, ScanAsg, DefAtom, AsgExpr );
|
||||
unionvpnline( VasyFigure, &NewAct->LINE, ScanAsg->LINE );
|
||||
|
||||
AsgExpr = ScanAsg->VEX_EXPR;
|
||||
}
|
||||
|
||||
DefName = GetVexAtomValue( AsgExpr );
|
||||
DefPos = getvexvectorpos( AsgAtom, Index );
|
||||
DefIndex = getvexvectorindex( AsgExpr, DefPos );
|
||||
|
||||
DefAtom = createvexatomvec( DefName, DefIndex, DefIndex );
|
||||
}
|
||||
else
|
||||
{
|
||||
DefAtom = createvexatomvec( AtomValue, Index, Index );
|
||||
}
|
||||
|
||||
if ( Width == 1 ) SubstExpr = DefAtom;
|
||||
else addvexqexpr( SubstExpr, DefAtom );
|
||||
|
||||
Index += Step;
|
||||
}
|
||||
|
||||
freevexexpr( Expr );
|
||||
Expr = simpvexexpr( SubstExpr );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel2() )
|
||||
{
|
||||
VasyPrintf( stdout, " --> VasyRedActSubstVexAtom\n" );
|
||||
VasyPrintf( stdout, " +++ Replace %s by ", AtomValue );
|
||||
viewvexexprboundln( Expr );
|
||||
VasyPrintf( stdout, " <-- VasyRedActSubstVexAtom\n" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Expr = (vexexpr *)0;
|
||||
}
|
||||
|
||||
return( Expr );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyRedActSubstVex |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static vexexpr *VasyRedActSubstVex( Expr )
|
||||
|
||||
vexexpr *Expr;
|
||||
{
|
||||
chain_list *ScanOper;
|
||||
vexexpr *SubstExpr;
|
||||
long Oper;
|
||||
|
||||
if ( IsVexNodeAtom( Expr ) )
|
||||
{
|
||||
if ( ! IsVexAtomLiteral( Expr ) )
|
||||
{
|
||||
SubstExpr = VasyRedActSubstVexAtom( Expr, 0 );
|
||||
|
||||
if ( SubstExpr != (vexexpr *)0 ) Expr = SubstExpr;
|
||||
}
|
||||
|
||||
return( Expr );
|
||||
}
|
||||
else
|
||||
if ( IsVexNodeOper( Expr ) )
|
||||
{
|
||||
Oper = GetVexOperValue( Expr );
|
||||
|
||||
if ( Oper == VEX_DRIVER )
|
||||
{
|
||||
SubstExpr = GetVexOperand( Expr->OPERAND );
|
||||
SubstExpr = VasyRedActSubstVexAtom( SubstExpr, 1 );
|
||||
|
||||
if ( SubstExpr != (vexexpr *)0 )
|
||||
{
|
||||
Expr->OPERAND->DATA = (void *)0;
|
||||
freevexexpr( Expr );
|
||||
|
||||
Expr = SubstExpr;
|
||||
}
|
||||
|
||||
return( Expr );
|
||||
}
|
||||
}
|
||||
|
||||
for ( ScanOper = Expr->OPERAND;
|
||||
ScanOper != (chain_list *)0;
|
||||
ScanOper = ScanOper->NEXT )
|
||||
{
|
||||
SubstExpr = VasyRedActSubstVex( GetVexOperand( ScanOper ) );
|
||||
SetVexOperand( ScanOper, SubstExpr );
|
||||
}
|
||||
|
||||
return( Expr );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyRedActSubstVpnAct |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
static void VasyRedActSubstVpnAct( VpnFigure, VpnProc, VpnTrans, VpnAct )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
vpnproc_list *VpnProc;
|
||||
vpntrans_list *VpnTrans;
|
||||
vpnact_list *VpnAct;
|
||||
{
|
||||
VasyFigure = VpnFigure;
|
||||
VasyProcess = VpnProc;
|
||||
VasySubstTrans = VpnTrans;
|
||||
|
||||
if ( IsVasyDebugLevel2() )
|
||||
{
|
||||
VasyPrintf( stdout, " --> VasyRedActSubstVpnAct\n" );
|
||||
VasyPrintf( stdout, " +++ " );
|
||||
viewvexexprboundln( VpnAct->VEX_EXPR );
|
||||
}
|
||||
|
||||
VpnAct->VEX_EXPR = VasyRedActSubstVex( VpnAct->VEX_EXPR );
|
||||
|
||||
if ( IsVasyDebugLevel2() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ " );
|
||||
viewvexexprboundln( VpnAct->VEX_EXPR );
|
||||
VasyPrintf( stdout, " <-- VasyRedActSubstVpnAct\n" );
|
||||
}
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyRedActVpnTrans |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyRedActVpnTrans( VpnFigure, VpnProc, VpnTrans, SubstDriver )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
vpnproc_list *VpnProc;
|
||||
vpntrans_list *VpnTrans;
|
||||
short SubstDriver;
|
||||
{
|
||||
vpnact_list *VpnAct;
|
||||
vpnact_list *DelAct;
|
||||
vpnact_list *NewAct;
|
||||
unsigned char AsgVar;
|
||||
unsigned char AsgDriver;
|
||||
vpndecl_list *AsgDeclar;
|
||||
vpnsym *AsgSymbol;
|
||||
vpnsym *DelSymbol;
|
||||
vexexpr *AsgAtom;
|
||||
vexexpr *AsgExpr;
|
||||
vpndecl_list *DefDeclar;
|
||||
vexexpr *DefAtom;
|
||||
vexexpr *DelAtom;
|
||||
vexexpr *DelExpr;
|
||||
vexexpr *DelAtom2;
|
||||
vexexpr *DelExpr2;
|
||||
authelem *Element;
|
||||
char *AtomValue;
|
||||
int AsgIndex;
|
||||
int AsgMin;
|
||||
int AsgMax;
|
||||
int DelMin;
|
||||
int DelMax;
|
||||
int DelPos;
|
||||
int DelIndex;
|
||||
/*
|
||||
** Reduction for all assign's action in a transition
|
||||
*/
|
||||
if ( VpnTrans->ACT == (vpnact_list *)0 ) return;
|
||||
|
||||
if ( VasyHashAssign == (authtable *)0 )
|
||||
{
|
||||
VasyHashAssign = createauthtable( 100 );
|
||||
VasyHashBitVecAsg = createauthtable( 100 );
|
||||
|
||||
VasyHashVariable = createauthtable( 100 );
|
||||
VasyHashBitVecVar = createauthtable( 100 );
|
||||
|
||||
VasyHashDriver = createauthtable( 100 );
|
||||
VasyHashBitVecDrv = createauthtable( 100 );
|
||||
}
|
||||
|
||||
VpnAct = VpnTrans->ACT;
|
||||
|
||||
while ( VpnAct != (vpnact_list *)0 )
|
||||
{
|
||||
VasyRedActSubstVpnAct( VpnFigure, VpnProc, VpnTrans, VpnAct );
|
||||
/*
|
||||
** Assign statement
|
||||
*/
|
||||
if ( VpnAct->TYPE == VPN_ACT_ASG_VARIABLE )
|
||||
{
|
||||
AsgVar = 1;
|
||||
AsgDriver = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
AsgVar = 0;
|
||||
|
||||
if ( ( SubstDriver ) &&
|
||||
( ( VpnAct->TYPE == VPN_ACT_ASG_PORT ) ||
|
||||
( VpnAct->TYPE == VPN_ACT_ASG_SIGNAL ) ) ) AsgDriver = 1;
|
||||
else AsgDriver = 0;
|
||||
}
|
||||
|
||||
AsgAtom = VpnAct->VEX_ATOM;
|
||||
AsgExpr = VpnAct->VEX_EXPR;
|
||||
|
||||
if ( ! IsVexNodeAtom( AsgAtom ) )
|
||||
{
|
||||
VasyErrorLine( VASY_ILLEGAL_ASSIGN_ERROR, VpnAct->LINE, getvexatomname( AsgAtom ) );
|
||||
}
|
||||
|
||||
AtomValue = GetVexAtomValue( AsgAtom );
|
||||
AsgDeclar = searchvpndeclall( VpnFigure, AtomValue );
|
||||
|
||||
AsgMin = getvexvectormin( AsgAtom );
|
||||
AsgMax = getvexvectormax( AsgAtom );
|
||||
/*
|
||||
** Delete action if S <= S --> there is nothing more to do !
|
||||
*/
|
||||
if ( isvexequalexpr( AsgAtom, AsgExpr ) )
|
||||
{
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ %s <= %s just delete and continue !\n", AtomValue, AtomValue );
|
||||
}
|
||||
|
||||
DelAct = VpnAct;
|
||||
VpnAct = VpnAct->NEXT;
|
||||
|
||||
delvpnact( VpnFigure, VpnTrans, DelAct );
|
||||
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
** Variable Assign statement
|
||||
*/
|
||||
if ( ( AsgVar ) && ( ! SubstDriver ) )
|
||||
{
|
||||
/*
|
||||
** Modify assign V := f --> Define #= f, V := Define
|
||||
*/
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ First Variable assignment %s := define !\n", AtomValue );
|
||||
}
|
||||
|
||||
DefDeclar = VasyRedActAddVpnDefine( VpnFigure, VpnProc,
|
||||
AsgAtom->WIDTH, AsgDeclar->BASE );
|
||||
|
||||
DefAtom = dupvexnode( DefDeclar->VEX_ATOM );
|
||||
VpnAct->VEX_EXPR = dupvexnode( DefAtom );
|
||||
|
||||
NewAct = addvpnactasgbefore( VpnFigure, VpnTrans, VpnAct, DefAtom, AsgExpr );
|
||||
unionvpnline( VpnFigure, &NewAct->LINE, VpnAct->LINE );
|
||||
}
|
||||
/*
|
||||
** Variable or Signal Assign statement
|
||||
*/
|
||||
Element = searchauthelem( VasyHashAssign, AtomValue );
|
||||
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ previous assignment to %s !\n", AtomValue );
|
||||
}
|
||||
|
||||
if ( ! isvextypedivisible( AsgDeclar->BASE ) )
|
||||
{
|
||||
/*
|
||||
** Delete previous assign to symbol V
|
||||
*/
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ just delete previous assignment to %s !\n", AtomValue );
|
||||
}
|
||||
|
||||
DelAct = (vpnact_list *)Element->VALUE;
|
||||
delvpnact( VpnFigure, VpnTrans, DelAct );
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
** Delete previous assign to bit_vector symbol V
|
||||
*/
|
||||
for ( AsgIndex = AsgMin; AsgIndex <= AsgMax; AsgIndex++ )
|
||||
{
|
||||
AsgSymbol = getvpnsymdecl( AsgDeclar, AsgIndex );
|
||||
Element = searchauthelem( VasyHashBitVecAsg, (char *)AsgSymbol );
|
||||
/*
|
||||
** Check if there is a previous assign to symbol V
|
||||
*/
|
||||
if ( Element != (authelem *)0 )
|
||||
{
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ Previous bit_vector assign to %s %d\n",
|
||||
AsgSymbol->NAME, AsgIndex );
|
||||
}
|
||||
|
||||
DelAct = (vpnact_list *)Element->VALUE;
|
||||
DelAtom = DelAct->VEX_ATOM;
|
||||
|
||||
DelMin = getvexvectormin( DelAtom );
|
||||
DelMax = getvexvectormax( DelAtom );
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ Check instersection [%d %d] -> [%d %d]\n",
|
||||
AsgMin, AsgMax, DelMin, DelMax );
|
||||
}
|
||||
/*
|
||||
** Check the kind of range's intersection
|
||||
*/
|
||||
if ( ( DelMin >= AsgMin ) &&
|
||||
( DelMax <= AsgMax ) )
|
||||
{
|
||||
/*
|
||||
** [ ] Asg Completely included
|
||||
** [<-[ ]->] Del
|
||||
*/
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ Intersection completely included just delete\n" );
|
||||
}
|
||||
|
||||
AsgIndex = DelMax;
|
||||
delvpnact( VpnFigure, VpnTrans, DelAct );
|
||||
}
|
||||
else
|
||||
{
|
||||
DelAtom = DelAct->VEX_ATOM;
|
||||
DelExpr = DelAct->VEX_EXPR;
|
||||
/*
|
||||
** Previous assign to symbol V must be an atomic expression !
|
||||
*/
|
||||
if ( ( ! IsVexNodeAtom( DelExpr ) ) ||
|
||||
( IsVexAtomLiteral( DelExpr ) ) )
|
||||
{
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ Previous assign is not atomic, create define !\n" );
|
||||
}
|
||||
|
||||
DefDeclar = VasyRedActAddVpnDefine( VpnFigure, VpnProc,
|
||||
DelAtom->WIDTH, AsgDeclar->BASE );
|
||||
DefAtom = dupvexnode( DefDeclar->VEX_ATOM );
|
||||
DelAct->VEX_EXPR = dupvexnode( DefAtom );
|
||||
|
||||
NewAct = addvpnactasgbefore( VpnFigure, VpnTrans, DelAct, DefAtom, DelExpr );
|
||||
unionvpnline( VpnFigure, &NewAct->LINE, DelAct->LINE );
|
||||
|
||||
DelExpr = DelAct->VEX_EXPR;
|
||||
}
|
||||
|
||||
if ( ( DelMin < AsgMin ) &&
|
||||
( DelMax <= AsgMax ) )
|
||||
{
|
||||
/*
|
||||
** [ ] Asg Partialy included on left
|
||||
** [<-[]------->] Del
|
||||
*/
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ Intersection partialy on left\n" );
|
||||
}
|
||||
|
||||
if ( IsVexAtomDown( DelAtom ) )
|
||||
{
|
||||
DelPos = getvexvectorpos( DelAtom, AsgMin - 1 );
|
||||
DelIndex = getvexvectorindex( DelExpr, DelPos );
|
||||
|
||||
slicevexatomvec( DelExpr, DelIndex , DelExpr->RIGHT );
|
||||
slicevexatomvec( DelAtom, AsgMin - 1, DelAtom->RIGHT );
|
||||
}
|
||||
else
|
||||
{
|
||||
DelPos = getvexvectorpos( DelAtom, AsgMin - 1 );
|
||||
DelIndex = getvexvectorindex( DelExpr, DelPos );
|
||||
|
||||
slicevexatomvec( DelExpr, DelExpr->LEFT, DelIndex );
|
||||
slicevexatomvec( DelAtom, DelAtom->LEFT, AsgMin - 1 );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ New previous assign \n" );
|
||||
viewvexexprbound( DelAtom );
|
||||
fprintf( stdout, " <= " );
|
||||
viewvexexprboundln( DelExpr );
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( ( DelMax > AsgMax ) &&
|
||||
( DelMin >= AsgMin ) )
|
||||
{
|
||||
/*
|
||||
** [ ] Asg Partialy included on right
|
||||
** [<-------[]->] Del
|
||||
*/
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ Intersection partialy on right\n" );
|
||||
}
|
||||
|
||||
if ( IsVexAtomDown( DelAtom ) )
|
||||
{
|
||||
DelPos = getvexvectorpos( DelAtom, AsgMax + 1 );
|
||||
DelIndex = getvexvectorindex( DelExpr, DelPos );
|
||||
|
||||
slicevexatomvec( DelExpr, DelExpr->LEFT, DelIndex );
|
||||
slicevexatomvec( DelAtom, DelAtom->LEFT, AsgMax + 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
DelPos = getvexvectorpos( DelAtom, AsgMax + 1 );
|
||||
DelIndex = getvexvectorindex( DelExpr, DelPos );
|
||||
|
||||
slicevexatomvec( DelExpr, DelIndex , DelExpr->RIGHT );
|
||||
slicevexatomvec( DelAtom, AsgMax + 1, DelAtom->RIGHT );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ New previous assign \n" );
|
||||
viewvexexprbound( DelAtom );
|
||||
fprintf( stdout, " <= " );
|
||||
viewvexexprboundln( DelExpr );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
** [ ] Asg Partialy included on the two sides
|
||||
** [<-[]----[]->] Del
|
||||
*/
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ Intersection partialy on two sides\n" );
|
||||
}
|
||||
|
||||
DelAtom2 = dupvexnode( DelAtom );
|
||||
DelExpr2 = dupvexnode( DelExpr );
|
||||
|
||||
if ( IsVexAtomDown( DelAtom ) )
|
||||
{
|
||||
DelPos = getvexvectorpos( DelAtom, AsgMin - 1 );
|
||||
DelIndex = getvexvectorindex( DelExpr, DelPos );
|
||||
|
||||
slicevexatomvec( DelExpr, DelIndex , DelExpr->RIGHT );
|
||||
slicevexatomvec( DelAtom, AsgMin - 1, DelAtom->RIGHT );
|
||||
}
|
||||
else
|
||||
{
|
||||
DelPos = getvexvectorpos( DelAtom, AsgMin - 1 );
|
||||
DelIndex = getvexvectorindex( DelExpr, DelPos );
|
||||
|
||||
slicevexatomvec( DelExpr, DelExpr->LEFT, DelIndex );
|
||||
slicevexatomvec( DelAtom, DelAtom->LEFT, AsgMin - 1 );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ New previous assign \n" );
|
||||
viewvexexprbound( DelAtom );
|
||||
fprintf( stdout, " <= " );
|
||||
viewvexexprboundln( DelExpr );
|
||||
}
|
||||
|
||||
if ( IsVexAtomDown( DelAtom ) )
|
||||
{
|
||||
DelPos = getvexvectorpos( DelAtom2, AsgMax + 1 );
|
||||
DelIndex = getvexvectorindex( DelExpr2, DelPos );
|
||||
|
||||
slicevexatomvec( DelExpr2, DelExpr2->LEFT, DelIndex );
|
||||
slicevexatomvec( DelAtom2, DelAtom2->LEFT, AsgMax + 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
DelPos = getvexvectorpos( DelAtom2, AsgMax + 1 );
|
||||
DelIndex = getvexvectorindex( DelExpr2, DelPos );
|
||||
|
||||
slicevexatomvec( DelExpr2, DelIndex , DelExpr2->RIGHT );
|
||||
slicevexatomvec( DelAtom2, AsgMax + 1, DelAtom2->RIGHT );
|
||||
}
|
||||
|
||||
NewAct = addvpnactasgbefore( VpnFigure, VpnTrans,
|
||||
DelAct, DelAtom2, DelExpr2 );
|
||||
unionvpnline( VpnFigure, &NewAct->LINE, DelAct->LINE );
|
||||
DelAct = NewAct;
|
||||
|
||||
if ( IsVasyDebugLevel1() )
|
||||
{
|
||||
VasyPrintf( stdout, " +++ New added previous assign \n" );
|
||||
viewvexexprbound( DelAtom2 );
|
||||
fprintf( stdout, " <= " );
|
||||
viewvexexprboundln( DelExpr2 );
|
||||
}
|
||||
|
||||
DelMin = getvexvectormin( DelAtom2 );
|
||||
DelMax = getvexvectormax( DelAtom2 );
|
||||
/*
|
||||
** Add modified assign to bit_vector symbol V in hash table
|
||||
*/
|
||||
for ( DelIndex = DelMin; DelIndex <= DelMax; DelIndex++ )
|
||||
{
|
||||
DelSymbol = getvpnsymdecl( AsgDeclar, DelIndex );
|
||||
addauthelem( VasyHashBitVecAsg, (char *)DelSymbol, (long)DelAct );
|
||||
|
||||
if ( AsgVar )
|
||||
{
|
||||
addauthelem( VasyHashBitVecVar, (char *)DelSymbol, (long)DelAct );
|
||||
}
|
||||
else
|
||||
if ( AsgDriver )
|
||||
{
|
||||
addauthelem( VasyHashBitVecDrv, (char *)DelSymbol, (long)DelAct );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AsgIndex = AsgMax;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
** Add assign to bit_vector symbol V in hash table
|
||||
*/
|
||||
if ( isvextypedivisible( AsgDeclar->BASE ) )
|
||||
{
|
||||
for ( AsgIndex = AsgMin; AsgIndex <= AsgMax; AsgIndex++ )
|
||||
{
|
||||
AsgSymbol = getvpnsymdecl( AsgDeclar, AsgIndex );
|
||||
addauthelem( VasyHashBitVecAsg, (char *)AsgSymbol, (long)VpnAct );
|
||||
|
||||
if ( AsgVar )
|
||||
{
|
||||
addauthelem( VasyHashBitVecVar, (char *)AsgSymbol, (long)VpnAct );
|
||||
}
|
||||
else
|
||||
if ( AsgDriver )
|
||||
{
|
||||
addauthelem( VasyHashBitVecDrv, (char *)AsgSymbol, (long)VpnAct );
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
** Add assign to symbol V in hash table
|
||||
*/
|
||||
addauthelem( VasyHashAssign, AtomValue, (long)VpnAct );
|
||||
/*
|
||||
** Add assign to variable V in hash table
|
||||
*/
|
||||
if ( AsgVar )
|
||||
{
|
||||
addauthelem( VasyHashVariable, AtomValue, (long)VpnAct );
|
||||
}
|
||||
else
|
||||
if ( AsgDriver )
|
||||
{
|
||||
addauthelem( VasyHashDriver, AtomValue, (long)VpnAct );
|
||||
}
|
||||
|
||||
VpnAct = VpnAct->NEXT;
|
||||
}
|
||||
|
||||
resetauthtable( VasyHashAssign );
|
||||
resetauthtable( VasyHashBitVecAsg );
|
||||
|
||||
resetauthtable( VasyHashVariable );
|
||||
resetauthtable( VasyHashBitVecVar );
|
||||
|
||||
resetauthtable( VasyHashDriver );
|
||||
resetauthtable( VasyHashBitVecDrv );
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_redact.h |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_REDACT_H
|
||||
# define VASY_REDACT_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern vpndecl_list *VasyRedActAddVpnDefine();
|
||||
extern void VasyRedActVpnTrans();
|
||||
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_reduce.h |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_REDINST_H
|
||||
# define VASY_REDINST_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_REDINST_TAG_MASK (long)0x01
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyRedInstTag( O ) ((O)->FLAGS |= VASY_REDINST_TAG_MASK)
|
||||
# define ClearVasyRedInstTag( O ) ((O)->FLAGS &= ~VASY_REDINST_TAG_MASK)
|
||||
# define IsVasyRedInstTag( O ) ((O)->FLAGS & VASY_REDINST_TAG_MASK)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern int IsVasyRedInstGuardAtomic();
|
||||
extern int VasyRedInstLateralWait();
|
||||
extern void VasyRedInstVpnProc();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,170 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_reduce.c |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "bdd.h"
|
||||
# include "vex.h"
|
||||
# include "vpn.h"
|
||||
# include "vtl.h"
|
||||
# include "rtn.h"
|
||||
|
||||
# include "vasy_shared.h"
|
||||
# include "vasy_redact.h"
|
||||
# include "vasy_redinst.h"
|
||||
# include "vasy_redwait.h"
|
||||
# include "vasy_reduce.h"
|
||||
|
||||
# include "vasy_debug.h"
|
||||
# include "vasy_error.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyReduceVpnFig |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyReduceVpnFig( VpnFigure )
|
||||
|
||||
vpnfig_list *VpnFigure;
|
||||
{
|
||||
vpnproc_list *VpnProc;
|
||||
int Reduced;
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> VasyReduceVpnFig %s\n", VpnFigure->NAME );
|
||||
VasyDebugSaveVpnFig( VpnFigure );
|
||||
}
|
||||
/*
|
||||
** Partial reduction instruction by instruction
|
||||
*/
|
||||
if ( IsVasyDebugStatistics() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> Process : %ld\n", GetVpnNumProc( VpnFigure ) );
|
||||
VasyPrintf( stdout, "--> Transition : %ld\n", GetVpnNumTrans( VpnFigure ) );
|
||||
VasyPrintf( stdout, "--> Place : %ld\n", GetVpnNumPlace( VpnFigure ) );
|
||||
VasyDebugStartChrono(1);
|
||||
}
|
||||
|
||||
for ( VpnProc = VpnFigure->PROCESS;
|
||||
VpnProc != (vpnproc_list *)0;
|
||||
VpnProc = VpnProc->NEXT )
|
||||
{
|
||||
if ( IsVasyVpnProcToAnalyse( VpnProc ) )
|
||||
{
|
||||
VasyRedInstVpnProc( VpnFigure, VpnProc );
|
||||
}
|
||||
}
|
||||
|
||||
if ( IsVasyDebugStatistics() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> Local reduction : %ld sec\n", VasyDebugReadChrono(1) );
|
||||
VasyPrintf( stdout, "--> Process : %ld\n", GetVpnNumProc( VpnFigure ) );
|
||||
VasyPrintf( stdout, "--> Transition : %ld\n", GetVpnNumTrans( VpnFigure ) );
|
||||
VasyPrintf( stdout, "--> Place : %ld\n", GetVpnNumPlace( VpnFigure ) );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyDebugSaveVpnFig( VpnFigure );
|
||||
}
|
||||
/*
|
||||
** Global reduction wait to wait
|
||||
*/
|
||||
if ( IsVasyDebugStatistics() ) VasyDebugStartChrono(1);
|
||||
|
||||
Reduced = 0;
|
||||
|
||||
for ( VpnProc = VpnFigure->PROCESS;
|
||||
VpnProc != (vpnproc_list *)0;
|
||||
VpnProc = VpnProc->NEXT )
|
||||
{
|
||||
if ( IsVasyVpnProcToAnalyse( VpnProc ) )
|
||||
{
|
||||
Reduced += VasyRedWaitVpnProc( VpnFigure, VpnProc );
|
||||
}
|
||||
}
|
||||
|
||||
if ( IsVasyDebugStatistics() )
|
||||
{
|
||||
VasyPrintf( stdout, "--> Process minimal : %d\n", Reduced );
|
||||
|
||||
VasyPrintf( stdout, "--> Global reduction : %ld sec\n", VasyDebugReadChrono(1) );
|
||||
VasyPrintf( stdout, "--> Process : %ld\n", GetVpnNumProc( VpnFigure ) );
|
||||
VasyPrintf( stdout, "--> Transition : %ld\n", GetVpnNumTrans( VpnFigure ) );
|
||||
VasyPrintf( stdout, "--> Place : %ld\n", GetVpnNumPlace( VpnFigure ) );
|
||||
}
|
||||
|
||||
if ( IsVasyDebugLevel0() )
|
||||
{
|
||||
VasyDebugSaveVpnFig( VpnFigure );
|
||||
VasyPrintf( stdout, "<-- VasyReduceVpnFig %s\n", VpnFigure->NAME );
|
||||
}
|
||||
}
|
|
@ -0,0 +1,71 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_reduce.h |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_REDUCE_H
|
||||
# define VASY_REDUCE_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasyReduceVpnFig();
|
||||
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,114 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_redwait.h |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_REDWAIT_H
|
||||
# define VASY_REDWAIT_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_REDWAIT_DEL_MASK (long)0x01
|
||||
# define VASY_REDWAIT_TAG_MASK (long)0x02
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Delete |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyRedWaitDelete( O ) ((O)->FLAGS |= VASY_REDWAIT_DEL_MASK)
|
||||
# define ClearVasyRedWaitDelete( O ) ((O)->FLAGS &= ~VASY_REDWAIT_DEL_MASK)
|
||||
# define IsVasyRedWaitDelete( O ) ((O)->FLAGS & VASY_REDWAIT_DEL_MASK)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Tag |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyRedWaitTag( O ) ((O)->FLAGS |= VASY_REDWAIT_TAG_MASK)
|
||||
# define ClearVasyRedWaitTag( O ) ((O)->FLAGS &= ~VASY_REDWAIT_TAG_MASK)
|
||||
# define IsVasyRedWaitTag( O ) ((O)->FLAGS & VASY_REDWAIT_TAG_MASK)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Place |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyRedWaitPlace( T, P ) ((T)->USER = (void *)P )
|
||||
# define GetVasyRedWaitPlace( T ) ((vpnplace_list *)(T)->USER)
|
||||
# define ClearVasyRedWaitPlace( T ) ((T)->USER = (void *)0 )
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
typedef struct vasystack_list
|
||||
{
|
||||
struct vasystack_list *NEXT;
|
||||
struct vasystack_list *PREV;
|
||||
vpntrans_list *TRANS;
|
||||
|
||||
} vasystack_list;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern int VasyRedWaitVpnProc();
|
||||
|
||||
# endif
|
|
@ -0,0 +1,402 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_shared.c |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Include Files |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# include <stdio.h>
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
|
||||
# include "mut.h"
|
||||
# include "aut.h"
|
||||
# include "abl.h"
|
||||
# include "bdd.h"
|
||||
# include "vex.h"
|
||||
# include "vpn.h"
|
||||
# include "vtl.h"
|
||||
|
||||
# include "vasy_error.h"
|
||||
# include "vasy_shared.h"
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
char *VASY_SYM_TYPE[ VASY_MAX_SYM_TYPE ] =
|
||||
{
|
||||
"UNKNOWN",
|
||||
"UNUSED",
|
||||
"CONSTANT",
|
||||
"COMBINATORIAL",
|
||||
"TRISTATE",
|
||||
"REGISTER"
|
||||
};
|
||||
|
||||
char *VasyPowerVdd = (char *)0;
|
||||
char *VasyPowerVss = (char *)0;
|
||||
|
||||
int VasyFlagDebug = 0;
|
||||
int VasyFlagOption = 0;
|
||||
int VasyFlagDrive = 2;
|
||||
int VasyFlagVerbose = 0;
|
||||
int VasyFlagHier = 0;
|
||||
int VasyFlagOver = 0;
|
||||
int VasyFlagStdLogic = 0;
|
||||
int VasyFlagInitial = 0;
|
||||
int VasyFlagPower = 0;
|
||||
int VasyFlagCLA = 0;
|
||||
int VasyFlagEqual = 0;
|
||||
int VasyFlagLax = 0;
|
||||
int VasyFlagBoom = 0;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyAddVpnProcInfo |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
vasyprocinfo *VasyAddVpnProcInfo( VpnProc )
|
||||
|
||||
vpnproc_list *VpnProc;
|
||||
{
|
||||
vasyprocinfo *ProcInfo;
|
||||
|
||||
ProcInfo = (vasyprocinfo *)autallocheap( sizeof( vasyprocinfo ) );
|
||||
|
||||
SetVasyVpnProcInfo( VpnProc, ProcInfo );
|
||||
|
||||
return( ProcInfo );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDelVpnProcInfo |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyDelVpnProcInfo( VpnProc )
|
||||
|
||||
vpnproc_list *VpnProc;
|
||||
{
|
||||
vasyprocinfo *ProcInfo;
|
||||
vasybivex_list *ProcBiVex;
|
||||
vasybivex_list *DelProcBiVex;
|
||||
|
||||
ProcInfo = GetVasyVpnProcInfo( VpnProc );
|
||||
|
||||
ProcBiVex = ProcInfo->BIVEX;
|
||||
|
||||
while ( ProcBiVex != (vasybivex_list *)0 )
|
||||
{
|
||||
freevexexpr( ProcBiVex->VEX_COND );
|
||||
freevexexpr( ProcBiVex->VEX_DATA );
|
||||
|
||||
DelProcBiVex = ProcBiVex;
|
||||
ProcBiVex = ProcBiVex->NEXT;
|
||||
|
||||
autfreeheap( DelProcBiVex, sizeof( vasybivex_list ) );
|
||||
}
|
||||
|
||||
autfreeheap( ProcInfo, sizeof( vasyprocinfo ) );
|
||||
|
||||
SetVasyVpnProcInfo( VpnProc, (vasyprocinfo *)0 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyAddVpnActInfo |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
vasyactinfo *VasyAddVpnActInfo( VpnAction )
|
||||
|
||||
vpnact_list *VpnAction;
|
||||
{
|
||||
vasyactinfo *ActInfo;
|
||||
vexexpr *AsgAtom;
|
||||
chain_list **Support;
|
||||
chain_list **Literal;
|
||||
chain_list **Event;
|
||||
vasysyminfo *SymInfo;
|
||||
unsigned char *Flags;
|
||||
short Width;
|
||||
|
||||
AsgAtom = VpnAction->VEX_ATOM;
|
||||
Width = AsgAtom->WIDTH;
|
||||
|
||||
ActInfo = (vasyactinfo *)autallocheap( sizeof( vasyactinfo ) );
|
||||
|
||||
Support = (chain_list **)autallocblock( sizeof( chain_list *) * Width );
|
||||
Literal = (chain_list **)autallocblock( sizeof( chain_list *) * Width );
|
||||
Event = (chain_list **)autallocblock( sizeof( chain_list *) * Width );
|
||||
Flags = (unsigned char *)autallocblock( sizeof( char ) * Width );
|
||||
SymInfo = (vasysyminfo *)autallocblock( sizeof( vasysyminfo ) * Width );
|
||||
|
||||
ActInfo->SUPPORT = Support;
|
||||
ActInfo->LITERAL = Literal;
|
||||
ActInfo->EVENT = Event;
|
||||
ActInfo->FLAGS = Flags;
|
||||
ActInfo->SYM_INFO = SymInfo;
|
||||
|
||||
SetVasyVpnActInfo( VpnAction, ActInfo );
|
||||
|
||||
return( ActInfo );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDelVpnActInfo |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyDelVpnActInfo( VpnAction )
|
||||
|
||||
vpnact_list *VpnAction;
|
||||
{
|
||||
vasyactinfo *ActInfo;
|
||||
vexexpr *AsgAtom;
|
||||
chain_list **Support;
|
||||
chain_list **Literal;
|
||||
chain_list **Event;
|
||||
unsigned char *Flags;
|
||||
vasysyminfo *SymInfo;
|
||||
vasybivex_list *SymBiVex;
|
||||
vasybivex_list *DelSymBiVex;
|
||||
int Index;
|
||||
|
||||
ActInfo = GetVasyVpnActInfo( VpnAction );
|
||||
|
||||
AsgAtom = VpnAction->VEX_ATOM;
|
||||
Support = ActInfo->SUPPORT;
|
||||
Literal = ActInfo->LITERAL;
|
||||
Event = ActInfo->EVENT;
|
||||
Flags = ActInfo->FLAGS;
|
||||
SymInfo = ActInfo->SYM_INFO;
|
||||
|
||||
for ( Index = 0; Index < AsgAtom->WIDTH; Index++ )
|
||||
{
|
||||
freechain( Support[ Index ] );
|
||||
freechain( Literal[ Index ] );
|
||||
|
||||
SymBiVex = SymInfo[ Index ].BIVEX;
|
||||
|
||||
while ( SymBiVex != (vasybivex_list *)0 )
|
||||
{
|
||||
freevexexpr( SymBiVex->VEX_COND );
|
||||
freevexexpr( SymBiVex->VEX_DATA );
|
||||
|
||||
DelSymBiVex = SymBiVex;
|
||||
SymBiVex = SymBiVex->NEXT;
|
||||
|
||||
autfreeheap( DelSymBiVex, sizeof( vasybivex_list ) );
|
||||
}
|
||||
|
||||
freevexexpr( SymInfo[ Index ].VEX_DATA );
|
||||
}
|
||||
|
||||
autfreeblock( Support );
|
||||
autfreeblock( Literal );
|
||||
autfreeblock( Event );
|
||||
autfreeblock( Flags );
|
||||
autfreeblock( SymInfo );
|
||||
|
||||
autfreeheap( ActInfo, sizeof( vasyactinfo ) );
|
||||
|
||||
SetVasyVpnActInfo( VpnAction, (vasyactinfo *)0 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyAddVpnWaitInfo |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
vasywaitinfo *VasyAddVpnWaitInfo( VpnTrans )
|
||||
|
||||
vpntrans_list *VpnTrans;
|
||||
{
|
||||
vasywaitinfo *WaitInfo;
|
||||
|
||||
WaitInfo = (vasywaitinfo *)autallocheap( sizeof( vasywaitinfo ) );
|
||||
SetVasyVpnWaitInfo( VpnTrans, WaitInfo );
|
||||
|
||||
return( WaitInfo );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDelVpnWaitInfo |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyDelVpnWaitInfo( VpnTrans )
|
||||
|
||||
vpntrans_list *VpnTrans;
|
||||
{
|
||||
vasywaitinfo *WaitInfo;
|
||||
|
||||
WaitInfo = GetVasyVpnWaitInfo( VpnTrans );
|
||||
autfreeheap( WaitInfo, sizeof( vasywaitinfo ) );
|
||||
|
||||
SetVasyVpnWaitInfo( VpnTrans, (vasywaitinfo *)0 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyAddVpnTransInfo |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
vasytransinfo *VasyAddVpnTransInfo( VpnTrans )
|
||||
|
||||
vpntrans_list *VpnTrans;
|
||||
{
|
||||
vasytransinfo *TransInfo;
|
||||
|
||||
TransInfo = (vasytransinfo *)autallocheap( sizeof( vasytransinfo ) );
|
||||
|
||||
TransInfo->HASH_ASSIGN = createauthtable( 100 );
|
||||
TransInfo->HASH_BITVEC = createauthtable( 100 );
|
||||
TransInfo->HASH_SUPPORT = createauth2table( 100 );
|
||||
TransInfo->HASH_LITERAL = createauth2table( 100 );
|
||||
TransInfo->HASH_EVENT = createauth2table( 100 );
|
||||
|
||||
SetVasyVpnTransInfo( VpnTrans, TransInfo );
|
||||
|
||||
return( TransInfo );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyDelVpnTransInfo |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
void VasyDelVpnTransInfo( VpnTrans )
|
||||
|
||||
vpntrans_list *VpnTrans;
|
||||
{
|
||||
vasytransinfo *TransInfo;
|
||||
|
||||
TransInfo = GetVasyVpnTransInfo( VpnTrans );
|
||||
|
||||
destroyauthtable( TransInfo->HASH_ASSIGN );
|
||||
destroyauthtable( TransInfo->HASH_BITVEC );
|
||||
destroyauth2table( TransInfo->HASH_SUPPORT );
|
||||
destroyauth2table( TransInfo->HASH_LITERAL );
|
||||
destroyauth2table( TransInfo->HASH_EVENT );
|
||||
|
||||
autfreeheap( TransInfo, sizeof( vasytransinfo ) );
|
||||
|
||||
SetVasyVpnTransInfo( VpnTrans, (vasytransinfo *)0 );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyAddVpnSymBiVex |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
vasybivex_list *VasyAddVpnSymBiVex( SymInfo, VexCond, VexData, Type )
|
||||
|
||||
vasysyminfo *SymInfo;
|
||||
vexexpr *VexCond;
|
||||
vexexpr *VexData;
|
||||
int Type;
|
||||
{
|
||||
vasybivex_list *SymBiVex;
|
||||
|
||||
SymBiVex = (vasybivex_list *)autallocheap( sizeof( vasybivex_list ) );
|
||||
|
||||
SymBiVex->VEX_COND = VexCond;
|
||||
SymBiVex->VEX_DATA = VexData;
|
||||
SymBiVex->TYPE = Type;
|
||||
|
||||
SymBiVex->NEXT = SymInfo->BIVEX;
|
||||
SymInfo->BIVEX = SymBiVex;
|
||||
|
||||
return( SymBiVex );
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| VasyAddVpnProcBiVex |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
vasybivex_list *VasyAddVpnProcBiVex( ProcInfo, VexCond, VexData, Type )
|
||||
|
||||
vasyprocinfo *ProcInfo;
|
||||
vexexpr *VexCond;
|
||||
vexexpr *VexData;
|
||||
int Type;
|
||||
{
|
||||
vasybivex_list *SymBiVex;
|
||||
|
||||
SymBiVex = (vasybivex_list *)autallocheap( sizeof( vasybivex_list ) );
|
||||
|
||||
SymBiVex->VEX_COND = VexCond;
|
||||
SymBiVex->VEX_DATA = VexData;
|
||||
SymBiVex->TYPE = Type;
|
||||
|
||||
SymBiVex->NEXT = ProcInfo->BIVEX;
|
||||
ProcInfo->BIVEX = SymBiVex;
|
||||
|
||||
return( SymBiVex );
|
||||
}
|
|
@ -0,0 +1,335 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_shared.h |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_SHARED_H
|
||||
# define VASY_SHARED_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Process Flags |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_PROC_TO_ANALYSE_MASK 0x1
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Process Type |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_PROC_UNKNOWN 0
|
||||
# define VASY_PROC_UNUSED 1
|
||||
# define VASY_PROC_DATA_FLOW 2
|
||||
# define VASY_PROC_FSM 3
|
||||
# define VASY_PROC_FSM_OUTREG 4
|
||||
# define VASY_MAX_VPN_PROC_TYPE 5
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Rtl Declar Type Mask |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_RTL_DECL_COMBINATORIAL 0x0100
|
||||
# define VASY_RTL_DECL_TRISTATE 0x0200
|
||||
# define VASY_RTL_DECL_PULL_UP 0x0400
|
||||
# define VASY_RTL_DECL_PULL_DOWN 0x0800
|
||||
# define VASY_RTL_DECL_REGISTER 0x1000
|
||||
|
||||
# define VASY_RTL_VERILOG_REG_MASK 0x2000
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Symbol Type |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_SYM_UNKNOWN 0
|
||||
# define VASY_SYM_UNUSED 1
|
||||
# define VASY_SYM_CONSTANT 2
|
||||
# define VASY_SYM_COMBINATORIAL 3
|
||||
# define VASY_SYM_TRISTATE 4
|
||||
# define VASY_SYM_PULL_UP 5
|
||||
# define VASY_SYM_PULL_DOWN 6
|
||||
# define VASY_SYM_REGISTER 7
|
||||
|
||||
# define VASY_MAX_SYM_TYPE 8
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Symbol Register Type |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_SYM_REGISTER_NONE 0
|
||||
# define VASY_SYM_REGISTER_SYNC 1
|
||||
# define VASY_SYM_REGISTER_ASYNC 2
|
||||
# define VASY_SYM_REGISTER_MIXED 3
|
||||
|
||||
# define VASY_MAX_SYM_REGISTER TYPE 4
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Bi Vex Type |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_BIVEX_FALLING_EDGE RTL_BIVEX_FALLING_EDGE
|
||||
# define VASY_BIVEX_RISING_EDGE RTL_BIVEX_RISING_EDGE
|
||||
# define VASY_BIVEX_ASYNC_RESET RTL_BIVEX_ASYNC_RESET
|
||||
# define VASY_BIVEX_ASYNC_SET RTL_BIVEX_ASYNC_SET
|
||||
# define VASY_BIVEX_ASYNC_WEN RTL_BIVEX_ASYNC_WEN
|
||||
# define VASY_BIVEX_SYNC_RESET RTL_BIVEX_SYNC_RESET
|
||||
# define VASY_BIVEX_SYNC_SET RTL_BIVEX_SYNC_SET
|
||||
# define VASY_BIVEX_SYNC_WEN RTL_BIVEX_SYNC_WEN
|
||||
# define VASY_MAX_BIVEX_TYPE RTL_MAX_BIVEX_TYPE
|
||||
|
||||
# define VASY_BIVEX_TYPE RTL_BIVEX_TYPE
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Action Flags |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_ACT_USED_MASK 0x1
|
||||
# define VASY_ACT_ARITH_MASK 0x2
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Process Analysis |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define IsVasyVpnProcToAnalyse( P ) ( (P)->FLAGS & VASY_PROC_TO_ANALYSE_MASK )
|
||||
# define SetVasyVpnProcToAnalyse( P ) ( (P)->FLAGS |= VASY_PROC_TO_ANALYSE_MASK )
|
||||
# define ClearVasyVpnProcToAnalyse( P ) ( (P)->FLAGS &= ~VASY_PROC_TO_ANALYSE_MASK)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Rtl Declar Type |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyRtlDeclType( D, T ) ((D)->FLAGS |= (long)(T))
|
||||
# define IsVasyRtlDeclType( D, T ) ((D)->FLAGS & (long)(T))
|
||||
|
||||
# define SetVasyRtlDeclVerilogReg( D ) ((D)->FLAGS |= VASY_RTL_VERILOG_REG_MASK)
|
||||
# define IsVasyRtlDeclVerilogReg( D ) ((D)->FLAGS & VASY_RTL_VERILOG_REG_MASK)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Proc Info |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyVpnProcInfo( P, I ) ((P)->USER = (void *)(I))
|
||||
# define GetVasyVpnProcInfo( P ) ((vasyprocinfo *)(P)->USER)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Act Info |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyVpnActInfo( A, I ) ((A)->USER = (void *)(I))
|
||||
# define GetVasyVpnActInfo( A ) ((vasyactinfo *)(A)->USER)
|
||||
|
||||
# define GetVasyVpnActInfoSupport( A ) (((vasyactinfo *)(A)->USER)->SUPPORT)
|
||||
# define GetVasyVpnActInfoFlags( A ) (((vasyactinfo *)(A)->USER)->FLAGS)
|
||||
# define GetVasyVpnActInfoLiteral( A ) (((vasyactinfo *)(A)->USER)->LITERAL)
|
||||
# define GetVasyVpnActInfoEvent( A ) (((vasyactinfo *)(A)->USER)->EVENT)
|
||||
|
||||
# define SetVasyVpnActInfoUsed( F ) ( (F) |= VASY_ACT_USED_MASK )
|
||||
# define SetVasyVpnActInfoArith( F ) ( (F) |= VASY_ACT_ARITH_MASK )
|
||||
|
||||
# define ClearVasyVpnActInfoUsed( F ) ( (F) &= ~VASY_ACT_USED_MASK )
|
||||
# define ClearVasyVpnActInfoArith( F ) ( (F) &= ~VASY_ACT_ARITH_MASK )
|
||||
|
||||
# define IsVasyVpnActInfoUsed( F ) ( (F) & VASY_ACT_USED_MASK )
|
||||
# define IsVasyVpnActInfoArith( F ) ( (F) & VASY_ACT_ARITH_MASK )
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Trans Info |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyVpnTransInfo( T, I ) ((T)->USER = (void *)(I))
|
||||
# define GetVasyVpnTransInfo( T ) ((vasytransinfo *)(T)->USER)
|
||||
|
||||
# define SetVasyVpnWaitInfo( T, I ) ((T)->USER = (void *)(I))
|
||||
# define GetVasyVpnWaitInfo( T ) ((vasywaitinfo *)(T)->USER)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Sym Info |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyVpnSymInfo( S, I ) ((S)->USER = (void *)(I))
|
||||
# define GetVasyVpnSymInfo( S ) ((vasysyminfo *)(S)->USER)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
typedef struct vasybivex_list
|
||||
{
|
||||
struct vasybivex_list *NEXT;
|
||||
vexexpr *VEX_COND;
|
||||
vexexpr *VEX_DATA;
|
||||
unsigned char TYPE;
|
||||
|
||||
} vasybivex_list;
|
||||
|
||||
typedef struct vasyprocinfo
|
||||
{
|
||||
long NUMBER_WAIT;
|
||||
long NUMBER_ACTION;
|
||||
bddcircuit *BDD_CIRCUIT;
|
||||
bddsystem *BDD_SYSTEM;
|
||||
bddnode **BDD_LITERAL;
|
||||
authtable *HASH_ABL2SYM;
|
||||
authtable *HASH_SYM2ABL;
|
||||
vasybivex_list *BIVEX;
|
||||
unsigned char TYPE;
|
||||
|
||||
} vasyprocinfo;
|
||||
|
||||
typedef struct vasywaitinfo
|
||||
{
|
||||
vpntrans_list *DEF_TRANS;
|
||||
vpntrans_list *LOOP_TRANS;
|
||||
vpnplace_list *WAIT_PLACE;
|
||||
|
||||
} vasywaitinfo;
|
||||
|
||||
typedef struct vasytransinfo
|
||||
{
|
||||
authtable *HASH_ASSIGN;
|
||||
authtable *HASH_BITVEC;
|
||||
auth2table *HASH_SUPPORT;
|
||||
auth2table *HASH_LITERAL;
|
||||
auth2table *HASH_EVENT;
|
||||
|
||||
} vasytransinfo;
|
||||
|
||||
|
||||
typedef struct vasysyminfo
|
||||
{
|
||||
vexexpr *VEX_DATA;
|
||||
vasybivex_list *BIVEX;
|
||||
unsigned char TYPE;
|
||||
unsigned char TRS_TYPE;
|
||||
unsigned char REG_TYPE;
|
||||
|
||||
} vasysyminfo;
|
||||
|
||||
typedef struct vasyactinfo
|
||||
{
|
||||
chain_list **SUPPORT;
|
||||
chain_list **LITERAL;
|
||||
chain_list **EVENT;
|
||||
vasysyminfo *SYM_INFO;
|
||||
unsigned char *FLAGS;
|
||||
unsigned char SPLIT;
|
||||
|
||||
} vasyactinfo;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern char *VASY_SYM_TYPE[ VASY_MAX_SYM_TYPE ];
|
||||
|
||||
extern char *VasyPowerVdd;
|
||||
extern char *VasyPowerVss;
|
||||
|
||||
extern int VasyFlagDebug;
|
||||
extern int VasyFlagOption;
|
||||
extern int VasyFlagDrive;
|
||||
extern int VasyFlagVerbose;
|
||||
extern int VasyFlagHier;
|
||||
extern int VasyFlagOver;
|
||||
extern int VasyFlagStdLogic;
|
||||
extern int VasyFlagInitial;
|
||||
extern int VasyFlagPower;
|
||||
extern int VasyFlagCLA;
|
||||
extern int VasyFlagEqual;
|
||||
extern int VasyFlagLax;
|
||||
extern int VasyFlagBoom;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern vasyprocinfo *VasyAddVpnProcInfo();
|
||||
extern void VasyDelVpnProcInfo();
|
||||
|
||||
extern vasytransinfo *VasyAddVpnTransInfo();
|
||||
extern void VasyDelVpnTransInfo();
|
||||
|
||||
extern vasywaitinfo *VasyAddVpnWaitInfo();
|
||||
extern void VasyDelVpnWaitInfo();
|
||||
|
||||
extern vasyactinfo *VasyAddVpnActInfo();
|
||||
extern void VasyDelVpnActInfo();
|
||||
|
||||
extern vasybivex_list *VasyAddVpnSymBiVex();
|
||||
extern vasybivex_list *VasyAddVpnProcBiVex();
|
||||
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,134 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_simprtl.h |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_SIMP_RTL_H
|
||||
# define VASY_SIMP_RTL_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Declar Mask |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_DECLAR_ASG_MASK 0x01
|
||||
# define VASY_DECLAR_READ_MASK 0x02
|
||||
# define VASY_DECLAR_USED_MASK 0x03
|
||||
# define VASY_DECLAR_DEFINE_MASK 0x04
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macros Declar |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyRtlDeclarAsg( D ) ((D)->FLAGS |= VASY_DECLAR_ASG_MASK)
|
||||
# define ClearVasyRtlDeclarAsg( D ) ((D)->FLAGS &= ~VASY_DECLAR_ASG_MASK)
|
||||
# define IsVasyRtlDeclarAsg( D ) ((D)->FLAGS & VASY_DECLAR_ASG_MASK)
|
||||
|
||||
# define SetVasyRtlDeclarRead( D ) ((D)->FLAGS |= VASY_DECLAR_READ_MASK)
|
||||
# define ClearVasyRtlDeclarRead( D ) ((D)->FLAGS &= ~VASY_DECLAR_READ_MASK)
|
||||
# define IsVasyRtlDeclarRead( D ) ((D)->FLAGS & VASY_DECLAR_READ_MASK)
|
||||
|
||||
# define IsVasyRtlDeclarUsed( D ) ((D)->FLAGS & VASY_DECLAR_USED_MASK)
|
||||
# define ClearVasyRtlDeclarUsed( D ) ((D)->FLAGS &= ~VASY_DECLAR_USED_MASK)
|
||||
|
||||
# define SetVasyRtlDeclarDefine( D ) ((D)->FLAGS |= VASY_DECLAR_DEFINE_MASK)
|
||||
# define ClearVasyRtlDeclarDefine( D ) ((D)->FLAGS &= ~VASY_DECLAR_DEFINE_MASK)
|
||||
# define IsVasyRtlDeclarDefine( D ) ((D)->FLAGS & VASY_DECLAR_DEFINE_MASK)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Assign Mask |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_ASSIGN_SUBST_MASK 0x01
|
||||
# define VASY_ASSIGN_SUBST_DONE_MASK 0x02
|
||||
|
||||
# define VASY_ASSIGN_NUMBER_READ_MASK 0xF0
|
||||
# define VASY_ASSIGN_NUMBER_READ_SHIFT 4
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macros Assign |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyRtlAssignSubst( D ) ((D)->FLAGS |= VASY_ASSIGN_SUBST_MASK)
|
||||
# define ClearVasyRtlAssignSubst( D ) ((D)->FLAGS &= ~VASY_ASSIGN_SUBST_MASK)
|
||||
# define IsVasyRtlAssignSubst( D ) ((D)->FLAGS & VASY_ASSIGN_SUBST_MASK)
|
||||
|
||||
# define GetVasyRtlAssignNumberRead( D ) \
|
||||
(((D)->FLAGS & VASY_ASSIGN_NUMBER_READ_MASK) >> VASY_ASSIGN_NUMBER_READ_SHIFT)
|
||||
|
||||
# define SetVasyRtlAssignNumberRead( D, V ) \
|
||||
((D)->FLAGS = ((D)->FLAGS & ~VASY_ASSIGN_NUMBER_READ_MASK) | \
|
||||
(((V) << VASY_ASSIGN_NUMBER_READ_SHIFT) & VASY_ASSIGN_NUMBER_READ_MASK))
|
||||
|
||||
# define IncVasyRtlAssignNumberRead( D ) \
|
||||
(SetVasyRtlAssignNumberRead( D, GetVasyRtlAssignNumberRead( D ) + 1 ))
|
||||
|
||||
# define SetVasyRtlAssignSubstDone( D ) ((D)->FLAGS |= VASY_ASSIGN_SUBST_DONE_MASK)
|
||||
# define ClearVasyRtlAssignSubstDone( D ) ((D)->FLAGS &= ~VASY_ASSIGN_SUBST_DONE_MASK)
|
||||
# define IsVasyRtlAssignSubstDone( D ) ((D)->FLAGS & VASY_ASSIGN_SUBST_DONE_MASK)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasySimplifyRtlFig();
|
||||
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,101 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_simul.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 28.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_SIMUL_H
|
||||
# define VASY_SIMUL_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Loop |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_MAX_SIMULATE_LOOP 1000
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasySymbolInOut( S, IO ) ((S)->FLAGS = IO )
|
||||
# define GetVasySymbolInOut( S ) ((S)->FLAGS )
|
||||
|
||||
# define SetVasySymbolEvent( S, E ) ((S)->USER = (void *)E )
|
||||
# define GetVasySymbolEvent( S ) ((paevt_list *)(S)->USER )
|
||||
|
||||
# define IncVasySimulateLoop( O ) ((O)->FLAGS++ )
|
||||
# define ClearVasySimulateLoop( O ) ((O)->FLAGS = 0)
|
||||
# define IsVasySimulateLoop( O ) ((O)->FLAGS == VASY_MAX_SIMULATE_LOOP)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
typedef struct vasysimul
|
||||
{
|
||||
char *VALUE;
|
||||
short WIDTH;
|
||||
short SIGNED;
|
||||
|
||||
} vasysimul;
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasySimulateDelSimul();
|
||||
extern vasysimul *VasySimulateVexExpr();
|
||||
extern void VasySimulateVpnProc();
|
||||
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,86 @@
|
|||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| 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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_support.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_SUPPORT_H
|
||||
# define VASY_SUPPORT_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Support |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_SUPPORT_ERROR 0
|
||||
# define VASY_SUPPORT_LOGIC 1
|
||||
# define VASY_SUPPORT_BOOLEAN 2
|
||||
# define VASY_SUPPORT_ARITH 3
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasySupportCreateVpnTrans();
|
||||
extern void VasySupportMergeVpnTrans();
|
||||
extern void VasySupportResetVpnTrans();
|
||||
extern void VasySupportDestroyVpnTrans();
|
||||
|
||||
extern void VasySupportVpnTrans();
|
||||
extern void VasySupportUsedVpnTrans();
|
||||
|
||||
extern chain_list *VasySupportVpnTransBitVex();
|
||||
extern chain_list *VasySupportVpnTransEventBitVex();
|
||||
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_synth.h |
|
||||
| |
|
||||
| Author : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_SYNTH_H
|
||||
# define VASY_SYNTH_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define VASY_TRANS_ASG_DEFINE_MASK 0x01
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# define SetVasyVpnTransAsgDefine( T ) ((T)->FLAGS |= VASY_TRANS_ASG_DEFINE_MASK)
|
||||
# define ClearVasyVpnTransAsgDefine( T ) ((T)->FLAGS &= ~VASY_TRANS_ASG_DEFINE_MASK)
|
||||
# define IsVasyVpnTransAsgDefine( T ) ((T)->FLAGS & VASY_TRANS_ASG_DEFINE_MASK)
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern void VasySynthesisOneWaitVpnProc();
|
||||
extern void VasySynthesisMultiWaitVpnProc();
|
||||
extern void VasySynthesisCombinatorialVpnProc();
|
||||
extern void VasySynthesisVpnDecl();
|
||||
extern void VasySynthesisVpnInstance();
|
||||
extern void VasySynthesisVpnModel();
|
||||
|
||||
# endif
|
File diff suppressed because it is too large
Load Diff
|
@ -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 General Public |
|
||||
| License as published by the Free Software Foundation; |
|
||||
| either version 2 of the License, or (at your option) any |
|
||||
| later version. |
|
||||
| |
|
||||
| Alliance VLSI CAD System is distributed in the hope that |
|
||||
| it will be useful, but WITHOUT ANY WARRANTY; |
|
||||
| without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
||||
| Public License for more details. |
|
||||
| |
|
||||
| You should have received a copy of the GNU General Public |
|
||||
| License along with 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 : VASY |
|
||||
| |
|
||||
| File : vasy_vexbdd.h |
|
||||
| |
|
||||
| Authors : Jacomme Ludovic |
|
||||
| |
|
||||
| Date : 25.08.97 |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
# ifndef VASY_VEXBDD_H
|
||||
# define VASY_VEXBDD_H
|
||||
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Constants |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Macro |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Types |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Variables |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
/*------------------------------------------------------------\
|
||||
| |
|
||||
| Functions |
|
||||
| |
|
||||
\------------------------------------------------------------*/
|
||||
|
||||
extern bddnode *VasyVexBddAddBddCircuitInput();
|
||||
extern bddnode *VasyVexBddDelBddCircuitInput();
|
||||
extern int VasyVexBddDelBddCircuitOutput();
|
||||
|
||||
extern bddnode *VasyVexBddSearchBddCircuitInput();
|
||||
extern bddnode *VasyVexBddSearchBddCircuitStable();
|
||||
extern bddcircuit *VasyVexBddCreateBddCircuit();
|
||||
extern void VasyVexBddDestroyBddCircuit();
|
||||
|
||||
extern bddnode *VasyVexBddConvertVex2Bdd();
|
||||
extern long VasyVexBddConvertVex2BddSize();
|
||||
extern vexexpr *VasyVexBddConvertBdd2Vex();
|
||||
|
||||
extern chain_list *VasyVexBddSupportVpnSymbol();
|
||||
|
||||
|
||||
# endif
|
Loading…
Reference in New Issue