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

The vector unit seems disabled #3

Open
mp-17 opened this issue Nov 5, 2021 · 9 comments
Open

The vector unit seems disabled #3

mp-17 opened this issue Nov 5, 2021 · 9 comments

Comments

@mp-17
Copy link

mp-17 commented Nov 5, 2021

It seems that critical signals relative to the vector unit are hardcoded to zero.
Some examples:

  1. The VS bits in mstatus
    https://github.com/T-head-Semi/openc906/blob/main/C906_RTL_FACTORY/gen_rtl/cp0/rtl/aq_cp0_trap_csr.v#L505
  2. Decoder signals
    https://github.com/T-head-Semi/openc906/blob/main/C906_RTL_FACTORY/gen_rtl/idu/rtl/aq_idu_id_decd.v#L1011
    https://github.com/T-head-Semi/openc906/blob/main/C906_RTL_FACTORY/gen_rtl/idu/rtl/aq_idu_id_decd.v#L934
    https://github.com/T-head-Semi/openc906/blob/main/C906_RTL_FACTORY/gen_rtl/idu/rtl/aq_idu_id_decd.v#L3740

I tried to run some vector code, but it always triggers exceptions on the vector instructions (if I fix some of the hardcoded values, the exception is generated by some other disabled signals). This makes me think that the code was generated with incorrect settings, or that this version of the processor simply does not support the V extension. Can this be the case? If yes, are there any plans to open-source it?

Thanks a lot,
Matteo

@CaffreyCC
Copy link

Yes, openC906 didn't include the V extension because it wasn't officially final yet. In the future, we will open-source it the time is ripe.

@mp-17
Copy link
Author

mp-17 commented Mar 15, 2022

Hello @CaffreyCC, thanks a lot for the information!
Is this true also for the RISC-V physical boards with C906? I bought one, but I cannot enable the V extension.

@PhilippvK
Copy link

@mp-17 I have an Sipeed Lichee RV D1 board with a C906 and was able to use the vector unit. However it only support RVV v0.7, so you can not use more recent toolchains to work with the vector instructions.

@mp-17
Copy link
Author

mp-17 commented Mar 21, 2022

Thanks a lot, @PhilippvK. I have the Nezha board, and the V extension seems disabled by default. I cannot modify the machine/supervisor CSRs to enable it either since the board runs Linux and my applications are kept in U mode.

@PhilippvK
Copy link

@mp-17 I also had similar issues running Linux. I had to build baremetal programs to make use of the vector extension. I am not sure if this would somehow be possible from an OS.

Reference: https://github.com/bigmagic123/d1-nezha-baremeta/tree/main/src/2.vector_example

@mp-17
Copy link
Author

mp-17 commented Mar 21, 2022

This is really useful, I will try it. Thank you.
I also tried to build a kernel module to modify the CSR settings in supervisor mode but did not find the correct headers to build kernel modules for the native Linux distro on the board. It would be quite useful to have something like this. If I make it, I will upload it.

@mp-17
Copy link
Author

mp-17 commented Mar 21, 2022

So, just to understand: you booted the board in a baremetal environment taking the material from this repo, right?

@PhilippvK
Copy link

PhilippvK commented Mar 21, 2022

@mp-17 Not exactly. I put together code from multiple sources also including the relevant parts for uboot/xfel/mksunxi. However I am unfortunately unable to publish the project in its current stage. Sorry for that.

@mp-17
Copy link
Author

mp-17 commented Mar 30, 2022

No problems, thank you very much for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants