-
Notifications
You must be signed in to change notification settings - Fork 924
Optimize stack management, fix preemption, and add automated QEMU testing for RISC-V32 port #513
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
Open
Winstonllllai
wants to merge
14
commits into
eclipse-threadx:master
Choose a base branch
from
Winstonllllai:rv32-fix-feature
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
6dee013
docs: resolve merge conflicts in RISC-V 32-bit GNU port files
Winstonllllai 85d0626
feat: implement Lazy FPU Stacking and Vector Table
Winstonllllai aad13e8
Implement WFI for Idle Loops and Enforce Shadow Stack Alignment
Winstonllllai 633629d
feat: add RISC-V QEMU demo support and fix assembly implementation
Winstonllllai fedd124
Add RISC-V QEMU functional test runner and FPU verification
Winstonllllai ae13c5b
feat: use macros for stack offsets and enhance verification framework
Winstonllllai 39ede67
Enable GP Relaxation optimization
Winstonllllai a1b2457
Optimize stack management and update QEMU port
Winstonllllai 4425c5b
fix preemption logic and interrupt context restore
Winstonllllai fa9b870
build: stop tracking build_qemu directory and update copyright headers
Winstonllllai ae2aa03
delete output log file
Winstonllllai e3d4e9f
cleanup: address RISC-V32 QEMU demo review feedback
Winstonllllai 08d2bea
test: relocate and harden RISC-V32 QEMU functional runner
Winstonllllai 7e31dc6
feat: restore Lazy FPU stacking without assembly macros
Winstonllllai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ | |
| .tmp/ | ||
| _deps/ | ||
| build/ | ||
| build_qemu/ | ||
| Debug/ | ||
| CMakeFiles/ | ||
| CMakeScripts/ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # ThreadX RISC-V32 GNU port: QEMU virt demo build. | ||
| # | ||
| # This subdirectory is opted-in by ports/risc-v32/gnu/CMakeLists.txt when | ||
| # the consumer is building the threadx library for the risc-v32/gnu port. | ||
| # | ||
| # kernel.elf is marked EXCLUDE_FROM_ALL so that: | ||
| # - The default `cmake --build .` (which builds the threadx library | ||
| # and any tests the consumer wires up) is unaffected by the demo. | ||
| # - Users who explicitly want the demo can `cmake --build . | ||
| # --target kernel.elf` or `cmake --build . --target | ||
| # check-functional-riscv32` to also drive the QEMU/GDB test runner. | ||
| # | ||
| # This avoids touching the root CMakeLists.txt while still keeping the | ||
| # build-system entry point for the demo discoverable next to the demo | ||
| # sources themselves. | ||
|
|
||
| set(QEMU_DEMO_DIR ${CMAKE_CURRENT_LIST_DIR}) | ||
|
|
||
| add_executable(kernel.elf EXCLUDE_FROM_ALL | ||
| ${QEMU_DEMO_DIR}/demo_threadx.c | ||
| ${QEMU_DEMO_DIR}/entry.s | ||
| ${QEMU_DEMO_DIR}/uart.c | ||
| ${QEMU_DEMO_DIR}/plic.c | ||
| ${QEMU_DEMO_DIR}/hwtimer.c | ||
| ${QEMU_DEMO_DIR}/trap.c | ||
| ${QEMU_DEMO_DIR}/board.c | ||
| ${QEMU_DEMO_DIR}/tx_initialize_low_level.S | ||
| ) | ||
|
|
||
| target_link_libraries(kernel.elf PRIVATE threadx) | ||
|
|
||
| target_include_directories(kernel.elf PRIVATE | ||
| ${CMAKE_SOURCE_DIR}/common/inc | ||
| ${CMAKE_SOURCE_DIR}/ports/${THREADX_ARCH}/${THREADX_TOOLCHAIN}/inc | ||
| ${QEMU_DEMO_DIR} | ||
| ) | ||
|
|
||
| target_link_options(kernel.elf PRIVATE | ||
| -T${QEMU_DEMO_DIR}/link.lds | ||
| -nostartfiles | ||
| -Wl,-Map=kernel.map | ||
| ) | ||
|
|
||
| # QEMU/GDB functional test runner. Optional: skipped silently if the | ||
| # host has no Python 3 interpreter on PATH. | ||
| find_package(Python3 COMPONENTS Interpreter) | ||
| if(Python3_FOUND) | ||
| add_custom_target(check-functional-riscv32 | ||
| COMMAND ${Python3_EXECUTABLE} | ||
| ${QEMU_DEMO_DIR}/test/azrtos_test_tx_gnu_riscv32_qemu.py | ||
| --elf $<TARGET_FILE:kernel.elf> | ||
| --qemu qemu-system-riscv32 | ||
| --gdb gdb | ||
| DEPENDS kernel.elf | ||
| WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
| COMMENT "Running RISC-V32 QEMU/GDB functional test runner..." | ||
| ) | ||
| else() | ||
| message(STATUS | ||
| "Python3 not found; check-functional-riscv32 target unavailable.") | ||
| endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
x3 register is missing. also I'm not sure why we need to change .text to .init.