]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - sim/or1k/sim-main.h
bf3558ddfef1fba89800d0814db518c441ca08cd
[thirdparty/binutils-gdb.git] / sim / or1k / sim-main.h
1 /* OpenRISC simulator main header
2 Copyright (C) 2017-2022 Free Software Foundation, Inc.
3
4 This file is part of GDB, the GNU debugger.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18
19 #ifndef SIM_MAIN_H
20 #define SIM_MAIN_H
21
22 #define SIM_HAVE_COMMON_SIM_CPU
23
24 #define WITH_SCACHE_PBB 1
25
26 #include "ansidecl.h"
27 #include "or1k-desc.h"
28 #include "or1k-opc.h"
29 #include "sim-basics.h"
30 #include "cgen-types.h"
31 #include "arch.h"
32 #include "sim-base.h"
33 #include "sim-fpu.h"
34
35 #include "cgen-sim.h"
36 #include "or1k-sim.h"
37
38 #define OR1K_DEFAULT_MEM_SIZE 0x800000 /* 8M */
39
40 struct or1k_sim_cpu
41 {
42 OR1K_MISC_PROFILE or1k_misc_profile;
43 #define CPU_OR1K_MISC_PROFILE(cpu) (& OR1K_SIM_CPU (cpu)->or1k_misc_profile)
44
45 /* CPU specific parts go here.
46 Note that in files that don't need to access these pieces WANT_CPU_FOO
47 won't be defined and thus these parts won't appear. This is ok in the
48 sense that things work. It is a source of bugs though.
49 One has to of course be careful to not take the size of this
50 struct and no structure members accessed in non-cpu specific files can
51 go after here. Oh for a better language. */
52 UWI spr[NUM_SPR];
53
54 /* Next instruction will be in delay slot. */
55 BI next_delay_slot;
56 /* Currently in delay slot. */
57 BI delay_slot;
58
59 #ifdef WANT_CPU_OR1K32BF
60 OR1K32BF_CPU_DATA cpu_data;
61 #endif
62 };
63 #define OR1K_SIM_CPU(cpu) ((struct or1k_sim_cpu *) CPU_ARCH_DATA (cpu))
64
65 #endif /* SIM_MAIN_H */