| 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 3 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, see <http://www.gnu.org/licenses/>. |
| 17 | |
| 18 | */ |
| 19 | |
| 20 | |
| 21 | |
| 22 | /* Output code to manipulate the instruction cache: either create it |
| 23 | or reference it */ |
| 24 | |
| 25 | typedef enum { |
| 26 | declare_variables, |
| 27 | define_variables, |
| 28 | undef_variables, |
| 29 | } icache_decl_type; |
| 30 | |
| 31 | typedef enum { |
| 32 | do_not_use_icache = 0, |
| 33 | get_values_from_icache = 0x1, |
| 34 | put_values_in_icache = 0x2, |
| 35 | both_values_and_icache = 0x3, |
| 36 | } icache_body_type; |
| 37 | |
| 38 | extern void print_icache_body |
| 39 | (lf *file, |
| 40 | insn *instruction, |
| 41 | insn_bits *expanded_bits, |
| 42 | cache_table *cache_rules, |
| 43 | icache_decl_type what_to_declare, |
| 44 | icache_body_type what_to_do); |
| 45 | |
| 46 | |
| 47 | /* Output an instruction cache decode function */ |
| 48 | |
| 49 | extern insn_handler print_icache_declaration; |
| 50 | extern insn_handler print_icache_definition; |
| 51 | |
| 52 | |
| 53 | /* Output an instruction cache support function */ |
| 54 | |
| 55 | extern function_handler print_icache_internal_function_declaration; |
| 56 | extern function_handler print_icache_internal_function_definition; |
| 57 | |
| 58 | |
| 59 | /* Output the instruction cache table data structure */ |
| 60 | |
| 61 | extern void print_icache_struct |
| 62 | (insn_table *instructions, |
| 63 | cache_table *cache_rules, |
| 64 | lf *file); |
| 65 | |
| 66 | |
| 67 | /* Output a single instructions decoder */ |