Files
Interpreter/vm/README.md
T
AdminandCursor 2eb2468119 划定 CMake 模块目录并补充各层 README。
固定 isa/compiler/vm/host 的职责边界,样例与测试单独成目录。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-18 16:32:07 +08:00

25 lines
758 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# vm
寄存器虚拟机。CMake 目标:`vm``STATIC`),只依赖 `isa`
运行时是 **一台 VM、一个入口、一份映像**。不链接 `compiler`
## 扫描周期
```text
1. 按 toml 的 io 绑定,采样 → I / 输入全局
2. 从 PROGRAM MAIN 的 pc=0 执行到 RET
3. 写回 Q / 输出全局
4. 用本周期 Δt 推进 TON / TOF / CTU(不用 wall clock
```
## 约束
- 局部 / `VAR` = 固定寄存器;`nregs` 写在函数头
- `I` / `Q` / `M` 走映像指令,不是通用寄存器
- FB 实例固定布局,字段偏移编译期算死
- `CALL` 目标是立即数 `fn_id`,有界调用栈
- 无 GC、无堆、无线程;每周期受 `cycle_limit` 限制
I/O 从哪来、Δt 谁给、回放怎么喂,属于 `host`