-
Notifications
You must be signed in to change notification settings - Fork 895
Add RISC-V32 arch. port layer #490
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
base: dev
Are you sure you want to change the base?
Conversation
|
Hi @akifejaz. Thank you for this contribution and congratulations on your first PR! I will request a review during today's committer meeting. |
This update adapts the ThreadX low-level kernel routines for RV32, including: - startup and initialization logic - context save/restore implementations - interrupt control and scheduler entry - thread stack build and system return paths - timer interrupt handling These changes provide full low-level support needed to run ThreadX on RISC-V32 targets. Signed-off-by: Akif Ejaz <[email protected]>
…plementation This commit replaces the manually translated GNU assembly files in 'ports/risc-v32/gnu' with the implementation from Eclipse ThreadX Pull Request eclipse-threadx#490 (by akifejaz). Key changes: - Replaced local IAR-to-GNU assembly translations with the upstream version. - Adopted the community-verified architecture layer for RISC-V 32-bit. - This establishes a clean baseline for further development. Reference: eclipse-threadx#490
|
This looks really good... nice work! Here is my feedback on some minor issues and recommended testing:
Next, it's good to generate three (or more) assembly language threads of equal priority and with a time-slice of 2 ticks. Each thread basically fills the register set with thread-unique values and sits in a tight loop. A higher-priority assembly thread should then be created, where the processing simply sets all the compiler-saved registers with a pattern specific to that thread, then performs a tx_thread_sleep(2) call in a tight loop. Let this application run, then manually halt it and verify that the "tx_thread_run_count" of all threads is incrementing, and that each thread's register set follows the expected pattern. Also, verify that each thread's stack pointer remains constant. You should also verify that context save switches to the system stack pointer. This will verify much of the context saving and restoring. Next, take the same system and don't start the three background threads - only start the higher-priority thread. This system will test the idle system processing. You should make sure that the stack pointer in the idle system is the system stack and isn't changing while in the _tx_thread_schedule_loop idle loop. |
|
Hi @billlamiework Thank you for taking time to review.
As I mentioned this is similar to RV64/GNU port that we already have in threadx and I also kind of followed the similar flow intentionally. However, I agree your points are valid and I'm already working on streamlining both RV ports starting from RV64 (like #496), I also noticed a issue with RV64 port (I mentioned here #416 (comment)) Hoping to cleanup this in coming PRs. Also, about testing I've already verified its working on qemu virt see details #492 |
|
Hi @akifejaz. Just to synthesise what we discussed during this week's committer meeting.
So, the short version is: please make changes to this PR to align with @billlamiework's recommendations. I will work to publish past C coding standards on GitHub ASAP. I will also start a file to host assembly standards as well. In the meantime, please send an email to the threadx-dev mailing list if you are unsure about some of the details. Senior contributors like @billlamiework and @cypherbridge could provide guidance there. |
This update adapts the ThreadX low-level kernel routines for RV32, including:
These changes provide full low-level support needed to run ThreadX on RISC-V32 targets.
This is similar to RISC-V64/GNU we already had. Its my first PR in Threadx, please let me know if I missed something or you have anything to add regarding this PR.