aboutsummaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
authorPrashanth Mundkur <prashanth.mundkur@gmail.com>2019-01-28 14:19:30 -0800
committerPrashanth Mundkur <prashanth.mundkur@gmail.com>2019-01-28 14:19:30 -0800
commitb6b532cc7855dc8223eb3572fd847959f3d363b4 (patch)
treea7ff5363b5d5c6f5c771f57cf4ac9b9d937fca1c /model
parent3f2933fdcdb0ff550d3c8ddbbbcb8400e7c45fd6 (diff)
downloadsail-riscv-b6b532cc7855dc8223eb3572fd847959f3d363b4.zip
sail-riscv-b6b532cc7855dc8223eb3572fd847959f3d363b4.tar.gz
sail-riscv-b6b532cc7855dc8223eb3572fd847959f3d363b4.tar.bz2
Comment on handling mstatus.FS, and update to match Spike.
Diffstat (limited to 'model')
-rw-r--r--model/riscv_sys.sail10
1 files changed, 6 insertions, 4 deletions
diff --git a/model/riscv_sys.sail b/model/riscv_sys.sail
index 1baeb93..984af71 100644
--- a/model/riscv_sys.sail
+++ b/model/riscv_sys.sail
@@ -121,7 +121,11 @@ function legalize_mstatus(o : Mstatus, v : xlenbits) -> Mstatus = {
/* We don't have any extension context yet. */
let m = update_XS(m, extStatus_to_bits(Off));
- let m = update_FS(m, extStatus_to_bits(Off));
+ /* FS is WARL, and making FS writable can support the M-mode emulation of an FPU
+ * to support code running in S/U-modes. Spike does this, and for now, we match it.
+ * FIXME: This should be made a platform parameter.
+ */
+ // let m = update_FS(m, extStatus_to_bits(Off));
let m = update_SD(m, extStatus_of_bits(m.FS()) == Dirty
| extStatus_of_bits(m.XS()) == Dirty);
@@ -383,13 +387,11 @@ function lower_mstatus(m : Mstatus) -> Sstatus = {
}
function lift_sstatus(m : Mstatus, s : Sstatus) -> Mstatus = {
- // FIXME: This should be parameterized by a platform setting. For now, match spike.
- // let m = update_UXL(m, s.UXL());
let m = update_MXR(m, s.MXR());
let m = update_SUM(m, s.SUM());
- // FIXME: Should XS and FS check whether X and F|D are supported in misa?
let m = update_XS(m, s.XS());
+ // See comment for mstatus.FS.
let m = update_FS(m, s.FS());
let m = update_SD(m, extStatus_of_bits(m.FS()) == Dirty
| extStatus_of_bits(m.XS()) == Dirty);