1 /*
2  * This file is part of the Alliance CAD System
3  * Copyright (C) Laboratoire LIP6 - D�partement ASIM
4  * Universite Pierre et Marie Curie
5  *
6  * Home page          : http://www-asim.lip6.fr/alliance/
7  * E-mail             : mailto:alliance-users@asim.lip6.fr
8  *
9  * This library is free software; you  can redistribute it and/or modify it
10  * under the terms  of the GNU Library General Public  License as published
11  * by the Free Software Foundation; either version 2 of the License, or (at
12  * your option) any later version.
13  *
14  * Alliance VLSI  CAD System  is distributed  in the hope  that it  will be
15  * useful, but WITHOUT  ANY WARRANTY; without even the  implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
17  * Public License for more details.
18  *
19  * You should have received a copy  of the GNU General Public License along
20  * with the GNU C Library; see the  file COPYING. If not, write to the Free
21  * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 
24 /* ###--------------------------------------------------------------### */
25 /* file		: pat109.h						*/
26 /* date		: Mar 10 2000						*/
27 /* version	: v109							*/
28 /* authors	: Pirouz BAZARGAN SABET					*/
29 /* description	: header for PAT library				*/
30 /* ###--------------------------------------------------------------### */
31 
32 #ifndef PAT_PATDEF
33 #define PAT_PATDEF
34 
35 	/* ###------------------------------------------------------### */
36 	/*    defines							*/
37 	/* ###------------------------------------------------------### */
38 
39 #define PAT_SEQ__IOLARRAY	0x01	/* paseq FLAGS: array of paiols	*/
40 #define PAT_SEQ__ZERODELAY	0x02	/* paseq FLAGS: zero delay desc	*/
41 
42 #define PAT_IOL__SPY            0x01    /* paiol FLAG : spied		*/
43 #define PAT_IOL__TRACE          0x02    /* paiol FLAG : traced		*/
44 
45 #define PAT_PAT__SPY            0x01    /* papat FLAG : spy pattern	*/
46 
47 #define PAT_SEQ__TIMEUNIT	0x07	/* time unit			*/
48 #define PAT_TU__VU		   0	/* time unit : virtual unit	*/
49 #define PAT_TU__FS		   1	/* time unit : fs		*/
50 #define PAT_TU__PS		   2	/* time unit : ps		*/
51 #define PAT_TU__NS		   3	/* time unit : ns		*/
52 #define PAT_TU__US		   4	/* time unit : us		*/
53 #define PAT_TU__MS		   5	/* time unit : ms		*/
54 
55 	/* ###------------------------------------------------------### */
56 	/*    global variables						*/
57 	/* ###------------------------------------------------------### */
58 
59 extern unsigned int  PAT_LINNUM  ;
60 
61 extern unsigned char PAT_TIMEUNIT;
62 extern unsigned int  PAT_TIMESTEP;
63 
64 extern float         PAT_CNV_FS  ;
65 extern float         PAT_CNV_PS  ;
66 extern float         PAT_CNV_NS  ;
67 extern float         PAT_CNV_US  ;
68 extern float         PAT_CNV_MS  ;
69 
70 	/* ###------------------------------------------------------### */
71 	/*    data structures						*/
72 	/* ###------------------------------------------------------### */
73 
74 typedef struct paseq			/* sequence of patterns		*/
75   {
76   struct paseq   *NEXT     ;		/* next sequence		*/
77   char           *NAME     ;		/* sequence's name		*/
78   struct pagrp   *PAGRP    ;		/* list of declared arraies	*/
79   struct paiol   *PAIOL    ;		/* list of inputs-outputs	*/
80   struct pacom   *DECCOM   ;		/* declaration part comments	*/
81   struct papat   *OLDPAT   ;		/* old list of patterns		*/
82   struct pacom   *OLDCOM   ;		/* old list of comments		*/
83   struct papat   *CURPAT   ;		/* current patterns		*/
84   struct pacom   *CURCOM   ;		/* current comments		*/
85   struct papat   *NXTPAT   ;		/* next patterns		*/
86   char           *MODEL    ;		/* model of a pttern		*/
87   char           *BUFFER   ;		/* accu. buffer to build pettern*/
88   struct pains   *PAINS    ;		/* inspected instances		*/
89   unsigned int    PATNBR   ;		/* # of patterns for simulation	*/
90   unsigned int    LINENO   ;		/* current line number		*/
91   unsigned short  IOLNBR   ;		/* # of inputs-outputs		*/
92   unsigned short  SUBSEQ   ;		/* subsequence number		*/
93   unsigned short  DRVSEQ   ;		/* last drived subsequence	*/
94   char            SAVFLG   ;		/* save flag 'Y' or 'N'		*/
95   char            ENDFLG   ;		/* end  flag 'Y' or 'N'		*/
96   unsigned char   ERRFLG   ;		/* error flag			*/
97   unsigned char   FLAGS    ;		/* flags			*/
98   unsigned char   TIME_UNIT;		/* time unit			*/
99   unsigned int    TIME_STEP;		/* time step			*/
100   }
101 paseq_list;
102 
103 typedef struct pains			/* inspected instance		*/
104   {
105   struct pains   *NEXT     ;		/* next inspected instance	*/
106   char           *INSNAME  ;		/* instance name		*/
107   char           *FILNAME  ;		/* file name			*/
108   void           *INSTANCE ;		/* instance pointer		*/
109   FILE           *FILPNT   ;		/* file pointer			*/
110   char           *MODEL    ;		/* model of generated pattern	*/
111   char          **VALUE    ;		/* instance's interface values	*/
112   }
113 pains_list;
114 
115 typedef struct pagrp			/* actual or virtual array	*/
116   {
117   struct pagrp   *NEXT     ;		/* next array			*/
118   char           *NAME     ;		/* array's name			*/
119   unsigned short  LENGTH   ;		/* array's number of bit	*/
120   unsigned short  FINDEX   ;		/* index of the first paiol	*/
121   short           FLAG     ;		/* actual or virtual (0,1)	*/
122   }
123 pagrp_list;
124 
125 typedef struct paiol			/* input-output signal		*/
126   {
127   struct paiol   *NEXT     ;		/* next input-output		*/
128   char           *NAME     ;		/* input-output's name		*/
129   void           *SIG      ;		/* pointer on the signal	*/
130   char            FORMAT   ;		/* read-write format B,O,X	*/
131   char            MODE     ;		/* mode I,B,O,Z,T,R,S,X,W,U	*/
132   char            BLANK    ;		/* number of blank columns	*/
133   char            VALUE    ;		/* (not used)			*/
134   char            FLAG     ;		/* flag				*/
135   }
136 paiol_list;
137 
138 typedef struct papat			/* pattern			*/
139   {
140   struct papat   *NEXT     ;		/* next pattern			*/
141   char           *LABEL    ;		/* pattern's label		*/
142   struct paini   *PAINI    ;		/* list of initializations	*/
143   struct paevt   *PAEVT    ;		/* list of events		*/
144   unsigned int    TIME     ;		/* pattern's absolute time	*/
145   unsigned short  LINE     ;		/* pattern's line number	*/
146   char            BLANK    ;		/* number of blank lines	*/
147   char            ACTFLAG  ;		/* action flag (U,I)		*/
148   char            SIMFLAG  ;		/* simulation flag (U,S)	*/
149   unsigned char   FLAG     ;		/* flag				*/
150   }
151 papat_list;
152 
153 typedef struct paini			/* initialized register		*/
154   {
155   struct paini   *NEXT     ;		/* next initialization		*/
156   char           *NAME     ;		/* register's name		*/
157   char            VALUE    ;		/* initialization's value	*/
158   }
159 paini_list;
160 
161 typedef struct paevt			/* event			*/
162   {
163   struct paevt   *NEXT     ;		/* next event			*/
164   unsigned short  INDEX    ;		/* input-output's index		*/
165   char            USRVAL   ;		/* value given by the user	*/
166   char            SIMVAL   ;		/* calculated value		*/
167   }
168 paevt_list;
169 
170 typedef struct pacom			/* comment line			*/
171   {
172   struct pacom   *NEXT     ;		/* next comment			*/
173   char           *TEXT     ;		/* text of the comment		*/
174   unsigned short  POSITION ;		/* nbr of decl. or pat. before	*/
175   }
176 pacom_list;
177 
178 	/* ###------------------------------------------------------### */
179 	/*    low-level functions					*/
180 	/* ###------------------------------------------------------### */
181 
182 extern struct paseq *pat_addpaseq ();	/* add a paseq structure	*/
183 extern struct papat *pat_addpapat ();	/* add a papat structure	*/
184 extern struct paevt *pat_addpaevt ();	/* add a paevt structure	*/
185 extern struct paini *pat_addpaini ();	/* add a paini structure	*/
186 extern struct pacom *pat_addpacom ();	/* add a pacom structure	*/
187 extern struct pagrp *pat_addpagrp ();	/* add a pagrp structure	*/
188 extern struct paiol *pat_addpaiol ();	/* add a paiol structure	*/
189 extern struct pains *pat_addpains ();	/* add a pains structure	*/
190 
191 extern struct paiol *pat_crtpaiol ();	/* create a table of paiols	*/
192 
193 extern void          pat_frepaiol ();	/* delete a list of paiols	*/
194 extern void          pat_frepaini ();	/* delete a list of painis	*/
195 extern void          pat_frepaevt ();	/* delete a list of paevts	*/
196 extern void          pat_frepapat ();	/* delete a list of papats	*/
197 extern void          pat_frepacom ();	/* delete a list of pacoms	*/
198 
199 extern int           pat_error    ();	/* pat error function		*/
200 extern int           pat_warning  ();	/* pat warning function		*/
201 extern int           pat_message  ();	/* pat message function		*/
202 
203 #endif
204