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.
- checksums.yaml +4 -4
- data/.data/cfgs/example_rv64_with_overlay.yaml +15 -18
- data/.data/cfgs/qc_iu.yaml +5 -1
- data/.data/cfgs/rv32-riscv-tests.yaml +4 -1
- data/.data/cfgs/rv32-vector.yaml +4 -1
- data/.data/cfgs/rv64-riscv-tests.yaml +4 -1
- data/.data/cfgs/rv64-vector.yaml +4 -1
- data/.data/spec/custom/isa/qc_iu/ext/Xqccmi.yaml +107 -36
- data/.data/spec/custom/isa/qc_iu/inst/Xqccmi/qc.cm.ilut.yaml +52 -69
- data/.data/spec/custom/isa/qc_iu/isa/globals.isa +27 -5
- data/.data/spec/schemas/config_schema.json +1 -1
- data/.data/spec/schemas/mmr_schema.json +3 -3
- data/.data/spec/schemas/schema_defs.json +5 -0
- data/.data/spec/std/isa/csr/H/henvcfg.yaml +25 -0
- data/.data/spec/std/isa/csr/I/pmpaddr0.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr1.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr10.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr11.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr12.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr13.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr14.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr15.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr16.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr17.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr18.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr19.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr2.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr20.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr21.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr22.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr23.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr24.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr25.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr26.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr27.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr28.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr29.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr3.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr30.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr31.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr32.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr33.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr34.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr35.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr36.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr37.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr38.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr39.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr4.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr40.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr41.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr42.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr43.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr44.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr45.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr46.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr47.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr48.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr49.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr5.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr50.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr51.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr52.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr53.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr54.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr55.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr56.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr57.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr58.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr59.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr6.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr60.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr61.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr62.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr63.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr7.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr8.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddr9.yaml +6 -4
- data/.data/spec/std/isa/csr/I/pmpaddrN.layout +6 -4
- data/.data/spec/std/isa/csr/I/pmpcfg0.yaml +120 -144
- data/.data/spec/std/isa/csr/I/pmpcfg1.yaml +60 -72
- data/.data/spec/std/isa/csr/I/pmpcfg10.yaml +120 -144
- data/.data/spec/std/isa/csr/I/pmpcfg11.yaml +60 -72
- data/.data/spec/std/isa/csr/I/pmpcfg12.yaml +120 -144
- data/.data/spec/std/isa/csr/I/pmpcfg13.yaml +60 -72
- data/.data/spec/std/isa/csr/I/pmpcfg14.yaml +120 -144
- data/.data/spec/std/isa/csr/I/pmpcfg15.yaml +60 -72
- data/.data/spec/std/isa/csr/I/pmpcfg2.yaml +120 -144
- data/.data/spec/std/isa/csr/I/pmpcfg3.yaml +60 -72
- data/.data/spec/std/isa/csr/I/pmpcfg4.yaml +120 -144
- data/.data/spec/std/isa/csr/I/pmpcfg5.yaml +60 -72
- data/.data/spec/std/isa/csr/I/pmpcfg6.yaml +120 -144
- data/.data/spec/std/isa/csr/I/pmpcfg7.yaml +60 -72
- data/.data/spec/std/isa/csr/I/pmpcfg8.yaml +120 -144
- data/.data/spec/std/isa/csr/I/pmpcfg9.yaml +60 -72
- data/.data/spec/std/isa/csr/I/pmpcfgN.layout +15 -18
- data/.data/spec/std/isa/csr/jvt.yaml +1 -0
- data/.data/spec/std/isa/csr/menvcfg.yaml +20 -0
- data/.data/spec/std/isa/csr/mstatus.yaml +8 -6
- data/.data/spec/std/isa/csr/senvcfg.yaml +26 -0
- data/.data/spec/std/isa/inst/B/andn.yaml +10 -12
- data/.data/spec/std/isa/inst/B/clmul.yaml +9 -11
- data/.data/spec/std/isa/inst/B/clmulh.yaml +9 -11
- data/.data/spec/std/isa/inst/B/orn.yaml +9 -11
- data/.data/spec/std/isa/inst/B/rev8.yaml +1 -1
- data/.data/spec/std/isa/inst/B/rol.yaml +9 -11
- data/.data/spec/std/isa/inst/B/rolw.yaml +9 -11
- data/.data/spec/std/isa/inst/B/ror.yaml +9 -11
- data/.data/spec/std/isa/inst/B/rorw.yaml +9 -11
- data/.data/spec/std/isa/inst/B/xnor.yaml +9 -11
- data/.data/spec/std/isa/inst/C/c.ldsp.yaml +3 -3
- data/.data/spec/std/isa/inst/I/addi.yaml +1 -0
- data/.data/spec/std/isa/inst/I/addiw.yaml +1 -0
- data/.data/spec/std/isa/inst/I/andi.yaml +1 -0
- data/.data/spec/std/isa/inst/I/auipc.yaml +1 -0
- data/.data/spec/std/isa/inst/I/lb.yaml +1 -0
- data/.data/spec/std/isa/inst/I/lbu.yaml +1 -0
- data/.data/spec/std/isa/inst/I/ld.yaml +2 -0
- data/.data/spec/std/isa/inst/I/lh.yaml +1 -0
- data/.data/spec/std/isa/inst/I/lhu.yaml +1 -0
- data/.data/spec/std/isa/inst/I/lui.yaml +1 -0
- data/.data/spec/std/isa/inst/I/lw.yaml +1 -0
- data/.data/spec/std/isa/inst/I/lwu.yaml +1 -0
- data/.data/spec/std/isa/inst/I/ori.yaml +1 -0
- data/.data/spec/std/isa/inst/I/sb.yaml +1 -0
- data/.data/spec/std/isa/inst/I/sd.yaml +1 -0
- data/.data/spec/std/isa/inst/I/sh.yaml +1 -0
- data/.data/spec/std/isa/inst/I/slti.yaml +1 -0
- data/.data/spec/std/isa/inst/I/sltiu.yaml +1 -0
- data/.data/spec/std/isa/inst/I/sw.yaml +1 -0
- data/.data/spec/std/isa/inst/I/xori.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vadc.vim.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vadd.vi.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vand.vi.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vle8.v.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vmadc.vi.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vmadc.vim.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vmerge.vim.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vmseq.vi.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vmsgt.vi.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vmsgtu.vi.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vmsle.vi.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vmsleu.vi.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vmsne.vi.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vor.vi.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vrsub.vi.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vsadd.vi.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vsaddu.vi.yaml +1 -0
- data/.data/spec/std/isa/inst/V/vse8.v.yaml +1 -0
- data/.data/spec/std/isa/inst/Zawrs/wrs.nto.yaml +4 -2
- data/.data/spec/std/isa/inst/Zba/add.uw.yaml +9 -11
- data/.data/spec/std/isa/inst/Zbb/orc.b.yaml +1 -1
- data/.data/spec/std/isa/inst/Zbkb/brev8.yaml +3 -3
- data/.data/spec/std/isa/inst/Zbkb/unzip.yaml +2 -2
- data/.data/spec/std/isa/inst/Zbkb/zip.yaml +2 -2
- data/.data/spec/std/isa/inst/Zbkx/xperm4.yaml +2 -2
- data/.data/spec/std/isa/inst/Zbkx/xperm8.yaml +2 -2
- data/.data/spec/std/isa/inst/Zicbop/prefetch.i.yaml +2 -0
- data/.data/spec/std/isa/inst/Zicbop/prefetch.r.yaml +2 -0
- data/.data/spec/std/isa/inst/Zicbop/prefetch.w.yaml +2 -0
- data/.data/spec/std/isa/inst/Zks/sm3p0.yaml +1 -1
- data/.data/spec/std/isa/inst/Zks/sm3p1.yaml +1 -1
- data/.data/spec/std/isa/inst/Zks/sm4ed.yaml +1 -1
- data/.data/spec/std/isa/inst/Zks/sm4ks.yaml +1 -1
- data/.data/spec/std/isa/isa/builtin_functions.idl +1 -0
- data/.data/spec/std/isa/isa/globals.isa +27 -7
- data/.data/spec/std/isa/isa/interrupts.idl +1 -0
- data/.data/spec/std/isa/param/HSTATEEN_CONTEXT_TYPE.yaml +1 -0
- data/.data/spec/std/isa/param/MSTATEEN_CONTEXT_TYPE.yaml +1 -0
- data/.data/spec/std/isa/param/MTVEC_BASE_ALIGNMENT_DIRECT.yaml +1 -0
- data/.data/spec/std/isa/param/MTVEC_BASE_ALIGNMENT_VECTORED.yaml +1 -0
- data/.data/spec/std/isa/param/NUM_PMP_ENTRIES.yaml +11 -22
- data/.data/spec/std/isa/param/NUM_USABLE_PMP_ENTRIES.yaml +35 -0
- data/.data/spec/std/isa/param/PMP_NA4_SUPPORTED.yaml +23 -0
- data/.data/spec/std/isa/param/PMP_NAPOT_SUPPORTED.yaml +19 -0
- data/.data/spec/std/isa/param/{MSTATUS_TVM_IMPLEMENTED.yaml → PMP_TOR_SUPPORTED.yaml} +6 -6
- data/.data/spec/std/isa/param/PRECISE_SYNCHRONOUS_EXCEPTIONS.yaml +1 -0
- data/.data/spec/std/isa/param/TRAP_ON_EBREAK.yaml +1 -0
- data/.data/spec/std/isa/param/TRAP_ON_ECALL_FROM_M.yaml +1 -0
- data/.data/spec/std/isa/param/TRAP_ON_SFENCE_VMA_WHEN_SATP_MODE_IS_READ_ONLY.yaml +1 -0
- data/.data/spec/std/isa/param/ZAWRS_NTO_IS_NOP.yaml +19 -0
- data/lib/udb/ESPRESSO_VERSION +1 -1
- data/lib/udb/config.rb +14 -2
- data/lib/udb/doc_link.rb +3 -4
- data/lib/udb/obj/instruction.rb +1 -1
- data/lib/udb/obj/non_isa_specification.rb +22 -100
- data/lib/udb/version.rb +1 -1
- data/lib/udb/z3.rb +2 -2
- 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
|
-
|
|
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
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
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) &&
|
|
@@ -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.
|
|
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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
-
|
|
34
|
-
|
|
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
|
-
|
|
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:
|
|
8
|
+
name: PMP_TOR_SUPPORTED
|
|
9
9
|
description: |
|
|
10
|
-
Whether or not
|
|
10
|
+
Whether or not the Top-of-Range (TOR) PMP address matching mode is supported.
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
long_name: TODO
|
|
12
|
+
long_name: PMP TOR mode supported
|
|
14
13
|
schema:
|
|
15
14
|
type: boolean
|
|
16
15
|
definedBy:
|
|
17
|
-
|
|
18
|
-
name:
|
|
16
|
+
param:
|
|
17
|
+
name: NUM_PMP_ENTRIES
|
|
18
|
+
greaterThan: 0
|
|
@@ -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
|
data/lib/udb/ESPRESSO_VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
espresso-
|
|
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" =>
|
|
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 [
|
|
36
|
+
# @param db_obj [Object] Database object
|
|
37
37
|
def initialize(dst_link, db_obj)
|
|
38
|
-
raise ArgumentError, "
|
|
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
|
data/lib/udb/obj/instruction.rb
CHANGED
|
@@ -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
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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'],
|
|
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
|
|
320
|
-
def render_structured_prose(prose_content,
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
256
|
+
next if when_callback && !when_callback.call(condition, statement)
|
|
335
257
|
|
|
336
|
-
rendered_statements <<
|
|
258
|
+
rendered_statements << text
|
|
337
259
|
end
|
|
338
260
|
rendered_statements.join("\n\n")
|
|
339
261
|
end
|
data/lib/udb/version.rb
CHANGED