Skip to content

Incorrect minstret Count Increased by ECALL #245

@fly-1011

Description

@fly-1011

Bug Description:

When executing the ECALL instruction, the NutShell processor incorrectly incremented the minstret CSR.

As ECALL and EBREAK cause synchronous exceptions, they are not considered to retire, and should not increment the minstret CSR.

According to the RISC-V Privileged Specification, ECALL (and EBREAK) cause synchronous exceptions and must not be considered retired, therefore must not increment minstret.

Test program and log information: test_ecall.zip

Inconsistent information:

Image Image

Spike reports minstret = 3 DUT reports minstret = 4

This indicates that the ECALL instruction was mistakenly counted as a retired instruction.

Environment:

NutShell: commit e315a27

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