You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The RISC-V specification in Section 16.5 clearly states that
C.ADDI4SPN is only valid when nzuimm=0; the code points with nzuimm=0 are reserved.
the C.ADDI4SPN instruction is only valid when nzuimm!=0, with the code points where nzuimm=0 being reserved, implying that executing C.ADDI4SPN with nzuimm=0 should result in an illegal instruction exception. While the SPIKE simulator correctly implements this behavior by throwing an illegal instruction exception, the NutShell processor implementation deviates from this specification by executing c.addi4spn a2, sp, 0 without any errors, thereby failing to comply with the RISC-V standards.
To Reproduce
On the NutShell processor, compile and run a RISC-V assembly program containing the instruction c.addi4spn a2, sp, 0.
Observe that the instruction executes successfully, which is contrary to the expected behavior as per the RISC-V specification.
Expected behavior
Per the RISC-V specification, attempting to execute C.ADDI4SPN with nzuimm=0 should result in an illegal instruction exception. The expected behavior for both SPIKE and NutShell is to reject the execution of c.addi4spn a2, sp, 0 by throwing an illegal instruction exception, maintaining consistency with the RISC-V ISA specification and ensuring that reserved code points are not executed.
Describe the bug
The RISC-V specification in Section 16.5 clearly states that
the
C.ADDI4SPN
instruction is only valid when nzuimm!=0, with the code points where nzuimm=0 being reserved, implying that executingC.ADDI4SPN
with nzuimm=0 should result in an illegal instruction exception. While the SPIKE simulator correctly implements this behavior by throwing an illegal instruction exception, the NutShell processor implementation deviates from this specification by executingc.addi4spn a2, sp, 0
without any errors, thereby failing to comply with the RISC-V standards.To Reproduce
c.addi4spn a2, sp, 0.
Expected behavior
Per the RISC-V specification, attempting to execute
C.ADDI4SPN
with nzuimm=0 should result in an illegal instruction exception. The expected behavior for both SPIKE and NutShell is to reject the execution ofc.addi4spn a2, sp, 0
by throwing an illegal instruction exception, maintaining consistency with the RISC-V ISA specification and ensuring that reserved code points are not executed.Screenshots
Environment (optional, if necessary):
OS: Ubuntu 22.04.3 LTS
Compiler: gcc 11.4.0
Additional context
None
The text was updated successfully, but these errors were encountered: