/************************************************************************* -------------------------------------------------------------------------- -------------------------------------------------------------------------- -- File Name : data_struct.h -- File type : A .h file -- Introduction : Includes data structures used by the parser -- Date Created : Jan 10, 1991 -- -- Author : Jayanta Roy -- Affiliation : University of Cincinnati, -- Department of Computer Engg. -- -- This document was created as a part of the project funded by -- the Defense Advanced Research Projects Agency under order no. -- 7056 monitored by the Federal Bureau of Investigation under -- contract no. J-FBI-89-094 and by the University of Cincinnati -- Research Council. -- -- Use of this document is strictly prohibited to those members of -- the community who do not beleive in sharing their efforts with -- others. Duplication and distribution is limited to specific -- request to the author. -- -- Copyright (C) 1990 -- University of Cincinnati, The Ohio Board of Regents -- Jayanta Roy and Ranga Vemuri -- All Rights Reserved -- -------------------------------------------------------------------------- -- Modification History : -------------------------------------------------------------------------- -------------------------------------------------------------------------- *************************************************************************/ struct symbol_table_rec { /* Symbol Table Record Format */ char* symbol_id=NULL; /* format is :: 'e' # symbol is an entity 'a' # symbol is an architecture 's' # symbol is a storage 'm' # symbol is a VIFmodule :: Sequential number example :: 'e1' , 's10' etc. */ char* parent_id=NULL; /* Same format as above - identifies the parent */ struct { /* a collection of 16 bits that identifies various attributes */ unsigned int is_bit_vector : 1; unsigned int is_array : 1; unsigned int is_alias : 1; unsigned int is_process : 1; unsigned int is_block : 1; unsigned int is_conc_sa : 1; unsigned int is_wait : 1; unsigned int is_subprogram : 1; unsigned int is_loop : 1; unsigned int is_port : 1; unsigned int is_signal : 1; unsigned int is_variable : 1; unsigned int is_formal : 1; unsigned int not_used : 3; } flags; struct { int from=0; int to=0; } word_struct; /* word structure */ struct { int from=0; int to=0; } bit_struct; /* bit structure */ char* resn_fn_id=NULL; // if it is a port or signal and has a resolution fn char* name=NULL; /* VHDL name if any */ int mode=0; /* If it is a port */ struct { struct symbol_table_rec *alias_of=NULL; struct constant_rec *cr_ptr=NULL; // Indicates the start index int start_index=0; } alias_info; struct symbol_table_rec *next_str_ptr=NULL; }; struct constant_rec { /* Constant Record Format */ char* constant_id=NULL; /* Format c eg. c10 */ int value=0; /* Decimal value of the constant */ int width=0; /* bit_width of the constant */ struct constant_rec *next_cr_ptr=NULL; }; struct inout { /* Inout format */ char* inout_id = NULL; /* format is :: 'i' # module input 'l' # local storage of module 'f' # formal parameter of module 'o' # module output 'p' # operator output :: Sequential number example :: 'i1' , 'p10' etc. */ char* destn_id=NULL; /* id of the destn as stored in the symbol table */ int width=0; /* Size of the carrier in context */ char* name=NULL; /* name of the carrier if any */ struct inout *next_io_ptr=NULL; }; struct input { /* Input Format : eg. (m11.i3) etc. */ char* inp_id=NULL; /* Of the form .: eg. m3.i2:blah */ struct input *next_in_ptr=NULL; }; struct op_erator { /* Operator Format */ char* op_id=NULL; /* Operator id : Format x eg. x7 */ int op_code=0; struct input* input_list=NULL; /* List of inputs */ struct branch_rec *br_ptr=NULL; // For SELECT/DIVERGE operators char *module_id=NULL; // For ENTER/LEAVE operators struct inout* output_list=NULL; /* List of outputs */ struct op_erator *next_op_ptr=NULL; }; struct module_rec { /* VIFmodule Format */ struct symbol_table_rec* str_ptr=NULL; // pointer to the Symbol Table Entry struct inout* input_list=NULL; // List of Inputs or Formal Parameters struct op_erator* operator_list=NULL; // List of Operators struct inout* output_list=NULL; // List of Outputs struct symbol_table_rec *STR_list=NULL; // All symbols for this module struct module_rec *prev_mr_ptr=NULL; struct module_rec *next_mr_ptr=NULL; }; struct carrier_info { // Used to build the data_flow graph in terms of operator list struct symbol_table_rec *str_ptr=NULL; char *op_inp_id=NULL; struct carrier_info *next_ci_ptr=NULL; }; struct context_rec { // used to store the context information of a module // used by push and pop routines struct module_rec *mr_ptr=NULL; // identifies the appropriate module int op_cnt=1; // stores current operator count of module int mo_inp_cnt=1; // stores current input count of module struct op_erator *curr_op_ptr=NULL; int mo_out_cnt=1; // stores current output count of module int op_out_cnt=1; // stores current operator output count of module struct carrier_info *ci_ptr=NULL; // stores current carrier info of module struct context_rec *prev_cxr_ptr=NULL; }; struct select_stack_rec { // used to stack parent information for recursive SELECT(IF) statements. // created/destroyed by push_select and pop_select routines. struct op_erator *parent_sel_op_ptr=NULL; int output_cnt=1; // output count for the SELECT operator int br_cnt=1; // branch count for the SELECT operator struct carrier_info *parent_ci_ptr=NULL; // Till the SELECT operator struct select_stack_rec *parent_ssr_ptr=NULL; }; struct branch_rec { // used to store branch specific information char *branch_id=NULL; // char *sel_val=NULL; // to be modified later struct branch_val_rec *bvr_list=NULL; // list of branch select values struct op_erator *op_ptr=NULL; struct branch_rec *next_br_ptr=NULL; }; struct branch_val_rec { // used to store a value of the branch int value=0; struct branch_val_rec *next_bvr_ptr=NULL; }; struct type_mark { int type=0; /* ARRAY, SIMPLE */ int bit_from=0; int bit_to=0; int arr_from=0; int arr_to=0; char *res_fn_name=NULL; }; struct id_rec { char *id=NULL; struct id_rec *next_id_ptr=NULL; }; struct type_decl { char *name=NULL; struct type_mark *type_mark_ptr=NULL; struct type_decl *next_td_ptr=NULL; }; struct range_rec { int range=0; int start_index=0; }; /**** Global pointers needed ****/ constant_rec *global_CR_ptr; symbol_table_rec *global_STR_ptr; module_rec *global_MR_ptr; type_decl *global_TD_ptr; /**** Currently used pointers ****/ symbol_table_rec *curr_ent_STR_ptr; module_rec *curr_MR_ptr; select_stack_rec *top_SSR_ptr; context_rec *curr_CXR_ptr; /**** Global Counts used *****/ int STR_cnt=1, CR_cnt=1; /**** Counts & Pointers used to build the module *****/ int OP_cnt=1, MO_inp_cnt=1, MO_out_cnt=1, OP_out_cnt=1, BR_cnt=1; carrier_info *CI_ptr; op_erator *curr_OP_ptr; int yydebug=0; int log_exp_env=NORMAL; /* function names needed for simulation */ char *stupid_simulator[NO_OF_FUNC_NAMES]={"bit_Wired_OR", "bit_Wired_AND", "int_Wired_OR", "int_Wired_AND", "bits_to_int", "int_to_bits"};