sim-main.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* Lattice Mico32 simulator support code
  2. Contributed by Jon Beniston <jon@beniston.com>
  3. Copyright (C) 2009-2015 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. #include "symcat.h"
  19. #include "sim-basics.h"
  20. #include "cgen-types.h"
  21. #include "lm32-desc.h"
  22. #include "lm32-opc.h"
  23. #include "arch.h"
  24. #include "sim-base.h"
  25. #include "cgen-sim.h"
  26. #include "lm32-sim.h"
  27. #include "opcode/cgen.h"
  28. /* The _sim_cpu struct. */
  29. struct _sim_cpu
  30. {
  31. /* sim/common cpu base. */
  32. sim_cpu_base base;
  33. /* Static parts of cgen. */
  34. CGEN_CPU cgen_cpu;
  35. /* CPU specific parts go here.
  36. Note that in files that don't need to access these pieces WANT_CPU_FOO
  37. won't be defined and thus these parts won't appear. This is ok in the
  38. sense that things work. It is a source of bugs though.
  39. One has to of course be careful to not take the size of this
  40. struct and no structure members accessed in non-cpu specific files can
  41. go after here. Oh for a better language. */
  42. #if defined (WANT_CPU_LM32BF)
  43. LM32BF_CPU_DATA cpu_data;
  44. #endif
  45. };
  46. /* The sim_state struct. */
  47. struct sim_state
  48. {
  49. sim_cpu *cpu[MAX_NR_PROCESSORS];
  50. CGEN_STATE cgen_state;
  51. sim_state_base base;
  52. };
  53. /* Misc. */
  54. /* Catch address exceptions. */
  55. extern SIM_CORE_SIGNAL_FN lm32_core_signal;
  56. #define SIM_CORE_SIGNAL(SD,CPU,CIA,MAP,NR_BYTES,ADDR,TRANSFER,ERROR) \
  57. lm32_core_signal ((SD), (CPU), (CIA), (MAP), (NR_BYTES), (ADDR), \
  58. (TRANSFER), (ERROR))
  59. #endif /* SIM_MAIN_H */