Open james-ball-qualcomm opened 1 month ago
Yes, I agree we are probably missing parameters for Zihpm.
As for "enabled," that means that the corresponding CSR is present (read won't cause exception or undefined behavior). It may still be read-only-0 even if "enabled".
Couple of issues I noticed with Zihpm.
The Unpriv ISA manual chapter on Zihpm says "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."
Seems like we need a bunch more of parameters in the Zihpm.yaml to capture all these possibilities. Should we add them?
The other issue is that the Zihpm.yaml has this description for HPM_COUNTER_EN: "List of HPM counters that are enabled." What does "enabled" mean? Counting some event (i.e., run-time controlled) or provides a non-zero value when the associated CSR is read (since all 29 perf counters are always implemented but can be read-only-0 if not actually functional).