Skip to content

Get error messages from c_emulator? #25

Description

I'm running test cases randomly generated by Google's riscv-dv on the sail-riscv c_emulator model.

It runs a few thousand instructions and then dies:

[2399] [M]: 0x00000000800016BC (0x1D73222F) sc.w.aq tp, t1, s7
Sail exception!Exiting due to uncaught exception

How can I tell what this "uncaught exception" is referring to? I can't find anything in the c_emulator/* that would tell me anything more than have_exception.

When I run the same code on the ocaml emulator, I see:

[2399] [M]: 0x00000000800016BC (0x1D73222F) sc.w.aq tp, t1, s7
reservation: 0x000000008001E000, key=0x000000008001E000

Error: Not implemented: sc.aq

Which is a nice clear error message.

How can I find that same message when running the C model?

I see this struct zexception in the generated C code, but I'm not sure how I can access that struct from within riscv_sim.c. That struct is not defined in any header file, and since riscv_sim.c is compiled separately, it can't see it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions