文档同步:machine.toml 配置驱动架构收尾。

- README.md:依赖方向(STCompiler→compiler 不链 isa)、模块表、isa 归执行器侧、
  数据流图(machine.toml + 型号/SHA)
- isa/README.md:重写——只管指令定义(Types/Op/Instr/Encode),删 Image 部分
- 指令与映像.md:依赖图与 CMake(compiler 不链 isa)
- 编译管线.md:管线首步加载 machine.toml、产物含型号/SHA
- 初步计划.md:12.10/12.13 修订(--machine、依赖方向)
- 扫描周期.md / 指令执行.md:12.9 步骤标注已落地、vm 读校验说明
- compiler/vm/executor README:依赖与边界同步
This commit is contained in:
2026-08-21 22:39:27 +08:00
parent 1168f5ae30
commit 6873b5ee0b
10 changed files with 76 additions and 158 deletions
+11 -7
View File
@@ -530,17 +530,21 @@ CMake 三个库能空编译:`isa`、`compiler`、`vm`;两个可执行 `STCom
编译与执行拆成两个可执行,映像 `.stb` 是中间产物:
```text
STCompiler <project.toml> -o <name>.stb # 编译:读 toml + .st → 映像 + sidecar
BytecodeExecutor <name>.stb [--cycles N] # 执行:加载 .stb + sidecar,跑 N 周期
STCompiler <project.toml> -o <name>.stb --machine <machine.toml>
BytecodeExecutor <name>.stb [--cycles N]
```
- `STCompiler``compiler` + `isa``BytecodeExecutor``vm` + `isa`**不链 `compiler`**。
- 产物两个文件:`<name>.stb`映像,魔数 `STSC`+ `<name>.runtime.toml`sidecarI/O 绑定 var → 槽号 → channel/bit)。`[[io.*]]` 不进映像,sidecar 由 STCompiler 生成,不创造变量。
- `STCompiler``compiler`**不链 `isa`**,编码查 `machine.toml``BytecodeExecutor``vm` + `isa`**不链 `compiler`**。
- 产物两个文件:`<name>.stb`头 104 含型号标识 + 段 + SHA-256 文件尾+ `<name>.runtime.toml`sidecarI/O 绑定 var → 槽号 → channel/bit)。`[[io.*]]` 不进映像,sidecar 由 STCompiler 生成,不创造变量。
- `dt_ms` / `cycle_limit` 从映像头取,sidecar 不重复配置。
- 执行器读取时**型号匹配 + SHA-256 校验**,不匹配/篡改 → 拒绝。
- 最小可观测:BytecodeExecutor 打印本周期 I/Q,或把寄存器/映像 dump 出来。
- 回放:读预先录制的 I 序列(文本即可),不接真实硬件。
完成:`STCompiler examples/line1/project.toml -o line1.stb` 产出两个文件;`BytecodeExecutor line1.stb` 能跑若干周期。
完成:`STCompiler examples/line1/project.toml -o line1.stb --machine compiler/machine.toml` 产出两个文件;`BytecodeExecutor line1.stb` 能跑若干周期。
> 12.13 修订:指令 opcode / 类型 / FB 布局的登记移入 `compiler/machine.toml`(见 [`指令配置.md`](isa/指令配置.md)),
> `STCompiler` 编译路径必填 `--machine`。
---
@@ -575,8 +579,8 @@ BytecodeExecutor <name>.stb [--cycles N] # 执行:加载 .stb + sidecar
### 12.13 依赖方向(全程遵守)
```text
STCompiler → compiler → isa
BytecodeExecutor → vm → isa
STCompiler → compiler (编码查 machine.toml;自带 .stb 写)
BytecodeExecutor → vm → isa isa 只管指令;vm 自带 .stb 读)
```
- 指令或映像布局有变:先改 `isa` 和编解码测试,再改两端。