1GENPAT(1)                   ALLIANCE USER COMMANDS                   GENPAT(1)
2
3
4

NAME

6       genpat, A procedural pattern file generator
7
8

SYNOPSIS

10       genpat [-v] [-k] [file]
11
12
13

ORIGIN

15       This software belongs to the  ALLIANCE CAD SYSTEM developed by the ASIM
16       team at LIP6 laboratory of Université Pierre et Marie CURIE, in  Paris,
17       France.
18
19       Web : http://asim.lip6.fr/recherche/alliance/
20       E-mail : alliance-users@asim.lip6.fr
21
22

DESCRIPTION

24       Genpat  is a set of C fonctions that allows a procedural description of
25       input pattern file for the logic simulator ASIMUT. The Unix genpat com‐
26       mand  accepts a C file as input and produces a pattern description file
27       as output. The extension ".c" is not to be given. The file generated by
28       genpat  is  in  pat format, so IT IS STRONGLY RECOMMENDED TO SEE pat(5)
29       BEFORE THIS MANUAL.
30
31

OPTIONS

33       -v             verbose mode
34
35       -k             keeps the executable along with the compilation Makefile
36                      after completion
37
38

GENPAT FILE FORMAT

40       From  a  user  point  of view, genpat is a pattern description language
41       using all standard C  facilities  (include,  define,  variables,  loop,
42       ...).   Fonctions  provided  by genpat are to be used in a given order.
43       Using them in a different order won't crash the system, but will result
44       in execution errors. Here follows the description of the input file.
45
46
47       A  pat  format  file  can  be  divided  in  two parts : declaration and
48       description part.
49
50
51       The declaration part is the list of inputs, outputs,  internal  signals
52       and  registers.  Inputs are to be forced to a certain value and all the
53       others are to be observed during simulation.
54
55
56       The description part is a set of patterns, where each  pattern  defines
57       the value of inputs and outputs. The pattern number represents actually
58       the absolute time for the simulator.
59
60
61       Similarly, a genpat file can be divided in two parts : declaration  and
62       description  part.  Functions related to the declaration must be called
63       before any function related to the description part.
64
65
66       declaration part
67                 The first thing you should do in this part  is  to  give  the
68                 output  file's  name  (see  DEF_GENPAT(3)).  Then,  this part
69                 allows you to declare the inputs, the outputs,  and  internal
70                 observing points (see DECLAR(3)). It is also possible to cre‐
71                 ate virtual arraies (see ARRAY(3)).
72
73       description part
74                 After all signals are declared, you can begin to define input
75                 values  which  are to be applied to the inputs of the circuit
76                 or output values which are to be compare with the values pro‐
77                 duced   during   the  simulation.  (see  AFFECT(3)).   Genpat
78                 describes the stimulus by event : only signal transitions are
79                 described.  This part also allows you to give instructions to
80                 the simulation tool to save the state of the circuit  at  the
81                 end  of  the simulation. (see SAVE(3)). Last thing you should
82                 do in this part is to generate the output file (see  SAV_GEN‐
83                 PAT(3)).
84
85

FUNCTIONS

87       DEF_GENPAT()   defines the output file's name.
88
89       SAV_GENPAT()   make the output file be generated
90
91       DECLAR()       declares  inputs,  outputs,  and  the internal observing
92                      points.
93
94       ARRAY()        allows signals of the same type to  be  groupped  in  an
95                      "virtual array" in order to ease their manipulation
96
97       INIT()         changes the values of registers between two patterns.
98
99       AFFECT()       assigns  a value to a signal, at a given pattern number.
100                      This value is kept on the signal until a  new  value  is
101                      assigned to the signal.
102
103       SAVE()         informs  the  simulation  tool  to save the state of the
104                      circuit at the end of simulation
105
106       LABEL()        gives a label to the current pattern
107
108       GETCPAT()      return the number of the current pattern
109
110

EXAMPLES

112       #include <stdio.h>
113       #include "genpat.h"
114
115       char *inttostr(entier)
116       int entier;
117         {
118         char *str;
119         str = (char *) mbkalloc (32 * sizeof (char));
120         sprintf (str, "%d",entier);
121         return(str);
122         }
123          /*------------------------------*/
124          /* end of the description       */
125          /*------------------------------*/
126
127        main ()
128        {
129        int i;
130        int j;
131        int cur_vect = 0;
132
133        DEF_GENPAT("example");
134
135        /* interface */
136        DECLAR ("a", ":2", "X", IN, "3  downto 0", "" );
137        DECLAR ("b", ":2", "X", IN, "3  downto 0", "" );
138        DECLAR ("s", ":2", "X", OUT, "3 downto 0", "" );
139        DECLAR ("vdd", ":2", "B", IN, "", "" );
140        DECLAR ("vss", ":2", "B", IN, "", "" );
141
142        LABEL ("adder");
143        AFFECT ("0", "vdd", "0b1");
144        AFFECT ("0", "vss", "0b0");
145
146        for (i=0; i<16; i++)
147        {
148            for (j=0; j<16; j++)
149            {
150                AFFECT (inttostr(cur_vect), "a", inttostr(i) );
151                AFFECT (inttostr(cur_vect), "b", inttostr(j) );
152                cur_vect++;
153            }
154        }
155
156
157        SAV_GENPAT ();
158        }
159
160

ENVIRONMENT VARIABLES

162       Genpat reads the environment variable VH_PATSFX to give the result file
163       an extension.
164
165

SEE ALSO

167       AFFECT(3),  ARRAY(3),  DECLAR(3),  DEF_GENPAT(3),  GETCPAT(3), INIT(3),
168       LABEL(3), SAVE(3), SAV_GENPAT(3), pat(5), asimut(1)
169
170
171
172
173
174
175ASIM/LIP6                       October 1, 1997                      GENPAT(1)
Impressum