1 /* The IGEN simulator generator for GDB, the GNU Debugger.
3 Copyright 2002, 2007 Free Software Foundation, Inc.
5 Contributed by Andrew Cagney.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA. */
25 /* code-generation options: */
30 /* Transfer control to an instructions semantic code using the the
31 standard call/return mechanism */
35 /* Transfer control to an instructions semantic code using
36 (computed) goto's instead of the more conventional call/return
54 typedef struct _igen_gen_options igen_gen_options;
55 struct _igen_gen_options
60 int conditional_issue;
61 int slot_verification;
64 /* If zeroing a register, which one? */
68 /* should multiple simulators be generated? */
71 /* name of the default multi-sim model */
74 /* should the simulator support multi word instructions and if so,
75 what is the max nr of words. */
78 /* SMP? Should the generated code include SMP support (>0) and if
79 so, for how many processors? */
82 /* how should the next instruction address be computed? */
85 /* nr of instructions in the decoded instruction cache */
94 typedef struct _igen_trace_options igen_trace_options;
95 struct _igen_trace_options
105 typedef struct _igen_name
111 typedef struct _igen_module
118 typedef struct _igen_module_options
125 igen_module semantics;
130 typedef struct _igen_decode_options igen_decode_options;
131 struct _igen_decode_options
134 /* Combine tables? Should the generator make a second pass through
135 each generated table looking for any sub-entries that contain the
136 same instructions. Those entries being merged into a single
140 /* Instruction expansion? Should the semantic code for each
141 instruction, when the oportunity arrises, be expanded according
142 to the variable opcode files that the instruction decode process
146 /* Treat reserved fields as constant (zero) instead of ignoring
147 their value when determining decode tables */
150 /* Convert any padded switch rules into goto_switch */
153 /* Force all tables to be generated with this lookup mechanism */
154 char *overriding_gen;
158 typedef struct _igen_warn_options igen_warn_options;
159 struct _igen_warn_options
162 /* Issue warning about discarded instructions */
165 /* Issue warning about invalid instruction widths */
168 /* Issue warning about unimplemented instructions */
175 typedef struct _igen_options igen_options;
179 /* What does the instruction look like - bit ordering, size, widths or
183 int insn_specifying_widths;
185 /* what should global names be prefixed with? */
186 igen_module_options module;
188 /* See above for options and flags */
189 igen_gen_options gen;
191 /* See above for trace options */
192 igen_trace_options trace;
194 /* See above for include options */
195 table_include *include;
197 /* See above for decode options */
198 igen_decode_options decode;
200 /* Filter set to be used on the flag field of the instruction table */
201 filter *flags_filter;
203 /* See above for warn options */
204 igen_warn_options warn;
206 /* Be more picky about the input */
207 error_func (*warning);
209 /* Model (processor) set - like flags_filter. Used to select the
210 specific ISA within a processor family. */
211 filter *model_filter;
213 /* Format name set */
214 filter *format_name_filter;
217 extern igen_options options;
219 /* default options - hopefully backward compatible */
220 #define INIT_OPTIONS() \
222 memset (&options, 0, sizeof options); \
223 memset (&options.warn, -1, sizeof (options.warn)); \
224 options.hi_bit_nr = 0; \
225 options.insn_bit_size = default_insn_bit_size; \
226 options.insn_specifying_widths = 0; \
227 options.module.global.prefix.u = ""; \
228 options.module.global.prefix.l = ""; \
230 options.module.engine = options.module.global; \
231 options.module.icache = options.module.global; \
232 options.module.idecode = options.module.global; \
233 options.module.itable = options.module.global; \
234 options.module.semantics = options.module.global; \
235 options.module.support = options.module.global; \
237 options.module.engine.suffix.l = "engine"; \
238 options.module.engine.suffix.u = "ENGINE"; \
239 options.module.icache.suffix.l = "icache"; \
240 options.module.icache.suffix.u = "ICACHE"; \
241 options.module.idecode.suffix.l = "idecode"; \
242 options.module.idecode.suffix.u = "IDECODE"; \
243 options.module.itable.suffix.l = "itable"; \
244 options.module.itable.suffix.u = "ITABLE"; \
245 options.module.semantics.suffix.l = "semantics"; \
246 options.module.semantics.suffix.u = "SEMANTICS"; \
247 options.module.support.suffix.l = "support"; \
248 options.module.support.suffix.u = "SUPPORT"; \
250 options.gen.code = generate_calls; \
251 options.gen.icache_size = 1024; \
252 options.warning = warning; \