NEMU貌似没有为riscv32e单独配置一个完整的环境
- nemu缺少
configs/riscv32e-am_defconfig
- 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'
临时解决方法
- 添加
configs/riscv32e-am_defconfig
CONFIG_RVE=y
CONFIG_TARGET_AM=y
# CONFIG_TRACE is not set
CONFIG_MSIZE=0x2000000
CONFIG_DEVICE=y
- 在
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).bin为IMG=$(NEMU_HOME)/build/$(ISA_NEMU)-nemu-interpreter-$(ARCH).bin
另一个小问题/建议
nemu中有可能会使用64位数的位移运算,编译成rv32版本时会出现找不到__lshrdi3与__ashldi3的错误。感觉可以把这两个函数实现放到klib里,防止有人跟我一样踩这个坑。要是本来就是个坑当我没说(doge)
NEMU貌似没有为riscv32e单独配置一个完整的环境
configs/riscv32e-am_defconfigriscv32-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'临时解决方法
configs/riscv32e-am_defconfigam-kernels/kernels/nemu/Makefile中添加并修改16行
IMG=$(NEMU_HOME)/build/$(ISA)-nemu-interpreter-$(ARCH).bin为IMG=$(NEMU_HOME)/build/$(ISA_NEMU)-nemu-interpreter-$(ARCH).bin另一个小问题/建议
nemu中有可能会使用64位数的位移运算,编译成rv32版本时会出现找不到
__lshrdi3与__ashldi3的错误。感觉可以把这两个函数实现放到klib里,防止有人跟我一样踩这个坑。要是本来就是个坑当我没说(doge)