fix(esp32c3): 按真 ISA(riscv32imc)构建并进门禁——imac 产物含 12 条 A 扩展指令 - #18
Merged
Merged
Conversation
问题(**无需硬件即可定性**):ESP32-C3 真身是 **RV32IMC**(无 A 扩展),而仓库与门禁一直按 `riscv32imac` 构建。实测同一示例的两种产物: | 目标 | A 扩展指令(amo/lr/sc) | 说明 | |---|---|---| | `riscv32imac` | **12 条**(8 amo + 2 `lr.w` + 2 `sc.w`) | 来自 Arc/信号量的原子读改写——真芯片执行到就是**非法指令** | | `riscv32imc` | **0 条** | 原子走 `src/arch/riscv/critical.rs` 的 critical-section 垫片 | 即:该口此前的"构建级验证"掩盖了一个错误的 ISA 选择——产物根本不可能在真芯片上跑。 ## 改法 1. `ci/gate.sh`:新增 esp32c3 按 `riscv32imc`(真 ISA)的构建步骤,与 ch572 同一条无 A 路径。 2. `README.md` 的 ESP32C3 条目:注明真身 ISA、imac 产物 12 条 A 指令的事实、改用真 ISA 后 0 条。 3. `CLAUDE.md` 芯片清单同样标注。 ## 顺带核实(回应 issue #14 的 ISA 存疑,官方 MRS 工程设置) - CH583 `.cproject`:`isa.atomic = true` → **有 A 扩展,`riscv32imac` 正确**(已合并的 ch583 口无误)。 - CH572 `.cproject`:`isa.atomic = false` → **无 A 扩展,`riscv32imc` 正确**(与已合并的 ch572 口一致)。 ## 验证 - `bash ci/gate.sh` 全绿(含新增 esp32c3/imc 步骤):host 159 / ISR 向量 / 启动头 ×3 / 乒乓 A×200 B×200 / kernel_tests 24-24 ×3 / smp 9-9。 - 宿主默认 features 82 passed;14 口 `cargo build --lib` 全绿。 - 指令数统计用 `llvm-objdump -d` 逐条数出(非转述)。
Owner
Author
合并记录(2026-09-19)
|
2 of 7 tasks
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.
问题(无需硬件即可定性):ESP32-C3 真身是 RV32IMC(无 A 扩展),而仓库与门禁一直按
riscv32imac构建。实测同一示例的两种产物:riscv32imaclr.w+ 2sc.w)riscv32imcsrc/arch/riscv/critical.rs的 critical-section 垫片即:该口此前的"构建级验证"掩盖了一个错误的 ISA 选择——产物根本不可能在真芯片上跑。
改法
ci/gate.sh:新增 esp32c3 按riscv32imc(真 ISA)的构建步骤,与 ch572 同一条无 A 路径。README.md的 ESP32C3 条目:注明真身 ISA、imac 产物 12 条 A 指令的事实、改用真 ISA 后 0 条。CLAUDE.md芯片清单同样标注。顺带核实(回应 issue #14 的 ISA 存疑,官方 MRS 工程设置)
.cproject:isa.atomic = true→ 有 A 扩展,riscv32imac正确(已合并的 ch583 口无误)。.cproject:isa.atomic = false→ 无 A 扩展,riscv32imc正确(与已合并的 ch572 口一致)。验证
bash ci/gate.sh全绿(含新增 esp32c3/imc 步骤):host 159 / ISR 向量 / 启动头 ×3 / 乒乓 A×200 B×200 / kernel_tests 24-24 ×3 / smp 9-9。cargo build --lib全绿。llvm-objdump -d逐条数出(非转述)。Refs #14(回应其中的 ISA 存疑:CH583 有 A、CH572 无 A、esp32c3 真身无 A;本 PR 只修 esp32c3 的构建目标,不关闭该 issue)