aboutsummaryrefslogtreecommitdiff
path: root/model/riscv_platform.sail
diff options
context:
space:
mode:
authorPrashanth Mundkur <prashanth.mundkur@gmail.com>2019-07-19 10:19:46 -0700
committerPrashanth Mundkur <prashanth.mundkur@gmail.com>2019-07-19 10:19:46 -0700
commit5d7e86c77ff33115c58763e27acbfd6d5e9ecab1 (patch)
tree9cfda6f6e82911c3d806cfeec0f769aa5e2eaa9d /model/riscv_platform.sail
parent8b06916333edf84de5b7c27b44e7ce453fac5037 (diff)
parentad348876ca17529c4d7fe2f3d2ec227f9f3026e1 (diff)
downloadsail-riscv-5d7e86c77ff33115c58763e27acbfd6d5e9ecab1.zip
sail-riscv-5d7e86c77ff33115c58763e27acbfd6d5e9ecab1.tar.gz
sail-riscv-5d7e86c77ff33115c58763e27acbfd6d5e9ecab1.tar.bz2
Merge branch 'master-cleanup'
Diffstat (limited to 'model/riscv_platform.sail')
-rw-r--r--model/riscv_platform.sail9
1 files changed, 8 insertions, 1 deletions
diff --git a/model/riscv_platform.sail b/model/riscv_platform.sail
index 9184f02..52511a9 100644
--- a/model/riscv_platform.sail
+++ b/model/riscv_platform.sail
@@ -337,12 +337,19 @@ function htif_tick() = {
}
/* Top-level MMIO dispatch */
-
+$ifndef RVFI_DII
function within_mmio_readable forall 'n, 0 < 'n <= max_mem_access . (addr : xlenbits, width : atom('n)) -> bool =
within_clint(addr, width) | (within_htif_readable(addr, width) & 1 <= 'n)
+$else
+function within_mmio_readable forall 'n, 0 < 'n <= max_mem_access . (addr : xlenbits, width : atom('n)) -> bool = false
+$endif
+$ifndef RVFI_DII
function within_mmio_writable forall 'n, 0 < 'n <= max_mem_access . (addr : xlenbits, width : atom('n)) -> bool =
within_clint(addr, width) | (within_htif_writable(addr, width) & 'n <= 8)
+$else
+function within_mmio_writable forall 'n, 0 < 'n <= max_mem_access . (addr : xlenbits, width : atom('n)) -> bool = false
+$endif
function mmio_read forall 'n, 0 < 'n <= max_mem_access . (addr : xlenbits, width : atom('n)) -> MemoryOpResult(bits(8 * 'n)) =
if within_clint(addr, width)