benchmarks in riscv-tests fail to run on gem5

Description

benchmarks in riscv-tests riscv-tests available in gem5-resources crash with an "illegal instruction" exception when run in gem5 in SE or FS mode.

I have observed that this is caused by an attempt to read mstatus directly when program is running in u-mode. Basically, it seems like the riscv-tests do not support Linux abi and are intended to be run on a simulator like spike which takes care of skipping over instructions which cause such exceptions.

Environment

None

Activity

Show:
Ayaz Akram
March 29, 2021, 10:13 PM

Things to do based on gem5 meeting:

  • Drop “RISCV-tests” on resources.

  • Incorporate RISCV-compliance tests ( )

  • riscv asm tests can be used for testing at the moment

Jason Lowe-Power
March 24, 2021, 4:46 PM

hmm… maybe we need to update our testing strategy for RISC-V. It would be nice if we could use similar compliance tests as upstream RISC-V. It would give us some confidence that we’ve correctly implemented RISC-V.

If resources/riscv-tests isn’t working, we should probably remove it from the resources.

Peter Yuen
March 24, 2021, 6:49 AM

Yes, I recall getting Illegal Instruction error also if I directly compile the benchmarks from “riscv/riscv-tests”. I can only run the tests under the modified “https://gem5.googlesource.com/public/gem5-resources/+/refs/heads/stable/src/asmtest”.

Ayaz Akram
March 23, 2021, 3:47 AM

Hi Peter, thanks for the comment. I wonder if you also ran the [benchmarks| ] in riscv-tests? I think I ran few asm tests earlier and they seemed to work fine for me as well.

Peter Yuen
March 23, 2021, 3:33 AM
Edited

Hi Ayaz, I ran riscv-tests in SE mode recently (only asm tests) and they seem to work fine for me. If it is a related issue maybe we can discuss about it.

Assignee

Unassigned

Reporter

Ayaz Akram

Priority

Medium

Components