1 /* The IGEN simulator generator for GDB, the GNU Debugger.
3 Copyright 2002-2013 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 3 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, see <http://www.gnu.org/licenses/>. */
23 /* Creates the files semantics.[hc].
25 The generated file semantics contains functions that implement the
26 operations required to model a single target processor instruction.
28 Several different variations on the semantics file can be created:
32 No instruction cache exists. The semantic function
33 needs to generate any required values locally.
35 o cached - separate cracker and semantic
37 Two independant functions are created. Firstly the
38 function that cracks an instruction entering it into a
39 cache and secondly the semantic function propper that
42 o cached - semantic + cracking semantic
44 The function that cracks the instruction and enters
45 all values into the cache also contains a copy of the
46 semantic code (avoiding the need to call both the
47 cracker and the semantic function when there is a
50 For each of these general forms, several refinements can occure:
52 o do/don't duplicate/expand semantic functions
54 As a consequence of decoding an instruction, the
55 decoder, as part of its table may have effectivly made
56 certain of the variable fields in an instruction
57 constant. Separate functions for each of the
58 alternative values for what would have been treated as
59 a variable part can be created.
61 o use cache struct directly.
63 When a cracking cache is present, the semantic
64 functions can be generated to either hold intermediate
65 cache values in local variables or always refer to the
66 contents of the cache directly. */
73 extern void print_semantic_declaration
76 opcode_bits *bits, insn_opcodes *opcodes, int nr_prefetched_words);
78 extern void print_semantic_definition
82 insn_opcodes *opcodes, cache_entry *cache_rules, int nr_prefetched_words);
88 invalid_fp_unavailable,
93 extern void print_idecode_invalid
94 (lf *file, const char *result, invalid_type type);
96 extern void print_semantic_body
98 insn_entry * instruction,
99 opcode_bits *expanded_bits, insn_opcodes *opcodes);