importing genpat ....

This commit is contained in:
Christophe Alexandre 2002-05-30 13:28:15 +00:00
parent e78b08526d
commit bbdb04e282
21 changed files with 3052 additions and 0 deletions

View File

@ -0,0 +1 @@
SUBDIRS = src doc

View File

@ -0,0 +1,46 @@
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
AC_INIT(src/genpat.sh)
AM_INIT_AUTOMAKE(genpat, 3.3)
AC_PROG_CC
AC_PROG_RANLIB
AC_CHECK_PROG(SED, sed, sed)
AM_PROG_LEX
AC_PROG_YACC
AC_PROG_MAKE_SET
changequote(,)dnl
if test -z $SED ; then
echo "Cannot find sed here! Quiting, ..."
exit 1
fi
changequote([,])dnl
AM_ALLIANCE
AC_OUTPUT([
Makefile
src/Makefile
doc/Makefile
])

View File

@ -0,0 +1,4 @@
## Process this file with automake to produce Makefile.in
man_MANS = genpat.1
EXTRA_DIST = $(man_MANS)

View File

@ -0,0 +1,180 @@
.\" $Id: genpat.1,v 1.1 2002/05/30 13:28:15 xtof Exp $
.\" @(#)genpat 2.0 Sep 07 1993 UPMC; Author: PITON D.
.TH GENPAT 1 "October 1, 1997" "ASIM/LIP6" "ALLIANCE USER COMMANDS"
.SH NAME
.PP
\fBgenpat\fP, A procedural pattern file generator
.SH SYNOPSIS
.PP
\fBgenpat [-v] [-k] [file]\fP
.br
.so man1/alc_origin.1
.SH DESCRIPTION
.PP
\fBGenpat\fP is a set of C fonctions that allows a procedural description of
input pattern file for the logic simulator \fBASIMUT\fP. The Unix \fBgenpat\fP
command accepts a C file as input and produces a pattern description file as
output. The extension ".c" is not to be given. The file generated by
\fBgenpat\fP is in pat format, so IT IS STRONGLY RECOMMENDED TO SEE pat(5)
BEFORE THIS MANUAL.
.SH OPTIONS
.PP
.TP 15
\fI\-v\fP
verbose mode
.TP 15
\fI\-k\fP
keeps the executable along with the compilation Makefile after completion
.SH GENPAT FILE FORMAT
.PP
From a user point of view, \fBgenpat\fP is a pattern description language
using all standard C facilities (include, define, variables, loop, ...).
Fonctions provided by \fBgenpat\fP are to be used in a given order. Using
them in a different order won't crash the system, but will result in
execution errors. Here follows the description of the input file.
.PP
A \fBpat\fP format file can be divided in two parts : declaration and
description part.
.PP
The declaration part is the list of inputs, outputs, internal signals and
registers. Inputs are to be forced to a certain value and all the others are
to be observed during simulation.
.PP
The description part is a set of patterns, where each pattern defines the
value of inputs and outputs. The pattern number represents actually the
absolute time for the simulator.
.PP
Similarly, a \fBgenpat\fP file can be divided in two parts : declaration and
description part. Functions related to the declaration must be called before
any function related to the description part.
.PP
.TP 10
\fIdeclaration part\fP
The first thing you should do in this part is to give the output file's name
(see DEF_GENPAT(3)). Then, this part allows you to declare the inputs, the
outputs, and internal observing points (see DECLAR(3)). It is also possible
to create virtual arraies (see ARRAY(3)).
.TP 10
\fIdescription part\fP
After all signals are declared, you can begin to define input values which
are to be applied to the inputs of the circuit or output values which are
to be compare with the values produced during the simulation. (see AFFECT(3)).
Genpat describes the stimulus by event : only signal transitions are described.
This part also allows you to give instructions to the simulation tool to save
the state of the circuit at the end of the simulation. (see SAVE(3)). Last
thing you should do in this part is to generate the output file (see
SAV_GENPAT(3)).
.SH FUNCTIONS
.PP
.TP 15
\fIDEF_GENPAT()\fP
defines the output file's name.
.TP 15
\fISAV_GENPAT()\fP
make the output file be generated
.TP 15
\fIDECLAR()\fP
declares inputs, outputs, and the internal observing points.
.TP 15
\fIARRAY()\fP
allows signals of the same type to be groupped in an "virtual array" in
order to ease their manipulation
.TP 15
\fIINIT()\fP
changes the values of registers between two patterns.
.TP 15
\fIAFFECT()\fP
assigns a value to a signal, at a given pattern number. This value is kept on
the signal until a new value is assigned to the signal.
.TP 15
\fISAVE()\fP
informs the simulation tool to save the state of the circuit at the end of
simulation
.TP 15
\fILABEL()\fP
gives a label to the current pattern
.TP 15
\fIGETCPAT()\fP
return the number of the current pattern
.SH EXAMPLES
.PP
.nf
#include <stdio.h>
#include "genpat.h"
char *inttostr(entier)
int entier;
{
char *str;
str = (char *) mbkalloc (32 * sizeof (char));
sprintf (str, "%d",entier);
return(str);
}
/*------------------------------*/
/* end of the description */
/*------------------------------*/
main ()
{
int i;
int j;
int cur_vect;
DEF_GENPAT("vecteurs");
/* interface */
DECLAR ("a", ":2", "X", IN, "0 to 3");
DECLAR ("b", ":2", "X", IN, "0 to 3");
DECLAR ("sel", ":2", "B", IN, "");
DECLAR ("ck", ":2", "B", IN, "");
DECLAR ("s", ":2", "X", OUT, "0 to 3");
LABEL ("additionneur");
AFFECT ("0", "ck", "0b0");
AFFECT ("0", "sel", "0b0");
for (i=0; i<16; i++)
for (j=0; j<16; j++)
{
cur_vect = i*16 + j;
AFFECT (inttostr(cur_vect), "a", inttostr(i));
AFFECT (inttostr(cur_vect), "b", inttostr(j));
}
cur_vect = cur_vect + 1;
AFFECT (inttostr(cur_vect), "a", "0b0");
AFFECT (inttostr(cur_vect), "b", "0b0");
AFFECT (inttostr(cur_vect), "sel", "0b0");
AFFECT (inttostr(cur_vect), "ck" , "0b0");
SAV_GENPAT ();
}
.fi
.SH ENVIRONMENT VARIABLES
.PP
\fBGenpat\fP reads the environment variable VH_PATSFX to give the result
file an extension.
.SH SEE ALSO
.PP
AFFECT(3), ARRAY(3), DECLAR(3), DEF_GENPAT(3), GETCPAT(3), INIT(3), LABEL(3),
SAVE(3), SAV_GENPAT(3), pat(5), asimut(1)
.so man1/alc_bug_report.1

View File

@ -0,0 +1,192 @@
/*
* 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 progam is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Alliance VLSI CAD System is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/***************************************************************/
/* module : affect.c */
/* date : 28/07/92 */
/* auteurs : RENAUD & VENOT & PITON */
/***************************************************************/
#ident "$Id: AFFECT.c,v 1.1 2002/05/30 13:28:15 xtof Exp $"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "mut.h"
#include "pat.h"
#include "phl.h"
#include "libpat_l.h"
/* ###--------------------------------------------------------------### */
/* function : AFFECT */
/* description : set GNP_TAB_PAIOL_CREE to GNP_ACTIF if not done yet */
/* create a PAEVT list according to value and connector */
/* Create or set the good PAPAT structure */
/* called func. : CheckPattern, pat_crtpaiol, Erreur, MajPatternCourant */
/* SplitIdent, CheckIdent, TraiterChaine, CheckWidth, FindIdent */
/* FormatValue, ExisteIdent, CreatePaevt, CreatePapat */
/* ###--------------------------------------------------------------### */
void d_AFFECT (pat_numb,ident,val)
char *pat_numb;
char *ident;
char *val;
{
char *valeur;
char field_ident [64];
char buffer [80];
char tmp_valeur [1024];
char value [1024];
int dim = 0,num_ident,sens,i,j;
struct alpha_num decomp;
struct paevt *tmp_paevt = NULL;
/* namealloc must be performed after mbkenv() - Czo - */
if (!CATA_LIB || !WORK_LIB)
mbkenv();
if (racine_paseq == NULL)
Erreur ("AFFECT must declare output file's name first\n");
if ( GNP_TAB_PAIOL_CREE == GNP_INACTIF)
{
racine_paiol = (struct paiol *) reverse ((struct chain *)racine_paiol);
racine_paiol = pat_crtpaiol(racine_paiol);
GNP_TAB_PAIOL_CREE = GNP_ACTIF;
}
if ( pat_numb == NULL)
Erreur ("AFFECT unvalid parameter");
strcpy(buffer,pat_numb);
CheckPattern (buffer);
MajPatternCourant(buffer);
if ( ident == NULL)
Erreur ("AFFECT unvalid parameter");
strcpy (buffer,ident);
SplitIdent (buffer,field_ident);
CheckIdent (buffer);
if (strlen (field_ident) != 0)
{
TraiterChaine (field_ident,&decomp );
CheckWidth (&decomp);
if (strlen (decomp.alpha) != 0)
Erreur ("AFFECT expected a group name or paiol name\n");
if (strlen (decomp.gauche) != 0)
{
strcat(buffer," ");
strcat(buffer,decomp.gauche);
}
}
if ( val == NULL)
Erreur ("AFFECT unvalid parameter");
strcpy(tmp_valeur,val);
num_ident = FindIdent (buffer,hash_paiol);
if ( num_ident != -1)
{
switch (
((struct paiol *)tab_ident[num_ident].pointeur)->MODE)
{
case 'R': case 'S': case 'O':
{
valeur = tmp_valeur;
if (tmp_valeur[0] == '?')
valeur++;
FormatValue (value,valeur,1,GNP_UP,1);
break;
}
case 'T':
{
valeur = tmp_valeur;
if (tmp_valeur[0] == '?')
{
valeur++;
FormatValue (value,valeur,1,GNP_UP,1);
}
else
FormatValue (value,tmp_valeur,1,GNP_UP,0);
break;
}
case 'I':
{
FormatValue (value,tmp_valeur,1,GNP_UP,0);
break;
}
default:
Erreur ("unconsistent internal structures\n");
}
tmp_paevt = CreatePaevt (tmp_paevt,num_ident,value[0]);
}
else
{
num_ident = FindIdent (buffer,hash_pagrp);
if ( num_ident == -1)
Erreur ("AFFECT not yet declared identifier\n");
else
{
sens = ExisteIdent(buffer,hash_pagrp)-> sens;
dim = ((struct pagrp *)tab_ident[num_ident].pointeur)->LENGTH;
switch (
((struct paiol *)tab_ident[num_ident -1].pointeur)->MODE)
{
case 'R': case 'S': case 'O':
{
valeur = tmp_valeur;
if (tmp_valeur[0] == '?')
valeur++;
FormatValue (value,valeur,dim,sens,1);
break;
}
case 'T':
{
valeur = tmp_valeur;
if (tmp_valeur[0] == '?')
{
valeur++;
FormatValue (value,valeur,dim,sens,1);
}
else
FormatValue (value,tmp_valeur,dim,sens,0);
break;
}
case 'I':
{
FormatValue (value,tmp_valeur,dim,sens,0);
break;
}
default:
Erreur ("unconsistent internal structures\n");
}
for (j =0, i = dim; i > 0; i--, j++ )
tmp_paevt = CreatePaevt (tmp_paevt,num_ident -i,value[j]);
}
}
CreatePapat (NULL,tmp_paevt,NULL);
}

View File

@ -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 progam is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Alliance VLSI CAD System is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/***************************************************************/
/* module : array.c */
/* date : 28/07/92 */
/* auteurs : RENAUD & VENOT & PITON */
/***************************************************************/
#ident "$Id: ARRAY.c,v 1.1 2002/05/30 13:28:15 xtof Exp $"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <varargs.h>
#include "mut.h"
#include "pat.h"
#include "libpat_l.h"
/* ###--------------------------------------------------------------### */
/* function : ARRAY */
/* description : Create a PAGRP structure and the referenced PAIOL */
/* called func. : Erreur, SplitIdent, KillEsp, CheckIdent, TraiterChaine*/
/* CheckWidth, FindIdent, EmpileParam, CheckSeparate, */
/* CheckFormat, CheckType, DefileParam, DupPaiol, CreatePagrp */
/* ###--------------------------------------------------------------### */
void d_ARRAY (va_alist)
va_dcl
{
va_list pa;
char *param;
char buffer [80];
char buffer_anx [64];
char name [64];
char buffer_name [80];
char blk;
char base;
char i_o;
char flg;
short dim;
int tmp_ind_paiol;
struct alpha_num decomp;
/* namealloc must be performed after mbkenv() - Czo - */
if (!CATA_LIB || !WORK_LIB)
mbkenv();
if (racine_paseq == NULL)
Erreur ("ARRAY must declare output file's name first\n");
if (GNP_TAB_PAIOL_CREE == GNP_ACTIF)
Erreur ("ARRAY already in descriptive part\n");
va_start(pa);
param = va_arg(pa, char *);
if (param == NULL)
Erreur ("ARRAY needs any parameters\n");
strcpy (buffer,param);
KillEsp (buffer);
if (*buffer == ':')
Erreur ("ARRAY must have an element at least\n");
sp_pile_param = 0;
while ( *buffer != ':')
{
strcpy (buffer,param);
SplitIdent (buffer,buffer_anx);
CheckIdent (buffer);
if (strlen (buffer_anx) != 0)
{
TraiterChaine (buffer_anx, &decomp);
CheckWidth (&decomp);
if (strlen(decomp.alpha) ==0)
sprintf(buffer,"%s %s",buffer,decomp.gauche);
else
Erreur ("ARRAY must separate each element of a vector\n");
}
else
if ( FindIdent (buffer,hash_pagrp) != -1)
Erreur ("ARRAY yet declared identifier as a pagrp\n");
EmpileParam(param);
param = va_arg(pa, char *);
if (param == NULL)
Erreur ("ARRAY needs more parameters\n");
strcpy (buffer,param);
KillEsp (buffer);
}
blk = CheckSeparate(buffer);
dim = sp_pile_param;
param = va_arg(pa, char *);
if (param == NULL)
Erreur ("ARRAY needs more parameters\n");
strcpy (buffer,param);
base = CheckFormat (buffer);
param = va_arg(pa, char *);
if (param == NULL)
Erreur ("ARRAY needs more parameters\n");
strcpy (buffer,param);
i_o = CheckType (buffer);
param = va_arg(pa, char *);
if (param == NULL)
Erreur ("ARRAY needs more parameters\n");
strcpy (buffer,param);
flg = CheckOption (buffer);
param = va_arg(pa, char *);
if (param == NULL)
Erreur ("ARRAY needs group name\n");
strcpy (name,param);
if ( FindIdent (name,hash_paiol) != -1)
Erreur ("ARRAY duplicate declared identifier\n");
if ( FindIdent (name,hash_pagrp) != -1)
Erreur ("ARRAY yet declared identifier as a pagrp\n");
param = va_arg(pa, char *);
if (param != NULL)
Erreur ("ARRAY NULL parameter expected\n");
va_end (pa);
sp_file_param = 0;
/* test si les parametres sont de meme mode 'O', 'R', 'S' ou non declares */
while (sp_file_param < sp_pile_param)
{
param = DefileParam();
strcpy (buffer,param);
SplitIdent (buffer,buffer_anx);
if (strlen (buffer_anx) != 0)
{
sprintf (buffer, "%s %s", buffer, buffer_anx);
}
sprintf (buffer_name, "%s %d", name, GNP_PARAM_COURANT);
switch (i_o)
{
case 'I': case 'T' :
{
if ( FindIdent (buffer,hash_paiol) != -1)
Erreur ("ARRAY duplicate declared identifier\n");
DupPaiol (-1,base,buffer,buffer_name,i_o,blk,flg);
break;
}
case 'O': case 'R': case 'S' :
{
tmp_ind_paiol = FindIdent (buffer,hash_paiol);
if ( tmp_ind_paiol == -1)
DupPaiol (-1,base,buffer,buffer_name,i_o,blk,flg);
else
{
if (((struct paiol*)tab_ident[tmp_ind_paiol].pointeur)->MODE != i_o)
Erreur ("ARRAY /port mode not matched\n");
DupPaiol (tmp_ind_paiol,base,buffer,buffer_name,i_o,blk,flg);
break;
}
}
}
}
CreatePagrp (name,dim,-1,GNP_VECTEUR_VIRTUEL);
}

View File

@ -0,0 +1,52 @@
/*
* 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 progam is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Alliance VLSI CAD System is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/****************************************************************/
/* module : conv.c */
/* date : 02/09/93 */
/* auteurs : RENAUD & VENOT */
/****************************************************************/
#ident "$Id: CONV.c,v 1.1 2002/05/30 13:28:15 xtof Exp $"
#include <stdio.h>
#include "pat.h"
#include "mut.h"
#include "libpat_l.h"
/* ###--------------------------------------------------------------### */
/* function : CONV */
/* description : convert an integer into a uns. decimal type string */
/* called func. : none */
/* ###--------------------------------------------------------------### */
char *d_CONV(entier)
int entier;
{
char *str;
str = (char *) mbkalloc (32 * sizeof (char));
sprintf (str, "%d", entier);
return (str);
}

View File

@ -0,0 +1,176 @@
/*
* 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 progam is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Alliance VLSI CAD System is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/************************************************************************/
/* module : declar.c */
/* date : 02/09/93 */
/* auteurs : RENAUD & VENOT & PITON */
/************************************************************************/
#ident "$Id: DECLAR.c,v 1.1 2002/05/30 13:28:15 xtof Exp $"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "mut.h"
#include "pat.h"
#include "libpat_l.h"
/* ###--------------------------------------------------------------### */
/* function : DECLAR */
/* description : create PAIOL or PAGRP structs according to parameter */
/* called func. : Erreur, CreatePaiol, CreatePagrp, KillEsp, atoi */
/* DefileParam, CheckIdent, TraiterChaine, CheckWidth, FindIdent */
/* EmpileParam, CheckSeparate, CheckFormat */
/* ###--------------------------------------------------------------### */
void d_DECLAR (ident,space,format,mode,size,option)
char *ident;
char *space;
char *format;
char *mode;
char *size;
char *option;
{
char buffer [80];
char name [80];
char blk,base,i_o,flg;
short dim=0;
int i = 0;
int borne_g = -1;
int borne_d = -1;
int sens = 0;
struct alpha_num decomp;
/* namealloc must be performed after mbkenv() - Czo - */
if (!CATA_LIB || !WORK_LIB)
mbkenv();
if (racine_paseq == NULL)
Erreur ("DECLAR must declare output file's name first\n");
if (GNP_TAB_PAIOL_CREE == GNP_ACTIF)
Erreur ("DECLAR already in descriptive part\n");
if (space == NULL)
Erreur ("DECLAR unvalid parameter\n");
strcpy (buffer,space);
KillEsp (buffer);
blk = CheckSeparate(buffer);
if (format == NULL)
Erreur ("DECLAR unvalid parameter\n");
strcpy (buffer,format);
base = CheckFormat (buffer);
if (mode == NULL)
Erreur ("DECLAR unvalid parameter\n");
strcpy (buffer,mode);
i_o = CheckType (buffer);
if (option == NULL)
Erreur ("DECLAR unvalid parameter\n");
strcpy (buffer,option);
flg = CheckOption (buffer);
if (ident == NULL)
Erreur ("DECLAR unvalid parameter\n");
strcpy (name,ident);
KillEsp (name);
CheckIdent (name);
if ( FindIdent (name,hash_paiol) != -1)
Erreur ("DECLAR duplicate declared identifier\n");
if ( FindIdent (name,hash_pagrp) != -1)
Erreur ("DECLAR yet declared identifier as a pagrp\n");
if (size == NULL)
Erreur ("DECLAR unvalid parameter\n");
strcpy (buffer,size);
TraiterChaine(buffer,&decomp);
CheckWidth (&decomp);
if (strlen (decomp.gauche) == 0)
dim = 0;
else
{
if (strlen(decomp.alpha) ==0)
dim = 1;
else
{
borne_g = atoi (decomp.gauche);
borne_d = atoi (decomp.droite);
if ( borne_g > borne_d )
{
borne_d--;
sens = -1;
dim = borne_g - borne_d;
}
else
{
borne_d++;
sens = 1;
dim = borne_d - borne_g;
}
}
}
switch (dim)
{
case 0:
{
if ( base != 'B' )
Erreur ("DECLAR illegal format for one bit identifier\n");
CreatePaiol (base,name,i_o,blk,flg);
break;
}
case 1:
{
char x[80];
sprintf(x," %s",decomp.gauche);
strcat(name,x);
if ( FindIdent (name,hash_paiol) != -1)
Erreur ("DECLAR duplicate declared identifier\n");
if ( base != 'B' )
Erreur ("DECLAR illegal format for one bit identifier\n");
CreatePaiol (base,name,i_o,blk,flg);
break;
}
default:
{
for (i = borne_g; i != borne_d; i = i + sens)
{
char x[80];
sprintf (x," %d", i);
strcpy(buffer,name);
strcat(buffer,x);
if ( FindIdent (buffer,hash_paiol) != -1)
Erreur ("DECLAR duplicate declared identifier\n");
CreatePaiol (base,buffer,i_o,blk,flg);
}
}
}
if (dim > 1)
CreatePagrp (name,dim,sens,GNP_VECTEUR_EFFECTIF);
}

View File

@ -0,0 +1,66 @@
/*
* 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 progam is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Alliance VLSI CAD System is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/************************************************************************/
/* module : def_gen.c */
/* date : 02/09/93 */
/* auteurs : RENAUD & VENOT & PITON */
/************************************************************************/
#ident "$Id: DEF_GEN.c,v 1.1 2002/05/30 13:28:15 xtof Exp $"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "mut.h"
#include "pat.h"
#include "libpat_l.h"
/* ###--------------------------------------------------------------### */
/* function : DEF_GENPAT */
/* description : create PASEQ struct and initialization */
/* called func. : pat_addpaseq, CreateLabel */
/* ###--------------------------------------------------------------### */
void d_DEF_GENPAT(chaine)
char *chaine;
{
/* namealloc must be performed after mbkenv() - Czo - */
if (!CATA_LIB || !WORK_LIB)
mbkenv();
racine_paseq = pat_addpaseq (racine_paseq);
racine_paseq->NAME = namealloc (chaine);
racine_paseq->FLAGS |= PAT_SEQ__IOLARRAY; /* Czo */
GNP_PATTERN_COURANT = 0;
GNP_PAIOL_INDEX = 0;
IOLNUMBER = 0;
InitHash (hash_paiol);
InitHash (hash_pagrp);
}

View File

@ -0,0 +1,49 @@
/*
* 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 progam is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Alliance VLSI CAD System is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/************************************************************************/
/* module : getcpat.c */
/* date : 02/09/93 */
/* auteurs : PITON */
/************************************************************************/
#ident "$Id: GETCPAT.c,v 1.1 2002/05/30 13:28:15 xtof Exp $"
#include <stdio.h>
#include "mut.h"
#include "pat.h"
#include "libpat_l.h"
/* ###--------------------------------------------------------------### */
/* function : GETCPAT */
/* description : return current pattern date */
/* called func. : none */
/* ###--------------------------------------------------------------### */
unsigned long d_GETCPAT ()
{
return (GNP_PATTERN_COURANT);
}

View File

@ -0,0 +1,161 @@
/*
* 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 progam is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Alliance VLSI CAD System is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/************************************************************************/
/* module : init.c */
/* date : 07/09/93 */
/* auteurs : RENAUD & VENOT & PITON */
/************************************************************************/
#ident "$Id: INIT.c,v 1.1 2002/05/30 13:28:15 xtof Exp $"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "mut.h"
#include "pat.h"
#include "libpat_l.h"
/* ###--------------------------------------------------------------### */
/* function : INIT */
/* description : add a PAINI list to the good PAPAT structure if it */
/* does exist, else create PAPAT on the way */
/* called func. : FormatValue, CheckPattern, MajPatternCourant, */
/* SplitIdent,CheckIdent, checkWidth, atoi, pat_addpaini, */
/* CreatePapat, CreateAction */
/* ###--------------------------------------------------------------### */
void d_INIT (pat_numb, ident, val)
char *pat_numb;
char *ident;
char *val;
{
char buffer [ 80];
char buffer_anx [ 80];
char tmp_valeur [1024];
char value [1024];
int dim, borne_g = -1, borne_d = -1, sens = 0, i, j;
struct alpha_num decomp;
struct paini *tmp_paini = NULL;
/* namealloc must be performed after mbkenv() - Czo - */
if (!CATA_LIB || !WORK_LIB)
mbkenv();
if (racine_paseq == NULL)
Erreur ("INIT must declare output file name first\n");
if (GNP_TAB_PAIOL_CREE == GNP_INACTIF)
{
racine_paiol = (struct paiol *) reverse ((struct chain *)racine_paiol);
racine_paiol = pat_crtpaiol (racine_paiol);
GNP_TAB_PAIOL_CREE = GNP_ACTIF;
}
if (pat_numb == NULL)
Erreur ("INIT unvalid parameter");
strcpy (buffer, pat_numb);
CheckPattern (buffer);
MajPatternCourant (buffer);
if (ident == NULL)
Erreur ("INIT unvalid parameter");
strcpy (buffer, ident);
SplitIdent (buffer, buffer_anx);
CheckIdent (buffer);
if (strlen (buffer_anx) == 0)
dim = 0;
else
{
TraiterChaine (buffer_anx, &decomp);
CheckWidth (&decomp);
if (strlen (decomp.gauche) == 0)
dim = 0;
else
{
if (strlen (decomp.alpha) == 0)
dim = 1;
else
{
borne_g = atoi (decomp.gauche);
borne_d = atoi (decomp.droite);
if (borne_g > borne_d)
{
borne_d--;
sens = -1;
dim = borne_g - borne_d;
}
else
{
borne_d++;
sens = 1;
dim = borne_d - borne_g;
}
}
}
}
if (val == NULL)
Erreur ("INIT unvalid parameter");
strcpy (tmp_valeur, val);
switch (dim)
{
case 0:
{
FormatValue (value,tmp_valeur,1,GNP_UP,0);
tmp_paini = pat_addpaini (tmp_paini, buffer, *value);
break;
}
case 1:
{
strcat (buffer," ");
strcat (buffer,decomp.gauche);
FormatValue (value,tmp_valeur,1,GNP_UP,0);
tmp_paini = pat_addpaini (tmp_paini, buffer, *value);
break;
}
default:
{
FormatValue (value,tmp_valeur,dim,sens,0);
for (i=borne_g, j=0; i != borne_d; i = i + sens, j++)
{
sprintf (buffer_anx, "%s %d", buffer, i);
tmp_paini = pat_addpaini (tmp_paini, buffer_anx, value[j]);
}
tmp_paini = (struct paini *) reverse ((struct chain *)tmp_paini);
}
}
CreatePapat (NULL, NULL, tmp_paini);
CreateAction ("I");
}

View File

@ -0,0 +1,71 @@
/*
* 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 progam is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Alliance VLSI CAD System is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/****************************************************************/
/* module : label.c */
/* date : 02/09/93 */
/* auteurs : PITON */
/****************************************************************/
#ident "$Id: LABEL.c,v 1.1 2002/05/30 13:28:15 xtof Exp $"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "mut.h"
#include "pat.h"
#include "libpat_l.h"
/* ###--------------------------------------------------------------### */
/* function : LABEL */
/* description : set current pattern label */
/* called func. : none */
/* ###--------------------------------------------------------------### */
void d_LABEL(ident)
char *ident;
{
char buffer[20];
int i = 1;
/* namealloc must be performed after mbkenv() - Czo - */
if (!CATA_LIB || !WORK_LIB)
mbkenv();
if (ident == NULL)
Erreur ("LABEL missing argument");
strncpy(buffer,ident,19);
KillEsp(buffer);
if( isalpha(buffer[0]) == 0 )
Erreur ("IDENT error not an identifier");
while (buffer[i] != '\0')
{
if( (isalpha(buffer[i])==0) && (isalnum(buffer[i])==0) && (buffer[i] != '_'))
Erreur ("IDENT error not an identifier");
i++;
}
CreatePapat (buffer, NULL,NULL);
}

View File

@ -0,0 +1,68 @@
#
# 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 progam is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# Alliance VLSI CAD System is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with the GNU C Library; see the file COPYING. If not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
include $(ALLIANCE_TOP)/etc/$(ALLIANCE_OS).mk
include $(ALLIANCE_TOP)/etc/libraries.mk
LOCAL_TRGBIN = $(TARGET_BIN)
LOCAL_TRGLIB = $(TARGET_LIB)
LOCAL_TRGINC = $(TARGET_INCLUDE)
LOCAL_INC = $(ALLIANCE_INCLUDE)
LOCAL_CFLAGS = $(CFLAGS) -Wall -I$(LOCAL_INC) -I$(ALLIANCE_INCLUDE) \
-DPPT_H='"$(PPT_H)"' \
-DPHL_H='"$(PHL_H)"' \
-DPAT_H='"$(PAT_H)"' \
-DMUT_H='"$(MUT_H)"'
LOCAL_OBJECTS = ARRAY.o DECLAR.o DEF_GEN.o SAV_GEN.o INIT.o AFFECT.o \
SAVE.o CONV.o libpat_l.o GETCPAT.o LABEL.o SETTUNIT.o
LOCAL_LIBLIST = -lPgn103 $(PPT_L) $(PAT_L) $(PHL_L) $(MUT_L)
.c.o:
$(CC) -c $< $(LOCAL_CFLAGS)
all $(LOCAL_TRGBIN)/genpat : $(LOCAL_TRGLIB)/libPgn103.a
$(CP) genpat $(LOCAL_TRGBIN)/genpat
$(CP) genpat.h $(LOCAL_TRGINC)/genpat.h
cd tests ; $(MAKE)
$(LOCAL_TRGLIB)/libPgn103.a : $(LOCAL_OBJECTS)
$(AR) $(ARFLAGS) $(LOCAL_TRGLIB)/libPgn103.a $(LOCAL_OBJECTS)
$(RANLIB) $(LOCAL_TRGLIB)/libPgn103.a
clean :
-$(RM) -f $(LOCAL_OBJECTS)
-$(RM) -f *.bak .*.bak *~ .*~ core
distclean realclean : clean
-$(RM) -f $(LOCAL_TRGBIN)/genpat $(LOCAL_TRGLIB)/libPgn103.a $(LOCAL_TRGINC)/genpat.h

View File

@ -0,0 +1,15 @@
AM_CFLAGS = @ALLIANCE_CFLAGS@
lib_LIBRARIES = libPgn.a
include_HEADERS = genpat.h
libPgn_a_SOURCES = AFFECT.c ARRAY.c CONV.c DECLAR.c DEF_GEN.c GETCPAT.c \
INIT.c LABEL.c SAVE.c SAV_GEN.c SETTUNIT.c \
genpat.1 libpat_l.c libpat_l.h
bin_SCRIPTS = genpat
CLEANFILES = genpat
genpat : ${srcdir}/genpat.sh
${SED} 's,__ALLIANCE_INSTALL_DIR__,$(ALLIANCE_INSTALL_DIR),' $< > $@
chmod a+x $@
EXTRA_DIST = genpat.sh

View File

@ -0,0 +1,49 @@
/*
* 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 progam is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Alliance VLSI CAD System is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/************************************************************************/
/* module : save.c */
/* date : 02/09/93 */
/* auteurs : RENAUD & VENOT & PITON */
/************************************************************************/
#ident "$Id: SAVE.c,v 1.1 2002/05/30 13:28:15 xtof Exp $"
#include <stdio.h>
#include "pat.h"
#include "libpat_l.h"
/* ###--------------------------------------------------------------### */
/* function : SAVE */
/* description : modify Flag in PASEQ Structure */
/* called func. : Erreur */
/* ###--------------------------------------------------------------### */
void SAVE ()
{
if (racine_paseq == NULL)
Erreur ("SAVE must declare output file's name first\n");
racine_paseq->SAVFLG = 'Y';
}

View File

@ -0,0 +1,97 @@
/*
* 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 progam is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Alliance VLSI CAD System is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/***************************************************************/
/* module : fnct_genpat */
/* date : 28/03/92 */
/* auteurs : RENAUD & VENOT & PITON */
/***************************************************************/
#ident "$Id: SAV_GEN.c,v 1.1 2002/05/30 13:28:15 xtof Exp $"
#include <stdio.h>
#include "mut.h"
#include "pat.h"
#include "phl.h"
#include "ppt.h"
#include "libpat_l.h"
/*--------------------------------------------------------------*/
void d_SAV_GENPAT()
{
struct paiol *tmp_paiol;
struct paevt *tmp_paevt;
int i = 0;
/* namealloc must be performed after mbkenv() - Czo - */
if (!CATA_LIB || !WORK_LIB)
mbkenv();
if (racine_pagrp != NULL)
racine_pagrp = (struct pagrp*) reverse ((void *)racine_pagrp);
if (racine_papat == NULL)
Erreur("not all inputs initialized \n");
else
racine_papat = (struct papat*) reverse ((void *)racine_papat);
if ( racine_papat->PAEVT == NULL )
Erreur("not all inputs initialized \n");
tmp_paiol = racine_paiol;
while (tmp_paiol != NULL)
{
if (tmp_paiol->MODE == 'I')
{
tmp_paevt = racine_papat->PAEVT;
while (tmp_paevt != NULL)
{
if (tmp_paevt->INDEX == i)
break;
tmp_paevt = tmp_paevt->NEXT;
}
if (tmp_paevt == NULL)
Erreur ("not all inputs initialized at pattern zero \n");
}
i++;
tmp_paiol = tmp_paiol->NEXT;
}
racine_paseq->SUBSEQ = 1;
racine_paseq->ENDFLG = 'Y';
racine_paseq->ERRFLG = 0;
/*--------
pat_debug (racine_paseq,"paseq");
---------*/
pat_savpaseq (racine_paseq->NAME, racine_paseq, MAX_LABEL);
if (racine_pagrp != NULL)
racine_pagrp = (struct pagrp*) reverse ((void *)racine_pagrp);
}

View File

@ -0,0 +1,120 @@
/*
* 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 progam is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Alliance VLSI CAD System is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/****************************************************************/
/* module : settunit.c */
/* date : 02/09/93 */
/* auteurs : PITON */
/****************************************************************/
#ident "$Id: SETTUNIT.c,v 1.1 2002/05/30 13:28:15 xtof Exp $"
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "mut.h"
#include "pat.h"
#include "libpat_l.h"
/* ###--------------------------------------------------------------### */
/* function : SETTUNIT */
/* description : set pat time unit */
/* called func. : none */
/* ###--------------------------------------------------------------### */
/* Czo : 2000/09/04 */
void d_SETTUNIT(ident)
char *ident;
{
/* namealloc must be performed after mbkenv() - Czo - */
if (!CATA_LIB || !WORK_LIB)
mbkenv();
if (ident == NULL)
Erreur ("SETTUNIT missing argument");
if ((strlen (ident) == 0) || (namealloc(ident) == namealloc("vu")))
{
PAT_TIMEUNIT = PAT_TU__VU ;
PAT_CNV_FS = 0.0 ;
PAT_CNV_PS = 0.0 ;
PAT_CNV_NS = 0.0 ;
PAT_CNV_US = 0.0 ;
PAT_CNV_MS = 0.0 ;
}
else if (namealloc(ident) == namealloc("fs"))
{
PAT_TIMEUNIT = PAT_TU__FS ;
PAT_CNV_FS = 1.0 ;
PAT_CNV_PS = 1.0E3 ;
PAT_CNV_NS = 1.0E6 ;
PAT_CNV_US = 1.0E9 ;
PAT_CNV_MS = 1.0E12 ;
}
else if (namealloc(ident) == namealloc("ps"))
{
PAT_TIMEUNIT = PAT_TU__PS ;
PAT_CNV_FS = 1.0E-3 ;
PAT_CNV_PS = 1.0 ;
PAT_CNV_NS = 1.0E3 ;
PAT_CNV_US = 1.0E6 ;
PAT_CNV_MS = 1.0E9 ;
}
else if (namealloc(ident) == namealloc("ns"))
{
PAT_TIMEUNIT = PAT_TU__NS ;
PAT_CNV_FS = 1.0E-6 ;
PAT_CNV_PS = 1.0E-3 ;
PAT_CNV_NS = 1.0 ;
PAT_CNV_US = 1.0E3 ;
PAT_CNV_MS = 1.0E6 ;
}
else if (namealloc(ident) == namealloc("us"))
{
PAT_TIMEUNIT = PAT_TU__US ;
PAT_CNV_FS = 1.0E-9 ;
PAT_CNV_PS = 1.0E-6 ;
PAT_CNV_NS = 1.0E-3 ;
PAT_CNV_US = 1.0 ;
PAT_CNV_MS = 1.0E3 ;
}
else if (namealloc(ident) == namealloc("ms"))
{
PAT_TIMEUNIT = PAT_TU__MS ;
PAT_CNV_FS = 1.0E-12 ;
PAT_CNV_PS = 1.0E-9 ;
PAT_CNV_NS = 1.0E-6 ;
PAT_CNV_US = 1.0E-3 ;
PAT_CNV_MS = 1.0 ;
}
else
{
Erreur ("SETTUNIT : illegal time unit");
}
if (racine_paseq != NULL)
racine_paseq->TIME_UNIT = PAT_TIMEUNIT;
}

View File

@ -0,0 +1,78 @@
/*
* 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 progam is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Alliance VLSI CAD System is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/***************************************************************/
/* module : libpat_h.h */
/* date : 28/03/92 */
/* auteurs : RENAUD & VENOT */
/***************************************************************/
/* $Id: genpat.h,v 1.1 2002/05/30 13:28:15 xtof Exp $ */
#ifndef GENPAT_H
#define GENPAT_H
#define DEF_GENPAT GNP_LINE = __LINE__ , d_DEF_GENPAT
#define DECLAR GNP_LINE = __LINE__ , d_DECLAR
#define ARRAY GNP_LINE = __LINE__ , d_ARRAY
#define AFFECT GNP_LINE = __LINE__ , d_AFFECT
#define INIT GNP_LINE = __LINE__ , d_INIT
#define LABEL GNP_LINE = __LINE__ , d_LABEL
#define SETTUNIT GNP_LINE = __LINE__ , d_SETTUNIT
#define GETCPAT GNP_LINE = __LINE__ , d_GETCPAT
#define CONV GNP_LINE = __LINE__ , d_CONV
#define SAV_GENPAT GNP_LINE = __LINE__ , d_SAV_GENPAT
#define IN "I"
#define OUT "O"
#define INOUT "T"
#define REGISTER "R"
#define SIGNAL "S"
#define SPY "S"
extern unsigned int GNP_LINE;
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
extern void d_DEF_GENPAT __P((char *chaine));
extern void d_DECLAR __P((char *ident, char *space, char *format, char *mode, char *size, char *option));
extern void d_ARRAY __P(());
extern void d_AFFECT __P((char *pat_numb, char *ident, char *val));
extern void d_INIT __P((char *pat_numb, char *ident, char *val));
extern void d_LABEL __P((char *ident));
extern void d_SETTUNIT __P((char *ident));
extern unsigned long d_GETCPAT __P(());
extern char * d_CONV __P((int entier));
extern void d_SAV_GENPAT __P(());
#endif

116
alliance/src/genpat/src/genpat.sh Executable file
View File

@ -0,0 +1,116 @@
#!/bin/sh
# $Id: genpat.sh,v 1.1 2002/05/30 13:28:15 xtof Exp $
#set -v
#set -x
help() {
echo "Syntax: `basename $0` [-vk] source-file (without extension)"
echo " -v : verbose mode"
echo " -k : keeps the executable (whith debugging"
echo " informations) along with the"
echo " compilation Makefile after completion"
exit 1
}
if [ $# -lt 1 -o $# -gt 4 ] ; then
help 1 2
fi
debug=
talk=0
keep=0
name=""
while [ $# -gt 0 ]
do
case $1 in
-v) talk=1;;
-k) keep=1;debug=-g;;
-vk) keep=1;debug=-g; talk=1;;
-kv) keep=1;debug=-g; talk=1;;
*) if [ -z "$name" ]; then
name=$1;
else
help
fi
esac
shift
done
trap "rm -f ./*.$$; exit 0" 1 2 3 6
alcbanner "GenPat" "3.1" "Procedural GENeration of test PATterns" "1991"
if [ -z "$name" ] ; then
help
fi
if [ ! -f $name.c ] ; then
echo "There seems no to be a file called $name.c"
help
fi
if [ $talk -eq 1 ]; then
echo "Generating the Makefile";
fi
makefile="Makefile.$$"
cat << EOF > $makefile
ALLIANCE_LIBRARY = -L\$(ALLIANCE_TOP)/lib \\
-lPgn \\
-lPpt \\
-lPhl \\
-lPat \\
-lMut \\
-lRcn
ALLIANCE_INC = -I\$(ALLIANCE_TOP)/include
$name : $name.c
\$(CC) $debug -o $name $name.c \$(ALLIANCE_INC) \$(ALLIANCE_LIBRARY)
EOF
if [ $talk -eq 1 ]; then
echo "Compiling, ..."
fi
make -f $makefile > $name.grr 2>&1
if [ ! $? -eq 0 ]; then
echo "Compilation failed!"
cat $name.grr
exit 1
fi
if [ $talk -eq 1 ] ; then
echo "Current execution environment"
echo "MBK_CATA_LIB : ${MBK_CATA_LIB-no cell library specified}"
echo "MBK_WORK_LIB : ${MBK_WORK_LIB-:}"
echo "MBK_IN_LO : ${MBK_IN_LO-vst}"
echo "MBK_OUT_LO : ${MBK_OUT_LO-vst}"
echo "MBK_IN_PH : ${MBK_IN_PH-ap}"
echo "MBK_OUT_PH : ${MBK_OUT_PH-ap}"
echo "MBK_CATAL_NAME : ${MBK_CATAL_NAME-CATAL}"
fi
if [ $talk -eq 1 ]; then
echo "Executing ..."
fi
./$name
exit_code=$?
if [ $talk -eq 1 ]; then
echo "Removing tmp files ..."
fi
if [ $keep -eq 0 ] ; then
rm $name;
fi
rm $name.o $name.grr $makefile > /dev/null 2>&1
exit $exit_code

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,173 @@
/*
* 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 progam is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* Alliance VLSI CAD System is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU C Library; see the file COPYING. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/***************************************************************/
/* module : libpat_l.h */
/* date : 12/04/92 */
/* auteurs : RENAUD & VENOT */
/***************************************************************/
/* $Id: libpat_l.h,v 1.1 2002/05/30 13:28:15 xtof Exp $ */
#ifndef LIBPAT_L_H
#define LIBPAT_L_H
/*------------------------------------------------------------
* CONSTANTES
*------------------------------------------------------------*/
#define GNP_MAXPILE_PARAM 40
/* sp_.. pointe#include MUT_H tjrs sur le suivant */
#define GNP_PARAM_COURANT (sp_file_param - 1)
#define GNP_MAXTAB_IDENT 4096
#define GNP_MAXTAB_PAIOL 4096
#define GNP_NO_DUPLICATE -1
#define GNP_NOT_FOUND -1
#define GNP_ACTIF 1
#define GNP_INACTIF 0
#define GNP_VECTEUR_VIRTUEL 1
#define GNP_VECTEUR_EFFECTIF 0
#define GNP_UP 1
#define GNP_DO -1
/*------------------------------------------------------------
* STRUCTURE PAT
*------------------------------------------------------------*/
#define racine_pagrp (racine_paseq->PAGRP)
#define racine_paiol (racine_paseq->PAIOL)
#define racine_papat (racine_paseq->CURPAT)
#define racine_pacom (racine_paseq->CURCOM)
#define racine_paevt (racine_paseq->CURPAT->PAEVT)
#define racine_paini (racine_paseq->CURPAT->PAINI)
#define PATNUMBER (racine_paseq->PATNBR)
#define IOLNUMBER (racine_paseq->IOLNBR)
extern struct paseq *racine_paseq;
/*------------------------------------------------------------
* NUMERO DE PATTERN COURANT
*------------------------------------------------------------*/
extern unsigned long GNP_PATTERN_COURANT;
/*------------------------------------------------------------
* TAILLE DU MAX. LABEL
*------------------------------------------------------------*/
extern unsigned int MAX_LABEL;
/*------------------------------------------------------------
* TABLE DES PAIOLs
*------------------------------------------------------------*/
extern struct paiol *tab_paiol[];
extern int GNP_PAIOL_INDEX;
extern int GNP_TAB_PAIOL_CREE;
/*------------------------------------------------------------
* GESTION DES PARAMETRES A NOMBRE INDETERMINE
*------------------------------------------------------------*/
struct alpha_num {
char gauche[6];
char droite[6];
char alpha[7];
};
extern char *pile_param[];
extern int sp_pile_param ;
extern int sp_file_param ;
extern FILE *fp;
/*------------------------------------------------------------
* TABLE DES IDENTIFICATEURS
*------------------------------------------------------------*/
typedef struct {
int duplicate;
int num_paiol;
void * pointeur;
} Tptab_ident;
extern Tptab_ident tab_ident[];
extern int ind_tab_ident;
/*------------------------------------------------------------*
* CONSTANTES DE LA LIBRAIRIE *
*------------------------------------------------------------*/
#define GNP_HASHSIZE 29
/*------------------------------------------------------------*
* TABLES DE HACHAGE *
*------------------------------------------------------------*/
typedef struct _elt
{
char *name;
int num_index;
int sens; /* definit l'ordre de declaration des poids
des elements d'un vecteur */
struct _elt *next;
}elt;
extern elt *hash_paiol[GNP_HASHSIZE];
extern elt *hash_pagrp[GNP_HASHSIZE];
/*------------------------------------------------------------*
* FONCTIONS DE LA LIBRAIRIE *
*------------------------------------------------------------*/
#ifndef __P
# if defined(__STDC__) || defined(__GNUC__)
# define __P(x) x
# else
# define __P(x) ()
# endif
#endif
extern void InitHash __P((elt *tab[]));
extern elt * ExisteIdent __P((char *ident, elt *tab[]));
extern elt * SymbAlloc __P((char *ident, elt *tab[]));
extern int FindIdent __P((char *ident, elt *tab[]));
extern void Erreur __P((char *chaine));
extern void KillEsp __P((char *name));
extern void CheckIdent __P((char *ident));
extern char CheckSeparate __P((char *chn_blk));
extern char CheckFormat __P((char *format));
extern char CheckType __P((char *type));
extern char CheckOption __P((char *option));
extern void CheckPattern __P((char *pattern));
extern void CheckWidth __P((struct alpha_num *chaine));
extern void DupPaiol __P((int duplicate, char format, char *param_effectif, char *param_virtuel, char i_o, char blk, char flg));
extern void TraiterChaine __P((char *chaine, struct alpha_num *traite));
extern void SplitIdent __P((char *chaine, char *ident));
extern void FormatValue __P((char *ret_val, char *value, int nb_car, int sens, int i_o));
extern char * DefileParam __P(());
extern void EmpileParam __P((char *param));
extern void CreatePapat __P((char *label, struct paevt *lst_event, struct paini *lst_ini));
extern void CreatePaiol __P((char format, char *ident, char mode, char blk, char flg));
extern void CreatePagrp __P((char *ident, int length, int sens, short type_vecteur));
extern void CreateAction __P((char *act_type));
extern struct paevt * CreatePaevt __P((struct paevt *tete_paevt, int num_ident, char valeur));
extern struct paevt * FusionPaevt __P((struct paevt *lst_event, struct paevt *tete_event));
extern struct paini * FusionPaini __P((struct paini *fst_ini, struct paini *scd_ini));
extern void MajPatternCourant __P((char *pattern));
#endif