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