dv-bfin_mmu.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /* Blackfin Memory Management Unit (MMU) model.
  2. Copyright (C) 2010-2022 Free Software Foundation, Inc.
  3. Contributed by Analog Devices, Inc.
  4. This file is part of simulators.
  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. #ifndef DV_BFIN_MMU_H
  16. #define DV_BFIN_MMU_H
  17. #undef PAGE_SIZE /* Cleanup system headers. */
  18. void mmu_check_addr (SIM_CPU *, bu32 addr, bool write, bool inst, int size);
  19. void mmu_check_cache_addr (SIM_CPU *, bu32 addr, bool write, bool inst);
  20. void mmu_process_fault (SIM_CPU *, bu32 addr, bool write, bool inst, bool unaligned, bool miss);
  21. void mmu_log_ifault (SIM_CPU *);
  22. /* MEM_CONTROL */
  23. #define ENM (1 << 0)
  24. #define ENCPLB (1 << 1)
  25. #define MC (1 << 2)
  26. #define ENDM ENM
  27. #define ENDCPLB ENCPLB
  28. #define DMC_AB_SRAM 0x0
  29. #define DMC_AB_CACHE 0xc
  30. #define DMC_ACACHE_BSRAM 0x8
  31. /* CPLB_DATA */
  32. #define CPLB_VALID (1 << 0)
  33. #define CPLB_USER_RD (1 << 2)
  34. #define CPLB_USER_WR (1 << 3)
  35. #define CPLB_USER_RW (CPLB_USER_RD | CPLB_USER_WR)
  36. #define CPLB_SUPV_WR (1 << 4)
  37. #define CPLB_L1SRAM (1 << 5)
  38. #define CPLB_DA0ACC (1 << 6)
  39. #define CPLB_DIRTY (1 << 7)
  40. #define CPLB_L1_CHBL (1 << 12)
  41. #define CPLB_WT (1 << 14)
  42. #define PAGE_SIZE (3 << 16)
  43. #define PAGE_SIZE_1K (0 << 16)
  44. #define PAGE_SIZE_4K (1 << 16)
  45. #define PAGE_SIZE_1M (2 << 16)
  46. #define PAGE_SIZE_4M (3 << 16)
  47. /* CPLB_STATUS */
  48. #define FAULT_CPLB0 (1 << 0)
  49. #define FAULT_CPLB1 (1 << 1)
  50. #define FAULT_CPLB2 (1 << 2)
  51. #define FAULT_CPLB3 (1 << 3)
  52. #define FAULT_CPLB4 (1 << 4)
  53. #define FAULT_CPLB5 (1 << 5)
  54. #define FAULT_CPLB6 (1 << 6)
  55. #define FAULT_CPLB7 (1 << 7)
  56. #define FAULT_CPLB8 (1 << 8)
  57. #define FAULT_CPLB9 (1 << 9)
  58. #define FAULT_CPLB10 (1 << 10)
  59. #define FAULT_CPLB11 (1 << 11)
  60. #define FAULT_CPLB12 (1 << 12)
  61. #define FAULT_CPLB13 (1 << 13)
  62. #define FAULT_CPLB14 (1 << 14)
  63. #define FAULT_CPLB15 (1 << 15)
  64. #define FAULT_READ (0 << 16)
  65. #define FAULT_WRITE (1 << 16)
  66. #define FAULT_USER (0 << 17)
  67. #define FAULT_SUPV (1 << 17)
  68. #define FAULT_DAG0 (0 << 18)
  69. #define FAULT_DAG1 (1 << 18)
  70. #define FAULT_ILLADDR (1 << 19)
  71. /* DTEST_COMMAND */
  72. #define TEST_READ (0 << 1)
  73. #define TEST_WRITE (1 << 1)
  74. #define TEST_TAG_ARRAY (0 << 2)
  75. #define TEST_DATA_ARRAY (1 << 2)
  76. #define TEST_DBANK (1 << 23)
  77. #define TEST_DATA_SRAM (0 << 24)
  78. #define TEST_INST_SRAM (1 << 24)
  79. #endif