[BUG] SBE/UBE/MBE Bit in mstatus
Register Does Not Affect Endianness of Explicit Memory Accesses
#2695
Labels
Type:Bug
For bugs in the RTL, Documentation, Verification environment or Tool and Build system
Is there an existing CVA6 bug for this?
Bug Description
According to the RISC-V ISA specification, the MBE, SBE, and UBE bits in the mstatus and mstatush registers control the endianness of memory accesses, except for instruction fetches, which are always little-endian. Specifically:
However, on the CVA6 core, setting the MBE bit in mstatus does not affect the expected behavior of explicit load and store operations. Specifically, even when the MBE bit is manipulated (by clearing or setting it), the endianness of the subsequent sw (store word) and lb (load byte) instructions is not affected as expected.
Code for Reproducing the Bug:
Expected Behavior:
When the MBE bit in mstatus is cleared or set, the endianness of memory accesses (explicit loads and stores) should change accordingly. Specifically, the sw (store word) and lb (load byte) instructions should behave as expected with the appropriate endianness (little-endian when MBE=0, big-endian when MBE=1).
Observed Behavior:
When manipulating the MBE bit in mstatus, the endianness of memory accesses is not affected, and the behavior of sw and lb instructions does not change as expected.
CVA6 commit: 2155d0e
Build config:
cv64a6_imafdch_sv39_wb
The text was updated successfully, but these errors were encountered: