Skip to content

Commit 8ae05df

Browse files
k1nsomclaude
andcommitted
feat: 集成 TinyFive 库作为 RISC-V 仿真后端
- 修复 scratchv/simulator/tinyfive.py: 正确的 tinyfive.machine API 调用 - 使用二进制直接加载 (load_binary) 避免 asm() API 限制 - 正确的 int32/uint32 转换处理负值 - 在编译管线添加 --tinyfive 选项,使用第三方库独立验证 - --tinyfive-max-instr 控制仿真指令数 - 自动设置 bare-metal ABI 寄存器 (sp/gp/a0/a1) - Makefile 新增 bench-tinyfive 目标 TinyFive 作为可靠的第三方 RV32IM 仿真器,替代手写 Python 仿真器进行独立验证,确保 benchmark 数据可信。 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent d1bdafa commit 8ae05df

3 files changed

Lines changed: 308 additions & 101 deletions

File tree

‎Makefile‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ bench-cnn:
2929
-o /tmp/cnn_riscv.bin --estimate --report
3030
@echo "Reports: benchmark_reports/"
3131

32+
# ── CNN RISC-V 编译 + TinyFive 仿真验证 ───────────────────────────────────
33+
34+
bench-tinyfive:
35+
python3 scratchv/standalone/onnx_to_riscv_standalone.py models/graph/cnn.onnx \
36+
-o /tmp/cnn_riscv.bin --estimate --tinyfive --tinyfive-max-instr 200000
37+
@echo "TinyFive simulation complete."
38+
3239
# ── CI Benchmark (LLVM + TinyFive + 可视化仪表盘) ──────────────────────────
3340

3441
bench-ci:

0 commit comments

Comments
 (0)