Skip to content

decoder.sv: fix sfence.vma when rs1 != 0

Eclipse Webmaster requested to merge github/fork/Gchauvon/fix-sfence_vma into master

Created by: Gchauvon

Hello,

Related to PR #921 and issue #876 (closed). @Phantom1003 you might want to check this.

Unlike other instructions with minor opcode == PRIV (000), SFENCE.VMA do not check for rs1 != 0. Illegal instruction happens if :

  • rd !=0
  • privilege mode not in S or M.

The solution I propose check for rd != 0 which should solved the issue raised in #876 (closed). It also reset the illegal instruction flag to 0 in case it has been raised in the if case below :

https://github.com/openhwgroup/cva6/blob/56ccf8089e80e5c7950038cad5796e50c64aa0c2/core/decoder.sv#L99-L103

Merge request reports

Loading