Skip to content

Fix execution priority. #55

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

Merged
merged 2 commits into from
Jan 8, 2025
Merged

Fix execution priority. #55

merged 2 commits into from
Jan 8, 2025

Conversation

asanza
Copy link

@asanza asanza commented Jan 7, 2025

This commit implements the execution priority as defined in the armv7-m architecture reference manual.

There was a bug where the group priority for reset, nmi and hardfault was not being ignored as specified in the ARMV7-M Arch Reference Manual. Version E. Page B1-157. Here it is defined that the group priority for Hardfault, NMI and Reset is -1, -2 and -3 respectively, regardles of the value of PRIGROUP.

Related: #54

This commit implements the execution priority as defined in the
armv7-m architecture reference manual.

There was a bug where the group priority for reset, nmi and hardfault
was not being ignored as specified in the ARMV7-M Arch Reference Manual.
Version E. Page B1-157. Here it is defined that the group priority
for Hardfault, NMI and Reset is -1, -2 and -3 respectively, regardles
of the value of PRIGROUP.

Signed-off-by: Diego Asanza <f.asanza@de.abb.com>
@jjkt
Copy link
Owner

jjkt commented Jan 8, 2025

Now looking at ARM V6m and ARM v7m reference manuals side by side I note that the ARM v6m implementation is likely broken (not related to this PR directly though).

Interesting that the ExecutionPriority() pseudocode implementation as is does not result in correct operation regarding NMI, HARDFAULT and RESET. In make_default_exception_priorities() they are configured with correct priority numbers...

Signed-off-by: Diego Asanza <f.asanza@de.abb.com>
@jjkt jjkt merged commit c4d2b04 into jjkt:master Jan 8, 2025
1 check passed
@asanza
Copy link
Author

asanza commented Jan 9, 2025

Btw, i think the way the exceptions are handled in the simulator will need probably some rework.

Now looking at ARM V6m and ARM v7m reference manuals side by side I note that the ARM v6m implementation is likely broken (not related to this PR directly though).

Interesting that the ExecutionPriority() pseudocode implementation as is does not result in correct operation regarding NMI, HARDFAULT and RESET. In make_default_exception_priorities() they are configured with correct priority numbers...

Yes, i was thinking the same. But I don't yet the architecture of the simulator good enough to start doing more involved changes.
The main difference between armv6-m and v7-m seems to be that there are extra fault registers that are affected in the v7-m architecture.

specifically, the hfsr is available in v7-m but not in v6-m. The same with others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants