sim-main.h 2.0 KB

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