This commit is contained in:
parent
6e10725924
commit
9b36896547
|
@ -0,0 +1 @@
|
|||
SUBDIRS = src
|
|
@ -0,0 +1,45 @@
|
|||
dnl
|
||||
/*
|
||||
dnl This file is part of the Alliance CAD System
|
||||
dnl Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
dnl Universite Pierre et Marie Curie
|
||||
dnl
|
||||
dnl Home page : http://www-asim.lip6.fr/alliance/
|
||||
dnl E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
dnl
|
||||
dnl This library is free software; you can redistribute it and/or modify it
|
||||
dnl under the terms of the GNU Library General Public License as published
|
||||
dnl by the Free Software Foundation; either version 2 of the License, or (at
|
||||
dnl your option) any later version.
|
||||
dnl
|
||||
dnl Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
dnl useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
dnl Public License for more details.
|
||||
dnl
|
||||
dnl You should have received a copy of the GNU General Public License along
|
||||
dnl with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
dnl Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
dnl
|
||||
dnl Purpose : Auto stuffing Alliance
|
||||
dnl Almost ten years since I wrote this stuff, I just can't
|
||||
dnl believe it
|
||||
dnl Date : 01/02/2002
|
||||
dnl Author : Frederic Petrot <Frederic.Petrot@lip6.fr>
|
||||
dnl $Id: configure.in,v 1.1 2002/04/04 14:54:58 ludo Exp $
|
||||
dnl
|
||||
dnl
|
||||
AC_INIT(src/bhl.h)
|
||||
AM_INIT_AUTOMAKE(bhl, 1.11)
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_CC
|
||||
AC_HEADER_STDC
|
||||
AC_C_CONST
|
||||
AC_PROG_RANLIB
|
||||
|
||||
AM_ALLIANCE
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
src/Makefile
|
||||
])
|
|
@ -0,0 +1,10 @@
|
|||
CFLAGS = @ALLIANCE_CFLAGS@ \
|
||||
-DALLIANCE_TOP=\"${ALLIANCE_TOP}\"
|
||||
lib_LIBRARIES = libBhl.a
|
||||
include_HEADERS = bhl.h
|
||||
libBhl_a_SOURCES = \
|
||||
beh_chkbefig.c beh_dly2sta.c beh_makbdd.c beh_makvarlist.c \
|
||||
beh_clrdepend.c beh_freabl.c beh_makderiv.c beh_namelist.c \
|
||||
beh_debug.c beh_gettu.c beh_makgex.c beh_sta2dly.c \
|
||||
beh_debug.h beh_indexbdd.c beh_maknode.c beh_unamlist.c \
|
||||
beh_depend.c beh_makabl.c beh_makquad.c bhl.h
|
|
@ -0,0 +1,196 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_chkbefig.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* description : high level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_chkbefig */
|
||||
/* description : check the consistency of a behavioural description */
|
||||
/* called func. : none */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
int beh_chkbefig (pt_befig, mode)
|
||||
|
||||
struct befig *pt_befig;
|
||||
unsigned int mode ;
|
||||
|
||||
{
|
||||
struct beout *pt_beout ;
|
||||
struct beaux *pt_beaux ;
|
||||
struct bebus *pt_bebus ;
|
||||
struct bebux *pt_bebux ;
|
||||
struct bereg *pt_bereg ;
|
||||
int err_flg = 0;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* check that the description is not empty */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((pt_befig == NULL) || (pt_befig->ERRFLG != 0))
|
||||
err_flg = 1;
|
||||
else
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* check that each output has at least one driver. Outputs */
|
||||
/* are simple output ports, bussed output ports, simple */
|
||||
/* internal signals, delayed internal signals, bussed internal */
|
||||
/* signals, and internal registers. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((mode & BEH_CHK_DRIVERS) != 0)
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* simple output ports */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beout = pt_befig->BEOUT;
|
||||
while (pt_beout != NULL)
|
||||
{
|
||||
if (pt_beout->ABL == NULL)
|
||||
err_flg += beh_error (40, pt_beout->NAME);
|
||||
pt_beout = pt_beout->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* simple internal signals */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beaux = pt_befig->BEAUX;
|
||||
while (pt_beaux != NULL)
|
||||
{
|
||||
if (pt_beaux->ABL == NULL)
|
||||
err_flg += beh_error (40, pt_beaux->NAME);
|
||||
pt_beaux = pt_beaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* delayed internal signals */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beaux = pt_befig->BEDLY;
|
||||
while (pt_beaux != NULL)
|
||||
{
|
||||
if (pt_beaux->ABL == NULL)
|
||||
err_flg += beh_error (40, pt_beaux->NAME);
|
||||
pt_beaux = pt_beaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* bussed output ports */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bebus = pt_befig->BEBUS;
|
||||
while (pt_bebus != NULL)
|
||||
{
|
||||
if (pt_bebus->BIABL == NULL)
|
||||
err_flg += beh_error (40, pt_bebus->NAME);
|
||||
pt_bebus = pt_bebus->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* bussed internal signals */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bebux = pt_befig->BEBUX;
|
||||
while (pt_bebux != NULL)
|
||||
{
|
||||
if (pt_bebux->BIABL == NULL)
|
||||
err_flg += beh_error (40, pt_bebux->NAME);
|
||||
pt_bebux = pt_bebux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* internal registers */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bereg = pt_befig->BEREG;
|
||||
while (pt_bereg != NULL)
|
||||
{
|
||||
if (pt_bereg->BIABL == NULL)
|
||||
err_flg += beh_error (40, pt_bereg->NAME);
|
||||
pt_bereg = pt_bereg->NEXT;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* check that the descriptiona has an empty architecture. */
|
||||
/* that means, no internal signal is declared and output ports */
|
||||
/* have no dreivers. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((mode & BEH_CHK_EMPTY) != 0)
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* check that simple output ports have no drivers */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beout = pt_befig->BEOUT;
|
||||
while (pt_beout != NULL)
|
||||
{
|
||||
if (pt_beout->ABL != NULL)
|
||||
break;
|
||||
pt_beout = pt_beout->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* check that bussed output ports have no drivers */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bebus = pt_befig->BEBUS;
|
||||
while (pt_bebus != NULL)
|
||||
{
|
||||
if (pt_bebus->BIABL != NULL)
|
||||
break;
|
||||
pt_bebus = pt_bebus->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* check that the architecture is empty */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((pt_befig->BEAUX != NULL) || (pt_befig->BEBUX != NULL) ||
|
||||
(pt_befig->BEDLY != NULL) || (pt_befig->BEREG != NULL) ||
|
||||
(pt_befig->BEMSG != NULL) || (pt_beout != NULL) ||
|
||||
(pt_bebus != NULL) )
|
||||
err_flg += beh_error (41, pt_befig->NAME);
|
||||
|
||||
}
|
||||
|
||||
pt_befig->ERRFLG = err_flg;
|
||||
}
|
||||
|
||||
return (err_flg);
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_clrdepend.c */
|
||||
/* date : Mar 8
|
||||
/* version : v111 */
|
||||
/* author : Laurent VUILLEMIN, Pirouz BAZARGAN SABET */
|
||||
/* description : beh_clrdepend */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_clrdepend */
|
||||
/* description : clear the dependecy lists in the description */
|
||||
/* called func. : freechain */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void beh_clrdepend (pt_fig)
|
||||
|
||||
struct befig *pt_fig;
|
||||
|
||||
{
|
||||
struct berin *pt_rin;
|
||||
|
||||
if (( pt_fig != NULL) &&
|
||||
( pt_fig->ERRFLG == 0 ) &&
|
||||
((pt_fig->FLAG & BEH_FIG_DEPEND) != 0 ) )
|
||||
{
|
||||
pt_rin = pt_fig->BERIN;
|
||||
while (pt_rin != NULL)
|
||||
{
|
||||
freechain (pt_rin->OUT_REF);
|
||||
pt_rin->OUT_REF = NULL;
|
||||
|
||||
freechain (pt_rin->AUX_REF);
|
||||
pt_rin->AUX_REF = NULL;
|
||||
|
||||
freechain (pt_rin->REG_REF);
|
||||
pt_rin->REG_REF = NULL;
|
||||
|
||||
freechain (pt_rin->BUS_REF);
|
||||
pt_rin->BUS_REF = NULL;
|
||||
|
||||
freechain (pt_rin->BUX_REF);
|
||||
pt_rin->BUX_REF = NULL;
|
||||
|
||||
freechain (pt_rin->MSG_REF);
|
||||
pt_rin->MSG_REF = NULL;
|
||||
|
||||
freechain (pt_rin->DLY_REF);
|
||||
pt_rin->DLY_REF = NULL;
|
||||
|
||||
pt_rin = pt_rin->NEXT;
|
||||
}
|
||||
|
||||
pt_fig->FLAG ^= BEH_FIG_DEPEND;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,137 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_debug.h */
|
||||
/* date : Mar 8 2000 */
|
||||
/* version : v111 */
|
||||
/* author : Pirouz BAZARGAN SABET */
|
||||
/* description : difines and structures for the debug function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct stack /* debugger's stack's structure */
|
||||
{
|
||||
short type; /* type of the current ponter */
|
||||
short mark; /* stop mark */
|
||||
void *data; /* current pointer */
|
||||
};
|
||||
|
||||
union value
|
||||
{
|
||||
void *dat;
|
||||
long imd;
|
||||
};
|
||||
|
||||
#define STKSIZ_DFN 200 /* debugger's stack size */
|
||||
|
||||
#define KIND_DFN 0xff000000
|
||||
#define COMMAND_DFN 0x01000000
|
||||
#define IMMEDIATE_DFN 0x02000000
|
||||
#define POINTER_DFN 0x03000000
|
||||
#define ARRAY_DFN 0x04000000
|
||||
#define ARYOFPNT_DFN 0x05000000
|
||||
|
||||
#define FORMAT_DFN 0x00ff0000
|
||||
#define s_DFN 0x00010000
|
||||
#define u_DFN 0x00020000
|
||||
#define d_DFN 0x00030000
|
||||
#define l_DFN 0x00040000
|
||||
#define x_DFN 0x00050000
|
||||
#define c_DFN 0x00060000
|
||||
#define ABL_DFN 0x00070000
|
||||
#define BDD_DFN 0x00080000
|
||||
#define GEX_DFN 0x00090000
|
||||
|
||||
#define _error_DFN 0x0000ffff
|
||||
|
||||
#define TYPE_DFN 0x0000ffff
|
||||
#define _back_DFN 0
|
||||
#define _exit_DFN _back_DFN + 1
|
||||
#define _jump_DFN _exit_DFN + 1
|
||||
#define _save_DFN _jump_DFN + 1
|
||||
#define _stop_DFN _save_DFN + 1
|
||||
#define _top_DFN _stop_DFN + 1
|
||||
#define _up_DFN _top_DFN + 1
|
||||
#define _display_DFN _up_DFN + 1
|
||||
|
||||
#define character_DFN _display_DFN + 1
|
||||
#define short_DFN character_DFN + 1
|
||||
#define integer_DFN short_DFN + 1
|
||||
#define long_DFN integer_DFN + 1
|
||||
#define void_DFN long_DFN + 1
|
||||
#define string_DFN void_DFN + 1
|
||||
|
||||
#define chain_DFN string_DFN + 1
|
||||
#define ptype_DFN chain_DFN + 1
|
||||
|
||||
#define befig_DFN ptype_DFN + 1
|
||||
#define bereg_DFN befig_DFN + 1
|
||||
#define bemsg_DFN bereg_DFN + 1
|
||||
#define berin_DFN bemsg_DFN + 1
|
||||
#define beout_DFN berin_DFN + 1
|
||||
#define bebus_DFN beout_DFN + 1
|
||||
#define beaux_DFN bebus_DFN + 1
|
||||
#define bedly_DFN beaux_DFN + 1
|
||||
#define bebux_DFN bedly_DFN + 1
|
||||
#define bepor_DFN bebux_DFN + 1
|
||||
#define begen_DFN bepor_DFN + 1
|
||||
#define biabl_DFN begen_DFN + 1
|
||||
#define binode_DFN biabl_DFN + 1
|
||||
#define bequad_DFN binode_DFN + 1
|
||||
#define beder_DFN bequad_DFN + 1
|
||||
|
||||
#define next_DFN beder_DFN + 1
|
||||
#define name_DFN next_DFN + 1
|
||||
#define user_DFN name_DFN + 1
|
||||
#define errflg_DFN user_DFN + 1
|
||||
#define type_DFN errflg_DFN + 1
|
||||
#define level_DFN type_DFN + 1
|
||||
#define label_DFN level_DFN + 1
|
||||
#define message_DFN label_DFN + 1
|
||||
#define abl_DFN message_DFN + 1
|
||||
#define node_DFN abl_DFN + 1
|
||||
#define direction_DFN node_DFN + 1
|
||||
#define cndabl_DFN direction_DFN + 1
|
||||
#define valabl_DFN cndabl_DFN + 1
|
||||
#define cndnode_DFN valabl_DFN + 1
|
||||
#define valnode_DFN cndnode_DFN + 1
|
||||
#define out_ref_DFN valnode_DFN + 1
|
||||
#define bus_ref_DFN out_ref_DFN + 1
|
||||
#define aux_ref_DFN bus_ref_DFN + 1
|
||||
#define reg_ref_DFN aux_ref_DFN + 1
|
||||
#define bux_ref_DFN reg_ref_DFN + 1
|
||||
#define msg_ref_DFN bux_ref_DFN + 1
|
||||
#define dly_ref_DFN msg_ref_DFN + 1
|
||||
#define value_DFN dly_ref_DFN + 1
|
||||
#define data_DFN value_DFN + 1
|
||||
#define time_DFN data_DFN + 1
|
||||
#define bdd_DFN time_DFN + 1
|
||||
#define gex_DFN bdd_DFN + 1
|
||||
#define varlist_DFN gex_DFN + 1
|
||||
#define derivate_DFN varlist_DFN + 1
|
||||
#define index_DFN derivate_DFN + 1
|
||||
#define flag_DFN index_DFN + 1
|
||||
#define time_unit_DFN flag_DFN + 1
|
||||
#define time_step_DFN time_unit_DFN + 1
|
||||
|
||||
#define MAXCMD_DFN time_step_DFN + 1
|
|
@ -0,0 +1,357 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_depend.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* description : high level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* A hash table containing inputs name and their pointers */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
static ht *rin_list = NULL;
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_expdepend */
|
||||
/* description : find dependencies for an expression */
|
||||
/* called func. : beh_namelist, gethtitem */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
static struct chain *beh_expdepend (pt_fig, pt_exp)
|
||||
|
||||
struct befig *pt_fig;
|
||||
struct chain *pt_exp;
|
||||
|
||||
{
|
||||
struct chain *res_chain = NULL;
|
||||
struct chain *del_chain = NULL;
|
||||
struct chain *tmp_chain = NULL;
|
||||
struct chain *mem_chain = NULL;
|
||||
int value ;
|
||||
|
||||
if (pt_fig->ERRFLG == 0)
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if there is no error in the current figure, find the list */
|
||||
/* of terminals for the expression */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
res_chain = beh_namelist (pt_exp);
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* scan the list of terminals to replace terminal names by */
|
||||
/* the pointer on the corresponding primary input (berin). */
|
||||
/* check the unicity of terminals ... */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
tmp_chain = res_chain;
|
||||
|
||||
while (tmp_chain != NULL)
|
||||
{
|
||||
del_chain = tmp_chain->NEXT;
|
||||
while (del_chain != NULL)
|
||||
{
|
||||
mem_chain = del_chain->NEXT;
|
||||
|
||||
if (del_chain->DATA == tmp_chain->DATA)
|
||||
tmp_chain = delchain (tmp_chain, del_chain);
|
||||
|
||||
del_chain = mem_chain;
|
||||
}
|
||||
|
||||
value = gethtitem (rin_list, tmp_chain->DATA);
|
||||
|
||||
if (value == EMPTYHT)
|
||||
pt_fig->ERRFLG = beh_error (3, tmp_chain->DATA);
|
||||
else
|
||||
tmp_chain->DATA = (void *) value;
|
||||
|
||||
tmp_chain = tmp_chain->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
return (res_chain);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_depend */
|
||||
/* description : find dependencies between signals for a behavioural */
|
||||
/* description. */
|
||||
/* called func. : beh_expdepend, addht , addhtitem, addchain, */
|
||||
/* freechain , append , delhtitem */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void beh_depend (pt_fig)
|
||||
|
||||
struct befig *pt_fig;
|
||||
|
||||
{
|
||||
struct chain *res_chain = NULL;
|
||||
struct beaux *pt_aux ;
|
||||
struct beaux *pt_dly ;
|
||||
struct bebux *pt_bux ;
|
||||
struct bereg *pt_reg ;
|
||||
struct bemsg *pt_msg ;
|
||||
struct berin *pt_rin ;
|
||||
struct beout *pt_out ;
|
||||
struct bebus *pt_bus ;
|
||||
struct biabl *pt_biabl ;
|
||||
unsigned int count = 0;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if there is no error in the current figure ... */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((pt_fig != NULL) && (pt_fig->ERRFLG == 0))
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* initialize a hash table with inputs */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_rin = pt_fig->BERIN;
|
||||
while (pt_rin != NULL)
|
||||
{
|
||||
count++;
|
||||
pt_rin = pt_rin->NEXT;
|
||||
}
|
||||
|
||||
pt_rin = pt_fig->BERIN;
|
||||
|
||||
if (pt_rin != NULL)
|
||||
rin_list = addht (count);
|
||||
|
||||
while (pt_rin != NULL)
|
||||
{
|
||||
addhtitem (rin_list, pt_rin->NAME, (int) pt_rin);
|
||||
pt_rin = pt_rin->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* process simple internal signals. */
|
||||
/* check that the signal does not already belong to the */
|
||||
/* dependency list before adding it to the list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_aux = pt_fig->BEAUX;
|
||||
while (pt_aux != NULL)
|
||||
{
|
||||
res_chain = beh_expdepend (pt_fig, pt_aux->ABL);
|
||||
while (res_chain != NULL)
|
||||
{
|
||||
pt_rin = (struct berin *) res_chain->DATA;
|
||||
|
||||
if ((pt_rin->AUX_REF == NULL) || (pt_rin->AUX_REF->DATA != pt_aux))
|
||||
pt_rin->AUX_REF = addchain (pt_rin->AUX_REF, pt_aux);
|
||||
|
||||
res_chain = res_chain->NEXT;
|
||||
}
|
||||
freechain (res_chain);
|
||||
pt_aux = pt_aux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* process delayed internal signals */
|
||||
/* check that the signal does not already belong to the */
|
||||
/* dependency list before adding it to the list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_dly = pt_fig->BEDLY;
|
||||
while (pt_dly != NULL)
|
||||
{
|
||||
res_chain = beh_expdepend (pt_fig, pt_dly->ABL);
|
||||
while (res_chain != NULL)
|
||||
{
|
||||
pt_rin = (struct berin *) res_chain->DATA;
|
||||
|
||||
if ((pt_rin->DLY_REF == NULL) || (pt_rin->DLY_REF->DATA != pt_dly))
|
||||
pt_rin->DLY_REF = addchain (pt_rin->DLY_REF, pt_dly);
|
||||
|
||||
res_chain = res_chain->NEXT;
|
||||
}
|
||||
freechain (res_chain);
|
||||
pt_dly = pt_dly->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* process simple ouputs */
|
||||
/* check that the signal does not already belong to the */
|
||||
/* dependency list before adding it to the list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_out = pt_fig->BEOUT;
|
||||
while (pt_out != NULL)
|
||||
{
|
||||
res_chain = beh_expdepend (pt_fig, pt_out->ABL);
|
||||
while (res_chain != NULL)
|
||||
{
|
||||
pt_rin = (struct berin *) res_chain->DATA;
|
||||
|
||||
if ((pt_rin->OUT_REF == NULL) || (pt_rin->OUT_REF->DATA != pt_out))
|
||||
pt_rin->OUT_REF = addchain (pt_rin->OUT_REF, pt_out);
|
||||
|
||||
res_chain = res_chain->NEXT;
|
||||
}
|
||||
freechain (res_chain);
|
||||
pt_out = pt_out->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* process bussed ouputs. */
|
||||
/* check that the signal does not already belong to the */
|
||||
/* dependency list before adding it to the list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
res_chain = NULL;
|
||||
pt_bus = pt_fig->BEBUS;
|
||||
while (pt_bus != NULL)
|
||||
{
|
||||
pt_biabl = pt_bus->BIABL;
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
res_chain = append (res_chain, beh_expdepend (pt_fig,pt_biabl->VALABL));
|
||||
res_chain = append (res_chain, beh_expdepend (pt_fig,pt_biabl->CNDABL));
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
}
|
||||
|
||||
while (res_chain != NULL)
|
||||
{
|
||||
pt_rin = (struct berin *) res_chain->DATA;
|
||||
|
||||
if ((pt_rin->BUS_REF == NULL) || (pt_rin->BUS_REF->DATA != pt_bus))
|
||||
pt_rin->BUS_REF = addchain (pt_rin->BUS_REF, pt_bus);
|
||||
|
||||
res_chain = res_chain->NEXT;
|
||||
}
|
||||
freechain (res_chain);
|
||||
pt_bus = pt_bus->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* process bussed internal signals. */
|
||||
/* check that the signal does not already belong to the */
|
||||
/* dependency list before adding it to the list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
res_chain = NULL;
|
||||
pt_bux = pt_fig->BEBUX;
|
||||
while (pt_bux != NULL)
|
||||
{
|
||||
pt_biabl = pt_bux->BIABL;
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
res_chain = append (res_chain, beh_expdepend (pt_fig,pt_biabl->VALABL));
|
||||
res_chain = append (res_chain, beh_expdepend (pt_fig,pt_biabl->CNDABL));
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
}
|
||||
|
||||
while (res_chain != NULL)
|
||||
{
|
||||
pt_rin = (struct berin *) res_chain->DATA;
|
||||
|
||||
if ((pt_rin->BUX_REF == NULL) || (pt_rin->BUX_REF->DATA != pt_bux))
|
||||
pt_rin->BUX_REF = addchain (pt_rin->BUX_REF, pt_bux);
|
||||
|
||||
res_chain = res_chain->NEXT;
|
||||
}
|
||||
freechain (res_chain);
|
||||
pt_bux = pt_bux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* process internal registers. */
|
||||
/* check that the signal does not already belong to the */
|
||||
/* dependency list before adding it to the list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
res_chain = NULL;
|
||||
pt_reg = pt_fig->BEREG;
|
||||
while (pt_reg != NULL)
|
||||
{
|
||||
pt_biabl = pt_reg->BIABL;
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
res_chain = append (res_chain, beh_expdepend (pt_fig,pt_biabl->VALABL));
|
||||
res_chain = append (res_chain, beh_expdepend (pt_fig,pt_biabl->CNDABL));
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
}
|
||||
|
||||
while (res_chain != NULL)
|
||||
{
|
||||
pt_rin = (struct berin *) res_chain->DATA;
|
||||
|
||||
if ((pt_rin->REG_REF == NULL) || (pt_rin->REG_REF->DATA != pt_reg))
|
||||
pt_rin->REG_REF = addchain (pt_rin->REG_REF, pt_reg);
|
||||
|
||||
res_chain = res_chain->NEXT;
|
||||
}
|
||||
freechain (res_chain);
|
||||
pt_reg = pt_reg->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* process assert statements. */
|
||||
/* check that the statement does not already belong to the */
|
||||
/* dependency list before adding it to the list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
res_chain = NULL;
|
||||
pt_msg = pt_fig->BEMSG;
|
||||
while (pt_msg != NULL)
|
||||
{
|
||||
res_chain = beh_expdepend (pt_fig, pt_msg->ABL);
|
||||
while (res_chain != NULL)
|
||||
{
|
||||
pt_rin = (struct berin *) res_chain->DATA;
|
||||
|
||||
if ((pt_rin->MSG_REF == NULL) || (pt_rin->MSG_REF->DATA != pt_msg))
|
||||
pt_rin->MSG_REF = addchain (pt_rin->MSG_REF, pt_msg);
|
||||
|
||||
res_chain = res_chain->NEXT;
|
||||
}
|
||||
freechain (res_chain);
|
||||
pt_msg = pt_msg->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* release hash tables and lists that they contain */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (pt_fig->BERIN != NULL)
|
||||
{
|
||||
delht (rin_list);
|
||||
rin_list = NULL;
|
||||
}
|
||||
|
||||
pt_fig->FLAG |= BEH_FIG_DEPEND;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,139 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_dly2sta.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* content : high-level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_dly2sta */
|
||||
/* description : replace the DELAYED attribute by STABLE in the */
|
||||
/* expressions of the description */
|
||||
/* called func. : beh_rpldelayed */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void beh_dly2sta (pt_fig, mode)
|
||||
|
||||
struct befig *pt_fig;
|
||||
unsigned int mode ;
|
||||
|
||||
{
|
||||
struct beout *pt_out ;
|
||||
struct bebus *pt_bus ;
|
||||
struct beaux *pt_aux ;
|
||||
struct bebux *pt_bux ;
|
||||
struct bereg *pt_reg ;
|
||||
struct bemsg *pt_msg ;
|
||||
struct biabl *pt_biabl;
|
||||
|
||||
if ((pt_fig != NULL) && (pt_fig->ERRFLG == 0))
|
||||
{
|
||||
if ((mode & BEH_STA_REPLACE_OUT) != 0)
|
||||
{
|
||||
pt_out = pt_fig->BEOUT;
|
||||
while (pt_out != NULL)
|
||||
{
|
||||
pt_out->ABL = beh_rpldelayed (pt_out->ABL);
|
||||
pt_out = pt_out->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
if ((mode & BEH_STA_REPLACE_AUX) != 0)
|
||||
{
|
||||
pt_aux = pt_fig->BEAUX;
|
||||
while (pt_aux != NULL)
|
||||
{
|
||||
pt_aux->ABL = beh_rpldelayed (pt_aux->ABL);
|
||||
pt_aux = pt_aux->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
if ((mode & BEH_STA_REPLACE_MSG) != 0)
|
||||
{
|
||||
pt_msg = pt_fig->BEMSG;
|
||||
while (pt_msg != NULL)
|
||||
{
|
||||
pt_msg->ABL = beh_rpldelayed (pt_msg->ABL);
|
||||
pt_msg = pt_msg->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
if ((mode & BEH_STA_REPLACE_BUS) != 0)
|
||||
{
|
||||
pt_bus = pt_fig->BEBUS;
|
||||
while (pt_bus != NULL)
|
||||
{
|
||||
pt_biabl = pt_bus->BIABL;
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
pt_biabl->VALABL = beh_rpldelayed (pt_biabl->VALABL);
|
||||
pt_biabl->CNDABL = beh_rpldelayed (pt_biabl->CNDABL);
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
}
|
||||
pt_bus = pt_bus->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
if ((mode & BEH_STA_REPLACE_BUX) != 0)
|
||||
{
|
||||
pt_bux = pt_fig->BEBUX;
|
||||
while (pt_bux != NULL)
|
||||
{
|
||||
pt_biabl = pt_bux->BIABL;
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
pt_biabl->VALABL = beh_rpldelayed (pt_biabl->VALABL);
|
||||
pt_biabl->CNDABL = beh_rpldelayed (pt_biabl->CNDABL);
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
}
|
||||
pt_bux = pt_bux->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
if ((mode & BEH_STA_REPLACE_REG) != 0)
|
||||
{
|
||||
pt_reg = pt_fig->BEREG;
|
||||
while (pt_reg != NULL)
|
||||
{
|
||||
pt_biabl = pt_reg->BIABL;
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
pt_biabl->VALABL = beh_rpldelayed (pt_biabl->VALABL);
|
||||
pt_biabl->CNDABL = beh_rpldelayed (pt_biabl->CNDABL);
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
}
|
||||
pt_reg = pt_reg->NEXT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,197 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_freabl.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* description : high level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_freabl */
|
||||
/* description : free all ABLs in BEFIG structure */
|
||||
/* called func. : freeExpr */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void beh_freabl (ptr_befig)
|
||||
|
||||
struct befig *ptr_befig; /* pointer on current BEFIG */
|
||||
{
|
||||
struct beaux *ptr_beaux;
|
||||
struct bemsg *ptr_bemsg;
|
||||
struct beout *ptr_beout;
|
||||
struct bebus *ptr_bebus;
|
||||
struct biabl *ptr_biabl;
|
||||
struct bebux *ptr_bebux;
|
||||
struct bereg *ptr_bereg;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* check that the unit exists */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (ptr_befig != NULL)
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* release expression in simple internal signals' list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_beaux = ptr_befig->BEAUX;
|
||||
while (ptr_beaux != NULL)
|
||||
{
|
||||
if (ptr_beaux->ABL != NULL)
|
||||
{
|
||||
freeExpr (ptr_beaux->ABL);
|
||||
ptr_beaux->ABL = NULL;
|
||||
}
|
||||
ptr_beaux = ptr_beaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* release expression in delayed signals' list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_beaux = ptr_befig->BEDLY;
|
||||
while (ptr_beaux != NULL)
|
||||
{
|
||||
if (ptr_beaux->ABL != NULL)
|
||||
{
|
||||
freeExpr (ptr_beaux->ABL);
|
||||
ptr_beaux->ABL = NULL;
|
||||
}
|
||||
ptr_beaux = ptr_beaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* release expression in assertions' list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_bemsg = ptr_befig->BEMSG;
|
||||
while (ptr_bemsg != NULL)
|
||||
{
|
||||
if (ptr_bemsg->ABL != NULL)
|
||||
{
|
||||
freeExpr (ptr_bemsg->ABL);
|
||||
ptr_bemsg->ABL = NULL;
|
||||
}
|
||||
ptr_bemsg = ptr_bemsg->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* release expression in simple output ports' list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_beout = ptr_befig->BEOUT;
|
||||
while (ptr_beout != NULL)
|
||||
{
|
||||
if (ptr_beout->ABL != NULL)
|
||||
{
|
||||
freeExpr (ptr_beout->ABL);
|
||||
ptr_beout->ABL = NULL;
|
||||
}
|
||||
ptr_beout = ptr_beout->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* release expression in bussed output ports' list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_bebus = ptr_befig->BEBUS;
|
||||
while (ptr_bebus != NULL)
|
||||
{
|
||||
ptr_biabl = ptr_bebus->BIABL;
|
||||
while (ptr_biabl != NULL)
|
||||
{
|
||||
if (ptr_biabl->CNDABL != NULL)
|
||||
{
|
||||
freeExpr(ptr_biabl->CNDABL);
|
||||
ptr_biabl->CNDABL = NULL;
|
||||
}
|
||||
if (ptr_biabl->VALABL != NULL)
|
||||
{
|
||||
freeExpr(ptr_biabl->VALABL);
|
||||
ptr_biabl->VALABL = NULL;
|
||||
}
|
||||
ptr_biabl = ptr_biabl->NEXT;
|
||||
}
|
||||
ptr_bebus = ptr_bebus->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* release expression in bussed internal signals' list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_bebux = ptr_befig->BEBUX;
|
||||
while (ptr_bebux != NULL)
|
||||
{
|
||||
ptr_biabl = ptr_bebux->BIABL;
|
||||
while (ptr_biabl != NULL)
|
||||
{
|
||||
if (ptr_biabl->CNDABL != NULL)
|
||||
{
|
||||
freeExpr (ptr_biabl->CNDABL);
|
||||
ptr_biabl->CNDABL = NULL;
|
||||
}
|
||||
if (ptr_biabl->VALABL != NULL)
|
||||
{
|
||||
freeExpr (ptr_biabl->VALABL);
|
||||
ptr_biabl->VALABL = NULL;
|
||||
}
|
||||
|
||||
ptr_biabl = ptr_biabl->NEXT;
|
||||
}
|
||||
ptr_bebux = ptr_bebux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* release expression in internal registers' list */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_bereg = ptr_befig->BEREG;
|
||||
while (ptr_bereg != NULL)
|
||||
{
|
||||
ptr_biabl = ptr_bereg->BIABL;
|
||||
while (ptr_biabl != NULL)
|
||||
{
|
||||
if ( ptr_biabl->CNDABL != NULL )
|
||||
{
|
||||
freeExpr(ptr_biabl->CNDABL);
|
||||
ptr_biabl->CNDABL = NULL;
|
||||
}
|
||||
if ( ptr_biabl->VALABL != NULL )
|
||||
{
|
||||
freeExpr(ptr_biabl->VALABL);
|
||||
ptr_biabl->VALABL = NULL;
|
||||
}
|
||||
ptr_biabl = ptr_biabl->NEXT;
|
||||
}
|
||||
ptr_bereg = ptr_bereg->NEXT;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_gettu.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* description : high level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_gettimeunit */
|
||||
/* description : returns a string containg the time unit of the */
|
||||
/* description */
|
||||
/* called func. : none */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
char *beh_gettimeunit (pt_fig)
|
||||
|
||||
struct befig *pt_fig;
|
||||
|
||||
{
|
||||
char *unit_str = "";
|
||||
|
||||
switch (pt_fig->TIME_UNIT)
|
||||
{
|
||||
case BEH_TU__FS:
|
||||
unit_str = "fs"; break;
|
||||
case BEH_TU__PS:
|
||||
unit_str = "ps"; break;
|
||||
case BEH_TU__NS:
|
||||
unit_str = "ns"; break;
|
||||
case BEH_TU__US:
|
||||
unit_str = "us"; break;
|
||||
case BEH_TU__MS:
|
||||
unit_str = "ms"; break;
|
||||
default:
|
||||
beh_error (70, NULL);
|
||||
}
|
||||
|
||||
return (unit_str);
|
||||
}
|
|
@ -0,0 +1,157 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_indexbdd.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* description : high level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_indexbdd */
|
||||
/* description : initilize the index table for bdd */
|
||||
/* called func. : initializeCct, addInputCct */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void beh_indexbdd (pt_fig)
|
||||
|
||||
struct befig *pt_fig;
|
||||
|
||||
{
|
||||
struct berin *pt_rin = NULL;
|
||||
struct beout *pt_out = NULL;
|
||||
struct bebus *pt_bus = NULL;
|
||||
struct beaux *pt_aux = NULL;
|
||||
struct bebux *pt_bux = NULL;
|
||||
struct bereg *pt_reg = NULL;
|
||||
struct bemsg *pt_msg = NULL;
|
||||
struct biabl *pt_bia = NULL;
|
||||
unsigned int cnt_in = 0 ;
|
||||
unsigned int cnt_out = 0 ;
|
||||
|
||||
if ((pt_fig != NULL) && (pt_fig->CIRCUI == NULL))
|
||||
{
|
||||
/* ###--------------------------------------------------------### */
|
||||
/* count inputs */
|
||||
/* ###--------------------------------------------------------### */
|
||||
|
||||
pt_rin = pt_fig->BERIN;
|
||||
while (pt_rin != NULL)
|
||||
{
|
||||
cnt_in ++;
|
||||
pt_rin = pt_rin->NEXT;
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------### */
|
||||
/* count outputs */
|
||||
/* ###--------------------------------------------------------### */
|
||||
|
||||
pt_out = pt_fig->BEOUT;
|
||||
while (pt_out != NULL)
|
||||
{
|
||||
cnt_out ++;
|
||||
pt_out = pt_out->NEXT;
|
||||
}
|
||||
|
||||
pt_bus = pt_fig->BEBUS;
|
||||
while (pt_bus != NULL)
|
||||
{
|
||||
pt_bia = pt_bus->BIABL;
|
||||
while (pt_bia != NULL)
|
||||
{
|
||||
cnt_out += 2;
|
||||
pt_bia = pt_bia->NEXT;
|
||||
}
|
||||
pt_bus = pt_bus->NEXT;
|
||||
}
|
||||
|
||||
pt_aux = pt_fig->BEAUX;
|
||||
while (pt_aux != NULL)
|
||||
{
|
||||
cnt_out ++;
|
||||
pt_aux = pt_aux->NEXT;
|
||||
}
|
||||
|
||||
pt_aux = pt_fig->BEDLY;
|
||||
while (pt_aux != NULL)
|
||||
{
|
||||
cnt_out ++;
|
||||
pt_aux = pt_aux->NEXT;
|
||||
}
|
||||
|
||||
pt_bux = pt_fig->BEBUX;
|
||||
while (pt_bux != NULL)
|
||||
{
|
||||
pt_bia = pt_bux->BIABL;
|
||||
while (pt_bia != NULL)
|
||||
{
|
||||
cnt_out += 2;
|
||||
pt_bia = pt_bia->NEXT;
|
||||
}
|
||||
pt_bux = pt_bux->NEXT;
|
||||
}
|
||||
|
||||
pt_reg = pt_fig->BEREG;
|
||||
while (pt_reg != NULL)
|
||||
{
|
||||
pt_bia = pt_reg->BIABL;
|
||||
while (pt_bia != NULL)
|
||||
{
|
||||
cnt_out += 2;
|
||||
pt_bia = pt_bia->NEXT;
|
||||
}
|
||||
pt_reg = pt_reg->NEXT;
|
||||
}
|
||||
|
||||
pt_msg = pt_fig->BEMSG;
|
||||
while (pt_msg != NULL)
|
||||
{
|
||||
cnt_out ++;
|
||||
pt_msg = pt_msg->NEXT;
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------### */
|
||||
/* initialization */
|
||||
/* ###--------------------------------------------------------### */
|
||||
|
||||
pt_fig->CIRCUI = initializeCct (pt_fig->NAME, cnt_in*2, cnt_out);
|
||||
|
||||
/* ###--------------------------------------------------------### */
|
||||
/* define an index for each primary signal */
|
||||
/* ###--------------------------------------------------------### */
|
||||
|
||||
pt_rin = pt_fig->BERIN;
|
||||
while (pt_rin != NULL)
|
||||
{
|
||||
addInputCct (pt_fig->CIRCUI, pt_rin->NAME);
|
||||
pt_rin = pt_rin->NEXT;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,250 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_makabl.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : DUNOYER julien, Pirouz BAZARGAN SABET */
|
||||
/* description : high level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
static ht *HashTable = NULL;
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_dupabl */
|
||||
/* description : duplicate recursively an abl */
|
||||
/* called func. : ATOM,CDR,VALUE_ATOM,addchain */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct chain *beh_dupdabl (pt_abl1)
|
||||
|
||||
struct chain *pt_abl1;
|
||||
|
||||
{
|
||||
struct chain *op ;
|
||||
struct chain *pt_abl;
|
||||
|
||||
if (ATOM(pt_abl1))
|
||||
{
|
||||
return (createAtom(VALUE_ATOM(pt_abl1)));
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_abl = createExpr(OPER(pt_abl1));
|
||||
|
||||
while (pt_abl1 = CDR(pt_abl1))
|
||||
{
|
||||
pt_abl->NEXT=addchain(pt_abl->NEXT, (void *)beh_dupabl(CAR(pt_abl1)));
|
||||
}
|
||||
return pt_abl;
|
||||
}
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_makabl */
|
||||
/* description : make abl for each signal of a befig structure */
|
||||
/* called func. : beh_dupabl, addht, addhtitem, delht */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void beh_makabl (ptr_befig, node_flag)
|
||||
|
||||
struct befig *ptr_befig; /* befig containing expressions */
|
||||
char node_flag;
|
||||
|
||||
{
|
||||
struct beaux *ptr_beaux;
|
||||
struct beaux *ptr_bedly;
|
||||
struct bemsg *ptr_bemsg;
|
||||
struct beout *ptr_beout;
|
||||
struct bebus *ptr_bebus;
|
||||
struct bebux *ptr_bebux;
|
||||
struct bereg *ptr_bereg;
|
||||
struct biabl *ptr_biabl;
|
||||
struct binode *ptr_binode;
|
||||
|
||||
if (!(ptr_befig->TYPE & BEH_NODE_ABL))
|
||||
{
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a abl for each simple internal signal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_beaux = ptr_befig->BEAUX;
|
||||
while (ptr_beaux != NULL)
|
||||
{
|
||||
if (ptr_befig->TYPE & BEH_NODE_QUAD)
|
||||
((bequad_list *)(ptr_beaux->NODE))->ABL = beh_dupabl (ptr_beaux->ABL);
|
||||
else
|
||||
ptr_beaux->NODE= (pNode)beh_dupabl (ptr_beaux->ABL);
|
||||
|
||||
ptr_beaux = ptr_beaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a abl for each delayed internal signal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_bedly = ptr_befig->BEDLY;
|
||||
while (ptr_bedly != NULL)
|
||||
{
|
||||
if (ptr_befig->TYPE & BEH_NODE_QUAD)
|
||||
((bequad_list *)(ptr_bedly->NODE))->ABL = beh_dupabl (ptr_bedly->ABL);
|
||||
else
|
||||
ptr_bedly->NODE= (pNode)beh_dupabl(ptr_bedly->ABL);
|
||||
|
||||
ptr_bedly = ptr_bedly->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a abl for each assertion */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_bemsg = ptr_befig->BEMSG;
|
||||
while (ptr_bemsg != NULL)
|
||||
{
|
||||
if (ptr_befig->TYPE & BEH_NODE_QUAD)
|
||||
((bequad_list *)(ptr_bemsg->NODE))->ABL = beh_dupabl (ptr_bemsg->ABL);
|
||||
else
|
||||
ptr_bemsg->NODE=(pNode)beh_dupabl(ptr_bemsg->ABL);
|
||||
ptr_bemsg = ptr_bemsg->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a abl for each simple output */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_beout = ptr_befig->BEOUT;
|
||||
while (ptr_beout != NULL)
|
||||
{
|
||||
if (ptr_befig->TYPE & BEH_NODE_QUAD)
|
||||
((bequad_list *)(ptr_beout->NODE))->ABL = beh_dupabl (ptr_beout->ABL);
|
||||
else
|
||||
ptr_beout->NODE=(pNode) beh_dupabl (ptr_beout->ABL);
|
||||
|
||||
ptr_beout = ptr_beout->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a abl for each bussed output */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_bebus = ptr_befig->BEBUS;
|
||||
while (ptr_bebus != NULL)
|
||||
{
|
||||
ptr_biabl = ptr_bebus->BIABL;
|
||||
ptr_binode = ptr_bebus->BINODE;
|
||||
|
||||
while (ptr_biabl != NULL)
|
||||
{
|
||||
if (ptr_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(ptr_binode->CNDNODE))->ABL =
|
||||
beh_dupabl (ptr_biabl->CNDABL);
|
||||
((bequad_list *)(ptr_binode->VALNODE))->ABL =
|
||||
beh_dupabl (ptr_biabl->VALABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_binode->CNDNODE=(pNode)beh_dupabl(ptr_biabl->CNDABL);
|
||||
ptr_binode->VALNODE=(pNode)beh_dupabl(ptr_biabl->VALABL);
|
||||
}
|
||||
|
||||
ptr_biabl = ptr_biabl->NEXT;
|
||||
ptr_binode = ptr_binode->NEXT;
|
||||
}
|
||||
ptr_bebus = ptr_bebus->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a abl for each bussed internal signal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_bebux = ptr_befig->BEBUX;
|
||||
while (ptr_bebux != NULL)
|
||||
{
|
||||
ptr_biabl = ptr_bebux->BIABL;
|
||||
ptr_binode = ptr_bebux->BINODE;
|
||||
|
||||
while (ptr_biabl != NULL)
|
||||
{
|
||||
if (ptr_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(ptr_binode->CNDNODE))->ABL =
|
||||
beh_dupabl(ptr_biabl->CNDABL);
|
||||
((bequad_list *)(ptr_binode->VALNODE))->ABL =
|
||||
beh_dupabl(ptr_biabl->VALABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_binode->CNDNODE=(pNode)beh_dupabl(ptr_biabl->CNDABL);
|
||||
ptr_binode->VALNODE=(pNode)beh_dupabl(ptr_biabl->VALABL);
|
||||
}
|
||||
|
||||
ptr_biabl = ptr_biabl->NEXT;
|
||||
ptr_binode = ptr_binode->NEXT;
|
||||
}
|
||||
ptr_bebux = ptr_bebux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a abl for each internal register */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
ptr_bereg = ptr_befig->BEREG;
|
||||
while (ptr_bereg != NULL)
|
||||
{
|
||||
ptr_biabl = ptr_bereg->BIABL;
|
||||
ptr_binode = ptr_bereg->BINODE;
|
||||
|
||||
while (ptr_biabl != NULL)
|
||||
{
|
||||
if (ptr_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(ptr_binode->CNDNODE))->ABL =
|
||||
beh_dupabl(ptr_biabl->CNDABL);
|
||||
((bequad_list *)(ptr_binode->VALNODE))->ABL =
|
||||
beh_dupabl(ptr_biabl->VALABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
ptr_binode->CNDNODE=(pNode)beh_dupabl(ptr_biabl->CNDABL);
|
||||
ptr_binode->VALNODE=(pNode)beh_dupabl(ptr_biabl->VALABL);
|
||||
}
|
||||
|
||||
|
||||
ptr_biabl = ptr_biabl->NEXT;
|
||||
ptr_binode = ptr_binode->NEXT;
|
||||
}
|
||||
ptr_bereg = ptr_bereg->NEXT;
|
||||
}
|
||||
|
||||
ptr_befig->TYPE |= BEH_NODE_ABL;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,381 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_makbdd.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : VUONG H.N., L.A. TABUSSE, Pirouz BAZARGAN SABET */
|
||||
/* description : high level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* modifs : DUNOYER J., VUILLEMIN L. */
|
||||
/* - Refonte du pointeur NODE pour avoir BDD, GEX, */
|
||||
/* VARIABLE-LISTS, DERIVATE. */
|
||||
/* - Changement de l'interface de beh_makbdd, */
|
||||
/* Plus de trace_flg, plus de aux_flg, mais un node_flg. */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_abl2bdd */
|
||||
/* description : transform recursively an abl into a bdd */
|
||||
/* called func. : searchInputCct, createNodeTermBdd, addListBdd, */
|
||||
/* beh_abl2bdd , applyBdd , freechain , */
|
||||
/* beh_error , */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
static pNode beh_abl2bdd (pt_befig, expr)
|
||||
|
||||
struct befig *pt_befig; /* pointer on behavioural figure */
|
||||
struct chain *expr ; /* pointer abl expression */
|
||||
|
||||
{
|
||||
short oper ;
|
||||
struct node *pt_bdd = zero;
|
||||
struct chain *lstGbd = NULL;
|
||||
pCircuit ptr_circuit = pt_befig->CIRCUI;
|
||||
int err_flg = 0;
|
||||
int index ;
|
||||
char *atom ;
|
||||
char name [256] ;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* check that the expression exists */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (expr == NULL)
|
||||
err_flg = beh_error (2, NULL);
|
||||
else
|
||||
{
|
||||
|
||||
if (ATOM(expr))
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if the expression is a terminal (atom) */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
atom = (char *) VALUE_ATOM (expr);
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if the terminal is a primary signal create a single node */
|
||||
/* with its index and return */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((index = searchInputCct (ptr_circuit, atom)) != VIDE)
|
||||
pt_bdd = createNodeTermBdd (index);
|
||||
else
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* the terminal should be a const. '0', '1' or 'd' (don't care) */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((!strcmp(atom, "'0'")) || (!strcmp(atom, "'d'")))
|
||||
pt_bdd = zero;
|
||||
else
|
||||
{
|
||||
if (!strcmp(atom, "'1'"))
|
||||
pt_bdd = one;
|
||||
else
|
||||
{
|
||||
err_flg = beh_error (3, atom);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if the expression is not a terminal (is a complex expr.) */
|
||||
/* get the operator, create the bdd of each operand then, */
|
||||
/* combine operands applying the operator */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
lstGbd = NULL;
|
||||
|
||||
if ((oper = OPER(expr)) != STABLE)
|
||||
{
|
||||
while ((expr = CDR(expr)) != NULL)
|
||||
lstGbd = addListBdd (lstGbd, beh_abl2bdd (pt_befig, CAR(expr)));
|
||||
|
||||
pt_bdd = applyBdd (oper, lstGbd);
|
||||
freechain (lstGbd);
|
||||
}
|
||||
else
|
||||
{
|
||||
expr = CDR(expr);
|
||||
if (!ATOM(expr))
|
||||
err_flg = beh_error (4, NULL);
|
||||
else
|
||||
{
|
||||
atom = (char *)VALUE_ATOM (CAR(expr));
|
||||
|
||||
if ((index = searchInputCct (ptr_circuit, atom)) != VIDE)
|
||||
{
|
||||
lstGbd = addListBdd (lstGbd, createNodeTermBdd (index));
|
||||
sprintf (name, "%s'delayed", atom);
|
||||
atom = namealloc (name);
|
||||
if ((index = searchInputCct (ptr_circuit, atom)) != VIDE)
|
||||
{
|
||||
lstGbd = addListBdd (lstGbd, createNodeTermBdd (index));
|
||||
pt_bdd = applyBdd (NXOR, lstGbd);
|
||||
}
|
||||
else
|
||||
err_flg = beh_error (3, atom);
|
||||
freechain (lstGbd);
|
||||
}
|
||||
else
|
||||
err_flg = beh_error (3, atom);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (err_flg != 0)
|
||||
pt_befig->ERRFLG = 1;
|
||||
|
||||
return (pt_bdd);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_mbddtot */
|
||||
/* description : make bdds for all primary signals: simple and bussed */
|
||||
/* outputs, simple and bussed internal signals and */
|
||||
/* registers */
|
||||
/* called func. : beh_abl2bdd, addchain , delchain */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
static void beh_mbddtot (pt_befig)
|
||||
|
||||
struct befig *pt_befig; /* pointer on current BEFIG */
|
||||
|
||||
{
|
||||
struct beaux *pt_beaux;
|
||||
struct bemsg *pt_bemsg;
|
||||
struct beout *pt_beout;
|
||||
struct bebus *pt_bebus;
|
||||
struct bebux *pt_bebux;
|
||||
struct bereg *pt_bereg;
|
||||
struct biabl *pt_biabl;
|
||||
struct binode *pt_binode;
|
||||
struct node *pt_cndbdd;
|
||||
struct node *pt_valbdd;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a bdd for each simple internal signal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beaux = pt_befig->BEAUX;
|
||||
|
||||
while (pt_beaux != NULL)
|
||||
{
|
||||
pt_valbdd = beh_abl2bdd (pt_befig, pt_beaux->ABL);
|
||||
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
((struct bequad *)(pt_beaux->NODE))->BDD = pt_valbdd;
|
||||
else
|
||||
pt_beaux->NODE = pt_valbdd;
|
||||
|
||||
pt_beaux = pt_beaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a bdd for each delayed internal signal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beaux = pt_befig->BEDLY;
|
||||
while (pt_beaux != NULL)
|
||||
{
|
||||
pt_valbdd = beh_abl2bdd (pt_befig, pt_beaux->ABL);
|
||||
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
((struct bequad *)(pt_beaux->NODE))->BDD = pt_valbdd;
|
||||
else
|
||||
pt_beaux->NODE = pt_valbdd;
|
||||
pt_beaux = pt_beaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a bdd for each assertion */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bemsg = pt_befig->BEMSG;
|
||||
while (pt_bemsg != NULL)
|
||||
{
|
||||
pt_valbdd = beh_abl2bdd (pt_befig, pt_bemsg->ABL);
|
||||
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
((bequad_list *)(pt_bemsg->NODE))->BDD = pt_valbdd;
|
||||
else
|
||||
pt_bemsg->NODE = pt_valbdd;
|
||||
|
||||
pt_bemsg = pt_bemsg->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a bdd for each simple output port */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beout = pt_befig->BEOUT;
|
||||
while (pt_beout != NULL)
|
||||
{
|
||||
pt_valbdd = beh_abl2bdd (pt_befig, pt_beout->ABL);
|
||||
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
((bequad_list *)(pt_beout->NODE))->BDD = pt_valbdd;
|
||||
else
|
||||
pt_beout->NODE = pt_valbdd;
|
||||
|
||||
pt_beout = pt_beout->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a bdd for each bussed output port */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bebus = pt_befig->BEBUS;
|
||||
while (pt_bebus != NULL)
|
||||
{
|
||||
pt_biabl = pt_bebus->BIABL;
|
||||
pt_binode = pt_bebus->BINODE;
|
||||
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
pt_cndbdd = beh_abl2bdd (pt_befig, pt_biabl->CNDABL);
|
||||
pt_valbdd = beh_abl2bdd (pt_befig, pt_biabl->VALABL);
|
||||
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(pt_binode->CNDNODE))->BDD = pt_cndbdd;
|
||||
((bequad_list *)(pt_binode->VALNODE))->BDD = pt_valbdd;
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_binode->CNDNODE = pt_cndbdd;
|
||||
pt_binode->VALNODE = pt_valbdd;
|
||||
}
|
||||
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
pt_binode = pt_binode->NEXT;
|
||||
}
|
||||
|
||||
pt_bebus = pt_bebus->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a bdd for each bussed internal signal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bebux = pt_befig->BEBUX;
|
||||
while (pt_bebux != NULL)
|
||||
{
|
||||
pt_biabl = pt_bebux->BIABL;
|
||||
pt_binode = pt_bebux->BINODE;
|
||||
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
pt_cndbdd = beh_abl2bdd (pt_befig, pt_biabl->CNDABL);
|
||||
pt_valbdd = beh_abl2bdd (pt_befig, pt_biabl->VALABL);
|
||||
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(pt_binode->CNDNODE))->BDD = pt_cndbdd;
|
||||
((bequad_list *)(pt_binode->VALNODE))->BDD = pt_valbdd;
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_binode->CNDNODE = pt_cndbdd;
|
||||
pt_binode->VALNODE = pt_valbdd;
|
||||
}
|
||||
|
||||
pt_biabl = pt_biabl->NEXT ;
|
||||
pt_binode = pt_binode->NEXT;
|
||||
}
|
||||
pt_bebux = pt_bebux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a bdd for each internal register */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bereg = pt_befig->BEREG;
|
||||
while (pt_bereg != NULL)
|
||||
{
|
||||
pt_biabl = pt_bereg->BIABL;
|
||||
pt_binode = pt_bereg->BINODE;
|
||||
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(pt_binode->CNDNODE))->BDD =
|
||||
beh_abl2bdd (pt_befig, pt_biabl->CNDABL);
|
||||
((bequad_list *)(pt_binode->VALNODE))->BDD =
|
||||
beh_abl2bdd (pt_befig, pt_biabl->VALABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_binode->CNDNODE = beh_abl2bdd (pt_befig, pt_biabl->CNDABL);
|
||||
pt_binode->VALNODE = beh_abl2bdd (pt_befig, pt_biabl->VALABL);
|
||||
}
|
||||
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
pt_binode = pt_binode->NEXT;
|
||||
}
|
||||
pt_bereg = pt_bereg->NEXT;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_makbdd */
|
||||
/* description : translate all abls into bdds */
|
||||
/* called func. : beh_indexbdd, beh_mbddtot */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void beh_makbdd (pt_befig)
|
||||
|
||||
struct befig *pt_befig;
|
||||
|
||||
{
|
||||
int err_flg = 0;
|
||||
|
||||
if (!(pt_befig->TYPE & BEH_NODE_BDD));
|
||||
{
|
||||
beh_indexbdd (pt_befig);
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* change ABLs to BDDs */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
beh_mbddtot (pt_befig);
|
||||
pt_befig->TYPE |= BEH_NODE_BDD;
|
||||
|
||||
if (err_flg != 0)
|
||||
pt_befig->ERRFLG = 1;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,239 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_makderiv.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : Laurent VUILLEMIN */
|
||||
/* description : high level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_derivSigByVar */
|
||||
/* description : derivate a BDD by a variable */
|
||||
/* called func. : constraintBdd, applyBinBdd */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
pNode beh_derivSigByVar (sigbdd, index_var)
|
||||
|
||||
pNode sigbdd ;
|
||||
short index_var;
|
||||
|
||||
{
|
||||
pNode high ;
|
||||
pNode low ;
|
||||
pNode varbdd;
|
||||
|
||||
varbdd = createNodeTermBdd (index_var);
|
||||
|
||||
high = constraintBdd (sigbdd, varbdd);
|
||||
low = constraintBdd (sigbdd, notBdd(varbdd));
|
||||
|
||||
return (applyBinBdd (XOR,high,low));
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_derivSigByAllVar */
|
||||
/* description : derivate a BDD by all variables */
|
||||
/* called func. : derivSigByVar, supportIndexBdd */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct beder *beh_derivSigByAllVar (pt_bequad)
|
||||
|
||||
struct bequad *pt_bequad;
|
||||
|
||||
{
|
||||
pNode pt_node ;
|
||||
struct chain *pt_varidx ;
|
||||
struct chain *suppor ;
|
||||
struct beder *list_derive = NULL;
|
||||
|
||||
pt_varidx = pt_bequad->VARLIST;
|
||||
while (pt_varidx != NULL)
|
||||
{
|
||||
pt_node = beh_derivSigByVar (pt_bequad->BDD, pt_varidx->DATA);
|
||||
list_derive = beh_addbeder (list_derive , pt_node, pt_varidx->DATA);
|
||||
|
||||
pt_varidx = pt_varidx->NEXT;
|
||||
}
|
||||
|
||||
return (list_derive);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_makderiv */
|
||||
/* description : build the list of partial derivate for all signals */
|
||||
/* called func. : derivSigByAllVar */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void beh_makderiv (pt_befig)
|
||||
|
||||
struct befig *pt_befig;
|
||||
|
||||
{
|
||||
struct beaux *pt_beaux;
|
||||
struct beout *pt_beout;
|
||||
struct bebus *pt_bebus;
|
||||
struct bebux *pt_bebux;
|
||||
struct bereg *pt_bereg;
|
||||
struct bemsg *pt_bemsg;
|
||||
struct binode *pt_binod;
|
||||
struct chain *list_der;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* check that the BEFIG is ready to support the derivation */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((pt_befig->TYPE & BEH_NODE_QUAD) == 0)
|
||||
beh_error (6, NULL);
|
||||
|
||||
else
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* simple output ports */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beout = pt_befig->BEOUT;
|
||||
while (pt_beout != NULL)
|
||||
{
|
||||
((struct bequad *) (pt_beout->NODE))->DERIVATE =
|
||||
beh_derivSigByAllVar ((struct bequad *) (pt_beout->NODE));
|
||||
|
||||
pt_beout = pt_beout->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* bussed output ports */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bebus = pt_befig->BEBUS;
|
||||
while (pt_bebus != NULL)
|
||||
{
|
||||
pt_binod = pt_bebus->BINODE;
|
||||
while (pt_binod != NULL)
|
||||
{
|
||||
((struct bequad *) (pt_binod->CNDNODE))->DERIVATE =
|
||||
beh_derivSigByAllVar ((struct bequad *) (pt_binod->CNDNODE));
|
||||
|
||||
((struct bequad *) (pt_binod->VALNODE))->DERIVATE =
|
||||
beh_derivSigByAllVar ((struct bequad *) (pt_binod->VALNODE));
|
||||
|
||||
pt_binod = pt_binod->NEXT;
|
||||
}
|
||||
|
||||
pt_bebus = pt_bebus->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* bussed internal signals */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bebux = pt_befig->BEBUX;
|
||||
while (pt_bebux != NULL)
|
||||
{
|
||||
pt_binod = pt_bebux->BINODE;
|
||||
while (pt_binod != NULL)
|
||||
{
|
||||
((struct bequad *) (pt_binod->CNDNODE))->DERIVATE =
|
||||
beh_derivSigByAllVar ((struct bequad *) (pt_binod->CNDNODE));
|
||||
|
||||
((struct bequad *) (pt_binod->VALNODE))->DERIVATE =
|
||||
beh_derivSigByAllVar ((struct bequad *) (pt_binod->VALNODE));
|
||||
|
||||
pt_binod = pt_binod->NEXT;
|
||||
}
|
||||
pt_bebux = pt_bebux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* internal registers */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bereg = pt_befig->BEREG;
|
||||
while (pt_bereg != NULL)
|
||||
{
|
||||
pt_binod = pt_bereg->BINODE;
|
||||
while (pt_binod != NULL)
|
||||
{
|
||||
((struct bequad *) (pt_binod->CNDNODE))->DERIVATE =
|
||||
beh_derivSigByAllVar ((struct bequad *) (pt_binod->CNDNODE));
|
||||
|
||||
((struct bequad *) (pt_binod->VALNODE))->DERIVATE =
|
||||
beh_derivSigByAllVar ((struct bequad *) (pt_binod->VALNODE));
|
||||
|
||||
pt_binod = pt_binod->NEXT;
|
||||
}
|
||||
pt_bereg = pt_bereg->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* internal simple signals */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beaux = pt_befig->BEAUX;
|
||||
while (pt_beaux != NULL)
|
||||
{
|
||||
((struct bequad *) (pt_beaux->NODE))->DERIVATE =
|
||||
beh_derivSigByAllVar ((struct bequad *) ( pt_beaux->NODE));
|
||||
|
||||
pt_beaux = pt_beaux->NEXT;
|
||||
}
|
||||
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* delayed internal signals */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beaux = pt_befig->BEDLY;
|
||||
while (pt_beaux != NULL)
|
||||
{
|
||||
((struct bequad *) (pt_beaux->NODE))->DERIVATE =
|
||||
beh_derivSigByAllVar ((struct bequad *) (pt_beaux->NODE));
|
||||
|
||||
pt_beaux = pt_beaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* assertions */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bemsg = pt_befig->BEMSG;
|
||||
while (pt_bemsg != NULL)
|
||||
{
|
||||
((struct bequad *) (pt_bemsg->NODE))->DERIVATE =
|
||||
beh_derivSigByAllVar ((struct bequad *) (pt_bemsg->NODE));
|
||||
|
||||
pt_bemsg = pt_bemsg->NEXT;
|
||||
}
|
||||
|
||||
pt_befig->TYPE=pt_befig->TYPE | BEH_NODE_DERIVATE;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,803 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_makgex.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : Xavier Picat, Pirouz BAZARGAN SABET */
|
||||
/* description : high level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
#define BEH_GEXBLK 256
|
||||
|
||||
static struct begex *BEH_GEXHED = NULL;
|
||||
static ht *HashTable = NULL;
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_addgexex */
|
||||
/* description : create a GEX expression */
|
||||
/* called func. : mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
static struct begex *beh_addgexex (oper, type)
|
||||
|
||||
unsigned int oper;
|
||||
unsigned short type;
|
||||
|
||||
{
|
||||
struct begex *ptgex;
|
||||
int i;
|
||||
|
||||
if (BEH_GEXHED == NULL)
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if there is no more structure allocate a new block */
|
||||
/* (use OPERAND field to chain structures in a list) */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
BEH_GEXHED = mbkalloc (sizeof (struct begex) * BEH_GEXBLK);
|
||||
|
||||
ptgex = BEH_GEXHED;
|
||||
for (i=1 ; i<BEH_GEXBLK ; i++)
|
||||
{
|
||||
ptgex->OPERAND = (struct chain *) (ptgex + 1);
|
||||
ptgex++;
|
||||
}
|
||||
ptgex->OPERAND = NULL;
|
||||
}
|
||||
|
||||
ptgex = BEH_GEXHED;
|
||||
BEH_GEXHED = (struct begex *) BEH_GEXHED->OPERAND;
|
||||
|
||||
ptgex->TERM = oper;
|
||||
ptgex->TYPE = type;
|
||||
ptgex->OPERAND = NULL;
|
||||
|
||||
return (ptgex);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_addterm */
|
||||
/* description : create a GEX for a terminal. For each terminal there */
|
||||
/* is a unique GEX */
|
||||
/* called func. : beh_addgexex, mbkalloc, addchain */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
static struct begex *beh_addterm (oper)
|
||||
|
||||
unsigned int oper;
|
||||
|
||||
{
|
||||
static struct chain *term_tab = NULL;
|
||||
static unsigned int bank_nbr = 0;
|
||||
struct chain *tmp_chn = NULL;
|
||||
struct begex *locl_tab;
|
||||
unsigned int bank;
|
||||
struct begex *resgex;
|
||||
int i;
|
||||
int j;
|
||||
|
||||
bank = oper / 64;
|
||||
if (bank >= bank_nbr)
|
||||
{
|
||||
for (i=bank_nbr ; i<=bank ; i++)
|
||||
{
|
||||
locl_tab = (struct begex *) mbkalloc (64 * sizeof (struct begex));
|
||||
|
||||
for (j=0 ; j<64 ; j++)
|
||||
{
|
||||
(locl_tab [j]).TERM = j + (i * 64);
|
||||
(locl_tab [j]).TYPE = 0;
|
||||
(locl_tab [j]).OPERAND = NULL;
|
||||
}
|
||||
|
||||
if (term_tab == NULL)
|
||||
term_tab = addchain (NULL, locl_tab);
|
||||
else
|
||||
{
|
||||
tmp_chn = term_tab;
|
||||
while (tmp_chn->NEXT != NULL)
|
||||
tmp_chn = tmp_chn->NEXT;
|
||||
tmp_chn->NEXT = addchain (NULL, locl_tab);
|
||||
}
|
||||
}
|
||||
|
||||
bank_nbr = bank + 1;
|
||||
}
|
||||
|
||||
tmp_chn = term_tab;
|
||||
for (i=0 ; i<bank ; i++)
|
||||
tmp_chn = tmp_chn->NEXT;
|
||||
|
||||
locl_tab = (struct begex *) tmp_chn->DATA;
|
||||
|
||||
resgex = & (locl_tab [(unsigned int) (oper % 64)]);
|
||||
|
||||
return (resgex);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : mad_fregex */
|
||||
/* description : release a GEX expression (excluding terminals) */
|
||||
/* called func. : none */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void *mad_fregex (ptgex, mode)
|
||||
|
||||
struct begex *ptgex;
|
||||
char mode ;
|
||||
|
||||
{
|
||||
struct begex *tmpgex;
|
||||
struct chain *tmpchn;
|
||||
|
||||
if (ptgex != NULL)
|
||||
{
|
||||
if ((tmpchn = ptgex->OPERAND) != NULL)
|
||||
{
|
||||
if (mode == 'a')
|
||||
{
|
||||
while (tmpchn != NULL)
|
||||
{
|
||||
mad_fregex ((struct begex *) tmpchn->DATA, 'a');
|
||||
tmpchn = tmpchn->NEXT;
|
||||
}
|
||||
freechain (ptgex->OPERAND);
|
||||
}
|
||||
|
||||
ptgex->OPERAND = (struct chain *) BEH_GEXHED;
|
||||
BEH_GEXHED = ptgex;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : flatgex */
|
||||
/* description : flatten the top level of a complex expression */
|
||||
/* called func. : mbkalloc */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
static struct begex *flatgex (gexpnt)
|
||||
|
||||
struct begex *gexpnt;
|
||||
|
||||
{
|
||||
int top_operator;
|
||||
int operator;
|
||||
struct chain *tmp_chn;
|
||||
struct chain *cur_oper;
|
||||
struct chain *oper_list = NULL;
|
||||
struct begex *operand;
|
||||
struct begex *resgex = gexpnt;
|
||||
char flatflag = 0;
|
||||
|
||||
if ((gexpnt != NULL) && (gexpnt->OPERAND != NULL))
|
||||
{
|
||||
cur_oper = gexpnt->OPERAND;
|
||||
|
||||
while (cur_oper != NULL)
|
||||
{
|
||||
flatflag = 0;
|
||||
top_operator = gexpnt->TERM;
|
||||
operand = (struct begex *) cur_oper->DATA;
|
||||
|
||||
if (operand->OPERAND != NULL)
|
||||
{
|
||||
operator = operand->TERM;
|
||||
switch (operator)
|
||||
{
|
||||
case OR :
|
||||
if (top_operator == NOT)
|
||||
{
|
||||
gexpnt->TERM = NOR;
|
||||
flatflag = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((top_operator == OR) || (top_operator == NOR))
|
||||
flatflag = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case AND :
|
||||
if (top_operator == NOT)
|
||||
{
|
||||
gexpnt->TERM = NAND;
|
||||
flatflag = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((top_operator == AND) || (top_operator == NAND))
|
||||
flatflag = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case XOR :
|
||||
if (top_operator == NOT)
|
||||
{
|
||||
gexpnt->TERM = NXOR;
|
||||
flatflag = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((top_operator == XOR) || (top_operator == NXOR))
|
||||
flatflag = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case NXOR :
|
||||
if (top_operator == XOR)
|
||||
{
|
||||
gexpnt->TERM = NXOR;
|
||||
flatflag = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((top_operator == NXOR) || (top_operator == NOT))
|
||||
{
|
||||
gexpnt->TERM = XOR;
|
||||
flatflag = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (flatflag == 1)
|
||||
{
|
||||
tmp_chn = operand->OPERAND;
|
||||
while (tmp_chn->NEXT != NULL)
|
||||
tmp_chn = tmp_chn->NEXT;
|
||||
|
||||
tmp_chn->NEXT = oper_list;
|
||||
oper_list = operand->OPERAND;
|
||||
mad_fregex (operand, 'p');
|
||||
}
|
||||
else
|
||||
oper_list = addchain (oper_list, operand);
|
||||
|
||||
cur_oper = cur_oper->NEXT;
|
||||
}
|
||||
|
||||
freechain (gexpnt->OPERAND);
|
||||
|
||||
gexpnt->OPERAND = oper_list;
|
||||
resgex = gexpnt;
|
||||
}
|
||||
|
||||
return (resgex);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : rmvconst */
|
||||
/* description : remove constantes that appear at the top level of a */
|
||||
/* espression */
|
||||
/* called func. : addchain, freechain, mad_fregex */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
static struct begex *rmvconst (gexpnt)
|
||||
|
||||
struct begex *gexpnt;
|
||||
|
||||
{
|
||||
struct begex *resgex;
|
||||
struct begex *operand;
|
||||
struct begex *gex_zero;
|
||||
struct begex *gex_one ;
|
||||
struct chain *new_oper = NULL;
|
||||
struct chain *cur_oper;
|
||||
struct chain *tmp_chn = NULL;
|
||||
int operator;
|
||||
char freflag = 0;
|
||||
|
||||
resgex = gexpnt;
|
||||
gex_zero = beh_addterm (0);
|
||||
gex_one = beh_addterm (1);
|
||||
|
||||
if (gexpnt != NULL)
|
||||
{
|
||||
if (gexpnt->OPERAND != NULL)
|
||||
{
|
||||
cur_oper = gexpnt->OPERAND;
|
||||
|
||||
while (cur_oper != NULL)
|
||||
{
|
||||
operator = gexpnt->TERM;
|
||||
operand = (struct begex *) cur_oper->DATA;
|
||||
freflag = 0;
|
||||
|
||||
if (operand == gex_zero)
|
||||
{
|
||||
switch (operator)
|
||||
{
|
||||
case AND :
|
||||
freflag = 2; resgex = gex_zero; break;
|
||||
case NAND :
|
||||
case NOT :
|
||||
freflag = 2; resgex = gex_one ; break;
|
||||
case OR :
|
||||
case XOR :
|
||||
case NOR :
|
||||
case NXOR :
|
||||
freflag = 1; break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (operand == gex_one)
|
||||
{
|
||||
switch (operator)
|
||||
{
|
||||
case OR :
|
||||
freflag = 2; resgex = gex_one ; break;
|
||||
case NOR :
|
||||
case NOT :
|
||||
freflag = 2; resgex = gex_zero; break;
|
||||
case NAND :
|
||||
case AND :
|
||||
freflag = 1; break;
|
||||
break;
|
||||
case XOR :
|
||||
gexpnt->TERM = NXOR; freflag = 1; break;
|
||||
break;
|
||||
case NXOR :
|
||||
gexpnt->TERM = XOR ; freflag = 1; break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (freflag == 2)
|
||||
{
|
||||
mad_fregex (gexpnt);
|
||||
freechain (new_oper);
|
||||
gexpnt = NULL;
|
||||
new_oper = NULL;
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (freflag == 0)
|
||||
new_oper = addchain (new_oper, cur_oper->DATA);
|
||||
cur_oper = cur_oper->NEXT;
|
||||
}
|
||||
}
|
||||
if (gexpnt != NULL)
|
||||
{
|
||||
operator = gexpnt->TERM;
|
||||
if (new_oper == NULL)
|
||||
{
|
||||
switch (operator)
|
||||
{
|
||||
case AND :
|
||||
case NOR :
|
||||
case NXOR :
|
||||
resgex = gex_one ;
|
||||
break;
|
||||
case OR :
|
||||
case XOR :
|
||||
case NAND :
|
||||
resgex = gex_zero;
|
||||
break;
|
||||
}
|
||||
mad_fregex (gexpnt);
|
||||
gexpnt = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (new_oper->NEXT == NULL)
|
||||
{
|
||||
switch (operator)
|
||||
{
|
||||
case AND :
|
||||
case OR :
|
||||
case XOR :
|
||||
resgex = (struct begex *) new_oper->DATA;
|
||||
freechain (new_oper);
|
||||
gexpnt = NULL;
|
||||
new_oper = NULL;
|
||||
break;
|
||||
case NOR :
|
||||
case NXOR :
|
||||
case NAND :
|
||||
case NOT :
|
||||
tmp_chn = gexpnt->OPERAND;
|
||||
gexpnt->OPERAND = new_oper;
|
||||
gexpnt->TERM = NOT;
|
||||
freechain (tmp_chn);
|
||||
tmp_chn = NULL;
|
||||
resgex = gexpnt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (resgex);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_abl2gex */
|
||||
/* description : transform recursively abl in gex */
|
||||
/* called func. : beh_toolbug, beh_abl2gex, gethtitem beh_addgexex, */
|
||||
/* namealloc , addchain */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
static struct begex *beh_abl2gex (ptr_befig, expr)
|
||||
|
||||
struct befig *ptr_befig;
|
||||
struct chain *expr;
|
||||
|
||||
{
|
||||
struct chain *my_operand;
|
||||
|
||||
char delayed [128];
|
||||
static char *str_zero = NULL;
|
||||
static char *str_one = NULL;
|
||||
struct begex *resgex ;
|
||||
struct begex *gex_elt ;
|
||||
struct chain *oper_list ;
|
||||
struct chain *operand ;
|
||||
char *term ;
|
||||
long term_idx ;
|
||||
long operator ;
|
||||
|
||||
if (expr == NULL)
|
||||
beh_toolbug (103, "beh_abl2gex", NULL, 0);
|
||||
|
||||
if (str_zero == NULL)
|
||||
{
|
||||
str_zero = namealloc ("'0'");
|
||||
str_one = namealloc ("'1'");
|
||||
}
|
||||
|
||||
if (expr->NEXT != NULL)
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if the expression is not a terminal ... */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
operator = (long) ((struct chain *)expr->DATA)->DATA;
|
||||
switch (operator)
|
||||
{
|
||||
case STABLE:
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* translate signal'stable into a logical expression. */
|
||||
/* notice : */
|
||||
/* signal'stable = not (signal xor signal'delayed) */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
resgex = beh_addgexex (NXOR, 0);
|
||||
|
||||
operand = (struct chain *) expr->NEXT->DATA;
|
||||
|
||||
if (operand->NEXT != NULL)
|
||||
beh_toolbug (100, "beh_abl2gex", NULL, 0);
|
||||
else
|
||||
{
|
||||
term = (char *) operand->DATA;
|
||||
term_idx = gethtitem (HashTable, term);
|
||||
|
||||
if (term_idx == EMPTYHT)
|
||||
beh_toolbug (101, "beh_abl2gex", term, 0);
|
||||
else
|
||||
{
|
||||
gex_elt = beh_addterm (term_idx);
|
||||
|
||||
resgex->OPERAND = addchain (NULL, gex_elt);
|
||||
|
||||
sprintf (delayed, "%s'delayed", term);
|
||||
term = namealloc (delayed);
|
||||
term_idx = gethtitem (HashTable, term);
|
||||
|
||||
if (term_idx == EMPTYHT)
|
||||
beh_toolbug (101, "beh_abl2gex", term, 0);
|
||||
else
|
||||
{
|
||||
gex_elt = beh_addterm (term_idx);
|
||||
resgex->OPERAND->NEXT = addchain (NULL, gex_elt);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case OR:
|
||||
case AND:
|
||||
case XOR:
|
||||
case NOR:
|
||||
case NAND:
|
||||
case NXOR:
|
||||
case NOT:
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* for other operator make the top level, then, translate */
|
||||
/* each operand */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
resgex = beh_addgexex (operator, 0);
|
||||
oper_list = expr->NEXT;
|
||||
while (oper_list != NULL)
|
||||
{
|
||||
gex_elt = beh_abl2gex (ptr_befig, oper_list->DATA);
|
||||
resgex->OPERAND = addchain (resgex->OPERAND, gex_elt);
|
||||
oper_list = oper_list->NEXT;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
beh_toolbug (102, "beh_abl2gex", NULL, operator);
|
||||
}
|
||||
|
||||
resgex = rmvconst (resgex);
|
||||
resgex = flatgex (resgex);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if the expression is a terminal create a terminal gex */
|
||||
/* with the index correspnding to the terminal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
term = (char *) expr->DATA;
|
||||
term_idx = gethtitem (HashTable, term);
|
||||
if (term_idx == EMPTYHT)
|
||||
{
|
||||
if (expr->DATA == str_one)
|
||||
resgex = beh_addterm (1);
|
||||
else
|
||||
{
|
||||
if (expr->DATA == str_zero)
|
||||
resgex = beh_addterm (0);
|
||||
else
|
||||
beh_toolbug (101, "beh_abl2gex", term, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
resgex = beh_addterm (term_idx);
|
||||
|
||||
}
|
||||
|
||||
return (resgex);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_makgex */
|
||||
/* description : make gex for each signal of a befig structure */
|
||||
/* called func. : beh_abl2gex, addht, addhtitem, delht */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void beh_makgex (pt_befig)
|
||||
|
||||
struct befig *pt_befig; /* befig containing expressions */
|
||||
|
||||
{
|
||||
struct beaux *pt_beaux ;
|
||||
struct bemsg *pt_bemsg ;
|
||||
struct beout *pt_beout ;
|
||||
struct bebus *pt_bebus ;
|
||||
struct bebux *pt_bebux ;
|
||||
struct bereg *pt_bereg ;
|
||||
struct biabl *pt_biabl ;
|
||||
struct binode *pt_binode;
|
||||
struct berin *pt_rin ;
|
||||
unsigned int count ;
|
||||
|
||||
if (!(pt_befig->TYPE & BEH_NODE_GEX));
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* initialize hash table */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
count = 1;
|
||||
pt_rin = pt_befig->BERIN;
|
||||
|
||||
while (pt_rin != NULL)
|
||||
{
|
||||
count ++;
|
||||
pt_rin = pt_rin->NEXT;
|
||||
}
|
||||
|
||||
HashTable = addht (count);
|
||||
|
||||
count = 2;
|
||||
pt_rin = pt_befig->BERIN;
|
||||
|
||||
while (pt_rin != NULL)
|
||||
{
|
||||
addhtitem (HashTable, pt_rin->NAME, count);
|
||||
count ++;
|
||||
pt_rin = pt_rin->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a gex for each simple internal signal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beaux = pt_befig->BEAUX;
|
||||
while (pt_beaux != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
((bequad_list *)(pt_beaux->NODE))->GEX =
|
||||
beh_abl2gex (pt_befig, pt_beaux->ABL);
|
||||
else
|
||||
pt_beaux->NODE= (pNode)beh_abl2gex (pt_befig, pt_beaux->ABL);
|
||||
|
||||
pt_beaux = pt_beaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a gex for each delayed internal signal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beaux = pt_befig->BEDLY;
|
||||
while (pt_beaux != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
((bequad_list *)(pt_beaux->NODE))->GEX =
|
||||
beh_abl2gex (pt_befig, pt_beaux->ABL);
|
||||
else
|
||||
pt_beaux->NODE= (pNode)beh_abl2gex(pt_befig,pt_beaux->ABL);
|
||||
|
||||
pt_beaux = pt_beaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a gex for each assertion */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bemsg = pt_befig->BEMSG;
|
||||
while (pt_bemsg != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
((bequad_list *)(pt_bemsg->NODE))->GEX =
|
||||
beh_abl2gex (pt_befig, pt_bemsg->ABL);
|
||||
else
|
||||
pt_bemsg->NODE=(pNode)beh_abl2gex(pt_befig,pt_bemsg->ABL);
|
||||
pt_bemsg = pt_bemsg->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a gex for each simple output */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beout = pt_befig->BEOUT;
|
||||
while (pt_beout != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
((bequad_list *)(pt_beout->NODE))->GEX =
|
||||
beh_abl2gex (pt_befig, pt_beout->ABL);
|
||||
else
|
||||
pt_beout->NODE=(pNode) beh_abl2gex (pt_befig,pt_beout->ABL);
|
||||
|
||||
pt_beout = pt_beout->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a gex for each bussed output */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bebus = pt_befig->BEBUS;
|
||||
while (pt_bebus != NULL)
|
||||
{
|
||||
pt_biabl = pt_bebus->BIABL;
|
||||
pt_binode = pt_bebus->BINODE;
|
||||
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(pt_binode->CNDNODE))->GEX =
|
||||
beh_abl2gex (pt_befig, pt_biabl->CNDABL);
|
||||
((bequad_list *)(pt_binode->VALNODE))->GEX =
|
||||
beh_abl2gex (pt_befig, pt_biabl->VALABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_binode->CNDNODE=(pNode)beh_abl2gex(pt_befig,pt_biabl->CNDABL);
|
||||
pt_binode->VALNODE=(pNode)beh_abl2gex(pt_befig,pt_biabl->VALABL);
|
||||
}
|
||||
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
pt_binode = pt_binode->NEXT;
|
||||
}
|
||||
pt_bebus = pt_bebus->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a gex for each bussed internal signal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bebux = pt_befig->BEBUX;
|
||||
while (pt_bebux != NULL)
|
||||
{
|
||||
pt_biabl = pt_bebux->BIABL;
|
||||
pt_binode = pt_bebux->BINODE;
|
||||
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(pt_binode->CNDNODE))->GEX =
|
||||
beh_abl2gex (pt_befig, pt_biabl->CNDABL);
|
||||
((bequad_list *)(pt_binode->VALNODE))->GEX =
|
||||
beh_abl2gex (pt_befig, pt_biabl->VALABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_binode->CNDNODE=(pNode)beh_abl2gex(pt_befig,pt_biabl->CNDABL);
|
||||
pt_binode->VALNODE=(pNode)beh_abl2gex(pt_befig,pt_biabl->VALABL);
|
||||
}
|
||||
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
pt_binode = pt_binode->NEXT;
|
||||
}
|
||||
pt_bebux = pt_bebux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a gex for each internal register */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bereg = pt_befig->BEREG;
|
||||
while (pt_bereg != NULL)
|
||||
{
|
||||
pt_biabl = pt_bereg->BIABL;
|
||||
pt_binode = pt_bereg->BINODE;
|
||||
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(pt_binode->CNDNODE))->GEX =
|
||||
beh_abl2gex (pt_befig, pt_biabl->CNDABL);
|
||||
((bequad_list *)(pt_binode->VALNODE))->GEX =
|
||||
beh_abl2gex (pt_befig, pt_biabl->VALABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_binode->CNDNODE=(pNode)beh_abl2gex(pt_befig,pt_biabl->CNDABL);
|
||||
pt_binode->VALNODE=(pNode)beh_abl2gex(pt_befig,pt_biabl->VALABL);
|
||||
}
|
||||
|
||||
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
pt_binode = pt_binode->NEXT;
|
||||
}
|
||||
pt_bereg = pt_bereg->NEXT;
|
||||
}
|
||||
|
||||
delht (HashTable);
|
||||
pt_befig->TYPE |= BEH_NODE_GEX;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,146 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_maknode.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : Laurent VUILLEMIN */
|
||||
/* description : high level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_maknode */
|
||||
/* description : create node for each signal register or bus */
|
||||
/* called func. : beh_makquad beh_makbdd beh_makderiv beh_makgex */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void beh_maknode (pt_befig, node_flag, trace)
|
||||
|
||||
struct befig *pt_befig ;
|
||||
char node_flag;
|
||||
char trace ;
|
||||
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* setting missing flags : */
|
||||
/* - derivatives need quads, Bdd and list of variables */
|
||||
/* - if two flags are set, quads are needed */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((node_flag & BEH_NODE_DERIVATE) != 0)
|
||||
node_flag |= BEH_NODE_BDD | BEH_NODE_VARLIST | BEH_NODE_QUAD;
|
||||
|
||||
if ((node_flag & BEH_NODE_VARLIST) != 0)
|
||||
{
|
||||
if (((node_flag & BEH_NODE_BDD) || (node_flag & BEH_NODE_GEX) ||
|
||||
(node_flag & BEH_NODE_USER)) != 0)
|
||||
{
|
||||
node_flag |= BEH_NODE_QUAD ;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((node_flag & BEH_NODE_USER) != 0)
|
||||
{
|
||||
if (((node_flag & BEH_NODE_BDD) || (node_flag & BEH_NODE_GEX)) != 0)
|
||||
{
|
||||
node_flag |= BEH_NODE_QUAD ;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((node_flag & BEH_NODE_BDD) && (node_flag & BEH_NODE_GEX)) != 0)
|
||||
{
|
||||
node_flag |= BEH_NODE_QUAD ;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* call the appropriate function two build the requested */
|
||||
/* structures */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* build quads to support further structures */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((node_flag & BEH_NODE_QUAD) != 0)
|
||||
{
|
||||
if (trace != 0)
|
||||
beh_message (14, "QUAD");
|
||||
beh_makquad (pt_befig);
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* build general expressions */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((node_flag & BEH_NODE_GEX) != 0)
|
||||
{
|
||||
if (trace != 0)
|
||||
beh_message (14, "GEX");
|
||||
beh_makgex (pt_befig);
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* build binary decision diagrams */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((node_flag & BEH_NODE_BDD) != 0)
|
||||
{
|
||||
if (trace != 0)
|
||||
beh_message (14, "BDD");
|
||||
beh_makbdd (pt_befig);
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* build list of variables */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((node_flag & BEH_NODE_VARLIST) != 0)
|
||||
{
|
||||
if (trace != 0)
|
||||
beh_message (14, "list of variables");
|
||||
beh_makvarlist (pt_befig);
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* build derivatives of binary expressions (list of Bdds) */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((node_flag & BEH_NODE_DERIVATE) != 0)
|
||||
{
|
||||
if (trace != 0)
|
||||
beh_message (14, "derivatives");
|
||||
beh_makderiv (pt_befig);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,158 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_makquad.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : Laurent VUILLEMIN */
|
||||
/* description : high level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_makquad */
|
||||
/* description : add a BEQUAD structure for each expression */
|
||||
/* called func. : beh_addbequad */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void beh_makquad (pt_befig)
|
||||
|
||||
struct befig *pt_befig;
|
||||
|
||||
{
|
||||
struct beaux *pt_beaux;
|
||||
struct berin *pt_berin;
|
||||
struct beout *pt_beout;
|
||||
struct bebus *pt_bebus;
|
||||
struct bebux *pt_bebux;
|
||||
struct bereg *pt_bereg;
|
||||
struct bemsg *pt_bemsg;
|
||||
struct binode *pt_binod;
|
||||
struct biabl *pt_biabl;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* simple output ports */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beout = pt_befig->BEOUT;
|
||||
while (pt_beout != NULL)
|
||||
{
|
||||
pt_beout->NODE = (pNode) beh_addbequad (NULL,NULL,NULL,NULL);
|
||||
pt_beout = pt_beout->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* bussed ouput ports */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bebus = pt_befig->BEBUS;
|
||||
while (pt_bebus != NULL)
|
||||
{
|
||||
pt_binod = pt_bebus->BINODE;
|
||||
while (pt_binod != NULL)
|
||||
{
|
||||
pt_binod->CNDNODE = (pNode) beh_addbequad (NULL,NULL,NULL,NULL);
|
||||
pt_binod->VALNODE = (pNode) beh_addbequad (NULL,NULL,NULL,NULL);
|
||||
|
||||
pt_binod = pt_binod->NEXT;
|
||||
}
|
||||
pt_bebus = pt_bebus->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* internal bussed signals */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bebux = pt_befig->BEBUX;
|
||||
while (pt_bebux != NULL)
|
||||
{
|
||||
pt_binod = pt_bebux->BINODE;
|
||||
while (pt_binod != NULL)
|
||||
{
|
||||
pt_binod->CNDNODE = (pNode) beh_addbequad (NULL,NULL,NULL,NULL);
|
||||
pt_binod->VALNODE = (pNode) beh_addbequad (NULL,NULL,NULL,NULL);
|
||||
|
||||
pt_binod = pt_binod->NEXT;
|
||||
}
|
||||
pt_bebux = pt_bebux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* internal registers */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bereg = pt_befig->BEREG;
|
||||
while (pt_bereg != NULL)
|
||||
{
|
||||
pt_binod = pt_bereg->BINODE;
|
||||
while (pt_binod != NULL)
|
||||
{
|
||||
pt_binod->CNDNODE = (pNode) beh_addbequad (NULL,NULL,NULL,NULL);
|
||||
pt_binod->VALNODE = (pNode) beh_addbequad (NULL,NULL,NULL,NULL);
|
||||
|
||||
pt_binod = pt_binod->NEXT;
|
||||
}
|
||||
pt_bereg = pt_bereg->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* internal simple signals */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beaux = pt_befig->BEAUX;
|
||||
while (pt_beaux != NULL)
|
||||
{
|
||||
pt_beaux->NODE = (pNode) beh_addbequad (NULL,NULL,NULL,NULL);
|
||||
pt_beaux = pt_beaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* internal delayed signals */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beaux = pt_befig->BEDLY;
|
||||
while (pt_beaux != NULL)
|
||||
{
|
||||
pt_beaux->NODE = (pNode) beh_addbequad (NULL,NULL,NULL,NULL);
|
||||
pt_beaux = pt_beaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* assertions */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bemsg = pt_befig->BEMSG;
|
||||
while (pt_bemsg != NULL)
|
||||
{
|
||||
pt_bemsg->NODE = (pNode) beh_addbequad (NULL,NULL,NULL,NULL);
|
||||
pt_bemsg = pt_bemsg->NEXT;
|
||||
}
|
||||
|
||||
pt_befig->TYPE = pt_befig->TYPE | BEH_NODE_QUAD;
|
||||
}
|
|
@ -0,0 +1,365 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_makvarlist.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : DUNOYER Julien. */
|
||||
/* description : high level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_abl2varlist */
|
||||
/* description : for an expression create the list of terminals. Each */
|
||||
/* terminal may be present only once in the list. */
|
||||
/* Constante values are not present in the list. Each */
|
||||
/* terminal is represented by its BDD index */
|
||||
/* */
|
||||
/* called func. : searchInputCct , beh_abl2varlist , beh_error, */
|
||||
/* cst_AddSetElement, cst_CreateUnionSet */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
static struct chain *beh_abl2varlist (pt_befig, expr)
|
||||
|
||||
struct befig *pt_befig; /* pointer on behavioural figure */
|
||||
struct chain *expr ; /* pointer abl expression */
|
||||
|
||||
{
|
||||
struct chain *set_pnt = NULL;
|
||||
struct circuit *pt_circuit = pt_befig->CIRCUI;
|
||||
int err_flg = 0;
|
||||
int index ;
|
||||
char *atom ;
|
||||
static char buffer [128] ;
|
||||
short oper ;
|
||||
struct chain *cst_AddSetElement ();
|
||||
struct chain *cst_CreateUnionSet ();
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* check that the expression exists */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (expr == NULL)
|
||||
err_flg = beh_error (2, NULL);
|
||||
else
|
||||
{
|
||||
if (expr->NEXT == NULL)
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if the expression is a terminal (atom) */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
atom = (char *) expr->DATA;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if the terminal is a primary signal create an element */
|
||||
/* with its index and return */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((index = searchInputCct (pt_circuit, atom)) != VIDE)
|
||||
set_pnt = cst_AddSetElement (set_pnt, index);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if the expression is not a terminal (is a complex expr.) */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((oper = OPER(expr)) != STABLE)
|
||||
{
|
||||
while ((expr = CDR(expr)) != NULL)
|
||||
{
|
||||
set_pnt = cst_CreateUnionSet
|
||||
(set_pnt, beh_abl2varlist (pt_befig, CAR(expr)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
expr = CDR(expr);
|
||||
if (!ATOM(expr))
|
||||
err_flg = beh_error (4, NULL);
|
||||
else
|
||||
{
|
||||
atom = (char *)VALUE_ATOM (CAR(expr));
|
||||
|
||||
if ((index = searchInputCct (pt_circuit, atom)) != VIDE)
|
||||
{
|
||||
set_pnt = cst_AddSetElement (set_pnt, index);
|
||||
|
||||
sprintf (buffer, "%s'delayed", atom);
|
||||
atom = namealloc (buffer);
|
||||
|
||||
if ((index = searchInputCct (pt_circuit, atom)) != VIDE)
|
||||
{
|
||||
set_pnt = cst_AddSetElement (set_pnt, index);
|
||||
}
|
||||
else
|
||||
err_flg = beh_error (3, atom);
|
||||
}
|
||||
else
|
||||
err_flg = beh_error (3, atom);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (err_flg != 0)
|
||||
pt_befig->ERRFLG = 1;
|
||||
|
||||
return (set_pnt);
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_mvlsttot */
|
||||
/* description : make list of variables for all primary signals */
|
||||
/* simple and bussed outputs, */
|
||||
/* simple and bussed internal signals, registers. */
|
||||
/* called func. : beh_abl2varlist */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
static void beh_mvlsttot (pt_befig)
|
||||
|
||||
struct befig *pt_befig; /* pointer on current BEFIG */
|
||||
|
||||
{
|
||||
struct beaux *pt_beaux;
|
||||
struct beaux *pt_bedly;
|
||||
struct bemsg *pt_bemsg;
|
||||
struct beout *pt_beout;
|
||||
struct bebus *pt_bebus;
|
||||
struct bebux *pt_bebux;
|
||||
struct bereg *pt_bereg;
|
||||
struct biabl *pt_biabl;
|
||||
struct binode *pt_binode;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a var list for each simple internal signal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beaux = pt_befig->BEAUX;
|
||||
|
||||
while (pt_beaux != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(pt_beaux->NODE))->VARLIST =
|
||||
beh_abl2varlist (pt_befig, pt_beaux->ABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_beaux->NODE = (struct node *)beh_abl2varlist (pt_befig, pt_beaux->ABL);
|
||||
}
|
||||
pt_beaux = pt_beaux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a var list for each delayed internal signal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bedly = pt_befig->BEDLY;
|
||||
while (pt_bedly != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(pt_bedly->NODE))->VARLIST =
|
||||
beh_abl2varlist (pt_befig, pt_bedly->ABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_bedly->NODE = (struct node *)beh_abl2varlist (pt_befig, pt_bedly->ABL);
|
||||
}
|
||||
pt_bedly = pt_bedly->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a var list for each assertion */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bemsg = pt_befig->BEMSG;
|
||||
while (pt_bemsg != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(pt_bemsg->NODE))->VARLIST =
|
||||
beh_abl2varlist (pt_befig, pt_bemsg->ABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_bemsg->NODE = (struct node *)beh_abl2varlist (pt_befig, pt_bemsg->ABL);
|
||||
}
|
||||
|
||||
pt_bemsg = pt_bemsg->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a var list for each simple output port */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_beout = pt_befig->BEOUT;
|
||||
while (pt_beout != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(pt_beout->NODE))->VARLIST =
|
||||
beh_abl2varlist (pt_befig, pt_beout->ABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_beout->NODE = (struct node *)beh_abl2varlist (pt_befig, pt_beout->ABL);
|
||||
}
|
||||
|
||||
pt_beout = pt_beout->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a var list for each bussed output port */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bebus = pt_befig->BEBUS;
|
||||
while (pt_bebus != NULL)
|
||||
{
|
||||
pt_biabl = pt_bebus->BIABL;
|
||||
pt_binode = pt_bebus->BINODE;
|
||||
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(pt_binode->CNDNODE))->VARLIST =
|
||||
beh_abl2varlist (pt_befig, pt_biabl->CNDABL);
|
||||
((bequad_list *)(pt_binode->VALNODE))->VARLIST =
|
||||
beh_abl2varlist (pt_befig, pt_biabl->VALABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_binode->CNDNODE = (struct node *)beh_abl2varlist (pt_befig, pt_biabl->CNDABL);
|
||||
pt_binode->VALNODE = (struct node *)beh_abl2varlist (pt_befig, pt_biabl->VALABL);
|
||||
}
|
||||
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
pt_binode = pt_binode->NEXT;
|
||||
}
|
||||
|
||||
pt_bebus = pt_bebus->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a var list for each bussed internal signal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bebux = pt_befig->BEBUX;
|
||||
while (pt_bebux != NULL)
|
||||
{
|
||||
pt_biabl = pt_bebux->BIABL;
|
||||
pt_binode = pt_bebux->BINODE;
|
||||
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(pt_binode->CNDNODE))->VARLIST =
|
||||
beh_abl2varlist (pt_befig, pt_biabl->CNDABL);
|
||||
((bequad_list *)(pt_binode->VALNODE))->VARLIST =
|
||||
beh_abl2varlist (pt_befig, pt_biabl->VALABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_binode->CNDNODE = (struct node *)beh_abl2varlist (pt_befig, pt_biabl->CNDABL);
|
||||
pt_binode->VALNODE = (struct node *)beh_abl2varlist (pt_befig, pt_biabl->VALABL);
|
||||
}
|
||||
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
pt_binode = pt_binode->NEXT;
|
||||
}
|
||||
pt_bebux = pt_bebux->NEXT;
|
||||
}
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* make a var list for each internal register */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
pt_bereg = pt_befig->BEREG;
|
||||
while (pt_bereg != NULL)
|
||||
{
|
||||
pt_biabl = pt_bereg->BIABL;
|
||||
pt_binode = pt_bereg->BINODE;
|
||||
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
if (pt_befig->TYPE & BEH_NODE_QUAD)
|
||||
{
|
||||
((bequad_list *)(pt_binode->CNDNODE))->VARLIST =
|
||||
beh_abl2varlist (pt_befig, pt_biabl->CNDABL);
|
||||
((bequad_list *)(pt_binode->VALNODE))->VARLIST =
|
||||
beh_abl2varlist (pt_befig, pt_biabl->VALABL);
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_binode->CNDNODE = (struct node *)beh_abl2varlist (pt_befig, pt_biabl->CNDABL);
|
||||
pt_binode->VALNODE = (struct node *)beh_abl2varlist (pt_befig, pt_biabl->VALABL);
|
||||
}
|
||||
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
pt_binode = pt_binode->NEXT;
|
||||
}
|
||||
pt_bereg = pt_bereg->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_makvarlist */
|
||||
/* description : make var list for each signal of a befig structure */
|
||||
/* called func. : initializeCct, addInputCct, beh_mvlsttot */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void beh_makvarlist (pt_befig)
|
||||
|
||||
struct befig *pt_befig;
|
||||
|
||||
{
|
||||
int err_flg = 0;
|
||||
|
||||
if (!(pt_befig->TYPE & BEH_NODE_VARLIST));
|
||||
{
|
||||
beh_indexbdd (pt_befig);
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* get the list of variables for all expressions */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
beh_mvlsttot (pt_befig);
|
||||
|
||||
pt_befig->TYPE |= BEH_NODE_VARLIST;
|
||||
|
||||
if (err_flg != 0)
|
||||
pt_befig->ERRFLG = 1;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,127 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_namelist.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* description : expression level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_namelist */
|
||||
/* description : find the list of terminals' name for an expression. */
|
||||
/* The value returned by the function is the list of */
|
||||
/* terminals. Each terminal is represented by its name */
|
||||
/* in the list. A given terminal may appear several */
|
||||
/* times in the list. Constante values are not added */
|
||||
/* to the list. */
|
||||
/* called func. : beh_namelist, namealloc, addchain, append */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct chain *beh_namelist (pt_exp)
|
||||
|
||||
struct chain *pt_exp;
|
||||
|
||||
{
|
||||
struct chain *res_chain = NULL;
|
||||
struct chain *tmp_chain = NULL;
|
||||
struct chain *pt_opr ;
|
||||
char *name ;
|
||||
|
||||
static char *str_z = NULL;
|
||||
static char *str_o = NULL;
|
||||
static char *str_d = NULL;
|
||||
static char buffer [128] ;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* initialize 3 variables with constante (first call only) */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (str_z == NULL)
|
||||
{
|
||||
str_z = namealloc ("'0'");
|
||||
str_o = namealloc ("'1'");
|
||||
str_d = namealloc ("'d'");
|
||||
}
|
||||
|
||||
if (pt_exp != NULL)
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* check that the expression is not empty */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (pt_exp->NEXT != NULL)
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* If the expression is not a terminal : */
|
||||
/* */
|
||||
/* - if the operator is STABLE, add the varaiable's name */
|
||||
/* to the list. Add also the "delayed" variable. */
|
||||
/* - otherwies, call recursively the function on each */
|
||||
/* operand, and append the returned list to the previous */
|
||||
/* variable list. */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if (((int) ((struct chain *) pt_exp->DATA)->DATA) == STABLE)
|
||||
{
|
||||
name = ((struct chain *) pt_exp->NEXT->DATA)->DATA;
|
||||
res_chain = addchain (NULL, name);
|
||||
sprintf (buffer, "%s'delayed", name);
|
||||
name = namealloc (buffer);
|
||||
res_chain = addchain (res_chain, name);
|
||||
}
|
||||
else
|
||||
{
|
||||
pt_opr = pt_exp->NEXT;
|
||||
while (pt_opr != NULL)
|
||||
{
|
||||
tmp_chain = beh_namelist (pt_opr->DATA);
|
||||
res_chain = append (res_chain, tmp_chain);
|
||||
pt_opr = pt_opr->NEXT;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* ###------------------------------------------------------### */
|
||||
/* if the expression is a terminal but not a constante, add */
|
||||
/* the variable's name to the list of variables (do not check */
|
||||
/* if the variable has already been added to the list). */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
if ((pt_exp->DATA != str_z) && (pt_exp->DATA != str_o) &&
|
||||
(pt_exp->DATA != str_d) )
|
||||
{
|
||||
res_chain = addchain (NULL, pt_exp->DATA);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (res_chain);
|
||||
}
|
|
@ -0,0 +1,139 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_sta2dly.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* content : high-level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_sta2dly */
|
||||
/* description : replace the STABLE attribute by DELAYED in the */
|
||||
/* expressions of the description */
|
||||
/* called func. : beh_rplstable */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
void beh_sta2dly (pt_fig, mode)
|
||||
|
||||
struct befig *pt_fig;
|
||||
unsigned int mode ;
|
||||
|
||||
{
|
||||
struct beout *pt_out ;
|
||||
struct bebus *pt_bus ;
|
||||
struct beaux *pt_aux ;
|
||||
struct bebux *pt_bux ;
|
||||
struct bereg *pt_reg ;
|
||||
struct bemsg *pt_msg ;
|
||||
struct biabl *pt_biabl;
|
||||
|
||||
if ((pt_fig != NULL) && (pt_fig->ERRFLG == 0))
|
||||
{
|
||||
if ((mode & BEH_STA_REPLACE_OUT) != 0)
|
||||
{
|
||||
pt_out = pt_fig->BEOUT;
|
||||
while (pt_out != NULL)
|
||||
{
|
||||
pt_out->ABL = beh_rplstable (pt_out->ABL);
|
||||
pt_out = pt_out->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
if ((mode & BEH_STA_REPLACE_AUX) != 0)
|
||||
{
|
||||
pt_aux = pt_fig->BEAUX;
|
||||
while (pt_aux != NULL)
|
||||
{
|
||||
pt_aux->ABL = beh_rplstable (pt_aux->ABL);
|
||||
pt_aux = pt_aux->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
if ((mode & BEH_STA_REPLACE_MSG) != 0)
|
||||
{
|
||||
pt_msg = pt_fig->BEMSG;
|
||||
while (pt_msg != NULL)
|
||||
{
|
||||
pt_msg->ABL = beh_rplstable (pt_msg->ABL);
|
||||
pt_msg = pt_msg->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
if ((mode & BEH_STA_REPLACE_BUS) != 0)
|
||||
{
|
||||
pt_bus = pt_fig->BEBUS;
|
||||
while (pt_bus != NULL)
|
||||
{
|
||||
pt_biabl = pt_bus->BIABL;
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
pt_biabl->VALABL = beh_rplstable (pt_biabl->VALABL);
|
||||
pt_biabl->CNDABL = beh_rplstable (pt_biabl->CNDABL);
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
}
|
||||
pt_bus = pt_bus->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
if ((mode & BEH_STA_REPLACE_BUX) != 0)
|
||||
{
|
||||
pt_bux = pt_fig->BEBUX;
|
||||
while (pt_bux != NULL)
|
||||
{
|
||||
pt_biabl = pt_bux->BIABL;
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
pt_biabl->VALABL = beh_rplstable (pt_biabl->VALABL);
|
||||
pt_biabl->CNDABL = beh_rplstable (pt_biabl->CNDABL);
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
}
|
||||
pt_bux = pt_bux->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
if ((mode & BEH_STA_REPLACE_REG) != 0)
|
||||
{
|
||||
pt_reg = pt_fig->BEREG;
|
||||
while (pt_reg != NULL)
|
||||
{
|
||||
pt_biabl = pt_reg->BIABL;
|
||||
while (pt_biabl != NULL)
|
||||
{
|
||||
pt_biabl->VALABL = beh_rplstable (pt_biabl->VALABL);
|
||||
pt_biabl->CNDABL = beh_rplstable (pt_biabl->CNDABL);
|
||||
pt_biabl = pt_biabl->NEXT;
|
||||
}
|
||||
pt_reg = pt_reg->NEXT;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : beh_unamlist.c */
|
||||
/* date : Feb 29 2000 */
|
||||
/* version : v111 */
|
||||
/* authors : Pirouz BAZARGAN SABET */
|
||||
/* description : high level function */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "mut.h"
|
||||
#include "log.h"
|
||||
#include "beh.h"
|
||||
#include "bhl.h"
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* function : beh_unamlist */
|
||||
/* description : find the list of terminals' name for an expression. */
|
||||
/* The value returned by the function is the list of */
|
||||
/* terminals. Each terminal is represented by its name */
|
||||
/* in the list. A given terminal may only appear once */
|
||||
/* in the list. Constante values are not added */
|
||||
/* to the list. */
|
||||
/* called func. : beh_namelist, delchain */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
struct chain *beh_unamlist (pt_exp)
|
||||
|
||||
struct chain *pt_exp;
|
||||
|
||||
{
|
||||
struct chain *res_chain;
|
||||
struct chain *tmp_chain;
|
||||
struct chain *del_chain;
|
||||
struct chain *prv_chain;
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* find the list of terminals */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
res_chain = beh_namelist (pt_exp);
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* delete multiple refernces to the same terminal */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
tmp_chain = res_chain;
|
||||
|
||||
while (tmp_chain != NULL)
|
||||
{
|
||||
prv_chain = tmp_chain ;
|
||||
del_chain = tmp_chain->NEXT;
|
||||
|
||||
while (del_chain != NULL)
|
||||
{
|
||||
if (del_chain->DATA == tmp_chain->DATA)
|
||||
{
|
||||
del_chain = delchain (del_chain, del_chain);
|
||||
prv_chain->NEXT = del_chain;
|
||||
}
|
||||
else
|
||||
{
|
||||
prv_chain = del_chain ;
|
||||
del_chain = del_chain->NEXT;
|
||||
}
|
||||
}
|
||||
|
||||
tmp_chain = tmp_chain->NEXT;
|
||||
}
|
||||
|
||||
return (res_chain);
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/*
|
||||
* This file is part of the Alliance CAD System
|
||||
* Copyright (C) Laboratoire LIP6 - Département ASIM
|
||||
* Universite Pierre et Marie Curie
|
||||
*
|
||||
* Home page : http://www-asim.lip6.fr/alliance/
|
||||
* E-mail support : mailto:alliance-support@asim.lip6.fr
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU Library General Public License as published
|
||||
* by the Free Software Foundation; either version 2 of the License, or (at
|
||||
* your option) any later version.
|
||||
*
|
||||
* Alliance VLSI CAD System is distributed in the hope that it will be
|
||||
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
* Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with the GNU C Library; see the file COPYING. If not, write to the Free
|
||||
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
/* ###--------------------------------------------------------------### */
|
||||
/* file : bhl111.h */
|
||||
/* date : Mar 2 2000 */
|
||||
/* version : v111 */
|
||||
/* author : Pirouz BAZARGAN SABET */
|
||||
/* contents : high level library for behavioural description */
|
||||
/* ###--------------------------------------------------------------### */
|
||||
|
||||
#ifndef BEH_BHLDEF
|
||||
#define BEH_BHLDEF
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* defines */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
#define BEH_STA_REPLACE_OUT 0x01
|
||||
#define BEH_STA_REPLACE_BUS 0x02
|
||||
#define BEH_STA_REPLACE_AUX 0x04
|
||||
#define BEH_STA_REPLACE_BUX 0x08
|
||||
#define BEH_STA_REPLACE_MSG 0x10
|
||||
#define BEH_STA_REPLACE_REG 0x20
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* structure definitions */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
/* ###------------------------------------------------------### */
|
||||
/* functions */
|
||||
/* ###------------------------------------------------------### */
|
||||
|
||||
extern int beh_chkbefig ();
|
||||
extern void beh_debug ();
|
||||
extern void beh_makbdd ();
|
||||
extern void beh_makgex ();
|
||||
extern void beh_makderiv ();
|
||||
extern void beh_makvarlist ();
|
||||
extern void beh_freabl ();
|
||||
extern void beh_depend ();
|
||||
|
||||
extern char *beh_gettimeunit ();
|
||||
|
||||
extern void beh_dly2sta ();
|
||||
extern void beh_sta2dly ();
|
||||
|
||||
extern struct chain *beh_namelist ();
|
||||
extern struct chain *beh_unamlist ();
|
||||
extern void beh_indexbdd ();
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue