-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Feature] [risc-v] RISC-V 的toolchain 讨论 #10161
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
Comments
下面是当前的bsp中的RISCV的版本 riscv-none-embed-gcc:
bsp:
- gd32/risc-v/gd32vf103r-start
- gd32/risc-v/gd32vf103v-eval
- hifive1
- juicevm
- k210
- rv32m1_vega/ri5cy
- wch/risc-v/ch32v103r-evt
- wch/risc-v/ch32v208w-r0
- wch/risc-v/ch32v307v-r1
- wch/risc-v/ch569w-evt
- wch/risc-v/yd-ch32v307vct6
count: 11
download_url: https://github.com/RT-Thread/toolchains-ci/releases/download/v1.5/xpack-riscv-none-embed-gcc-8.3.0-2.3-linux-x64.tar.gz
riscv-nuclei-elf-gcc:
bsp:
- nuclei/gd32vf103_rvstar
- nuclei/nuclei_fpga_eval
count: 2
riscv32-esp-elf-gcc:
bsp:
- ESP32_C3
count: 1
download_url: https://github.com/espressif/crosstool-NG/releases/download/esp-2022r1-RC1/riscv32-esp-elf-gcc11_2_0-esp-2022r1-RC1-linux-amd64.tar.xz
riscv32-unknown-elf-gcc:
bsp:
- core-v-mcu/core-v-cv32e40p
- hpmicro/hpm5300evk
- hpmicro/hpm5301evklite
- hpmicro/hpm6200evk
- hpmicro/hpm6300evk
- hpmicro/hpm6750evk
- hpmicro/hpm6750evk2
- hpmicro/hpm6750evkmini
- hpmicro/hpm6800evk
count: 9
download_url: https://github.com/hpmicro/riscv-gnu-toolchain/releases/download/2022.05.15/riscv32-unknown-elf-newlib-multilib_2022.05.15_linux.tar.gz
riscv64-unknown-elf-gcc:
bsp:
- bluetrum/ab32vg1-ab-prougen
- bouffalo_lab/bl60x
- bouffalo_lab/bl61x
- bouffalo_lab/bl70x
- bouffalo_lab/bl808/lp
- bouffalo_lab/bl808/m0
- cvitek/c906_little
- cvitek/cv18xx_risc-v
- qemu-virt64-riscv
- sparkfun-redv
- thead-smart
count: 11
download_url: https://github.com/RT-Thread/toolchains-ci/releases/download/v1.4/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz
riscv64-unknown-linux-musl-gcc:
bsp:
- allwinner/d1
- allwinner/d1s
- bouffalo_lab/bl808/d0
count: 3 |
字段含义: |
统一来看 支持的arch架构:
|
https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases
|
这个议题是不是没有考虑 RT-smart 的情况? |
是的,这块我没有接触。有经验的也可以讨论。给出一些参考。 |
补充一些我这边维护比较多的 riscv 相关 bsp 使用的 toolchain 信息(包括了 RT-standard 和 RT-smart): cvitek(milkv-duo 系列): https://github.com/RT-Thread/rt-thread/blob/master/bsp/cvitek/README.md#41-toolchain-%E4%B8%8B%E8%BD%BD 另外,我一直在跟踪的 riscv 工具链不统一的问题,提的相关 issue:
感觉推动很困难,拖了很长时间了。 |
嗯,标准版理论上应该可以用官方的。下面的链接对于RISCV64和RISCV32都是兼容的 |
SMART 版本可以尝试下下面的链接: |
这个估计不行,rt-smart 用的 musl gcc 听说是定制了 rtt 自己的什么东西,具体要问睿赛德了。 |
但是要注意类似 duo 这些使用的 c906 里的 cpu core 上会用到一些 vendor 自己的扩展,譬如 v-ext v0.7, 这些 gcc 主线不一定支持的,所以说还不能完全确定。 |
应该是的,musl libc库是定制过的,前几天我刚问过 |
嗯,首先确定的是: |
标准版就是当前仓库版本倒是可以统一用一个,当然也不是强制的,只是当大家不知道用哪款toolchain的时候,给一个统一的建议。当然也有一些特殊的指令拓展像c906,大家也可以把遇到的不能用的也列出来。 |
smart工具链可另看。 riscv的工具链问题确实头大,开源的ISA,然后工具链一堆的发散,收敛不了,很头疼,我在公开场合也提到过…… |
xPack的Toolchain通过以下方式来保证与其他开发工具的兼容性:
|
https://releases.linaro.org/components/toolchain/binaries/ 最后2019年12月,已经没有继续更新了 |
HPMicro用的toolchain是基于标准的riscv-gnu-toolchain仓库编译出来的,只包含了RV32系列的,是xpack版本的子集,理论上可以换成xpack版本的。https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/tag/v14.2.0-3 这个似乎是最新的GCC14.x版本的 |
wch对mrs的toolchain写的编译选项,换成xpack可能会有点问题。。。快速中断和代码压缩啥的。不过目前看来似乎并不影响编译。 可以参考 |
hpm的用xpack的问题不大,hslink项目都在用 |
zephyr 的toolchain,也只用了一种RISCV64的toolchain,兼容RISCV32:
|
RISC-V指令集由“基本指令集(I) + 扩展指令集(E)”组成。 基本指令(I)集是必选的,扩展指令集(E)是可选的。意思就是可以根据你的实际需求,选择需要使用的指令。例如在一个项目中,如果不需要用到压缩指令,那么就不需要把压缩指令添加进来,从而做到定制化,这也是RISC-V的一大特点。 RISC-V 指令集有 RV32I、RV32E、RV64I、RV64E、RV64I 等等。 RV 代表 RISC-V,32/64 代表 32 位或 64 位,I 和 E 都是基本指令集,在 I 和 E 的基础上,可以添加 D(双精度浮点扩展)、M(整数乘除法)、A(原子扩展)、C(压缩扩展)等扩展指令。 例如,在 RV64I 基础上,添加原子、整数乘除法、双精度浮点、压缩指令,则该指令集称为 RV64IMADC。 |
基本指令集 标准扩充指令集 https://riscv-rtthread-programming-manual.readthedocs.io/zh-cn/latest/zh_CN/1.html#id2 |
https://toolchains.bootlin.com/ 这个平台提供toolchain都是基于linux的 |
Describe problem solved by the proposed feature
目前RISC-V的toolchain版本比较多,这里加一些讨论,讨论哪些toolchain版本是比较通用和官方的,方便后续RISC-V平台整理和使用比较统一的版本。
大家可以提供一些自己常用的RISCV的toolchain的下载路径和RISCV平台的详细信息。
Describe your preferred solution
No response
Describe possible alternatives
No response
The text was updated successfully, but these errors were encountered: