Skip to content

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

@YorigamiChitose

Description

@YorigamiChitose

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions