udb 0.1.9 → 0.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. checksums.yaml +4 -4
  2. data/.data/cfgs/example_rv64_with_overlay.yaml +20 -20
  3. data/.data/cfgs/mc100-32-full-example.yaml +1 -0
  4. data/.data/cfgs/profile/README.adoc +10 -0
  5. data/.data/cfgs/profile/RVA20S64.yaml +26 -6
  6. data/.data/cfgs/profile/RVA20U64.yaml +18 -4
  7. data/.data/cfgs/profile/RVA22S64.yaml +27 -7
  8. data/.data/cfgs/profile/RVA22U64.yaml +18 -4
  9. data/.data/cfgs/profile/RVA23S64.yaml +61 -7
  10. data/.data/cfgs/profile/RVA23U64.yaml +36 -4
  11. data/.data/cfgs/profile/RVB23S64.yaml +27 -7
  12. data/.data/cfgs/profile/RVB23U64.yaml +18 -4
  13. data/.data/cfgs/profile/RVI20U32.yaml +10 -4
  14. data/.data/cfgs/profile/RVI20U64.yaml +10 -4
  15. data/.data/cfgs/qc_iu.yaml +8 -1
  16. data/.data/cfgs/rv32-riscv-tests.yaml +6 -2
  17. data/.data/cfgs/rv32-vector.yaml +6 -2
  18. data/.data/cfgs/rv64-riscv-tests.yaml +6 -2
  19. data/.data/cfgs/rv64-vector.yaml +6 -2
  20. data/.data/spec/custom/isa/qc_iu/csr/Smrnmi/mnepc.yaml +17 -0
  21. data/.data/spec/custom/isa/qc_iu/csr/Xqccmi/qc.itba.yaml +45 -0
  22. data/.data/spec/custom/isa/qc_iu/csr/Xqccmi/qc.itdec.yaml +39 -0
  23. data/.data/spec/custom/isa/qc_iu/csr/jvt.yaml +11 -0
  24. data/.data/spec/custom/isa/qc_iu/csr/mepc.yaml +16 -0
  25. data/.data/spec/custom/isa/qc_iu/ext/Xqccmi.yaml +290 -0
  26. data/.data/spec/custom/isa/qc_iu/ext/Xqccmt.yaml +127 -0
  27. data/.data/spec/custom/isa/qc_iu/inst/Xqccmi/qc.cm.ilut.yaml +136 -0
  28. data/.data/spec/custom/isa/qc_iu/inst/Xqccmt/qc.cm.jalt.yaml +84 -0
  29. data/.data/spec/custom/isa/qc_iu/inst/Xqccmt/qc.cm.jt.yaml +60 -0
  30. data/.data/spec/custom/isa/qc_iu/isa/globals.isa +134 -0
  31. data/.data/spec/schemas/config_schema.json +220 -27
  32. data/.data/spec/schemas/csr_schema.json +0 -6
  33. data/.data/spec/schemas/ext_schema.json +80 -24
  34. data/.data/spec/schemas/inst_schema.json +0 -3
  35. data/.data/spec/schemas/mmr_schema.json +3 -3
  36. data/.data/spec/schemas/profile_release_schema.json +1 -1
  37. data/.data/spec/schemas/profile_schema.json +0 -3
  38. data/.data/spec/schemas/register_file_schema.json +8 -3
  39. data/.data/spec/schemas/schema_defs.json +13 -27
  40. data/.data/spec/std/isa/csr/H/henvcfg.yaml +25 -0
  41. data/.data/spec/std/isa/csr/I/pmpaddr0.yaml +6 -4
  42. data/.data/spec/std/isa/csr/I/pmpaddr1.yaml +6 -4
  43. data/.data/spec/std/isa/csr/I/pmpaddr10.yaml +6 -4
  44. data/.data/spec/std/isa/csr/I/pmpaddr11.yaml +6 -4
  45. data/.data/spec/std/isa/csr/I/pmpaddr12.yaml +6 -4
  46. data/.data/spec/std/isa/csr/I/pmpaddr13.yaml +6 -4
  47. data/.data/spec/std/isa/csr/I/pmpaddr14.yaml +6 -4
  48. data/.data/spec/std/isa/csr/I/pmpaddr15.yaml +6 -4
  49. data/.data/spec/std/isa/csr/I/pmpaddr16.yaml +6 -4
  50. data/.data/spec/std/isa/csr/I/pmpaddr17.yaml +6 -4
  51. data/.data/spec/std/isa/csr/I/pmpaddr18.yaml +6 -4
  52. data/.data/spec/std/isa/csr/I/pmpaddr19.yaml +6 -4
  53. data/.data/spec/std/isa/csr/I/pmpaddr2.yaml +6 -4
  54. data/.data/spec/std/isa/csr/I/pmpaddr20.yaml +6 -4
  55. data/.data/spec/std/isa/csr/I/pmpaddr21.yaml +6 -4
  56. data/.data/spec/std/isa/csr/I/pmpaddr22.yaml +6 -4
  57. data/.data/spec/std/isa/csr/I/pmpaddr23.yaml +6 -4
  58. data/.data/spec/std/isa/csr/I/pmpaddr24.yaml +6 -4
  59. data/.data/spec/std/isa/csr/I/pmpaddr25.yaml +6 -4
  60. data/.data/spec/std/isa/csr/I/pmpaddr26.yaml +6 -4
  61. data/.data/spec/std/isa/csr/I/pmpaddr27.yaml +6 -4
  62. data/.data/spec/std/isa/csr/I/pmpaddr28.yaml +6 -4
  63. data/.data/spec/std/isa/csr/I/pmpaddr29.yaml +6 -4
  64. data/.data/spec/std/isa/csr/I/pmpaddr3.yaml +6 -4
  65. data/.data/spec/std/isa/csr/I/pmpaddr30.yaml +6 -4
  66. data/.data/spec/std/isa/csr/I/pmpaddr31.yaml +6 -4
  67. data/.data/spec/std/isa/csr/I/pmpaddr32.yaml +6 -4
  68. data/.data/spec/std/isa/csr/I/pmpaddr33.yaml +6 -4
  69. data/.data/spec/std/isa/csr/I/pmpaddr34.yaml +6 -4
  70. data/.data/spec/std/isa/csr/I/pmpaddr35.yaml +6 -4
  71. data/.data/spec/std/isa/csr/I/pmpaddr36.yaml +6 -4
  72. data/.data/spec/std/isa/csr/I/pmpaddr37.yaml +6 -4
  73. data/.data/spec/std/isa/csr/I/pmpaddr38.yaml +6 -4
  74. data/.data/spec/std/isa/csr/I/pmpaddr39.yaml +6 -4
  75. data/.data/spec/std/isa/csr/I/pmpaddr4.yaml +6 -4
  76. data/.data/spec/std/isa/csr/I/pmpaddr40.yaml +6 -4
  77. data/.data/spec/std/isa/csr/I/pmpaddr41.yaml +6 -4
  78. data/.data/spec/std/isa/csr/I/pmpaddr42.yaml +6 -4
  79. data/.data/spec/std/isa/csr/I/pmpaddr43.yaml +6 -4
  80. data/.data/spec/std/isa/csr/I/pmpaddr44.yaml +6 -4
  81. data/.data/spec/std/isa/csr/I/pmpaddr45.yaml +6 -4
  82. data/.data/spec/std/isa/csr/I/pmpaddr46.yaml +6 -4
  83. data/.data/spec/std/isa/csr/I/pmpaddr47.yaml +6 -4
  84. data/.data/spec/std/isa/csr/I/pmpaddr48.yaml +6 -4
  85. data/.data/spec/std/isa/csr/I/pmpaddr49.yaml +6 -4
  86. data/.data/spec/std/isa/csr/I/pmpaddr5.yaml +6 -4
  87. data/.data/spec/std/isa/csr/I/pmpaddr50.yaml +6 -4
  88. data/.data/spec/std/isa/csr/I/pmpaddr51.yaml +6 -4
  89. data/.data/spec/std/isa/csr/I/pmpaddr52.yaml +6 -4
  90. data/.data/spec/std/isa/csr/I/pmpaddr53.yaml +6 -4
  91. data/.data/spec/std/isa/csr/I/pmpaddr54.yaml +6 -4
  92. data/.data/spec/std/isa/csr/I/pmpaddr55.yaml +6 -4
  93. data/.data/spec/std/isa/csr/I/pmpaddr56.yaml +6 -4
  94. data/.data/spec/std/isa/csr/I/pmpaddr57.yaml +6 -4
  95. data/.data/spec/std/isa/csr/I/pmpaddr58.yaml +6 -4
  96. data/.data/spec/std/isa/csr/I/pmpaddr59.yaml +6 -4
  97. data/.data/spec/std/isa/csr/I/pmpaddr6.yaml +6 -4
  98. data/.data/spec/std/isa/csr/I/pmpaddr60.yaml +6 -4
  99. data/.data/spec/std/isa/csr/I/pmpaddr61.yaml +6 -4
  100. data/.data/spec/std/isa/csr/I/pmpaddr62.yaml +6 -4
  101. data/.data/spec/std/isa/csr/I/pmpaddr63.yaml +6 -4
  102. data/.data/spec/std/isa/csr/I/pmpaddr7.yaml +6 -4
  103. data/.data/spec/std/isa/csr/I/pmpaddr8.yaml +6 -4
  104. data/.data/spec/std/isa/csr/I/pmpaddr9.yaml +6 -4
  105. data/.data/spec/std/isa/csr/I/pmpaddrN.layout +6 -4
  106. data/.data/spec/std/isa/csr/I/pmpcfg0.yaml +128 -152
  107. data/.data/spec/std/isa/csr/I/pmpcfg1.yaml +64 -76
  108. data/.data/spec/std/isa/csr/I/pmpcfg10.yaml +128 -152
  109. data/.data/spec/std/isa/csr/I/pmpcfg11.yaml +64 -76
  110. data/.data/spec/std/isa/csr/I/pmpcfg12.yaml +128 -152
  111. data/.data/spec/std/isa/csr/I/pmpcfg13.yaml +64 -76
  112. data/.data/spec/std/isa/csr/I/pmpcfg14.yaml +128 -152
  113. data/.data/spec/std/isa/csr/I/pmpcfg15.yaml +64 -76
  114. data/.data/spec/std/isa/csr/I/pmpcfg2.yaml +128 -152
  115. data/.data/spec/std/isa/csr/I/pmpcfg3.yaml +64 -76
  116. data/.data/spec/std/isa/csr/I/pmpcfg4.yaml +128 -152
  117. data/.data/spec/std/isa/csr/I/pmpcfg5.yaml +64 -76
  118. data/.data/spec/std/isa/csr/I/pmpcfg6.yaml +128 -152
  119. data/.data/spec/std/isa/csr/I/pmpcfg7.yaml +64 -76
  120. data/.data/spec/std/isa/csr/I/pmpcfg8.yaml +128 -152
  121. data/.data/spec/std/isa/csr/I/pmpcfg9.yaml +64 -76
  122. data/.data/spec/std/isa/csr/I/pmpcfgN.layout +16 -19
  123. data/.data/spec/std/isa/csr/Zicntr/mcountinhibit.layout +6 -2
  124. data/.data/spec/std/isa/csr/Zicntr/mcountinhibit.yaml +6 -2
  125. data/.data/spec/std/isa/csr/hstatus.yaml +16 -0
  126. data/.data/spec/std/isa/csr/jvt.yaml +1 -0
  127. data/.data/spec/std/isa/csr/mcycleh.yaml +1 -1
  128. data/.data/spec/std/isa/csr/menvcfg.yaml +20 -0
  129. data/.data/spec/std/isa/csr/misa.yaml +0 -12
  130. data/.data/spec/std/isa/csr/mstatus.yaml +46 -6
  131. data/.data/spec/std/isa/csr/mstatush.yaml +17 -15
  132. data/.data/spec/std/isa/csr/senvcfg.yaml +42 -0
  133. data/.data/spec/std/isa/csr/sstatus.yaml +12 -0
  134. data/.data/spec/std/isa/csr/vsstatus.yaml +24 -0
  135. data/.data/spec/std/isa/ext/A.yaml +5 -7
  136. data/.data/spec/std/isa/ext/S.yaml +12 -0
  137. data/.data/spec/std/isa/ext/Smpmpmt.yaml +52 -0
  138. data/.data/spec/std/isa/ext/Sv32.yaml +7 -19
  139. data/.data/spec/std/isa/ext/Sv39.yaml +7 -19
  140. data/.data/spec/std/isa/ext/Sv48.yaml +4 -20
  141. data/.data/spec/std/isa/ext/Sv57.yaml +4 -20
  142. data/.data/spec/std/isa/ext/Svukte.yaml +71 -0
  143. data/.data/spec/std/isa/ext/Zawrs.yaml +1 -1
  144. data/.data/spec/std/isa/ext/Zihpm.yaml +0 -12
  145. data/.data/spec/std/isa/inst/B/andn.yaml +10 -12
  146. data/.data/spec/std/isa/inst/B/clmul.yaml +9 -11
  147. data/.data/spec/std/isa/inst/B/clmulh.yaml +9 -11
  148. data/.data/spec/std/isa/inst/B/orn.yaml +9 -11
  149. data/.data/spec/std/isa/inst/B/rev8.yaml +1 -1
  150. data/.data/spec/std/isa/inst/B/rol.yaml +9 -11
  151. data/.data/spec/std/isa/inst/B/rolw.yaml +9 -11
  152. data/.data/spec/std/isa/inst/B/ror.yaml +9 -11
  153. data/.data/spec/std/isa/inst/B/rorw.yaml +9 -11
  154. data/.data/spec/std/isa/inst/B/xnor.yaml +9 -11
  155. data/.data/spec/std/isa/inst/C/c.addi.yaml +1 -0
  156. data/.data/spec/std/isa/inst/C/c.addi16sp.yaml +1 -0
  157. data/.data/spec/std/isa/inst/C/c.addiw.yaml +1 -0
  158. data/.data/spec/std/isa/inst/C/c.andi.yaml +1 -0
  159. data/.data/spec/std/isa/inst/C/c.ldsp.yaml +4 -4
  160. data/.data/spec/std/isa/inst/C/c.li.yaml +1 -0
  161. data/.data/spec/std/isa/inst/C/c.lui.yaml +1 -0
  162. data/.data/spec/std/isa/inst/C/c.mv.yaml +1 -1
  163. data/.data/spec/std/isa/inst/C/c.sdsp.yaml +1 -1
  164. data/.data/spec/std/isa/inst/D/fsgnj.d.yaml +3 -0
  165. data/.data/spec/std/isa/inst/D/fsgnjn.d.yaml +3 -0
  166. data/.data/spec/std/isa/inst/D/fsgnjx.d.yaml +3 -0
  167. data/.data/spec/std/isa/inst/F/fadd.s.yaml +5 -5
  168. data/.data/spec/std/isa/inst/F/fclass.s.yaml +2 -2
  169. data/.data/spec/std/isa/inst/F/fcvt.l.s.yaml +1 -1
  170. data/.data/spec/std/isa/inst/F/fcvt.lu.s.yaml +1 -1
  171. data/.data/spec/std/isa/inst/F/fcvt.s.l.yaml +1 -1
  172. data/.data/spec/std/isa/inst/F/fcvt.s.lu.yaml +1 -1
  173. data/.data/spec/std/isa/inst/F/fcvt.s.w.yaml +1 -1
  174. data/.data/spec/std/isa/inst/F/fcvt.s.wu.yaml +1 -1
  175. data/.data/spec/std/isa/inst/F/fcvt.w.s.yaml +1 -1
  176. data/.data/spec/std/isa/inst/F/fcvt.wu.s.yaml +1 -1
  177. data/.data/spec/std/isa/inst/F/fdiv.s.yaml +1 -1
  178. data/.data/spec/std/isa/inst/F/feq.s.yaml +2 -2
  179. data/.data/spec/std/isa/inst/F/fle.s.yaml +2 -2
  180. data/.data/spec/std/isa/inst/F/fleq.s.yaml +2 -2
  181. data/.data/spec/std/isa/inst/F/flt.s.yaml +2 -2
  182. data/.data/spec/std/isa/inst/F/fltq.s.yaml +2 -2
  183. data/.data/spec/std/isa/inst/F/flw.yaml +2 -2
  184. data/.data/spec/std/isa/inst/F/fmadd.s.yaml +1 -1
  185. data/.data/spec/std/isa/inst/F/fmax.s.yaml +6 -6
  186. data/.data/spec/std/isa/inst/F/fmin.s.yaml +6 -6
  187. data/.data/spec/std/isa/inst/F/fmsub.s.yaml +1 -1
  188. data/.data/spec/std/isa/inst/F/fmul.s.yaml +1 -1
  189. data/.data/spec/std/isa/inst/F/fmv.w.x.yaml +2 -2
  190. data/.data/spec/std/isa/inst/F/fmv.x.w.yaml +1 -1
  191. data/.data/spec/std/isa/inst/F/fnmadd.s.yaml +2 -2
  192. data/.data/spec/std/isa/inst/F/fnmsub.s.yaml +1 -1
  193. data/.data/spec/std/isa/inst/F/fsgnj.s.yaml +4 -4
  194. data/.data/spec/std/isa/inst/F/fsgnjn.s.yaml +3 -3
  195. data/.data/spec/std/isa/inst/F/fsgnjx.s.yaml +4 -4
  196. data/.data/spec/std/isa/inst/F/fsqrt.s.yaml +1 -1
  197. data/.data/spec/std/isa/inst/F/fsub.s.yaml +1 -1
  198. data/.data/spec/std/isa/inst/F/fsw.yaml +1 -1
  199. data/.data/spec/std/isa/inst/I/addi.yaml +2 -1
  200. data/.data/spec/std/isa/inst/I/addiw.yaml +2 -1
  201. data/.data/spec/std/isa/inst/I/andi.yaml +2 -1
  202. data/.data/spec/std/isa/inst/I/auipc.yaml +1 -0
  203. data/.data/spec/std/isa/inst/I/beq.yaml +1 -1
  204. data/.data/spec/std/isa/inst/I/bge.yaml +4 -2
  205. data/.data/spec/std/isa/inst/I/bgeu.yaml +3 -0
  206. data/.data/spec/std/isa/inst/I/blt.yaml +4 -2
  207. data/.data/spec/std/isa/inst/I/bltu.yaml +3 -0
  208. data/.data/spec/std/isa/inst/I/bne.yaml +1 -1
  209. data/.data/spec/std/isa/inst/I/lb.yaml +1 -0
  210. data/.data/spec/std/isa/inst/I/lbu.yaml +1 -0
  211. data/.data/spec/std/isa/inst/I/ld.yaml +2 -0
  212. data/.data/spec/std/isa/inst/I/lh.yaml +1 -0
  213. data/.data/spec/std/isa/inst/I/lhu.yaml +1 -0
  214. data/.data/spec/std/isa/inst/I/lui.yaml +1 -0
  215. data/.data/spec/std/isa/inst/I/lw.yaml +1 -0
  216. data/.data/spec/std/isa/inst/I/lwu.yaml +1 -0
  217. data/.data/spec/std/isa/inst/I/ori.yaml +1 -0
  218. data/.data/spec/std/isa/inst/I/sb.yaml +1 -0
  219. data/.data/spec/std/isa/inst/I/sd.yaml +1 -0
  220. data/.data/spec/std/isa/inst/I/sh.yaml +1 -0
  221. data/.data/spec/std/isa/inst/I/slt.yaml +2 -2
  222. data/.data/spec/std/isa/inst/I/slti.yaml +1 -0
  223. data/.data/spec/std/isa/inst/I/sltiu.yaml +2 -1
  224. data/.data/spec/std/isa/inst/I/sltu.yaml +1 -1
  225. data/.data/spec/std/isa/inst/I/sub.yaml +1 -1
  226. data/.data/spec/std/isa/inst/I/subw.yaml +1 -1
  227. data/.data/spec/std/isa/inst/I/sw.yaml +1 -0
  228. data/.data/spec/std/isa/inst/I/xori.yaml +2 -1
  229. data/.data/spec/std/isa/inst/M/mul.yaml +0 -19
  230. data/.data/spec/std/isa/inst/Q/fsgnj.q.yaml +1 -1
  231. data/.data/spec/std/isa/inst/S/sret.yaml +3 -1
  232. data/.data/spec/std/isa/inst/V/vadc.vim.yaml +1 -0
  233. data/.data/spec/std/isa/inst/V/vadd.vi.yaml +1 -0
  234. data/.data/spec/std/isa/inst/V/vadd.vv.yaml +1 -5
  235. data/.data/spec/std/isa/inst/V/vand.vi.yaml +1 -0
  236. data/.data/spec/std/isa/inst/V/vfsgnjn.vv.yaml +3 -0
  237. data/.data/spec/std/isa/inst/V/vfsgnjx.vv.yaml +3 -0
  238. data/.data/spec/std/isa/inst/V/vl1re8.v.yaml +3 -0
  239. data/.data/spec/std/isa/inst/V/vl2re8.v.yaml +3 -0
  240. data/.data/spec/std/isa/inst/V/vl4re8.v.yaml +3 -0
  241. data/.data/spec/std/isa/inst/V/vl8re8.v.yaml +3 -0
  242. data/.data/spec/std/isa/inst/V/vle8.v.yaml +4 -8
  243. data/.data/spec/std/isa/inst/V/vmadc.vi.yaml +1 -0
  244. data/.data/spec/std/isa/inst/V/vmadc.vim.yaml +1 -0
  245. data/.data/spec/std/isa/inst/V/vmand.mm.yaml +3 -0
  246. data/.data/spec/std/isa/inst/V/vmerge.vim.yaml +1 -0
  247. data/.data/spec/std/isa/inst/V/vmfle.vv.yaml +3 -0
  248. data/.data/spec/std/isa/inst/V/vmflt.vv.yaml +3 -0
  249. data/.data/spec/std/isa/inst/V/vmnand.mm.yaml +3 -0
  250. data/.data/spec/std/isa/inst/V/vmseq.vi.yaml +1 -0
  251. data/.data/spec/std/isa/inst/V/vmsgt.vi.yaml +4 -0
  252. data/.data/spec/std/isa/inst/V/vmsgtu.vi.yaml +4 -0
  253. data/.data/spec/std/isa/inst/V/vmsle.vi.yaml +4 -0
  254. data/.data/spec/std/isa/inst/V/vmsle.vv.yaml +3 -0
  255. data/.data/spec/std/isa/inst/V/vmsleu.vi.yaml +4 -0
  256. data/.data/spec/std/isa/inst/V/vmsleu.vv.yaml +3 -0
  257. data/.data/spec/std/isa/inst/V/vmslt.vv.yaml +3 -0
  258. data/.data/spec/std/isa/inst/V/vmsltu.vv.yaml +3 -0
  259. data/.data/spec/std/isa/inst/V/vmsne.vi.yaml +1 -0
  260. data/.data/spec/std/isa/inst/V/vmv.v.i.yaml +2 -13
  261. data/.data/spec/std/isa/inst/V/vmv.x.s.yaml +1 -1
  262. data/.data/spec/std/isa/inst/V/vmxnor.mm.yaml +3 -0
  263. data/.data/spec/std/isa/inst/V/vmxor.mm.yaml +3 -0
  264. data/.data/spec/std/isa/inst/V/vnsrl.wx.yaml +3 -0
  265. data/.data/spec/std/isa/inst/V/vor.vi.yaml +1 -0
  266. data/.data/spec/std/isa/inst/V/vrsub.vi.yaml +1 -0
  267. data/.data/spec/std/isa/inst/V/vrsub.vx.yaml +3 -0
  268. data/.data/spec/std/isa/inst/V/vsadd.vi.yaml +1 -0
  269. data/.data/spec/std/isa/inst/V/vsaddu.vi.yaml +1 -0
  270. data/.data/spec/std/isa/inst/V/vse8.v.yaml +4 -4
  271. data/.data/spec/std/isa/inst/V/vwadd.vx.yaml +3 -0
  272. data/.data/spec/std/isa/inst/V/vwaddu.vx.yaml +3 -0
  273. data/.data/spec/std/isa/inst/V/vxor.vi.yaml +4 -0
  274. data/.data/spec/std/isa/inst/Zalasr/lSIZE.AQRL.layout +40 -5
  275. data/.data/spec/std/isa/inst/Zalasr/lb.aq.yaml +17 -1
  276. data/.data/spec/std/isa/inst/Zalasr/lb.aqrl.yaml +17 -1
  277. data/.data/spec/std/isa/inst/Zalasr/ld.aq.yaml +17 -1
  278. data/.data/spec/std/isa/inst/Zalasr/ld.aqrl.yaml +17 -1
  279. data/.data/spec/std/isa/inst/Zalasr/lh.aq.yaml +17 -1
  280. data/.data/spec/std/isa/inst/Zalasr/lh.aqrl.yaml +17 -1
  281. data/.data/spec/std/isa/inst/Zalasr/lw.aq.yaml +17 -1
  282. data/.data/spec/std/isa/inst/Zalasr/lw.aqrl.yaml +17 -1
  283. data/.data/spec/std/isa/inst/Zalasr/sSIZE.AQRL.layout +46 -5
  284. data/.data/spec/std/isa/inst/Zalasr/sb.aqrl.yaml +16 -1
  285. data/.data/spec/std/isa/inst/Zalasr/sb.rl.yaml +16 -1
  286. data/.data/spec/std/isa/inst/Zalasr/sd.aqrl.yaml +16 -1
  287. data/.data/spec/std/isa/inst/Zalasr/sd.rl.yaml +16 -1
  288. data/.data/spec/std/isa/inst/Zalasr/sh.aqrl.yaml +16 -1
  289. data/.data/spec/std/isa/inst/Zalasr/sh.rl.yaml +16 -1
  290. data/.data/spec/std/isa/inst/Zalasr/sw.aqrl.yaml +16 -1
  291. data/.data/spec/std/isa/inst/Zalasr/sw.rl.yaml +16 -1
  292. data/.data/spec/std/isa/inst/Zawrs/wrs.nto.yaml +4 -2
  293. data/.data/spec/std/isa/inst/Zba/add.uw.yaml +9 -11
  294. data/.data/spec/std/isa/inst/Zbb/orc.b.yaml +1 -1
  295. data/.data/spec/std/isa/inst/Zbkb/brev8.yaml +3 -3
  296. data/.data/spec/std/isa/inst/Zbkb/packw.yaml +1 -1
  297. data/.data/spec/std/isa/inst/Zbkb/unzip.yaml +2 -2
  298. data/.data/spec/std/isa/inst/Zbkb/zip.yaml +2 -2
  299. data/.data/spec/std/isa/inst/Zbkx/xperm4.yaml +2 -2
  300. data/.data/spec/std/isa/inst/Zbkx/xperm8.yaml +2 -2
  301. data/.data/spec/std/isa/inst/Zcd/c.fld.yaml +1 -1
  302. data/.data/spec/std/isa/inst/Zcd/c.fldsp.yaml +1 -1
  303. data/.data/spec/std/isa/inst/Zcd/c.fsdsp.yaml +1 -1
  304. data/.data/spec/std/isa/inst/Zcf/c.flwsp.yaml +1 -1
  305. data/.data/spec/std/isa/inst/Zcf/c.fswsp.yaml +1 -1
  306. data/.data/spec/std/isa/inst/Zcmp/cm.pop.yaml +1 -1
  307. data/.data/spec/std/isa/inst/Zcmp/cm.popret.yaml +1 -1
  308. data/.data/spec/std/isa/inst/Zcmp/cm.popretz.yaml +1 -1
  309. data/.data/spec/std/isa/inst/Zcmp/cm.push.yaml +2 -3
  310. data/.data/spec/std/isa/inst/Zfa/fround.s.yaml +1 -1
  311. data/.data/spec/std/isa/inst/Zfh/fcvt.h.s.yaml +6 -6
  312. data/.data/spec/std/isa/inst/Zfh/fcvt.s.h.yaml +5 -5
  313. data/.data/spec/std/isa/inst/Zfh/flh.yaml +1 -1
  314. data/.data/spec/std/isa/inst/Zfh/fmv.h.x.yaml +1 -1
  315. data/.data/spec/std/isa/inst/Zfh/fmv.x.h.yaml +1 -1
  316. data/.data/spec/std/isa/inst/Zfh/fsh.yaml +1 -1
  317. data/.data/spec/std/isa/inst/Zicbop/prefetch.i.yaml +2 -0
  318. data/.data/spec/std/isa/inst/Zicbop/prefetch.r.yaml +2 -0
  319. data/.data/spec/std/isa/inst/Zicbop/prefetch.w.yaml +2 -0
  320. data/.data/spec/std/isa/inst/Zicsr/csrrc.yaml +1 -1
  321. data/.data/spec/std/isa/inst/Zicsr/csrrci.yaml +1 -1
  322. data/.data/spec/std/isa/inst/Zicsr/csrrs.yaml +2 -2
  323. data/.data/spec/std/isa/inst/Zicsr/csrrsi.yaml +1 -1
  324. data/.data/spec/std/isa/inst/Zicsr/csrrw.yaml +1 -1
  325. data/.data/spec/std/isa/inst/Zicsr/csrrwi.yaml +1 -1
  326. data/.data/spec/std/isa/inst/Zks/sm3p0.yaml +1 -1
  327. data/.data/spec/std/isa/inst/Zks/sm3p1.yaml +1 -1
  328. data/.data/spec/std/isa/inst/Zks/sm4ed.yaml +1 -1
  329. data/.data/spec/std/isa/inst/Zks/sm4ks.yaml +1 -1
  330. data/.data/spec/std/isa/isa/builtin_functions.idl +18 -0
  331. data/.data/spec/std/isa/isa/fp.idl +1 -5
  332. data/.data/spec/std/isa/isa/globals.isa +72 -21
  333. data/.data/spec/std/isa/isa/interrupts.idl +1 -0
  334. data/.data/spec/std/isa/isa/vec.idl +1 -2
  335. data/.data/spec/std/isa/manual_version/isa/20240411/isa_20240411.yaml +5 -5
  336. data/.data/spec/std/isa/param/COUNTINHIBIT_EN.yaml +8 -2
  337. data/.data/spec/std/isa/param/HSTATEEN_CONTEXT_TYPE.yaml +1 -0
  338. data/.data/spec/std/isa/param/JVT_BASE_MASK.yaml +1 -1
  339. data/.data/spec/std/isa/param/MCOUNTINHIBIT_IMPLEMENTED.yaml +25 -0
  340. data/.data/spec/std/isa/param/MSTATEEN_CONTEXT_TYPE.yaml +1 -0
  341. data/.data/spec/std/isa/param/MTVEC_BASE_ALIGNMENT_DIRECT.yaml +1 -0
  342. data/.data/spec/std/isa/param/MTVEC_BASE_ALIGNMENT_VECTORED.yaml +1 -0
  343. data/.data/spec/std/isa/param/MTVEC_MODES.yaml +10 -3
  344. data/.data/spec/std/isa/param/NUM_PMP_ENTRIES.yaml +11 -22
  345. data/.data/spec/std/isa/param/NUM_USABLE_PMP_ENTRIES.yaml +35 -0
  346. data/.data/spec/std/isa/param/PMP_NA4_SUPPORTED.yaml +23 -0
  347. data/.data/spec/std/isa/param/PMP_NAPOT_SUPPORTED.yaml +19 -0
  348. data/.data/spec/std/isa/param/{MSTATUS_TVM_IMPLEMENTED.yaml → PMP_TOR_SUPPORTED.yaml} +6 -6
  349. data/.data/spec/std/isa/param/PRECISE_SYNCHRONOUS_EXCEPTIONS.yaml +1 -0
  350. data/.data/spec/std/isa/param/TRAP_ON_EBREAK.yaml +1 -0
  351. data/.data/spec/std/isa/param/TRAP_ON_ECALL_FROM_M.yaml +1 -0
  352. data/.data/spec/std/isa/param/TRAP_ON_SFENCE_VMA_WHEN_SATP_MODE_IS_READ_ONLY.yaml +1 -0
  353. data/.data/spec/std/isa/param/VLEN.yaml +2 -0
  354. data/.data/spec/std/isa/param/ZAWRS_NTO_IS_NOP.yaml +19 -0
  355. data/.data/spec/std/isa/profile/RVA20S64.yaml +11 -4
  356. data/.data/spec/std/isa/profile/RVA20U64.yaml +14 -5
  357. data/.data/spec/std/isa/profile/RVA22S64.yaml +14 -3
  358. data/.data/spec/std/isa/profile/RVA22U64.yaml +8 -1
  359. data/.data/spec/std/isa/profile/RVA23S64.yaml +13 -0
  360. data/.data/spec/std/isa/profile/RVA23U64.yaml +15 -1
  361. data/.data/spec/std/isa/profile/RVB23S64.yaml +15 -3
  362. data/.data/spec/std/isa/profile/RVB23U64.yaml +8 -1
  363. data/.data/spec/std/isa/profile/RVI20U32.yaml +8 -1
  364. data/.data/spec/std/isa/profile/RVI20U64.yaml +7 -0
  365. data/.data/spec/std/isa/register_file/F.yaml +3 -2
  366. data/.data/spec/std/isa/register_file/V.yaml +2 -2
  367. data/.data/spec/std/isa/register_file/X.yaml +2 -1
  368. data/lib/udb/ESPRESSO_VERSION +1 -1
  369. data/lib/udb/architecture.rb +4 -25
  370. data/lib/udb/cfg_arch.rb +171 -59
  371. data/lib/udb/cli.rb +10 -1
  372. data/lib/udb/condition.rb +38 -37
  373. data/lib/udb/config.rb +86 -8
  374. data/lib/udb/doc_link.rb +3 -4
  375. data/lib/udb/logic.rb +29 -56
  376. data/lib/udb/obj/csr.rb +23 -5
  377. data/lib/udb/obj/csr_field.rb +36 -21
  378. data/lib/udb/obj/database_obj.rb +2 -5
  379. data/lib/udb/obj/extension.rb +0 -3
  380. data/lib/udb/obj/instruction.rb +2 -5
  381. data/lib/udb/obj/non_isa_specification.rb +22 -100
  382. data/lib/udb/obj/portfolio.rb +75 -20
  383. data/lib/udb/obj/profile.rb +0 -4
  384. data/lib/udb/obj/register_file.rb +63 -2
  385. data/lib/udb/portfolio_design.rb +3 -6
  386. data/lib/udb/resolver.rb +84 -23
  387. data/lib/udb/version.rb +1 -1
  388. data/lib/udb/version_spec.rb +8 -0
  389. data/lib/udb/z3.rb +25 -2
  390. data/lib/udb.rb +0 -3
  391. metadata +30 -38
  392. data/.data/cfgs/profile/RVA23M64.yaml +0 -159
  393. data/.data/cfgs/profile/RVB23M64.yaml +0 -149
  394. data/.data/spec/schemas/proc_cert_class_schema.json +0 -35
  395. data/.data/spec/schemas/proc_cert_model_schema.json +0 -336
  396. data/.data/spec/std/isa/proc_cert_class/AC.yaml +0 -13
  397. data/.data/spec/std/isa/proc_cert_class/MC.yaml +0 -13
  398. data/.data/spec/std/isa/proc_cert_class/RVI.yaml +0 -16
  399. data/.data/spec/std/isa/proc_cert_model/AC100.yaml +0 -72
  400. data/.data/spec/std/isa/proc_cert_model/AC200.yaml +0 -58
  401. data/.data/spec/std/isa/proc_cert_model/MC100-32.yaml +0 -155
  402. data/.data/spec/std/isa/proc_cert_model/MC100-64.yaml +0 -21
  403. data/.data/spec/std/isa/proc_cert_model/MC200-32.yaml +0 -60
  404. data/.data/spec/std/isa/proc_cert_model/MC200-64.yaml +0 -21
  405. data/.data/spec/std/isa/proc_cert_model/MC300-32.yaml +0 -40
  406. data/.data/spec/std/isa/proc_cert_model/MC300-64.yaml +0 -21
  407. data/.data/spec/std/isa/proc_cert_model/RVI20-32.yaml +0 -39
  408. data/.data/spec/std/isa/proc_cert_model/RVI20-64.yaml +0 -19
  409. data/.data/spec/std/isa/profile/RVA23M64.yaml +0 -24
  410. data/.data/spec/std/isa/profile/RVB23M64.yaml +0 -86
  411. data/lib/udb/cert_normative_rule.rb +0 -41
  412. data/lib/udb/obj/certifiable_obj.rb +0 -21
  413. data/lib/udb/obj/certificate.rb +0 -230
  414. data/lib/udb/proc_cert_design.rb +0 -77
@@ -0,0 +1,290 @@
1
+ # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2
+ # SPDX-License-Identifier: BSD-3-Clause-Clear
3
+
4
+ # yaml-language-server: $schema=../../../../schemas/ext_schema.json
5
+
6
+ $schema: ext_schema.json#
7
+ kind: extension
8
+ name: Xqccmi
9
+ long_name: Qualcomm Custom Compressed Instruction Lookup Table
10
+ description: |
11
+ == Xqccmi: Qualcomm Custom Compressed Instruction Lookup Table
12
+
13
+ The Xqccmi extension adds the `qc.cm.ilut` instruction, a 16-bit compressed
14
+ instruction that fetches and executes one or two packed instructions from an
15
+ Instruction Lookup Table (ILUT) stored in memory. The extension also defines
16
+ two new user-level CSRs: `qc.itba` (ILUT Base Address) and `qc.itdec` (ILUT
17
+ Double Entry Count).
18
+
19
+ NOTE: Xqccmi uses the same encoding space as the `c.fld` instruction defined
20
+ by the Zcd extension (bits[1:0]=00, bits[15:13]=001). Therefore, Xqccmi and
21
+ Zcd are mutually exclusive and cannot be implemented together.
22
+
23
+ === Instruction Lookup Table (ILUT)
24
+
25
+ `qc.cm.ilut` is a 16-bit instruction that takes an 11-bit immediate index
26
+ (range 0..2047) into the ILUT. The ILUT base address is held in the `qc.itba`
27
+ CSR (address 0x800). The instruction architecturally behaves as the
28
+ sub-instruction(s) stored at the addressed ILUT entry, executed in order.
29
+
30
+ ILUT memory is treated as instruction memory. It requires execute (X)
31
+ permission and does NOT require read (R) permission. A `fence.i` instruction
32
+ must be executed after any write to ILUT memory to guarantee that subsequent
33
+ `qc.cm.ilut` executions observe the updated contents.
34
+
35
+ === qc.itba CSR (Address 0x800)
36
+
37
+ The `qc.itba` CSR holds the base address of the ILUT.
38
+
39
+ [cols="^1,^1,^3,^3",options="header"]
40
+ |===
41
+ | Bits | Name | Access | Description
42
+ | 31:6 | base | WARL (RW) | 64-byte aligned base address of the ILUT. Bits[5:0] of the physical base address are implicitly zero.
43
+ | 5:0 | mode | Read-only 0 | Reserved for future use. Always reads as zero; writes are ignored.
44
+ |===
45
+
46
+ `qc.itba` is a user-level read/write CSR. Software must save and restore
47
+ `qc.itba` on context switches.
48
+
49
+ === qc.itdec CSR (Address 0x801) — Double Entry Count
50
+
51
+ The `qc.itdec` CSR specifies how many of the leading ILUT entries are 64-bit
52
+ double entries. All remaining entries are 32-bit.
53
+
54
+ [cols="^1,^1,^3,^3",options="header"]
55
+ |===
56
+ | Bits | Name | Access | Description
57
+ | 13:3 | dec | WARL (RW) | 11-bit double entry count. Legal range: 0..2047. Reset value: 0.
58
+ | 31:14 | — | Read-only 0 | Reserved. Always reads as zero; writes are ignored.
59
+ | 2:0 | — | Read-only 0 | Reserved. Always reads as zero; writes are ignored.
60
+ |===
61
+
62
+ `qc.itdec` is a user-level read/write CSR. The default reset value of 0
63
+ selects backward-compatible mode in which all entries are 32-bit.
64
+
65
+ === Table Layout
66
+
67
+ The first DEC logical entries (indices 0 through DEC−1) are 64-bit double
68
+ entries. The remaining entries (indices DEC through 2047) are 32-bit entries.
69
+
70
+ The byte offset from the ILUT base address for logical index _i_ is:
71
+
72
+ * If _i_ < DEC: offset = _i_ × 8
73
+ * If _i_ ≥ DEC: offset = DEC × 8 + (_i_ − DEC) × 4
74
+
75
+ The maximum table size is DEC×8 + (2048−DEC)×4 bytes. This ranges from
76
+ approximately 8 KB (DEC=0, all 32-bit entries) up to approximately 16 KB
77
+ (DEC=2047, nearly all 64-bit entries). No alignment constraint beyond the
78
+ 64-byte base alignment imposed by `qc.itba` is required for individual entries.
79
+
80
+ === Dual-Instruction Packing
81
+
82
+ Each ILUT entry may contain one or two instructions packed together.
83
+ Instruction sizes are determined by the standard RISC-V instruction-length
84
+ encoding (bits[1:0] of each sub-instruction).
85
+
86
+ ==== 32-bit Entry Valid Combinations
87
+
88
+ [cols="^1,^3",options="header"]
89
+ |===
90
+ | Combination | Description
91
+ | One 32-bit instruction | bits[1:0] == 2'b11; the entire 32-bit entry is a single RVI instruction.
92
+ | Two 16-bit instructions | bits[1:0] != 2'b11; the first 16-bit RVC instruction occupies bits[15:0] and the second occupies bits[31:16].
93
+ |===
94
+
95
+ ==== 64-bit Entry Valid Combinations
96
+
97
+ [cols="^1,^3",options="header"]
98
+ |===
99
+ | Combination | Description
100
+ | 16 + 32 bits | First instruction is 16-bit (bits[1:0] != 2'b11); second instruction is 32-bit.
101
+ | 16 + 48 bits | First instruction is 16-bit; second instruction is 48-bit.
102
+ | 32 + 16 bits | First instruction is 32-bit (bits[1:0] == 2'b11); second instruction is 16-bit occupying bits[47:32].
103
+ | 32 + 32 bits | Both instructions are 32-bit.
104
+ | Single 48-bit instruction | A single 48-bit instruction occupying bits[47:0]; bits[63:48] must be padded with `c.nop` (16'h0001).
105
+ |===
106
+
107
+ A single 32-bit instruction placed in a 64-bit entry is valid as the 32+16
108
+ case with `c.nop` (16'h0001) padding in bits[63:48].
109
+
110
+ Unused bits in any entry MUST be padded with `c.nop` (16'h0001). Instruction
111
+ combinations that do not fit within the entry size cause an illegal instruction
112
+ exception. Instruction sizes are determined by the standard RISC-V
113
+ instruction-length encoding (bits[1:0] of each sub-instruction).
114
+
115
+ === Instruction Restrictions
116
+
117
+ Any instruction that references PC as an input or output is NOT permitted
118
+ in the ILUT. If any such instruction is present in the entry, an
119
+ IllegalInstruction exception is raised before any sub-instruction in the
120
+ entry takes architectural effect.
121
+
122
+ Forbidden instructions fall into three categories:
123
+
124
+ * *PC-relative instructions* (read PC as input):
125
+ ** `auipc`
126
+ ** All branch instructions (`beq`, `bne`, `blt`, `bge`, `bltu`, `bgeu`,
127
+ `c.beqz`, `c.bnez`, etc.)
128
+ ** PC-relative jump instructions (`jal`, `c.j`, `c.jal`)
129
+
130
+ * *Register-indirect jumps* (write PC as output):
131
+ ** `jalr`
132
+ ** `c.jr`
133
+ ** `c.jalr`
134
+
135
+ * *Return instructions* (write PC as output):
136
+ ** `cm.popret`
137
+ ** `cm.popretz`
138
+ ** `qc.cm.popret`
139
+ ** `qc.cm.popretz`
140
+
141
+ The following push/pop instructions are explicitly *allowed* in ILUT entries
142
+ because they do not reference PC:
143
+ `cm.push`, `cm.pop`, `qc.cm.push`, `qc.cm.pushfp`, `qc.cm.pop`.
144
+
145
+ 16-bit compressed instructions (bits[1:0] != 2'b11) are otherwise valid
146
+ in ILUT entries.
147
+
148
+ === Execution Model
149
+
150
+ The PC points to the `qc.cm.ilut` instruction throughout the execution of all
151
+ sub-instructions contained within the fetched ILUT entry. Sub-instructions
152
+ execute sequentially and independently:
153
+
154
+ * The architectural state changes produced by the first sub-instruction are
155
+ visible to the second sub-instruction and to any subsequent trap handler.
156
+ * Each sub-instruction can trap independently; traps are taken precisely at the
157
+ sub-instruction that caused them, not deferred.
158
+ * After the final sub-instruction completes, the PC advances past `qc.cm.ilut`
159
+ normally.
160
+
161
+ === Exception Handling
162
+
163
+ On any trap (exception, interrupt, NMI, or double-trap) occurring during the
164
+ execution of a sub-instruction fetched from the ILUT:
165
+
166
+ * mepc (or mnepc for a double-trap) is set to the PC of `qc.cm.ilut`.
167
+ * Bit 0 of mepc/mnepc encodes which sub-instruction was executing when the trap
168
+ occurred:
169
+ ** Bit 0 = 0: the trap occurred during the first (or only) sub-instruction.
170
+ ** Bit 0 = 1: the trap occurred during the second sub-instruction (the
171
+ architectural effects of the first sub-instruction are already visible).
172
+
173
+ On trap return (`mret`, `qc.c.mret`, `qc.c.mnret`, `qc.c.mileaveret`), $pc is
174
+ restored directly from mepc/mnepc including bit 0:
175
+
176
+ * If bit 0 = 0: `qc.cm.ilut` re-executes from the beginning, running both
177
+ sub-instructions.
178
+ * If bit 0 = 1: `qc.cm.ilut` skips the first sub-instruction and executes only
179
+ the second.
180
+
181
+ Bit 0 of mepc/mnepc is readable and writable in this architecture.
182
+ Software may explicitly set bit 0 to 1 to force resumption from the second
183
+ sub-instruction.
184
+
185
+ NOTE: This is an architectural exception to the standard RISC-V requirement
186
+ that *epc bit 0 is always zero. The non-zero bit 0 encodes which sub-instruction
187
+ within the ILUT entry was interrupted, enabling precise trap restart.
188
+
189
+ === Encoding
190
+
191
+ `qc.cm.ilut` uses the same encoding as `c.fld` (bits[1:0]=00,
192
+ bits[15:13]=001). Xqccmi is therefore mutually exclusive with the Zcd
193
+ extension.
194
+
195
+ [cols="^2,^5,^2",options="header"]
196
+ |===
197
+ | Bits[15:13] | Bits[12:2] | Bits[1:0]
198
+ | 001 | ilut_index[10:0] | 00
199
+ |===
200
+
201
+ The 11-bit `ilut_index` field (bits[12:2]) encodes the logical index into the
202
+ ILUT, selecting one of up to 2048 entries.
203
+
204
+ === Instruction Summary
205
+
206
+ [%header,cols="^1,^1,4,8"]
207
+ |===
208
+ |RV32
209
+ |RV64
210
+ |Mnemonic
211
+ |Instruction
212
+
213
+ |yes
214
+ |no
215
+ |qc.cm.ilut _index_
216
+ |<<#insns-qc_cm_ilut>>
217
+
218
+ |===
219
+ type: unprivileged
220
+ versions:
221
+ - version: "0.1.0"
222
+ state: development
223
+ contributors:
224
+ - name: Albert Yosher
225
+ company: Qualcomm Technologies, Inc.
226
+ email: ayosher@qti.qualcomm.com
227
+ - name: Derek Hower
228
+ company: Qualcomm Technologies, Inc.
229
+ email: dhower@qti.qualcomm.com
230
+ - name: Gil Zukerman
231
+ company: Qualcomm Technologies, Inc.
232
+ email: gzukerma@qti.qualcomm.com
233
+ changes:
234
+ - Initial version. Custom instruction lookup table extension with dual-instruction
235
+ packing and 64-bit double entries. Supports 16-bit, 32-bit, and 48-bit instructions
236
+ in the ILUT. Introduces qc.itba and qc.itdec CSRs.
237
+ requirements:
238
+ allOf:
239
+ - extension:
240
+ name: Zca
241
+ version: ">= 1.0.0"
242
+ - extension:
243
+ name: Zicsr
244
+ version: ">= 2.0.0"
245
+ - not:
246
+ extension:
247
+ name: Zcd
248
+ - version: "0.2.0"
249
+ state: development
250
+ contributors:
251
+ - name: Albert Yosher
252
+ company: Qualcomm Technologies, Inc.
253
+ email: ayosher@qti.qualcomm.com
254
+ - name: Derek Hower
255
+ company: Qualcomm Technologies, Inc.
256
+ email: dhower@qti.qualcomm.com
257
+ - name: Gil Zukerman
258
+ company: Qualcomm Technologies, Inc.
259
+ email: gzukerma@qti.qualcomm.com
260
+ changes:
261
+ - >-
262
+ Precise trap semantics: each sub-instruction in an ILUT entry can now trap
263
+ independently. Traps are taken immediately at the faulting sub-instruction
264
+ rather than being deferred.
265
+ - >-
266
+ Resume mechanism: bit 0 of mepc/mnepc encodes which sub-instruction caused
267
+ the trap. On trap return, qc.cm.ilut re-enters with PC bit 0 reflecting this
268
+ value; if set, the first sub-instruction is skipped and only the second is
269
+ re-executed.
270
+ - >-
271
+ mepc/mnepc bit 0 is readable and writable in this architecture.
272
+ Software may set bit 0 to 1 to force resumption from the second sub-instruction.
273
+ - >-
274
+ Expanded ILUT instruction restrictions to all PC-referencing instructions:
275
+ added register-indirect jumps (jalr, c.jr, c.jalr) and return instructions
276
+ (cm.popret, cm.popretz, qc.cm.popret, qc.cm.popretz) to the forbidden list.
277
+ - >-
278
+ Spec language audit: removed all implementation-implying language; descriptions
279
+ now define architectural behavior only.
280
+ requirements:
281
+ allOf:
282
+ - extension:
283
+ name: Zca
284
+ version: ">= 1.0.0"
285
+ - extension:
286
+ name: Zicsr
287
+ version: ">= 2.0.0"
288
+ - not:
289
+ extension:
290
+ name: Zcd
@@ -0,0 +1,127 @@
1
+ # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2
+ # SPDX-License-Identifier: BSD-3-Clause-Clear
3
+
4
+ # yaml-language-server: $schema=../../../../schemas/ext_schema.json
5
+
6
+ $schema: ext_schema.json#
7
+ kind: extension
8
+ name: Xqccmt
9
+ long_name: Qualcomm Custom Compressed Jump Table with Alternate Link Register
10
+ description: |
11
+ Xqccmt is a Qualcomm custom extension that provides compressed (16-bit) jump table
12
+ instructions for code-size reduction. It introduces two instructions, `qc.cm.jt` and
13
+ `qc.cm.jalt`, which perform indirect jumps through a jump vector table (JVT) whose
14
+ base address is held in the `jvt` CSR.
15
+
16
+ === Jump Vector Table
17
+
18
+ The jump vector table is an array of XLEN-wide entries stored in memory. Its base
19
+ address is configured by writing to the `jvt` CSR. The base address must be aligned
20
+ to a 64-byte boundary (the lower 6 bits of the base are always zero). The memory
21
+ region pointed to by `jvt.BASE` is treated as instruction memory for the purpose of
22
+ execute-permission checks.
23
+
24
+ Each instruction encodes an 8-bit `index` field. The index selects which entry in the
25
+ table to use:
26
+
27
+ * Indices 0–31 (bits [7:5] of index == 0b000): used by `qc.cm.jt` (jump only, no link)
28
+ * Indices 32–255 (bits [7:5] of index != 0b000): used by `qc.cm.jalt` (jump with link)
29
+
30
+ The entry address is computed as: `entry_addr = {jvt.BASE, 6'b000000} + index × (XLEN/8)`
31
+
32
+ === Alternate Link Register
33
+
34
+ In standard table-jump behavior, a call instruction always saves the return address in
35
+ `ra` (x1). Xqccmt extends this by repurposing bit 0 of each call table entry (index ≥ 32)
36
+ as metadata to select the return address register:
37
+
38
+ * Entry bit 0 = 0: save return address in `ra` (x1)
39
+ * Entry bit 0 = 1: save return address in `t0` (x5), the alternate link register
40
+
41
+ Because XLEN-wide addresses are naturally aligned, bit 0 of a valid target address is
42
+ always zero. Xqccmt repurposes this always-zero bit as a one-bit selector without
43
+ affecting the jump target. The actual jump target is always computed with bit 0 forced
44
+ to zero: `target = {entry[XLEN-1:1], 1'b0}`.
45
+
46
+ For `qc.cm.jt` (index < 32), bit 0 of the table entry is not used as metadata; the
47
+ jump target is computed identically: `target = {entry[XLEN-1:1], 1'b0}`, and no link
48
+ register is written.
49
+
50
+ === Encoding
51
+
52
+ Both instructions use the 16-bit compressed encoding space (quadrant 2, funct3=0b101),
53
+ the same space used by `cm.jt` and `cm.jalt` in the standard Zcmt extension. Because
54
+ of this encoding overlap, Xqccmt and Zcmt are mutually exclusive and cannot both be
55
+ present in the same configuration.
56
+
57
+ The 16-bit encoding is:
58
+
59
+ [%header,cols="^1,^1,^1,^1,^1"]
60
+ |===
61
+ |[15:13]
62
+ |[12:10]
63
+ |[9:5]
64
+ |[4:2]
65
+ |[1:0]
66
+
67
+ |101
68
+ |index[7:5]
69
+ |index[4:0]
70
+ |000
71
+ |10
72
+ |===
73
+
74
+ When index[7:5] == 0b000, the instruction is `qc.cm.jt` (indices 0–31).
75
+ When index[7:5] != 0b000, the instruction is `qc.cm.jalt` (indices 32–255).
76
+
77
+ === JVT CSR Access Control
78
+
79
+ The `jvt` CSR is accessible at address 0x017. If the Smstateen extension is
80
+ implemented, access to `jvt` from non-M modes is gated by the JVT bit in the
81
+ `mstateen0` / `sstateen0` / `hstateen0` CSRs. Attempting to execute `qc.cm.jt` or
82
+ `qc.cm.jalt` when `jvt` is inaccessible raises an Illegal Instruction exception.
83
+
84
+ === Instruction Summary
85
+
86
+ [%header,cols="^1,^1,4,8"]
87
+ |===
88
+ |RV32
89
+ |RV64
90
+ |Mnemonic
91
+ |Instruction
92
+
93
+ |yes
94
+ |yes
95
+ |qc.cm.jt _index_
96
+ |<<#insns-qc_cm_jt>>
97
+
98
+ |yes
99
+ |yes
100
+ |qc.cm.jalt _index_
101
+ |<<#insns-qc_cm_jalt>>
102
+
103
+ |===
104
+ type: unprivileged
105
+ versions:
106
+ - version: "0.1.0"
107
+ state: development
108
+ ratification_date: unknown
109
+ contributors:
110
+ - name: Albert Yosher
111
+ company: Qualcomm Technologies, Inc.
112
+ email: ayosher@qti.qualcomm.com
113
+ - name: Derek Hower
114
+ company: Qualcomm Technologies, Inc.
115
+ email: dhower@qti.qualcomm.com
116
+ changes:
117
+ - Initial version. Custom variant of Zcmt with alternate link register support.
118
+ Uses bit 0 of call table entries as metadata to select ra (x1) or t0 (x5)
119
+ as the return address register for qc.cm.jalt.
120
+ requirements:
121
+ allOf:
122
+ - extension:
123
+ name: Zca
124
+ version: ">= 1.0.0"
125
+ - extension:
126
+ name: Zicsr
127
+ version: ">= 2.0.0"
@@ -0,0 +1,136 @@
1
+ # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2
+ # SPDX-License-Identifier: BSD-3-Clause-Clear
3
+
4
+ # yaml-language-server: $schema=../../../../../schemas/inst_schema.json
5
+
6
+ $schema: "inst_schema.json#"
7
+ kind: instruction
8
+ name: qc.cm.ilut
9
+ long_name: Instruction Lookup Table Execute
10
+ description: |
11
+ Fetch and execute the instruction(s) packed in the ILUT entry at index `ilut_index`.
12
+
13
+ The ILUT base address is held in `qc.itba.base` (shifted left by 6 to form a
14
+ 64-byte-aligned byte address). The first `qc.itdec.dec` entries are 64-bit
15
+ double entries; all remaining entries are 32-bit single entries.
16
+
17
+ Entry address calculation:
18
+ - If `ilut_index` < `qc.itdec.dec`: `entry_addr = (qc.itba.BASE << 6) + ilut_index * 8`
19
+ - Otherwise: `entry_addr = (qc.itba.BASE << 6) + qc.itdec.DEC * 8 + (ilut_index - qc.itdec.DEC) * 4`
20
+
21
+ Each entry may contain one or two packed RISC-V instructions. The first
22
+ instruction begins at bit 0 of the entry. Its size is determined by the
23
+ standard RISC-V instruction-length encoding (16-bit, 32-bit, or 48-bit).
24
+ If bits remain after the first instruction and the next 16 bits are not
25
+ `c.nop` (16'h0001), a second instruction is present and is also executed.
26
+
27
+ Any instruction that references PC as an input or output is not permitted
28
+ inside ILUT entries. This includes: PC-relative instructions (`auipc`,
29
+ branches, `jal`, `c.j`, `c.jal`, `c.beqz`, `c.bnez`); register-indirect
30
+ jumps that write PC (`jalr`, `c.jr`, `c.jalr`); and return instructions
31
+ that write PC (`cm.popret`, `cm.popretz`, `qc.cm.popret`, `qc.cm.popretz`).
32
+ If any such instruction is present in the entry, an IllegalInstruction
33
+ exception is raised before any sub-instruction in the entry takes
34
+ architectural effect.
35
+
36
+ When a trap (exception, interrupt, NMI, or double-trap) occurs during
37
+ execution of a `qc.cm.ilut` entry, `mepc`/`mnepc` is set to the PC of
38
+ `qc.cm.ilut` with bit 0 encoding which sub-instruction caused the trap:
39
+ bit 0 = 0 means the trap came from the first (or only) instruction;
40
+ bit 0 = 1 means the trap came from the second instruction (the architectural
41
+ effects of the first sub-instruction are already visible). When `qc.cm.ilut` is re-entered with PC bit 0 = 1,
42
+ it skips the first instruction and executes only the second. This applies
43
+ uniformly to all trap types including exceptions, interrupts, NMIs, and
44
+ double-traps.
45
+
46
+ See the Xqccmi extension description for full details on entry layout,
47
+ dual-instruction packing, exception handling, and restrictions.
48
+ definedBy:
49
+ extension:
50
+ name: Xqccmi
51
+ assembly: ilut_index
52
+ encoding:
53
+ match: 001-----------00
54
+ variables:
55
+ - name: ilut_index
56
+ location: 12-2
57
+ access:
58
+ s: always
59
+ u: always
60
+ vs: always
61
+ vu: always
62
+ operation(): |
63
+ XReg real_pc = $pc & ~32'b1;
64
+ Boolean resuming_second = ($pc[0:0] == 1'b1);
65
+
66
+ XReg N = {21'b0, CSR[qc.itdec].dec};
67
+ XReg base_addr = CSR[qc.itba].base << 6;
68
+ XReg entry_addr;
69
+ Boolean is_double;
70
+
71
+ if (ilut_index < N) {
72
+ entry_addr = base_addr + (ilut_index * 8);
73
+ is_double = true;
74
+ } else {
75
+ entry_addr = base_addr + (N * 8) + ((ilut_index - N) * 4);
76
+ is_double = false;
77
+ }
78
+
79
+ TranslationResult result;
80
+ if (CSR[misa].S == 1) {
81
+ result = translate(entry_addr, MemoryOperation::Fetch, mode(), $encoding);
82
+ } else {
83
+ result.paddr = entry_addr;
84
+ }
85
+ access_check(result.paddr, is_double ? 8 : 4, $pc, MemoryOperation::Fetch, ExceptionCode::InstructionAccessFault, mode());
86
+
87
+ XReg entry_lo = read_physical_memory(32, result.paddr);
88
+ XReg entry_hi = is_double ? read_physical_memory(32, result.paddr + 4) : 32'b0;
89
+
90
+ Boolean has_second_inst = false; # true if entry contains a second packed instruction
91
+ if (entry_lo[1:0] != 2'b11) {
92
+ if (entry_lo[31:16] != 16'h0001) { has_second_inst = true; }
93
+ } else if (entry_lo[4:2] != 3'b111) {
94
+ if (is_double && entry_hi[15:0] != 16'h0001) { has_second_inst = true; }
95
+ } else {
96
+ if (!is_double) { raise_ilut(ExceptionCode::IllegalInstruction, $encoding); }
97
+ }
98
+
99
+ if (is_pc_referencing_inst?(entry_lo)) {
100
+ executing_second_inst = false;
101
+ raise_ilut(ExceptionCode::IllegalInstruction, $encoding);
102
+ }
103
+ if (has_second_inst) {
104
+ Bits<32> second_inst = (entry_lo[1:0] != 2'b11) ? {16'b0, entry_lo[31:16]} : {16'b0, entry_hi[15:0]};
105
+ if (is_pc_referencing_inst?(second_inst)) {
106
+ executing_second_inst = true;
107
+ raise_ilut(ExceptionCode::IllegalInstruction, $encoding);
108
+ }
109
+ }
110
+
111
+ # Execute first instruction (skip if resuming after second-slot trap)
112
+ if (!resuming_second) {
113
+ if (implemented?(ExtensionName::Smrnmi) && CSR[mnstatus].NMIE == 1'b0) {
114
+ CSR[mnepc].PC = real_pc;
115
+ } else {
116
+ CSR[mepc].PC = real_pc;
117
+ }
118
+ execute_instruction(entry_lo);
119
+ }
120
+
121
+ # Execute second instruction if present
122
+ if (has_second_inst) {
123
+ Bits<32> second_inst = (entry_lo[1:0] != 2'b11) ? {16'b0, entry_lo[31:16]} : {16'b0, entry_hi[15:0]};
124
+ if (implemented?(ExtensionName::Smrnmi) && CSR[mnstatus].NMIE == 1'b0) {
125
+ CSR[mnepc].PC = real_pc | 32'b1;
126
+ } else {
127
+ CSR[mepc].PC = real_pc | 32'b1;
128
+ }
129
+ execute_instruction(second_inst);
130
+ # Restore mepc/mnepc bit 0 to 0 after successful completion
131
+ if (implemented?(ExtensionName::Smrnmi) && CSR[mnstatus].NMIE == 1'b0) {
132
+ CSR[mnepc].PC = real_pc;
133
+ } else {
134
+ CSR[mepc].PC = real_pc;
135
+ }
136
+ }
@@ -0,0 +1,84 @@
1
+ # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2
+ # SPDX-License-Identifier: BSD-3-Clause-Clear
3
+
4
+ # yaml-language-server: $schema=../../../../../schemas/inst_schema.json
5
+
6
+ $schema: "inst_schema.json#"
7
+ kind: instruction
8
+ name: qc.cm.jalt
9
+ long_name: Jump Via Table with Link to ra or t0
10
+ description: |
11
+ Read an address from the Jump Vector Table and jump to it, linking to either
12
+ `ra` (x1) or `t0` (x5) depending on bit 0 of the table entry.
13
+
14
+ Bit 0 of the jump table entry is used as metadata:
15
+
16
+ * Bit 0 = 0: save return address in `ra` (x1)
17
+ * Bit 0 = 1: save return address in `t0` (x5)
18
+
19
+ The actual jump target always has bit 0 cleared:
20
+ `target = {entry[XLEN-1:1], 1'b0}`
21
+
22
+ Instruction encoded in the same encoding space as cm.jalt (Zcmt).
23
+ Xqccmt and Zcmt are mutually exclusive extensions.
24
+ definedBy:
25
+ extension:
26
+ name: Xqccmt
27
+ assembly: index_7_5, index_4_0
28
+ encoding:
29
+ match: 101000--------10
30
+ variables:
31
+ - name: index_7_5
32
+ location: 9-7
33
+ not: 0
34
+ - name: index_4_0
35
+ location: 6-2
36
+ access:
37
+ s: always
38
+ u: always
39
+ vs: always
40
+ vu: always
41
+ operation(): |
42
+ # Ensure JVT readable
43
+ check_zcmt_enabled($encoding);
44
+
45
+ if (CSR[jvt].MODE != 0) {
46
+ raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
47
+ }
48
+
49
+ # Skip over _this_ 16-bit instruction
50
+ XReg return_addr = $pc + 2;
51
+
52
+ XReg jump_table_base = { CSR[jvt].BASE, 6'b000000 };
53
+ XReg index = { index_7_5, index_4_0 };
54
+ XReg virtual_address = jump_table_base + index `* (xlen() / 8);
55
+ XReg entry;
56
+ TranslationResult result;
57
+
58
+ # TODO: Correct this check when we figure out what MISA can do
59
+ if (CSR[misa].S == 1) {
60
+ result = translate(virtual_address, MemoryOperation::Fetch, mode(), $encoding);
61
+ } else {
62
+ result.paddr = virtual_address;
63
+ }
64
+
65
+ # may raise an exception
66
+ access_check(result.paddr, xlen(), $pc, MemoryOperation::Fetch, ExceptionCode::InstructionAccessFault, mode());
67
+
68
+ if (xlen() == 32) {
69
+ entry = read_physical_memory(32, result.paddr);
70
+ } else {
71
+ entry = read_physical_memory(64, result.paddr);
72
+ }
73
+
74
+ # Bit 0 of entry is metadata: 0 = link to ra (x1), 1 = link to t0 (x5)
75
+ if (entry[0] == 1'b1) {
76
+ X[5] = return_addr; # t0
77
+ } else {
78
+ X[1] = return_addr; # ra
79
+ }
80
+
81
+ # Jump target always has bit 0 cleared
82
+ XReg addr = entry & $signed(2'b10);
83
+
84
+ jump(addr);
@@ -0,0 +1,60 @@
1
+ # Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
2
+ # SPDX-License-Identifier: BSD-3-Clause-Clear
3
+
4
+ # yaml-language-server: $schema=../../../../../schemas/inst_schema.json
5
+
6
+ $schema: "inst_schema.json#"
7
+ kind: instruction
8
+ name: qc.cm.jt
9
+ long_name: Jump Via Table
10
+ description: |
11
+ Read an address from the Jump Vector Table and jump to it.
12
+ Instruction encoded in the same encoding space as cm.jt (Zcmt).
13
+ Xqccmt and Zcmt are mutually exclusive extensions.
14
+ definedBy:
15
+ extension:
16
+ name: Xqccmt
17
+ assembly: index
18
+ encoding:
19
+ match: 101000000-----10
20
+ variables:
21
+ - name: index
22
+ location: 6-2
23
+ access:
24
+ s: always
25
+ u: always
26
+ vs: always
27
+ vu: always
28
+ operation(): |
29
+ # Ensure JVT readable
30
+ check_zcmt_enabled($encoding);
31
+
32
+ if (CSR[jvt].MODE != 0) {
33
+ raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
34
+ }
35
+
36
+ XReg jump_table_base = { CSR[jvt].BASE, 6'b000000 };
37
+ XReg virtual_address = jump_table_base + index `* (xlen() / 8);
38
+ XReg addr;
39
+ TranslationResult result;
40
+
41
+ # TODO: Correct this check when we figure out what MISA can do
42
+ if (CSR[misa].S == 1) {
43
+ result = translate(virtual_address, MemoryOperation::Fetch, mode(), $encoding);
44
+ } else {
45
+ result.paddr = virtual_address;
46
+ }
47
+
48
+ # may raise an exception
49
+ access_check(result.paddr, xlen(), $pc, MemoryOperation::Fetch, ExceptionCode::InstructionAccessFault, mode());
50
+
51
+ if (xlen() == 32) {
52
+ addr = read_physical_memory(32, result.paddr);
53
+ } else {
54
+ addr = read_physical_memory(64, result.paddr);
55
+ }
56
+
57
+ # Ensure low-order bit is clear
58
+ addr = addr & $signed(2'b10);
59
+
60
+ jump(addr);