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

Unused standard parts of mie register not properly implementing read-only 0 #3610

Open
tzwaenn opened this issue Apr 9, 2024 · 1 comment

Comments

@tzwaenn
Copy link

tzwaenn commented Apr 9, 2024

Type of issue: bug report

What is the current behavior?
The mie register is currently implemented such that it is not initialized (no issue as such). However, this leads to RTL simulation traces where the first CSR instruction accessing mie reads for example 1 from bit 0 of mie (if 1 was picked as initial value) and this bit is defined as read-only 0 in chapter 3.1.9 of the privileged specification. Any actual CSR write to mie sets the unused bits to 0 and they cannot get back to 1, so subsequent CSR accesses are sure to read 0, but the initial read is still violating the "read-only 0" requirement from the privileged specification. There may be similar issues with bit 1 in other configurations (which is additionally read-only zero in case S mode is not implemented).

What is the expected behavior?
To honor the read-only zero requirement of the spec, it should be made sure that the initial CSR access to mie also returns 0 for the unused standard bits. This is handled properly for mip which has analogous read-only 0 requirements in the specification, but not for mie.

Please tell us about your environment:
The issue was found with the Questa Processor app on the generated RTL of the default configuration.

@jerryz123
Copy link
Contributor

Yes, this seems like it is indeed a bug, thanks for the report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants