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