Skip to content

Commit d5051d1

Browse files
authored
fix: use VS field when updating mstatus.VS (#999)
The mstatus.VS field was incorrectly written with the value of the FS field from a CSR write. Update it to use the VS field as expected. Signed-off-by: Jordan Carlin <[email protected]>
1 parent 6e1eee9 commit d5051d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spec/std/isa/csr/mstatus.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,13 +476,13 @@ fields:
476476
}
477477
sw_write(csr_value): |
478478
if (CSR[misa].V == 1'b1){
479-
return ary_includes?<$array_size(MSTATUS_VS_LEGAL_VALUES), 2>(MSTATUS_VS_LEGAL_VALUES, csr_value.FS) ? csr_value.FS : UNDEFINED_LEGAL_DETERMINISTIC;
479+
return ary_includes?<$array_size(MSTATUS_VS_LEGAL_VALUES), 2>(MSTATUS_VS_LEGAL_VALUES, csr_value.VS) ? csr_value.VS : UNDEFINED_LEGAL_DETERMINISTIC;
480480
} else if ((CSR[misa].S == 1'b0) && (CSR[misa].V == 1'b0)) {
481481
# must be read-only-0
482482
return 0;
483483
} else {
484484
# there will be no hardware update in this case because we know the V extension isn't implemented
485-
return ary_includes?<$array_size(MSTATUS_VS_LEGAL_VALUES), 2>(MSTATUS_VS_LEGAL_VALUES, csr_value.FS) ? csr_value.FS : UNDEFINED_LEGAL_DETERMINISTIC;
485+
return ary_includes?<$array_size(MSTATUS_VS_LEGAL_VALUES), 2>(MSTATUS_VS_LEGAL_VALUES, csr_value.VS) ? csr_value.VS : UNDEFINED_LEGAL_DETERMINISTIC;
486486
}
487487
SPP:
488488
location: 8

0 commit comments

Comments
 (0)