riscvarchive / riscv-count-overflow

https://jira.riscv.org/browse/RVG-59
Creative Commons Attribution 4.0 International
2 stars 2 forks source link

Mcounteren relevance in reading scountovf #12

Open Abhiram1221 opened 8 months ago

Abhiram1221 commented 8 months ago

Hi, The spec says,

In M and S modes, scountovf bit X is readable when mcounteren bit X is set, and otherwise reads as zero.

Should it be the case that the mcounteren bit only matters while reading scountovf from S mode ? And scountovf should always give the true value on reading in M mode irrespective of the corresponding mcounteren bits. Asking this since mcounteren controls the availability of the hardware performance-monitoring counters to the next-lowest privileged mode.

Thanks

ingallsj commented 8 months ago

Makes sense to me.