xref: /netbsd-src/external/gpl3/gdb.old/dist/sim/lm32/sim-main.h (revision 8b657b0747480f8989760d71343d6dd33f8d4cf9)
1a5a4af3bSchristos /* Lattice Mico32 simulator support code
2a5a4af3bSchristos    Contributed by Jon Beniston <jon@beniston.com>
3a5a4af3bSchristos 
4*8b657b07Schristos    Copyright (C) 2009-2023 Free Software Foundation, Inc.
5a5a4af3bSchristos 
6a5a4af3bSchristos    This file is part of GDB.
7a5a4af3bSchristos 
8a5a4af3bSchristos    This program is free software; you can redistribute it and/or modify
9a5a4af3bSchristos    it under the terms of the GNU General Public License as published by
10a5a4af3bSchristos    the Free Software Foundation; either version 3 of the License, or
11a5a4af3bSchristos    (at your option) any later version.
12a5a4af3bSchristos 
13a5a4af3bSchristos    This program is distributed in the hope that it will be useful,
14a5a4af3bSchristos    but WITHOUT ANY WARRANTY; without even the implied warranty of
15a5a4af3bSchristos    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16a5a4af3bSchristos    GNU General Public License for more details.
17a5a4af3bSchristos 
18a5a4af3bSchristos    You should have received a copy of the GNU General Public License
19a5a4af3bSchristos    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
20a5a4af3bSchristos 
21a5a4af3bSchristos /* Main header for the LM32 simulator.  */
22a5a4af3bSchristos 
23a5a4af3bSchristos #ifndef SIM_MAIN_H
24a5a4af3bSchristos #define SIM_MAIN_H
25a5a4af3bSchristos 
26e5cb852cSchristos #define WITH_SCACHE_PBB 1
27e5cb852cSchristos 
28a5a4af3bSchristos #include "symcat.h"
29a5a4af3bSchristos #include "sim-basics.h"
30a5a4af3bSchristos #include "cgen-types.h"
31a5a4af3bSchristos #include "lm32-desc.h"
32a5a4af3bSchristos #include "lm32-opc.h"
33a5a4af3bSchristos #include "arch.h"
34a5a4af3bSchristos #include "sim-base.h"
35a5a4af3bSchristos #include "cgen-sim.h"
36a5a4af3bSchristos #include "lm32-sim.h"
37a5a4af3bSchristos #include "opcode/cgen.h"
38a5a4af3bSchristos 
39a5a4af3bSchristos /* The _sim_cpu struct.  */
40a5a4af3bSchristos 
41a5a4af3bSchristos struct _sim_cpu
42a5a4af3bSchristos {
43a5a4af3bSchristos   /* sim/common cpu base.  */
44a5a4af3bSchristos   sim_cpu_base base;
45a5a4af3bSchristos 
46a5a4af3bSchristos   /* Static parts of cgen.  */
47a5a4af3bSchristos   CGEN_CPU cgen_cpu;
48a5a4af3bSchristos 
49a5a4af3bSchristos   /* CPU specific parts go here.
50a5a4af3bSchristos      Note that in files that don't need to access these pieces WANT_CPU_FOO
51a5a4af3bSchristos      won't be defined and thus these parts won't appear.  This is ok in the
52a5a4af3bSchristos      sense that things work.  It is a source of bugs though.
53a5a4af3bSchristos      One has to of course be careful to not take the size of this
54a5a4af3bSchristos      struct and no structure members accessed in non-cpu specific files can
55a5a4af3bSchristos      go after here.  Oh for a better language.  */
56a5a4af3bSchristos #if defined (WANT_CPU_LM32BF)
57a5a4af3bSchristos   LM32BF_CPU_DATA cpu_data;
58a5a4af3bSchristos #endif
59a5a4af3bSchristos 
60a5a4af3bSchristos };
61a5a4af3bSchristos 
62a5a4af3bSchristos /* Misc.  */
63a5a4af3bSchristos 
64a5a4af3bSchristos /* Catch address exceptions.  */
65a5a4af3bSchristos extern SIM_CORE_SIGNAL_FN lm32_core_signal;
66a5a4af3bSchristos #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
67a5a4af3bSchristos lm32_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
68a5a4af3bSchristos 		  (TRANSFER), (ERROR))
69a5a4af3bSchristos 
70a5a4af3bSchristos #endif /* SIM_MAIN_H */
71