sim-main.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* Lattice Mico32 simulator support code
  2. Contributed by Jon Beniston <jon@beniston.com>
  3. Copyright (C) 2009-2022 Free Software Foundation, Inc.
  4. This file is part of GDB.
  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. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. /* Main header for the LM32 simulator. */
  16. #ifndef SIM_MAIN_H
  17. #define SIM_MAIN_H
  18. #define WITH_SCACHE_PBB 1
  19. #include "symcat.h"
  20. #include "sim-basics.h"
  21. #include "cgen-types.h"
  22. #include "lm32-desc.h"
  23. #include "lm32-opc.h"
  24. #include "arch.h"
  25. #include "sim-base.h"
  26. #include "cgen-sim.h"
  27. #include "lm32-sim.h"
  28. #include "opcode/cgen.h"
  29. /* The _sim_cpu struct. */
  30. struct _sim_cpu
  31. {
  32. /* sim/common cpu base. */
  33. sim_cpu_base base;
  34. /* Static parts of cgen. */
  35. CGEN_CPU cgen_cpu;
  36. /* CPU specific parts go here.
  37. Note that in files that don't need to access these pieces WANT_CPU_FOO
  38. won't be defined and thus these parts won't appear. This is ok in the
  39. sense that things work. It is a source of bugs though.
  40. One has to of course be careful to not take the size of this
  41. struct and no structure members accessed in non-cpu specific files can
  42. go after here. Oh for a better language. */
  43. #if defined (WANT_CPU_LM32BF)
  44. LM32BF_CPU_DATA cpu_data;
  45. #endif
  46. };
  47. /* Misc. */
  48. /* Catch address exceptions. */
  49. extern SIM_CORE_SIGNAL_FN lm32_core_signal;
  50. #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
  51. lm32_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
  52. (TRANSFER), (ERROR))
  53. #endif /* SIM_MAIN_H */