Skip to content

Commit a176914

Browse files
committed
guard CSR[misa] checks
1 parent f857538 commit a176914

File tree

11 files changed

+277
-176
lines changed

11 files changed

+277
-176
lines changed

spec/std/isa/csr/cycle.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ sw_read(): |
4545
raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
4646
}
4747
} else if (mode() == PrivilegeMode::U) {
48-
if (CSR[misa].S == 1'b1) {
48+
if ((!MISA_CSR_IMPLEMENTED) || ((!MISA_CSR_IMPLEMENTED) || (CSR[misa].S == 1'b1))) {
4949
# S-mode is present ->
5050
# mcounteren and scounteren together determine access in U-mode
5151
if ((CSR[mcounteren].CY & CSR[scounteren].CY) == 1'b0) {

spec/std/isa/csr/mip.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,6 @@ sw_read(): |
411411
# OR in the hidden smode external interrupt
412412
return
413413
$bits(CSR[mip])
414-
| ((CSR[misa].S == 1'b1 && pending_smode_external_interrupt)
414+
| (((!MISA_CSR_IMPLEMENTED) || ((!MISA_CSR_IMPLEMENTED) || (CSR[misa].S == 1'b1 ))&& pending_smode_external_interrupt)
415415
? 10'h200
416416
: 0);

0 commit comments

Comments
 (0)