Files
ROT-8-Machine/AGENTS.md
T
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

2.7 KiB
Raw Blame History

给接手的 agent 的话(ROT-8 Machine)

这是"物理 ROT-8"的仓库:一台机器,不是工具链。ISA 的权威定义在 ../R8Forge/SPEC.md,汇编器和 tape_pack/tape_run 也在那边 —— 不要在这里重新定义语义。

一句话状态

RTL 已验证、面板已定稿、采购清单已下单(≈¥280)、面包板未开工、微码未写。

三件最容易踩的事

  1. 改 RTL 之后必须重新对拍。tests/rtl_sim.cmake 把 RTL 跑一遍,要求 OUT 流和步数与 r8forge_tape_run --loop-stack --retest 完全一致。需要一份 R8Forge 的构建:

    cmake -DRTL=rtl -DPACK=<R8Forge>/build/Release/r8forge_tape_pack \
          -DRUN=<R8Forge>/build/Release/r8forge_tape_run \
          -DR8FORGE=<R8Forge>/build/Release/r8forge \
          -DSOURCE=../R8Forge/examples/hello.r8asm -DWORK=build -P tests/rtl_sim.cmake
    iverilog -g2012 -o build/tb vvp rtl/rot8.v rtl/tb_rot8.v
    

    这台机器只认"和解释器一致"这一个标准,别的说法都不作数。

  2. RTL 里有五个"故意这么写"的地方(见 rtl/README.md):16 位取指窗口、 循环栈进出账跟跳法绑定、biz 的前向跳过是独立状态、, 阻塞、ip >= len 才停机。 改之前先读那五条,否则会"修好"一个其实是对的 bug。

  3. 面板的规矩是硬的:只显示状态、不显示数字、每样信息一种表示。已经被删掉的东西包括 十进制数字显示、步数计数器、dp 二进制灯排(后来又加回来)、64 格点阵、机械指针 —— 每一条都记在 docs/panel.md,别好心加回去。

目录

想查 去哪
需求、预算、载体选型 docs/requirements.md
34 片主板的接线(逐脚) docs/ttl-schematic.md
面板(尺寸/布局/电气/氖灯成本) docs/panel.md
机械档(转鼓/延迟线/机械 dp) docs/mechanics.md
面包板第一块 + 宿舍版全机 docs/bringup.md
成本 / 采购 / 链接 docs/bom.md、docs/buy.md、docs/order.md、docs/links.txt
RTL 说明与对拍方法 rtl/README.md

约定

  • 文档中文,RTL 注释英文。
  • 所有数字要能在 R8Forge 上复现(步数、OUT 流、格号)。
  • 提交身份 dsh <dsh@gitea.local>(和 R8Forge 一致)。
  • 生成图用 tools/ 里的脚本,别手改 PNG。
  • 买不到的老件可以换现代件,判据是 "总线以内必须老,总线以外随便"(docs/buy.md §7)。