genpat, A procedural pattern file generator
genpat [-v] [-k] [file]
This software belongs to the ALLIANCE CAD system from the CAO-VLSI team at
ASIM/LIP6/UPMC laboratory.
LIP6/ASIM
University P. et M. Curie
4, place Jussieu
75252 PARIS Cedex 05
FRANCE
Fax : {33/0} 1.44.27.62.86
E-mail support : alliance-support@asim.lip6.fr
Genpat is a set of C fonctions that allows a procedural description of input pattern file for the logic simulator ASIMUT. The Unix genpat 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 genpat is in pat format, so IT IS STRONGLY RECOMMENDED TO SEE pat(5) BEFORE THIS MANUAL.
From a user point of view, genpat is a pattern description language using all standard C facilities (include, define, variables, loop, ...). Fonctions provided by genpat 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.
A pat format file can be divided in two parts : declaration and description part.
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.
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.
Similarly, a genpat 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.
declaration part
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)
).
description part
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)
).
#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);
}
/*------------------------------*/
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");
Genpat reads the environment variable VH_PATSFX to give the result file an extension.
AFFECT(3) , ARRAY(3) , DECLAR(3) , DEF_GENPAT(3) , GETCPAT(3) , INIT(3) , LABEL(3) , SAVE(3) , SAV_GENPAT(3) , pat(5) , asimut(1)
This tool is under development at the ASIM/LIP6/UPMC laboratory, cao-vlsi
research team.
We need your feedbak to improve documentation and tools.
If you find bugs, please fill-in the form at
http://asim.lip6.fr/alliance/support/bug-report/
Thanks for doing this.