Extend xor-endian and per-cpu support in core module.
[external/binutils.git] / sim / igen / igen.h
1 /*  This file is part of the program psim.
2
3     Copyright (C) 1994-1997, Andrew Cagney <cagney@highland.com.au>
4
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 2 of the License, or
8     (at your option) any later version.
9
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14  
15     You should have received a copy of the GNU General Public License
16     along with this program; if not, write to the Free Software
17     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  
19     */
20
21
22 /* What does the instruction look like - bit ordering, size, widths or offesets */
23 extern int hi_bit_nr;
24 extern int insn_bit_size;
25 extern int insn_specifying_widths;
26
27
28 /* what should global names be prefixed with? */
29 extern const char *global_name_prefix;
30 extern const char *global_uname_prefix;
31
32
33 /* generation options: */
34
35
36 enum {
37   generate_with_direct_access = 0x1,
38   generate_with_icache = 0x2,
39   generate_with_semantic_icache = 0x4,
40   generate_with_insn_in_icache = 0x8,
41
42   generate_with_semantic_returning_modified_nia_only = 0x010,
43   generate_with_semantic_conditional_issue           = 0x020,
44   generate_with_idecode_slot_verification            = 0x040,
45   generate_with_semantic_delayed_branch              = 0x080,
46   generate_with_semantic_zero_r0                     = 0x100
47 };
48
49
50 typedef enum {
51
52   /* Transfer control to an instructions semantic code using the the
53      standard call/return mechanism */
54
55   generate_calls = 0x1000,
56
57
58   /* Transfer control to an instructions semantic code using
59      (computed) goto's instead of the more conventional call/return
60      mechanism */
61
62   generate_jumps = 0x2000,
63
64
65 } igen_code;
66
67 extern int code;
68
69
70
71
72 extern int icache_size;
73
74
75 /* Instruction expansion?
76
77    Should the semantic code for each instruction, when the oportunity
78    arrises, be expanded according to the variable opcode files that
79    the instruction decode process renders constant */
80
81 extern int generate_expanded_instructions;
82
83
84 /* SMP?
85
86    Should the generated code include SMP support (>0) and if so, for
87    how many processors? */
88
89 extern int generate_smp;
90
91
92
93
94 /* Misc junk */
95
96
97
98 /* Function header definitions */
99
100
101 /* Cache functions: */
102
103 extern int print_icache_function_formal
104 (lf *file);
105
106 extern int print_icache_function_actual
107 (lf *file);
108
109 extern int print_icache_function_type
110 (lf *file);
111
112 extern int print_semantic_function_formal
113 (lf *file);
114
115 extern int print_semantic_function_actual
116 (lf *file);
117
118 extern int print_semantic_function_type
119 (lf *file);
120
121 extern void print_my_defines
122 (lf *file,
123  insn_bits *expanded_bits,
124  table_entry *file_entry);
125
126 extern void print_itrace
127 (lf *file,
128  table_entry *file_entry,
129  int idecode);
130
131
132 typedef enum {
133   function_name_prefix_semantics,
134   function_name_prefix_idecode,
135   function_name_prefix_itable,
136   function_name_prefix_icache,
137   function_name_prefix_none
138 } lf_function_name_prefixes;
139
140 extern int print_function_name
141 (lf *file,
142  const char *basename,
143  insn_bits *expanded_bits,
144  lf_function_name_prefixes prefix);