The configuration registers are refactored for a more sensible encoding of the metrics that can be tracked. Further, the configuration of the metric/hart and the enable are now separate registers, which should make it a bit faster resp. more accurate to enable/disable performance counters. This means the interface for the performance counter API changed slightly, but makes more sense now.
The previous perf_cnt test was adapted to the new performance counter API interface, and now actually checks for error. Previously, it served mostly as an example on how to set up the performance counters and always returned zero.
This PR adds improvements to the performance counters for bring-up, and restructures the performance counter implementation:
Changed
After reset, performance counters immediately start tracking, which allows checking from outside if the cores, icache, etc., are alive. The metrics that are currently tracked are: https://github.com/pulp-platform/snitch_cluster/blob/333ee0d619268a59f987e9466f281dba075a7bd6/hw/snitch_cluster/src/snitch_cluster_peripheral/snitch_cluster_peripheral.sv#L103-L111
The configuration registers are refactored for a more sensible encoding of the metrics that can be tracked. Further, the configuration of the metric/hart and the enable are now separate registers, which should make it a bit faster resp. more accurate to enable/disable performance counters. This means the interface for the performance counter API changed slightly, but makes more sense now.
The previous
perf_cnt
test was adapted to the new performance counter API interface, and now actually checks for error. Previously, it served mostly as an example on how to set up the performance counters and always returned zero.TODO
main
when deemed ready to merge~