sim-d10v.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. /* This file defines the interface between the d10v simulator and gdb.
  2. Copyright (C) 1999-2015 Free Software Foundation, Inc.
  3. This file is part of GDB.
  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. #if !defined (SIM_D10V_H)
  15. #define SIM_D10V_H
  16. #ifdef __cplusplus
  17. extern "C" { // }
  18. #endif
  19. /* GDB interprets addresses as:
  20. 0x00xxxxxx: Physical unified memory segment (Unified memory)
  21. 0x01xxxxxx: Physical instruction memory segment (On-chip insn memory)
  22. 0x02xxxxxx: Physical data memory segment (On-chip data memory)
  23. 0x10xxxxxx: Logical data address segment (DMAP translated memory)
  24. 0x11xxxxxx: Logical instruction address segment (IMAP translated memory)
  25. The remote d10v board interprets addresses as:
  26. 0x00xxxxxx: Physical unified memory segment (Unified memory)
  27. 0x01xxxxxx: Physical instruction memory segment (On-chip insn memory)
  28. 0x02xxxxxx: Physical data memory segment (On-chip data memory)
  29. The following translate a virtual DMAP/IMAP offset into a physical
  30. memory segment assigning the translated address to PHYS. Since a
  31. memory access may cross a page boundrary the number of bytes for
  32. which the translation is applicable (or 0 for an invalid virtual
  33. offset) is returned. */
  34. enum
  35. {
  36. SIM_D10V_MEMORY_UNIFIED = 0x00000000,
  37. SIM_D10V_MEMORY_INSN = 0x01000000,
  38. SIM_D10V_MEMORY_DATA = 0x02000000,
  39. SIM_D10V_MEMORY_DMAP = 0x10000000,
  40. SIM_D10V_MEMORY_IMAP = 0x11000000
  41. };
  42. extern unsigned long sim_d10v_translate_dmap_addr
  43. (unsigned long offset,
  44. int nr_bytes,
  45. unsigned long *phys,
  46. void *regcache,
  47. unsigned long (*dmap_register) (void *regcache, int reg_nr));
  48. extern unsigned long sim_d10v_translate_imap_addr
  49. (unsigned long offset,
  50. int nr_bytes,
  51. unsigned long *phys,
  52. void *regcache,
  53. unsigned long (*imap_register) (void *regcache, int reg_nr));
  54. extern unsigned long sim_d10v_translate_addr
  55. (unsigned long vaddr,
  56. int nr_bytes,
  57. unsigned long *phys,
  58. void *regcache,
  59. unsigned long (*dmap_register) (void *regcache, int reg_nr),
  60. unsigned long (*imap_register) (void *regcache, int reg_nr));
  61. /* The simulator makes use of the following register information. */
  62. enum sim_d10v_regs
  63. {
  64. SIM_D10V_R0_REGNUM,
  65. SIM_D10V_R1_REGNUM,
  66. SIM_D10V_R2_REGNUM,
  67. SIM_D10V_R3_REGNUM,
  68. SIM_D10V_R4_REGNUM,
  69. SIM_D10V_R5_REGNUM,
  70. SIM_D10V_R6_REGNUM,
  71. SIM_D10V_R7_REGNUM,
  72. SIM_D10V_R8_REGNUM,
  73. SIM_D10V_R9_REGNUM,
  74. SIM_D10V_R10_REGNUM,
  75. SIM_D10V_R11_REGNUM,
  76. SIM_D10V_R12_REGNUM,
  77. SIM_D10V_R13_REGNUM,
  78. SIM_D10V_R14_REGNUM,
  79. SIM_D10V_R15_REGNUM,
  80. SIM_D10V_CR0_REGNUM,
  81. SIM_D10V_CR1_REGNUM,
  82. SIM_D10V_CR2_REGNUM,
  83. SIM_D10V_CR3_REGNUM,
  84. SIM_D10V_CR4_REGNUM,
  85. SIM_D10V_CR5_REGNUM,
  86. SIM_D10V_CR6_REGNUM,
  87. SIM_D10V_CR7_REGNUM,
  88. SIM_D10V_CR8_REGNUM,
  89. SIM_D10V_CR9_REGNUM,
  90. SIM_D10V_CR10_REGNUM,
  91. SIM_D10V_CR11_REGNUM,
  92. SIM_D10V_CR12_REGNUM,
  93. SIM_D10V_CR13_REGNUM,
  94. SIM_D10V_CR14_REGNUM,
  95. SIM_D10V_CR15_REGNUM,
  96. SIM_D10V_A0_REGNUM,
  97. SIM_D10V_A1_REGNUM,
  98. SIM_D10V_SPI_REGNUM,
  99. SIM_D10V_SPU_REGNUM,
  100. SIM_D10V_IMAP0_REGNUM,
  101. SIM_D10V_IMAP1_REGNUM,
  102. SIM_D10V_DMAP0_REGNUM,
  103. SIM_D10V_DMAP1_REGNUM,
  104. SIM_D10V_DMAP2_REGNUM,
  105. SIM_D10V_DMAP3_REGNUM,
  106. SIM_D10V_TS2_DMAP_REGNUM
  107. };
  108. enum
  109. {
  110. SIM_D10V_NR_R_REGS = 16,
  111. SIM_D10V_NR_A_REGS = 2,
  112. SIM_D10V_NR_IMAP_REGS = 2,
  113. SIM_D10V_NR_DMAP_REGS = 4,
  114. SIM_D10V_NR_CR_REGS = 16
  115. };
  116. #ifdef __cplusplus
  117. }
  118. #endif
  119. #endif