aboutsummaryrefslogtreecommitdiff
path: root/riscv_sys.sail
diff options
context:
space:
mode:
authorPrashanth Mundkur <prashanth.mundkur@gmail.com>2018-04-18 15:01:43 -0700
committerPrashanth Mundkur <prashanth.mundkur@gmail.com>2018-04-18 15:37:50 -0700
commitcb0fdf1bbe09e2ce99a0ba6a3f9967f8624423f3 (patch)
tree79d6bd1f609961e6253499d9f39c1b7693c496c3 /riscv_sys.sail
parenta273184b4b77a605825f0fb2604d83e05e830d3c (diff)
downloadsail-riscv-cb0fdf1bbe09e2ce99a0ba6a3f9967f8624423f3.zip
sail-riscv-cb0fdf1bbe09e2ce99a0ba6a3f9967f8624423f3.tar.gz
sail-riscv-cb0fdf1bbe09e2ce99a0ba6a3f9967f8624423f3.tar.bz2
Fix mideleg semantics after spec clarification from Andrew Waterman.
Diffstat (limited to 'riscv_sys.sail')
-rw-r--r--riscv_sys.sail14
1 files changed, 10 insertions, 4 deletions
diff --git a/riscv_sys.sail b/riscv_sys.sail
index dfed02c..37c487c 100644
--- a/riscv_sys.sail
+++ b/riscv_sys.sail
@@ -152,7 +152,13 @@ function legalize_mie(o : Minterrupts, v : xlenbits) -> Minterrupts = {
}
function legalize_mideleg(o : Minterrupts, v : xlenbits) -> Minterrupts = {
- Mk_Minterrupts(v)
+ /* M-mode interrupt delegation bits "should" be hardwired to 0. */
+ /* FIXME: needs verification against eventual spec language. */
+ let m = Mk_Minterrupts(v);
+ let m = update_MEI(m, false);
+ let m = update_MTI(m, false);
+ let m = update_MSI(m, false);
+ m
}
/* exception registers */
@@ -325,9 +331,9 @@ bitfield Sinterrupts : bits(64) = {
function lower_mip(m : Minterrupts, d : Minterrupts) -> Sinterrupts = {
let s : Sinterrupts = Mk_Sinterrupts(EXTZ(0b0));
/* M-mode interrupts delegated to S-mode should appear as S-mode interrupts */
- let s = update_SEI(s, (m.SEI() & d.SEI()) | (m.MEI() & d.MEI()));
- let s = update_STI(s, (m.STI() & d.STI()) | (m.MTI() & d.MTI()));
- let s = update_SSI(s, (m.SSI() & d.SSI()) | (m.MSI() & d.MSI()));
+ let s = update_SEI(s, m.SEI() & d.SEI());
+ let s = update_STI(s, m.STI() & d.STI());
+ let s = update_SSI(s, m.SSI() & d.SSI());
let s = update_UEI(s, m.UEI() & d.UEI());
let s = update_UTI(s, m.UTI() & d.UTI());