OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gdb-6.8/] [pre-binutils-2.20.1-sync/] [sim/] [igen/] [gen.h] - Diff between revs 24 and 157

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 24 Rev 157
/* The IGEN simulator generator for GDB, the GNU Debugger.
/* The IGEN simulator generator for GDB, the GNU Debugger.
 
 
   Copyright 2002, 2007, 2008 Free Software Foundation, Inc.
   Copyright 2002, 2007, 2008 Free Software Foundation, Inc.
 
 
   Contributed by Andrew Cagney.
   Contributed by Andrew Cagney.
 
 
   This file is part of GDB.
   This file is part of GDB.
 
 
   This program is free software; you can redistribute it and/or modify
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.
   (at your option) any later version.
 
 
   This program is distributed in the hope that it will be useful,
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
   GNU General Public License for more details.
 
 
   You should have received a copy of the GNU General Public License
   You should have received a copy of the GNU General Public License
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
 
 
typedef struct _opcode_field opcode_field;
typedef struct _opcode_field opcode_field;
struct _opcode_field
struct _opcode_field
{
{
  int word_nr;
  int word_nr;
  int first;
  int first;
  int last;
  int last;
  int is_boolean;
  int is_boolean;
  int nr_opcodes;
  int nr_opcodes;
  unsigned boolean_constant;
  unsigned boolean_constant;
  opcode_field *parent;
  opcode_field *parent;
};
};
 
 
typedef struct _opcode_bits opcode_bits;
typedef struct _opcode_bits opcode_bits;
struct _opcode_bits
struct _opcode_bits
{
{
  int value;
  int value;
  int first;
  int first;
  int last;
  int last;
  insn_field_entry *field;
  insn_field_entry *field;
  opcode_field *opcode;
  opcode_field *opcode;
  opcode_bits *next;
  opcode_bits *next;
};
};
 
 
typedef struct _insn_opcodes insn_opcodes;
typedef struct _insn_opcodes insn_opcodes;
struct _insn_opcodes
struct _insn_opcodes
{
{
  opcode_field *opcode;
  opcode_field *opcode;
  insn_opcodes *next;
  insn_opcodes *next;
};
};
 
 
typedef struct _insn_list insn_list;
typedef struct _insn_list insn_list;
struct _insn_list
struct _insn_list
{
{
  /* the instruction */
  /* the instruction */
  insn_entry *insn;
  insn_entry *insn;
  /* list of non constant bits that have been made constant */
  /* list of non constant bits that have been made constant */
  opcode_bits *expanded_bits;
  opcode_bits *expanded_bits;
  /* list of the various opcode field paths used to reach this
  /* list of the various opcode field paths used to reach this
     instruction */
     instruction */
  insn_opcodes *opcodes;
  insn_opcodes *opcodes;
  /* number of prefetched words for this instruction */
  /* number of prefetched words for this instruction */
  int nr_prefetched_words;
  int nr_prefetched_words;
  /* The semantic function list_entry corresponding to this insn */
  /* The semantic function list_entry corresponding to this insn */
  insn_list *semantic;
  insn_list *semantic;
  /* linked list */
  /* linked list */
  insn_list *next;
  insn_list *next;
};
};
 
 
/* forward */
/* forward */
typedef struct _gen_list gen_list;
typedef struct _gen_list gen_list;
 
 
typedef struct _gen_entry gen_entry;
typedef struct _gen_entry gen_entry;
struct _gen_entry
struct _gen_entry
{
{
 
 
  /* as an entry in a table */
  /* as an entry in a table */
  int word_nr;
  int word_nr;
  int opcode_nr;
  int opcode_nr;
  gen_entry *sibling;
  gen_entry *sibling;
  opcode_bits *expanded_bits;
  opcode_bits *expanded_bits;
  gen_entry *parent;            /* parent has the opcode* data */
  gen_entry *parent;            /* parent has the opcode* data */
 
 
  /* as a table containing entries */
  /* as a table containing entries */
  decode_table *opcode_rule;
  decode_table *opcode_rule;
  opcode_field *opcode;
  opcode_field *opcode;
  int nr_prefetched_words;
  int nr_prefetched_words;
  int nr_entries;
  int nr_entries;
  gen_entry *entries;
  gen_entry *entries;
 
 
  /* as both an entry and a table */
  /* as both an entry and a table */
  int nr_insns;
  int nr_insns;
  insn_list *insns;
  insn_list *insns;
 
 
  /* if siblings are being combined */
  /* if siblings are being combined */
  gen_entry *combined_next;
  gen_entry *combined_next;
  gen_entry *combined_parent;
  gen_entry *combined_parent;
 
 
  /* our top-of-tree */
  /* our top-of-tree */
  gen_list *top;
  gen_list *top;
};
};
 
 
 
 
struct _gen_list
struct _gen_list
{
{
  model_entry *model;
  model_entry *model;
  insn_table *isa;
  insn_table *isa;
  gen_entry *table;
  gen_entry *table;
  gen_list *next;
  gen_list *next;
};
};
 
 
 
 
typedef struct _gen_table gen_table;
typedef struct _gen_table gen_table;
struct _gen_table
struct _gen_table
{
{
  /* list of all the instructions */
  /* list of all the instructions */
  insn_table *isa;
  insn_table *isa;
  /* list of all the semantic functions */
  /* list of all the semantic functions */
  decode_table *rules;
  decode_table *rules;
  /* list of all the generated instruction tables */
  /* list of all the generated instruction tables */
  gen_list *tables;
  gen_list *tables;
  /* list of all the semantic functions */
  /* list of all the semantic functions */
  int nr_semantics;
  int nr_semantics;
  insn_list *semantics;
  insn_list *semantics;
};
};
 
 
 
 
extern gen_table *make_gen_tables (insn_table *isa, decode_table *rules);
extern gen_table *make_gen_tables (insn_table *isa, decode_table *rules);
 
 
 
 
extern void gen_tables_expand_insns (gen_table *gen);
extern void gen_tables_expand_insns (gen_table *gen);
 
 
extern void gen_tables_expand_semantics (gen_table *gen);
extern void gen_tables_expand_semantics (gen_table *gen);
 
 
extern int gen_entry_depth (gen_entry *table);
extern int gen_entry_depth (gen_entry *table);
 
 
 
 
 
 
/* Traverse the created data structure */
/* Traverse the created data structure */
 
 
typedef void gen_entry_handler
typedef void gen_entry_handler
  (lf *file, gen_entry *entry, int depth, void *data);
  (lf *file, gen_entry *entry, int depth, void *data);
 
 
extern void gen_entry_traverse_tree
extern void gen_entry_traverse_tree
  (lf *file,
  (lf *file,
   gen_entry *table,
   gen_entry *table,
   int depth,
   int depth,
   gen_entry_handler * start,
   gen_entry_handler * start,
   gen_entry_handler * leaf, gen_entry_handler * end, void *data);
   gen_entry_handler * leaf, gen_entry_handler * end, void *data);
 
 
 
 
 
 
/* Misc functions - actually in igen.c */
/* Misc functions - actually in igen.c */
 
 
 
 
/* Cache functions: */
/* Cache functions: */
 
 
extern int print_icache_function_formal (lf *file, int nr_prefetched_words);
extern int print_icache_function_formal (lf *file, int nr_prefetched_words);
 
 
extern int print_icache_function_actual (lf *file, int nr_prefetched_words);
extern int print_icache_function_actual (lf *file, int nr_prefetched_words);
 
 
extern int print_icache_function_type (lf *file);
extern int print_icache_function_type (lf *file);
 
 
extern int print_semantic_function_formal (lf *file, int nr_prefetched_words);
extern int print_semantic_function_formal (lf *file, int nr_prefetched_words);
 
 
extern int print_semantic_function_actual (lf *file, int nr_prefetched_words);
extern int print_semantic_function_actual (lf *file, int nr_prefetched_words);
 
 
extern int print_semantic_function_type (lf *file);
extern int print_semantic_function_type (lf *file);
 
 
extern int print_idecode_function_formal (lf *file, int nr_prefetched_words);
extern int print_idecode_function_formal (lf *file, int nr_prefetched_words);
 
 
extern int print_idecode_function_actual (lf *file, int nr_prefetched_words);
extern int print_idecode_function_actual (lf *file, int nr_prefetched_words);
 
 
typedef enum
typedef enum
{
{
  function_name_prefix_semantics,
  function_name_prefix_semantics,
  function_name_prefix_idecode,
  function_name_prefix_idecode,
  function_name_prefix_itable,
  function_name_prefix_itable,
  function_name_prefix_icache,
  function_name_prefix_icache,
  function_name_prefix_engine,
  function_name_prefix_engine,
  function_name_prefix_none
  function_name_prefix_none
}
}
lf_function_name_prefixes;
lf_function_name_prefixes;
 
 
typedef enum
typedef enum
{
{
  is_function_declaration = 0,
  is_function_declaration = 0,
  is_function_definition = 1,
  is_function_definition = 1,
  is_function_variable,
  is_function_variable,
}
}
function_decl_type;
function_decl_type;
 
 
extern int print_function_name
extern int print_function_name
  (lf *file,
  (lf *file,
   const char *basename,
   const char *basename,
   const char *format_name,
   const char *format_name,
   const char *model_name,
   const char *model_name,
   opcode_bits *expanded_bits, lf_function_name_prefixes prefix);
   opcode_bits *expanded_bits, lf_function_name_prefixes prefix);
 
 
extern void print_my_defines
extern void print_my_defines
  (lf *file,
  (lf *file,
   const char *basename, const char *format_name, opcode_bits *expanded_bits);
   const char *basename, const char *format_name, opcode_bits *expanded_bits);
 
 
extern void print_itrace (lf *file, insn_entry * insn, int idecode);
extern void print_itrace (lf *file, insn_entry * insn, int idecode);
 
 
extern void print_sim_engine_abort (lf *file, const char *message);
extern void print_sim_engine_abort (lf *file, const char *message);
 
 
 
 
extern void print_include (lf *file, igen_module module);
extern void print_include (lf *file, igen_module module);
extern void print_include_inline (lf *file, igen_module module);
extern void print_include_inline (lf *file, igen_module module);
extern void print_includes (lf *file);
extern void print_includes (lf *file);
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.