Subversion Repositories Vertical

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
/*
11 mjames 2
 *  contains the type declarations for generic information  
2 mjames 3
 *
11 mjames 4
 * $Header: c:\\cygwin\\cvsroot/Vert03/vertlib/generic.h,v 1.1.1.1 2003/11/04 23:34:57 mjames Exp $
2 mjames 5
 *
6
 * $Log: generic.h,v $
7
 * Revision 1.1.1.1  2003/11/04 23:34:57  mjames
8
 * Imported into local repositrory
9
 *
10
 * Revision 1.9  2002/09/27 22:38:07  MJAMES
11
 * Introduced automatic creation of partition generics
12
 *
13
 * Revision 1.8  2002/09/09 10:29:21  mjames
14
 * Removed set generic range and replaced it with a set generic value command
15
 * that takes both integers and ranges.
16
 *
17
 * Revision 1.7  2002/01/15 12:34:54  mjames
18
 * ALtered comments on the enumeration for generic classes
19
 *
20
 * Revision 1.6  2001/10/31 22:20:07  mjames
21
 * Tidying up problematical comments caused by CVS
22
 * 'intelligent' comment guessing
23
 *
24
 * Revision 1.5  2001/10/22 10:59:56  mjames
25
 * Added IS_ATTRIBUTE : a generic attribute used for controlling VERTICAL.
26
 * Can have either string or expression here.
27
 *
28
 * Revision 1.4  2001/06/06 12:10:21  mjames
29
 * Move from HPUX
30
 *
31
 * Revision 1.3  2001/04/06 22:47:02  mjames
32
 * Added doc2, the creator of documentation to Vertical scripts uses PERL
33
 * Also correcting generic behaviour and the printing of Verilog.
34
 *
35
 * Revision 1.2  2001/01/02 07:53:53  mjames
36
 * Made changes to allow for interface with TCL/Tk
37
 *
38
 * Revision 1.1.1.1  2000/10/19 21:58:38  mjames
39
 * Mike put it here
40
 *
41
 * Revision 1.25  2000/10/04  10:37:14  10:37:14  mjames (Mike James)
42
 * Modified for Vertical2 : support COMPONENTS and SIGNALS
11 mjames 43
 *
2 mjames 44
 * Revision 1.25  2000/10/04  10:37:14  10:37:14  mjames (Mike James)
45
 * Part of Release PSAVAT01
11 mjames 46
 *
2 mjames 47
 * Revision 1.24  2000/10/02  11:04:15  11:04:15  mjames (Mike James)
48
 * new_vhdl
11 mjames 49
 *
2 mjames 50
 * Revision 1.23  2000/09/27  14:42:30  14:42:30  mjames (Mike James)
51
 * Part of Release Sep_27_ST_2000
11 mjames 52
 *
2 mjames 53
 * Revision 1.22  2000/09/21  10:15:59  10:15:59  mjames (Mike James)
54
 * Part of Release Sep21Alpha
11 mjames 55
 *
2 mjames 56
 * Revision 1.21  2000/08/25  09:57:23  09:57:23  mjames (Mike James)
57
 * Part of Release Aug25_alpha
11 mjames 58
 *
2 mjames 59
 * Revision 1.20  2000/08/16  08:57:40  08:57:40  mjames (Mike James)
60
 * Part of Release CD01_Aug2000
11 mjames 61
 *
2 mjames 62
 * Revision 1.19  2000/08/14  14:45:19  14:45:19  mjames (Mike James)
63
 * Part of Release Aug_14_2000
11 mjames 64
 *
2 mjames 65
 * Revision 1.18  2000/08/11  08:30:39  08:30:39  mjames (Mike James)
66
 * Part of Release Aug_11_2000
11 mjames 67
 *
2 mjames 68
 * Revision 1.17  2000/08/09  10:31:57  10:31:57  mjames (Mike James)
69
 * Part of Release Aug__9_2000
11 mjames 70
 *
2 mjames 71
 * Revision 1.16  2000/05/31  11:43:10  11:43:10  mjames (Mike James)
72
 * Part of Release May_31_2000
11 mjames 73
 *
2 mjames 74
 * Revision 1.15  2000/05/08  17:01:46  17:01:46  mjames (Mike James)
75
 * Part of Release May__8_2000
11 mjames 76
 *
2 mjames 77
 * Revision 1.14  2000/05/08  16:59:39  16:59:39  mjames (Mike James)
78
 * Part of Release May__8_2000
11 mjames 79
 *
2 mjames 80
 * Revision 1.13  2000/05/08  16:57:16  16:57:16  mjames (Mike James)
81
 * Part of Release May__8_2000
11 mjames 82
 *
2 mjames 83
 * Revision 1.12  2000/03/08  16:19:09  16:19:09  mjames (Mike James)
84
 * New version including PC
11 mjames 85
 *
2 mjames 86
 * Revision 1.9  2000/01/20  15:58:58  15:58:58  mjames (Mike James)
87
 * Part of Release R22
11 mjames 88
 *
2 mjames 89
 * Revision 1.8  99/12/22  11:15:38  11:15:38  mjames (Mike James)
90
 * Part of Release Dec_22_1999
11 mjames 91
 *
2 mjames 92
 * Revision 1.7  99/11/23  13:52:06  13:52:06  mjames (Mike James)
93
 * Addded syntax to support special generics for Certify support
11 mjames 94
 *
2 mjames 95
 * Revision 1.6  99/06/18  09:25:18  09:25:18  mjames (Mike James)
96
 * Added new VHDL printing of generic information
11 mjames 97
 *
2 mjames 98
 * Revision 1.5  99/05/04  09:51:40  09:51:40  mjames (Mike James)
99
 * Amended generic lookup rules
11 mjames 100
 *
2 mjames 101
 * Revision 1.3  98/08/12  14:21:28  14:21:28  mjames (Mike James)
102
 * Added correct header files
11 mjames 103
 *
2 mjames 104
 * Revision 1.2  98/07/14  13:24:48  13:24:48  mjames (Mike James)
11 mjames 105
 * fixed errors in lookup of generic variables -
2 mjames 106
 * now works better
11 mjames 107
 *
2 mjames 108
 * Revision 1.1  98/02/11  11:26:21  11:26:21  mjames (Mike James)
109
 * Initial revision
110
 *  */
111
#if !defined _GENERIC
112
#define _GENERIC
113
 
114
#if !defined _EXPRESSION
115
#error Need to include expression.h before generic.h
116
#endif
117
 
11 mjames 118
/* this structure is used to provide a list of all expressions that make
2 mjames 119
   reference to a particular pointer */
11 mjames 120
typedef struct expr_ref
121
  {
122
  struct expr_ref * expr_ref;
123
  expression_t *    expr;
124
  } expr_ref_t;
125
 
2 mjames 126
 
127
 
128
 
11 mjames 129
typedef enum {
130
  NO_VALUE = 0,
131
  IS_STRING,      
132
  IS_INTEGER,
133
  IS_DECLARATION_DIRECTIVE,
134
  IS_INSTANCE_DIRECTIVE,
135
  IS_ENV_VAL,            /* environment value : string */
136
  IS_ATTRIBUTE,          /* component attribute : integer */
137
  IS_BOOLEAN
138
 
139
  } generic_type_t;
140
 
141
/* this is used to define whether a generic
142
   attached to an entity is
2 mjames 143
   a default or defined for that entity */
11 mjames 144
typedef enum {
145
  DEFAULT=0,
146
  DEFINED
147
  } generic_define_class_t;
2 mjames 148
 
149
/* need to define actual data types as otherwise there will be problems
11 mjames 150
 * definition eg. of integer range type which is assigned a fixed value.
2 mjames 151
 * e.g. signal s : integer range (0 to 31) := 23;. This is not supported
152
 * yet but it needs to be there....
153
 * As of December 2000 there are only a few defined data types */
11 mjames 154
 
155
typedef struct generic_info {
156
  struct generic_info * next;               /* neighbour in generic values */
157
  char * name;
158
  char * typename;  /* this section needs expansion into a types hierarchy */
159
  expression_t * expr; /* this is its current value as opposed to the type */
160
  expr_ref_t   * expr_ref; /* this is a pointer to the list of expressions that
161
                              refer to this generic */
162
  generic_type_t         g_type;
163
  generic_define_class_t g_class;
164
  unsigned int valid:1;
165
  unsigned int is_component_generic:1; /* is this generic part of a component template */
166
  } generic_info_t;
2 mjames 167
 
168
 
11 mjames 169
extern generic_info_t * global_generics;   /* a list of user set generics */
170
extern generic_info_t * partition_generics;/* a list of generics in the partition */
2 mjames 171
 
11 mjames 172
extern generic_type_t get_generic_value(
173
  generic_info_t ** list,
174
  char * name,
175
  generic_info_t * value);
2 mjames 176
 
11 mjames 177
extern generic_info_t * get_generic_ref(
178
  generic_info_t ** list,
179
  char * name);
2 mjames 180
 
11 mjames 181
extern int convert_num(char * string,int * value);
2 mjames 182
 
11 mjames 183
/* this function makes a copy of the info passed to it */
184
extern generic_info_t *  set_generic_value(generic_info_t ** list, generic_info_t * info);
2 mjames 185
 
186
/* this function will delete a generic expression whose
187
   name matches that given, if found on the list */
11 mjames 188
extern int del_generic_value(generic_info_t ** list, generic_info_t * info);
2 mjames 189
 
11 mjames 190
extern void list_generic_values(FILE * f,generic_info_t ** list,int indent);
2 mjames 191
 
192
 
11 mjames 193
extern void list_VHDL_generic_map_values(FILE * f,generic_info_t ** list) ;
2 mjames 194
 
195
 
11 mjames 196
extern void list_VHDL_generic_values(FILE * f,generic_info_t ** list) ;
197
 
198
extern void list_VHDL_constants(FILE * f,generic_info_t ** list) ;
199
 
2 mjames 200
struct socket; /* from database.h */
11 mjames 201
extern void copy_declaration_generics(struct socket * to,struct socket * from);
2 mjames 202
 
11 mjames 203
extern void clear_partition_generics(generic_info_t ** list);
2 mjames 204
 
205
 
11 mjames 206
extern void elaborate_all(void);
207
 
208
 
2 mjames 209
#endif