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

[OCD] stop CPU counters during debugging #277

Merged
merged 4 commits into from
Feb 17, 2022
Merged

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Feb 16, 2022

As illustrated in riscv/riscv-debug-spec#638 this PR hardwires the dcsr.stopcount bit to 1. Thus, all standard CPU counters ([m]cycle[h] and [m]instret[h]) and all hardware performance monitor (HPM) counters are always stopped during debugging (when the CPU is in debug mode).

Note that the [m]time[h] CSRs are not affected by this since they are a shadow copy of the MTIME system timer, which keeps running also during debugging (hence, dcsr.stoptime is hardwired to 0).

standard CPU counters (cycle & instret CSRs) and all HPM counters are **stopped** when the CPU is in debug mode
@stnolting stnolting added the HW hardware-related label Feb 16, 2022
@stnolting stnolting self-assigned this Feb 16, 2022
@stnolting stnolting marked this pull request as ready for review February 16, 2022 18:52
@stnolting stnolting merged commit fecc272 into main Feb 17, 2022
@stnolting stnolting deleted the set_dcsr_stopcount branch February 17, 2022 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HW hardware-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant