riscv-qemu icon indicating copy to clipboard operation
riscv-qemu copied to clipboard

RV64 mstatus/status: SXL and UXL are not correctly implemented

Open vsiles opened this issue 6 years ago • 2 comments

Hi ! The misa register correctly provides the value of MXL, but the mstatus/sstatus register do not provide a valid value for the SXL and UXL bits (which are always returned as 0). For example, the documentation states that:

For RV64 and RV128 systems, if S-mode is not supported, then SXL is hardwired to zero. Other-
wise, it is a WARL field that encodes the current value of S-XLEN. In particular, the implemen-
tation may hardwire SXL so that S-XLEN = M-XLEN.

In the case of the sifive_u machine, where Supervisor mode is implemented, 0 is incorrect. Hard-wiring it MXL seems a good option to have a legal value for the time being.

vsiles avatar Apr 30 '18 08:04 vsiles

Thanks for the bug report. Will look into this...

michaeljclark avatar May 08 '18 21:05 michaeljclark

SXL and UXL are not implemented at all.

michaeljclark avatar May 09 '18 23:05 michaeljclark