Hey There!
Hope you are well. I have a question regarding privilege modes in the OpenPiton+Ariane system.
I am trying to read / write to registers within some custom unit tests to measure
statistics of branch prediction, cache, FP instructions, etc. This functionality is supported in cva6 by making the use of certain registers. There are some general performance counter registers called "mhpmcounter1", ..., "mhpmcounter31" which count events depending on some select registers called "mhpmevent3", ..., "mhpmevent31". All of which are machine-level registers. Other CSRs (such as "mcycle") are not an issue as these are accessible from a user privilege mode.
I have a good idea of what I need to do, however it would seem that these registers require M-level privilege (0b11), and a dump of "mstatus" indicates that the C tests are run in U-mode (0b00). I am curious if there is a simple way to elevate the permission level of user-run programs to M-level for unrestricted R/W access to the hardware registers from a user program. If not, can the Ariane core itself be configured to allow for these elevated accesses? All my tests are making use of the VCS simulator at this point.
Also, if anyone can suggest any workarounds to accessing these low-level registers as a user then that would also be appreciated! Thanks for your time.
-Zachary