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

[rtl] Implement cycle/instret/time/hmpcountern CSRs #1973

Open
GregAC opened this issue Jan 19, 2023 · 3 comments
Open

[rtl] Implement cycle/instret/time/hmpcountern CSRs #1973

GregAC opened this issue Jan 19, 2023 · 3 comments

Comments

@GregAC
Copy link
Contributor

GregAC commented Jan 19, 2023

The cycle/instret/time/hmpcountern CSRs are optionally accessible from U-mode. In Ibex we hardwire mcounteren to 0 meaning these counters cannot be accessed from U-mode. However they are still accessible from M-mode. Ibex currently doesn't implement them at all which isn't standards compliant. They should be implemented.

@GregAC GregAC added the Type:Bug Bugs label Jan 19, 2023
@GregAC GregAC added this to the D3 milestone Jan 19, 2023
@GregAC GregAC added the Component:RTL RTL issue label Jan 19, 2023
@GregAC
Copy link
Contributor Author

GregAC commented Jan 19, 2023

Additional reads of these should be stimulated in DV and coverage added

@GregAC
Copy link
Contributor Author

GregAC commented Jan 19, 2023

I have asked the riscv-privileged list if my understanding here is correct but it looks pretty clear from the spec and the fact the compliance tests specifically test accessing these CSRs from M mode.

@GregAC GregAC modified the milestones: D3, OT-M2.5 Feb 27, 2023
@GregAC
Copy link
Contributor Author

GregAC commented Mar 23, 2023

After some further digging there's an argument you don't need to implement these going by the latest spec draft, if you don't implement Zicntr (which we don't currently). I'm going to push this out of M2.5 due to this ambiguity. Solution here is likely to implement Zicntr.

@GregAC GregAC removed this from the OT-M2.5 milestone Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant