[FIX] Simulator: fix TinyFive dead loop caused by ABI names and non-s…#15
Merged
Merged
Conversation
watney1024
approved these changes
Jul 26, 2026
…tandard assembly syntax Des: 1. Switch verify_assembly() to assemble_to_binary() + load_binary() as primary path, avoiding TinyFive's asm() which rejects ABI register names and silently skips failed instructions via except Exception: continue. 2. Add _expand_pseudo() to expand max pseudo-instruction and branch-with-immediate into standard RISC-V sequences before encoding. 3. Add SW dual-syntax support (compiler format and standard format) in _encode_line(), suppressing non-standard instruction errors. 4. Add encoding for rem, srai, xor, and instructions; remove broken max handling that incorrectly encoded max as add. 5. Set ra = mem_size after binary load as termination sentinel, preventing jalr zero, ra from looping back to address 0. Signed-off-by: Seven Gao <799889633@qq.com>
Contributor
Author
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
解决了loop的死循环问题,并适配了部分tinyfive的abi不兼容问题。
文档展示了问题定位思路和修改根因:
01_devdoc_simulator_deadloop.md
…tandard assembly syntax
Des: