Re: Questions on HPMs


Beeman Strong
 

Thanks guys.  It would be good to clarify this in the spec, so there is no confusion.  x86's INST_RETIRED.ALL, for instance, does increment for interrupts and exceptions.


On Thu, Oct 28, 2021 at 4:36 PM Andrew Waterman <andrew@...> wrote:


On Thu, Oct 28, 2021 at 4:18 PM Greg Favor <gfavor@...> wrote:
On Thu, Oct 28, 2021 at 3:21 PM Beeman Strong <beeman@...> wrote:
2) I haven't seen a clear definition of what instret counts, other than:

* The minstret CSR counts the number of instructions the hart has retired.
* As ECALL and EBREAK cause synchronous exceptions, they are not considered to retire, and should not increment the minstret CSR.

From this I'm inferring that neither interrupts nor instructions that take exceptions increment instret.  Is that right?

Andrew can confirm, but I believe the answer is Yes.  Which makes sense since in both cases an instruction is not successfully executed (and one doesn't want double-counting of an instruction that first takes an exception and then successfully executes after return from the exception, e.g. a page fault).

👍
 
 
Greg

Join tech-privileged@lists.riscv.org to automatically receive all group messages.