Skip to content

[BUG] Misaligned store exceptions are reported with the wrong scause code.

Is there an existing CVA6 bug for this?

  • I have searched the existing bug issues

Bug Description

Problem

  • Executing hsv.d x13, 0(x12) with x12 = 0x8fffffc4 (8-byte misaligned) should raise scause 0x6 (Store/AMO address misaligned).
  • CVA6 instead reports scause 0x5, so the misaligned store trap is mis-encoded.

Reproduction

  1. Run the following snippet on CVA6 and on Spike (reference core). Ensure the trap handler writes scause to a GPR (e.g., x17) for observation.
    li x12, 0x8fffffc4
    li x13, 0xffffffff99257d63
    hsv.d x13, 0(x12)
  2. After the trap, read back the recorded scause.
  3. Spike reports 0x6, while CVA6 reports 0x5, demonstrating the incorrect encoding of the misaligned store exception.