Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Illegal Instruction Exception not Raised - FS Field #170

Closed
shetalani opened this issue Sep 27, 2019 · 4 comments
Closed

Illegal Instruction Exception not Raised - FS Field #170

shetalani opened this issue Sep 27, 2019 · 4 comments
Assignees
Labels
Component:RTL For issues in the RTL (e.g. for files in the rtl directory) Good First Issue Good first issue to work on if you want to contribute PARAM:FPU Issue depends on the FPU parameter Status:Resolved Issue has been resolved, but closure is pending on git merge and/or issuer confirmation Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system

Comments

@shetalani
Copy link

RISC-V Specification:

  • "The FS field encodes the status of the floating-point unit, including the CSR fcsr and floating-point data registers f0–f31"
  • "In systems that do not implement S-mode and do not have a floating-point unit, the FS field is hardwired to zero."
  • "When an extension’s status is set to Off, any instruction that attempts to read or write the corresponding state will cause an illegal instruction exception."

Issue Description:

Accessing the F-extension CSRs / floating-point data registers f0–f31 while the FS field of MSTATUS is set to OFF doesn't raise an illegal instruction exception.

Example:

As shown below, the instruction 32'h23aaf3 (csrrs x21, frm, x7) is decoded at time point t##0, while FS field is set to OFF, with no illegal instruction being flagged, as illegal_insn_dec is de-asserted.

issue_9


Product: OneSpin 360 DV-Verify
App: RVV
Tool's version: 2019.2.2

@stmach stmach assigned davideschiavone and unassigned stmach Oct 8, 2019
@Silabs-ArjanB Silabs-ArjanB added Component:RTL For issues in the RTL (e.g. for files in the rtl directory) PARAM:FPU Issue depends on the FPU parameter Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system Good First Issue Good first issue to work on if you want to contribute labels Jul 13, 2020
@EkanshBhatnagar
Copy link

Can I tackle this bug ?

@davideschiavone
Copy link
Contributor

hi @EkanshBhatnagar , of course you can, everyone can :) thanks, please synchronize with @pascalgouedo

@pascalgouedo
Copy link

Hi,
After some CV32E40P RTL analysis, here is the status:

  • FS (and SD) are always hardwired to 0 even when FPU = 1

After some RISC-V spec analysis, here are some remarks:

  • If no S-Mode and FPU = 0 (v1 tag case), F-extension CSRs / f0–f31 registers read/write accesses and FS field write access should raise illegal exception => agreed.
  • If no S-Mode and FPU = 1 (will be v2 tag case), FS should be writeable by csr instruction and modifiable to Dirty when F-extension CSRs / f0–f31 registers are written/updated => Not done in present v1 RTL. New issue to create.

pascalgouedo pushed a commit to pascalgouedo/cv32e40p that referenced this issue Apr 19, 2023
Added MSTATUS.FS and SD and all their control.
Added fs_off_o for instructions decoder to generate illegal instructions when FS is OFF.

Signed-off-by: Pascal Gouedo <[email protected]>
pascalgouedo pushed a commit to pascalgouedo/cv32e40p that referenced this issue Apr 21, 2023
Added MSTATUS.FS and SD and all their control.
Added fs_off_o for instructions decoder to generate illegal instructions when FS is OFF.

Signed-off-by: Pascal Gouedo <[email protected]>
pascalgouedo pushed a commit to pascalgouedo/cv32e40p that referenced this issue Apr 28, 2023
Added MSTATUS.FS and SD and all their control.
Added fs_off_o for instructions decoder to generate illegal instructions when FS is OFF.

Signed-off-by: Pascal Gouedo <[email protected]>
pascalgouedo pushed a commit to pascalgouedo/cv32e40p that referenced this issue Jun 23, 2023
@pascalgouedo
Copy link

Resolved with PR #801

@pascalgouedo pascalgouedo added the Status:Resolved Issue has been resolved, but closure is pending on git merge and/or issuer confirmation label Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component:RTL For issues in the RTL (e.g. for files in the rtl directory) Good First Issue Good first issue to work on if you want to contribute PARAM:FPU Issue depends on the FPU parameter Status:Resolved Issue has been resolved, but closure is pending on git merge and/or issuer confirmation Type:Bug For bugs in the RTL, Documentation, Verification environment or Tool and Build system
Projects
None yet
Development

No branches or pull requests

6 participants