Subversion Repositories Vertical

Rev

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

  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 Exp $
  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
  43.  *
  44.  * Revision 1.25  2000/10/04  10:37:14  10:37:14  mjames (Mike James)
  45.  * Part of Release PSAVAT01
  46.  *
  47.  * Revision 1.24  2000/10/02  11:04:15  11:04:15  mjames (Mike James)
  48.  * new_vhdl
  49.  *
  50.  * Revision 1.23  2000/09/27  14:42:30  14:42:30  mjames (Mike James)
  51.  * Part of Release Sep_27_ST_2000
  52.  *
  53.  * Revision 1.22  2000/09/21  10:15:59  10:15:59  mjames (Mike James)
  54.  * Part of Release Sep21Alpha
  55.  *
  56.  * Revision 1.21  2000/08/25  09:57:23  09:57:23  mjames (Mike James)
  57.  * Part of Release Aug25_alpha
  58.  *
  59.  * Revision 1.20  2000/08/16  08:57:40  08:57:40  mjames (Mike James)
  60.  * Part of Release CD01_Aug2000
  61.  *
  62.  * Revision 1.19  2000/08/14  14:45:19  14:45:19  mjames (Mike James)
  63.  * Part of Release Aug_14_2000
  64.  *
  65.  * Revision 1.18  2000/08/11  08:30:39  08:30:39  mjames (Mike James)
  66.  * Part of Release Aug_11_2000
  67.  *
  68.  * Revision 1.17  2000/08/09  10:31:57  10:31:57  mjames (Mike James)
  69.  * Part of Release Aug__9_2000
  70.  *
  71.  * Revision 1.16  2000/05/31  11:43:10  11:43:10  mjames (Mike James)
  72.  * Part of Release May_31_2000
  73.  *
  74.  * Revision 1.15  2000/05/08  17:01:46  17:01:46  mjames (Mike James)
  75.  * Part of Release May__8_2000
  76.  *
  77.  * Revision 1.14  2000/05/08  16:59:39  16:59:39  mjames (Mike James)
  78.  * Part of Release May__8_2000
  79.  *
  80.  * Revision 1.13  2000/05/08  16:57:16  16:57:16  mjames (Mike James)
  81.  * Part of Release May__8_2000
  82.  *
  83.  * Revision 1.12  2000/03/08  16:19:09  16:19:09  mjames (Mike James)
  84.  * New version including PC
  85.  *
  86.  * Revision 1.9  2000/01/20  15:58:58  15:58:58  mjames (Mike James)
  87.  * Part of Release R22
  88.  *
  89.  * Revision 1.8  99/12/22  11:15:38  11:15:38  mjames (Mike James)
  90.  * Part of Release Dec_22_1999
  91.  *
  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
  94.  *
  95.  * Revision 1.6  99/06/18  09:25:18  09:25:18  mjames (Mike James)
  96.  * Added new VHDL printing of generic information
  97.  *
  98.  * Revision 1.5  99/05/04  09:51:40  09:51:40  mjames (Mike James)
  99.  * Amended generic lookup rules
  100.  *
  101.  * Revision 1.3  98/08/12  14:21:28  14:21:28  mjames (Mike James)
  102.  * Added correct header files
  103.  *
  104.  * Revision 1.2  98/07/14  13:24:48  13:24:48  mjames (Mike James)
  105.  * fixed errors in lookup of generic variables -
  106.  * now works better
  107.  *
  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.  
  118. /* this structure is used to provide a list of all expressions that make
  119.    reference to a particular pointer */
  120. typedef struct expr_ref
  121.   {
  122.   struct expr_ref * expr_ref;
  123.   expression_t *    expr;
  124.   } expr_ref_t;
  125.  
  126.  
  127.  
  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.  
  141. /* this is used to define whether a generic
  142.    attached to an entity is
  143.    a default or defined for that entity */
  144. typedef enum {
  145.   DEFAULT=0,
  146.   DEFINED
  147.   } generic_define_class_t;
  148.  
  149. /* need to define actual data types as otherwise there will be problems
  150.  * definition eg. of integer range type which is assigned a fixed value.
  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 */
  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);
  180.  
  181. extern int convert_num(char * string,int * value);
  182.  
  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);
  185.  
  186. /* this function will delete a generic expression whose
  187.    name matches that given, if found on the list */
  188. extern int del_generic_value(generic_info_t ** list, generic_info_t * info);
  189.  
  190. extern void list_generic_values(FILE * f,generic_info_t ** list,int indent);
  191.  
  192.  
  193. extern void list_VHDL_generic_map_values(FILE * f,generic_info_t ** list) ;
  194.  
  195.  
  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.  
  200. struct socket; /* from database.h */
  201. extern void copy_declaration_generics(struct socket * to,struct socket * from);
  202.  
  203. extern void clear_partition_generics(generic_info_t ** list);
  204.  
  205.  
  206. extern void elaborate_all(void);
  207.  
  208.  
  209. #endif
  210.