Nuclei-Software/nuclei-studio

How to pass extra risc-v ISA like b/p/k/v in Nuclei Studio or Nuclei SDK.

fanghuaqi opened this issue · 0 comments

In RISC-V Compiler option, -march option is used to pass your desired RISC-V ISA, see https://gcc.gnu.org/onlinedocs/gcc/RISC-V-Options.html

For the normal imafdc ISA, you can pass it as usual, such as -march=rv32imafdc or -march=rv64imafdc, but from Nuclei RISC-V GCC 13, if you want to pass extra ISA not in normal imafdc, you may need to specify it using multi-letter ISA string.

e.g.

If you want to use b extension with rv32imafdc, you need to pass -march=rv32imafdc_zba_zbb_zbc_zbs.

In our Nuclei SDK, we defined a Makefile variable used in command line called ARCH_EXT to pass this extra ISA besides CORE defined normal ISA, see https://doc.nucleisys.com/nuclei_sdk/develop/buildsystem.html#arch-ext for details(Please click it and read it carefully).

If you want to set it in Nuclei Studio, when you create project using Nuclei SDK NPK >= 0.5.0, you can set Nuclei ARCH Extensions to _zba_zbb_zbc_zbs, and select Nuclei RISC-V Core to represent the correct base cpu isa.

WARNING don't put ARCH_EXT=_zba_zbb_zbc_zbs like string in IDE, it is only used in Nuclei SDK command line mode, instead of it, you should put _zba_zbb_zbc_zbs like string.

For ISA using Zc*, just select base cpu isa with c in it, and pass _zc* like isa string in Nuclei ARCH Extensions

image

If you forget to set extra isa string during project creation, you can change it using Nuclei Settings

image

Or you can change it in Project Properties like below:

image