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
Regression: RiscV FPU regs not saved in multithreaded applications #54205
Comments
Please re-test using the latest main branch making sure you have Also the latest main branch contains a new test: |
hi,
As said, if I can further support, let me know how - if this is board and/or CPU specific and therefore cannot be further investigated, also fine for me. I can revert to the old implementation and can try to find the reason of my port-flaw on my own. Again, I very much appreciate the work here - great OS, nice to hack around for me. bye, pottendo |
What RISC-V implementation is this? Are the MSTATUS_FS bits properly implemented? |
Hi,
The project is derived from thishttps://github.com/SpinalHDL/VexRiscvbased on LiteX. Here the branch:https://github.com/pottendo/RVCop64-pottendo
You may need to checkout the submodules to get the respective detailed Code.
But don't mess too long. I can look into it.Thx, pottendo
Am 31.01.2023 19:45 schrieb npitre ***@***.***>:
What RISC-V implementation is this?
Are the MSTATUS_FS bits properly implemented?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Alright. Since you do have access to the CPU implementation source code, I don't pretend to understand anything that I'm seeing in
So the connection between the FPU and MSTATUS_FS + CSR.MSTATUS_SD appears |
Hi,thanks,
I'll have a look.
The VexRiscv guys are also very supportive. I'm sure we'll sort this out.
All the best, pottendo
|
The VexRiscv core design was updated and confirmed to work here: |
hi,
With reference to this thread I found a regression in a test which was working in 3.2.99:
FPU registers aren't saved in this multithreaded FPU-intense application.
Find the test in my tree here
the board is a FPGA (Lattice ECP5) loaded with a 'VexRiscV-SMP' cpu all assembled with the litex framework.
See here and here
The output CPU is supposed to feature an ISA: rv32i2p0_mafdc
The FPU is working, as the program is 100x faster than building the application without FPU instructions.
Zephyr config:
and many more you find here: https://github.com/pottendo/zephyr-pottendo/blob/main/boards/riscv/orangecart/orangecart_fpu_defconfig
I've tried to select RISCV_ISA_EXT_C but this didn't make a difference.
The test-program produces part of a mandelbrot set on the console:
Bad case:
Good case - built without FPU instructions:
My program uses
k_float_enable(k_current_get(), 0)
to enable the FPU reg-saving; this was necessary in previous versions (3.2.99); from the code now in (3.3-rc1) I see that this may not be necessary any more for RiscV CPUs.Debugging into
arch/riscv/core/fpu.c
I found thatvoid z_riscv_fpu_trap(z_arch_esf_t *esf)
is never being executed. It seems that the FPU instructions used by this CPU core won't trap as needed.I use the SDK: zephyr-sdk-0.15.2 on an Ubuntu 22.10 host environment.
The test-program should be working on other suitable boards, however the bug may be specific to VexRiscV-smp CPUs.
thanks for taking care,
pottendo
PS: Big thanks for the entire Zephyr system and the community - a great project! Keep the momentum!
The text was updated successfully, but these errors were encountered: