Skip to content

Branch unit: Fix incorrect raising of misaligned exception

Created by: yaohsiaopid

This patch fixes the issue cva6#1466: the branch unit incorrectly raises exception when target address is misaligned in regardless of the type of branch (can be unconditional or conditional). According to RISC-V specificaiton p.11:

An instruction address misaligned exception is generated on a taken branch or unconditional jump if the target address is not four-byte aligned.

This patch fixes this by taking into account the type of branch and do a check on result (taken or not) when the branch is a conditional one.

Merge request reports

Loading