Commit Graph
3 Commits
Author SHA1 Message Date
hermes 4307899a18 rtl: 修 in_ready 的单步漏洞,加 EPROM 取指模型,量出扫描占比
三件事,都有测试或数字兜着:

1. in_ready 少算 run/step。原来只有 `state==S_FETCH && op_now==OP_INP`,
   单步模式(run=0)停着时照样拉高,生产者按契约交出的字节被丢掉,机器从此
   卡在 ',' 上(steps 一直是 0)。补 `(run || step) && !halted`。
   回归:tests/tb_in_ready.v(自带纸带,不需要 R8Forge 构建)。

2. 新增 EPROM 参数(1 = 一字节一指令,prog_data0[2:0] 即操作码、ip 直接当地址),
   就是 docs/ttl-schematic.md 焊的 27C512 方案;tb_rot8.v 用 -DEPROM_MODE 打开。
   两种格式在 hello / calc / asm/test 上步数、拍数、OUT 流全部相同
   (417 / 166741 / 100142)—— 之前 RTL 只对得上打包镜像,和板子焊的格式不是一回事。

3. 栈满改成停机(原来是 sp 静默回绕);新增 tests/tb_state_mix.v + tests/rtl_probe.sh,
   量出拍数分布:calc 698075 拍里 531332 拍是括号前向扫描(76%),hello 27%、
   asm/test 53%;最大栈深 calc 7、test 4、hello 0。分析见 docs/bracket-skip.md。

文档同步:ttl-schematic 取消两片 74LS670 的栈方案(4 深不够,实测要 7),片数改 31+晶振;
微码字段数到 18 根,一片 28C64 装不下 → 定 16 位两片;NEXT.md/AGENTS.md/rtl/README.md
记录新状态与两条探针。
2026-11-25 16:53:18 +00:00
dsh 144c666f59 fix: the moved docs still described the test as "ctest -R rtl_sim"
That target stayed behind in R8Forge; here the equivalence check is a script,
tests/rtl_sim.cmake, run with the three tool binaries as parameters.  Four mentions
corrected, including the milestone table and the schematic preamble.
2026-11-25 17:02:20 +08:00
dsh d0dc2d4d66 ROT-8-Machine: one physical ROT-8, split out of R8Forge
This repository is a machine, not a toolchain.  R8Forge keeps the language, the ISA
specification and the tools that assemble, pack and run tapes; this one keeps what it
takes to build the thing: the RTL and its testbench, the requirements note, the 34 chip
board wiring, the panel design and its mockups, the mechanics analysis, the bill of
materials, the buying guide and the order sheet, the bring up plan, and the microcode
directory that is still empty.

The equivalence test came with the RTL, since it needs both halves: it assembles a tape
with r8forge, packs it with tape_pack, runs it with tape_run --loop-stack --retest, then
compiles rtl/rot8.v with iverilog and requires the same OUT stream and the same step
count.  It takes those three binaries as parameters and its header says they must be
built for eight bit cells and sixty four cells, because an eleven bit packer feeding an
eight bit machine produces different output and looks like an RTL bug.

Verified here: hello 577 instructions 417 steps, calc 51378 instructions 166741 steps
with "12 34 + ." fed in, both agreeing with the interpreter.
2026-11-25 17:02:09 +08:00