aboutsummaryrefslogtreecommitdiff
path: root/model/riscv_pmp_regs.sail
diff options
context:
space:
mode:
authorPrashanth Mundkur <prashanth.mundkur@gmail.com>2019-06-17 19:09:27 -0700
committerPrashanth Mundkur <prashanth.mundkur@gmail.com>2019-06-17 19:09:27 -0700
commit918afe11c45fe207bd15ca0d9d79afe8a20de4c7 (patch)
treeaa649fce289cba8eb94281130ca838cab7c0bed5 /model/riscv_pmp_regs.sail
parent5dc38f37b871af7d6d1af9dfbbb203fb92d99d6a (diff)
downloadsail-riscv-918afe11c45fe207bd15ca0d9d79afe8a20de4c7.zip
sail-riscv-918afe11c45fe207bd15ca0d9d79afe8a20de4c7.tar.gz
sail-riscv-918afe11c45fe207bd15ca0d9d79afe8a20de4c7.tar.bz2
Add basic PMP definitions.
Diffstat (limited to 'model/riscv_pmp_regs.sail')
-rw-r--r--model/riscv_pmp_regs.sail25
1 files changed, 25 insertions, 0 deletions
diff --git a/model/riscv_pmp_regs.sail b/model/riscv_pmp_regs.sail
new file mode 100644
index 0000000..2326cc7
--- /dev/null
+++ b/model/riscv_pmp_regs.sail
@@ -0,0 +1,25 @@
+enum PmpAddrmatchType = {OFF, TOR, NA4, NAPOT}
+
+bitfield Pmpcfg_ent : bits(8) = {
+ L : 7, /* locking */
+ A : 4 .. 3, /* address matching */
+ // permissions:
+ X : 2, /* execute */
+ W : 1, /* write */
+ R : 0 /* read */
+}
+
+type Pmpcfg_reg = vector(xlen_bytes, dec, Pmpcfg_ent)
+
+register Pmpcfg0 : Pmpcfg_reg
+register Pmpcfg1 : Pmpcfg_reg
+register Pmpcfg2 : Pmpcfg_reg
+register Pmpcfg3 : Pmpcfg_reg
+
+bitfield Pmp_addr_64 : bits(64) = {
+ addr : 53 .. 0
+}
+
+bitfield Pmp_addr_32 : bits(64) = {
+ addr : 31 .. 0
+}