-
Notifications
You must be signed in to change notification settings - Fork 170
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 HPM counters #404
Add support for HPM counters #404
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"High Performance Counters" should be "Hardware Performance Counters"?
Also do we need to guard these with a (always-true) haveZihpm()
function?
Good call, I'll add that too. |
65621a3
to
260bbb3
Compare
260bbb3
to
ff07c86
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM but would be good to have someone else double-check
661228a
to
549f55f
Compare
@billmcspadden-riscv I think it's ok if you double check this since you've also done a lot of HPM stuff. |
549f55f
to
008577f
Compare
008577f
to
eb99d93
Compare
eb99d93
to
a880990
Compare
a880990
to
023c48d
Compare
@billmcspadden-riscv I've rebased this. |
023c48d
to
947a20d
Compare
@billmcspadden-riscv please can you merge this? It's ready to go. |
Implements Hardware Performance Monitoring counters, but only by making the registers available. Their values only change if explicitly written to and all values are legal. All 32 HPM counters are always implemented (the spec says this "should" be the case), and a platform callback `sys_writable_hpm_counters` is added to allow making any of them read-only. I haven't hooked `sys_writable_hpm_counters` up to CLI flags because Codasip does not use the CLI flags and it is quite tedious, and hopefully going to change when riscv-config is used.
947a20d
to
01b63cd
Compare
Implements Hardware Performance Monitoring counters, but only by making the registers available. Their values only change if explicitly written to and all values are legal.
All 32 HPM counters are always implemented (the spec says this "should" be the case), and a platform callback
sys_writable_hpm_counters
is added to allow making any of them read-only. I haven't hookedsys_writable_hpm_counters
up to CLI flags because Codasip does not use the CLI flags and it is quite tedious, and hopefully going to change when riscv-config is used.Finally this adds
menvcfg
andsenvcfg
to the CSR name map which I forgot to do previously.