Skip to content

Commit 5e1f556

Browse files
committed
Raise illegal instruction if accessing PMP CSRs instead of just hardwiring zero
1 parent 4efc4bd commit 5e1f556

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cpu/worker.mlog.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2383,8 +2383,9 @@ modify_csr__read__machine:
23832383
jump modify_csr__mip equal imm 0x344 # mip
23842384

23852385
# PMP registers (unimplemented)
2386+
# the spec seems to imply these can be read-only zero if not implemented, but sail throws illegal op
23862387
jump modify_csr__read__privileged lessThan imm 0x3a0 # pmpcfg0
2387-
jump modify_csr__readonly_zero lessThanEq imm 0x3ef # pmpaddr63
2388+
jump ILLEGAL_OP lessThanEq imm 0x3ef # pmpaddr63
23882389

23892390
modify_csr__read__privileged:
23902391
# CSRs that use the same handler for supervisor- and machine-level

0 commit comments

Comments
 (0)