Skip to content

Can "mcontrol execute address before" trigger ever fire on an ECALL instruction? #1159

@Silabs-ArjanB

Description

@Silabs-ArjanB

Hi,

The "Version 1.0, Revised 2025-02-21: Ratified" version of the RISC-V Debug Specification states the following about the mcontrol timing field:

0 (before): The action for this trigger will be taken just before the instruction that triggered it is retired, but after all preceding instructions are retired. xepc or dpc (depending on action) must be set to the virtual address of the instruction that matched.

Certain instructions (e.g., ECALL) can never retire as per definition in the RISC-V Privileged specification. Therefore, if we take the above literally, an "mcontrol execute address before" trigger that matches the execute address of an ECALL instruction will never fire.

Is that really the intention of the above definition of before timing? Should it maybe be reworded to something like "just before the instruction that triggered it is retired or traps?

Best regards,
Arjan

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