sim-main.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* Copyright 2009-2022 Free Software Foundation, Inc.
  2. This file is part of the Xilinx MicroBlaze simulator.
  3. This library is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, see <http://www.gnu.org/licenses/>. */
  13. #ifndef MICROBLAZE_SIM_MAIN
  14. #define MICROBLAZE_SIM_MAIN
  15. #include "microblaze.h"
  16. #include "sim-basics.h"
  17. #include "sim-base.h"
  18. /* The machine state.
  19. This state is maintained in host byte order. The
  20. fetch/store register functions must translate between host
  21. byte order and the target processor byte order.
  22. Keeping this data in target byte order simplifies the register
  23. read/write functions. Keeping this data in native order improves
  24. the performance of the simulator. Simulation speed is deemed more
  25. important. */
  26. /* The ordering of the microblaze_regset structure is matched in the
  27. gdb/config/microblaze/tm-microblaze.h file in the REGISTER_NAMES macro. */
  28. struct microblaze_regset
  29. {
  30. signed_4 regs[32]; /* primary registers */
  31. signed_4 spregs[2]; /* pc + msr */
  32. int cycles;
  33. int insts;
  34. unsigned_1 imm_enable;
  35. signed_2 imm_high;
  36. };
  37. struct _sim_cpu {
  38. struct microblaze_regset microblaze_cpu;
  39. sim_cpu_base base;
  40. };
  41. #endif /* MICROBLAZE_SIM_MAIN */