9 Commits
Author SHA1 Message Date
dsh 947ef3efd2 Merge pull request 'Rot8/bringup rtl cleanup' (#2) from rot8/bringup-rtl-cleanup into master
Reviewed-on: #2
2026-11-28 03:20:29 +00:00
dsh 237e7b9942 docs: clarify bring-up steps and record actual parts 2026-11-28 11:05:42 +08:00
dsh aa00ec5fb2 rtl: fix single-step execution and validate simulation inputs 2026-11-28 11:05:34 +08:00
dsh a6c5d4039a Merge pull request 'rtl: 修 in_ready 单步漏洞、加 EPROM 取指模式、量出扫描占 76% 拍' (#1) from hermes/ROT-8-Machine:rtl/in-ready-eprom into master
Reviewed-on: #1
2026-11-25 16:57:37 +00:00
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 745ccbdb23 docs: record the constraints that decide the trade offs
Everything technical survives in the repository, but what did not was why the trade offs
came out the way they did: the work happens in holiday bursts, the budget is small (280
CNY for the breadboard build, 400 to 950 for the finished machine), the dorm has no
soldering iron and little desk, and the taste is 8800 vintage inside the bus and modern
outside it.  Five lines at the top of NEXT.md, so a fresh session reads them before
proposing anything expensive, plus a reminder that the deleted panel elements were
deleted on purpose.
2026-11-25 17:08:30 +08:00
dsh d7a41821cf docs: NEXT.md, so the next session starts cold without losing the thread
The design reasoning all lives in the repository already -- AGENTS.md for the traps,
docs/ for the decisions, the RTL for the contract -- so a fresh session only needs one
file that says what was finished, what comes next and the two commands that matter.  It
also records that the equivalence test wants a build of the toolchain made for eight bit
cells, which cost an hour the first time.
2026-11-25 17:06:25 +08: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