1 /* This file is part of the program psim.
3 Copyright (C) 1994,1995,1996,1997 Andrew Cagney <cagney@highland.com.au>
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.
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.
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.
23 typedef unsigned64 insn_uint;
26 /* Common among most entries:
31 record_type_field = 1,
32 old_record_type_field = 2,
33 record_filter_flags_field = 2,
39 Include the specified file.
51 include_record_filename_field = 3,
52 nr_include_record_fields = 4,
59 Valid options are: hi-bit-nr (default 0), insn-bit-size (default
60 32), insn-specifying-widths (default true), multi-sim (default false).
72 | "insn-specifying-widths"
88 These update the global options structure. */
92 option_name_field = 3,
93 option_value_field = 4,
110 Macro define/undef is currently unimplemented. */
113 /* Functions and internal routins:
129 [ ":" <parameter-list> ]
137 function_typedef_field = 3,
138 function_name_field = 4,
139 function_param_field = 5,
140 nr_function_fields = 5,
144 old_function_typedef_field = 0,
145 old_function_type_field = 2,
146 old_function_name_field = 4,
147 old_function_param_field = 5,
148 nr_old_function_fields = 6,
152 typedef struct _function_entry function_entry;
153 struct _function_entry {
161 function_entry *next;
165 typedef void function_entry_handler
167 function_entry *function,
170 extern void function_entry_traverse
172 function_entry *functions,
173 function_entry_handler *handler,
184 ":" <field-name> { "," <field-name> }
189 <cache-macro-type> ::=
197 | <ident> "_is_" <integer>
200 A cache entry is defined (for an instruction) when all
201 <field-name>s are present as named opcode fields within the
204 SCRATCH and CACHE macros are defined during the cache fill stage
205 while CACHE and COMPUTE macros are defined during the instruction
211 cache_type_field = 3,
212 cache_name_field = 4,
213 cache_original_fields_field = 5,
214 cache_expression_field = 6,
224 typedef struct _cache_entry cache_entry;
225 struct _cache_entry {
228 cache_entry_type entry_type;
230 filter *original_fields;
240 <model-processor> ::=
245 ":" <function-unit-data>
281 nr_model_macro_fields = 3,
282 nr_model_data_fields = 3,
283 nr_model_static_fields = 6,
284 nr_model_internal_fields = 6,
285 nr_model_function_fields = 6,
288 typedef struct _model_data model_data;
298 model_name_field = 3,
299 model_full_name_field = 4,
300 model_unit_data_field = 5,
301 nr_model_processor_fields = 6,
304 typedef struct _model_entry model_entry;
305 struct _model_entry {
315 typedef struct _model_table model_table;
316 struct _model_table {
322 function_entry *statics;
323 function_entry *internals;
324 function_entry *functions;
329 /* Instruction format:
331 An instruction is composed of a sequence of N bit instruction
332 words. Each word broken into a number of instruction fields.
333 Those fields being constant (ex. an opcode) or variable (register
337 <insn-field> { "," <insn-field> } ;
340 ( <binary-value-implying-width>
341 | <field-name-implying-width>
342 | [ <start-or-width> "." ] <field>
344 { "!" <excluded-value> }
352 | "0b" <binary-value>
358 typedef struct _insn_field_exclusion insn_field_exclusion;
359 struct _insn_field_exclusion {
362 insn_field_exclusion *next;
372 typedef struct _insn_field_entry insn_field_entry;
373 struct _insn_field_entry {
378 insn_field_type type;
382 insn_field_exclusion *exclusions;
383 insn_field_entry *next;
384 insn_field_entry *prev;
387 typedef struct _insn_bit_entry insn_bit_entry;
388 struct _insn_bit_entry {
391 insn_field_entry *field;
397 typedef struct _insn_entry insn_entry; /* forward */
399 typedef struct _insn_word_entry insn_word_entry;
400 struct _insn_word_entry {
401 /* list of sub-fields making up the instruction. bit provides
402 faster access to the field data for bit N. */
403 insn_field_entry *first;
404 insn_field_entry *last;
405 insn_bit_entry *bit[max_insn_bit_size];
406 /* set of all the string fields */
408 /* For multi-word instructions, The Nth word (from zero). */
409 insn_word_entry *next;
414 /* Instruction model:
416 Provides scheduling data for the code modeling the instruction unit.
420 ":" <function-unit-data>
424 If <processor> is NULL, the model is made the default for this
430 insn_model_name_field = 0,
431 insn_model_unit_data_field = 1,
432 nr_insn_model_fields = 1,
435 typedef struct _insn_model_entry insn_model_entry;
436 struct _insn_model_entry {
442 insn_model_entry *next;
447 /* Instruction mnemonic:
449 List of assembler mnemonics for the instruction.
452 "\"" <assembler-mnemonic> "\""
453 [ ":" <conditional-expression> ]
460 insn_mnemonic_format_field = 0,
461 insn_mnemonic_condition_field = 1,
462 nr_insn_mnemonic_fields = 1,
465 typedef struct _insn_mnemonic_entry insn_mnemonic_entry;
466 struct _insn_mnemonic_entry {
471 insn_mnemonic_entry *next;
479 <insn-word> { "+" <insn-word> }
493 insn_format_name_field = 1,
494 insn_filter_flags_field = 2,
495 insn_options_field = 3,
501 /* typedef struct _insn_entry insn_entry; */
504 filter *flags; /* filtered by options.filters */
508 /* the words that make up the instruction. Word provides direct
509 access to word N. Pseudo instructions can be identified by
512 insn_word_entry *words;
513 insn_word_entry **word;
514 /* a set of all the fields from all the words */
516 /* an array of processor models, missing models are NULL! */
518 insn_model_entry *models;
519 insn_model_entry **model;
521 /* list of assember formats */
523 insn_mnemonic_entry *mnemonics;
530 /* Instruction table:
534 typedef struct _insn_table insn_table;
540 function_entry *functions;
541 insn_entry *illegal_insn;
547 extern insn_table *load_insn_table
551 typedef void insn_entry_handler
557 extern void insn_table_traverse_insn
560 insn_entry_handler *handler,
567 extern void print_insn_words
579 insn_field_entry *field,
586 insn_word_entry *word,