-
-
Notifications
You must be signed in to change notification settings - Fork 397
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
arm: Use FullyQualifiedApAddresses rather than GenericAp or MemoryAp #2706
arm: Use FullyQualifiedApAddresses rather than GenericAp or MemoryAp #2706
Conversation
31186fc
to
f78b33e
Compare
- Those two type do not provide much value beyond being attached to a set of registers. - GenericAp can be converted to MemoryAp without checks.
f78b33e
to
795cfd9
Compare
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 quite sold on the unnecessary import grouping changes. I think we should set up rustfmt to enforce an import style that avoids some rebase headaches in the future.
Not all APs are memory APs, so I don't understand why no check is necessary here. Shouldn't the type be checked? |
I only checked |
Now we should check the type of the AP in every function which takes an AP address, which seems more cumbersome than using a specific type to indicate that we know it is a memory AP. It might reflect the case that we didn't do that check before, so it's probably not worse now, but I would have preferred to keep different types to represent the reality that not all AP addresses point to memory APs. |
I would agree if constructing a MemoryAp type included checking whether the AP is actually a memory AP. If we don't do this check at construction time, then it doesn't matter what type our API takes, there's opportunity for misuse. Anyway, feel free to revert this PR if you feel that we should try another approach. |
Actually please do not revert. The types and checks are added in the following pr. EDIT: Give me a little moment, I’ll rebase #2683 and add links to the relevant parts for the types and the checks. EDIT2: And for my humble opinion, as much as I’d like to avoid doing those checks several times at run time, this only happen when a new memory_interface is obtained, so it is not as bad as it looks. EDIT3: EDIT4: |
of registers.
Follows: