OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gdb/] [gdb-6.8/] [gdb-6.8.openrisc-2.1/] [sim/] [ppc/] [ld-decode.h] - Diff between revs 24 and 33

Only display areas with differences | Details | Blame | View Log

Rev 24 Rev 33
/*  This file is part of the program psim.
/*  This file is part of the program psim.
 
 
    Copyright (C) 1994,1995,1996, Andrew Cagney <cagney@highland.com.au>
    Copyright (C) 1994,1995,1996, Andrew Cagney <cagney@highland.com.au>
 
 
    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 2 of the License, or
    the Free Software Foundation; either version 2 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, write to the Free Software
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 
    */
    */
 
 
/* Instruction decode table:
/* Instruction decode table:
 
 
   <options>:<first>:<last>:<force-first>:<force-last>:<force-expand>:<special>...
   <options>:<first>:<last>:<force-first>:<force-last>:<force-expand>:<special>...
 
 
 
 
 
 
   Ignore the below:
   Ignore the below:
 
 
 
 
   The instruction decode table contains rules that dictate how igen
   The instruction decode table contains rules that dictate how igen
   is going to firstly break down the opcode table and secondly
   is going to firstly break down the opcode table and secondly
 
 
   The table that follows is used by gen to construct a decision tree
   The table that follows is used by gen to construct a decision tree
   that can identify each possible instruction.  Gen then outputs this
   that can identify each possible instruction.  Gen then outputs this
   decision tree as (according to config) a table or switch statement
   decision tree as (according to config) a table or switch statement
   as the function idecode.
   as the function idecode.
 
 
   In parallel to this, as mentioned above, WITH_EXPANDED_SEMANTICS
   In parallel to this, as mentioned above, WITH_EXPANDED_SEMANTICS
   determines of the semantic functions themselves should be expanded
   determines of the semantic functions themselves should be expanded
   in a similar way.
   in a similar way.
 
 
   <first>
   <first>
   <last>
   <last>
 
 
   Range of bits (within the instruction) that should be searched for
   Range of bits (within the instruction) that should be searched for
   an instruction field.  Within such ranges, gen looks for opcodes
   an instruction field.  Within such ranges, gen looks for opcodes
   (constants), registers (strings) and reserved bits (slash) and
   (constants), registers (strings) and reserved bits (slash) and
   according to the rules that follows includes or excludes them from
   according to the rules that follows includes or excludes them from
   a possible instruction field.
   a possible instruction field.
 
 
   <force_first>
   <force_first>
   <force_last>
   <force_last>
 
 
   If an instruction field was found, enlarge the field size so that
   If an instruction field was found, enlarge the field size so that
   it is forced to at least include bits starting from <force_first>
   it is forced to at least include bits starting from <force_first>
   (<force_last>).  To stop this occuring, use <force_first> = <last>
   (<force_last>).  To stop this occuring, use <force_first> = <last>
   + 1 and <force_last> = <first> - 1.
   + 1 and <force_last> = <first> - 1.
 
 
   <force_slash>
   <force_slash>
 
 
   Treat `/' fields as a constant instead of variable when looking for
   Treat `/' fields as a constant instead of variable when looking for
   an instruction field.
   an instruction field.
 
 
   <force_expansion>
   <force_expansion>
 
 
   Treat any contained register (string) fields as constant when
   Treat any contained register (string) fields as constant when
   determining the instruction field.  For the instruction decode (and
   determining the instruction field.  For the instruction decode (and
   controled by IDECODE_EXPAND_SEMANTICS) this forces the expansion of
   controled by IDECODE_EXPAND_SEMANTICS) this forces the expansion of
   what would otherwize be non constant bits of an instruction.
   what would otherwize be non constant bits of an instruction.
 
 
   <use_switch>
   <use_switch>
 
 
   Should this table be expanded using a switch statement (val 1) and
   Should this table be expanded using a switch statement (val 1) and
   if so, should it be padded with entries so as to force the compiler
   if so, should it be padded with entries so as to force the compiler
   to generate a jump table (val 2). Or a branch table (val 3).
   to generate a jump table (val 2). Or a branch table (val 3).
 
 
   <special_mask>
   <special_mask>
   <special_value>
   <special_value>
   <special_rule>
   <special_rule>
   <special_constant>
   <special_constant>
 
 
   Special rule to fine tune how specific (or groups) of instructions
   Special rule to fine tune how specific (or groups) of instructions
   are expanded.  The applicability of the rule is determined by
   are expanded.  The applicability of the rule is determined by
 
 
     <special_mask> != 0 && (instruction> & <special_mask>) == <special_value>
     <special_mask> != 0 && (instruction> & <special_mask>) == <special_value>
 
 
   Where <instruction> is obtained by looking only at constant fields
   Where <instruction> is obtained by looking only at constant fields
   with in an instructions spec.  When determining an expansion, the
   with in an instructions spec.  When determining an expansion, the
   rule is only considered when a node contains a single instruction.
   rule is only considered when a node contains a single instruction.
   <special_rule> can be any of:
   <special_rule> can be any of:
 
 
        0: for this instruction, expand by earlier rules
        0: for this instruction, expand by earlier rules
        1: expand bits <force_low> .. <force_hi> only
        1: expand bits <force_low> .. <force_hi> only
        2: boolean expansion of only zero/non-zero cases
        2: boolean expansion of only zero/non-zero cases
        3: boolean expansion of equality of special constant
        3: boolean expansion of equality of special constant
 
 
        */
        */
 
 
 
 
typedef enum {
typedef enum {
  normal_decode_rule,
  normal_decode_rule,
  expand_forced_rule,
  expand_forced_rule,
  boolean_rule,
  boolean_rule,
  nr_decode_rules
  nr_decode_rules
} decode_special_type;
} decode_special_type;
 
 
typedef enum {
typedef enum {
  invalid_gen,
  invalid_gen,
  array_gen,
  array_gen,
  switch_gen,
  switch_gen,
  padded_switch_gen,
  padded_switch_gen,
  goto_switch_gen,
  goto_switch_gen,
  nr_decode_gen_types,
  nr_decode_gen_types,
} decode_gen_type;
} decode_gen_type;
 
 
 
 
typedef struct _decode_table decode_table;
typedef struct _decode_table decode_table;
struct _decode_table {
struct _decode_table {
  decode_special_type type;
  decode_special_type type;
  decode_gen_type gen;
  decode_gen_type gen;
  int first;
  int first;
  int last;
  int last;
  int force_first;
  int force_first;
  int force_last;
  int force_last;
  int force_slash;
  int force_slash;
  char *force_expansion;
  char *force_expansion;
  unsigned special_mask;
  unsigned special_mask;
  unsigned special_value;
  unsigned special_value;
  unsigned special_constant;
  unsigned special_constant;
  decode_table *next;
  decode_table *next;
};
};
 
 
 
 
extern void force_decode_gen_type
extern void force_decode_gen_type
(const char *type);
(const char *type);
 
 
extern decode_table *load_decode_table
extern decode_table *load_decode_table
(char *file_name,
(char *file_name,
 int hi_bit_nr);
 int hi_bit_nr);
 
 
extern void dump_decode_rule
extern void dump_decode_rule
(decode_table *rule,
(decode_table *rule,
 int indent);
 int indent);
 
 

powered by: WebSVN 2.1.0

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