Skip to content

Commit

Permalink
Added a condition so that new Zfinx CSR only present when COREV_PULP = 1
Browse files Browse the repository at this point in the history
Signed-off-by: Pascal Gouedo <pascal.gouedo@dolphin.fr>
  • Loading branch information
Pascal Gouedo committed Jun 26, 2023
1 parent 34f55d8 commit 37b43ac
Showing 1 changed file with 155 additions and 154 deletions.
Loading

3 comments on commit 37b43ac

@jstraus59
Copy link

@jstraus59 jstraus59 commented on 37b43ac Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure this is correct at line 1709:
(FPU = 0 | (FPU = 1 & ZFINX = 1))
Why would the zfinx CSR register exist when the FPU is not present, but not exist when the FPU is present but without ZFINX???

This register exists to tell software that uses the FPU whether it has ZFINX or not, so would only be checked if FPU=1.

(FPU=1 && ZFINX=1) appears to be the expression for the value of bit 0 in the register, not for whether the register is present.

@pascalgouedo
Copy link

@pascalgouedo pascalgouedo commented on 37b43ac Jun 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jstraus59
Here is a summary of what sees the software when looking at MISA.F which is the only information it can have using RISC-V defined CSRs (remember that software does not have access to RTL parameter values):

FPU ZFINX MISA.F Zfinx presence and value
0 0 0 0
0 1 Not possible Not possible
1 0 1 No present
1 1 0 1

So from software point of view you need to discriminate when MISA.F = 0.
Without new Zfinx CSR implemented in CV32E40Pv2, there is no way to discriminate (!FPU & !ZFINX) and (FPU & ZFINX).

So for SW, first read MISA.F:
If 1 then ok F standard extension.
If 0 look at Zfinx CSR.
If 1 then Zfinx standard extension.
If 0 then no Floating Point support ...

@jstraus59
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation. I had not realized misa.F == 0 when Zfinx is 1.

Another way to think about it is The zfinx CSR is NOT implemented when FPU is implemented but Zfinx is not, as misa.F == 1 indicates that the FPRs are used by the FPU

Please sign in to comment.