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 Smcntrpmf support #1381

Merged
merged 3 commits into from
Jul 26, 2023
Merged

Conversation

atulkharerivos
Copy link
Contributor

@atulkharerivos atulkharerivos commented Jun 14, 2023

This adds support for the "Cycle & Instret Privilege Mode Filtering Architecture" extension ( https://github.com/riscv/riscv-smcntrpmf/releases/download/v1.0_rc2/riscv-smcntrpmf-v1.0_rc2.pdf).

riscv/isa_parser.cc Outdated Show resolved Hide resolved
riscv/csrs.cc Outdated Show resolved Hide resolved
Copy link
Contributor

@scottj97 scottj97 left a comment

Choose a reason for hiding this comment

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

I don't know anything about the spec for this feature, but I have some comments on the implementation.

riscv/csrs.cc Outdated Show resolved Hide resolved
riscv/csrs.cc Show resolved Hide resolved
riscv/csrs.cc Outdated Show resolved Hide resolved
riscv/csrs.cc Outdated Show resolved Hide resolved
riscv/csrs.cc Outdated Show resolved Hide resolved
riscv/csrs.cc Outdated Show resolved Hide resolved
@atulkharerivos
Copy link
Contributor Author

@scottj97 Sorry for taking so long to turnaround, but for some reason, I wasn't receiving any notifications on the comments. The specification can be found here: https://github.com/riscv/riscv-smcntrpmf/releases/download/v1.0_rc2/riscv-smcntrpmf-v1.0_rc2.pdf

Copy link
Contributor

@scottj97 scottj97 left a comment

Choose a reason for hiding this comment

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

I have reviewed only the implementation, and not its adherence to the spec, but this looks good to me.

This tracks whether the privilege / virtual mode was changed by the
execution of the current instruction.
If Smcntrpmf is enabled, mcycle / minstret increment only if counting
for the privilege level isn't inhibited in mcyclecfg / minstretcfg.
@aswaterman aswaterman merged commit c59e80e into riscv-software-src:master Jul 26, 2023
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.

4 participants