diff options
author | Prashanth Mundkur <prashanth.mundkur@gmail.com> | 2019-05-14 14:57:27 -0700 |
---|---|---|
committer | Prashanth Mundkur <prashanth.mundkur@gmail.com> | 2019-05-14 15:37:37 -0700 |
commit | 64933000be3f9ce0bf8d20b48e512d3c62830893 (patch) | |
tree | 4b0f3bfca583bb343826d4681312ba9db72de2a7 /model/riscv_sys_control.sail | |
parent | 2b0984ab49d48651e6daff0bcc3c37b8b49e2602 (diff) | |
download | sail-riscv-64933000be3f9ce0bf8d20b48e512d3c62830893.zip sail-riscv-64933000be3f9ce0bf8d20b48e512d3c62830893.tar.gz sail-riscv-64933000be3f9ce0bf8d20b48e512d3c62830893.tar.bz2 |
Improve the interface to access CSRs in extensions.
Diffstat (limited to 'model/riscv_sys_control.sail')
-rw-r--r-- | model/riscv_sys_control.sail | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/model/riscv_sys_control.sail b/model/riscv_sys_control.sail index 52111f1..6bee610 100644 --- a/model/riscv_sys_control.sail +++ b/model/riscv_sys_control.sail @@ -6,7 +6,7 @@ function csrAccess(csr : csreg) -> csrRW = csr[11..10] function csrPriv(csr : csreg) -> priv_level = csr[9..8] -function is_CSR_defined (csr : bits(12), p : Privilege) -> bool = +function is_CSR_defined (csr : csreg, p : Privilege) -> bool = match (csr) { /* machine mode: informational */ 0xf11 => p == Machine, // mvendorid @@ -69,7 +69,7 @@ function is_CSR_defined (csr : bits(12), p : Privilege) -> bool = 0xC82 => p == User & (sizeof(xlen) == 32), // instreth /* check extensions */ - _ => is_UExt_CSR_defined(csr, p) // 'N' extension + _ => ext_is_CSR_defined(csr, p) } val check_CSR_access : (csrRW, priv_level, Privilege, bool) -> bool |