udb 0.1.13 → 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 (189) hide show
  1. checksums.yaml +4 -4
  2. data/.data/cfgs/example_rv64_with_overlay.yaml +15 -18
  3. data/.data/cfgs/qc_iu.yaml +5 -1
  4. data/.data/cfgs/rv32-riscv-tests.yaml +4 -1
  5. data/.data/cfgs/rv32-vector.yaml +4 -1
  6. data/.data/cfgs/rv64-riscv-tests.yaml +4 -1
  7. data/.data/cfgs/rv64-vector.yaml +4 -1
  8. data/.data/spec/custom/isa/qc_iu/ext/Xqccmi.yaml +107 -36
  9. data/.data/spec/custom/isa/qc_iu/inst/Xqccmi/qc.cm.ilut.yaml +52 -69
  10. data/.data/spec/custom/isa/qc_iu/isa/globals.isa +27 -5
  11. data/.data/spec/schemas/config_schema.json +1 -1
  12. data/.data/spec/schemas/mmr_schema.json +3 -3
  13. data/.data/spec/schemas/schema_defs.json +5 -0
  14. data/.data/spec/std/isa/csr/H/henvcfg.yaml +25 -0
  15. data/.data/spec/std/isa/csr/I/pmpaddr0.yaml +6 -4
  16. data/.data/spec/std/isa/csr/I/pmpaddr1.yaml +6 -4
  17. data/.data/spec/std/isa/csr/I/pmpaddr10.yaml +6 -4
  18. data/.data/spec/std/isa/csr/I/pmpaddr11.yaml +6 -4
  19. data/.data/spec/std/isa/csr/I/pmpaddr12.yaml +6 -4
  20. data/.data/spec/std/isa/csr/I/pmpaddr13.yaml +6 -4
  21. data/.data/spec/std/isa/csr/I/pmpaddr14.yaml +6 -4
  22. data/.data/spec/std/isa/csr/I/pmpaddr15.yaml +6 -4
  23. data/.data/spec/std/isa/csr/I/pmpaddr16.yaml +6 -4
  24. data/.data/spec/std/isa/csr/I/pmpaddr17.yaml +6 -4
  25. data/.data/spec/std/isa/csr/I/pmpaddr18.yaml +6 -4
  26. data/.data/spec/std/isa/csr/I/pmpaddr19.yaml +6 -4
  27. data/.data/spec/std/isa/csr/I/pmpaddr2.yaml +6 -4
  28. data/.data/spec/std/isa/csr/I/pmpaddr20.yaml +6 -4
  29. data/.data/spec/std/isa/csr/I/pmpaddr21.yaml +6 -4
  30. data/.data/spec/std/isa/csr/I/pmpaddr22.yaml +6 -4
  31. data/.data/spec/std/isa/csr/I/pmpaddr23.yaml +6 -4
  32. data/.data/spec/std/isa/csr/I/pmpaddr24.yaml +6 -4
  33. data/.data/spec/std/isa/csr/I/pmpaddr25.yaml +6 -4
  34. data/.data/spec/std/isa/csr/I/pmpaddr26.yaml +6 -4
  35. data/.data/spec/std/isa/csr/I/pmpaddr27.yaml +6 -4
  36. data/.data/spec/std/isa/csr/I/pmpaddr28.yaml +6 -4
  37. data/.data/spec/std/isa/csr/I/pmpaddr29.yaml +6 -4
  38. data/.data/spec/std/isa/csr/I/pmpaddr3.yaml +6 -4
  39. data/.data/spec/std/isa/csr/I/pmpaddr30.yaml +6 -4
  40. data/.data/spec/std/isa/csr/I/pmpaddr31.yaml +6 -4
  41. data/.data/spec/std/isa/csr/I/pmpaddr32.yaml +6 -4
  42. data/.data/spec/std/isa/csr/I/pmpaddr33.yaml +6 -4
  43. data/.data/spec/std/isa/csr/I/pmpaddr34.yaml +6 -4
  44. data/.data/spec/std/isa/csr/I/pmpaddr35.yaml +6 -4
  45. data/.data/spec/std/isa/csr/I/pmpaddr36.yaml +6 -4
  46. data/.data/spec/std/isa/csr/I/pmpaddr37.yaml +6 -4
  47. data/.data/spec/std/isa/csr/I/pmpaddr38.yaml +6 -4
  48. data/.data/spec/std/isa/csr/I/pmpaddr39.yaml +6 -4
  49. data/.data/spec/std/isa/csr/I/pmpaddr4.yaml +6 -4
  50. data/.data/spec/std/isa/csr/I/pmpaddr40.yaml +6 -4
  51. data/.data/spec/std/isa/csr/I/pmpaddr41.yaml +6 -4
  52. data/.data/spec/std/isa/csr/I/pmpaddr42.yaml +6 -4
  53. data/.data/spec/std/isa/csr/I/pmpaddr43.yaml +6 -4
  54. data/.data/spec/std/isa/csr/I/pmpaddr44.yaml +6 -4
  55. data/.data/spec/std/isa/csr/I/pmpaddr45.yaml +6 -4
  56. data/.data/spec/std/isa/csr/I/pmpaddr46.yaml +6 -4
  57. data/.data/spec/std/isa/csr/I/pmpaddr47.yaml +6 -4
  58. data/.data/spec/std/isa/csr/I/pmpaddr48.yaml +6 -4
  59. data/.data/spec/std/isa/csr/I/pmpaddr49.yaml +6 -4
  60. data/.data/spec/std/isa/csr/I/pmpaddr5.yaml +6 -4
  61. data/.data/spec/std/isa/csr/I/pmpaddr50.yaml +6 -4
  62. data/.data/spec/std/isa/csr/I/pmpaddr51.yaml +6 -4
  63. data/.data/spec/std/isa/csr/I/pmpaddr52.yaml +6 -4
  64. data/.data/spec/std/isa/csr/I/pmpaddr53.yaml +6 -4
  65. data/.data/spec/std/isa/csr/I/pmpaddr54.yaml +6 -4
  66. data/.data/spec/std/isa/csr/I/pmpaddr55.yaml +6 -4
  67. data/.data/spec/std/isa/csr/I/pmpaddr56.yaml +6 -4
  68. data/.data/spec/std/isa/csr/I/pmpaddr57.yaml +6 -4
  69. data/.data/spec/std/isa/csr/I/pmpaddr58.yaml +6 -4
  70. data/.data/spec/std/isa/csr/I/pmpaddr59.yaml +6 -4
  71. data/.data/spec/std/isa/csr/I/pmpaddr6.yaml +6 -4
  72. data/.data/spec/std/isa/csr/I/pmpaddr60.yaml +6 -4
  73. data/.data/spec/std/isa/csr/I/pmpaddr61.yaml +6 -4
  74. data/.data/spec/std/isa/csr/I/pmpaddr62.yaml +6 -4
  75. data/.data/spec/std/isa/csr/I/pmpaddr63.yaml +6 -4
  76. data/.data/spec/std/isa/csr/I/pmpaddr7.yaml +6 -4
  77. data/.data/spec/std/isa/csr/I/pmpaddr8.yaml +6 -4
  78. data/.data/spec/std/isa/csr/I/pmpaddr9.yaml +6 -4
  79. data/.data/spec/std/isa/csr/I/pmpaddrN.layout +6 -4
  80. data/.data/spec/std/isa/csr/I/pmpcfg0.yaml +120 -144
  81. data/.data/spec/std/isa/csr/I/pmpcfg1.yaml +60 -72
  82. data/.data/spec/std/isa/csr/I/pmpcfg10.yaml +120 -144
  83. data/.data/spec/std/isa/csr/I/pmpcfg11.yaml +60 -72
  84. data/.data/spec/std/isa/csr/I/pmpcfg12.yaml +120 -144
  85. data/.data/spec/std/isa/csr/I/pmpcfg13.yaml +60 -72
  86. data/.data/spec/std/isa/csr/I/pmpcfg14.yaml +120 -144
  87. data/.data/spec/std/isa/csr/I/pmpcfg15.yaml +60 -72
  88. data/.data/spec/std/isa/csr/I/pmpcfg2.yaml +120 -144
  89. data/.data/spec/std/isa/csr/I/pmpcfg3.yaml +60 -72
  90. data/.data/spec/std/isa/csr/I/pmpcfg4.yaml +120 -144
  91. data/.data/spec/std/isa/csr/I/pmpcfg5.yaml +60 -72
  92. data/.data/spec/std/isa/csr/I/pmpcfg6.yaml +120 -144
  93. data/.data/spec/std/isa/csr/I/pmpcfg7.yaml +60 -72
  94. data/.data/spec/std/isa/csr/I/pmpcfg8.yaml +120 -144
  95. data/.data/spec/std/isa/csr/I/pmpcfg9.yaml +60 -72
  96. data/.data/spec/std/isa/csr/I/pmpcfgN.layout +15 -18
  97. data/.data/spec/std/isa/csr/jvt.yaml +1 -0
  98. data/.data/spec/std/isa/csr/menvcfg.yaml +20 -0
  99. data/.data/spec/std/isa/csr/mstatus.yaml +8 -6
  100. data/.data/spec/std/isa/csr/senvcfg.yaml +26 -0
  101. data/.data/spec/std/isa/inst/B/andn.yaml +10 -12
  102. data/.data/spec/std/isa/inst/B/clmul.yaml +9 -11
  103. data/.data/spec/std/isa/inst/B/clmulh.yaml +9 -11
  104. data/.data/spec/std/isa/inst/B/orn.yaml +9 -11
  105. data/.data/spec/std/isa/inst/B/rev8.yaml +1 -1
  106. data/.data/spec/std/isa/inst/B/rol.yaml +9 -11
  107. data/.data/spec/std/isa/inst/B/rolw.yaml +9 -11
  108. data/.data/spec/std/isa/inst/B/ror.yaml +9 -11
  109. data/.data/spec/std/isa/inst/B/rorw.yaml +9 -11
  110. data/.data/spec/std/isa/inst/B/xnor.yaml +9 -11
  111. data/.data/spec/std/isa/inst/C/c.ldsp.yaml +3 -3
  112. data/.data/spec/std/isa/inst/I/addi.yaml +1 -0
  113. data/.data/spec/std/isa/inst/I/addiw.yaml +1 -0
  114. data/.data/spec/std/isa/inst/I/andi.yaml +1 -0
  115. data/.data/spec/std/isa/inst/I/auipc.yaml +1 -0
  116. data/.data/spec/std/isa/inst/I/lb.yaml +1 -0
  117. data/.data/spec/std/isa/inst/I/lbu.yaml +1 -0
  118. data/.data/spec/std/isa/inst/I/ld.yaml +2 -0
  119. data/.data/spec/std/isa/inst/I/lh.yaml +1 -0
  120. data/.data/spec/std/isa/inst/I/lhu.yaml +1 -0
  121. data/.data/spec/std/isa/inst/I/lui.yaml +1 -0
  122. data/.data/spec/std/isa/inst/I/lw.yaml +1 -0
  123. data/.data/spec/std/isa/inst/I/lwu.yaml +1 -0
  124. data/.data/spec/std/isa/inst/I/ori.yaml +1 -0
  125. data/.data/spec/std/isa/inst/I/sb.yaml +1 -0
  126. data/.data/spec/std/isa/inst/I/sd.yaml +1 -0
  127. data/.data/spec/std/isa/inst/I/sh.yaml +1 -0
  128. data/.data/spec/std/isa/inst/I/slti.yaml +1 -0
  129. data/.data/spec/std/isa/inst/I/sltiu.yaml +1 -0
  130. data/.data/spec/std/isa/inst/I/sw.yaml +1 -0
  131. data/.data/spec/std/isa/inst/I/xori.yaml +1 -0
  132. data/.data/spec/std/isa/inst/V/vadc.vim.yaml +1 -0
  133. data/.data/spec/std/isa/inst/V/vadd.vi.yaml +1 -0
  134. data/.data/spec/std/isa/inst/V/vand.vi.yaml +1 -0
  135. data/.data/spec/std/isa/inst/V/vle8.v.yaml +1 -0
  136. data/.data/spec/std/isa/inst/V/vmadc.vi.yaml +1 -0
  137. data/.data/spec/std/isa/inst/V/vmadc.vim.yaml +1 -0
  138. data/.data/spec/std/isa/inst/V/vmerge.vim.yaml +1 -0
  139. data/.data/spec/std/isa/inst/V/vmseq.vi.yaml +1 -0
  140. data/.data/spec/std/isa/inst/V/vmsgt.vi.yaml +1 -0
  141. data/.data/spec/std/isa/inst/V/vmsgtu.vi.yaml +1 -0
  142. data/.data/spec/std/isa/inst/V/vmsle.vi.yaml +1 -0
  143. data/.data/spec/std/isa/inst/V/vmsleu.vi.yaml +1 -0
  144. data/.data/spec/std/isa/inst/V/vmsne.vi.yaml +1 -0
  145. data/.data/spec/std/isa/inst/V/vor.vi.yaml +1 -0
  146. data/.data/spec/std/isa/inst/V/vrsub.vi.yaml +1 -0
  147. data/.data/spec/std/isa/inst/V/vsadd.vi.yaml +1 -0
  148. data/.data/spec/std/isa/inst/V/vsaddu.vi.yaml +1 -0
  149. data/.data/spec/std/isa/inst/V/vse8.v.yaml +1 -0
  150. data/.data/spec/std/isa/inst/Zawrs/wrs.nto.yaml +4 -2
  151. data/.data/spec/std/isa/inst/Zba/add.uw.yaml +9 -11
  152. data/.data/spec/std/isa/inst/Zbb/orc.b.yaml +1 -1
  153. data/.data/spec/std/isa/inst/Zbkb/brev8.yaml +3 -3
  154. data/.data/spec/std/isa/inst/Zbkb/unzip.yaml +2 -2
  155. data/.data/spec/std/isa/inst/Zbkb/zip.yaml +2 -2
  156. data/.data/spec/std/isa/inst/Zbkx/xperm4.yaml +2 -2
  157. data/.data/spec/std/isa/inst/Zbkx/xperm8.yaml +2 -2
  158. data/.data/spec/std/isa/inst/Zicbop/prefetch.i.yaml +2 -0
  159. data/.data/spec/std/isa/inst/Zicbop/prefetch.r.yaml +2 -0
  160. data/.data/spec/std/isa/inst/Zicbop/prefetch.w.yaml +2 -0
  161. data/.data/spec/std/isa/inst/Zks/sm3p0.yaml +1 -1
  162. data/.data/spec/std/isa/inst/Zks/sm3p1.yaml +1 -1
  163. data/.data/spec/std/isa/inst/Zks/sm4ed.yaml +1 -1
  164. data/.data/spec/std/isa/inst/Zks/sm4ks.yaml +1 -1
  165. data/.data/spec/std/isa/isa/builtin_functions.idl +1 -0
  166. data/.data/spec/std/isa/isa/globals.isa +27 -7
  167. data/.data/spec/std/isa/isa/interrupts.idl +1 -0
  168. data/.data/spec/std/isa/param/HSTATEEN_CONTEXT_TYPE.yaml +1 -0
  169. data/.data/spec/std/isa/param/MSTATEEN_CONTEXT_TYPE.yaml +1 -0
  170. data/.data/spec/std/isa/param/MTVEC_BASE_ALIGNMENT_DIRECT.yaml +1 -0
  171. data/.data/spec/std/isa/param/MTVEC_BASE_ALIGNMENT_VECTORED.yaml +1 -0
  172. data/.data/spec/std/isa/param/NUM_PMP_ENTRIES.yaml +11 -22
  173. data/.data/spec/std/isa/param/NUM_USABLE_PMP_ENTRIES.yaml +35 -0
  174. data/.data/spec/std/isa/param/PMP_NA4_SUPPORTED.yaml +23 -0
  175. data/.data/spec/std/isa/param/PMP_NAPOT_SUPPORTED.yaml +19 -0
  176. data/.data/spec/std/isa/param/{MSTATUS_TVM_IMPLEMENTED.yaml → PMP_TOR_SUPPORTED.yaml} +6 -6
  177. data/.data/spec/std/isa/param/PRECISE_SYNCHRONOUS_EXCEPTIONS.yaml +1 -0
  178. data/.data/spec/std/isa/param/TRAP_ON_EBREAK.yaml +1 -0
  179. data/.data/spec/std/isa/param/TRAP_ON_ECALL_FROM_M.yaml +1 -0
  180. data/.data/spec/std/isa/param/TRAP_ON_SFENCE_VMA_WHEN_SATP_MODE_IS_READ_ONLY.yaml +1 -0
  181. data/.data/spec/std/isa/param/ZAWRS_NTO_IS_NOP.yaml +19 -0
  182. data/lib/udb/ESPRESSO_VERSION +1 -1
  183. data/lib/udb/config.rb +14 -2
  184. data/lib/udb/doc_link.rb +3 -4
  185. data/lib/udb/obj/instruction.rb +1 -1
  186. data/lib/udb/obj/non_isa_specification.rb +22 -100
  187. data/lib/udb/version.rb +1 -1
  188. data/lib/udb/z3.rb +2 -2
  189. metadata +7 -3
@@ -307,6 +307,7 @@ function compatible_mode? {
307
307
  (actual_mode == PrivilegeMode::VS) ||
308
308
  (actual_mode == PrivilegeMode::VU);
309
309
  }
310
+ return false;
310
311
  }
311
312
  }
312
313
 
@@ -1180,6 +1181,7 @@ function mpv {
1180
1181
  return (MXLEN == 32) ? CSR[mstatush].MPV : CSR[mstatus].MPV;
1181
1182
  } else {
1182
1183
  assert(false, "TODO");
1184
+ unreachable();
1183
1185
  }
1184
1186
  }
1185
1187
  }
@@ -1605,6 +1607,7 @@ function tinst_value_for_guest_page_fault {
1605
1607
  return tinst_transform(encoding, 0); # all guest page faults are aligned
1606
1608
  } else {
1607
1609
  unpredictable("Custom value written into htinst/mtinst");
1610
+ return 0;
1608
1611
  }
1609
1612
  } else if (op == MemoryOperation::Write || op == MemoryOperation::ReadModifyWrite) {
1610
1613
  if (TINST_VALUE_ON_FINAL_STORE_AMO_GUEST_PAGE_FAULT == "always zero") {
@@ -1619,6 +1622,7 @@ function tinst_value_for_guest_page_fault {
1619
1622
  return tinst_transform(encoding, 0); # all guest page faults are aligned
1620
1623
  } else {
1621
1624
  unpredictable("Custom value written into htinst/mtinst");
1625
+ return 0;
1622
1626
  }
1623
1627
  }
1624
1628
  } else {
@@ -1631,6 +1635,7 @@ function tinst_value_for_guest_page_fault {
1631
1635
  }
1632
1636
  }
1633
1637
  }
1638
+ return 0;
1634
1639
  }
1635
1640
  }
1636
1641
 
@@ -1658,9 +1663,11 @@ function tinst_transform {
1658
1663
  return {encoding[31:20], addr_offset, encoding[14:0]};
1659
1664
  } else {
1660
1665
  assert(false, "Bad transform");
1666
+ unreachable();
1661
1667
  }
1662
1668
  } else {
1663
1669
  assert(false, "TODO: compressed instruction");
1670
+ unreachable();
1664
1671
  }
1665
1672
  }
1666
1673
  }
@@ -1675,7 +1682,7 @@ function transformed_standard_instruction_for_tinst {
1675
1682
  }
1676
1683
  body {
1677
1684
  assert(false, "TODO");
1678
- return 0;
1685
+ unreachable();
1679
1686
  }
1680
1687
  }
1681
1688
 
@@ -1789,6 +1796,7 @@ function tinst_value {
1789
1796
  }
1790
1797
  } else {
1791
1798
  assert(false, "Unhandled exception type");
1799
+ unreachable();
1792
1800
  }
1793
1801
  }
1794
1802
  }
@@ -1974,6 +1982,7 @@ function gstage_page_walk {
1974
1982
  success = atomic_check_then_write_64(pte_paddr, pte, updated_pte);
1975
1983
  } else {
1976
1984
  assert(false, "Unexpected PTESIZE");
1985
+ unreachable();
1977
1986
  }
1978
1987
 
1979
1988
 
@@ -2024,6 +2033,7 @@ function gstage_page_walk {
2024
2033
  ppn = pte[PA_SIZE-3:10] << 12;
2025
2034
  }
2026
2035
  }
2036
+ unreachable();
2027
2037
  }
2028
2038
  }
2029
2039
 
@@ -2298,6 +2308,7 @@ function stage1_page_walk {
2298
2308
  success = atomic_check_then_write_64(pte_phys.paddr, pte, updated_pte);
2299
2309
  } else {
2300
2310
  assert(false, "Unexpected PTESIZE");
2311
+ unreachable();
2301
2312
  }
2302
2313
 
2303
2314
 
@@ -2370,6 +2381,7 @@ function stage1_page_walk {
2370
2381
  ppn = pte[PA_SIZE-3:10];
2371
2382
  }
2372
2383
  }
2384
+ unreachable();
2373
2385
  }
2374
2386
  }
2375
2387
 
@@ -2451,6 +2463,7 @@ function translate {
2451
2463
  result = stage1_page_walk(57, 56, 64, 5, vaddr, op, effective_mode, encoding);
2452
2464
  } else {
2453
2465
  assert(false, "Unexpected SatpMode");
2466
+ unreachable();
2454
2467
  }
2455
2468
 
2456
2469
  maybe_cache_translation(vaddr, op, result);
@@ -2496,6 +2509,7 @@ function canonical_vaddr? {
2496
2509
  } else if ((MXLEN == 64) && satp_mode == SatpMode::Sv57) {
2497
2510
  return eaddr[63:57] == {6{eaddr[56]}};
2498
2511
  }
2512
+ return false;
2499
2513
  }
2500
2514
  }
2501
2515
 
@@ -2522,6 +2536,7 @@ function canonical_gpaddr? {
2522
2536
  } else if ((MXLEN > 32) && (satp_mode == SatpMode::Sv57)) {
2523
2537
  return gpaddr[63:57] == {6{gpaddr[56]}};
2524
2538
  }
2539
+ return false;
2525
2540
  }
2526
2541
  }
2527
2542
 
@@ -2658,8 +2673,10 @@ function read_memory {
2658
2673
  return result;
2659
2674
  } else if (MISALIGNED_SPLIT_STRATEGY == "custom") {
2660
2675
  unpredictable("An implementation is free to break a misaligned access any way, leading to unpredictable behavior when any part of the misaligned access causes an exception");
2676
+ return 0;
2661
2677
  }
2662
2678
  }
2679
+ return 0;
2663
2680
  }
2664
2681
  }
2665
2682
 
@@ -2776,6 +2793,7 @@ function register_reservation_set {
2776
2793
  unpredictable("Implementations may set reservation sets of any size, as long as they cover the reserved accessed");
2777
2794
  } else {
2778
2795
  assert(false, "Unexpected LRSC_RESERVATION_STRATEGY");
2796
+ unreachable();
2779
2797
  }
2780
2798
  }
2781
2799
  }
@@ -2932,12 +2950,14 @@ function amo {
2932
2950
  # PMA Atomicity checks
2933
2951
  if (pma_applies?(PmaAttribute::AmoNone, physical_address, N)) {
2934
2952
  raise(ExceptionCode::StoreAmoAccessFault, mode(), virtual_address);
2935
- } else if (((op == AmoOperation::Add || op == AmoOperation::Max || op == AmoOperation::Maxu || op == AmoOperation::Min || op == AmoOperation::Minu)) &&
2936
- !pma_applies?(PmaAttribute::AmoArithmetic, physical_address, N)) {
2937
- raise(ExceptionCode::StoreAmoAccessFault, mode(), virtual_address);
2938
- } else if (((op == AmoOperation::And || op == AmoOperation::Or || op == AmoOperation::Xor)) &&
2939
- !pma_applies?(PmaAttribute::AmoLogical, physical_address, N)) {
2940
- raise(ExceptionCode::StoreAmoAccessFault, mode(), virtual_address);
2953
+ } else if (((op == AmoOperation::Add || op == AmoOperation::Max || op == AmoOperation::Maxu || op == AmoOperation::Min || op == AmoOperation::Minu))) {
2954
+ if (!pma_applies?(PmaAttribute::AmoArithmetic, physical_address, N)) {
2955
+ raise(ExceptionCode::StoreAmoAccessFault, mode(), virtual_address);
2956
+ }
2957
+ } else if (((op == AmoOperation::And || op == AmoOperation::Or || op == AmoOperation::Xor))) {
2958
+ if (!pma_applies?(PmaAttribute::AmoLogical, physical_address, N)) {
2959
+ raise(ExceptionCode::StoreAmoAccessFault, mode(), virtual_address);
2960
+ }
2941
2961
  } else {
2942
2962
  assert(
2943
2963
  pma_applies?(PmaAttribute::AmoSwap, physical_address, N) &&
@@ -259,6 +259,7 @@ function highest_priority_interrupt {
259
259
  }
260
260
  }
261
261
  assert(false, "There is no valid interrupt");
262
+ unreachable();
262
263
  }
263
264
  }
264
265
 
@@ -19,6 +19,7 @@ schema:
19
19
  - rw
20
20
  - read-only-0
21
21
  - read-only-1
22
+ default: rw
22
23
  requirements:
23
24
  idl(): |
24
25
  MSTATEEN_CONTEXT_TYPE == "read-only-0" -> HSTATEEN_CONTEXT_TYPE == "read-only-0";
@@ -19,6 +19,7 @@ schema:
19
19
  - rw
20
20
  - read-only-0
21
21
  - read-only-1
22
+ default: rw
22
23
  definedBy:
23
24
  extension:
24
25
  allOf:
@@ -25,6 +25,7 @@ description: |
25
25
  the base, the minimum alignment cannot be less than 4.
26
26
  schema:
27
27
  description: An unsigned power of 2 greater than or equal to 4 that fits in 64 bits
28
+ default: 4
28
29
  enum:
29
30
  [
30
31
  4,
@@ -25,6 +25,7 @@ description: |
25
25
  the base, the minimum alignment cannot be less than 4.
26
26
  schema:
27
27
  description: An unsigned power of 2 greater than or equal to 4 that fits in 64 bits
28
+ default: 4
28
29
  enum:
29
30
  [
30
31
  4,
@@ -7,36 +7,25 @@ $schema: param_schema.json#
7
7
  kind: parameter
8
8
  name: NUM_PMP_ENTRIES
9
9
  description: |
10
- Number of implemented PMP entries. Can be any value between 0-64, inclusive.
10
+ Number of implemented PMP entries.
11
11
 
12
12
  The architecture mandates that the number of implemented PMP registers
13
- must appear to be 0, 16, or 64.
14
-
15
- Therefore, pmp registers will behave as follows according to NUN_PMP_ENTRIES:
16
-
17
- [separator="!"]
18
- !===
19
- ! NUM_PMP_ENTRIES ! pmpaddr<0-15> / pmpcfg<0-3> ! pmpaddr<16-63> / pmpcfg<4-15>
20
- ! 0 ! N ! N
21
- ! 1-16 ! Y ! N
22
- ! 17-64 ! Y ! Y
23
- !===
24
-
25
- ** N = Not implemented; access will cause `IllegalInstruction`
26
- if TRAP_ON_UNIMPLEMENTED_CSR is true
27
- ** Y = Implemented; access will not cause an exception (from M-mode), but register
28
- may be read-only-zero if NUM_PMP_ENTRIES is less than the corresponding register
13
+ must appear to be 0, 16, or 64, so NUM_PMP_ENTRIES must be one of those values.
14
+ It directly determines which PMP registers exist: `pmpaddr0`-`pmpaddr<N-1>`
15
+ and their corresponding `pmpNcfg` fields are implemented, and the rest are
16
+ not. Accessing an unimplemented PMP register causes an `IllegalInstruction`
17
+ when TRAP_ON_UNIMPLEMENTED_CSR is true.
29
18
 
30
19
  [NOTE]
31
- `pmpcfgN` for an odd N never exists when XLEN == 64
20
+ `pmpcfgN` for an odd N never exists when XLEN == 64.
32
21
 
33
- When NUM_PMP_ENTRIES is not exactly 0, 16, or 64, some extant pmp registers,
34
- and associated pmpNcfg, will be read-only zero (but will never cause an exception).
22
+ An implemented entry may still be read-only zero (but will never cause an exception).
23
+ The number of entries that are actually usable is given by
24
+ NUM_USABLE_PMP_ENTRIES.
35
25
  long_name: TODO
36
26
  schema:
37
27
  type: integer
38
- minimum: 0
39
- maximum: 64
28
+ enum: [0, 16, 64]
40
29
  definedBy:
41
30
  extension:
42
31
  name: Sm
@@ -0,0 +1,35 @@
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/param_schema.json
5
+
6
+ $schema: param_schema.json#
7
+ kind: parameter
8
+ name: NUM_USABLE_PMP_ENTRIES
9
+ description: |
10
+ Number of implemented PMP entries that are actually usable.
11
+
12
+ An implementation may implement PMP entries (NUM_PMP_ENTRIES) but hardwire
13
+ some of them to zero (read-only zero). Such entries exist -- their
14
+ `pmpaddrN`/`pmpNcfg` registers are accessible and will not cause an exception
15
+ from M-mode -- but they cannot be configured to guard a region.
16
+
17
+ NUM_USABLE_PMP_ENTRIES gives the number of low-numbered entries that are
18
+ writable/usable. Entries `0` through `NUM_USABLE_PMP_ENTRIES-1` are usable;
19
+ entries `NUM_USABLE_PMP_ENTRIES` through `NUM_PMP_ENTRIES-1` are read-only
20
+ zero.
21
+
22
+ Must be between 0 and NUM_PMP_ENTRIES, inclusive.
23
+ long_name: TODO
24
+ schema:
25
+ type: integer
26
+ minimum: 0
27
+ maximum: 64
28
+ definedBy:
29
+ param:
30
+ name: NUM_PMP_ENTRIES
31
+ greaterThan: 0
32
+ requirements:
33
+ idl(): |
34
+ NUM_PMP_ENTRIES == 16 -> NUM_USABLE_PMP_ENTRIES <= 16;
35
+ reason: Usable PMP entries cannot exceed the number of implemented PMP entries
@@ -0,0 +1,23 @@
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/param_schema.json
5
+
6
+ $schema: param_schema.json#
7
+ kind: parameter
8
+ name: PMP_NA4_SUPPORTED
9
+ description: |
10
+ Whether or not the Naturally Aligned four-byte (NA4) PMP address matching
11
+ mode is supported.
12
+
13
+ long_name: PMP NA4 mode supported
14
+ schema:
15
+ type: boolean
16
+ definedBy:
17
+ param:
18
+ name: NUM_PMP_ENTRIES
19
+ greaterThan: 0
20
+ requirements:
21
+ idl(): |
22
+ PMP_NA4_SUPPORTED -> (PMP_GRANULARITY == 2);
23
+ reason: NA4 is not valid when the PMP granularity is larger than 4 bytes
@@ -0,0 +1,19 @@
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/param_schema.json
5
+
6
+ $schema: param_schema.json#
7
+ kind: parameter
8
+ name: PMP_NAPOT_SUPPORTED
9
+ description: |
10
+ Whether or not the Naturally Aligned Power-Of-Two (NAPOT) PMP address
11
+ matching mode is supported.
12
+
13
+ long_name: PMP NAPOT mode supported
14
+ schema:
15
+ type: boolean
16
+ definedBy:
17
+ param:
18
+ name: NUM_PMP_ENTRIES
19
+ greaterThan: 0
@@ -5,14 +5,14 @@
5
5
 
6
6
  $schema: param_schema.json#
7
7
  kind: parameter
8
- name: MSTATUS_TVM_IMPLEMENTED
8
+ name: PMP_TOR_SUPPORTED
9
9
  description: |
10
- Whether or not mstatus.TVM is implemented.
10
+ Whether or not the Top-of-Range (TOR) PMP address matching mode is supported.
11
11
 
12
- When not implemented mstatus.TVM will be read-only-zero.
13
- long_name: TODO
12
+ long_name: PMP TOR mode supported
14
13
  schema:
15
14
  type: boolean
16
15
  definedBy:
17
- extension:
18
- name: S
16
+ param:
17
+ name: NUM_PMP_ENTRIES
18
+ greaterThan: 0
@@ -15,3 +15,4 @@ description: |
15
15
  will cause execution to enter an unpredictable state.
16
16
  schema:
17
17
  type: boolean
18
+ default: true
@@ -15,3 +15,4 @@ description: |
15
15
  without raising a trap, in which case the EEI must provide a builtin.
16
16
  schema:
17
17
  type: boolean
18
+ default: true
@@ -15,3 +15,4 @@ description: |
15
15
  without raising a trap, in which case the EEI must provide a builtin.
16
16
  schema:
17
17
  type: boolean
18
+ default: true
@@ -20,6 +20,7 @@ description: |
20
20
  long_name: TODO
21
21
  schema:
22
22
  type: boolean
23
+ default: false
23
24
  definedBy:
24
25
  extension:
25
26
  allOf:
@@ -0,0 +1,19 @@
1
+ # Copyright (c) 2025-26 Harvey Mudd College
2
+ # Author: Ellen Yu (ellyu@hmc.edu)
3
+ # SPDX-License-Identifier: BSD-3-Clause-Clear
4
+
5
+ # yaml-language-server: $schema=../../../schemas/param_schema.json
6
+
7
+ $schema: param_schema.json#
8
+ kind: parameter
9
+ name: ZAWRS_NTO_IS_NOP
10
+ description: |
11
+ When true, WRS.NTO completes immediately, behaving as a no-op, rather than
12
+ stalling the hart.
13
+
14
+ long_name: TODO
15
+ schema:
16
+ type: boolean
17
+ definedBy:
18
+ extension:
19
+ name: Zawrs
@@ -1 +1 @@
1
- espresso-1.0
1
+ espresso-18f59c7
data/lib/udb/config.rb CHANGED
@@ -417,13 +417,25 @@ module Udb
417
417
  else
418
418
  @data["implemented_extensions"].map do |e|
419
419
  if e.is_a?(Array)
420
- { "name" => e[0], "version" => e[1] }
420
+ { "name" => e[0], "version" => implemented_extension_version(e[1]) }
421
421
  elsif e.is_a?(Hash)
422
- { "name" => e.fetch("name"), "version" => RequirementSpec.new(e.fetch("version")).version_spec.to_s }
422
+ { "name" => e.fetch("name"), "version" => implemented_extension_version(e.fetch("version")) }
423
423
  end
424
424
  end
425
425
  end
426
426
  end
427
427
 
428
+ private
429
+
430
+ sig { params(version: String).returns(String) }
431
+ def implemented_extension_version(version)
432
+ version_str = version.strip
433
+ if version_str.start_with?("=")
434
+ RequirementSpec.new(version_str).version_spec.to_s
435
+ else
436
+ VersionSpec.new(version_str).to_s
437
+ end
438
+ end
439
+
428
440
  end
429
441
  end
data/lib/udb/doc_link.rb CHANGED
@@ -33,12 +33,11 @@
33
33
  module Udb
34
34
  class DocLink
35
35
  # @param dst_link [String] The documentation link provided in the YAML
36
- # @param db_obj [String] Database object
36
+ # @param db_obj [Object] Database object
37
37
  def initialize(dst_link, db_obj)
38
- raise ArgumentError, "Need String but was passed a #{data.class}" unless dst_link.is_a?(String)
38
+ raise ArgumentError, "Missing documentation link for #{db_obj.name} of kind #{db_obj.kind}" if dst_link.nil?
39
+ raise ArgumentError, "Need String but was passed a #{dst_link.class}" unless dst_link.is_a?(String)
39
40
  @dst_link = dst_link
40
-
41
- raise ArgumentError, "Missing documentation link for #{db_obj.name} of kind #{db_obj.kind}" if @dst_link.nil?
42
41
  end
43
42
 
44
43
  # @return [String] Unique ID of the linked to normative rule
@@ -791,7 +791,7 @@ module Udb
791
791
  @left_shift = field_data["left_shift"].nil? ? 0 : field_data["left_shift"]
792
792
  @sext = field_data["sign_extend"].nil? ? false : field_data["sign_extend"]
793
793
  @alias = field_data["alias"].nil? ? nil : field_data["alias"]
794
- @location = field_data["location"]
794
+ @location = field_data["location"].to_s
795
795
  extract_location(field_data["location"])
796
796
  @excludes =
797
797
  if field_data.key?("not")
@@ -143,72 +143,19 @@ class NonIsaSpecification
143
143
  )
144
144
  end
145
145
 
146
- # Validation methods
147
- sig { returns(T::Array[String]) }
148
- # Validate all prose statement IDs and conventions for this spec.
149
- def validate_prose_ids
150
- return [] unless valid?
151
-
152
- issues = []
153
- statements = extract_prose_statements
154
- statements.each do |stmt|
155
- next unless stmt['id']
156
- id = stmt['id']
157
- source = stmt[:source] || 'unknown'
158
-
159
- # Check ID format according to prose-schema conventions
160
- unless valid_id_format?(id)
161
- issues << "Invalid ID format '#{id}' in #{source}: must be lowercase with underscores/hyphens only"
162
- end
163
-
164
- # Check for non-ISA specification naming convention
165
- unless valid_id_naming?(id)
166
- issues << "ID '#{id}' in #{source} should start with '#{name.downcase}-' for non-ISA specifications"
167
- end
168
- end
169
-
170
- # Check for duplicate IDs
171
- issues.concat(find_duplicate_ids(statements))
172
- issues
173
- end
174
-
175
- sig { params(include_sections: T::Boolean).returns(T::Array[T::Hash[T.any(String, Symbol), T.untyped]]) }
176
- # Extract all prose statements from description and sections, tagging their source.
177
- def extract_prose_statements(include_sections: true)
178
- statements = []
179
- # Extract from description
180
- if spec_description.is_a?(Array)
181
- spec_description.each_with_index { |stmt, i| statements << stmt.merge(source: "description[#{i}]") if stmt.is_a?(Hash) }
182
- end
183
- # Extract from sections
184
- if include_sections
185
- sections.each_with_index do |section, section_idx|
186
- next unless section['content'].is_a?(Array)
187
- section['content'].each_with_index do |stmt, stmt_idx|
188
- statements << stmt.merge(source: "sections[#{section_idx}].content[#{stmt_idx}]") if stmt.is_a?(Hash)
189
- end
190
- end
191
- end
192
- statements
193
- end
194
-
195
146
  # Rendering methods
196
147
  sig do
197
148
  params(
198
149
  cfg_arch: T.untyped,
199
150
  base_level: Integer,
200
- normative: T::Boolean,
201
- non_normative: T::Boolean
202
151
  ).returns(String)
203
152
  end
204
153
  # Configuration-aware rendering
205
- def render_for_cfg(cfg_arch, base_level: 3, normative: true, non_normative: true)
154
+ def render_for_cfg(cfg_arch, base_level: 3)
206
155
  return "" unless exists_in_cfg?(cfg_arch)
207
156
 
208
157
  to_asciidoc(
209
158
  base_level: base_level,
210
- normative: normative,
211
- non_normative: non_normative,
212
159
  when_callback: create_when_callback(cfg_arch)
213
160
  )
214
161
  end
@@ -216,24 +163,22 @@ class NonIsaSpecification
216
163
  sig do
217
164
  params(
218
165
  base_level: Integer,
219
- normative: T::Boolean,
220
- non_normative: T::Boolean,
221
166
  when_callback: T.nilable(T.proc.params(arg0: T.untyped, arg1: T.untyped).returns(T::Boolean))
222
167
  ).returns(String)
223
168
  end
224
169
  # Render the full specification as AsciiDoc, including description, sections, and references.
225
- def to_asciidoc(base_level: 3, normative: true, non_normative: true, when_callback: nil)
170
+ def to_asciidoc(base_level: 3, when_callback: nil)
226
171
  return create_fallback_content(base_level) unless valid?
227
172
 
228
173
  content = []
229
174
 
230
175
  # Add main description prose
231
- desc_content = render_structured_prose(spec_description, normative: normative, non_normative: non_normative, when_callback: when_callback)
176
+ desc_content = render_structured_prose(spec_description, when_callback: when_callback)
232
177
  content << desc_content if desc_content && !desc_content.empty?
233
178
  content << ""
234
179
 
235
180
  # Process all sections
236
- content.concat(render_sections(base_level, normative, non_normative, when_callback))
181
+ content.concat(render_sections(base_level, when_callback))
237
182
 
238
183
  # Add references section if present
239
184
  content.concat(render_references(base_level)) unless references.empty?
@@ -243,50 +188,22 @@ class NonIsaSpecification
243
188
 
244
189
  private
245
190
 
246
- # Validation helper methods
247
- sig { params(id: String).returns(T::Boolean) }
248
- # IDs must be lowercase, start with a letter, and use only underscores/hyphens.
249
- def valid_id_format?(id)
250
- id.match?(/^[a-z][a-z0-9_-]*$/)
251
- end
252
-
253
- sig { params(id: String).returns(T::Boolean) }
254
- # IDs should start with spec name or allowed prefixes for non-ISA specs.
255
- def valid_id_naming?(id)
256
- id.start_with?(name.downcase) || id.match?(/^(ext|inst|csr)-/)
257
- end
258
-
259
- sig { params(statements: T::Array[T::Hash[T.any(String, Symbol), T.untyped]]).returns(T::Array[String]) }
260
- # Find duplicate IDs in the statements array.
261
- def find_duplicate_ids(statements)
262
- issues = []
263
- id_counts = Hash.new(0)
264
- statements.each { |stmt| id_counts[stmt['id']] += 1 if stmt['id'] }
265
- id_counts.each do |id, count|
266
- next if count == 1
267
- issues << "Duplicate ID '#{id}' appears #{count} times"
268
- end
269
- issues
270
- end
271
-
272
191
  # Rendering helper methods
273
192
  sig do
274
193
  params(
275
194
  base_level: Integer,
276
- normative: T::Boolean,
277
- non_normative: T::Boolean,
278
195
  when_callback: T.nilable(T.proc.params(arg0: T.untyped, arg1: T.untyped).returns(T::Boolean))
279
196
  ).returns(T::Array[String])
280
197
  end
281
198
  # Render all sections, adjusting heading levels and filtering by callback.
282
- def render_sections(base_level, normative, non_normative, when_callback)
199
+ def render_sections(base_level, when_callback)
283
200
  content = []
284
201
  sections.each do |section|
285
202
  next unless should_include_section?(section, when_callback)
286
203
  level = section['level'] || (base_level + 1)
287
204
  content << "#{'=' * level} #{section['title']}"
288
205
  content << ""
289
- section_content = render_structured_prose(section['content'], normative: normative, non_normative: non_normative, when_callback: when_callback)
206
+ section_content = render_structured_prose(section['content'], when_callback: when_callback)
290
207
  content << section_content if section_content && !section_content.empty?
291
208
  content << ""
292
209
  end
@@ -311,29 +228,34 @@ class NonIsaSpecification
311
228
  sig do
312
229
  params(
313
230
  prose_content: T.untyped,
314
- normative: T::Boolean,
315
- non_normative: T::Boolean,
316
231
  when_callback: T.nilable(T.proc.params(arg0: T.untyped, arg1: T.untyped).returns(T::Boolean))
317
232
  ).returns(T.nilable(String))
318
233
  end
319
- # Render an array of prose statements as AsciiDoc, filtering by normative and conditional status.
320
- def render_structured_prose(prose_content, normative: true, non_normative: true, when_callback: nil)
234
+ # Render an array of prose statements as AsciiDoc.
235
+ def render_structured_prose(prose_content, when_callback: nil)
321
236
  return nil if prose_content.nil?
237
+
238
+ # Handle simple string (Asciidoc source)
239
+ return prose_content if prose_content.is_a?(String)
240
+
322
241
  return "" unless prose_content.is_a?(Array)
323
242
 
324
243
  rendered_statements = []
325
244
  prose_content.each do |statement|
326
- next unless statement.is_a?(Hash) && statement['id'] && statement['text']
245
+ text = nil
246
+ condition = nil
247
+
248
+ next unless statement.is_a?(Hash)
249
+
250
+ text = statement['text']
251
+ condition = statement['when()']
327
252
 
328
- # Filter by normative status
329
- stmt_normative = statement['normative']
330
- next if stmt_normative == true && !normative
331
- next if stmt_normative == false && !non_normative
253
+ next unless text
332
254
 
333
255
  # Filter by when condition
334
- next if when_callback && !when_callback.call(statement['when()'], statement)
256
+ next if when_callback && !when_callback.call(condition, statement)
335
257
 
336
- rendered_statements << statement['text']
258
+ rendered_statements << text
337
259
  end
338
260
  rendered_statements.join("\n\n")
339
261
  end
data/lib/udb/version.rb CHANGED
@@ -5,5 +5,5 @@
5
5
  # frozen_string_literal: true
6
6
 
7
7
  module Udb
8
- def self.version = "0.1.13"
8
+ def self.version = "0.1.14"
9
9
  end