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

am-kernels/kernels/nemu在使用riscv32e时出错 #99

Open
YorigamiChitose opened this issue Jun 23, 2024 · 1 comment
Open

am-kernels/kernels/nemu在使用riscv32e时出错 #99

YorigamiChitose opened this issue Jun 23, 2024 · 1 comment

Comments

@YorigamiChitose
Copy link

NEMU貌似没有为riscv32e单独配置一个完整的环境

  1. nemu缺少configs/riscv32e-am_defconfig
  2. menuconfig配置RVE选项,编译结果依然为riscv32-nemu-interpreter,在riscv32e情况下会使am-kernels/kernels/nemu编译出riscv32-nemu-interpreter-riscv32e-nemu然后出现如下报错
Can not open '/***/ysyx-workbench/nemu/build/riscv32e-nemu-interpreter-riscv32e-nemu.bin'

临时解决方法

  1. 添加configs/riscv32e-am_defconfig
CONFIG_RVE=y
CONFIG_TARGET_AM=y
# CONFIG_TRACE is not set
CONFIG_MSIZE=0x2000000
CONFIG_DEVICE=y
  1. am-kernels/kernels/nemu/Makefile中添加
ifeq ($(ISA), riscv32e)
	ISA_NEMU = riscv32
else
	ISA_NEMU = $(ISA)
endif

并修改16行IMG=$(NEMU_HOME)/build/$(ISA)-nemu-interpreter-$(ARCH).binIMG=$(NEMU_HOME)/build/$(ISA_NEMU)-nemu-interpreter-$(ARCH).bin

另一个小问题/建议

nemu中有可能会使用64位数的位移运算,编译成rv32版本时会出现找不到__lshrdi3__ashldi3的错误。感觉可以把这两个函数实现放到klib里,防止有人跟我一样踩这个坑。要是本来就是个坑当我没说(doge)

@YorigamiChitose YorigamiChitose closed this as not planned Won't fix, can't repro, duplicate, stale Sep 3, 2024
@sashimi-yzh sashimi-yzh reopened this Sep 3, 2024
@sashimi-yzh
Copy link
Contributor

我有时间再修复这个问题, 先让issue保留打开状态

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

2 participants