aboutsummaryrefslogtreecommitdiff
path: root/model/riscv_fdext_control.sail
diff options
context:
space:
mode:
authorPrashanth Mundkur <prashanth.mundkur@gmail.com>2020-02-06 11:24:17 -0800
committerPrashanth Mundkur <prashanth.mundkur@gmail.com>2020-02-06 11:24:17 -0800
commit313e217047f08b3c603df53eb59229bf5f313e10 (patch)
tree802b366b934bc1f81d79325bb7d2af6659633fe4 /model/riscv_fdext_control.sail
parent08e30132238c66bfc0d3120d6defd6a0e38c43f3 (diff)
downloadsail-riscv-313e217047f08b3c603df53eb59229bf5f313e10.zip
sail-riscv-313e217047f08b3c603df53eb59229bf5f313e10.tar.gz
sail-riscv-313e217047f08b3c603df53eb59229bf5f313e10.tar.bz2
Improve handling of fcsr by making it a bitfield.
Also properly dirty the FS bit in mstatus when writing to floating-point state. Fixes #38.
Diffstat (limited to 'model/riscv_fdext_control.sail')
-rw-r--r--model/riscv_fdext_control.sail10
1 files changed, 5 insertions, 5 deletions
diff --git a/model/riscv_fdext_control.sail b/model/riscv_fdext_control.sail
index 7b5cd31..7155699 100644
--- a/model/riscv_fdext_control.sail
+++ b/model/riscv_fdext_control.sail
@@ -13,12 +13,12 @@ function clause ext_is_CSR_defined (0x001, _) = haveFExt() | haveDExt()
function clause ext_is_CSR_defined (0x002, _) = haveFExt() | haveDExt()
function clause ext_is_CSR_defined (0x003, _) = haveFExt() | haveDExt()
-function clause ext_read_CSR (0x001) = Some (EXTZ (fcsr [4..0]))
-function clause ext_read_CSR (0x002) = Some (EXTZ (fcsr [7..5]))
-function clause ext_read_CSR (0x003) = Some (EXTZ (fcsr))
+function clause ext_read_CSR (0x001) = Some (EXTZ (fcsr.FFLAGS()))
+function clause ext_read_CSR (0x002) = Some (EXTZ (fcsr.FRM()))
+function clause ext_read_CSR (0x003) = Some (EXTZ (fcsr.bits()))
-function clause ext_write_CSR (0x001, value) = write_fcsr (fcsr [7..5], value [4..0])
-function clause ext_write_CSR (0x002, value) = write_fcsr (value [2..0], fcsr [4..0])
+function clause ext_write_CSR (0x001, value) = write_fcsr (fcsr.FRM(), value [4..0])
+function clause ext_write_CSR (0x002, value) = write_fcsr (value [2..0], fcsr.FFLAGS())
function clause ext_write_CSR (0x003, value) = write_fcsr (value [7..5], value [4..0])
/* **************************************************************** */