aboutsummaryrefslogtreecommitdiff
path: root/model/riscv_insts_zicsr.sail
diff options
context:
space:
mode:
Diffstat (limited to 'model/riscv_insts_zicsr.sail')
-rw-r--r--model/riscv_insts_zicsr.sail6
1 files changed, 3 insertions, 3 deletions
diff --git a/model/riscv_insts_zicsr.sail b/model/riscv_insts_zicsr.sail
index 569bc19..ccbc030 100644
--- a/model/riscv_insts_zicsr.sail
+++ b/model/riscv_insts_zicsr.sail
@@ -2,7 +2,7 @@
/* This file specifies the instructions in the 'Zicsr' extension. */
/* ****************************************************************** */
-union clause ast = CSR : (bits(12), regbits, regbits, bool, csrop)
+union clause ast = CSR : (bits(12), regidx, regidx, bool, csrop)
mapping encdec_csrop : csrop <-> bits(2) = {
CSRRW <-> 0b01,
@@ -141,7 +141,7 @@ function clause execute CSR(csr, rs1, rd, is_imm, op) = {
_ => if is_imm then unsigned(rs1_val) != 0 else unsigned(rs1) != 0
};
if ~ (check_CSR(csr, cur_privilege, isWrite))
- then { handle_illegal(); false }
+ then { handle_illegal(); RETIRE_FAIL }
else {
let csr_val = readCSR(csr); /* could have side-effects, so technically shouldn't perform for CSRW[I] with rd == 0 */
if isWrite then {
@@ -153,7 +153,7 @@ function clause execute CSR(csr, rs1, rd, is_imm, op) = {
writeCSR(csr, new_val)
};
X(rd) = csr_val;
- true
+ RETIRE_SUCCESS
}
}