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

add support for mcountinhibit CSR #1796

Merged
merged 1 commit into from
Sep 11, 2024

Conversation

cyyself
Copy link
Contributor

@cyyself cyyself commented Sep 1, 2024

We hardwired mcountinihibit to 0 previously. Now, we implemented it.

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't edit encoding.h directly, as this is an auto-generated file from https://github.com/riscv/riscv-opcodes

Note also when you update encoding.h over there, you should use 1U rather than 1ULL for these constants, which will minimize friction when using them in places where the underlying datatype is not long long. After all, they are very small numbers.

Otherwise, the changes LGTM.

We hardwired mcountinihibit to 0 previously. Now, we implemented it.

Signed-off-by: Yangyu Chen <[email protected]>
@cyyself
Copy link
Contributor Author

cyyself commented Sep 5, 2024

Please don't edit encoding.h directly, as this is an auto-generated file from https://github.com/riscv/riscv-opcodes

Fixed.

Note also when you update encoding.h over there, you should use 1U rather than 1ULL for these constants, which will minimize friction when using them in places where the underlying datatype is not long long. After all, they are very small numbers.

Fixed. I checked the ISA spec. The mcounteren and mcountinhibit are 32-bit wide CSR, so using 1U is enough.

Otherwise, the changes LGTM.

Thanks!

Copy link
Collaborator

@aswaterman aswaterman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM now, thanks for the contribution.

@cyyself
Copy link
Contributor Author

cyyself commented Sep 11, 2024

Is this PR ready to merge?

@aswaterman
Copy link
Collaborator

Yes, thanks for the ping.

@aswaterman aswaterman merged commit 2e816f2 into riscv-software-src:master Sep 11, 2024
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants