TD_USAGE.zh-CN.md 6.7 KB

TD 工具链使用说明(Prod2U / CPLD 项目)

活动权威环境是 Linux 容器,命令入口为 td2026(Anlogic TD 2026.1 SP2)。最终验收收据必须以当前 Linux 运行产生;Windows GUI/批处理路径仅作可选参考,不是活动闭环权威。

活动 TD / bitstream 身份(MSE A1 current product/release authority)

项 状态
活动合同 三轴 百分比定位;标定 seek-close→measure-open;WD 30s FAN10;0x03/0x83;truncate_current_high_pulse_immediately_after_synchronized_limit;EN permanent_high;六限位;CON104/105/106/120/12/129
当前 TD 冻结复用 c9e7e2b9… / bitstream f3242a47…(162762 bytes);LUT 4320 / MSLICE 1089 / LSLICE 1089 / total slices 2178 / DSP 1。历史 ff44128a / b4b0eda4… 不得冒充 current 位流
Round-12 tip TD(历史,非 current) 8403e020 / SHA e0cf1321… / LUT 2893 — 不得复用为 MSE A1 current
Round-11 tip bit(历史) SHA 4ce1dd7c… — 不得复用为 current
Round-10 door-percent tip bit(历史) verif c919ae3d…;SHA 299ef1cf… @ ff480c0a… — 不得复用
Round-9 door-percent tip bit(历史) run 1e784d30…;SHA 71a571a3… @ 52aae277… — 不得复用
修复前 tip bit(历史) 9cd778… @ 3ad444fb — 不得复用
旧 jog tip / bit(历史) f23d6d4c… / eb275921… — 不得复用
td2026 Release_2026.1_SP2 Build 6.2.2.200067(工具版本)
Hardware 烧录 not_run

生产 RTL/约束/ADC 变更后必须在 最终 clean tip 上独占重跑 td2026。勿用更旧历史位流(含 jog 时代 eb275921… / f23d6d4…,二轴时代 ce3157c5…,或 45f548ab… @ bb515af)冒充当前 tip 证据。

活动合同:X/Y/Z 百分比、六限位、标定 ≤5000/≤5000(无 500 backoff)、EN permanent_high、硬截断 truncate_current_high_pulse_immediately_after_synchronized_limit。活动 IO 不是 solenoid / CON68 / CON34 / CON138–141;runtime limit 不是 inert。

1. 工具链版本

环境 推荐版本 说明
Linux 容器(权威) TD Release 2026.1 SP2 NL Build 6.2.2.200067 无头批处理,td2026;zip 名 TD_Release_2026.1_SP2_NL.zip
Windows(非权威参考) TD Release 2026.1 SP2 NL(或更新) GUI + 批处理;不作最终验收权威

Linux 安装包与 license_for_website.zip 需放在项目目录或 Agentworkspace/,不包含在本源码压缩包内(TD zip 约 1.9 GB)。

2. Linux 容器部署(Podman / Debian)

2.1 前置条件

  • WSL2 Debian + Podman 容器 myapp(host 网络,SSH 2222)
  • 将 TD_Release_2026.1_SP2_NL.zip 与 license_for_website.zip 放到 CPLD_temperature_control_board/ 或 Agentworkspace/
  • 容器持久卷 /data 存放解压后的工具链

2.2 一键安装

在容器内执行(或 entrypoint 自动调用):

bash /root/Agentworkspace/wsl-deploy/scripts/setup-td2026-linux.sh

脚本会:

  1. 安装 Qt/X11/GTK 等运行时依赖
  2. 解压 zip 到 /data/anlogic/TD_Release_2026.1_SP2_NL
  3. 安装 license/Anlogic.lic
  4. 创建 /usr/local/bin/td2026 包装器
  5. 写入 /etc/profile.d/anlogic-td2026.sh

2.3 验证

td2026 -version
# Release_2026.1_SP2
# Build: 6.2.2.200067

bash /root/Agentworkspace/wsl-deploy/scripts/verify-td2026-linux.sh

2.4 常用命令(最终 tip 独占)

td2026 -version

cd /path/to/repo
td2026 td/syn/prod2u_p4_normal_v3.tcl
td2026 td/phy/prod2u_p4_normal_v3.tcl
td2026 td/bitgen/prod2u_p4_normal_v3.tcl

或 tools/verify.sh --lane td(确保收据进 run 目录)。Lane A 不跑 TD;TD 由集成在 clean tip 独占执行。

2.5 环境变量

将 TD 的 LD_LIBRARY_PATH / Qt 变量限制在 TD 子进程内;勿导出到全局 shell(会破坏 apt 等工具)。

export ANLOGIC_TD2026_HOME=/data/anlogic/TD_Release_2026.1_SP2_NL
# 仅在包装器/子进程内设置 LD_LIBRARY_PATH / QT_*;勿 source 进交互 shell

3. Windows 使用(非权威参考)

活动验收与最终收据以 Linux td2026 为准。历史 Windows 收据见 docs/historical/。

可选 GUI:打开工程 → 导入 src/generated/td-source-manifest.json → 加载 constraints/prod2u_p4_normal_v3.adc / .sdc → 综合 / 布线 / bitgen。Windows 路径不是活动权威。

4. 项目 TD 脚本说明

脚本 阶段 输出
td/syn/prod2u_p4_normal_v3.tcl 综合 + RTL 优化 + CDC 检查 网表、CDC 报告
td/phy/prod2u_p4_normal_v3.tcl 布局布线 时序/面积报告
td/bitgen/prod2u_p4_normal_v3.tcl 比特流生成 .bit 文件

规则(见 td/AGENTS.md):

  • 仅以 src/generated/td-source-manifest.json 为源文件清单
  • TD 脚本中不得包含编程器/下载线缆命令
  • 生产与验证工作目录分开,独立保留收据

5. Python 验证矩阵(含 TD 通道 · Linux)

python -B tools/run_verification_matrix.py \
  --work-root-prefix "${TMPDIR:-/tmp}/prod2u-matrix" \
  --verification-run-id my-run-id \
  --lanes python,icarus,verilator,formal,cocotb,td \
  --run \
  --max-workers 4

仅生成 TD 收据(不执行):

python -B tools/prod2u_p4_harness.py td --verification-run-id my-run-id

执行 TD 构建:

python -B tools/prod2u_p4_harness.py td --run --verification-run-id my-run-id

6. 固件交付包

python -B tools/build_firmware_package.py \
  --td-root "$ANLOGIC_TD2026_HOME" \
  --verification-run-id my-run-id \
  --output-dir "${TMPDIR:-/tmp}/prod2u-handoff"

最终包须绑定真实 bitstream + 完整 SHA + commit + source-manifest + TD 报告(不能停在 hook_ready / deferred)。

7. 部署脚本位置

本包内副本(与 wsl-deploy 同步):

docs/td-linux-deploy/setup-td2026-linux.sh
docs/td-linux-deploy/verify-td2026-linux.sh
docs/td-linux-deploy/td2026-container-receipt.json

8. 故障排查

现象 处理
libQt5*.so not found 在容器内 apt install Qt5 运行库,或在 TD 子进程设置 LD_LIBRARY_PATH 指向 TD 自带 lib/Qt/lib
td2026: command not found 重跑 setup-td2026-linux.sh;容器重建后 wrapper 会丢失
license 报错 确认 license_for_website.zip 已解压到 $TD_ROOT/license/Anlogic.lic
GUI 无法启动 Linux 使用 td2026 <script.tcl> 并设置 QT_QPA_PLATFORM=offscreen

9. 相关文档

  • 协议:docs/prod2u-door-temp-protocol.zh-CN.md
  • 打包:PACKAGE_FOR_AGENT_ANALYSIS.README.zh-CN.md
  • 项目配置:projects/prod2u-door-temp/project.json