l2cache_defs.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #ifndef __l2cache_defs_h
  2. #define __l2cache_defs_h
  3. /*
  4. * This file is autogenerated from
  5. * file: l2cache.r
  6. *
  7. * by ../../../tools/rdesc/bin/rdes2c -outfile l2cache_defs.h l2cache.r
  8. * Any changes here will be lost.
  9. *
  10. * -*- buffer-read-only: t -*-
  11. */
  12. /* Main access macros */
  13. #ifndef REG_RD
  14. #define REG_RD( scope, inst, reg ) \
  15. REG_READ( reg_##scope##_##reg, \
  16. (inst) + REG_RD_ADDR_##scope##_##reg )
  17. #endif
  18. #ifndef REG_WR
  19. #define REG_WR( scope, inst, reg, val ) \
  20. REG_WRITE( reg_##scope##_##reg, \
  21. (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
  22. #endif
  23. #ifndef REG_RD_VECT
  24. #define REG_RD_VECT( scope, inst, reg, index ) \
  25. REG_READ( reg_##scope##_##reg, \
  26. (inst) + REG_RD_ADDR_##scope##_##reg + \
  27. (index) * STRIDE_##scope##_##reg )
  28. #endif
  29. #ifndef REG_WR_VECT
  30. #define REG_WR_VECT( scope, inst, reg, index, val ) \
  31. REG_WRITE( reg_##scope##_##reg, \
  32. (inst) + REG_WR_ADDR_##scope##_##reg + \
  33. (index) * STRIDE_##scope##_##reg, (val) )
  34. #endif
  35. #ifndef REG_RD_INT
  36. #define REG_RD_INT( scope, inst, reg ) \
  37. REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg )
  38. #endif
  39. #ifndef REG_WR_INT
  40. #define REG_WR_INT( scope, inst, reg, val ) \
  41. REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg, (val) )
  42. #endif
  43. #ifndef REG_RD_INT_VECT
  44. #define REG_RD_INT_VECT( scope, inst, reg, index ) \
  45. REG_READ( int, (inst) + REG_RD_ADDR_##scope##_##reg + \
  46. (index) * STRIDE_##scope##_##reg )
  47. #endif
  48. #ifndef REG_WR_INT_VECT
  49. #define REG_WR_INT_VECT( scope, inst, reg, index, val ) \
  50. REG_WRITE( int, (inst) + REG_WR_ADDR_##scope##_##reg + \
  51. (index) * STRIDE_##scope##_##reg, (val) )
  52. #endif
  53. #ifndef REG_TYPE_CONV
  54. #define REG_TYPE_CONV( type, orgtype, val ) \
  55. ( { union { orgtype o; type n; } r; r.o = val; r.n; } )
  56. #endif
  57. #ifndef reg_page_size
  58. #define reg_page_size 8192
  59. #endif
  60. #ifndef REG_ADDR
  61. #define REG_ADDR( scope, inst, reg ) \
  62. ( (inst) + REG_RD_ADDR_##scope##_##reg )
  63. #endif
  64. #ifndef REG_ADDR_VECT
  65. #define REG_ADDR_VECT( scope, inst, reg, index ) \
  66. ( (inst) + REG_RD_ADDR_##scope##_##reg + \
  67. (index) * STRIDE_##scope##_##reg )
  68. #endif
  69. /* C-code for register scope l2cache */
  70. /* Register rw_cfg, scope l2cache, type rw */
  71. typedef struct {
  72. unsigned int en : 1;
  73. unsigned int dummy1 : 31;
  74. } reg_l2cache_rw_cfg;
  75. #define REG_RD_ADDR_l2cache_rw_cfg 0
  76. #define REG_WR_ADDR_l2cache_rw_cfg 0
  77. /* Register rw_ctrl, scope l2cache, type rw */
  78. typedef struct {
  79. unsigned int dummy1 : 7;
  80. unsigned int cbase : 9;
  81. unsigned int dummy2 : 4;
  82. unsigned int csize : 10;
  83. unsigned int dummy3 : 2;
  84. } reg_l2cache_rw_ctrl;
  85. #define REG_RD_ADDR_l2cache_rw_ctrl 4
  86. #define REG_WR_ADDR_l2cache_rw_ctrl 4
  87. /* Register rw_idxop, scope l2cache, type rw */
  88. typedef struct {
  89. unsigned int idx : 10;
  90. unsigned int dummy1 : 14;
  91. unsigned int way : 3;
  92. unsigned int dummy2 : 2;
  93. unsigned int cmd : 3;
  94. } reg_l2cache_rw_idxop;
  95. #define REG_RD_ADDR_l2cache_rw_idxop 8
  96. #define REG_WR_ADDR_l2cache_rw_idxop 8
  97. /* Register rw_addrop_addr, scope l2cache, type rw */
  98. typedef struct {
  99. unsigned int addr : 32;
  100. } reg_l2cache_rw_addrop_addr;
  101. #define REG_RD_ADDR_l2cache_rw_addrop_addr 12
  102. #define REG_WR_ADDR_l2cache_rw_addrop_addr 12
  103. /* Register rw_addrop_ctrl, scope l2cache, type rw */
  104. typedef struct {
  105. unsigned int size : 16;
  106. unsigned int dummy1 : 13;
  107. unsigned int cmd : 3;
  108. } reg_l2cache_rw_addrop_ctrl;
  109. #define REG_RD_ADDR_l2cache_rw_addrop_ctrl 16
  110. #define REG_WR_ADDR_l2cache_rw_addrop_ctrl 16
  111. /* Constants */
  112. enum {
  113. regk_l2cache_flush = 0x00000001,
  114. regk_l2cache_no = 0x00000000,
  115. regk_l2cache_rw_addrop_addr_default = 0x00000000,
  116. regk_l2cache_rw_addrop_ctrl_default = 0x00000000,
  117. regk_l2cache_rw_cfg_default = 0x00000000,
  118. regk_l2cache_rw_ctrl_default = 0x00000000,
  119. regk_l2cache_rw_idxop_default = 0x00000000,
  120. regk_l2cache_yes = 0x00000001
  121. };
  122. #endif /* __l2cache_defs_h */