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

add methods needed for cycle count comparisons #367

Merged
merged 12 commits into from
Dec 29, 2021

Conversation

TDHolmes
Copy link
Contributor

Extends the existing DWT comparator code to include cycle count comparisons which fire a DebugMonitor exception, if enabled with enable_debug_monitor. See working example here

@rust-highfive
Copy link

r? @thalesfragoso

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m labels Dec 14, 2021
@TDHolmes
Copy link
Contributor Author

Also tag @tmplt

Copy link
Contributor

@tmplt tmplt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see the DWT API extended. Some minor refactoring should be addressed so that the module is easily extended further in the future.

src/peripheral/dwt.rs Outdated Show resolved Hide resolved
src/peripheral/dwt.rs Outdated Show resolved Hide resolved
src/peripheral/dwt.rs Show resolved Hide resolved
src/peripheral/dwt.rs Show resolved Hide resolved
src/peripheral/dwt.rs Outdated Show resolved Hide resolved
src/peripheral/dwt.rs Outdated Show resolved Hide resolved
src/peripheral/dwt.rs Outdated Show resolved Hide resolved
src/peripheral/dwt.rs Show resolved Hide resolved
Copy link
Contributor

@tmplt tmplt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the below, DATAV{ADDR{1,0},SIZE} are SBZ on cycle count match, but these are not declared in the Function bitfield (c.f. Page 806) and never written to. These fields are also SBZ on address comparison match. I wonder if it isn't a good idea to write zero to these just in case.

src/peripheral/dwt.rs Outdated Show resolved Hide resolved
src/peripheral/dwt.rs Outdated Show resolved Hide resolved
src/peripheral/dwt.rs Outdated Show resolved Hide resolved
src/peripheral/dwt.rs Show resolved Hide resolved
@tmplt
Copy link
Contributor

tmplt commented Dec 15, 2021

These fields are also SBZ on address comparison match. I wonder if it isn't a good idea to write zero to these just in case.

It's for the better now that I think about it. If they are non-zero target behavior will be unpredictable on comparator match. Had they been marked SBZP I would have disregarded it, but that's not the case.

@TDHolmes
Copy link
Contributor Author

Agreed, updated

Copy link
Contributor

@tmplt tmplt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the last batch.

src/peripheral/dwt.rs Outdated Show resolved Hide resolved
src/peripheral/dwt.rs Outdated Show resolved Hide resolved
src/peripheral/dwt.rs Outdated Show resolved Hide resolved
src/peripheral/dwt.rs Outdated Show resolved Hide resolved
src/peripheral/dwt.rs Show resolved Hide resolved
@TDHolmes
Copy link
Contributor Author

TDHolmes commented Dec 16, 2021 via email

@TDHolmes
Copy link
Contributor Author

CI is failing due to #371

Copy link
Contributor

@tmplt tmplt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work.

src/peripheral/dwt.rs Outdated Show resolved Hide resolved
tmplt
tmplt previously approved these changes Dec 16, 2021
@TDHolmes
Copy link
Contributor Author

@tmplt thanks for the groundwork and thorough review! Looking forward to reading your thesis 😄

@thejpster
Copy link
Contributor

Are those nightly CI failures expected due to asm! changes?

@TDHolmes
Copy link
Contributor Author

TDHolmes commented Dec 18, 2021

Yes. That needs to be addressed for all other PRs

@TDHolmes
Copy link
Contributor Author

rebased on top of the asm PR to fix CI

@TDHolmes
Copy link
Contributor Author

TDHolmes commented Dec 29, 2021

Any update on this PR? It should be a non breaking change. Even though EmitOption is public and has new variants, it's only used in constructing configuration structs so it being not marked as non_exhaustive shouldn't be a problem

@thejpster
Copy link
Contributor

Looks ok to me, but I'm not an expert in this area

@TDHolmes
Copy link
Contributor Author

@tmplt Seems to be the expert and approved but I dunno if he has privileges to merge

Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is definitely a breaking change as it adds variants to two public enums that aren't already non_exhaustive, but all the code it changes is already breaking changes from #342, so it will have to go into a 0.8 either way.

Other than that LGTM.

bors merge

@bors
Copy link
Contributor

bors bot commented Dec 29, 2021

Build succeeded:

@bors bors bot merged commit bc00af3 into rust-embedded:master Dec 29, 2021
@TDHolmes TDHolmes deleted the DCB-enhancements branch December 29, 2021 21:13
@adamgreig adamgreig mentioned this pull request Dec 31, 2021
bors bot added a commit that referenced this pull request Jan 2, 2022
375: Prepare v0.7.4 r=thejpster a=adamgreig

I've created a new branch, `v0.7.x`, which is currently at the latest non-breaking commit (so includes #346 #349 #347 #351 #339 #352 #348 #363 #362 #361 but does not include #342), to track the 0.7 series since master now contains breaking changes for v0.8.

This PR (which targets the new branch) cherry-picks #372 #369 #374 and bumps the version to v0.7.4 (and updates CHANGELOG) ready for a new v0.7.4 release. Once complete I'll also backport the changelog entries and bump the version in master to 0.7.4.

I think this is everything that should be in 0.7 -- the only excluded PRs from master are #342 and #367 I believe, and I don't think we have any open PRs targeting 0.7 either.

Any other thoughts on items for inclusion in 0.7.4 (or other changelog entries I missed)?

Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Co-authored-by: Adam Greig <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-cortex-m
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants