-
Notifications
You must be signed in to change notification settings - Fork 751
Description
The spec seems to contradict itself, as I read it:
The Zihpm extension comprises up to 29 additional unprivileged 64-bit hardware performance counters, hpmcounter3-hpmcounter31. When XLEN=32, the upper 32 bits of these performance counters are accessible via additional CSRs hpmcounter3h- hpmcounter31h.
The implemented number and width of these additional counters, and the set of events they count, is platform-specific. Accessing an unimplemented or ill-configured counter may cause an illegal-instruction exception or may return a constant value.
The first paragraph says the hpmcounter*
registers are 64-bits wide. The second paragraph says the widths are platform-specific.
If the width(s) are platform-specific, what are the possibilities? 32 and 64, or any width > 0?
Can different registers be different widths?
Are all the possible "constant values" that could be returned when accessing an implemented register identical?
What would be an example of an "ill-configured" register?
The simplest (and most logical) implementation I think would be:
- from 0 to 29 additional implemented registers
- all registers have identical widths
- valid widths are 32 or 64 bits
- if access to an unimplemented register returns a constant value, access to any unimplemented register returns the same constant value as any other unimplemented register