-
Notifications
You must be signed in to change notification settings - Fork 157
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
Differentiate comparator 0 as the only one capable of cycle compare #377
base: master
Are you sure you want to change the base?
Changes from all commits
9e263cc
22efd36
f24999f
916e494
ffa638c
82b1975
79111ff
457864d
49a8438
ef728e8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,12 +42,21 @@ fn dwt() { | |
#[cfg(not(armv6m))] | ||
assert_eq!(address(&dwt.foldcnt), 0xE000_1018); | ||
assert_eq!(address(&dwt.pcsr), 0xE000_101C); | ||
assert_eq!(address(&dwt.c[0].comp), 0xE000_1020); | ||
assert_eq!(address(&dwt.c[0].mask), 0xE000_1024); | ||
assert_eq!(address(&dwt.c[0].function), 0xE000_1028); | ||
assert_eq!(address(&dwt.c[1].comp), 0xE000_1030); | ||
assert_eq!(address(&dwt.c[1].mask), 0xE000_1034); | ||
assert_eq!(address(&dwt.c[1].function), 0xE000_1038); | ||
if cfg!(not(armv6m)) { | ||
assert_eq!(address(&dwt.comp0.comp), 0xE000_1020); | ||
assert_eq!(address(&dwt.comp0.mask), 0xE000_1024); | ||
assert_eq!(address(&dwt.comp0.function), 0xE000_1028); | ||
|
||
assert_eq!(address(&dwt.comps[0].comp), 0xE000_1030); | ||
assert_eq!(address(&dwt.comps[0].mask), 0xE000_1034); | ||
assert_eq!(address(&dwt.comps[0].function), 0xE000_1038); | ||
} | ||
if cfg!(armv6m) { | ||
assert_eq!(address(&dwt.comps[0].comp), 0xE000_1020); | ||
assert_eq!(address(&dwt.comps[0].mask), 0xE000_1024); | ||
assert_eq!(address(&dwt.comps[0].function), 0xE000_1028); | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so unfortunately. These tests run on the native host so the best we can do is make sure these things are pointing to the right address. If we dereferenced them and tried to check behavior, we'd crash and burn |
||
|
||
#[cfg(not(armv6m))] | ||
assert_eq!(address(&dwt.lar), 0xE000_1FB0); | ||
#[cfg(not(armv6m))] | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What effect does this have?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not 100% sure what you mean so I'll take a stab at what I think you're asking. We need to "cary" around the generic argument
SupportedFunctions
, but it's zero sized so we usePhantomData
. As the tests show, it does not increase the size of theRegisterBlock
(addresses forcomp0
and more importantlycomp[0]
remained the same)