# 验证计划 ## 分层 Gate - `static`:检查顶层结构、活源码边界、活验证边界、generated artifacts 清理、TD source path 和文档关键语义。 - `model`:运行 PID model、BMC parser、control modes、contract model、debug bundle、harness、UART receipt、pin inventory 等单元测试。 - `replay`:用固定 sensor/host/expectation vector 验证控制合同。 - `hdl-sim` / `rtl-sim`:覆盖 UART RX/TX bit-level、BMC parser、bridge、system top、safety、actuator、debug 等 RTL testbench。 - `formal`:证明 PTC force-off、invalid channel、host disable history clear、thermal fault fan fallback 等性质。 - `detector-selftest`:故意坏 fixture 必须被 compile/lint/scoreboard/formal detector 抓住。 - `td --top uart_rs232_j6_host_sensor_real_fan_ptc_debug921_primary`:TD 2026.1 构建最新 real FAN/PTC 主 top;若真实 FAN/PTC pin 与三路临时串口冲突,必须输出 `blocked_pin_conflict_with_locked_debug_uart`,不能生成可刷 bitstream。 - `uart-preflight`:只读枚举 COM,要求 allowlist;未知 COM、无 allowlist、端口被占用或不可控 DTR/RTS 都不能 pass。 - `uart-protocol-offline`:用 PC 文本样本离线验证 BMC loose text hex parser。 - `uart-validate --strict`:校验 `uart-preflight-receipt-v1`、`bmc-uart-protocol-receipt-v1`、`uart-loopback-receipt-v1`、`uart-board-sram-receipt-v1`、`uart-soak-receipt-v1`。 - `final-gate-v2`:static、model、replay、RTL/HDL sim、formal、detector selftest、TD build、UART strict receipt 全部 pass 才通过。 ## UART Evidence 严格 UART receipt 必须包含: - `serial`:端口、`115200`、`8N1`、allowlist、DTR/RTS 状态。 - `transcript`:TX/RX 时间戳、原始文本、parser 结果和 `sha256`。 - `programming`:实机 SRAM 阶段只允许 `PROGRAM_SRAM`,记录 bitstream path、size、`sha256`。 - `debug_evidence`:debug UART 连续事件流和 register dump 快照。 - `counterparty`:`pc_emulator` 或 `real_bmc`。 - `safety`:flash、真实 PTC/fan/BMC 未受控动作、驱动安装/重装必须显式为 false。 ## Fake 与极端验证 - 协议:echo/no-echo、裸 hex、`0xNN`、多行、逗号、括号、引号、乱码、短帧、长帧、bad fraction、全 missing、部分 missing。 - UART bit-level:波特率误差、起始位抖动、停止位错误、break、glitch、RX overflow、TX backpressure。 - 控制:BMC stale 10s、90C overtemp、host disable、interlock、invalid channel、missing DIMM、PID history clear/freeze、fan fallback。 - Debug:frame_seq、parser_error、stale、missing_mask、PID done/fault、PTC force_off、fan fallback、config_seq。 - Soak:短时 CI、8h fake soak、24h offline fake final gate;失败轮保留 receipt,不得改写为 pass。 ## 状态语义 - `pass`:当前 gate 证据齐全且满足合同。 - `blocked_*`:环境、工具或外部状态阻塞,例如 missing simulator、无 COM allowlist、产品板 pin map 未导入。 - `fail_*`:证据违反合同,例如 forbidden action、hash mismatch、parser fail、TD/source mismatch。 任何缺工具、缺证据、dry-run、fixture、人工口述、preflight artifact 都不能写成 `pass`。 ## Offline Fidelity Gate V1 `offline-fidelity-gate-v1` 是无实物最高保真离线 gate;它不替代 `final-gate-v2`。required layers 是 `static`、`model`、`replay`、`protocol_fuzz`、`hdl_sim`、`cocotb_virtual_lab`、`virtual_driver_lab`、`formal`、`detector_selftest`、`mutation`、`thermal_digital_twin`、`coverage_matrix`、`td_build`、`debug_bundle`。所有 layer 必须实际运行并 `pass`;`blocked_*`、`partial`、`skipped`、dry-run 或缺证据不能顶层 pass。 该 gate 禁止 COM 打开、DTR/RTS、flash、主机 OS 驱动安装、真实 PTC/fan/BMC 动作,也禁止把 `hardware`、`uart_strict`、`chipwatcher`、`thermal_performance_pass` 写成离线 pass 证据。`virtual_driver_lab` 只允许用户态 driver facade、cocotb driver、pyserial loopback URL、socket/pipe/mock API 和可选隔离 VM/Sandbox receipt。Pass 只声明离线逻辑、协议、控制、安全、debug、用户态虚拟驱动、虚拟热模型、mutation 和 TD 离线工具证据通过,不声明真实电气、真实板级、真实驱动认证或真实 thermal performance。