Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify the logical counter index in the snapshot area. #134

Merged
merged 1 commit into from
Dec 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/ext-pmu.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -538,21 +538,28 @@ implement it.
|===
| Name | Offset | Size | Description
| counter_overflow_bitmap | 0x0000 | 8 | A bitmap of all logical overflown
counters. This is valid only if
the `Sscofpmf` ISA extension is
available. Otherwise, it must be
zero.
counters relative to the
`counter_idx_base`. This is valid
only if the `Sscofpmf` ISA
extension is available. Otherwise,
it must be zero.
| counter_values | 0x0008 | 512 | An array of 64-bit logical
counters where each index
represents the value of each
logical counter associated with
hardware/firmware.
hardware/firmware relative to the
`counter_idx_base`.
| Reserved | 0x0208 | 3576 | Reserved for future use
|===

Any future revisions to this structure should be made in a backward compatible
manner and will be associated with an SBI version.

The logical counter indicies in the `counter_overflow_bitmap` and `counter_values`
array are relative w.r.t to `counter_idx_base` argument present in the
`sbi_pmu_counter_stop` and `sbi_pmu_counter_start` functions. This allows the
users to use snapshot feature for more than XLEN counters if required.

This function should be invoked only once per hart at boot time. Once
configured, the SBI implementation has read/write access to the shared memory
when `sbi_pmu_counter_stop` is invoked with the
Expand Down