Skip to content

Conversation

@Saiiijchan
Copy link
Contributor

Currently, vector registers are not placed continuously in the stack. Place v31 - v0 in order from high address to low address to facilitate debugger analysis of task stack context.

Vector general register layout:

Before:
+--------------+ <-- High Address
| v7 |
+--------------+
| v6 |
+--------------+
| ... |
+--------------+
| v0 |
+--------------+ <-- v0 - v7
| v15 |
+--------------+
| v14 |
+--------------+
| ... |
+--------------+
| v8 |
+--------------+ <-- v8 - v15
| ... |
+--------------+
| v24 |
+--------------+ <-- Low address

After:
+--------------+ <-- High Address
| v31 |
+--------------+
| v30 |
+--------------+
| ... |
+--------------+
| v1 |
+--------------+
| v0 |
+--------------+ <-- Low Address

Description

Test Steps

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Vector general register layout:

Before:
+--------------+  <-- High Address
|      v7      |
+--------------+
|      v6      |
+--------------+
|      ...     |
+--------------+
|      v0      |
+--------------+  <-- v0 - v7
|      v15     |
+--------------+
|      v14     |
+--------------+
|      ...     |
+--------------+
|      v8      |
+--------------+  <-- v8 - v15
|      ...     |
+--------------+
|      v24     |
+--------------+  <-- Low address

After:
+--------------+  <-- High Address
|      v31     |
+--------------+
|      v30     |
+--------------+
|      ...     |
+--------------+
|      v1      |
+--------------+
|      v0      |
+--------------+ <-- Low Address

Signed-off-by: wangfei_chen <[email protected]>
@sonarqubecloud
Copy link

@aggarg
Copy link
Member

aggarg commented Oct 28, 2025

facilitate debugger analysis of task stack context.

@Saiiijchan Would you please help us understand how does this change facilitate debugger analysis of task stack context?

@Saiiijchan
Copy link
Contributor Author

facilitate debugger analysis of task stack context.

@Saiiijchan Would you please help us understand how does this change facilitate debugger analysis of task stack context?

Our debugger team is developing a GDB tool for FreeRTOS that can parse the task context from the stack. It would be easier to implement if the registers were arranged sequentially.

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