aboutsummaryrefslogtreecommitdiff
path: root/model/riscv_insts_base.sail
diff options
context:
space:
mode:
authorAlasdair <alasdair.armstrong@cl.cam.ac.uk>2023-12-12 14:55:37 +0000
committerBill McSpadden <bill@riscv.org>2024-01-31 12:38:33 -0600
commit563446c477f5e905df905e0d30371a2c4d51d7a5 (patch)
treed0f503b96366666ad97eea2a4ba4cbe748e82326 /model/riscv_insts_base.sail
parentd7a3d8012fd579f40e53a29569141d72dd5e0c32 (diff)
downloadsail-riscv-563446c477f5e905df905e0d30371a2c4d51d7a5.zip
sail-riscv-563446c477f5e905df905e0d30371a2c4d51d7a5.tar.gz
sail-riscv-563446c477f5e905df905e0d30371a2c4d51d7a5.tar.bz2
Update bitfield syntax
Use newer bitfield syntax, which has been part of Sail for a while now. Should in theory be more efficient as it removes a level of indirection for bitfield accesses. It's also much more friendly to `sail -fmt`, which has no idea how to handle the old bitfield syntax.
Diffstat (limited to 'model/riscv_insts_base.sail')
-rw-r--r--model/riscv_insts_base.sail6
1 files changed, 3 insertions, 3 deletions
diff --git a/model/riscv_insts_base.sail b/model/riscv_insts_base.sail
index eec5fbd..7d53d99 100644
--- a/model/riscv_insts_base.sail
+++ b/model/riscv_insts_base.sail
@@ -789,7 +789,7 @@ mapping clause encdec = SRET()
function clause execute SRET() = {
let sret_illegal : bool = match cur_privilege {
User => true,
- Supervisor => not(haveSupMode ()) | mstatus.TSR() == 0b1,
+ Supervisor => not(haveSupMode ()) | mstatus[TSR] == 0b1,
Machine => not(haveSupMode ())
};
if sret_illegal
@@ -826,7 +826,7 @@ mapping clause encdec = WFI()
function clause execute WFI() =
match cur_privilege {
Machine => { platform_wfi(); RETIRE_SUCCESS },
- Supervisor => if mstatus.TW() == 0b1
+ Supervisor => if mstatus[TW] == 0b1
then { handle_illegal(); RETIRE_FAIL }
else { platform_wfi(); RETIRE_SUCCESS },
User => { handle_illegal(); RETIRE_FAIL }
@@ -845,7 +845,7 @@ function clause execute SFENCE_VMA(rs1, rs2) = {
let asid : option(xlenbits) = if rs2 == 0b00000 then None() else Some(X(rs2));
match cur_privilege {
User => { handle_illegal(); RETIRE_FAIL },
- Supervisor => match (architecture(get_mstatus_SXL(mstatus)), mstatus.TVM()) {
+ Supervisor => match (architecture(get_mstatus_SXL(mstatus)), mstatus[TVM]) {
(Some(_), 0b1) => { handle_illegal(); RETIRE_FAIL },
(Some(_), 0b0) => { flush_TLB(asid, addr); RETIRE_SUCCESS },
(_, _) => internal_error(__FILE__, __LINE__, "unimplemented sfence architecture")