Skip to content

关于NEMU和NutShell的pmpaddr对齐问题 #868

@LuLuji04

Description

@LuLuji04

Describe the bug

当使用NEMU作为NutShell的参考时,由于NutShell未实现 pmpaddr4-15,NutShell抛出了非法指令异常,但是NEMU却没有触发异常。

这是NutShell的运行log
Image
这是二者的差异,由于NEMU没有触发异常,其mepc没有更新
Image

Expected behavior

当使用NEMU作为NutShell的参考时,由于NutShell未实现 pmpaddr4-15,NEMU应该在 M-mode 下访问该 CSR 应抛出非法指令异常。

To Reproduce

在NEMU中编译

make riscv64-nutshell-ref_defconfig
make -j

在NutShell中运行以下程序test.zip,以刚编译的NEMU为参照

./build/emu -i /<path-to>/test/build/test-riscv64-nutshell.bin  --diff /<path-to>/NEMU/build/riscv64-nemu-interpreter-so

Environment

  • NutShell branch: master
  • NutShell commit id: fc12171d929e7e589fab9f794ab63ce12e6c594e
  • NEMU commit id: 4a24b77

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions