[cva6_mmu]: always latch misaligned load/store exceptions (#2976)

Prior to this change, the MMU only captured LSU misalignment faults when
Hypervisor extensions (RVH) were enabled. If RVH was disabled, misaligned
loads/stores would silently bypass exception handling, violating the
RISC-V privilege spec. This patch moves the [misaligned_ex_q] update
outside the (RVH) guard so that misaligned exceptions are always registered
and prioritized over translation.

Fixes rv32mi-ma_addr & rv32i-I-MISALIGN_LDST_01 tests.
This commit is contained in:
Bill94l 2025-05-22 07:23:26 +02:00 committed by GitHub
parent c39333bdac
commit 94dfdb008b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -749,13 +749,13 @@ module cva6_mmu
dtlb_hit_q <= dtlb_hit_n;
lsu_is_store_q <= lsu_is_store_n;
dtlb_is_page_q <= dtlb_is_page_n;
misaligned_ex_q <= misaligned_ex_n;
if (CVA6Cfg.RVH) begin
lsu_tinst_q <= lsu_tinst_n;
hs_ld_st_inst_q <= hs_ld_st_inst_n;
dtlb_gpte_q <= dtlb_gpte_n;
lsu_gpaddr_q <= lsu_gpaddr_n;
misaligned_ex_q <= misaligned_ex_n;
end
end
end