aboutsummaryrefslogtreecommitdiff
path: root/ocaml_emulator/riscv_ocaml_sim.ml
diff options
context:
space:
mode:
authorTim Hutt <timothy.hutt@codasip.com>2024-02-02 11:56:55 +0000
committerBill McSpadden <bill@riscv.org>2024-02-05 11:22:09 -0600
commit4de2bff12d967d91dd064e4a49e25ca4785f25e3 (patch)
treeb106b03932811b9f35c4ac025a89c6f47862dc8f /ocaml_emulator/riscv_ocaml_sim.ml
parentd5e89a71e3a84495c1b88a7749c25fd6b9da684b (diff)
downloadsail-riscv-4de2bff12d967d91dd064e4a49e25ca4785f25e3.zip
sail-riscv-4de2bff12d967d91dd064e4a49e25ca4785f25e3.tar.gz
sail-riscv-4de2bff12d967d91dd064e4a49e25ca4785f25e3.tar.bz2
Improve PMP support
This implements a lot of missing functionality for PMPs. * Support 64 PMPs as well as 0 and 16. * Support setting PMP grain * Return correct address bits on read (some read as 0 or 1 depending on the grain and match type) * Unlock PMPs on reset * Implement pmpcfg WARL legalisation Co-authored-by: Ben Fletcher <benjamin.fletcher@codasip.com>
Diffstat (limited to 'ocaml_emulator/riscv_ocaml_sim.ml')
-rw-r--r--ocaml_emulator/riscv_ocaml_sim.ml9
1 files changed, 6 insertions, 3 deletions
diff --git a/ocaml_emulator/riscv_ocaml_sim.ml b/ocaml_emulator/riscv_ocaml_sim.ml
index c151d69..03887b7 100644
--- a/ocaml_emulator/riscv_ocaml_sim.ml
+++ b/ocaml_emulator/riscv_ocaml_sim.ml
@@ -41,9 +41,12 @@ let options = Arg.align ([("-dump-dts",
("-enable-misaligned-access",
Arg.Set P.config_enable_misaligned_access,
" enable misaligned accesses without M-mode traps");
- ("-enable-pmp",
- Arg.Set P.config_enable_pmp,
- " enable PMP support");
+ ("-pmp-count",
+ Arg.Int P.set_config_pmp_count,
+ " number of supported PMPs (0, 16, 64)");
+ ("-pmp-grain",
+ Arg.Int P.set_config_pmp_grain,
+ " exponent of granularity of PMP addresses (G in the spec)");
("-enable-next",
Arg.Set P.config_enable_next,
" enable N extension");