Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempts to access a non-existent CSR don't raise illegal instruction exceptions #38

Open
mmxsrup opened this issue Mar 11, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@mmxsrup
Copy link
Contributor

mmxsrup commented Mar 11, 2021

Observed Behavior

An illegal instruction exception should be raised when accessing a non-existent CSR, as described in Chapter 3.6.1 of RISC-V Privileged Architectures.

Attempts to access a non-existent CSR raise an illegal instruction exception.

For example, csrr t0, 0x394 is a instruction to access a CSR with address 0x394 that does not exist.

Therefore, this instruction should raise an illegal instruction exception, but in the current RSD, this instruction is executed normally without raising an illegal instruction exception. This issue applies to other CSRs as well.

Steps to reproduce the issue

When executing an instruction that accesses a non-existent CSR, as shown in the following code, you can confirm that the illegal instruction executes normally without raising an illegal instruction exception.

int main(void){
    asm volatile ("csrr t0, 0x394");
}
@mmxsrup mmxsrup added the bug Something isn't working label Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant