瀏覽代碼

chore(snapshot): checkpoint normal v3 before minimal motion rewrite

Codex Resource Selftest 4 月之前
父節點
當前提交
ddd52a2aef
共有 100 個文件被更改,包括 5293 次插入 和 8868 次删除
  1. 2 0
      .gitattributes
  2. 3 0
      .gitignore
  3. 24 15
      AGENTS.md
  4. 129 41
      README.zh-CN.md
  5. 0 420
      config/pid_channels.json
  6. 0 103
      config/pin_inventory.fcb_fpga_mcu0611.json
  7. 0 131
      config/pin_inventory.mini.json
  8. 0 12
      config/pin_inventory.product.placeholder.json
  9. 0 344
      config/prod2u_p4_normal_host_contract_v3.json
  10. 645 0
      config/prod2u_p4_normal_host_contract_v4.json
  11. 22 17
      config/prod2u_p4_normal_v3_hw_binding.json
  12. 13 99
      config/prod2u_p4_normal_v3_resource_baseline.json
  13. 154 0
      config/prod2u_p4_resource_replay_v1.json
  14. 28 0
      config/prod2u_p4_rx_bram_replay_v1.json
  15. 253 0
      config/prod2u_p4_verification_targets_v1.json
  16. 0 10
      constraints/pid_study_01.adc
  17. 0 1
      constraints/pid_study_01.sdc
  18. 0 58
      constraints/prod2u_bmc_replay_binary921.adc
  19. 6 6
      constraints/prod2u_p4_normal_v3.adc
  20. 0 23
      constraints/uart_rs232_j6_host_sensor_real_fan_ptc_debug921_primary.adc
  21. 0 61
      constraints/uart_rs232_j6_host_sensor_real_fan_ptc_debug_photo_uart_bmc_replay_binary921.adc
  22. 0 61
      constraints/uart_rs232_j6_host_sensor_real_fan_ptc_debug_photo_uart_bmc_replay_debug921.adc
  23. 0 61
      constraints/uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart1_bmc_replay_binary921.adc
  24. 0 61
      constraints/uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart1_bmc_replay_debug921.adc
  25. 0 61
      constraints/uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart_debug921.adc
  26. 0 61
      constraints/uart_rs232_j6_host_sensor_real_fan_ptc_temp_uart_ptc_remap_debug921.adc
  27. 0 92
      docs/adr/0001-j6-bmc-replay-binary921-boundaries.zh-CN.md
  28. 0 15
      docs/adr/README.zh-CN.md
  29. 0 41
      docs/bmc-uart-temperature-protocol-v2.zh-CN.md
  30. 0 35
      docs/fact-source-boundary.zh-CN.md
  31. 0 24
      docs/fake-stress-verification-v2.zh-CN.md
  32. 0 23
      docs/high-temp-chamber-design-v2.zh-CN.md
  33. 0 28
      docs/interface-contract.zh-CN.md
  34. 0 202
      docs/j6-bmc-replay-binary921-architecture.zh-CN.md
  35. 0 270
      docs/j6-bmc-replay-binary921-implementation-plan-v1.zh-CN.md
  36. 0 194
      docs/j6-bmc-replay-binary921-protocol-v1.zh-CN.md
  37. 0 99
      docs/j6-host-sensor-real-fan-ptc-debug921-runbook.zh-CN.md
  38. 0 398
      docs/j6-temp-pwm-scope-manual-debug.zh-CN.md
  39. 0 96
      docs/offline-fidelity-gate-v1.zh-CN.md
  40. 0 15
      docs/offline-verification-report.zh-CN.md
  41. 0 23
      docs/pid-safety-contract-v2.zh-CN.md
  42. 0 231
      docs/prod2u-p4-normal-v3-actuator-temp-runbook.zh-CN.md
  43. 83 0
      docs/prod2u-p4-normal-v3-actuator-trace-runbook.zh-CN.md
  44. 0 162
      docs/prod2u-program-sram-runbook.zh-CN.md
  45. 0 41
      docs/prod2u-start-here.zh-CN.md
  46. 0 16
      docs/td-2026.1-evidence-index.zh-CN.md
  47. 0 29
      docs/uart-rs232-validation-strategy.zh-CN.md
  48. 0 56
      docs/verification-gates-v2.zh-CN.md
  49. 0 48
      docs/verification-plan.zh-CN.md
  50. 0 38
      schemas/bmc_uart_protocol_receipt.schema.json
  51. 0 53
      schemas/cpld_bmc_acceptance_v1_receipt.schema.json
  52. 0 72
      schemas/final_gate_v2_receipt.schema.json
  53. 0 88
      schemas/j6_host_sensor_real_fan_ptc_debug921_pin_conflict_blocked_manifest.schema.json
  54. 0 59
      schemas/j6_host_sensor_real_fan_ptc_debug921_pin_conflict_blocked_package.schema.json
  55. 0 49
      schemas/j6_host_sensor_real_fan_ptc_debug921_pin_conflict_blocked_sha256_inventory.schema.json
  56. 0 292
      schemas/offline_fidelity_gate_v1_receipt.schema.json
  57. 0 130
      schemas/prod2u_evidence_manifest.schema.json
  58. 0 51
      schemas/prod2u_final_gate.schema.json
  59. 0 390
      schemas/prod2u_p4_normal_host_contract_v3.schema.json
  60. 703 0
      schemas/prod2u_p4_normal_host_contract_v4.schema.json
  61. 0 80
      schemas/prod2u_p4_normal_v3_actuator_temp_gate_receipt.schema.json
  62. 483 0
      schemas/prod2u_p4_normal_v3_actuator_trace_hardware_session.schema.json
  63. 289 0
      schemas/prod2u_p4_normal_v3_final_gate_receipt.schema.json
  64. 227 2
      schemas/prod2u_p4_normal_v3_formal_receipt.schema.json
  65. 82 3
      schemas/prod2u_p4_normal_v3_hdl_sim_receipt.schema.json
  66. 321 0
      schemas/prod2u_p4_normal_v3_offline_gate_receipt.schema.json
  67. 123 0
      schemas/prod2u_p4_normal_v3_package_selftest_receipt.schema.json
  68. 331 6
      schemas/prod2u_p4_normal_v3_resource_baseline.schema.json
  69. 929 16
      schemas/prod2u_p4_normal_v3_td_build_receipt.schema.json
  70. 123 0
      schemas/prod2u_p4_normal_v3_trace_events.schema.json
  71. 109 0
      schemas/prod2u_p4_rx_bram_ab_decision_receipt.schema.json
  72. 35 0
      schemas/prod2u_p4_rx_bram_candidate_producer_receipt.schema.json
  73. 67 0
      schemas/prod2u_p4_rx_bram_equivalence_receipt.schema.json
  74. 109 0
      schemas/prod2u_p4_rx_bram_equivalence_run_receipt.schema.json
  75. 0 65
      schemas/prod2u_td_build_receipt.schema.json
  76. 0 275
      schemas/real_bmc_j6_host_sensor_real_fan_ptc_debug921_v1_receipt.schema.json
  77. 0 169
      schemas/real_bmc_j6_windows_gate_v2_receipt.schema.json
  78. 0 69
      schemas/uart_board_sram_receipt.schema.json
  79. 0 50
      schemas/uart_loopback_receipt.schema.json
  80. 0 39
      schemas/uart_preflight_receipt.schema.json
  81. 0 38
      schemas/uart_soak_receipt.schema.json
  82. 0 161
      src/rtl/actuator_domain.v
  83. 0 75
      src/rtl/actuator_sink.v
  84. 0 771
      src/rtl/binary921_diag_core.v
  85. 0 200
      src/rtl/binary921_host_rx.v
  86. 0 108
      src/rtl/bmc_dimm_frame_parser.v
  87. 0 385
      src/rtl/bmc_uart_ascii_poll.v
  88. 0 73
      src/rtl/bmc_uart_phy_bridge.v
  89. 0 307
      src/rtl/bmc_uart_raw48_poll_lite.v
  90. 0 19
      src/rtl/board_io_adapter.v
  91. 0 275
      src/rtl/control_service_24ch.v
  92. 0 45
      src/rtl/debug_probe_bus.v
  93. 0 51
      src/rtl/debug_register_window.v
  94. 0 145
      src/rtl/debug_snapshot_v2.v
  95. 0 66
      src/rtl/debug_trace_recorder_bram.v
  96. 0 35
      src/rtl/debug_trigger_unit.v
  97. 0 122
      src/rtl/debug_uart_stream.v
  98. 0 54
      src/rtl/fake_host_config.v
  99. 0 158
      src/rtl/fake_sensor_source.v
  100. 0 0
      src/rtl/fan_tach_domain.v

+ 2 - 0
.gitattributes

@@ -5,6 +5,8 @@
 *.md text eol=lf
 *.prj text eol=lf
 *.py text eol=lf
+*.patch text eol=lf
+*.sby text eol=lf
 *.sdc text eol=lf
 *.tcl text eol=lf
 *.v text eol=lf

+ 3 - 0
.gitignore

@@ -24,6 +24,8 @@ td/project/.lock.f
 td/project/*_Runs/
 td/project/log/
 td/project/.recent_user_depot.ini
+tests/formal/*/
+obj_dir/
 *.db
 *.bit
 *.bid
@@ -40,6 +42,7 @@ tmp_last_pkg*.txt
 
 # Python/runtime caches.
 .codex/
+.planning/
 __pycache__/
 *.py[cod]
 .pytest_cache/

+ 24 - 15
AGENTS.md

@@ -1,26 +1,35 @@
 # CPLD Agent Instructions
 
-本仓库是单一顶层 CPLD PID 工程。workspace 不再是活工程入口,不能新增旧 study、教学工程或运行副本作为开发入口。
+本仓库只有一个生产 CPLD 工程:Prod2U Profile 4 Normal v3。
 
 ## 工程边界
 
-- 活源码只放在 `src/rtl/`、`src/top/`。
-- 活验证只放在 `tests/`、`tools/`、`td/`、`config/`、`constraints/`、`schemas/`。
-- 原始资料只放在 `reference/original/`;安装包、license、私有压缩包只能本地保留并由 `.gitignore` 排除。
-- 不要把 `td/build/`、`tmp/`、TD GUI runtime、bit/bid/data/log/timing/area 当成源码基线。
+- 唯一生产顶层是 `src/top/prod2u_p4_normal_v3_top.v`。
+- 活 RTL 只放在 `src/rtl/`,活验证只放在 `tests/`、`tools/`、`td/`、`config/`、`constraints/`、`schemas/`。
+- `td/prod2u_p4_normal_v3.prj` 及同名 syn/phy/bitgen 脚本是唯一 TD 工程入口。
+- `reference/original/**` 和 `receipts/**` 是只读历史证据,不得修改、重写或作为当前 gate 的通过证据。
+- `.planning/` 属于用户工作区;不得删除、提交或纳入构建输入。
+- `td/build/`、`tmp/`、TD GUI runtime、bit/bid/data/log/timing/area 都是生成物,不得纳入源码基线。
 
-## 验证边界
+## 功能边界
 
-- 当前 final gate 是 `final-gate-v2`,证据核心是 software/model/replay/RTL/formal/detector/TD elaboration/UART strict receipt。
-- `uart-preflight` 只能枚举串口,禁止打开未知 COM 口或切换 DTR/RTS。
-- `uart-board-sram-test` 类 receipt 只允许 `PROGRAM_SRAM`,必须记录 bitstream hash、串口 transcript hash、debug UART 事件流、register dump 和 counterparty。
-- `final-gate-v2` 只接受所有 required layer 为 `pass`;`blocked_*`、`fail_*`、dry-run、fixture 或缺证据都不等于 pass。
-- 机器 gate 的 pass 只声明控制通讯链路和软件安全策略通过,不声明完整 thermal performance。
+- 保留 24 路 PTC、4 路 FAN、solenoid、UART、X/Y 电机与关闭端限位,Z 仅保留协议位置。
+- PTC/FAN 是主机直接控制输出;CPLD 不声明本地热闭环或热保护能力。
+- binary921-v3 输入 envelope、Profile ID 4、50 字节输出 snapshot 和 10 字节 MOTION_STATUS 保持兼容。
+- Trace 是主动发送的数据面;主机必须持续解析 Trace、ACK 和状态帧,不得依赖旧式单响应假设。
 
-## 安全边界
+## 验证边界
 
-禁止 flash、驱动安装/重装、真实 PTC/fan/BMC 未受控动作。任何出现 `PROGRAM_FLASH`、`ERASE_FLASH`、`PROGRAM_SPIBIN`、`DIRECT_FLASH_WRITE`、真实热闭环动作的路径必须 fail closed。
+- 离线 gate 必须覆盖 software/model/RTL/formal/CDC/STA/TD、协议兼容、资源和独立故障注入。
+- TD 资源差值是 advisory;Trace 恰好使用一个 9K BRAM、DSP 为零、IO 为 41、时序为正属于结构性要求。
+- 任何 blocked、fail、dry-run、fixture 或缺失证据都不等于 pass。
+- 离线验证和 bitstream 生成不等于实板验收。
+- 资源 baseline 只能由 clean C1 的 `resource-baseline-produce` 生成。只有 measured baseline JSON 进入 Git;U clone、patch、bundle、producer evidence、8 proof、aggregate/audit、U/O TD、bitstream、package 和 final receipt 全部留在仓外。
+- Windows PowerShell 或 agent 运行 Verilator 前,必须先执行 `. .\tools\activate_verification_toolchain.ps1`,或由 harness/native resolver 显式调用 `verilator_bin.exe`/`verilator.exe`;子 PowerShell 只能经 `tools/toolchain_shims/verilator.ps1` 转发,`cmd.exe` 必须显式调用 `%VERILATOR%` 对应的原生 EXE。禁止执行 PATH 中无扩展名的 `verilator` wrapper,且不得修改用户或系统全局配置、文件关联或全局 PATH。
 
-## 更新要求
+## 硬件安全边界
 
-新增真实板级 PID、flash、驱动、外部仪器或生产硬件动作时,必须同时新增独立 gate、receipt schema、rollback/安全边界和中文 runbook。
+- 禁止 Flash、驱动安装/重装、真实 PTC 加热、温度实验和 Z 轴动作。
+- 最终硬件 gate 最多执行一次 `PROGRAM_SRAM @ 200 kHz`,异常不得自动重试或再次编程。
+- 编程后立即发送 DISABLE,不等待 READY;结束前必须确认 STEP 全低、EN_N 高和 DISABLE 已确认。
+- 实板不得注入限位断线/卡死、完整 65535 步无限位或 RECOVERY 故障;这些风险由离线仿真、formal 和独立模型覆盖。

文件差異過大導致無法顯示
+ 129 - 41
README.zh-CN.md


+ 0 - 420
config/pid_channels.json

@@ -1,420 +0,0 @@
-{
-  "schema": "pid-high-temp-chamber-config-v2",
-  "project": "pid_study_01",
-  "authority_boundary": "offline_contract_for_v2_high_temp_chamber_control_plane",
-  "fixed_point": {
-    "temperature_q": {
-      "width": 18,
-      "scale": "integer_celsius"
-    },
-    "control_q": {
-      "width": 18,
-      "scale": "abstract_pwm_level_0_127"
-    }
-  },
-  "physical_topology": {
-    "channel_count": 24,
-    "dimm_count": 24,
-    "ptc_count": 24,
-    "mapping_policy": "bmc_order_equals_physical_order_equals_ptc_channel_order",
-    "cpu_channel_ranges": [
-      {
-        "cpu_id": 0,
-        "channels": [
-          0,
-          1,
-          2,
-          3,
-          4,
-          5,
-          6,
-          7,
-          8,
-          9,
-          10,
-          11
-        ]
-      },
-      {
-        "cpu_id": 1,
-        "channels": [
-          12,
-          13,
-          14,
-          15,
-          16,
-          17,
-          18,
-          19,
-          20,
-          21,
-          22,
-          23
-        ]
-      }
-    ],
-    "airflow_zones": [
-      {
-        "zone_id": 0,
-        "name": "front_left_6_dimm",
-        "channels": [
-          0,
-          1,
-          2,
-          3,
-          4,
-          5
-        ]
-      },
-      {
-        "zone_id": 1,
-        "name": "middle_12_dimm",
-        "channels": [
-          6,
-          7,
-          8,
-          9,
-          10,
-          11,
-          12,
-          13,
-          14,
-          15,
-          16,
-          17
-        ]
-      },
-      {
-        "zone_id": 2,
-        "name": "rear_right_6_dimm",
-        "channels": [
-          18,
-          19,
-          20,
-          21,
-          22,
-          23
-        ]
-      }
-    ],
-    "fans": {
-      "fan_count": 6,
-      "front_fans": [
-        0,
-        1,
-        2
-      ],
-      "rear_fans": [
-        3,
-        4,
-        5
-      ],
-      "default_role": "background_airflow_only",
-      "fault_role": "full_speed_fallback"
-    }
-  },
-  "channels": {
-    "logical_channel_count": 24,
-    "dimm_count": 24,
-    "ptc_count": 24,
-    "airflow_zone_count": 3,
-    "channels_per_airflow_zone": [
-      6,
-      12,
-      6
-    ],
-    "default_dimm_to_channel_map": [
-      0,
-      1,
-      2,
-      3,
-      4,
-      5,
-      6,
-      7,
-      8,
-      9,
-      10,
-      11,
-      12,
-      13,
-      14,
-      15,
-      16,
-      17,
-      18,
-      19,
-      20,
-      21,
-      22,
-      23
-    ],
-    "channel_to_cpu": [
-      0,
-      0,
-      0,
-      0,
-      0,
-      0,
-      0,
-      0,
-      0,
-      0,
-      0,
-      0,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1
-    ],
-    "channel_to_airflow_zone": [
-      0,
-      0,
-      0,
-      0,
-      0,
-      0,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1,
-      1,
-      2,
-      2,
-      2,
-      2,
-      2,
-      2
-    ]
-  },
-  "input_sources": {
-    "default_source_select": "bmc_uart_text",
-    "auto_priority_enabled": false,
-    "supported_sources": [
-      "bmc_uart_text",
-      "fake_stress",
-      "host_register_inject",
-      "uart_debug_replay"
-    ],
-    "deprecated_sources": [
-      "i2c_adc_master_pull",
-      "i2c_adc_slave_inject",
-      "rs232_temperature_inject",
-      "rs485_temperature_inject"
-    ]
-  },
-  "bmc_uart_poll": {
-    "uart": "115200 8N1",
-    "poll_period_ms": 1000,
-    "stale_timeout_ms": 10000,
-    "command_ascii": "ipmitool raw 0x36 0x6c 0xdf 0xdd 0x00 0x03\n",
-    "response_format": "loose_text_hex",
-    "token_compatibility": [
-      "space",
-      "comma",
-      "parentheses",
-      "quotes",
-      "0xNN",
-      "multiline",
-      "echo",
-      "no_echo"
-    ],
-    "expected_payload_bytes": 48,
-    "expected_dimm_count": 24,
-    "bytes_per_dimm": 2,
-    "integer_byte_index": 0,
-    "fraction_byte_index": 1,
-    "fraction_scale": 100,
-    "missing_pair": "ff ff",
-    "frame_selection": "sliding_window_semantic_validation",
-    "echo_rejection": "ignore_windows_containing_poll_command_bytes",
-    "evidence_boundary": "offline_text_hex_parser_contract"
-  },
-  "host_config_link": {
-    "interface": "independent_host_uart_or_register_plane",
-    "must_not_share_bmc_temperature_uart": true,
-    "host_target_range_policy": "host_may_configure_arbitrary_target_but_hard_protection_overrides"
-  },
-  "default_host_config": {
-    "enable": true,
-    "target_q": 70,
-    "a0": 4,
-    "a1": -1,
-    "a2": 1,
-    "mode": 3,
-    "config_seq": 1,
-    "watchdog": true
-  },
-  "control": {
-    "default_mode": "incremental_pid_default",
-    "mode_encoding": {
-      "safe_off": 0,
-      "hysteresis_pi_experimental": 1,
-      "manual_level": 2,
-      "incremental_pid_default": 3
-    },
-    "default_target_q": 70,
-    "target_tolerance_q": 5,
-    "steady_state_acceptance_seconds": 600,
-    "kp_q": 4,
-    "ki_q": 1,
-    "power_limit_default": 32,
-    "first_real_pid_duty_limit_percent": 25,
-    "manual_level_default": 0,
-    "incremental_pid_default_allowed": true,
-    "disable_clear_history_policy": "clear_channel_history",
-    "missing_or_fault_history_policy": "clear_channel_history"
-  },
-  "safety": {
-    "stale_timeout_cycles": 10,
-    "global_bmc_timeout_cycles": 10,
-    "control_period_ms": 1000,
-    "overtemp_limit_q": 90,
-    "missing_dimm_policy": "ptc_off_exclude_from_steady_state_stats_record_in_debug",
-    "upper_pc_disconnect_policy": "keep_last_valid_target_until_host_watchdog_policy_is_defined",
-    "bmc_stale_policy": "force_off_all_ptc_fan_full",
-    "overtemp_policy": "force_off_all_ptc_fan_full_latched",
-    "fault_latch_default": true
-  },
-  "fan_policy": {
-    "fan_count": 6,
-    "default_strategy": "fixed_background",
-    "dynamic_pid_fan_control": "disabled_until_thermal_calibration",
-    "background_percent": 30,
-    "background_level": 38,
-    "fallback_percent": 100,
-    "fallback_level": 127
-  },
-  "pwm_outputs": {
-    "sys_clk_hz": 25000000,
-    "duty_max": 127,
-    "ptc": {
-      "channel_count": 24,
-      "default_pwm_hz": 10,
-      "min_pwm_hz": 1,
-      "max_pwm_hz": 500,
-      "polarity": "active_high_request",
-      "safe_state": 0,
-      "first_real_pid_duty_limit": 32
-    },
-    "fan": {
-      "fan_count": 6,
-      "default_pwm_hz": 25000,
-      "min_pwm_hz": 21000,
-      "max_pwm_hz": 28000,
-      "normal_percent": 30,
-      "normal_level": 38,
-      "fallback_percent": 100,
-      "fallback_level": 127,
-      "output_stage": "open_drain_low_true",
-      "tach_pulses_per_revolution": 2,
-      "tach_window_ms": 1000
-    }
-  },
-  "fake_stress": {
-    "scenario_seed": 260626,
-    "model_status": "verification_default_not_real_thermal_parameter",
-    "self_coupling": 1.0,
-    "neighbor_channel_coupling": 0.04,
-    "same_airflow_zone_non_neighbor_coupling": 0.01,
-    "cross_airflow_zone_coupling": 0.005,
-    "supported_events": [
-      "ramp",
-      "step",
-      "noise",
-      "missing_mask",
-      "bmc_stale",
-      "echo_no_echo",
-      "parser_garbage",
-      "full_rate_sweep"
-    ],
-    "ci_short_seconds": 60,
-    "nightly_soak_hours": 8,
-    "final_offline_gate_hours": 24
-  },
-  "host_replay_updates": [
-    {
-      "effective_sample_seq": 13,
-      "enable": true,
-      "target_q": 70,
-      "a0": 3,
-      "a1": -1,
-      "a2": 1,
-      "mode": 3,
-      "config_seq": 2,
-      "source": "fake_host",
-      "interface": "host_uart_or_register",
-      "command": "SET_TARGET_AND_PID"
-    },
-    {
-      "effective_sample_seq": 28,
-      "enable": false,
-      "target_q": 70,
-      "a0": 3,
-      "a1": -1,
-      "a2": 1,
-      "mode": 3,
-      "config_seq": 3,
-      "source": "fake_host",
-      "interface": "host_uart_or_register",
-      "command": "SET_ENABLE_OFF"
-    }
-  ],
-  "actuator": {
-    "kind": "abstract_ptc_pwm_level",
-    "actuator_count": 24,
-    "out_min": 0,
-    "out_max": 127,
-    "safe_default": "force_off"
-  },
-  "debug_trace": {
-    "required_fields": [
-      "trace_seq",
-      "source_id",
-      "channel",
-      "dimm_id",
-      "cpu_id",
-      "airflow_zone",
-      "frame_seq",
-      "raw_integer_byte",
-      "raw_fraction_byte",
-      "raw_status",
-      "missing",
-      "temp_q",
-      "age_ms",
-      "target_q",
-      "error_q",
-      "control_mode",
-      "ctrl_q",
-      "clamped",
-      "ptc_duty",
-      "fan_duty",
-      "fault_code",
-      "config_seq",
-      "sample_seq",
-      "parser_state",
-      "missing_mask"
-    ]
-  },
-  "replay": {
-    "sensor_vector": "test_vectors/sensor_replay_basic.csv",
-    "host_vector": "test_vectors/host_config_replay_basic.csv",
-    "expectation_vector": "test_vectors/actuator_expectations_basic.csv",
-    "sample_count": 28
-  }
-}

文件差異過大導致無法顯示
+ 0 - 103
config/pin_inventory.fcb_fpga_mcu0611.json


+ 0 - 131
config/pin_inventory.mini.json

@@ -1,131 +0,0 @@
-{
-  "schema": "cpld-pin-inventory-v1",
-  "board_id": "ef2l45bg256b_mini_v2",
-  "board_role": "development_validation_carrier",
-  "clock_hz": 25000000,
-  "manual_verification_required": true,
-  "product_thermal_gate_allowed": false,
-  "electrical_boundary": "FPGA IO is 3.3V UART only. External MAX3232 RS232 level shifter required between GPIO UART and RJ45 RS232 wiring.",
-  "source_documents": [
-    {
-      "kind": "hardware_user_guide",
-      "path": "reference/original/board/EF2L45BG256B_MINI_V2.0/EF2L45BG256B_MINI_V2.0板文档/TN427_安路科技EF2L45BG256B_MINI板硬件使用指南.pdf",
-      "confidence": "primary_manual_cross_check_required"
-    },
-    {
-      "kind": "schematic_pdf",
-      "path": "reference/original/board/EF2L45BG256B_MINI_V2.0/EF2L45BG256B_MINI_V2.0原理图/EF2L45BG256B_MINI_V2.0dsn.pdf",
-      "confidence": "schematic_cross_check_required"
-    }
-  ],
-  "pins": [
-    {
-      "signal": null,
-      "connector": "J5",
-      "connector_pin": 5,
-      "fpga_ball": "D2",
-      "io_standard": "LVCMOS33",
-      "role": "user_io",
-      "capability": ["gpio", "uart_rx", "uart_tx"],
-      "reserved": false,
-      "manually_verified": false,
-      "source_confidence": "tn427_cross_check_required"
-    },
-    {
-      "signal": null,
-      "connector": "J5",
-      "connector_pin": 6,
-      "fpga_ball": "D3",
-      "io_standard": "LVCMOS33",
-      "role": "user_io",
-      "capability": ["gpio", "uart_rx", "uart_tx"],
-      "reserved": false,
-      "manually_verified": false,
-      "source_confidence": "tn427_cross_check_required"
-    },
-    {
-      "signal": null,
-      "connector": "J6",
-      "connector_pin": 5,
-      "fpga_ball": "T4",
-      "io_standard": "LVCMOS33",
-      "role": "user_io",
-      "capability": ["gpio", "uart_rx", "uart_tx"],
-      "reserved": false,
-      "manually_verified": false,
-      "source_confidence": "tn427_cross_check_required"
-    },
-    {
-      "signal": null,
-      "connector": "J6",
-      "connector_pin": 6,
-      "fpga_ball": "R5",
-      "io_standard": "LVCMOS33",
-      "role": "user_io",
-      "capability": ["gpio", "uart_rx", "uart_tx"],
-      "reserved": false,
-      "manually_verified": false,
-      "source_confidence": "tn427_cross_check_required"
-    },
-    {
-      "signal": "+3V3",
-      "connector": "J5",
-      "connector_pin": 1,
-      "fpga_ball": "PWR_3V3_J5_1",
-      "io_standard": null,
-      "role": "power",
-      "capability": ["power"],
-      "reserved": true,
-      "manually_verified": false,
-      "source_confidence": "tn427_cross_check_required"
-    },
-    {
-      "signal": "GND",
-      "connector": "J5",
-      "connector_pin": 37,
-      "fpga_ball": "GND_J5_37",
-      "io_standard": null,
-      "role": "gnd",
-      "capability": ["gnd"],
-      "reserved": true,
-      "manually_verified": false,
-      "source_confidence": "tn427_cross_check_required"
-    },
-    {
-      "signal": "GND",
-      "connector": "J5",
-      "connector_pin": 38,
-      "fpga_ball": "GND_J5_38",
-      "io_standard": null,
-      "role": "gnd",
-      "capability": ["gnd"],
-      "reserved": true,
-      "manually_verified": false,
-      "source_confidence": "tn427_cross_check_required"
-    },
-    {
-      "signal": "GND",
-      "connector": "J6",
-      "connector_pin": 39,
-      "fpga_ball": "GND_J6_39",
-      "io_standard": null,
-      "role": "gnd",
-      "capability": ["gnd"],
-      "reserved": true,
-      "manually_verified": false,
-      "source_confidence": "tn427_cross_check_required"
-    },
-    {
-      "signal": "GND",
-      "connector": "J6",
-      "connector_pin": 40,
-      "fpga_ball": "GND_J6_40",
-      "io_standard": null,
-      "role": "gnd",
-      "capability": ["gnd"],
-      "reserved": true,
-      "manually_verified": false,
-      "source_confidence": "tn427_cross_check_required"
-    }
-  ]
-}

+ 0 - 12
config/pin_inventory.product.placeholder.json

@@ -1,12 +0,0 @@
-{
-  "schema": "cpld-pin-inventory-v1",
-  "board_id": "product_board_placeholder",
-  "board_role": "final_product_board",
-  "status": "product_pin_map_missing",
-  "clock_hz": 25000000,
-  "manual_verification_required": true,
-  "product_thermal_gate_allowed": false,
-  "electrical_boundary": "Product board schematic, pin map, driver circuits, interlock wiring, and rollback evidence are not imported yet.",
-  "source_documents": [],
-  "pins": []
-}

+ 0 - 344
config/prod2u_p4_normal_host_contract_v3.json

@@ -1,344 +0,0 @@
-{
-  "schema": "prod2u-p4-normal-host-contract-v3",
-  "profile": "prod2u-p4-normal-actuator-temp-binary921-v3",
-  "protocol": "binary921-v3",
-  "transport": {
-    "port": "COM5",
-    "baud": 921600,
-    "data_bits": 8,
-    "parity": "N",
-    "stop_bits": 1,
-    "format": "8N1",
-    "external_level": "RS232",
-    "dtr": false,
-    "rts": false
-  },
-  "standard_frame": {
-    "magic_hex": "A5 5A",
-    "version": 2,
-    "profile_id": 4,
-    "header_bytes": 14,
-    "trailer_crc_bytes": 2,
-    "offsets": {
-      "magic": [0, 1],
-      "version": 2,
-      "profile_id": 3,
-      "frame_type": 4,
-      "seq": [5, 8],
-      "timestamp": [9, 12],
-      "payload_length": 13,
-      "payload_start": 14,
-      "crc": "after_payload"
-    },
-    "seq_required": 0,
-    "timestamp_required": 0,
-    "strict_validation": {
-      "magic": true,
-      "version": true,
-      "profile": true,
-      "frame_type": true,
-      "exact_length": true,
-      "crc": true,
-      "nonzero_seq_rejected": true,
-      "nonzero_timestamp_rejected": true,
-      "replay_cache": false,
-      "duplicate_tracking": false,
-      "conflict_tracking": false
-    },
-    "crc": {
-      "algorithm": "CRC-16/CCITT-FALSE",
-      "polynomial": 4129,
-      "initial": 65535,
-      "reflect_input": false,
-      "reflect_output": false,
-      "xor_out": 0,
-      "encoding": "u16_le",
-      "coverage_start_offset": 2,
-      "coverage_end": "final_payload_byte"
-    }
-  },
-  "boot_build_id": {
-    "frame_type": 4,
-    "payload_length": 8,
-    "full_frame_length": 24,
-    "build_id_offsets": [14, 17],
-    "build_id_encoding": "u32_le",
-    "capability_offsets": [18, 21],
-    "capability": 8111,
-    "capability_wire_le": "AF 1F 00 00",
-    "announcement_count": 1,
-    "ready_semantics": false,
-    "gates_first_command": false
-  },
-  "commands": {
-    "set_output_snapshot": {
-      "frame_type": 7,
-      "command": 42,
-      "flags": 0,
-      "payload_length": 34,
-      "full_frame_length": 50,
-      "crc_coverage_offsets": [2, 47],
-      "byte_offsets": {
-        "command": 14,
-        "flags": 15,
-        "ptc": [16, 39],
-        "fan": [40, 43],
-        "solenoid": 44,
-        "x": 45,
-        "y": 46,
-        "z": 47,
-        "crc": [48, 49]
-      },
-      "accepted_values": {
-        "ptc_percent": {"minimum": 0, "maximum": 100},
-        "fan_percent": {"minimum": 0, "maximum": 100},
-        "solenoid": [0, 100],
-        "x": [0, 100],
-        "y": [0, 100],
-        "z": [0, 100]
-      },
-      "invalid_field_rejects_entire_frame": true,
-      "synchronous_outputs": ["PTC1..24", "FAN1..4", "solenoid"],
-      "solenoid_physical_semantics": {
-        "0": "P5_low_deenergized_intake_open",
-        "100": "P5_high_energized_intake_closed"
-      },
-      "hardware_qualified_motor_axes": ["X", "Y"],
-      "protocol_reserved_motor_axes": ["Z"],
-      "motor_axes_independent": true,
-      "busy_or_invalid_axis_no_queue": true,
-      "response": "HOST_ACK"
-    },
-    "get_status": {
-      "frame_type": 5,
-      "command": 36,
-      "payload_length": 4,
-      "full_frame_length": 20,
-      "payload_hex": "24 00 00 00",
-      "response": "HOST_ACK",
-      "refreshes_watchdog": false
-    },
-    "disable": {
-      "frame_type": 5,
-      "command": 38,
-      "payload_length": 4,
-      "full_frame_length": 20,
-      "payload_hex": "26 00 00 00",
-      "response": "HOST_ACK",
-      "applies_safe_state": true
-    },
-    "jog": {
-      "frame_type": 17,
-      "command": 53,
-      "payload_length": 8,
-      "full_frame_length": 24,
-      "payload_layout": "35 axis raw_dir speed_code steps_u16_le 00 00",
-      "axis_codes": {"X": 0, "Y": 1, "Z": 2},
-      "raw_dir_values": [0, 1],
-      "speed_step_per_s": {"0": 20, "1": 40, "2": 100, "3": 1000},
-      "steps_min": 1,
-      "steps_max": 160,
-      "response": "HOST_ACK"
-    },
-    "mark_closed": {
-      "frame_type": 17,
-      "command": 54,
-      "payload_length": 8,
-      "full_frame_length": 24,
-      "payload_layout": "36 02 close_dir 00 00 00 00 00",
-      "axis_fixed": 2,
-      "close_dir_values": [0, 1],
-      "hardware_qualification": "protocol_only_not_exercised",
-      "response": "HOST_ACK"
-    },
-    "get_motor_status": {
-      "frame_type": 17,
-      "command": 55,
-      "payload_length": 8,
-      "full_frame_length": 24,
-      "payload_hex": "37 00 00 00 00 00 00 00",
-      "responses": ["HOST_ACK", "MOTION_STATUS"]
-    },
-    "get_temperatures": {
-      "frame_type": 5,
-      "command": 41,
-      "payload_length": 4,
-      "full_frame_length": 20,
-      "payload_hex": "29 00 00 00",
-      "ack_sent": false,
-      "response": "TEMPERATURE_RESPONSE"
-    }
-  },
-  "responses": {
-    "host_ack": {
-      "frame_type": 6,
-      "payload_length": 8,
-      "full_frame_length": 24,
-      "byte_offsets": {
-        "ok": 14,
-        "command": 15,
-        "status": 16,
-        "detail": 17,
-        "state_hash16": [18, 19],
-        "response_type": 20,
-        "result_flags": 21,
-        "crc": [22, 23]
-      },
-      "state_hash16": {
-        "algorithm": "CRC-16/CCITT-FALSE",
-        "encoding": "u16_le",
-        "input_order": ["PTC1..24", "FAN1..4", "solenoid"],
-        "input_bytes": 29
-      },
-      "snapshot_detail_bits": {
-        "x_busy": 0,
-        "y_busy": 1,
-        "z_busy": 2,
-        "x_position_invalid": 3,
-        "y_position_invalid": 4,
-        "z_position_invalid": 5
-      },
-      "snapshot_result_flag_bits": {
-        "synchronous_outputs_committed": 0,
-        "x_accepted_or_noop": 1,
-        "y_accepted_or_noop": 2,
-        "z_accepted_or_noop": 3
-      },
-      "get_status_detail_bits": {
-        "disabled": 0,
-        "watchdog_timeout": 1
-      },
-      "status_codes": {
-        "OK": 0,
-        "UNSUPPORTED_IN_PROFILE": 1,
-        "BAD_FLAGS": 2,
-        "BAD_LENGTH": 3,
-        "BAD_VALUE": 5,
-        "BUSY": 9,
-        "PARTIAL": 22
-      },
-      "command_response_contracts": {
-        "get_status": {
-          "response_type": 0,
-          "result_flags": 0,
-          "detail_used_bits": [0, 1],
-          "detail_reserved_mask": 252,
-          "reserved_detail_bits_zero": true
-        },
-        "get_motor_status": {
-          "response_type": 18,
-          "result_flags": 8,
-          "detail": 0
-        },
-        "snapshot_ok": {
-          "ok": 1,
-          "status": 0,
-          "detail": 0,
-          "response_type": 0,
-          "result_flags": 15
-        },
-        "snapshot_partial": {
-          "ok": 1,
-          "status": 22,
-          "response_type": 0,
-          "synchronous_outputs_committed_flag_bit": 0,
-          "axis_result_flag_bits": [1, 2, 3],
-          "axis_result_flag_set_iff_not_busy_or_invalid": true,
-          "detail_axis_skip_bits": [0, 1, 2, 3, 4, 5],
-          "detail_reserved_mask": 192,
-          "reserved_detail_bits_zero": true
-        }
-      }
-    },
-    "motion_status": {
-      "frame_type": 18,
-      "payload_length": 10,
-      "full_frame_length": 26,
-      "byte_offsets": {
-        "flags": 14,
-        "valid_mask": 15,
-        "busy_mask": 16,
-        "current_xyz": [17, 19],
-        "target_xyz": [20, 22],
-        "fault_mask": 23,
-        "crc": [24, 25]
-      },
-      "position_values": [0, 100, 254, 255],
-      "intermediate_position": 254,
-      "unknown_position": 255,
-      "flag_bits": {
-        "any_busy": 0,
-        "en_active": 1,
-        "disabled": 2,
-        "watchdog_timeout": 3
-      },
-      "reserved_flag_mask": 240,
-      "reserved_flag_bits_zero": true
-    },
-    "temperature_response": {
-      "frame_type": 41,
-      "compact_frame": true,
-      "standard_envelope": false,
-      "full_frame_length": 61,
-      "raw_channel_count": 27,
-      "byte_offsets": {
-        "magic": [0, 1],
-        "version": 2,
-        "profile_id": 3,
-        "frame_type": 4,
-        "raw_u16_le": [5, 58],
-        "crc": [59, 60]
-      },
-      "has_seq": false,
-      "has_timestamp": false,
-      "has_payload_length": false,
-      "crc": {
-        "algorithm": "CRC-16/CCITT-FALSE",
-        "encoding": "u16_le",
-        "coverage_offsets": [2, 58]
-      },
-      "device_order": [
-        {
-          "device": "U6",
-          "address_7bit": 73,
-          "channels": ["Local", "Remote1", "Remote2", "Remote3", "Remote4", "Remote5", "Remote6", "Remote7", "Remote8"]
-        },
-        {
-          "device": "U24",
-          "address_7bit": 72,
-          "channels": ["Local", "Remote1", "Remote2", "Remote3", "Remote4", "Remote5", "Remote6", "Remote7", "Remote8"]
-        },
-        {
-          "device": "U25",
-          "address_7bit": 75,
-          "channels": ["Local", "Remote1", "Remote2", "Remote3", "Remote4", "Remote5", "Remote6", "Remote7", "Remote8"]
-        }
-      ],
-      "invalid_raw": 65535,
-      "celsius_formula": "int16(raw)/128.0"
-    }
-  },
-  "programming": {
-    "operation": "PROGRAM_SRAM",
-    "speed_hz": 200000,
-    "attempt_limit": 1,
-    "automatic_retry": false,
-    "flash_allowed": false
-  },
-  "safety": {
-    "ptc_actuation_allowed": false,
-    "watchdog_timeout_seconds": 5,
-    "safe_state": {
-      "ptc_percent": 0,
-      "fan_percent": [30, 30, 30, 30],
-      "solenoid": 0,
-      "solenoid_p5_level": 0,
-      "solenoid_effect": "intake_open",
-      "step_all_low": true,
-      "en_n_high": true
-    },
-    "reset_applies_safe_state": true,
-    "disable_applies_safe_state": true,
-    "watchdog_applies_safe_state": true
-  }
-}

+ 645 - 0
config/prod2u_p4_normal_host_contract_v4.json

@@ -0,0 +1,645 @@
+{
+  "schema": "prod2u-p4-normal-host-contract-v4",
+  "profile": "prod2u-p4-normal-actuator-trace-binary921-v3",
+  "protocol": "binary921-v3",
+  "host_compatibility": {
+    "minimum_contract": "v4",
+    "legacy_v3_compatible": false,
+    "incompatibility_reason": "unsolicited_trace_event_frames"
+  },
+  "transport": {
+    "port": "COM5",
+    "baud": 921600,
+    "data_bits": 8,
+    "parity": "N",
+    "stop_bits": 1,
+    "format": "8N1",
+    "external_level": "RS232",
+    "dtr": false,
+    "rts": false
+  },
+  "standard_frame": {
+    "magic_hex": "A5 5A",
+    "version": 2,
+    "profile_id": 4,
+    "header_bytes": 14,
+    "trailer_crc_bytes": 2,
+    "offsets": {
+      "magic": [0, 1],
+      "version": 2,
+      "profile_id": 3,
+      "frame_type": 4,
+      "seq": [5, 8],
+      "timestamp": [9, 12],
+      "payload_length": 13,
+      "payload_start": 14,
+      "crc": "after_payload"
+    },
+    "seq_required": 0,
+    "timestamp_required": 0,
+    "strict_validation": {
+      "magic": true,
+      "version": true,
+      "profile": true,
+      "frame_type": true,
+      "exact_length": true,
+      "crc": true,
+      "nonzero_seq_rejected": true,
+      "nonzero_timestamp_rejected": true,
+      "replay_cache": false,
+      "duplicate_tracking": false,
+      "conflict_tracking": false
+    },
+    "crc": {
+      "algorithm": "CRC-16/CCITT-FALSE",
+      "polynomial": 4129,
+      "initial": 65535,
+      "reflect_input": false,
+      "reflect_output": false,
+      "xor_out": 0,
+      "encoding": "u16_le",
+      "coverage_start_offset": 2,
+      "coverage_end": "final_payload_byte"
+    }
+  },
+  "boot_build_id": {
+    "frame_type": 4,
+    "payload_length": 8,
+    "full_frame_length": 24,
+    "build_id_offsets": [14, 17],
+    "build_id_encoding": "u32_le",
+    "capability_offsets": [18, 21],
+    "capability": 8095,
+    "capability_wire_le": "9F 1F 00 00",
+    "announcement_count": 1,
+    "ready_semantics": false,
+    "gates_first_command": false,
+    "startup_epoch_order": {
+      "collector_active_before_program_sram": true,
+      "host_sends_disable_without_waiting": true,
+      "allowed_boot_window": "PROGRAM_SRAM_START_TO_FIRST_DISABLE_COMMAND_RESULT",
+      "required_prefix": ["BOOT_BUILD_ID", "EPOCH"],
+      "boot_count": 1,
+      "epoch_count": 1,
+      "epoch_event_seq": 1,
+      "late_boot_policy": "FATAL_SEND_DISABLE_ONCE_AND_TERMINATE"
+    }
+  },
+  "capability_registry": {
+    "TRACE_EVENT_V1": {"bit": 4, "mask": 16, "enabled": true},
+    "TEMPERATURE": {"bit": 5, "mask": 32, "enabled": false}
+  },
+  "commands": {
+    "set_output_snapshot": {
+      "frame_type": 7,
+      "command": 42,
+      "flags": 0,
+      "payload_length": 34,
+      "full_frame_length": 50,
+      "crc_coverage_offsets": [2, 47],
+      "byte_offsets": {
+        "command": 14,
+        "flags": 15,
+        "ptc": [16, 39],
+        "fan": [40, 43],
+        "solenoid": 44,
+        "x": 45,
+        "y": 46,
+        "z": 47,
+        "crc": [48, 49]
+      },
+      "accepted_values": {
+        "ptc_percent": {"minimum": 0, "maximum": 100},
+        "fan_percent": {"minimum": 0, "maximum": 100},
+        "solenoid": [0, 100],
+        "x": [0, 100],
+        "y": [0, 100],
+        "z": [0, 100]
+      },
+      "invalid_field_rejects_entire_frame": true,
+      "synchronous_outputs": ["PTC1..24", "FAN1..4", "solenoid"],
+      "solenoid_physical_semantics": {
+        "0": "P5_low_deenergized_intake_open",
+        "100": "P5_high_energized_intake_closed"
+      },
+      "hardware_qualified_motor_axes": ["X", "Y"],
+      "protocol_reserved_motor_axes": ["Z"],
+      "protocol_reserved_axis_semantics": {
+        "Z": {
+          "accepted_snapshot_targets": [0, 100],
+          "snapshot_effect": "ACCEPTED_NOOP",
+          "drives_step_dir_enable": false,
+          "busy": false,
+          "position_valid": false,
+          "motion_status_current": 255,
+          "motion_status_target": 255
+        }
+      },
+      "motor_axes_independent": true,
+      "busy_or_invalid_axis_no_queue": true,
+      "response": "HOST_ACK",
+      "cli_warning": "This command always sends X/Y/Z targets; X/Y default 0 requests CLOSED and may start motion, while Z 0/100 is an accepted no-op.",
+      "arms_watchdog_on_accepted": true
+    },
+    "get_status": {
+      "frame_type": 5,
+      "command": 36,
+      "payload_length": 4,
+      "full_frame_length": 20,
+      "payload_hex": "24 00 00 00",
+      "response": "HOST_ACK",
+      "refreshes_watchdog": false
+    },
+    "disable": {
+      "frame_type": 5,
+      "command": 38,
+      "payload_length": 4,
+      "full_frame_length": 20,
+      "payload_hex": "26 00 00 00",
+      "response": "HOST_ACK",
+      "applies_safe_state": true
+    },
+    "jog": {
+      "frame_type": 17,
+      "command": 53,
+      "payload_length": 8,
+      "full_frame_length": 24,
+      "payload_layout": "35 axis raw_dir speed_code steps_u16_le 00 00",
+      "axis_codes": {"X": 0, "Y": 1},
+      "unsupported_axis_codes": {"Z": 2},
+      "unsupported_axis_status": "BAD_VALUE",
+      "raw_dir_values": [0, 1],
+      "speed_step_per_s": {"0": 20, "1": 40, "2": 100, "3": 1000},
+      "steps_min": 1,
+      "steps_max": 65535,
+      "arms_watchdog_on_accepted": true,
+      "uncalibrated_jog_policy": {
+        "allowed_raw_dir_values": [0, 1],
+        "requires_limit_fast": 0,
+        "requires_limit_active": 0,
+        "power_on_limit_high_action": "MARK_CLOSED_REQUIRED_BEFORE_MOTION",
+        "static_high_auto_learning_allowed": false,
+        "static_high_jog_allowed": false
+      },
+      "limit_gate": {
+        "requires_limit_ready": true,
+        "uncalibrated_start": {
+          "limit_guard": 0,
+          "limit_fast": 0,
+          "limit_active": 0
+        },
+        "closed_start": {
+          "limit_guard": 1,
+          "limit_fast": 1,
+          "limit_active": 1
+        },
+        "inconsistent_pretrip_status": "BUSY"
+      },
+      "response": "HOST_ACK"
+    },
+    "mark_closed": {
+      "frame_type": 17,
+      "command": 54,
+      "payload_length": 8,
+      "full_frame_length": 24,
+      "payload_layout": "36 axis close_dir 00 00 00 00 00",
+      "axis_codes": {"X": 0, "Y": 1},
+      "close_dir_values": [0, 1],
+      "requires_stable_active_limit": true,
+      "requires_idle": true,
+      "requires_limit_ready": true,
+      "requires_limit_fast_high": true,
+      "requires_limit_confirmed_high": true,
+      "current_closed_evidence": "limit_fast_and_limit_active",
+      "first_registration_effect": "CLOSED_DISTANCE_ZERO_CLOSE_DIR_VALID",
+      "same_direction_repeat": "OK_IDEMPOTENT_ZERO_MOTION",
+      "opposite_direction_status": "BAD_VALUE",
+      "busy_status": "BUSY",
+      "rejection_changes_state": false,
+      "arms_watchdog_on_accepted": true,
+      "response": "HOST_ACK"
+    },
+    "get_motor_status": {
+      "frame_type": 17,
+      "command": 55,
+      "payload_length": 8,
+      "full_frame_length": 24,
+      "payload_hex": "37 00 00 00 00 00 00 00",
+      "responses": ["HOST_ACK", "MOTION_STATUS"],
+      "refreshes_watchdog": true,
+      "watchdog_refresh": {
+        "requires_valid_command": true,
+        "requires_already_armed": true,
+        "requires_disabled_false": true,
+        "requires_watchdog_timeout_false": true,
+        "can_arm_watchdog": false,
+        "can_clear_disabled": false,
+        "can_clear_watchdog_timeout": false
+      }
+    }
+  },
+  "responses": {
+    "host_ack": {
+      "frame_type": 6,
+      "payload_length": 8,
+      "full_frame_length": 24,
+      "byte_offsets": {
+        "ok": 14,
+        "command": 15,
+        "status": 16,
+        "detail": 17,
+        "state_hash16": [18, 19],
+        "response_type": 20,
+        "result_flags": 21,
+        "crc": [22, 23]
+      },
+      "state_hash16": {
+        "algorithm": "CRC-16/CCITT-FALSE",
+        "encoding": "u16_le",
+        "input_order": ["PTC1..24", "FAN1..4", "solenoid"],
+        "input_bytes": 29
+      },
+      "snapshot_detail_bits": {
+        "x_busy": 0,
+        "y_busy": 1,
+        "z_busy": 2,
+        "x_position_invalid": 3,
+        "y_position_invalid": 4,
+        "z_position_invalid": 5
+      },
+      "snapshot_result_flag_bits": {
+        "synchronous_outputs_committed": 0,
+        "x_accepted_or_noop": 1,
+        "y_accepted_or_noop": 2,
+        "z_accepted_or_noop": 3
+      },
+      "get_status_detail_bits": {
+        "disabled": 0,
+        "watchdog_timeout": 1
+      },
+      "status_codes": {
+        "OK": 0,
+        "UNSUPPORTED_IN_PROFILE": 1,
+        "BAD_FLAGS": 2,
+        "BAD_LENGTH": 3,
+        "BAD_VALUE": 5,
+        "BUSY": 9,
+        "PARTIAL": 22
+      },
+      "command_response_contracts": {
+        "get_status": {
+          "response_type": 0,
+          "result_flags": 0,
+          "detail_used_bits": [0, 1],
+          "detail_reserved_mask": 252,
+          "reserved_detail_bits_zero": true
+        },
+        "get_motor_status": {
+          "response_type": 18,
+          "result_flags": 8,
+          "detail": 0
+        },
+        "snapshot_ok": {
+          "ok": 1,
+          "status": 0,
+          "detail": 0,
+          "response_type": 0,
+          "result_flags": 15
+        },
+        "snapshot_partial": {
+          "ok": 1,
+          "status": 22,
+          "response_type": 0,
+          "synchronous_outputs_committed_flag_bit": 0,
+          "axis_result_flag_bits": [1, 2, 3],
+          "axis_result_flag_set_iff_not_busy_or_invalid": true,
+          "detail_axis_skip_bits": [0, 1, 2, 3, 4, 5],
+          "detail_reserved_mask": 192,
+          "reserved_detail_bits_zero": true
+        }
+      }
+    },
+    "motion_status": {
+      "frame_type": 18,
+      "payload_length": 10,
+      "full_frame_length": 26,
+      "byte_offsets": {
+        "flags": 14,
+        "valid_mask": 15,
+        "busy_mask": 16,
+        "current_xyz": [17, 19],
+        "target_xyz": [20, 22],
+        "fault_mask": 23,
+        "crc": [24, 25]
+      },
+      "position_values": [0, 100, 254, 255],
+      "intermediate_position": 254,
+      "unknown_position": 255,
+      "flag_bits": {
+        "any_busy": 0,
+        "en_active": 1,
+        "disabled": 2,
+        "watchdog_timeout": 3
+      },
+      "fail_closed_invariants": {
+        "any_busy_equals_busy_mask_nonzero": true,
+        "disabled_requires_en_active_zero": true,
+        "watchdog_timeout_requires_disabled": true,
+        "z_busy_valid_fault_zero": true,
+        "z_current_unknown": 255,
+        "z_target_unknown": 255
+      },
+      "reserved_flag_mask": 240,
+      "reserved_flag_bits_zero": true
+    },
+    "trace_event": {
+      "frame_type": 15,
+      "payload_length": 18,
+      "full_frame_length": 34,
+      "byte_offsets": {
+        "event_seq_u32_le": [14, 17],
+        "event_type": 18,
+        "source": 19,
+        "meta_u16_le": [20, 21],
+        "data_u64_le": [22, 29],
+        "state_hash16_u16_le": [30, 31],
+        "crc": [32, 33]
+      },
+      "event_types": {
+        "EPOCH": 1,
+        "COMMAND_RESULT": 2,
+        "CORE_STATE": 3,
+        "AXIS_STATE": 4,
+        "LIMIT_STATE": 5,
+        "SAFETY_STATE": 6,
+        "OVERFLOW": 7
+      },
+      "event_seq_initial": 1,
+      "event_seq_wraps_to": 1,
+      "command_order": ["COMMAND_RESULT", "HOST_ACK", "FOLLOW_UP"],
+      "pre_command_result_policy": {
+        "continuous_crc_valid_trace": "ACCEPT_AS_ASYNC_BACKLOG",
+        "boot_build_id": "FATAL",
+        "host_ack": "FATAL",
+        "other_followup": "FATAL"
+      },
+      "post_completion_quiet_drain": {
+        "quiet_window_ms": 10,
+        "hard_deadline_ms": 50,
+        "accepted_trace_types": [
+          "CORE_STATE",
+          "AXIS_STATE",
+          "LIMIT_STATE",
+          "SAFETY_STATE"
+        ],
+        "unexpected_frame_policy": "FATAL_SEND_DISABLE_ONCE_AND_TERMINATE",
+        "final_session_drain_required": true,
+        "failure_rx_journal_required": true
+      },
+      "artifact_evidence": {
+        "schema": "schemas/trace-events.schema.json",
+        "strict_layout_validation": true,
+        "continuous_sequence_validation": true,
+        "exact_serial_transcript_replay_equality": true,
+        "rehash_without_equality_rejected": true
+      },
+      "command_result_binding": {
+        "source": "request_frame_type",
+        "meta": "request_wire_crc16",
+        "data": "complete_host_ack_payload_u64_le"
+      },
+      "event_layouts": {
+        "EPOCH": {
+          "layout_version": 1,
+          "source": 0,
+          "meta": 0,
+          "data_fields": {
+            "build_id_u32": [0, 31],
+            "capability_u32": [32, 63]
+          },
+          "boot_identity_binding_required": true,
+          "state_hash16": "live_synchronous_output_state_hash_at_event_attempt"
+        },
+        "CORE_STATE": {
+          "layout_version": 1,
+          "source": 0,
+          "meta": "data[15:0]",
+          "data_fields": {"core_state_hash16": [0, 15]},
+          "reserved_data_bits_zero": [16, 63],
+          "event_state_hash_may_differ_from_data": true,
+          "state_hash16": "live_synchronous_output_state_hash_at_event_attempt"
+        },
+        "AXIS_STATE": {
+          "layout_version": 1,
+          "terminal_only": true,
+          "source_codes": {"X": 1, "Y": 2},
+          "meta_bits": {
+            "requested_dir": 0,
+            "live_dir": 1,
+            "close_dir": 2,
+            "close_dir_valid": 3,
+            "speed_code": [4, 5],
+            "limit_fast": 6,
+            "limit_active": 7,
+            "limit_ready": 8,
+            "busy": 9,
+            "drive_active": 10,
+            "fault": 11,
+            "position_valid": 12,
+            "recovery_segment": 13,
+            "layout_version": [14, 15]
+          },
+          "data_bits": {
+            "requested_steps_u16": [0, 15],
+            "completed_steps_u16": [16, 31],
+            "distance_steps_u16": [32, 47],
+            "stop_reason_u8": [48, 55],
+            "axis_state": [56, 58],
+            "move_kind": [59, 60],
+            "distance_valid": 61,
+            "distance_saturated": 62,
+            "terminal": 63
+          },
+          "axis_state_codes": {
+            "UNCALIBRATED": 0,
+            "CLOSED": 1,
+            "OPENING": 2,
+            "OPEN": 3,
+            "CLOSING": 4,
+            "INTERMEDIATE": 5,
+            "RECOVERY": 6,
+            "LOCKED_FAULT": 7
+          },
+          "move_kind_codes": {"IDLE": 0, "STANDARD": 1, "JOG": 2},
+          "reserved_move_kind_codes": [3],
+          "stop_reason_codes": {
+            "NONE": 0,
+            "REQUEST_COMPLETE": 1,
+            "LIMIT_CONFIRMED": 2,
+            "FAST_TRIP_UNCONFIRMED": 3,
+            "DISABLE": 4,
+            "WATCHDOG": 5,
+            "LOCKED_FAULT": 6,
+            "REVERSED_TO_CLOSE": 7,
+            "RELEASE_TIMEOUT": 8,
+            "ALREADY_CLOSED": 9,
+            "MARK_CLOSED": 10,
+            "HARD_SAFE": 11
+          },
+          "invariants": {
+            "terminal_bit": 1,
+            "stop_reason_none_invalid": true,
+            "completed_steps_lte_requested_steps": true,
+            "state_hash16": "current_synchronous_output_state_hash"
+          }
+        },
+        "LIMIT_STATE": {
+          "layout_version": 1,
+          "source": 3,
+          "meta": 0,
+          "data_bits": {
+            "y_fast": 0,
+            "x_fast": 1,
+            "y_active": 2,
+            "x_active": 3,
+            "y_ready": 4,
+            "x_ready": 5
+          },
+          "reserved_data_bits_zero": [6, 63],
+          "state_hash16": "current_synchronous_output_state_hash"
+        },
+        "SAFETY_STATE": {
+          "layout_version": 1,
+          "source": 0,
+          "meta": 0,
+          "data_bits": {
+            "disabled": 0,
+            "watchdog_timeout": 1,
+            "trace_hard_safe": 2,
+            "trace_scheduler_fault": 3
+          },
+          "reserved_data_bits_zero": [4, 63],
+          "state_hash16": "current_synchronous_output_state_hash"
+        },
+        "OVERFLOW": {
+          "layout_version": 1,
+          "source": 0,
+          "meta": 0,
+          "first_lost_event_seq_u32": [0, 31],
+          "first_lost_event_seq_nonzero": true,
+          "reserved_data_bits_zero": [32, 63],
+          "state_hash16": "live_synchronous_output_state_hash_at_event_attempt"
+        }
+      }
+    }
+  },
+  "unsupported_commands": {
+    "0x29": {
+      "request_payload_hex": "29 00 00 00",
+      "status": "UNSUPPORTED_IN_PROFILE",
+      "status_code": 1,
+      "ack_ok": false,
+      "detail": 0,
+      "response_type": 0,
+      "result_flags": 0,
+      "changes_state": false,
+      "arms_watchdog": false,
+      "refreshes_watchdog": false,
+      "trace_event": "COMMAND_RESULT"
+    }
+  },
+  "programming": {
+    "operation": "PROGRAM_SRAM",
+    "speed_hz": 200000,
+    "attempt_limit": 1,
+    "automatic_retry": false,
+    "flash_allowed": false
+  },
+  "safety": {
+    "protocol_ptc_direct_control_allowed": true,
+    "protocol_ptc_percent_range": [0, 100],
+    "hardware_gate_ptc_heating_allowed": false,
+    "hardware_gate_requires_ptc_load_disabled": true,
+    "local_temperature_feedback_available": false,
+    "local_overtemperature_protection_available": false,
+    "immediate_step_truncation_sources": [
+      "DISABLE_OR_EMERGENCY_DISABLE",
+      "WATCHDOG_EXPIRY",
+      "TRACE_INTEGRITY_HARD_SAFE_OR_SCHEDULER_FAULT"
+    ],
+    "watchdog_timeout_seconds": 5,
+    "watchdog_expiry_refresh_same_cycle_priority": "EXPIRY",
+    "per_axis_calibration_policy": {
+      "axes": ["X", "Y"],
+      "command_and_motion_independence": "PER_AXIS",
+      "same_direction_unconfirmed_learning": "PRESERVE",
+      "reverse_direction_unconfirmed_learning": "CANCEL_AND_ACCEPT",
+      "peer_drive_overlap_unconfirmed_learning": "CANCEL_BOTH_AND_ACCEPT",
+      "cancel_vs_confirm_priority": "CANCEL",
+      "canceled_fast_trip": "STOP_WITHOUT_LEARNING",
+      "canceled_confirmed_limit": "LIMIT_CONFIRMED_KEEP_UNCALIBRATED_NO_FAULT",
+      "multi_axis_snapshot_policy": "PER_AXIS_ACCEPTED_BUSY_INVALID_WITH_PARTIAL"
+    },
+    "standard_motion_policy": {
+      "standard_target_state_table": {
+        "UNCALIBRATED": {"OPEN": "INVALID", "CLOSE": "INVALID"},
+        "CLOSED": {"OPEN": "START_OPENING", "CLOSE": "IDEMPOTENT"},
+        "OPENING": {"OPEN": "IDEMPOTENT", "CLOSE": "SAFE_REVERSE_TO_CLOSING"},
+        "OPEN": {"OPEN": "IDEMPOTENT", "CLOSE": "START_CLOSING"},
+        "CLOSING": {"OPEN": "BUSY_CONTINUE_CLOSING", "CLOSE": "IDEMPOTENT"},
+        "INTERMEDIATE": {"OPEN": "INVALID", "CLOSE": "START_CLOSING"},
+        "RECOVERY": {"OPEN": "BUSY", "CLOSE": "BUSY"},
+        "LOCKED_FAULT": {"OPEN": "INVALID", "CLOSE": "INVALID"}
+      },
+      "safe_reverse": "COMPLETE_STEP_LOW_SWITCH_DIR_WAIT_1MS_THEN_CLOSE",
+      "standard_open_steps": 3200,
+      "standard_close_homing_steps": 3200,
+      "recovery_steps": 160,
+      "recovery_speed_steps_per_second": 20,
+      "release_timeout_ms": 4000
+    },
+    "distance_close_policy": {
+      "counter_bits": 16,
+      "valid_unsaturated": "RUN_RECORDED_DISTANCE",
+      "invalid": "RUN_ONE_BOUNDED_3200_STEP_HOMING",
+      "saturated": "REJECT_STANDARD_CLOSE_ALLOW_CLOSE_DIR_JOG",
+      "jog_never_truncated_by_distance": true
+    },
+    "limit_pipeline_policy": {
+      "polarity": "ACTIVE_HIGH",
+      "open_voltage_v": 0.0,
+      "closed_voltage_v": 3.3,
+      "synchronizer_stages": 3,
+      "guard_stage": 2,
+      "fast_stage": 3,
+      "confirm_us": 5000,
+      "fast_trip": "BLOCK_NEXT_RISE_COMPLETE_CURRENT_HIGH_AND_LOW",
+      "unconfirmed_result": "FAST_TRIP_UNCONFIRMED_STOP_WAIT_NEW_COMMAND",
+      "confirmed_learning_requires": [
+        "SAME_AXIS",
+        "SAME_DIR",
+        "STABLE_LOW_START",
+        "REAL_STEP",
+        "FAST_HIGH",
+        "CONFIRMED_HIGH",
+        "NO_REVERSE",
+        "NO_HARD_STOP",
+        "NO_PEER_DRIVE_OVERLAP"
+      ],
+      "canceled_learning_confirmed_result": "LIMIT_CONFIRMED_KEEP_UNCALIBRATED_NO_FAULT",
+      "canceled_learning_unconfirmed_result": "FAST_TRIP_UNCONFIRMED_KEEP_UNCALIBRATED_NO_FAULT"
+    },
+    "safe_state": {
+      "ptc_percent": 0,
+      "fan_percent": [30, 30, 30, 30],
+      "solenoid": 0,
+      "solenoid_p5_level": 0,
+      "solenoid_effect": "intake_open",
+      "step_all_low": true,
+      "en_n_high": true
+    },
+    "reset_applies_safe_state": true,
+    "disable_applies_safe_state": true,
+    "watchdog_applies_safe_state": true
+  }
+}

文件差異過大導致無法顯示
+ 22 - 17
config/prod2u_p4_normal_v3_hw_binding.json


+ 13 - 99
config/prod2u_p4_normal_v3_resource_baseline.json

@@ -1,108 +1,22 @@
 {
-  "schema": "prod2u-p4-normal-v3-resource-baseline-v1",
+  "schema": "prod2u-p4-normal-v3-resource-baseline-v2",
   "profile": "prod2u_p4_normal_v3",
+  "runtime_profile": "prod2u-p4-normal-actuator-trace-binary921-v3",
   "device": "EF2L45BG256B",
-  "snapshot_commit": "c9cf6a561f6ed16c001fcc08244827ac75f5c981",
+  "status": "pending_measurement",
   "policy": {
     "mode": "advisory_only",
     "affects_build_status": false
   },
-  "samples": [
-    {
-      "build_id": "6A5AE72C",
-      "overall": {
-        "lut": 3060,
-        "reg": 2476,
-        "packed_slices": 1743,
-        "mslice": 871,
-        "bram": 0,
-        "dsp": 0,
-        "io": 43
-      },
-      "timing": {
-        "fmax_mhz": 57.637,
-        "worst_setup_slack_ns": 22.65,
-        "worst_hold_slack_ns": 0.031
-      }
-    },
-    {
-      "build_id": "6A5B30C9",
-      "overall": {
-        "lut": 3047,
-        "reg": 2475,
-        "packed_slices": 1748,
-        "mslice": 874,
-        "bram": 0,
-        "dsp": 0,
-        "io": 43
-      },
-      "timing": {
-        "fmax_mhz": 63.179,
-        "worst_setup_slack_ns": 24.172,
-        "worst_hold_slack_ns": 0.038
-      }
-    }
-  ],
-  "envelope": {
-    "overall": {
-      "lut": {"min": 3047, "max": 3060},
-      "reg": {"min": 2475, "max": 2476},
-      "packed_slices": {"min": 1743, "max": 1748},
-      "mslice": {"min": 871, "max": 874},
-      "bram": {"min": 0, "max": 0},
-      "dsp": {"min": 0, "max": 0},
-      "io": {"min": 43, "max": 43}
-    },
-    "timing": {
-      "fmax_mhz": {"min": 57.637, "max": 63.179},
-      "worst_setup_slack_ns": {"min": 22.65, "max": 24.172},
-      "worst_hold_slack_ns": {"min": 0.031, "max": 0.038}
-    },
-    "hierarchy": {
-      "u_core": {
-        "lut": {"min": 1168, "max": 1171},
-        "seq": {"min": 918, "max": 922}
-      },
-      "u_motors": {
-        "lut": {"min": 443, "max": 453},
-        "seq": {"min": 230, "max": 235}
-      },
-      "u_x_axis": {
-        "lut": {"min": 180, "max": 191},
-        "seq": {"min": 82, "max": 86}
-      },
-      "u_y_axis": {
-        "lut": {"min": 152, "max": 174},
-        "seq": {"min": 75, "max": 77}
-      },
-      "u_z_axis": {
-        "lut": {"min": 88, "max": 90},
-        "seq": {"min": 62, "max": 64}
-      },
-      "u_outputs": {
-        "lut": {"min": 539, "max": 551},
-        "seq": {"min": 537, "max": 548}
-      },
-      "u_protocol_rx": {
-        "lut": {"min": 327, "max": 329},
-        "seq": {"min": 319, "max": 322}
-      },
-      "u_temp_scan": {
-        "lut": {"min": 372, "max": 379},
-        "seq": {"min": 370, "max": 372}
-      },
-      "u_temperature_frame": {
-        "lut": {"min": 402, "max": 404},
-        "seq": {"min": 399, "max": 402}
-      },
-      "u_x_limit": {
-        "lut": {"min": 24, "max": 28},
-        "seq": {"min": 21, "max": 24}
-      },
-      "u_y_limit": {
-        "lut": {"min": 24, "max": 26},
-        "seq": {"min": 22, "max": 22}
-      }
-    }
+  "architecture": {
+    "io": 41,
+    "dsp": 0,
+    "trace_bram9k": 1
+  },
+  "rx_bram": {
+    "enabled": false,
+    "selection": "no_candidate",
+    "active_total_bram9k": 1,
+    "reason": "requires_real_trace_only_and_rx_bram_ab_evidence"
   }
 }

+ 154 - 0
config/prod2u_p4_resource_replay_v1.json

@@ -0,0 +1,154 @@
+{
+  "schema": "prod2u-p4-resource-replay-manifest-v1",
+  "version": 1,
+  "resource_paths": [
+    "src/rtl/prod2u_p4_axis_executor.v",
+    "src/rtl/prod2u_p4_normal_v3_output_state.v",
+    "src/rtl/prod2u_p4_normal_v3_rx.v",
+    "src/rtl/prod2u_p4_normal_v3_tx.v",
+    "src/rtl/prod2u_p4_normal_v3_watchdog.v",
+    "src/rtl/prod2u_p4_pwm_outputs.v",
+    "src/rtl/prod2u_p4_us_tick.v",
+    "src/rtl/prod2u_por.v",
+    "src/rtl/uart_rx_8n1.v",
+    "src/rtl/uart_tx_8n1.v"
+  ],
+  "proof_targets": [
+    "axis_timer_equivalence",
+    "output_state_storage_equivalence",
+    "parser_timeout_counter_equivalence",
+    "pwm_counter_equivalence",
+    "tx_payload_latch_equivalence",
+    "uart_rx_counter_equivalence",
+    "uart_tx_counter_equivalence",
+    "watchdog_counter_equivalence",
+    "us_tick_counter_equivalence",
+    "por_counter_equivalence"
+  ],
+  "differential_targets": [
+    "axis_timer_equivalence",
+    "output_state_storage_equivalence",
+    "tx_payload_latch_equivalence"
+  ],
+  "formal_targets": [
+    "parser_timeout_counter_equivalence",
+    "pwm_counter_equivalence",
+    "uart_rx_counter_equivalence",
+    "uart_tx_counter_equivalence",
+    "watchdog_counter_equivalence",
+    "us_tick_counter_equivalence",
+    "por_counter_equivalence"
+  ],
+  "differential_runner": "tools/resource_baseline/run_differential_equivalence.py",
+  "differential_testbenches": {
+    "axis_timer_equivalence": "tests/resource_equivalence/axis_timer_equiv_trace_tb.v",
+    "output_state_storage_equivalence": "tests/resource_equivalence/output_state_equiv_trace_tb.v",
+    "tx_payload_latch_equivalence": "tests/resource_equivalence/tx_stable_payload_equiv_trace_tb.v"
+  },
+  "formal_configs": {
+    "parser_timeout_counter_equivalence": {
+      "config": "tests/resource_equivalence/formal/parser_counter_width_equiv.sby",
+      "harness": "tests/resource_equivalence/formal/parser_counter_width_equiv_formal.v",
+      "sources": [
+        {
+          "path": "src/rtl/binary921_crc16.v",
+          "common_name": "binary921_crc16.v"
+        },
+        {
+          "path": "src/rtl/prod2u_p4_normal_v3_rx.v",
+          "optimized_name": "o_prod2u_p4_normal_v3_rx.v",
+          "baseline_name": "u_prod2u_p4_normal_v3_rx.v",
+          "probe": "parser_counters_v1"
+        }
+      ]
+    },
+    "pwm_counter_equivalence": {
+      "config": "tests/resource_equivalence/formal/pwm_equiv.sby",
+      "harness": "tests/resource_equivalence/formal/pwm_equiv_formal.v",
+      "sources": [
+        {
+          "path": "src/rtl/prod2u_p4_pwm_outputs.v",
+          "optimized_name": "o_prod2u_p4_pwm_outputs.v",
+          "baseline_name": "u_prod2u_p4_pwm_outputs.v"
+        }
+      ]
+    },
+    "uart_rx_counter_equivalence": {
+      "config": "tests/resource_equivalence/formal/uart_rx_counter_width_equiv.sby",
+      "harness": "tests/resource_equivalence/formal/uart_rx_counter_width_equiv_formal.v",
+      "sources": [
+        {
+          "path": "src/rtl/uart_rx_8n1.v",
+          "optimized_name": "o_uart_rx_8n1.v",
+          "baseline_name": "u_uart_rx_8n1.v",
+          "probe": "uart_rx_counters_v1"
+        }
+      ]
+    },
+    "uart_tx_counter_equivalence": {
+      "config": "tests/resource_equivalence/formal/uart_tx_counter_width_equiv.sby",
+      "harness": "tests/resource_equivalence/formal/uart_tx_counter_width_equiv_formal.v",
+      "sources": [
+        {
+          "path": "src/rtl/uart_tx_8n1.v",
+          "optimized_name": "o_uart_tx_8n1.v",
+          "baseline_name": "u_uart_tx_8n1.v",
+          "probe": "uart_tx_counter_v1"
+        }
+      ]
+    },
+    "watchdog_counter_equivalence": {
+      "config": "tests/resource_equivalence/formal/watchdog_equiv.sby",
+      "harness": "tests/resource_equivalence/formal/watchdog_equiv_formal.v",
+      "sources": [
+        {
+          "path": "src/rtl/prod2u_p4_normal_v3_watchdog.v",
+          "optimized_name": "o_prod2u_p4_normal_v3_watchdog.v",
+          "baseline_name": "u_prod2u_p4_normal_v3_watchdog.v"
+        }
+      ]
+    },
+    "us_tick_counter_equivalence": {
+      "config": "tests/resource_equivalence/formal/us_tick_equiv.sby",
+      "harness": "tests/resource_equivalence/formal/us_tick_equiv_formal.v",
+      "sources": [
+        {
+          "path": "src/rtl/prod2u_p4_us_tick.v",
+          "optimized_name": "o_prod2u_p4_us_tick.v",
+          "baseline_name": "u_prod2u_p4_us_tick.v"
+        }
+      ]
+    },
+    "por_counter_equivalence": {
+      "config": "tests/resource_equivalence/formal/por_equiv.sby",
+      "harness": "tests/resource_equivalence/formal/por_equiv_formal.v",
+      "sources": [
+        {
+          "path": "src/rtl/prod2u_por.v",
+          "optimized_name": "o_prod2u_por.v",
+          "baseline_name": "u_prod2u_por.v"
+        }
+      ]
+    }
+  },
+  "assets": {
+    "tools/resource_baseline/run_differential_equivalence.py": "5e79a260507077899694d3d36efabb3b03e3a07ba65f65b408e3f4f82168af36",
+    "tests/resource_equivalence/axis_timer_equiv_trace_tb.v": "83bc46701d1b2ef465bef7db02ecc6c2244dee234164950b3883987708779274",
+    "tests/resource_equivalence/output_state_equiv_trace_tb.v": "b1f90586aa7e5594d48dabeecb7e17178f3dee2f6e1e2859350cc751aff5bd7b",
+    "tests/resource_equivalence/tx_stable_payload_equiv_trace_tb.v": "24596d8203a4c1a52e8e55d6c51b5673031b05dfdb09f5d7e0b4e195a64989a2",
+    "tests/resource_equivalence/formal/parser_counter_width_equiv.sby": "91c7fcaa0d262eef83f22d3ee4785c1e3238af462707a287f5e6860a8bcbe538",
+    "tests/resource_equivalence/formal/parser_counter_width_equiv_formal.v": "a1c7a8fd0e76be10997ef56205b47cda2fb8c96836cfb68c5a5147f9306051a1",
+    "tests/resource_equivalence/formal/pwm_equiv.sby": "0fa6ab0d8314327ac067b42ef6d704d31f39c28b1207b010bbcfd3ad6b0871e9",
+    "tests/resource_equivalence/formal/pwm_equiv_formal.v": "0fb1a1d9732fa0b58c922e562dd23c12444b03838ba71f2ebc7a37208100a26c",
+    "tests/resource_equivalence/formal/uart_rx_counter_width_equiv.sby": "798251acd053912500d0d6ec73353806572e556f62e4e943d430a8ae8146eae1",
+    "tests/resource_equivalence/formal/uart_rx_counter_width_equiv_formal.v": "c4bee7a03f67558b6574f0d4d3429edae6f02193efd1a92b2548a4d57fab13fd",
+    "tests/resource_equivalence/formal/uart_tx_counter_width_equiv.sby": "b80860fb238bfb34e7e42c19d4c6c2091a3d8ce7efe1f033535d51a84f5656bf",
+    "tests/resource_equivalence/formal/uart_tx_counter_width_equiv_formal.v": "8d64c98ad111fa1c98aa0e8cf0082d17241c66e465995f664463dffa5b53139e",
+    "tests/resource_equivalence/formal/watchdog_equiv.sby": "7c36268c1954893353dba104aab623534239fa8f87d81db3777ab778cd7603cb",
+    "tests/resource_equivalence/formal/watchdog_equiv_formal.v": "e683efddbe8941f9095cb7cee4896bf838f80bb14448db83e453e6d7a813360e",
+    "tests/resource_equivalence/formal/us_tick_equiv.sby": "212372e2a95c1ed97017a508a3ffd3fdb447dbeaacefba643aee028cbc0f145b",
+    "tests/resource_equivalence/formal/us_tick_equiv_formal.v": "3184b0840a6e7c2baa427be456052bd38491282287af69c8ed17aa34c02c98d6",
+    "tests/resource_equivalence/formal/por_equiv.sby": "c11ba48b02062065ef7a9165e55874e980135c43401947d39d9389d699d9f260",
+    "tests/resource_equivalence/formal/por_equiv_formal.v": "4e2a4627ba79af3740920a248d35c32ec9184d224b64c03a5753eeeff11a7a28"
+  }
+}

+ 28 - 0
config/prod2u_p4_rx_bram_replay_v1.json

@@ -0,0 +1,28 @@
+{
+  "schema": "prod2u-p4-rx-bram-replay-manifest-v1",
+  "version": 1,
+  "changed_paths": [
+    "src/rtl/prod2u_p4_normal_v3_core.v",
+    "src/rtl/prod2u_p4_normal_v3_output_state_bram_candidate.v",
+    "src/rtl/prod2u_p4_normal_v3_rx.v",
+    "src/top/prod2u_p4_normal_v3_top.v",
+    "td/prod2u_p4_normal_v3.prj",
+    "td/syn/prod2u_p4_normal_v3.tcl"
+  ],
+  "proof_assets": [
+    "tests/resource_equivalence/rx_bram/default_parameter_equivalence.sby",
+    "tests/resource_equivalence/rx_bram/default_parameter_equivalence_formal.v",
+    "tests/resource_equivalence/rx_bram/disable_bypass_cycle_equivalence.sby",
+    "tests/resource_equivalence/rx_bram/disable_bypass_cycle_equivalence_formal.v",
+    "tests/resource_equivalence/rx_bram/candidate_transaction_contract.sby",
+    "tests/resource_equivalence/rx_bram/candidate_transaction_contract_formal.v"
+  ],
+  "assets": {
+    "tests/resource_equivalence/rx_bram/default_parameter_equivalence.sby": "723720e0564e4d8db0c8b42844d94140d661e53672bbc16d7926a73dd591de83",
+    "tests/resource_equivalence/rx_bram/default_parameter_equivalence_formal.v": "23fbd821bffd8a25ade7149af59186596cf55fe610028e913b996f26e389ef8c",
+    "tests/resource_equivalence/rx_bram/disable_bypass_cycle_equivalence.sby": "3b0bf7c6729b03f612f3cffa716b4cf93ac9a42cf5f500cc9bdd979aaa402bc9",
+    "tests/resource_equivalence/rx_bram/disable_bypass_cycle_equivalence_formal.v": "1bd158694119b25ab79f56bdd736a38c650813dc21faf25898bea9597c94e12c",
+    "tests/resource_equivalence/rx_bram/candidate_transaction_contract.sby": "1cbdb445d33d4b0165d002eef2560a6ca7aa7dba1ece6e64f209111718635aed",
+    "tests/resource_equivalence/rx_bram/candidate_transaction_contract_formal.v": "30f0034831bc5a68bf9b6fa92a64bc3541fe339822068d0c35f2285f4f1a40fb"
+  }
+}

+ 253 - 0
config/prod2u_p4_verification_targets_v1.json

@@ -0,0 +1,253 @@
+{
+  "schema": "prod2u-p4-verification-target-manifest-v1",
+  "version": 1,
+  "profile": "prod2u_p4_normal_v3",
+  "layers": {
+    "unit": [
+      "tests.unit.test_bootstrap_oss_cad_suite",
+      "tests.unit.test_prod2u_p4_activate_verification_toolchain",
+      "tests.unit.test_prod2u_p4_axis_isolation_structure",
+      "tests.unit.test_prod2u_p4_axis_terminal_trace_rtl",
+      "tests.unit.test_prod2u_p4_axis_trace_evidence",
+      "tests.unit.test_prod2u_p4_cli_v3",
+      "tests.unit.test_prod2u_p4_compact_state_resources",
+      "tests.unit.test_prod2u_p4_harness",
+      "tests.unit.test_prod2u_p4_harness_integrity",
+      "tests.unit.test_prod2u_p4_mechanical_oracle",
+      "tests.unit.test_prod2u_p4_model_terminal_contract",
+      "tests.unit.test_prod2u_p4_motion_mutation",
+      "tests.unit.test_prod2u_p4_normal_v3_gate",
+      "tests.unit.test_prod2u_p4_normal_v3_model",
+      "tests.unit.test_prod2u_p4_normal_v3_package",
+      "tests.unit.test_prod2u_p4_normal_v3_receipts",
+      "tests.unit.test_prod2u_p4_normal_v3_resources",
+      "tests.unit.test_prod2u_p4_normal_v3_simplified_delivery",
+      "tests.unit.test_prod2u_p4_normal_v3_td_files",
+      "tests.unit.test_prod2u_p4_output_storage_structure",
+      "tests.unit.test_prod2u_p4_policy_mutation",
+      "tests.unit.test_prod2u_p4_protocol_v3",
+      "tests.unit.test_prod2u_p4_resource_policy_v2",
+      "tests.unit.test_prod2u_p4_resource_baseline_producer",
+      "tests.unit.test_prod2u_p4_retirement_contract",
+      "tests.unit.test_prod2u_p4_rtl_pin_trace_bridge",
+      "tests.unit.test_prod2u_p4_rx_bram_ab",
+      "tests.unit.test_prod2u_p4_synthesis_input_hash",
+      "tests.unit.test_prod2u_p4_td_cdc_structure",
+      "tests.unit.test_prod2u_p4_trace_codec",
+      "tests.unit.test_prod2u_p4_trace_host_policy",
+      "tests.unit.test_prod2u_p4_trace_storage_structure",
+      "tests.unit.test_prod2u_p4_wrapper_v3",
+      "tests.unit.test_prod2u_programmer",
+      "tests.unit.test_prod2u_programmer_process_audit",
+      "tests.unit.test_prod2u_programmer_runtime",
+      "tests.unit.test_prod2u_td_build_identity",
+      "tests.test_project_structure"
+    ],
+    "icarus": [
+      "prod2u_p4_axis_executor_xy_tb",
+      "prod2u_p4_axis_fast_glitch_contract_tb",
+      "prod2u_p4_axis_jog_16bit_tb",
+      "prod2u_p4_axis_late_evidence_wallclock_tb",
+      "prod2u_p4_axis_limit_contract_tb",
+      "prod2u_p4_axis_motion_state_tb",
+      "prod2u_p4_axis_open_release_same_edge_tb",
+      "prod2u_p4_axis_recovery_budget_tb",
+      "prod2u_p4_axis_release_budget_tb",
+      "prod2u_p4_axis_reverse_boundary_tb",
+      "prod2u_p4_axis_saturated_jog_tb",
+      "prod2u_p4_axis_safety_gaps_tb",
+      "prod2u_p4_axis_stale_active_mark_tb",
+      "prod2u_p4_axis_terminal_trace_tb",
+      "prod2u_p4_cdc_sync_depth_tb",
+      "prod2u_p4_core_watchdog_refresh_tb",
+      "prod2u_p4_core_trace_hard_safe_tb",
+      "prod2u_p4_limit_fast_trip_tb",
+      "prod2u_p4_limit_filter_tb",
+      "prod2u_p4_limit_command_recheck_tb",
+      "prod2u_p4_limit_ready_motor_tb",
+      "prod2u_p4_limit_stage3_fall_guard_tb",
+      "prod2u_p4_limit_stage3_rise_guard_tb",
+      "prod2u_p4_limit_sync_depth_tb",
+      "prod2u_p4_motor_hub_axis_isolation_tb",
+      "prod2u_p4_motor_hub_closed_fast_drop_tb",
+      "prod2u_p4_motor_hub_deferred_trip_tb",
+      "prod2u_p4_motor_hub_hard_stop_capture_tb",
+      "prod2u_p4_motor_hub_mark_partial_tb",
+      "prod2u_p4_motor_hub_policy_tb",
+      "prod2u_p4_motor_hub_release_reassert_race_tb",
+      "prod2u_p4_motor_hub_reverse_ack_tb",
+      "prod2u_p4_motor_hub_status_tail_tb",
+      "prod2u_p4_motor_hub_tb",
+      "prod2u_p4_normal_v3_core_trace_tb",
+      "prod2u_p4_normal_v3_output_state_tb",
+      "prod2u_p4_normal_v3_rearm_tb",
+      "prod2u_p4_normal_v3_rx_tb",
+      "prod2u_p4_normal_v3_top_tb",
+      "prod2u_p4_normal_v3_tx_tb",
+      "prod2u_p4_normal_v3_watchdog_contract_tb",
+      "prod2u_p4_production_defaults_tb",
+      "prod2u_p4_production_limit_mapping_tb",
+      "prod2u_p4_pwm_outputs_tb",
+      "prod2u_p4_recovery_limit_handoff_tb",
+      "prod2u_p4_rtl_pin_trace_bridge_tb",
+      "prod2u_p4_trace_buffer_tb",
+      "prod2u_p4_trace_event_builder_tb",
+      "prod2u_p4_trace_pending_coalescing_tb",
+      "prod2u_p4_trace_scheduler_tb",
+      "prod2u_p4_trace_writer_fairness_tb",
+      "prod2u_p4_us_tick_tb",
+      "prod2u_por_tb",
+      "uart_8n1_phy_tb",
+      "uart_rx_back_to_back_tb",
+      "uart_rx_error_tb",
+      "prod2u_p4_axis_wait_confirm_busy_tb"
+    ],
+    "verilator": [
+      "prod2u_p4_normal_v3_top_lint"
+    ],
+    "cocotb": [
+      "prod2u_p4_normal_v3_actuator_trace_top_e2e"
+    ],
+    "formal": [
+      {
+        "name": "prod2u_p4_axis_late_evidence_wallclock",
+        "tasks": ["prove", "cover"]
+      },
+      {"name": "prod2u_p4_axis_limit_final_low", "tasks": []},
+      {
+        "name": "prod2u_p4_axis_motion_state",
+        "tasks": [
+          "prove_reverse",
+          "prove_lock",
+          "prove_setup_boundary",
+          "prove_low_boundary",
+          "prove_late_immediate",
+          "prove_late_last_valid",
+          "prove_late_expired",
+          "prove_open_release_same_edge",
+          "cover_open_release_same_edge",
+          "cover"
+        ]
+      },
+      {"name": "prod2u_p4_axis_recovery_budget", "tasks": ["prove", "cover"]},
+      {"name": "prod2u_p4_axis_safety", "tasks": []},
+      {
+        "name": "prod2u_p4_limit_guard",
+        "tasks": ["prove", "cover", "cover_raw_rise", "cover_prestep_rise"]
+      },
+      {
+        "name": "prod2u_p4_axis_safety_gaps",
+        "tasks": [
+          "prove_open_stuck",
+          "cover_open_stuck",
+          "prove_invalid_distance",
+          "cover_invalid_distance",
+          "prove_recovery_disable",
+          "cover_recovery_disable",
+          "prove_recovery_watchdog",
+          "cover_recovery_watchdog",
+          "prove_closed_drop",
+          "cover_closed_drop"
+        ]
+      },
+      {"name": "prod2u_p4_axis_stop_contract", "tasks": ["prove", "cover"]},
+      {"name": "prod2u_p4_axis_terminal_backpressure", "tasks": ["prove", "cover"]},
+      {"name": "prod2u_p4_core_disable_motor_safety", "tasks": ["bmc", "cover"]},
+      {"name": "prod2u_p4_core_trace_hard_safe", "tasks": ["bmc", "cover"]},
+      {"name": "prod2u_p4_core_watchdog_race", "tasks": ["bmc", "cover"]},
+      {
+        "name": "prod2u_p4_motor_hub_axis_isolation",
+        "tasks": [
+          "prove_peer_overlap",
+          "cover_peer_overlap",
+          "prove_idle_evidence_peer_start",
+          "cover_idle_evidence_peer_start",
+          "prove_same_direction",
+          "cover_same_direction",
+          "prove_reverse_cancel",
+          "cover_reverse_cancel",
+          "prove_zero_motion_peer",
+          "cover_zero_motion_peer",
+          "prove_calibrated_handoff_dir0",
+          "cover_calibrated_handoff_dir0",
+          "prove_calibrated_handoff_dir1",
+          "cover_calibrated_handoff_dir1",
+          "prove_calibrated_peer_cancel_late_learning_dir0",
+          "prove_calibrated_peer_window_contract_dir0",
+          "prove_calibrated_peer_window_age_dir0",
+          "prove_calibrated_peer_remaining_nonincreasing_dir0",
+          "prove_calibrated_peer_remaining_single_tick_dir0",
+          "prove_calibrated_peer_peer_jog_accept_dir0",
+          "cover_calibrated_peer_dir0",
+          "prove_calibrated_peer_cancel_late_learning_dir1",
+          "prove_calibrated_peer_window_contract_dir1",
+          "prove_calibrated_peer_window_age_dir1",
+          "prove_calibrated_peer_remaining_nonincreasing_dir1",
+          "prove_calibrated_peer_remaining_single_tick_dir1",
+          "prove_calibrated_peer_peer_jog_accept_dir1",
+          "cover_calibrated_peer_dir1",
+          "prove_cancel_confirm_priority",
+          "cover_cancel_confirm_priority",
+          "prove_hard_stop",
+          "cover_hard_stop",
+          "prove_terminal_backpressure",
+          "cover_terminal_backpressure",
+          "prove_snapshot_partial",
+          "cover_snapshot_partial"
+        ]
+      },
+      {
+        "name": "prod2u_p4_axis_peer_confirm",
+        "tasks": [
+          "prove_wait_safety_dir0",
+          "prove_wait_safety_dir1",
+          "prove_fast_evidence_dir0",
+          "prove_fast_evidence_dir1",
+          "prove_closed_stability_dir0",
+          "prove_closed_stability_dir1",
+          "cover_dir0",
+          "cover_dir1"
+        ]
+      },
+      {"name": "prod2u_p4_normal_v3_rx", "tasks": ["prove", "cover"]},
+      {"name": "prod2u_p4_normal_v3_rx_payload", "tasks": []},
+      {"name": "prod2u_p4_normal_v3_watchdog_contract", "tasks": []},
+      {"name": "prod2u_p4_output_state", "tasks": ["prove", "values"]},
+      {
+        "name": "prod2u_p4_trace_buffer",
+        "tasks": [
+          "prove_write_word0",
+          "prove_write_word1",
+          "prove_write_word2",
+          "prove_write_word3",
+          "prove_write_word4",
+          "prove_write_word5",
+          "prove_write_word6",
+          "prove_write_word7",
+          "prove_storage",
+          "prove_pop_word0",
+          "prove_pop_word1",
+          "prove_pop_word2",
+          "prove_pop_word3",
+          "prove_pop_word4",
+          "prove_pop_word5",
+          "prove_pop_word6",
+          "prove_pop_word7",
+          "prove_stall_word0",
+          "prove_stall_word1",
+          "prove_stall_word2",
+          "prove_stall_word3",
+          "prove_stall_word4",
+          "prove_stall_word5",
+          "prove_stall_word6",
+          "prove_stall_word7",
+          "prove_event_type",
+          "prove_control",
+          "prove_overflow",
+          "cover"
+        ]
+      },
+      {"name": "prod2u_p4_trace_scheduler", "tasks": ["prove", "cover"]}
+    ]
+  }
+}

+ 0 - 10
constraints/pid_study_01.adc

@@ -1,10 +0,0 @@
-set_pin_assignment { sys_clk }   { LOCATION = J1;  IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }
-set_pin_assignment { sys_rst_n } { LOCATION = N6;  IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }
-set_pin_assignment { led[0] }    { LOCATION = H16; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[1] }    { LOCATION = H15; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[2] }    { LOCATION = J16; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[3] }    { LOCATION = J15; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[4] }    { LOCATION = K16; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[5] }    { LOCATION = K15; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[6] }    { LOCATION = L16; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[7] }    { LOCATION = L15; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }

+ 0 - 1
constraints/pid_study_01.sdc

@@ -1 +0,0 @@
-create_clock -name sys_clk -period 40 -waveform {0 20} [get_ports {sys_clk}]

+ 0 - 58
constraints/prod2u_bmc_replay_binary921.adc

@@ -1,58 +0,0 @@
-# prod2u_bmc_replay_binary921 constraints.
-# Pin profile: production-two-uart-bmc-replay-binary921.
-# BMC replay UART1: L10/M9 @115200. Combined Host+Debug UART2: M10/N11 @921600.
-# SRAM-only diagnostic constraints; no flash or cable programming command is present.
-# Board: fcb_fpga_mcu0611
-set_pin_assignment { sys_clk } { LOCATION = J1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[0] } { LOCATION = H16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[1] } { LOCATION = H15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[2] } { LOCATION = J16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[3] } { LOCATION = J15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[4] } { LOCATION = K16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[5] } { LOCATION = K15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[6] } { LOCATION = L16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[7] } { LOCATION = L15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_rx } { LOCATION = M9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_tx } { LOCATION = L10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_rx } { LOCATION = N11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_tx } { LOCATION = M10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[0] } { LOCATION = D2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[1] } { LOCATION = D3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[2] } { LOCATION = E6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[3] } { LOCATION = D6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[4] } { LOCATION = C1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[5] } { LOCATION = C2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[6] } { LOCATION = B3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[7] } { LOCATION = B13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[0] } { LOCATION = N10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[1] } { LOCATION = M11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[2] } { LOCATION = P12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[3] } { LOCATION = R11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[0] } { LOCATION = C4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[1] } { LOCATION = B5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[2] } { LOCATION = B1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[3] } { LOCATION = A14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[0] } { LOCATION = F16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[1] } { LOCATION = G16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[2] } { LOCATION = T4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[3] } { LOCATION = R5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[4] } { LOCATION = T6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[5] } { LOCATION = R7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[6] } { LOCATION = M1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[7] } { LOCATION = N1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[8] } { LOCATION = P1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[9] } { LOCATION = R1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[10] } { LOCATION = T2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[11] } { LOCATION = R3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[12] } { LOCATION = P16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[13] } { LOCATION = R16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[14] } { LOCATION = M16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[15] } { LOCATION = N16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[16] } { LOCATION = P8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[17] } { LOCATION = P7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[18] } { LOCATION = T9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[19] } { LOCATION = P9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[20] } { LOCATION = P10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[21] } { LOCATION = R10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[22] } { LOCATION = T13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[23] } { LOCATION = T12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }

+ 6 - 6
constraints/prod2u_p4_normal_v3.adc

@@ -1,8 +1,8 @@
 # Prod2U Profile 4 Normal v3 board constraints.
 # Host UART2 is true RS232 through U23 at 921600 8N1.
-# TEMP SCL/SDA are open-drain in RTL and require confirmed external pull-ups.
+# M8/N9 are intentionally unassigned after retiring the temperature stack.
 set_pin_assignment { sys_clk } { LOCATION = J1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_rx } { LOCATION = N11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
+set_pin_assignment { host_uart_rx } { LOCATION = N11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; PACKREG = OFF; }
 set_pin_assignment { host_uart_tx } { LOCATION = M10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
 set_pin_assignment { fan_pwm_out[0] } { LOCATION = C4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
 set_pin_assignment { fan_pwm_out[1] } { LOCATION = B5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
@@ -40,7 +40,7 @@ set_pin_assignment { y_step } { LOCATION = D15; IOSTANDARD = LVCMOS33; PULLTYPE
 set_pin_assignment { y_dir } { LOCATION = H14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
 set_pin_assignment { z_step } { LOCATION = H12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
 set_pin_assignment { z_dir } { LOCATION = F14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { x_limit_raw } { LOCATION = A11; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }
-set_pin_assignment { y_limit_raw } { LOCATION = A5; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }
-set_pin_assignment { temp_scl } { LOCATION = M8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { temp_sda } { LOCATION = N9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
+# LS1/X: CON30.3 -> FAN_GPIO3 -> R662 -> BANK0_GPIO3 -> B9.
+# LS2/Y: CON12.3 -> FAN_GPIO1 -> R660 -> BANK0_GPIO1 -> A11. A5 is unassigned.
+set_pin_assignment { x_limit_raw } { LOCATION = B9; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; PACKREG = OFF; }
+set_pin_assignment { y_limit_raw } { LOCATION = A11; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; PACKREG = OFF; }

+ 0 - 23
constraints/uart_rs232_j6_host_sensor_real_fan_ptc_debug921_primary.adc

@@ -1,23 +0,0 @@
-# real-bmc-j6-host-sensor-real-fan-ptc-debug921-v1 primary build constraints.
-# COM7 Debug P10/R10 921600: USB serial TXD -> P10 (FPGA RX), USB serial RXD <- R10 (FPGA TX).
-# COM8 Host P7/P8 115200: serial RXD <- FPGA TX P7, serial TXD -> FPGA RX P8.
-# J6 T4/R5: FPGA TX -> J6 pin 5/T4, FPGA RX <- J6 pin 6/R5.
-# FAIL-CLOSED: real FAN/PTC pin map is incomplete in this repository. This ADC maps only
-# clocks, reset, J6, HostPort, DebugPort, and LEDs; it intentionally does not bind
-# real FAN/PTC actuator outputs and does not claim real hardware pin map pass.
-set_pin_assignment { sys_clk } { LOCATION = J1;  IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }
-set_pin_assignment { sys_rst_n } { LOCATION = N6;  IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }
-set_pin_assignment { bmc_uart_tx } { LOCATION = T4;  IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_rx } { LOCATION = R5;  IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }
-set_pin_assignment { host_uart_tx } { LOCATION = P7;  IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_rx } { LOCATION = P8;  IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }
-set_pin_assignment { debug_uart_rx } { LOCATION = P10; IOSTANDARD = LVCMOS33; PULLTYPE = PULLUP; }
-set_pin_assignment { debug_uart_tx } { LOCATION = R10; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[0] }        { LOCATION = H16; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[1] }        { LOCATION = H15; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[2] }        { LOCATION = J16; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[3] }        { LOCATION = J15; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[4] }        { LOCATION = K16; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[5] }        { LOCATION = K15; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[6] }        { LOCATION = L16; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }
-set_pin_assignment { led[7] }        { LOCATION = L15; IOSTANDARD = LVCMOS33; DRIVESTRENGTH = 20; PULLTYPE = NONE; }

+ 0 - 61
constraints/uart_rs232_j6_host_sensor_real_fan_ptc_debug_photo_uart_bmc_replay_binary921.adc

@@ -1,61 +0,0 @@
-# uart_rs232_j6_host_sensor_real_fan_ptc_debug_photo_uart_bmc_replay_binary921 constraints.
-# Pin profile: debug-photo-bmc-replay-binary921. Derived from config/pin_inventory.fcb_fpga_mcu0611.json.
-# SRAM-only diagnostic constraints; no flash or cable programming command is present.
-# BMC input is a PC replay from a real BMC capture; no live BMC link is claimed.
-# Board: fcb_fpga_mcu0611
-set_pin_assignment { sys_clk } { LOCATION = J1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { sys_rst_n } { LOCATION = N6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[0] } { LOCATION = H16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[1] } { LOCATION = H15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[2] } { LOCATION = J16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[3] } { LOCATION = J15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[4] } { LOCATION = K16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[5] } { LOCATION = K15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[6] } { LOCATION = L16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[7] } { LOCATION = L15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_rx } { LOCATION = R5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_tx } { LOCATION = T4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { debug_uart_rx } { LOCATION = P10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { debug_uart_tx } { LOCATION = R10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[0] } { LOCATION = D2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[1] } { LOCATION = D3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[2] } { LOCATION = E6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[3] } { LOCATION = D6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[4] } { LOCATION = C1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[5] } { LOCATION = C2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[6] } { LOCATION = B3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[7] } { LOCATION = B13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[0] } { LOCATION = N10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[1] } { LOCATION = M11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[2] } { LOCATION = P12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[3] } { LOCATION = R11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[0] } { LOCATION = C4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[1] } { LOCATION = B5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[2] } { LOCATION = B1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[3] } { LOCATION = A14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_rx } { LOCATION = P8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_tx } { LOCATION = P7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[0] } { LOCATION = F16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[1] } { LOCATION = G16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[2] } { LOCATION = P5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[3] } { LOCATION = T8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[4] } { LOCATION = T6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[5] } { LOCATION = R7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[6] } { LOCATION = M1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[7] } { LOCATION = N1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[8] } { LOCATION = P1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[9] } { LOCATION = R1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[10] } { LOCATION = T2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[11] } { LOCATION = R3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[12] } { LOCATION = P16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[13] } { LOCATION = R16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[14] } { LOCATION = M16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[15] } { LOCATION = N16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[16] } { LOCATION = M14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[17] } { LOCATION = M15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[18] } { LOCATION = T9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[19] } { LOCATION = P9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[20] } { LOCATION = P15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[21] } { LOCATION = N14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[22] } { LOCATION = T13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[23] } { LOCATION = T12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }

+ 0 - 61
constraints/uart_rs232_j6_host_sensor_real_fan_ptc_debug_photo_uart_bmc_replay_debug921.adc

@@ -1,61 +0,0 @@
-# uart_rs232_j6_host_sensor_real_fan_ptc_debug_photo_uart_bmc_replay_debug921 constraints.
-# Pin profile: debug-photo-uart-bmc-replay. Derived from config/pin_inventory.fcb_fpga_mcu0611.json.
-# SRAM-only diagnostic constraints; no flash or cable programming command is present.
-# BMC input is a PC replay from a real BMC capture; no live BMC link is claimed.
-# Board: fcb_fpga_mcu0611
-set_pin_assignment { sys_clk } { LOCATION = J1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { sys_rst_n } { LOCATION = N6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[0] } { LOCATION = H16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[1] } { LOCATION = H15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[2] } { LOCATION = J16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[3] } { LOCATION = J15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[4] } { LOCATION = K16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[5] } { LOCATION = K15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[6] } { LOCATION = L16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[7] } { LOCATION = L15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_rx } { LOCATION = R5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_tx } { LOCATION = T4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { debug_uart_rx } { LOCATION = P10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { debug_uart_tx } { LOCATION = R10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[0] } { LOCATION = D2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[1] } { LOCATION = D3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[2] } { LOCATION = E6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[3] } { LOCATION = D6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[4] } { LOCATION = C1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[5] } { LOCATION = C2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[6] } { LOCATION = B3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[7] } { LOCATION = B13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[0] } { LOCATION = N10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[1] } { LOCATION = M11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[2] } { LOCATION = P12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[3] } { LOCATION = R11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[0] } { LOCATION = C4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[1] } { LOCATION = B5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[2] } { LOCATION = B1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[3] } { LOCATION = A14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_rx } { LOCATION = P8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_tx } { LOCATION = P7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[0] } { LOCATION = F16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[10] } { LOCATION = T2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[11] } { LOCATION = R3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[12] } { LOCATION = P16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[13] } { LOCATION = R16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[14] } { LOCATION = M16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[15] } { LOCATION = N16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[16] } { LOCATION = M14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[17] } { LOCATION = M15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[18] } { LOCATION = T9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[19] } { LOCATION = P9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[1] } { LOCATION = G16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[20] } { LOCATION = P15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[21] } { LOCATION = N14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[22] } { LOCATION = T13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[23] } { LOCATION = T12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[2] } { LOCATION = P5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[3] } { LOCATION = T8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[4] } { LOCATION = T6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[5] } { LOCATION = R7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[6] } { LOCATION = M1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[7] } { LOCATION = N1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[8] } { LOCATION = P1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[9] } { LOCATION = R1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }

+ 0 - 61
constraints/uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart1_bmc_replay_binary921.adc

@@ -1,61 +0,0 @@
-# uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart1_bmc_replay_binary921 constraints.
-# Pin profile: formal-uart1-bmc-replay-binary921. Derived from config/pin_inventory.fcb_fpga_mcu0611.json.
-# SRAM-only diagnostic constraints; no flash or cable programming command is present.
-# BMC input is a PC replay from a real BMC capture through UART1; no live BMC link is claimed.
-# Board: fcb_fpga_mcu0611
-set_pin_assignment { sys_clk } { LOCATION = J1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { sys_rst_n } { LOCATION = N6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[0] } { LOCATION = H16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[1] } { LOCATION = H15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[2] } { LOCATION = J16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[3] } { LOCATION = J15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[4] } { LOCATION = K16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[5] } { LOCATION = K15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[6] } { LOCATION = L16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[7] } { LOCATION = L15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_rx } { LOCATION = M9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_tx } { LOCATION = L10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { debug_uart_rx } { LOCATION = M14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { debug_uart_tx } { LOCATION = M15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[0] } { LOCATION = D2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[1] } { LOCATION = D3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[2] } { LOCATION = E6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[3] } { LOCATION = D6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[4] } { LOCATION = C1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[5] } { LOCATION = C2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[6] } { LOCATION = B3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[7] } { LOCATION = B13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[0] } { LOCATION = N10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[1] } { LOCATION = M11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[2] } { LOCATION = P12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[3] } { LOCATION = R11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[0] } { LOCATION = C4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[1] } { LOCATION = B5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[2] } { LOCATION = B1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[3] } { LOCATION = A14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_rx } { LOCATION = N11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_tx } { LOCATION = M10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[0] } { LOCATION = F16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[1] } { LOCATION = G16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[2] } { LOCATION = T4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[3] } { LOCATION = R5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[4] } { LOCATION = T6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[5] } { LOCATION = R7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[6] } { LOCATION = M1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[7] } { LOCATION = N1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[8] } { LOCATION = P1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[9] } { LOCATION = R1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[10] } { LOCATION = T2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[11] } { LOCATION = R3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[12] } { LOCATION = P16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[13] } { LOCATION = R16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[14] } { LOCATION = M16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[15] } { LOCATION = N16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[16] } { LOCATION = P8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[17] } { LOCATION = P7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[18] } { LOCATION = T9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[19] } { LOCATION = P9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[20] } { LOCATION = P10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[21] } { LOCATION = R10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[22] } { LOCATION = T13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[23] } { LOCATION = T12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }

+ 0 - 61
constraints/uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart1_bmc_replay_debug921.adc

@@ -1,61 +0,0 @@
-# uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart1_bmc_replay_debug921 constraints.
-# Pin profile: formal-uart1-bmc-replay. Derived from config/pin_inventory.fcb_fpga_mcu0611.json.
-# SRAM-only diagnostic constraints; no flash or cable programming command is present.
-# BMC input is a PC replay from a real BMC capture through UART1; no live BMC link is claimed.
-# Board: fcb_fpga_mcu0611
-set_pin_assignment { sys_clk } { LOCATION = J1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { sys_rst_n } { LOCATION = N6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[0] } { LOCATION = H16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[1] } { LOCATION = H15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[2] } { LOCATION = J16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[3] } { LOCATION = J15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[4] } { LOCATION = K16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[5] } { LOCATION = K15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[6] } { LOCATION = L16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[7] } { LOCATION = L15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_rx } { LOCATION = M9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_tx } { LOCATION = L10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { debug_uart_rx } { LOCATION = P15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { debug_uart_tx } { LOCATION = N14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[0] } { LOCATION = D2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[1] } { LOCATION = D3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[2] } { LOCATION = E6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[3] } { LOCATION = D6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[4] } { LOCATION = C1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[5] } { LOCATION = C2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[6] } { LOCATION = B3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[7] } { LOCATION = B13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[0] } { LOCATION = N10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[1] } { LOCATION = M11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[2] } { LOCATION = P12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[3] } { LOCATION = R11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[0] } { LOCATION = C4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[1] } { LOCATION = B5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[2] } { LOCATION = B1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[3] } { LOCATION = A14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_rx } { LOCATION = N11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_tx } { LOCATION = M10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[0] } { LOCATION = F16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[10] } { LOCATION = T2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[11] } { LOCATION = R3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[12] } { LOCATION = P16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[13] } { LOCATION = R16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[14] } { LOCATION = M16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[15] } { LOCATION = N16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[16] } { LOCATION = P8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[17] } { LOCATION = P7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[18] } { LOCATION = T9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[19] } { LOCATION = P9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[1] } { LOCATION = G16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[20] } { LOCATION = P10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[21] } { LOCATION = R10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[22] } { LOCATION = T13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[23] } { LOCATION = T12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[2] } { LOCATION = T4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[3] } { LOCATION = R5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[4] } { LOCATION = T6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[5] } { LOCATION = R7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[6] } { LOCATION = M1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[7] } { LOCATION = N1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[8] } { LOCATION = P1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[9] } { LOCATION = R1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }

+ 0 - 61
constraints/uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart_debug921.adc

@@ -1,61 +0,0 @@
-# uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart_debug921 constraints.
-# Pin profile: formal-uart. Generated from config/pin_inventory.fcb_fpga_mcu0611.json.
-# SRAM-only diagnostic constraints; no flash or cable programming command is present.
-# Generated by tools/pin_inventory.py
-# Board: fcb_fpga_mcu0611
-set_pin_assignment { sys_clk } { LOCATION = J1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { sys_rst_n } { LOCATION = N6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[0] } { LOCATION = H16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[1] } { LOCATION = H15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[2] } { LOCATION = J16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[3] } { LOCATION = J15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[4] } { LOCATION = K16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[5] } { LOCATION = K15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[6] } { LOCATION = L16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[7] } { LOCATION = L15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_rx } { LOCATION = T8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_tx } { LOCATION = P5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { debug_uart_rx } { LOCATION = P15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { debug_uart_tx } { LOCATION = N14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[0] } { LOCATION = D2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[1] } { LOCATION = D3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[2] } { LOCATION = E6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[3] } { LOCATION = D6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[4] } { LOCATION = C1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[5] } { LOCATION = C2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[6] } { LOCATION = B3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[7] } { LOCATION = B13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[0] } { LOCATION = N10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[1] } { LOCATION = M11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[2] } { LOCATION = P12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[3] } { LOCATION = R11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[0] } { LOCATION = C4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[1] } { LOCATION = B5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[2] } { LOCATION = B1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[3] } { LOCATION = A14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_rx } { LOCATION = M15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_tx } { LOCATION = M14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[0] } { LOCATION = F16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[10] } { LOCATION = T2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[11] } { LOCATION = R3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[12] } { LOCATION = P16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[13] } { LOCATION = R16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[14] } { LOCATION = M16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[15] } { LOCATION = N16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[16] } { LOCATION = P8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[17] } { LOCATION = P7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[18] } { LOCATION = T9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[19] } { LOCATION = P9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[1] } { LOCATION = G16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[20] } { LOCATION = P10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[21] } { LOCATION = R10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[22] } { LOCATION = T13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[23] } { LOCATION = T12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[2] } { LOCATION = T4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[3] } { LOCATION = R5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[4] } { LOCATION = T6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[5] } { LOCATION = R7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[6] } { LOCATION = M1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[7] } { LOCATION = N1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[8] } { LOCATION = P1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[9] } { LOCATION = R1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }

+ 0 - 61
constraints/uart_rs232_j6_host_sensor_real_fan_ptc_temp_uart_ptc_remap_debug921.adc

@@ -1,61 +0,0 @@
-# uart_rs232_j6_host_sensor_real_fan_ptc_temp_uart_ptc_remap_debug921 constraints.
-# Pin profile: temp-uart-ptc-remap. Generated from config/pin_inventory.fcb_fpga_mcu0611.json.
-# SRAM-only diagnostic constraints; no flash or cable programming command is present.
-# Generated by tools/pin_inventory.py
-# Board: fcb_fpga_mcu0611
-set_pin_assignment { sys_clk } { LOCATION = J1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { sys_rst_n } { LOCATION = N6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[0] } { LOCATION = H16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[1] } { LOCATION = H15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[2] } { LOCATION = J16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[3] } { LOCATION = J15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[4] } { LOCATION = K16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[5] } { LOCATION = K15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[6] } { LOCATION = L16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { led[7] } { LOCATION = L15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_rx } { LOCATION = R5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { bmc_uart_tx } { LOCATION = T4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { debug_uart_rx } { LOCATION = P10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { debug_uart_tx } { LOCATION = R10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[0] } { LOCATION = D2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[1] } { LOCATION = D3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[2] } { LOCATION = E6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[3] } { LOCATION = D6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[4] } { LOCATION = C1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[5] } { LOCATION = C2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[6] } { LOCATION = B3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_fg_in[7] } { LOCATION = B13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[0] } { LOCATION = N10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[1] } { LOCATION = M11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[2] } { LOCATION = P12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_install_in[3] } { LOCATION = R11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[0] } { LOCATION = C4; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[1] } { LOCATION = B5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[2] } { LOCATION = B1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { fan_pwm_out[3] } { LOCATION = A14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_rx } { LOCATION = P8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { host_uart_tx } { LOCATION = P7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[0] } { LOCATION = F16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[10] } { LOCATION = T2; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[11] } { LOCATION = R3; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[12] } { LOCATION = P16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[13] } { LOCATION = R16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[14] } { LOCATION = M16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[15] } { LOCATION = N16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[16] } { LOCATION = M14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[17] } { LOCATION = M15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[18] } { LOCATION = T9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[19] } { LOCATION = P9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[1] } { LOCATION = G16; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[20] } { LOCATION = P15; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[21] } { LOCATION = N14; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[22] } { LOCATION = T13; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[23] } { LOCATION = T12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[2] } { LOCATION = P5; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[3] } { LOCATION = T8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[4] } { LOCATION = T6; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[5] } { LOCATION = R7; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[6] } { LOCATION = M1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[7] } { LOCATION = N1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[8] } { LOCATION = P1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
-set_pin_assignment { ptc_pwm_out[9] } { LOCATION = R1; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }

+ 0 - 92
docs/adr/0001-j6-bmc-replay-binary921-boundaries.zh-CN.md

@@ -1,92 +0,0 @@
-# ADR-0001: J6 BMC-Replay Binary921 边界
-
-## Status
-
-Accepted
-
-## Date
-
-2026-07-09
-
-## Context
-
-J6 debug921 旧方案依赖 CPLD 内部拼接大量 ASCII `J6RAW/J6EVT/J6STAT/J6MAP/J6TEMP` 文本。历史资源审计显示资源压力主要来自 top 内 debug/report/text-generation 逻辑,而 PWM 执行本身相对小。用户现在要求重新规划多串口连接,CPLD 暂不直连 live BMC,改为 PC 抓取真实 BMC raw payload 后通过串口 replay。
-
-同时存在两个硬件目标:
-
-- 照片/现有可接点优先的 debug 版本,可以最快调试,但会占用 6 个真实 HEAT/PTC ball。
-- PDF/inventory 正式 pinout 版本,使用 UART1/2 释放真实 HEAT/PTC/FAN,但 UART1/2 可接性和 TD resource 仍需复核。
-
-## Decision Drivers
-
-- 需要减少 CPLD 内部 ASCII 拼接 LUT 压力。
-- 需要把人读日志生成放到 PC 端,CPLD 输出可校验机器证据。
-- 需要区分 live BMC、PC replay、盲发循环三种不同证据强度。
-- 需要严格避免把未运行的 TD/板级/真实负载/热闭环动作写成 pass。
-- 需要保留用户当前可接线调试路径。
-
-## Considered Options
-
-### Option 1: 继续 ASCII debug921
-
-- Pros: 人类可直接用串口助手阅读;与旧 collector/runbook 接近。
-- Cons: CPLD LUT 压力高;长文本字段容易引入解析/尾帧/十六进制/PowerShell 类型错误;formal 资源收敛困难。
-
-### Option 2: 二进制 DebugPort,HostPort 仍用 ASCII
-
-- Pros: 降低 DebugPort 文本拼接压力;Host 手工调试较简单。
-- Cons: 仍保留 Host ASCII parser 和 ACK 错位风险;Host/Debug 证据模型不统一。
-
-### Option 3: HostPort 和 DebugPort 都采用 binary921
-
-- Pros: 机器帧可 CRC、可 seq、可 profile 校验;CPLD 不再负责长文本;PC decoder 统一生成人读证据;最有机会降低 formal 资源压力。
-- Cons: 手工串口助手不能直接敲 ASCII 命令;需要 Python harness;初期实现和测试成本更高。
-
-## Decision
-
-采用 Option 3:HostPort 和 DebugPort 都采用 `binary921` 机器帧。BMC source 改为 `pc_replay_from_real_bmc_capture`,CPLD 不再直接连接 live BMC。
-
-交付分两轨:
-
-- `debug-photo-bmc-replay-binary921`:使用 `T4/R5`、`P7/P8`、`P10/R10`,6 路 PTC remap 到 `P5/T8/M14/M15/P15/N14`。只有在 TD build、package selftest、板级 SRAM evidence、validator strict 全部通过后,才允许发布可刷 pass 包。
-- `formal-uart1-bmc-replay-binary921`:使用 `UART1_TX=L10`、`UART1_RX=M9`、`UART2_TX=M10`、`UART2_RX=N11`,保留全部真实 HEAT/FAN/FG/INSTALL。UART1/2 可接性和 TD/resource 未通过前,只能发布 blocked 说明,不发布可刷 pass bitstream。
-
-## Consequences
-
-### Positive
-
-- CPLD 侧不再承担长 ASCII 日志格式化。
-- ACK、event、snapshot 均可用 `seq/profile/CRC` 严格验证。
-- 旧程序输出、启动噪声、ACK 错位可以通过 epoch 和 seq 归因。
-- PC 端 decoder 可以输出 JSON/Markdown,既给机器验收,也给人读报告。
-- debug-photo 与 formal-uart1 的声明边界明确。
-
-### Negative
-
-- 手工串口助手无法直接发送可读命令,必须使用 Python CLI 或专用工具。
-- 需要维护 binary protocol、decoder、validator、package selftest。
-- 旧 ASCII collector/runbook 不能直接作为新 strict pass 证据。
-
-### Risks and Mitigations
-
-- Risk: binary921 RTL 仍可能资源超限。
-  - Mitigation: 每次 TD build 必须保存 QOR/area/timing receipt;formal 未通过时保持 blocked。
-- Risk: UART1/2 在 PDF 中存在但现场不可接。
-  - Mitigation: formal-uart1 必须保留 `blocked_waiting_for_uart1_uart2_access`,直到连通性实测。
-- Risk: PC replay 被误认为 live BMC pass。
-  - Mitigation: receipt 固定 `bmc_source=pc_replay_from_real_bmc_capture` 和 `live_bmc_link_status=not_used`。
-- Risk: 真实 PTC/FAN 未接时软件链路 pass 被误解为硬件 pass。
-  - Mitigation: `real_fan_ptc_hardware_status=not_run` 不参与硬件 pass;真实负载另建 gate。
-
-## Implementation Notes
-
-- 协议规范见 [docs/j6-bmc-replay-binary921-protocol-v1.zh-CN.md](/C:/Users/Administrator/Agentworkspace/CPLD/docs/j6-bmc-replay-binary921-protocol-v1.zh-CN.md)。
-- 实施计划见 [docs/j6-bmc-replay-binary921-implementation-plan-v1.zh-CN.md](/C:/Users/Administrator/Agentworkspace/CPLD/docs/j6-bmc-replay-binary921-implementation-plan-v1.zh-CN.md)。
-- `PROGRAM_FLASH`、`ERASE_FLASH`、`PROGRAM_SPIBIN`、`DIRECT_FLASH_WRITE` 仍属于 fail-closed 禁区。
-
-## Related Documents
-
-- [docs/j6-bmc-replay-binary921-architecture.zh-CN.md](/C:/Users/Administrator/Agentworkspace/CPLD/docs/j6-bmc-replay-binary921-architecture.zh-CN.md)
-- [docs/host-cpld-uart-spec-v1.zh-CN.md](/C:/Users/Administrator/Agentworkspace/CPLD/docs/host-cpld-uart-spec-v1.zh-CN.md)
-- [docs/verification-gates-v2.zh-CN.md](/C:/Users/Administrator/Agentworkspace/CPLD/docs/verification-gates-v2.zh-CN.md)
-- [docs/fact-source-boundary.zh-CN.md](/C:/Users/Administrator/Agentworkspace/CPLD/docs/fact-source-boundary.zh-CN.md)

+ 0 - 15
docs/adr/README.zh-CN.md

@@ -1,15 +0,0 @@
-# Architecture Decision Records
-
-本目录保存 CPLD 工程中影响 pin profile、串口协议、真实硬件动作、receipt/gate 口径的架构决策。
-
-## Index
-
-| ADR | Title | Status | Date |
-| --- | --- | --- | --- |
-| [0001](0001-j6-bmc-replay-binary921-boundaries.zh-CN.md) | J6 BMC-Replay Binary921 边界 | Accepted | 2026-07-09 |
-
-## 使用规则
-
-- 新增 live BMC、真实热闭环、flash、驱动安装、外部仪器或生产硬件动作前,必须新增或更新 ADR。
-- ADR 只记录决策、原因和后果;实现细节放到 `docs/*implementation-plan*.zh-CN.md` 或对应 runbook。
-- 已接受 ADR 不直接改历史结论;如果结论变更,新增 ADR supersede。

+ 0 - 41
docs/bmc-uart-temperature-protocol-v2.zh-CN.md

@@ -1,41 +0,0 @@
-# BMC UART 温度协议 V2
-
-## 串口与轮询
-
-- UART:`115200 8N1`。
-- CPLD 每 1 秒发送:
-
-```text
-ipmitool raw 0x36 0x6c 0xdf 0xdd 0x00 0x03
-```
-
-命令实际带换行:`ipmitool raw 0x36 0x6c 0xdf 0xdd 0x00 0x03\n`。
-
-## 响应格式
-
-BMC 返回 loose text hex。parser 必须兼容:
-
-- 空格、逗号、括号、引号。
-- `0xNN` 或裸 hex byte。
-- 多行。
-- echo 和 no-echo。
-
-有效温度帧为 48 byte,即 24 个 DIMM,每个 DIMM 两个 byte。
-
-## 温度编码
-
-- 第一个 byte:整数摄氏。
-- 第二个 byte:小数百分位。
-- `23 4b` 表示 35.75C。
-- `28 00` 表示 40.00C。
-- `ff ff` 表示 DIMM 缺失。
-
-fraction 必须在 0..99;超出视为 parser error。有效 DIMM 温度达到 90C 必须触发 overtemp safety。
-
-## 滑动窗口规则
-
-parser 从文本 token 流中使用滑动候选窗口提取 48 byte。包含 poll command byte 序列 `36 6c df dd 00 03` 的候选窗口视为 echo,不得误当温度帧。窗口必须满足 24 对 byte、`ff ff` 缺失合法、fraction 合法、至少一个 present DIMM。
-
-## stale 规则
-
-10s 内没有有效 BMC 温度帧时,系统进入 BMC stale:PTC 全关,风扇进入 fallback。该规则独立于 host 配置串口。

+ 0 - 35
docs/fact-source-boundary.zh-CN.md

@@ -1,35 +0,0 @@
-# 事实来源与边界
-
-本工程是 CPLD PID/高温罩控制合同工程,不等同于最终产品板完整热认证。
-
-## 已冻结事实
-
-- BMC 温度源通过 UART loose text hex 协议进入。
-- UART 参数为 `115200 8N1`。
-- 每秒轮询一次 BMC 温度。
-- 24 根 DIMM、24 个 PTC、24 个 control channel 一一对应。
-- CPU0 为 channel 0..11,CPU1 为 channel 12..23。
-- 最新原理图目标风扇接口为 4 路 `FAN_PWM`、8 路 `FAN_FG`、4 路 `FAN_INSTALL`。
-- 风扇默认背景档和故障策略属于控制合同;真实转速、tach 脉冲含义和气流标定仍需后续硬件验证。
-- 默认目标 70C;90C 硬过温保护永远优先。
-- BMC 温度断更超过 10s:PTC 全关,风扇进入 fallback。
-- 首次真机 PID 最高 PTC duty 限幅 25%。
-- FPGA IO 侧 UART 是 3.3V TTL;RS232 必须外接电平转换。
-
-## 未冻结事实
-
-- 最新原理图 pin inventory 已追到 FPGA ball,但当前三路临时 UART 与 `HEAT3/4/17/18/21/22` 冲突;冲突解除前真实 FAN/PTC bitstream 必须 fail closed。
-- PTC 驱动电路、电气极性、功率能力、硬件互锁。
-- 风扇真实驱动极性、tach pulses、故障策略和气流标定。
-- BMC 实际串口线缆、隔离、电平转换、错误注入和长期稳定性。
-- 真实热模型参数、温升惯性、串扰矩阵和稳态收敛证据。
-
-## 约束策略
-
-`constraints/pid_study_01.adc` 只绑定 MINI smoke IO:`sys_clk`、`sys_rst_n`、`led[0..7]`。它不绑定 PTC、fan、BMC UART、host UART、motor、tach 或任何真实高温罩 IO。
-
-`td/uart_rs232_j6_host_sensor_real_fan_ptc_debug921_primary.prj` 是当前唯一用户主 TD profile;在真实 FAN/PTC pin 与临时 UART 冲突解除前,它必须 fail closed,不生成声明可刷的真实 FAN/PTC bitstream。
-
-## 资料治理
-
-原始资料只能放在 `reference/original/`。产品板资料未导入前,完整热闭环 gate 必须保持 blocked。

+ 0 - 24
docs/fake-stress-verification-v2.zh-CN.md

@@ -1,24 +0,0 @@
-# Fake Stress 验证
-
-fake stress 用来在不接真实高温罩的情况下压测 CPLD PID、parser、safety、debug UART 和 register dump 路径。它不是热标定模型。
-
-## 场景
-
-- `ramp`:缓慢升温。
-- `step`:快速阶跃。
-- `noise`:温度扰动。
-- `missing_mask`:DIMM 缺失。
-- `bmc_stale`:10s stale。
-- `echo_no_echo`:BMC 文本 echo 与无 echo。
-- `parser_garbage`:乱码、短帧、长帧、bad fraction。
-- `full_rate_sweep`:高频扫过 frame_seq、config_seq、fault/state 位,验证 debug UART 和 register dump 可观测。
-
-## 必需证据
-
-- 协议 parser receipt。
-- UART bit-level RTL sim。
-- debug UART event stream。
-- register dump 快照。
-- final-gate-v2 receipt。
-
-24 小时 offline fake gate 通过后,才允许进入分级实机 SRAM UART smoke。真实热闭环仍需独立 runbook 和人工/仪器记录。

+ 0 - 23
docs/high-temp-chamber-design-v2.zh-CN.md

@@ -1,23 +0,0 @@
-# 高温罩控制设计 V2
-
-## 默认策略
-
-- 默认目标温度:70C。
-- 硬过温:90C,优先级最高。
-- BMC stale:10s 后 PTC 全关,fan fallback。
-- 首次真实闭环:PTC duty 限幅 25%。
-- 风扇:默认背景档,故障全速。
-
-## 当前准入
-
-当前只允许 software/model/RTL/formal/UART evidence 和 SRAM-only 实机通信验证。不得绕过 `final-gate-v2` 直接进入真机 PID。
-
-## 产品板阻塞项
-
-- 产品板 pin map。
-- PTC/fan 驱动资料。
-- BMC 串口电气资料。
-- 人工急停和回滚方案。
-- 外部仪器记录模板。
-
-上述资料未完成前,完整热闭环保持 blocked。

+ 0 - 28
docs/interface-contract.zh-CN.md

@@ -1,28 +0,0 @@
-# 接口合同
-
-## BMC UART
-
-- 波特率:`115200`
-- 格式:`8N1`
-- 协议:loose text hex。
-- 温度:每 DIMM 两个 byte,整数摄氏 + 小数百分位。
-- 缺失:`ff ff`。
-- counterparty:`pc_emulator` 或 `real_bmc`。
-
-## 物理 UART/RS232
-
-RS232 只作为外部电平转换链路。FPGA IO 侧必须是 3.3V UART,通过 MAX3232 类转换板连接到 RJ45/RS232 线缆。
-
-## Debug Evidence
-
-必须能进入 debug bundle:
-
-- debug UART event stream。
-- register dump。
-- parser status。
-- stale/missing/fault/config_seq。
-- PTC force_off 和 fan fallback 状态。
-
-## 禁止
-
-不恢复 `rs232_temperature_inject` 作为逻辑源。不通过 RS232 电平直接驱动 FPGA IO。

文件差異過大導致無法顯示
+ 0 - 202
docs/j6-bmc-replay-binary921-architecture.zh-CN.md


+ 0 - 270
docs/j6-bmc-replay-binary921-implementation-plan-v1.zh-CN.md

@@ -1,270 +0,0 @@
-# J6 BMC-Replay Binary921 实施计划 v1
-
-> **For agentic workers:** REQUIRED SUB-SKILL: use an execution workflow and complete tasks in order. Do not mark board, TD, package, or hardware layers as pass unless that layer was actually run and its receipt is present.
-
-**Goal:** 交付 `debug-photo-bmc-replay-binary921` 的可验证 SRAM-only 诊断链路,并把 `formal-uart1-bmc-replay-binary921` 保持为资源/可接性 blocked 的目标架构,直到 TD/resource 与 UART1/2 实测通过。
-
-**Architecture:** 共享执行核心保留 BMC poll、DIMM cache、PWM、PID requested-but-inactive、timeout fallback;HostPort/DebugPort 改为 binary921 机器帧;PC harness 负责 capture/replay/decode/validate。PowerShell 只做启动包装,复杂解析都在 Python。
-
-**Tech Stack:** Verilog RTL, TD 2026.1 project files, Python 3.12, PowerShell launch wrappers, pytest/unittest, JSON receipts, SRAM-only BitWriter.
-
-## Global Constraints
-
-- 当前权威 pin map 来自 `reference/original/schematics/FCB_FPGA+MCU0611.pdf` 和 `config/pin_inventory.fcb_fpga_mcu0611.json`。
-- Debug-photo 串口固定:BMC replay `T4/R5 @115200`,Host `P7/P8 @115200`,Debug `P10/R10 @921600`。
-- Formal-uart1 串口目标:BMC replay `L10/M9`,Host `M10/N11`,Debug 使用不冲突 spare GPIO。
-- BMC source 固定为 `pc_replay_from_real_bmc_capture`;CPLD 不直连 live BMC。
-- 不执行 flash;不安装驱动;不枚举未知 COM;不写 DebugPort。
-- 真实 PTC/FAN 未接入时必须写 `real_fan_ptc_hardware_status=not_run`。
-- 未运行 TD build、未刷 SRAM、未接板、未跑 validator 的层级不得写 pass。
-
----
-
-## Task 1: 冻结协议与文档合同
-
-**Files:**
-- Modify: [docs/j6-bmc-replay-binary921-architecture.zh-CN.md](/C:/Users/Administrator/Agentworkspace/CPLD/docs/j6-bmc-replay-binary921-architecture.zh-CN.md)
-- Create: [docs/j6-bmc-replay-binary921-protocol-v1.zh-CN.md](/C:/Users/Administrator/Agentworkspace/CPLD/docs/j6-bmc-replay-binary921-protocol-v1.zh-CN.md)
-- Create: [docs/adr/0001-j6-bmc-replay-binary921-boundaries.zh-CN.md](/C:/Users/Administrator/Agentworkspace/CPLD/docs/adr/0001-j6-bmc-replay-binary921-boundaries.zh-CN.md)
-
-**Interfaces:**
-- Consumes: existing ASCII contract [docs/host-cpld-uart-spec-v1.zh-CN.md](/C:/Users/Administrator/Agentworkspace/CPLD/docs/host-cpld-uart-spec-v1.zh-CN.md)
-- Produces: binary frame definitions for RTL, Python harness, validator, package docs.
-
-- [ ] Verify docs contain no placeholder markers or unfinished sections.
-- [ ] Verify every pass claim is scoped to a layer.
-- [ ] Verify formal-uart1 is blocked until UART1/2 access and TD/resource pass.
-
-Run:
-
-```powershell
-python -m pytest tests/test_project_structure.py -q
-```
-
-Expected: pass. If project structure tests do not check these docs yet, add a focused test before implementing code changes.
-
-## Task 2: Python binary921 protocol library
-
-**Files:**
-- Modify/Create: [tools/binary921.py](/C:/Users/Administrator/Agentworkspace/CPLD/tools/binary921.py)
-- Modify/Create: [tests/unit/test_binary921_protocol.py](/C:/Users/Administrator/Agentworkspace/CPLD/tests/unit/test_binary921_protocol.py)
-
-**Interfaces:**
-- Produces:
-  - `encode_frame(profile_id, frame_type, seq, timestamp_tick, payload) -> bytes`
-  - `decode_frame(data: bytes) -> Binary921Frame`
-  - `decode_stream(data: bytes) -> tuple[list[Binary921Frame], bytes]`
-  - `build_host_command(profile_id, seq, cmd_id, channel, value) -> bytes`
-
-- [ ] Add tests for encode/decode roundtrip, CRC mismatch, bad length, seq gap detection support, unknown frame type, profile mismatch.
-- [ ] Add tests for `PTC00/PTC25/FAN00/FAN05/value>100` negative command fixtures.
-- [ ] Implement minimal library until tests pass.
-
-Run:
-
-```powershell
-python -m pytest tests/unit/test_binary921_protocol.py -q
-```
-
-Expected: pass.
-
-## Task 3: BMC capture/replay harness
-
-**Files:**
-- Modify/Create: [tools/bmc_replay_uart.py](/C:/Users/Administrator/Agentworkspace/CPLD/tools/bmc_replay_uart.py)
-- Modify/Create: [tests/unit/test_bmc_replay_tool.py](/C:/Users/Administrator/Agentworkspace/CPLD/tests/unit/test_bmc_replay_tool.py)
-
-**Interfaces:**
-- Produces:
-  - `capture-bmc` CLI: raw text -> normalized 48-byte payload JSON.
-  - `replay-bmc` CLI: wait for CPLD poll then reply payload.
-  - `validate-payload` path used by collector.
-
-- [ ] Test loose real-BMC text with echo, spaces, commas, `0xNN`, and exactly 48 payload bytes.
-- [ ] Test `ff ff` missing DIMM handling.
-- [ ] Test reply only after full poll text, not on partial or wrong command.
-- [ ] Test receipt fields `bmc_source`, `live_bmc_link_status`, `replay_mode`, `payload_sha256`.
-
-Run:
-
-```powershell
-python -m pytest tests/unit/test_bmc_replay_tool.py -q
-```
-
-Expected: pass.
-
-## Task 4: RTL binary debug/host core
-
-**Files:**
-- Modify/Create: [src/rtl/binary921_crc16.v](/C:/Users/Administrator/Agentworkspace/CPLD/src/rtl/binary921_crc16.v)
-- Modify/Create: [src/rtl/binary921_frame_tx.v](/C:/Users/Administrator/Agentworkspace/CPLD/src/rtl/binary921_frame_tx.v)
-- Modify/Create: [src/rtl/binary921_host_rx.v](/C:/Users/Administrator/Agentworkspace/CPLD/src/rtl/binary921_host_rx.v)
-- Modify/Create: [src/rtl/binary921_diag_core.v](/C:/Users/Administrator/Agentworkspace/CPLD/src/rtl/binary921_diag_core.v)
-- Modify/Create: [tests/sim/uart_rs232_j6_host_sensor_real_fan_ptc_binary921_top_tb.v](/C:/Users/Administrator/Agentworkspace/CPLD/tests/sim/uart_rs232_j6_host_sensor_real_fan_ptc_binary921_top_tb.v)
-
-**Interfaces:**
-- Consumes: protocol spec frame fields.
-- Produces: DebugPort binary frames and HostPort binary ACK/NACK.
-
-- [ ] Add RTL sim checks for READY, BMC poll-response, SENSOR_CACHE, 12 Host ACKs, PWM state, PID inactive, timeout fallback.
-- [ ] Add bad host frame checks: CRC, length, channel, command.
-- [ ] Implement binary frame TX and host RX with CRC.
-- [ ] Keep debug-photo and formal wrappers separate.
-
-Run:
-
-```powershell
-python tools\pid_harness.py hdl-sim --run --backend icarus --json
-```
-
-Expected: binary921 sim pass. If Icarus is unavailable, report blocked toolchain, not pass.
-
-## Task 5: Pin profile wrappers and constraints
-
-**Files:**
-- Modify/Create: [src/top/uart_rs232_j6_host_sensor_real_fan_ptc_debug_photo_uart_bmc_replay_binary921_top.v](/C:/Users/Administrator/Agentworkspace/CPLD/src/top/uart_rs232_j6_host_sensor_real_fan_ptc_debug_photo_uart_bmc_replay_binary921_top.v)
-- Modify/Create: [src/top/uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart1_bmc_replay_binary921_top.v](/C:/Users/Administrator/Agentworkspace/CPLD/src/top/uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart1_bmc_replay_binary921_top.v)
-- Modify/Create: [constraints/uart_rs232_j6_host_sensor_real_fan_ptc_debug_photo_uart_bmc_replay_binary921.adc](/C:/Users/Administrator/Agentworkspace/CPLD/constraints/uart_rs232_j6_host_sensor_real_fan_ptc_debug_photo_uart_bmc_replay_binary921.adc)
-- Modify/Create: [constraints/uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart1_bmc_replay_binary921.adc](/C:/Users/Administrator/Agentworkspace/CPLD/constraints/uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart1_bmc_replay_binary921.adc)
-- Modify: [tools/pin_inventory.py](/C:/Users/Administrator/Agentworkspace/CPLD/tools/pin_inventory.py)
-- Modify: [tests/unit/test_pin_inventory.py](/C:/Users/Administrator/Agentworkspace/CPLD/tests/unit/test_pin_inventory.py)
-
-**Interfaces:**
-- Produces: generated pin inventory/receipt facts used by package manifests.
-
-- [ ] Assert debug-photo 6 PTC remaps do not collide with UART/CLK/RST/LED/FAN.
-- [ ] Assert formal-uart1 keeps all HEAT/FAN/FG/INSTALL real pins.
-- [ ] Assert formal-uart1 hardware access remains blocked until explicit continuity evidence is present.
-
-Run:
-
-```powershell
-python -m pytest tests/unit/test_pin_inventory.py -q
-```
-
-Expected: pass.
-
-## Task 6: Collector and validator
-
-**Files:**
-- Modify/Create: [tools/remote/collect_j6_binary921.py](/C:/Users/Administrator/Agentworkspace/CPLD/tools/remote/collect_j6_binary921.py)
-- Modify: [tools/uart_receipts.py](/C:/Users/Administrator/Agentworkspace/CPLD/tools/uart_receipts.py)
-- Modify: [tests/unit/test_uart_receipts.py](/C:/Users/Administrator/Agentworkspace/CPLD/tests/unit/test_uart_receipts.py)
-
-**Interfaces:**
-- Consumes: `tools/binary921.py`, BMC replay receipt JSON.
-- Produces: strict binary921 evidence receipt.
-
-- [ ] Collector opens only explicit Host/Debug COM.
-- [ ] Collector never writes DebugPort.
-- [ ] Collector waits for post-SRAM READY epoch.
-- [ ] Validator blocks missing BMC replay, ACK mismatch, seq gap, CRC error, sensor cache missing, PID active, timeout mismatch.
-- [ ] Validator preserves `real_fan_ptc_hardware_status=not_run` without turning it into hardware pass.
-
-Run:
-
-```powershell
-python -m pytest tests/unit/test_uart_receipts.py -q
-python -m pytest tests/unit/test_remote_scripts.py -q
-```
-
-Expected: pass.
-
-## Task 7: TD build and resource gates
-
-**Files:**
-- Modify/Create: `td/*.prj`, `td/syn/*.tcl`, `td/phy/*.tcl` for both binary921 profiles.
-- Receipt output location: agreed package/build receipt directory, not ephemeral `td/build` alone.
-
-**Interfaces:**
-- Produces: TD bitstream, `.qor/.area/timing`, TD receipt, resource status.
-
-- [ ] Run debug-photo TD build.
-- [ ] Save QOR/area/timing/resource receipt.
-- [ ] If formal TD build fails or UART1/2 access is unverified, produce blocked formal package only.
-
-Run:
-
-```powershell
-python tools\pid_harness.py td-build --run --top uart_rs232_j6_host_sensor_real_fan_ptc_debug_photo_uart_bmc_replay_binary921 --json
-python tools\pid_harness.py td-build --run --top uart_rs232_j6_host_sensor_real_fan_ptc_formal_uart1_bmc_replay_binary921 --json
-```
-
-Expected:
-
-- debug-photo must pass before可刷发布。
-- formal may be blocked; blocked must be explicit and cannot ship as pass bitstream.
-
-## Task 8: Package and runbook
-
-**Files:**
-- Modify/Create: [tools/package_j6_binary921.ps1](/C:/Users/Administrator/Agentworkspace/CPLD/tools/package_j6_binary921.ps1)
-- Package output: `C:\Users\Administrator\Downloads\CPLD-deliverables\j6bin-debug-photo-<timestamp>` and `.zip`
-
-**Interfaces:**
-- Produces: short-path `j6bin.bit`, `START-HERE.zh-CN.md`, Python tools, PowerShell wrappers, manifest, SHA256 inventory.
-
-- [ ] Package root contains short `j6bin.bit`.
-- [ ] START-HERE says: start replay, start collector, then manual `PROGRAM_SRAM`.
-- [ ] Safety scan: no `Set-ExecutionPolicy`, no COM enumeration, no DebugPort write, no pip/driver install, no flash.
-- [ ] Run package directory selftest.
-- [ ] Unzip package to temp dir and run selftest again.
-
-Run:
-
-```powershell
-powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\tools\package_j6_binary921.ps1 -Profile debug-photo-bmc-replay-binary921 -Bitstream <debug-photo-bit> -TdReceipt <td-json> -ForceOverwrite
-```
-
-Expected: package directory and zip hash inventory pass.
-
-## Task 9: Board evidence
-
-**Files/Artifacts:**
-- BMC capture payload JSON.
-- BMC replay receipt JSON.
-- binary921 collector receipt JSON.
-- Debug binary stream artifact.
-- Host transcript artifact.
-- manifest and SHA256 inventory.
-
-**Manual sequence:**
-
-1. Start BMC replay.
-2. Start collector.
-3. Manually run `PROGRAM_SRAM`.
-4. Wait for collector result.
-5. Run validator strict.
-
-Expected debug-photo result:
-
-- Host ACK 12/12 pass。
-- BMC replay poll-response pass。
-- SENSOR cache 24 DIMM pass。
-- PWM/PID/timeout pass。
-- `real_fan_ptc_hardware_status=not_run` unless真实负载已接并有独立 gate。
-
-## Task 10: Final gate and reporting
-
-**Files:**
-- Final report in package or receipt output directory.
-
-**Required reporting:**
-
-- package folder clickable path。
-- package zip clickable path。
-- `START-HERE.zh-CN.md` clickable path。
-- ZIP SHA256。
-- Changed files。
-- Commands run。
-- Passed/blocked/not_run layers。
-- Formal-uart1 blocked reason。
-
-Run:
-
-```powershell
-python -m pytest -q
-python tools\pid_harness.py static
-```
-
-Expected: local tests pass; board-only actions listed as not_run until user evidence returns.

+ 0 - 194
docs/j6-bmc-replay-binary921-protocol-v1.zh-CN.md

@@ -1,194 +0,0 @@
-# J6 BMC-Replay Binary921 协议规范 v1
-
-本文定义 `binary921` HostPort 与 DebugPort 的机器帧格式。它是 [docs/j6-bmc-replay-binary921-architecture.zh-CN.md](/C:/Users/Administrator/Agentworkspace/CPLD/docs/j6-bmc-replay-binary921-architecture.zh-CN.md) 的 wire-level 合同。
-
-## 1. 字节序和帧边界
-
-所有多字节整数使用 little-endian。CRC 使用 CRC16-CCITT,初值 `0xffff`,多项式 `0x1021`,覆盖 `version` 到 `payload`,不覆盖 `magic` 和 `crc16` 本身。
-
-| 字段 | 字节数 | 说明 |
-| --- | ---: | --- |
-| `magic` | 2 | 固定 `a5 5a` |
-| `version` | 1 | 当前 `01` |
-| `profile_id` | 1 | `01=debug-photo-bmc-replay-binary921`,`02=formal-uart1-bmc-replay-binary921` |
-| `frame_type` | 1 | 见第 2 节 |
-| `seq` | 4 | little-endian 递增序号 |
-| `timestamp_tick` | 4 | little-endian CPLD tick |
-| `payload_len` | 1 | `0..255` |
-| `payload` | N | 固定结构或 TLV |
-| `crc16` | 2 | little-endian CRC16-CCITT |
-
-decoder 必须支持流式重同步:遇到错误 magic、长度越界、CRC 错、version 不支持、unknown frame type 时丢弃当前候选帧并继续搜索下一处 `a5 5a`。validator 必须把这些错误计入 receipt,不能静默忽略。
-
-## 2. Frame Type
-
-| 值 | 名称 | 方向 | 用途 |
-| ---: | --- | --- | --- |
-| `0x01` | `READY` | CPLD -> Host/Debug | epoch 起点 |
-| `0x02` | `BMC_POLL` | CPLD -> Debug | CPLD 已向 BMC replay UART 发 poll |
-| `0x03` | `BMC_PAYLOAD` | CPLD -> Debug | CPLD 收到并解析 replay payload |
-| `0x04` | `SENSOR_CACHE` | CPLD -> Debug/Host response | 24 DIMM cache 摘要或分片 |
-| `0x05` | `HOST_CMD` | Host -> CPLD 或 Debug echo | Host 控制命令 |
-| `0x06` | `HOST_ACK` | CPLD -> Host/Debug | Host 命令 ACK/NACK |
-| `0x07` | `PWM_STATE` | CPLD -> Debug | PTC/FAN PWM state |
-| `0x08` | `PID_STATE` | CPLD -> Debug | PID requested/active boundary |
-| `0x09` | `TIMEOUT_STATE` | CPLD -> Debug | 5 秒 Host timeout fallback |
-| `0x0a` | `PIN_PROFILE` | CPLD -> Debug | 当前 pin profile 和 remap 摘要 |
-| `0x0b` | `MODULE_SNAPSHOT` | CPLD -> Debug | 内部模块快照 |
-| `0x0c` | `ERROR_COUNTERS` | CPLD -> Debug | drop/error/bad-frame counters |
-
-### 2.1 READY startup identity
-
-The production two-UART wrapper uses an internal configuration POR: reset stays active for 1024 `sys_clk` cycles at 25 MHz, and the production ADC does not expose an external `sys_rst_n` pin. The production runtime profile is `profile_id=3`.
-
-`READY` payload is seven bytes and is emitted at the startup tick after `STARTUP_DELAY_TICKS` (production default `250000`):
-
-| offset | field | meaning |
-| ---: | --- | --- |
-| 0 | `profile_id_payload` | Runtime profile ID, `0x03` for production Prod2U |
-| 1..4 | `BUILD_ID` | 32-bit build identity, little-endian, from the top/core `BUILD_ID` parameter |
-| 5 | `por_reason` | `0x01` = configuration POR |
-| 6 | `announcement_seq` | 0-based startup announcement number |
-
-The startup epoch is frame `seq=1`; the frame timestamp is the startup tick. To tolerate a receiver that begins reading shortly after SRAM configuration, the READY announcement is emitted at most three times with `announcement_seq=0,1,2`. Repeats retain `seq=1`, the same timestamp, profile, build identity, and POR reason; only `announcement_seq` changes, so the host can distinguish announcements without creating new fresh epochs.
-
-## 3. Host Command
-
-`HOST_CMD` payload 固定 4 字节:
-
-| offset | 字段 | 说明 |
-| ---: | --- | --- |
-| 0 | `cmd_id` | 见下表 |
-| 1 | `channel` | 1-based;无通道命令为 0 |
-| 2 | `value` | 百分比或 enable;无值命令为 0 |
-| 3 | `flags` | v1 固定 0 |
-
-| `cmd_id` | 名称 | 合法范围 |
-| ---: | --- | --- |
-| `0x20` | `SET_PTC` | `channel=1..24`,`value=0..100` |
-| `0x21` | `SET_FAN` | `channel=1..4`,`value=0..100` |
-| `0x22` | `GET_SENSOR` | `channel=0`,`value=0` |
-| `0x23` | `GET_MAP` | `channel=0`,`value=0` |
-| `0x24` | `GET_STATUS` | `channel=0`,`value=0` |
-| `0x25` | `SET_PID_REQUESTED` | `channel=0`,`value=0/1` |
-| `0x26` | `DISABLE` | `channel=0`,`value=0` |
-
-负向命令必须 NACK:
-
-- `SET_PTC` 的 `channel=0` 或 `channel>24`。
-- `SET_FAN` 的 `channel=0` 或 `channel>4`。
-- 任意百分比 `value>100`。
-- unknown `cmd_id`。
-- profile mismatch。
-- CRC/length/version/frame type 错误。
-
-## 4. HOST_ACK
-
-`HOST_ACK` payload 固定 8 字节:
-
-| offset | 字段 | 说明 |
-| ---: | --- | --- |
-| 0 | `ok` | `1=accepted`,`0=rejected` |
-| 1 | `cmd_id` | 被响应的命令 |
-| 2 | `status_code` | 见第 5 节 |
-| 3 | `channel` | 被响应通道;无通道为 0 |
-| 4 | `value` | 被应用值;无值为 0 |
-| 5 | `state_flags` | bit0=timeout_active, bit1=pid_requested, bit2=pid_active, bit3=disabled |
-| 6..7 | `applied_state_hash` | little-endian 16-bit 摘要 |
-
-ACK 的帧级 `seq` 必须等于 Host command `seq`。collector 必须逐条匹配 `seq/cmd_id/status_code/profile_id`,不能把错后一条 ACK 归给下一条命令。
-
-## 5. Status Code
-
-| 值 | 名称 | 含义 |
-| ---: | --- | --- |
-| `0x00` | `OK` | 命令被接受 |
-| `0x01` | `BAD_CHANNEL` | 1-based 通道越界 |
-| `0x02` | `BAD_VALUE` | 百分比或 enable 值非法 |
-| `0x03` | `BAD_LENGTH` | payload 长度错误 |
-| `0x04` | `BAD_CRC` | CRC 错误 |
-| `0x05` | `BAD_PROFILE` | profile_id 不匹配 |
-| `0x06` | `BAD_COMMAND` | unknown command |
-| `0x07` | `BUSY` | CPLD 当前不能接收命令 |
-| `0x08` | `INTERNAL_ERROR` | 内部错误,需要 DebugPort 进一步归因 |
-
-## 6. BMC Payload 和 Sensor Cache
-
-`BMC_PAYLOAD` payload:
-
-| offset | 字段 | 说明 |
-| ---: | --- | --- |
-| 0 | `payload_seq_lsb` | replay payload seq 低 8 位 |
-| 1 | `byte_count` | v1 必须为 48 |
-| 2 | `valid_count` | `0..24` |
-| 3 | `missing_count` | `0..24` |
-| 4..7 | `payload_hash32` | payload SHA256 前 32 bit,小端保存 |
-| 8..N | `payload_bytes` | 可选,verbose 固件可包含 48 字节;验收固件可只发 hash 摘要 |
-
-`SENSOR_CACHE` payload 可采用摘要或分片:
-
-- 摘要帧:`mode=0x00`,含 valid/missing/error/hash。
-- 分片帧:`mode=0x01`,含 `snapshot_seq/chunk_index/chunk_count` 和最多 48 字节 DIMM cache。
-
-validator 对 strict pass 至少要求能证明 24 个 DIMM 槽位都被覆盖;可以来自单帧完整 cache,也可以来自完整分片重组。
-
-## 7. PWM/PID/Timeout
-
-`PWM_STATE` 必须能证明:
-
-- `PTC01=10%`。
-- `PTC24=20%`。
-- `FAN01=40%`。
-- `FAN04=30%`。
-- `DISABLE` 或 timeout 后 PTC 全 0。
-- timeout fallback 后 FAN 默认为 30%。
-
-`PID_STATE` 必须证明:
-
-- `SET_PID_REQUESTED(enabled=1)` 后 `pid_requested=1`。
-- 本阶段 `pid_active=0`,不接管 PWM。
-- `SET_PID_REQUESTED(enabled=0)` 后 requested 清零。
-
-`TIMEOUT_STATE` 必须证明:
-
-- Host 命令停止超过配置 timeout 后 `timeout_active=1`。
-- fallback state 与 PWM state 一致。
-
-## 8. PIN_PROFILE
-
-`PIN_PROFILE` 必须至少编码:
-
-- `profile_id`。
-- `hardware_access_status`。
-- `bmc_source`。
-- debug-photo 的 6 路 PTC substitute 标记。
-- formal-uart1 的 `blocked_waiting_for_uart1_uart2_access` 标记,直到可接性复核通过。
-
-PC decoder 负责把该帧展开成人读 pin map;CPLD 不拼接长文本。
-
-## 9. MODULE_SNAPSHOT 分片
-
-`MODULE_SNAPSHOT` payload 头固定:
-
-| offset | 字段 | 说明 |
-| ---: | --- | --- |
-| 0 | `snapshot_group` | 例如 UART/BMC/PWM/PID/TIMEOUT/CACHE |
-| 1 | `snapshot_seq` | 8-bit,可回绕 |
-| 2 | `chunk_index` | 从 0 开始 |
-| 3 | `chunk_count` | 总分片数 |
-| 4..N | `chunk_payload` | 固定结构字段 |
-
-同一个 `snapshot_seq` 的 chunk 必须全部到齐且 CRC 正确。缺 chunk、重复 chunk、chunk_count 改变、跨 profile 混流都必须 blocked。
-
-## 10. Validator 规则
-
-strict pass 必须同时满足:
-
-1. 所有帧 CRC 正确。
-2. READY epoch 之后的正式 Host sequence 没有 seq gap。
-3. 12 条 Host 命令的 ACK 精确匹配。
-4. BMC replay receipt 为 `status=pass` 且 payload hash 匹配。
-5. SENSOR cache 覆盖 24 DIMM。
-6. PWM/PID/timeout 证据闭环。
-7. safety flags 未触发 flash、driver install、unknown COM、DebugPort write。
-8. 真实 PTC/FAN 未接时只写 `not_run`,不得写 pass。

+ 0 - 99
docs/j6-host-sensor-real-fan-ptc-debug921-runbook.zh-CN.md

@@ -1,99 +0,0 @@
-# J6 Host Sensor Real FAN/PTC Debug921
-
-本说明对应 `j6-host-sensor-real-fan-ptc-temp-uart-ptc-remap-debug921-v2-epochfix-psarrayfix` 远端包。包内路径、文件名、脚本名和命令均为英文;说明正文为简体中文。
-
-## 当前版本
-
-- `temp-uart-ptc-remap` 是当前唯一交付版本:三路调试串口保持现场现有接法,6 路与串口冲突的 PTC 输出改到复核空闲 GPIO。v2-epochfix-psarrayfix 增加 HostPort READY、DebugPort J6READY 和 `startup-preflight.json`,用于隔离脚本启动前板上旧程序与手动刷 SRAM 后的新程序,正式 12 条命令仍必须 12/12 ACK 严格匹配,并修复 PowerShell 单元素数组包裹导致的 pre-SRAM ACK 记录失败。
-- 历史真实引脚直连方案若未做 PTC/UART 冲突处理,必须 fail closed 并报告 `blocked_pin_conflict_with_locked_debug_uart`;本 v2 包不交付该方案。
-
-本版本只做 SRAM 诊断,不做非易失存储写入,不安装驱动,不枚举未知 COM,不写 DebugPort,不声明真实热性能、真实 PTC/FAN 负载合格或 PID 闭环通过。
-
-## temp-uart-ptc-remap 接线
-
-- BMC UART:CPLD `bmc_uart_tx=T4`,`bmc_uart_rx=R5`,BMC 温度来源仍是 J6 UART raw 命令。
-- DebugPort:串口板 TXD 接 P10,串口板 RXD 接 R10,Windows 端口默认 `COM7`,波特率 `921600 8N1`。
-- HostPort:串口板 RXD 接 P7,串口板 TXD 接 P8,Windows 端口默认 `COM8`,波特率 `115200 8N1`。
-- PTC 临时替代:
-  - `PTC03`: 原 `T4`,临时 `P5`
-  - `PTC04`: 原 `R5`,临时 `T8`
-  - `PTC17`: 原 `P8`,临时 `M14`
-  - `PTC18`: 原 `P7`,临时 `M15`
-  - `PTC21`: 原 `P10`,临时 `P15`
-  - `PTC22`: 原 `R10`,临时 `N14`
-
-## 执行顺序
-
-1. 先在包根目录打开 PowerShell,执行包内 `commands/collect-template.ps1`,或复制 `START-HERE.zh-CN.md` 首页中的 collector 命令。
-2. collector 打开 COM8/COM7 并开始等待后,确认 board power 已经接好,在 TD/ChipWatcher/BitWriter 中选择 JTAG speed 200k,只执行 `PROGRAM_SRAM`,选择包内短路径 bitstream。
-3. 等待 collector 自动完成 180 秒采集,把生成的 evidence 目录回传分析。
-
-固定顺序是 collector first, then PROGRAM_SRAM。
-
-不要求重新上电;之前 JTAG 无法识别的优先原因按现场结论修正为板子外部电源未接。若 BitWriter/AL-Link 看不到器件,第一检查 `board_power_present_before_program=true` 是否成立,其次检查 JTAG 线束、AL-Link 和 speed 设置。
-
-不要执行任何非易失存储写入、擦除或 固化存储相关动作。
-
-## HostPort 命令
-
-HostPort 使用 1-based 两位编号,只接受 `PTC01..PTC24` 和 `FAN01..FAN04`。旧的 `PTC00`、`FAN00`、`FAN05`、`FAN06` 必须拒绝。
-
-collector 会先等待新 SRAM epoch:HostPort `READY profile=temp-uart-ptc-remap seq=00000000` 和 DebugPort `J6READY ...` 都出现后才发送正式命令。READY/J6READY 之前收到的旧 ACK、旧日志会写入 `startup-preflight.json` 的 `pre_sram_noise`,不计入正式命令序列。若 45 秒内没有锁定 epoch,collector 不发送正式 12 条命令,直接输出 `blocked_waiting_for_ready_epoch`。
-
-正式序列固定为:
-
-```text
-SET PTC 01 10
-SET PTC 24 20
-SET FAN 01 40
-SET FAN 04 30
-SET PID ENABLE
-GET STATUS
-GET MAP
-GET SENSOR
-GET SENSOR
-GET SENSOR
-SET PID DISABLE
-DISABLE
-```
-
-预期 ACK:
-
-```text
-SET PTC 01 10      -> PTCCH
-SET PTC 24 20      -> PTCCH
-SET FAN 01 40      -> FANCH
-SET FAN 04 30      -> FANCH
-SET PID ENABLE     -> PID_EN
-GET STATUS         -> STATUS
-GET MAP            -> MAP___
-GET SENSOR         -> SENSOR
-SET PID DISABLE    -> PID_DI
-DISABLE            -> DISABL
-```
-
-## 预期 evidence
-
-- `startup-preflight.json`:READY/J6READY epoch 锁定、pre-SRAM noise 和 stale ACK 隔离证据。
-- `host-command-transcript.json`:正式 12 条 HostPort 命令的实际 ACK。
-- `host-port-escaped.txt`:HostPort 人读日志,可见 `READY`、`OK`、`SENS`、`DIMM`、`STAT`、`PWM`、`PID`。
-- `debug-uart-escaped.txt`:DebugPort 人读日志,可见 `J6READY`、`J6CMD`、`J6RAW`、`J6EVT`、`J6PWM`、`J6MOD`、`J6STAT`、`J6MAP`、`J6TEMP`。
-- `bmc-raw-replay.bin`:从 `J6RAW` 重建的 BMC 原始字节。
-- `host-sensor-report.json`:结构化后的 `SENS + 24 DIMM` 温度报告。
-- `real-bmc-j6-host-sensor-real-fan-ptc-debug921-v1-receipt-draft.json`:本轮诊断 receipt 草稿。
-
-## Pass 边界
-
-本诊断 pass 只说明 SRAM-only bitstream、HostPort 命令链路、BMC raw 采样、温度解析、DebugPort 证据帧、pin profile 和包内 hash 证据成立。
-
-它不说明:
-
-- 非易失存储写入通过
-- final gate 通过
-- 真实热性能通过
-- 真实 PTC/FAN 负载合格
-- PID 闭环合格
-
-没有真实受控温控硬件时,`real_fan_ptc_hardware_status` 只能是 `not_run` 或 `blocked_waiting_for_real_fan_ptc_hardware`。
-
-

+ 0 - 398
docs/j6-temp-pwm-scope-manual-debug.zh-CN.md

@@ -1,398 +0,0 @@
-# J6 temp-uart-ptc-remap PWM 示波器临时手动调试说明
-
-本文档用于临时验证当前 `temp-uart-ptc-remap` SRAM 诊断版本的 FPGA 输出 PWM 波形。目标是用示波器确认 CPLD/FPGA 引脚上确实随 HostPort 命令输出不同占空比;它不等同于验证真实 PTC 加热、真实风扇转速、真实热性能或 PID 闭环。
-
-## 1. 当前版本和边界
-
-使用短路径包:
-
-```text
-C:\Users\Admin\Downloads\j6tmp-v2-tailfix-20260704-134319
-```
-
-BitWriter/TD/ChipWatcher 刷 SRAM 时选择包根目录文件:
-
-```text
-j6tmp.bit
-```
-
-当前三路串口保持不变:
-
-| 用途 | Windows 端 | CPLD/FPGA ball | 参数 |
-|---|---:|---|---|
-| BMC J6 UART | 不通过 Windows 直连控制 | TX=T4, RX=R5 | BMC raw 温度 |
-| DebugPort | COM7 | RX=P10, TX=R10 | 921600 8N1,只读日志 |
-| HostPort | COM8 | TX=P7, RX=P8 | 115200 8N1,手动发命令 |
-
-因为这些串口占用了真实 HEAT/PTC 的 6 个 ball,temp 版本做了 PTC 临时改脚:
-
-| Host 命令通道 | 正式原理图 HEAT ball | temp 实际输出 ball | 原因 |
-|---|---|---|---|
-| PTC03 | T4 | P5 | T4 当前给 BMC UART TX |
-| PTC04 | R5 | T8 | R5 当前给 BMC UART RX |
-| PTC17 | P8 | M14 | P8 当前给 HostPort RX |
-| PTC18 | P7 | M15 | P7 当前给 HostPort TX |
-| PTC21 | P10 | P15 | P10 当前给 DebugPort RX |
-| PTC22 | R10 | N14 | R10 当前给 DebugPort TX |
-
-FAN_PWM1..4 没有被当前三路串口占用,仍按新原理图真实引脚输出。
-
-## 2. 示波器接线原则
-
-1. 示波器地夹接测试板数字地 GND。不要把地夹夹到任意信号脚。
-2. 探头建议用 10x 档,输入耦合 DC。
-3. FPGA 输出电平是 LVCMOS33,示波器垂直档先用 1 V/div 或 500 mV/div。
-4. PTC PWM 是 FPGA 直接输出逻辑波形,高电平约 3.3 V,低电平约 0 V。
-5. 当前顶层里的 FAN PWM 也是逻辑输出 `fan_pwm_out[n]`,预计高电平约 3.3 V,低电平约 0 V;若后续接真实 4-wire 风扇驱动级,则真实接口可能是开漏/上拉形态,需要按风扇板电路再确认。
-6. 只测波形时,可以先不接 PTC 加热块和风扇负载,只测 FPGA ball 或外接测试点上的逻辑波形。
-
-## 3. PWM 频率和预期波形
-
-当前 bitstream 参数:
-
-| 类型 | 周期参数 | 预期频率 | 适合示波器时基 |
-|---|---:|---:|---|
-| PTC PWM | `PTC_PWM_PERIOD_TICKS=2500000` | 约 10 Hz | 20 ms/div 到 50 ms/div |
-| FAN PWM | `FAN_PWM_PERIOD_TICKS=1000` | 约 25 kHz | 10 us/div 到 20 us/div |
-
-占空比规则:
-
-| 命令 | 预期输出 |
-|---|---|
-| `SET PTC 01 10` | PTC01 约 10% 高电平 |
-| `SET PTC 01 50` | PTC01 约 50% 高电平 |
-| `SET PTC 01 100` | PTC01 常高 |
-| `SET PTC 01 0` | PTC01 常低 |
-| `SET FAN 01 40` | FAN01 约 40% 高电平 |
-| `SET FAN 01 30` | FAN01 约 30% 高电平 |
-| `SET FAN 01 100` | FAN01 常高 |
-| `SET FAN 01 0` | FAN01 常低 |
-
-注意:HostPort 超过约 5 秒没有收到有效控制命令后,timeout fallback 会生效:PTC 全部回 0%,FAN 全部回 30%。所以手动测试时要么连续发命令,要么把“5 秒后 PTC 变低、FAN 回 30%”也当成一个测试点。
-
-## 4. 推荐先测的引脚
-
-先测不冲突、容易判断的 4 路:
-
-| 测试目标 | Host 命令 | FPGA ball | 说明 |
-|---|---|---|---|
-| PTC01 | `SET PTC 01 <pct>` | F16 | 非冲突真实 HEAT1 |
-| PTC24 | `SET PTC 24 <pct>` | T12 | 非冲突真实 HEAT24 |
-| FAN01 | `SET FAN 01 <pct>` | C4 | 真实 FAN_PWM1 |
-| FAN04 | `SET FAN 04 <pct>` | A14 | 真实 FAN_PWM4 |
-
-再测 6 路临时改脚,确认冲突处理是否按 temp profile 生效:
-
-| 测试目标 | Host 命令 | temp 实际测量 ball |
-|---|---|---|
-| PTC03 | `SET PTC 03 <pct>` | P5 |
-| PTC04 | `SET PTC 04 <pct>` | T8 |
-| PTC17 | `SET PTC 17 <pct>` | M14 |
-| PTC18 | `SET PTC 18 <pct>` | M15 |
-| PTC21 | `SET PTC 21 <pct>` | P15 |
-| PTC22 | `SET PTC 22 <pct>` | N14 |
-
-完整 PTC/FAN PWM ball 表:
-
-| 通道 | 实际输出 ball |
-|---|---|
-| PTC01 | F16 |
-| PTC02 | G16 |
-| PTC03 | P5 |
-| PTC04 | T8 |
-| PTC05 | T6 |
-| PTC06 | R7 |
-| PTC07 | M1 |
-| PTC08 | N1 |
-| PTC09 | P1 |
-| PTC10 | R1 |
-| PTC11 | T2 |
-| PTC12 | R3 |
-| PTC13 | P16 |
-| PTC14 | R16 |
-| PTC15 | M16 |
-| PTC16 | N16 |
-| PTC17 | M14 |
-| PTC18 | M15 |
-| PTC19 | T9 |
-| PTC20 | P9 |
-| PTC21 | P15 |
-| PTC22 | N14 |
-| PTC23 | T13 |
-| PTC24 | T12 |
-| FAN01 | C4 |
-| FAN02 | B5 |
-| FAN03 | B1 |
-| FAN04 | A14 |
-
-## 5. 上电和刷 SRAM 步骤
-
-1. 确认 COM7 DebugPort、COM8 HostPort、BMC J6 UART 仍按当前 temp 接法连接。
-2. 确认板子外部电源已经接好,JTAG/AL-Link 能看到器件。这里不要求重新上电;如果之前设备无法识别,优先检查是否漏接板子电源。
-3. 打开 BitWriter/TD/ChipWatcher。
-4. 选择 device `EF2L45`。
-5. 设置 JTAG speed 200k,然后选择短路径 bitstream:
-
-```text
-C:\Users\Admin\Downloads\j6tmp-v2-tailfix-20260704-134319\j6tmp.bit
-```
-
-6. 只执行 `PROGRAM_SRAM`。
-7. 如果 BitWriter 报 `Cannot open file`,先确认没有误选旧长包或 `bitstreams\...长文件名.bit`;如果 JTAG device 不出现,先检查 board power,再检查 JTAG 线束、AL-Link 和 200k speed。
-
-## 6. 手动打开 HostPort COM8
-
-下面命令不跑 collector,只打开 COM8 手动发命令。建议在 Windows PowerShell 中执行。
-
-进入包根目录:
-
-```powershell
-cd C:\Users\Admin\Downloads\j6tmp-v2-tailfix-20260704-134319
-```
-
-打开 COM8:
-
-```powershell
-$port = New-Object System.IO.Ports.SerialPort 'COM8',115200,'None',8,'One'
-$port.DtrEnable = $false
-$port.RtsEnable = $false
-$port.NewLine = "`r`n"
-$port.ReadTimeout = 1000
-$port.WriteTimeout = 1000
-$port.Open()
-```
-
-刷完 SRAM 后先读几行,正常应看到 READY 或后续 OK/状态行:
-
-```powershell
-1..5 | ForEach-Object {
-  try { $port.ReadLine() } catch { }
-}
-```
-
-如果没有读到 READY,不一定代表失败;可能 READY 已经过去了。继续发送 `GET STATUS` 看是否有 ACK。
-
-发送命令的通用格式:
-
-```powershell
-$port.WriteLine('GET STATUS')
-$port.ReadLine()
-```
-
-预期返回类似:
-
-```text
-OK seq=00000001 cmd=STATUS
-```
-
-seq 数字不必固定,只要每次递增且 `cmd=` 对得上。
-
-## 7. 手动 PWM 测试步骤
-
-### 7.1 测 PTC01 10%、50%、0%
-
-示波器探头接 PTC01 ball F16,地夹接 GND。
-
-发送 10%:
-
-```powershell
-$port.WriteLine('SET PTC 01 10')
-$port.ReadLine()
-```
-
-预期:
-
-```text
-OK ... cmd=PTCCH
-```
-
-示波器预期:约 10 Hz,约 10% 高电平。
-
-发送 50%:
-
-```powershell
-$port.WriteLine('SET PTC 01 50')
-$port.ReadLine()
-```
-
-示波器预期:约 10 Hz,约 50% 高电平。
-
-发送 0%:
-
-```powershell
-$port.WriteLine('SET PTC 01 0')
-$port.ReadLine()
-```
-
-示波器预期:常低。
-
-### 7.2 测 PTC24 20%、80%
-
-示波器探头接 PTC24 ball T12。
-
-```powershell
-$port.WriteLine('SET PTC 24 20')
-$port.ReadLine()
-```
-
-预期:T12 约 10 Hz、20% 高电平。
-
-```powershell
-$port.WriteLine('SET PTC 24 80')
-$port.ReadLine()
-```
-
-预期:T12 约 10 Hz、80% 高电平。
-
-### 7.3 测临时改脚 PTC03
-
-示波器探头接 P5,不要接原 HEAT3 的 T4。T4 当前是 BMC UART TX。
-
-```powershell
-$port.WriteLine('SET PTC 03 30')
-$port.ReadLine()
-```
-
-预期:P5 约 10 Hz、30% 高电平。
-
-再清零:
-
-```powershell
-$port.WriteLine('SET PTC 03 0')
-$port.ReadLine()
-```
-
-预期:P5 常低。
-
-### 7.4 测 FAN01 40%、70%
-
-示波器探头接 FAN01 ball C4。
-
-```powershell
-$port.WriteLine('SET FAN 01 40')
-$port.ReadLine()
-```
-
-预期:C4 约 25 kHz、40% 高电平。
-
-```powershell
-$port.WriteLine('SET FAN 01 70')
-$port.ReadLine()
-```
-
-预期:C4 约 25 kHz、70% 高电平。
-
-### 7.5 测 FAN04 30%、100%、0%
-
-示波器探头接 FAN04 ball A14。
-
-```powershell
-$port.WriteLine('SET FAN 04 30')
-$port.ReadLine()
-```
-
-预期:A14 约 25 kHz、30% 高电平。
-
-```powershell
-$port.WriteLine('SET FAN 04 100')
-$port.ReadLine()
-```
-
-预期:A14 常高。
-
-```powershell
-$port.WriteLine('SET FAN 04 0')
-$port.ReadLine()
-```
-
-预期:A14 常低,约 5 秒后如果没有新命令,fallback 会把 FAN 回到 30%。
-
-## 8. 查询内部状态
-
-查询状态:
-
-```powershell
-$port.WriteLine('GET STATUS')
-$port.ReadLine()
-```
-
-查询映射:
-
-```powershell
-$port.WriteLine('GET MAP')
-1..80 | ForEach-Object {
-  try { $port.ReadLine() } catch { }
-}
-```
-
-查询 BMC 温度缓存:
-
-```powershell
-$port.WriteLine('GET SENSOR')
-1..30 | ForEach-Object {
-  try { $port.ReadLine() } catch { }
-}
-```
-
-如果只是测 PWM,`GET SENSOR` 不是必需的。
-
-## 9. 测 timeout fallback
-
-1. 先设置 PTC01 50%、FAN01 80%:
-
-```powershell
-$port.WriteLine('SET PTC 01 50')
-$port.ReadLine()
-$port.WriteLine('SET FAN 01 80')
-$port.ReadLine()
-```
-
-2. 示波器分别确认 F16 和 C4 波形。
-3. 停止发送任何 HostPort 命令,等待 6 秒以上。
-4. 预期:
-   - F16 变为常低,PTC fallback 到 0%。
-   - C4 变为约 25 kHz、30% 高电平,FAN fallback 到 30%。
-
-## 10. 负向命令检查
-
-这些命令应该被拒绝,不应该改变有效 PWM 通道:
-
-```powershell
-$port.WriteLine('SET PTC 00 50')
-$port.ReadLine()
-$port.WriteLine('SET PTC 25 50')
-$port.ReadLine()
-$port.WriteLine('SET FAN 00 50')
-$port.ReadLine()
-$port.WriteLine('SET FAN 05 50')
-$port.ReadLine()
-```
-
-预期返回 `ERR` 或 `BAD_CH` 类错误。如果这些命令被接受,就不符合当前 1-based 两位通道协议。
-
-## 11. 关闭串口
-
-测试结束后执行:
-
-```powershell
-$port.WriteLine('DISABLE')
-$port.ReadLine()
-$port.Close()
-$port.Dispose()
-```
-
-`DISABLE` 后预期 PTC 输出关闭,FAN 回到安全默认/禁用逻辑对应状态。若只想继续看 timeout 行为,可以先不发 `DISABLE`,直接停止命令等待。
-
-## 12. 常见现象判断
-
-| 现象 | 更可能原因 | 处理 |
-|---|---|---|
-| BitWriter `Cannot open file` | 选了旧长路径 bitstream 或深目录长文件名 | 选包根目录 `j6tmp.bit` |
-| JTAG device 不出现 | 板子外部电源未接、JTAG 线束不稳、speed 太高 | 先确认 board power,再用 JTAG speed 200k |
-| COM8 打不开 | 串口工具/collector 占用了 COM8 | 关闭其它串口程序后重试 |
-| 命令无 ACK | HostPort TX/RX 接反、未刷入当前 SRAM、COM 号不对 | 确认 COM8、P7/P8 接线和 `READY` |
-| PTC03 在 T4 没波形 | temp 版本改脚,T4 是 BMC UART | 改测 P5 |
-| PTC17 在 P8 没波形 | temp 版本改脚,P8 是 HostPort RX | 改测 M14 |
-| PTC21 在 P10 没波形 | temp 版本改脚,P10 是 DebugPort RX | 改测 P15 |
-| PTC 波形过一会儿消失 | 5 秒 HostPort timeout fallback | 连续发命令或按 timeout 测试理解 |
-| FAN 过一会儿回 30% | 5 秒 HostPort timeout fallback | 这是预期行为 |

+ 0 - 96
docs/offline-fidelity-gate-v1.zh-CN.md

@@ -1,96 +0,0 @@
-# offline-fidelity-gate-v1
-
-`offline-fidelity-gate-v1` 是无真实物理设备条件下的最严离线验证 gate。它不替代 `final-gate-v2`,也不降低 UART strict 或板级 receipt 的要求。它只证明离线逻辑、协议、RTL、formal、debug 可观测性、安全策略、虚拟热模型、故障注入、mutation detector、TD 离线工具证据全部通过。
-
-Pass 语义固定为:offline-fidelity-gate-v1 proves offline logic/protocol/safety/debug/virtual-thermal evidence only and does not certify real hardware or thermal performance.
-
-## 权限边界
-
-允许:
-
-- 自动准备用户态离线工具链,例如 OSS CAD Suite、cocotb venv、`iverilog`、`vvp`、`verilator`、`yosys`、`sby`。
-- 自动准备扩展分析工具,例如 pytest/hypothesis、pyserial loopback URL、波形/trace 分析辅助工具;所有工具只能在用户态目录、venv 或临时目录内运行。
-- 运行用户态模拟驱动,例如 cocotb driver、Python driver facade、socket/pipe/mock API、BMC text driver、host register plane 和 debug UART decoder。
-- 运行 Python model、协议 fuzz、Verilog RTL simulation、cocotb virtual lab、formal、detector selftest、mutation、thermal digital twin、TD offline elaboration/build。
-- 生成 JSON receipt、debug bundle、coverage matrix 和可复现 seed/trace hash。
-
-禁止:
-
-- 打开 COM 口、枚举后自动连接未知串口、切换 DTR/RTS。
-- flash、`PROGRAM_FLASH`、`ERASE_FLASH`、`PROGRAM_SPIBIN`、`DIRECT_FLASH_WRITE`。
-- 主机 OS kernel/USB/JTAG/COM 驱动安装或重装;即使可卸载,也不能进入 `offline-fidelity-gate-v1` pass 证据。
-- 真实 PTC/fan/BMC 未受控动作。
-- 把 `hardware`、`board`、`uart_strict`、`chipwatcher`、`thermal_performance_pass` 写成离线 pass layer。
-
-## Required Layers
-
-receipt 的 `layers` 必须精确包含以下 required layer,且每一层 `status` 必须为 `pass`:
-
-- `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`
-
-任何 `blocked_*`、`partial`、`skipped`、`fail_*`、缺证据或 dry-run 都不能提升为顶层 pass。工具缺失且用户态 bootstrap 失败时,顶层必须 fail 或 blocked,不能通过。
-
-## 运行入口
-
-```powershell
-python tools\pid_harness.py offline-fidelity-gate-v1 --auto-bootstrap --hdl-backend all --formal --td-build --long-run final --json --report-file <receipt.json>
-```
-
-`--auto-bootstrap` 只允许用户态工具准备。它可以下载或解压离线仿真工具,也可以创建本地 Python venv;它不能安装系统驱动、不能打开串口、不能下载到硬件、不能写 flash。
-
-工具链缓存默认放在当前用户的 `CodexToolchains\CPLD` 目录下。每次自动准备都必须记录 manifest、下载 hash、工具版本、路径和 cleanup policy。`toolchain-clean` 默认 dry-run;只有带 `.cpld_toolchain_owner.json` owner marker 且 manifest 声明的用户态工具路径才允许实际删除。
-
-## 虚拟实验室
-
-Verilog testbench 保留确定性 smoke、协议边界、UART bit-level 和 RTL 基础安全场景。cocotb virtual lab 作为主虚拟实验室,覆盖:
-
-- UART 8N1 bit driver、start jitter、stop error、break、glitch、RX overflow、TX backpressure、debug UART overflow。
-- BMC loose text byte stream、echo/no-echo、裸 hex、`0xNN`、多行、乱码、短帧、长帧、bad fraction、全 missing、部分 missing。
-- host register plane、source switch、manual mode、host disable、PID history clear/freeze。
-- fault injection、scoreboard、debug UART frame decode 和 register/probe/trace 一致性。
-
-`virtual_driver_lab` 是 required layer。它只证明用户态模拟驱动合同通过,覆盖 pyserial `loop://` 或等价 loopback URL、socket/pipe transport、BMC text driver、host register plane、debug UART decoder,以及 timeout、disconnect、partial read/write、permission denied、buffer overflow、TX/RX backpressure 等错误路径。可选 Windows Sandbox/VM 证据只能作为隔离环境补强;主机 OS 不安装驱动,该 layer 也不声明真实驱动认证。
-
-系统级 scoreboard 分两条线:
-
-- `system_contract_top` 覆盖 host register、BMC byte stream、actuator、安全、debug register、BRAM trace、debug probe/status。
-- `uart_rs232_j6_host_sensor_real_fan_ptc_debug921_top` 覆盖真实 8N1 BMC RX/TX、COM8 HostPort、COM7 DebugPort、BMC raw 温度解析、真实 FAN/PTC 信号接口和端到端 UART 行为。
-
-## Debug 可信度
-
-离线 gate 必须闭环 debug 证据:
-
-- 解码 `debug_uart_tx`,校验 SOF、`frame_seq` 单调、payload、checksum、overflow。
-- 读 `0x80..0x93` debug register window,校验 event_count、frozen、overflow、last_fault、last_channel、trace read data。
-- 校验 BRAM trace wrap/freeze/clear 与 register/debug UART/probe bus 一致。
-
-## 热数字孪生
-
-`thermal_digital_twin` 同时运行保守、乐观、极端、随机扰动、传感器漂移、延迟、串扰、风扇退化、PTC 热惯性模型。所有模型都必须满足 fail-closed 合同才 pass。模型参数未校准时只能作为验证假设记录,不能声明真实 thermal performance。
-
-CI 使用 60s 固定 seed 矩阵;nightly 使用 8h 请求语义和固定/随机探索;final 使用 24h 请求语义和可复现 seed。所有 seed、模型参数、场景、trace hash 必须写入 receipt。
-
-## Coverage Matrix
-
-`coverage_matrix` 是 required contract coverage matrix,覆盖协议、UART bit、PID/control、safety、debug、virtual_driver_lab、thermal、fault injection、mutation、TD/toolchain。代码覆盖和功能覆盖只能作为增强指标,不能替代合同覆盖矩阵。
-
-## TD 离线工具证据
-
-TD layer 只接受离线 elaboration/build/timing/resource 证据。它不做下载、不做 flash、不声明真实 pin map,也不声明真实电气或热性能。
-
-## 与 final-gate-v2 的关系
-
-`offline-fidelity-gate-v1` 是无实物最高保真 gate;`final-gate-v2` 仍然是当前包含 UART strict receipt 的最终 gate。需要新增真实板级 PID、flash、驱动、外部仪器或生产硬件动作时,必须新增独立 gate、receipt schema、rollback/安全边界和中文 runbook。

+ 0 - 15
docs/offline-verification-report.zh-CN.md

@@ -1,15 +0,0 @@
-# 离线验证报告
-
-当前离线验证范围:
-
-- Python model。
-- BMC UART parser。
-- contract replay。
-- RTL/HDL sim。
-- formal。
-- detector selftest。
-- TD `uart_rs232_j6_host_sensor_real_fan_ptc_debug921_primary` build/blocker evidence。
-- UART receipt strict validation。
-- debug UART/register dump bundle。
-
-当前不声明真实热闭环、真实 PTC/fan/BMC、电气隔离或 thermal performance pass。

+ 0 - 23
docs/pid-safety-contract-v2.zh-CN.md

@@ -1,23 +0,0 @@
-# PID Safety Contract V2
-
-## Fail Closed
-
-- host disable:PTC off,相关 history clear。
-- invalid channel:不驱动 actuator。
-- missing DIMM:对应 PTC off,并进入 missing_mask。
-- BMC stale 10s:全部 PTC off,fan fallback。
-- overtemp 90C:全部 PTC off,fan fallback,fault latch。
-- interlock:全部 PTC off。
-
-## Evidence
-
-安全状态必须进入:
-
-- debug UART event stream。
-- register dump。
-- debug bundle。
-- final-gate-v2 layer evidence。
-
-## 禁止
-
-任何 flash、驱动安装/重装、真实 PTC/fan/BMC 未受控动作都必须 fail closed。

+ 0 - 231
docs/prod2u-p4-normal-v3-actuator-temp-runbook.zh-CN.md

@@ -1,231 +0,0 @@
-# Prod2U Profile 4 Normal v3 执行器与温度操作说明
-
-本文只适用于 `prod2u-p4-normal-actuator-temp-binary921-v3`。串口固定为 `COM5 921600 8N1`、真 RS232,DTR/RTS 关闭。JTAG 使用 AL-Link,只允许 `PROGRAM_SRAM @ 200 kHz`。禁止 Flash、驱动安装、自动重试和 PTC 加热。
-
-## 1. 本版固定硬件语义
-
-- P5 高电平:电磁铁吸合,关闭进风口。
-- P5 低电平:电磁铁断电,打开进风口,也是安全状态。
-- LS1=X,LS2=Y。
-- LS1/LS2 在关门端约为 3.3V,开门端约为 0V。
-- Z 未接电。协议字段保留,硬件 gate 固定发送 Z=0,不执行 Z JOG、MARK_CLOSED 或机械验收。
-- PTC 验收期间固定 0%,FAN 安全值固定 30%。
-- CT7428 总线未确认时不发送温度请求,不阻塞 X/Y、电磁铁和串口核心验收。
-
-安全状态固定为:PTC 0%、FAN1..4 30%、P5 低、STEP 全低、EN_N 高。复位、DISABLE 或 5 秒 watchdog 都进入该状态。
-
-## 2. 文件夹交付和身份
-
-交付只使用一个文件夹,不生成压缩包或全文件清单。必要文件为:
-
-```text
-firmware/prod2u_p4_normal_v3.bit
-build-info.json
-config/host-contract.json
-run.ps1
-bootstrap.ps1
-selftest.ps1
-requirements.txt
-tools/*.py
-wheelhouse/pyserial-3.5*.whl
-README.zh-CN.md
-```
-
-`build-info.json` 记录:
-
-- BUILD_ID:构建开始时的 UTC Unix 秒,以 8 位大写十六进制表示并嵌入 CPLD。
-- UTC 生成时间。
-- 唯一文件哈希字段 `bitstream_sha256`。
-- EF2L45BG256B、COM5 921600 8N1、AL-Link 200 kHz 和 PROGRAM_SRAM。
-
-UART CRC16 和 ACK 中的 `state_hash16` 是通信协议校验,不属于交付文件哈希,继续保留。
-
-## 3. 离线安装和自检
-
-在包外创建独立 Python 环境:
-
-```powershell
-$Pkg = "C:\path\to\prod2u-p4-normal-<BUILD_ID>"
-$Runtime = "C:\Users\Administrator\CodexTemp\p4-normal-v3-runtime\.venv"
-& (Join-Path $Pkg "bootstrap.ps1") -VenvDir $Runtime
-$Python = Join-Path $Runtime "Scripts\python.exe"
-```
-
-执行文件夹自检:
-
-```powershell
-& (Join-Path $Pkg "selftest.ps1") -Python $Python
-```
-
-`selftest.ps1` 只检查必要文件、Python 模块导入以及 `.bit` 是否匹配 `bitstream_sha256`。README 等说明文件变化不会导致自检失败。该命令不打开 COM5,也不访问 JTAG。
-
-只读枚举 COM5 和 AL-Link:
-
-```powershell
-& (Join-Path $Pkg "run.ps1") preflight -Python $Python
-```
-
-preflight 只枚举设备,不打开未知串口,不切换 DTR/RTS,不执行编程。
-
-## 4. 串口帧和 CRC
-
-标准帧为:
-
-```text
-A5 5A | 02 | 04 | type | seq_u32_le | timestamp_u32_le | length | payload | CRC16_le
-```
-
-- 命令的 seq 和 timestamp 固定为 0。
-- CRC 使用 CRC-16/CCITT-FALSE:poly=0x1021、init=0xFFFF、非反射、xorout=0。
-- CRC 从偏移 2 的 version 开始,计算到 payload 最后一个字节,不包含 `A5 5A` 和 CRC 自身。
-- CRC 线上小端发送,先低字节、后高字节。
-- magic、version、profile、type、长度、seq、timestamp 或 CRC 错误均拒绝且无输出副作用。
-
-### 4.1 全量输出快照
-
-快照整帧固定 50 字节:
-
-```text
-A5 5A 02 04 07
-00 00 00 00
-00 00 00 00
-22
-2A 00
-PTC1..PTC24
-FAN1..FAN4
-solenoid X Y Z
-CRC_LO CRC_HI
-```
-
-偏移定义:
-
-| 偏移 | 长度 | 内容 |
-|---|---:|---|
-| 0..1 | 2 | `A5 5A` |
-| 2 | 1 | version=`02` |
-| 3 | 1 | profile=`04` |
-| 4 | 1 | type=`07` |
-| 5..8 | 4 | seq=0 |
-| 9..12 | 4 | timestamp=0 |
-| 13 | 1 | payload length=`22`,十进制 34 |
-| 14 | 1 | command=`2A` |
-| 15 | 1 | flags=`00` |
-| 16..39 | 24 | PTC1..24,允许 0..100 |
-| 40..43 | 4 | FAN1..4,允许 0..100 |
-| 44 | 1 | solenoid,只允许 0 或 100 |
-| 45..47 | 3 | X/Y/Z,只允许 0 或 100 |
-| 48..49 | 2 | CRC16 小端,覆盖偏移 2..47 |
-
-PTC/FAN/电磁铁原子提交。X/Y/Z 逐轴接受;同目标命令允许幂等成功,禁止的反向或位置无效轴不排队。Z 当前保持 invalid,因此现场快照正常可能返回 PARTIAL,但 X/Y 和同步输出仍可成功提交。
-
-### 4.2 ACK、状态和温度
-
-HOST_ACK 的 payload 固定 8 字节:
-
-```text
-ok | command | status | detail | state_hash16_le | response_type | result_flags
-```
-
-`state_hash16` 对 24 路 PTC、4 路 FAN 和 solenoid 共 29 字节计算 CRC-16/CCITT-FALSE。
-
-- `GET_STATUS` payload:`24 00 00 00`,不刷新 watchdog。
-- `DISABLE` payload:`26 00 00 00`。
-- `0x35 JOG`:`35 axis raw_dir speed_code steps_lo steps_hi 00 00`。
-- `0x36 MARK_CLOSED`:`36 02 close_dir 00 00 00 00 00`,当前只保留 Z 协议,不做实板操作。
-- `0x37 GET_MOTOR_STATUS`:`37 00 00 00 00 00 00 00`,先返回 ACK,再返回 10 字节 MOTION_STATUS payload。
-- X/Y 位置字节中,`00` 为关闭端点、`64` 为全开端点、`FE` 为已校准的中间位置或运动状态、`FF` 为未校准/未知/锁定;锁定同时置 fault bit。
-- X/Y 关闭运行 3200 步未见 LS 时进入 RECOVERY,只允许一次同方向且最多 160 步的恢复 JOG;仍未见 LS 后锁定且不再输出 STEP。
-
-温度请求 payload 为 `29 00 00 00`。温度响应是唯一紧凑帧,固定 61 字节:
-
-```text
-A5 5A 02 04 29 | 27 x raw_u16_le | CRC16_le
-```
-
-27 路顺序为 U6/0x49、U24/0x48、U25/0x4B,每颗依次为 Local、Remote1..8。`FFFF` 表示读取失败或非法编码。上位机按 `int16(raw) / 128.0` 换算摄氏度。
-
-BOOT_BUILD_ID 上电只发送一次,payload 为 embedded BUILD_ID 和 capability `0x00001FAF`。它不是 READY,不阻塞首条命令。
-
-## 5. 单次硬件会话
-
-开始前必须确认:
-
-1. `bitstream_sha256` 自检通过。
-2. COM5 和 AL-Link 在线。
-3. PTC 负载不加热。
-4. 机构行程安全。
-5. P5 高电平确实关闭进风。
-6. LS1=X、LS2=Y,且关门约 3.3V、开门约 0V。
-7. 已知 X/Y 的原始关门方向:`--x-close-dir` 和 `--y-close-dir`,值只能是 0 或 1。
-
-如果 LS 电平不符合,只阻塞对应 X/Y 电机测试。CT7428 总线未确认不阻塞核心 gate。
-
-创建本次输出目录和参数:
-
-```powershell
-$RunId = "P4-normal-v3-" + [DateTimeOffset]::UtcNow.ToString("yyyyMMddTHHmmssZ")
-$Evidence = "C:\Users\Administrator\CodexTemp\p4-normal-v3-evidence-$RunId"
-$BoardId = "PROD2U-P4-BOARD-01"
-$XCloseDir = 0  # 必须替换为已确认的 X 关门原始方向
-$YCloseDir = 0  # 必须替换为已确认的 Y 关门原始方向
-
-$GateArgs = @(
-    "--output-dir", $Evidence,
-    "--board-id", $BoardId,
-    "--confirm-ptc-load-disabled",
-    "--confirm-mechanical-travel-safe",
-    "--confirm-p5-active-high-closes-intake",
-    "--confirm-ls1-x-closed-high",
-    "--confirm-ls2-y-closed-high",
-    "--x-close-dir", [string]$XCloseDir,
-    "--y-close-dir", [string]$YCloseDir,
-    "--run-id", $RunId
-)
-```
-
-CT7428 总线和 CON91 映射已经确认时,才追加:
-
-```powershell
-$GateArgs += @(
-    "--enable-temperature-test",
-    "--confirm-ct7428-cpld-bus",
-    "--con91-raw-index", "<0..26>"
-)
-```
-
-执行完整会话:
-
-```powershell
-& (Join-Path $Pkg "run.ps1") normal-actuator-temp-gate -Python $Python -Arguments $GateArgs
-```
-
-包内 `run.ps1` 自动注入固件路径和 `build-info.json`。gate 每个硬件会话最多调用一次 PROGRAM_SRAM,不执行 Flash,不自动重试。编程失败立即结束当前会话;只有查明根因并重新获得用户授权后,才能创建新的单次编程会话。
-
-编程成功后 gate 立即发送 DISABLE,不等待 BOOT_BUILD_ID。随后验证:
-
-- embedded BUILD_ID、ACK、CRC 和安全 state hash。
-- X/LS1、Y/LS2 先按已确认的关门方向校准;若上电时 LS 已为高电平,该步必须零步完成,不能先用离开方向猜测关门方向。
-- 校准后执行 X/Y 离开关门端的短 JOG 和人工运动确认。
-- 每个短 JOG 确认后立即按已确认的关门方向重新校准;只有 X/Y 都回到关闭端点后才进入标准全开、全关验收。
-- X/Y 全开、全关。
-- OPENING 重复 OPEN 幂等且不重启计数;CLOSING 收到 OPEN 返回 PARTIAL,当前关闭动作保持不变。
-- OPENING 收到 CLOSE 的安全反向由 RTL 仿真和 formal 覆盖:完整结束当前 STEP 和低电平后才切换 DIR,并重新等待 setup 时间。
-- 5 秒 watchdog 中止和安全回退。
-- P5 短时断电、吸合、断电。
-- 最终 DISABLE、STEP 全低、EN_N 高。
-
-本轮不做断开 LS1/LS2 的实板故障注入。限位缺失只由 RTL 仿真和 formal 覆盖。
-
-## 6. 结果解释和失败处理
-
-硬件 receipt 分开报告:
-
-- `core_status=pass`:串口、X/Y、限位、watchdog、电磁铁和最终安全状态通过。
-- `temperature_status=pass`:CT7428 已单独实测通过。
-- `temperature_status=not_run_bus_unconfirmed`:没有发送温度命令,只能声明执行器核心通过。
-
-未接探头的温度通道允许 `FFFF`。已接 CON91 的目标通道必须非 `FFFF`,并能观察到合理温度变化。
-
-非编程阶段失败时,流程先尝试 DISABLE 并记录当前 BUILD_ID,只重跑与根因相关的阶段及其下游。不要因为文档、封包或无关 receipt 变化重新启动完整验证。
-
-最终通过声明不包括:Flash 持久化、PTC 热性能、位置精度、扭矩、堵转、机械寿命、温度探头开短路诊断或长期可靠性。

文件差異過大導致無法顯示
+ 83 - 0
docs/prod2u-p4-normal-v3-actuator-trace-runbook.zh-CN.md


+ 0 - 162
docs/prod2u-program-sram-runbook.zh-CN.md

@@ -1,162 +0,0 @@
-# Prod2U 自动 PROGRAM_SRAM 与 binary921 现场 Runbook
-
-## 1. 适用范围
-
-本流程适用于生产温控板 profile `prod2u-bmc-replay-binary921`:
-
-- JTAG:Anlogic AL-Link Mini,J3,speed code `2`,对应 `200kHz`。
-- Combined Host+Debug:UART2,FPGA `TX=M10`、`RX=N11`,板外 RS232 电平,`921600 8N1`。
-- BMC replay:UART1,FPGA `TX=L10`、`RX=M9`,板外 RS232 电平,`115200 8N1`。
-- UART2 从生产板 `CON78` 引出:pin1=`RS232_TX2`(板输出)、pin2=`RS232_RX2`(板输入)、pin3/pin4=GND;pin5/pin6 是接地固定焊盘。
-- UART1 从生产板 `CON77` 引出:pin1=`RS232_TX1`(板输出)、pin2=`RS232_RX1`(板输入)、pin3/pin4=GND;pin5/pin6 是接地固定焊盘。
-- CON77/CON78 经过 U22/U23 `TRSF3232EIPWR`,必须接真正的 USB-RS232 适配器,不能接 USB-TTL。板 TX 接适配器 RXD,板 RX 接适配器 TXD,并共地;接口不提供 VCC。
-- 原理图没有给出实物连接器的观察方向。未通过 pin1 标记、连接器资料或万用表确认前,不得按“从左到右”猜测针序。
-
-包内 [CON77/CON78 RS-232 原理图截图](images/prod2u-con77-con78-rs232-schematic.png) 来自 `FCB_FPGA+MCU0611.pdf` 第 5 页。它证明电气链路,不证明实物连接器朝向。
-- 只允许 SRAM 配置,不写入非易失存储。
-- 板子保持正常供电,不要求重新上电,不把 DTR/RTS 当复位使用。
-
-本流程的 pass 只证明指定 bitstream 的 SRAM 下载、build identity、binary921 控制通信和 BMC replay 证据。真实 PTC/FAN 负载、热性能和真实 PID 闭环需要独立 gate。
-
-## 2. 已确认的历史事实
-
-旧 `j6bin.bit` 的 SHA256 为:
-
-```text
-D6648FA4E51384AC1DA92AD03A1A3FFEFDD04FECC4EDA07DFDDAC335A7881347
-```
-
-BitWriter 历史日志记录了该文件 4 次 `200kHz` 和 1 次 `500kHz` 完整下载。`-spd 2` 会生成 `bit_to_vec -freq 0.200000`,因此数值映射已有运行日志证据。
-
-此前 CLI 负向探针使用不存在的 `tmp/does-not-exist.bit`。出现 `PRG-8002 Cannot open file` 和后续通用错误是预期结果,不代表上述生产 bitstream 或 JTAG 链路失败。
-
-`bw_commands_prompt.exe` 即使内部命令失败也可能返回进程退出码 `0`。工具必须解析完整事务日志,不能只读取 `$LASTEXITCODE`。
-
-## 3. 固件启动修复
-
-旧生产约束错误地把 `N6` 当作低有效复位。权威原理图第 3 页显示 `N6=KEY_1`,并非系统复位。Prod2U 固件不再使用 N6,改用配置初始化的内部 POR:
-
-1. SRAM 配置完成后,POR 保持核心复位 1024 个 25MHz 时钟周期,约 `40.96us`。
-2. POR 同步释放。
-3. 核心再等待约 `10ms` startup delay。
-4. READY payload 固定为 7 字节:runtime profile ID `3` 1 字节、32-bit build ID 4 字节、POR reason 1 字节和 announcement sequence 1 字节。
-
-每次 SRAM 配置都会重新初始化 POR,不需要对板子断电。
-
-## 4. 包内容
-
-发布包名称固定为 `prod2u-<BUILD_ID>`,根目录包含:
-
-- `fw.bit`
-- `prod2u.ps1`
-- `prod2u_cli.py`
-- `prod2u_programmer.py`
-- `prod2u_validate.py`
-- `source-manifest.json`
-- `td.json`
-- `bmc-replay-payload.json`
-- `manifest.json`
-- `sha256-inventory.json`
-- `START-HERE.zh-CN.md`
-- `prod2u-program-sram-runbook.zh-CN.md`
-- `schemas/prod2u_program_sram_receipt.schema.json`
-- `schemas/prod2u_evidence_manifest.schema.json`
-- `schemas/prod2u_final_gate.schema.json`
-- `schemas/prod2u_td_build_receipt.schema.json`
-
-`BUILD_ID` 是 source manifest SHA256 的前 8 个十六进制字符。完整 source hash 同时保存在 source manifest、TD receipt 和 package manifest 中。
-
-## 5. 命令模式
-
-在包根目录执行。
-
-### 5.1 无硬件自测
-
-```powershell
-powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\prod2u.ps1 selftest
-```
-
-该命令不得打开 COM、AL-Link 或执行 SRAM 下载。
-
-### 5.2 预检
-
-```powershell
-powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\prod2u.ps1 preflight -CombinedPort COM5 -Bitstream .\fw.bit -TdReceipt .\td.json -SourceManifest .\source-manifest.json
-```
-
-预检校验文件 hash、build ID、TD receipt、显式 COM 名称与 TD 工具路径。preflight 不打开 AL-Link,不打开 COM,不检查或操作 AL-Link 状态,也不执行 SRAM 下载。
-
-### 5.3 仅验证 programmer
-
-```powershell
-powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\prod2u.ps1 program-only -Bitstream .\fw.bit -TdReceipt .\td.json -SourceManifest .\source-manifest.json -OutputDir ..\prod2u-<BUILD_ID>-evidence
-```
-
-该模式不证明 READY、UART、BMC replay 或 PWM 功能。
-
-### 5.4 完整自动流程
-
-```powershell
-powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\prod2u.ps1 all -CombinedPort COM5 -Bitstream .\fw.bit -TdReceipt .\td.json -SourceManifest .\source-manifest.json -BmcReplayReceipt ..\prod2u-<BUILD_ID>-runtime\bmc-replay-session.json -OutputDir ..\prod2u-<BUILD_ID>-evidence
-```
-
-固定顺序:
-
-1. 校验 package、source manifest、TD receipt 和 bitstream hash。
-2. 正常关闭 TD/BitWriter;等待 5 秒后只结束仍占用当前 TD 安装的进程。
-3. 打开 COM5。先保存 raw pre-program 字节和帧记录,再执行解析。
-4. 执行一次 `PROGRAM_SRAM @200kHz`。
-5. 同时保存 CLI stdout、stderr 和本次新增的 BitWriter 日志区间。
-6. 校验 7 字节 READY 的 profile、build ID、POR reason、序列和 post-program epoch;受损、部分或超时时同样先保存已读 raw,再分类失败。
-7. 发送 12 条 Host binary command,保存实际 wire bytes 和接收 raw。
-8. 生成 programmer receipt、evidence manifest 和 final gate 输入。
-
-失败后立即停止,不自动重试,不重新上电。
-
-## 6. Programmer 严格判定
-
-同一事务必须按顺序出现:
-
-1. 目标 `download` start,参数包含目标 bit 路径、JTAG、`-spd 2`、cable 0。
-2. `PRG-2014 : Chip validation success: EF2L45`。
-3. 同一 bit 路径的 `bit_to_vec` start,频率为 `0.200000`。
-4. `bit_to_vec` finish。
-5. `program -cable 0 -mode svf -spd 2 -p` start。
-6. `program` finish。
-7. 外层 `download` finish。
-
-任何错误代码、错误文本、路径/hash/chip/speed 不一致、marker 缺失或乱序、多事务、超时或禁止动作都使该层失败。退出码 `0` 只是辅助字段。
-
-## 7. READY 和串口失败分类
-
-collector 必须保存所有已读取字节,即使 READY 超时。失败分类包括:
-
-- `blocked_waiting_for_ready_empty`:当前进程确实没有收到字节。
-- `blocked_waiting_for_ready_noise`:收到字节,但不存在 binary921 magic。
-- `blocked_waiting_for_ready_partial`:存在未完成帧。
-- `blocked_waiting_for_ready_corrupt`:帧长度、版本或 CRC 错误。
-- `blocked_ready_profile_mismatch`:profile 不是 ID 3。
-- `blocked_ready_build_identity_mismatch`:READY build ID 与包不一致。
-- `blocked_ready_epoch_not_post_program`:帧不能关联到本次 SRAM 下载。
-
-空 raw 只能说明采集进程没有保存到字节,不能单独证明板子无输出、串口接线正确或 SRAM 下载失败。
-
-## 8. 验收边界
-
-- `program receipt pass`:只证明 BitWriter 日志报告指定 bitstream 的 SRAM 下载事务完整。
-- `fresh epoch pass`:证明本次下载后出现正确 profile/build ID READY。
-- `host_uart pass`:证明 12 条 Host 命令和 ACK 全部匹配。
-- `bmc_replay pass`:证明 CPLD poll 后 PC 回复历史真实 BMC payload,且 hash 匹配。
-- `real_fan_ptc_hardware_status=not_run`:不等于失败,也不能写成真实负载 pass。
-
-`prod2u-final-gate-v1` 是 Prod2U 子 gate。它的 required layers 全部为 `pass` 时,只表示 Prod2U 控制通信证据可作为仓库 `final-gate-v2` 的输入;它不替代 `final-gate-v2`,也不能把 `blocked_*`、`fail_*`、dry-run、fixture 或缺失证据提升为 pass。
-
-## 9. Harness 演进触发条件
-
-以下任一变化必须升级 schema/gate 并重新资格验证:
-
-- TD 或 BitWriter 版本变化。
-- CLI marker、日志目录或 speed 映射变化。
-- 原理图/PDF hash、板卡版本或 UART 电平路径变化。
-- READY payload 或 Host binary protocol 变化。
-- 引入真实 PTC/FAN 负载、真实热测试或 PID 闭环。

+ 0 - 41
docs/prod2u-start-here.zh-CN.md

@@ -1,41 +0,0 @@
-# Prod2U 生产温控板 SRAM 调试包
-
-本包 build ID:`{{BUILD_ID}}`。板子保持正常供电,不要求重新上电。
-
-## 接线与前置条件
-
-1. 生产板正常供电;AL-Link 排线接 J3,JTAG speed 固定 200kHz。
-2. combined Host+Debug 使用生产板 `CON78/UART2`,默认 COM5、921600 8N1。CON78 电气针序为:pin1=`RS232_TX2`(板输出)、pin2=`RS232_RX2`(板输入)、pin3/pin4=GND;pin5/pin6 是接地的固定焊盘。
-3. BMC replay 使用生产板 `CON77/UART1`,115200 8N1。CON77 电气针序为:pin1=`RS232_TX1`(板输出)、pin2=`RS232_RX1`(板输入)、pin3/pin4=GND;pin5/pin6 是接地的固定焊盘。
-4. CON77/CON78 已经过板载 `TRSF3232EIPWR`,板外是标准 RS-232 电平,不是 3.3V TTL。必须使用 USB-RS232 适配器:板 pin1 TX 接适配器 RXD,板 pin2 RX 接适配器 TXD,板 pin3 或 pin4 接适配器 GND。接口不提供 VCC,禁止把 USB-TTL 适配器直接接到 CON77/CON78。
-5. 原理图只证明电气 pin 编号,当前仓库没有 PCB/装配图证明实物连接器从哪个观察方向数 pin1。接线前必须依据板上 pin1 标记、连接器数据手册或万用表确认方向,不能凭左右位置猜测。
-
-电气连接截图见 [CON77/CON78 RS-232 原理图](images/prod2u-con77-con78-rs232-schematic.png)。截图来自 `FCB_FPGA+MCU0611.pdf` 第 5 页,只用于确认 U22/U23、信号名和 pin 编号,不代表实物观察方向。
-
-运行现场流程前,调试机需已具备 Python 3、`pyserial` 和 `jsonschema`。本包不会安装 Python、驱动或依赖。
-
-## 自动流程
-
-先做不打开硬件的检查:`preflight` 不打开 COM、AL-Link,不执行 `PROGRAM_SRAM`。它只校验包内文件、build identity、TD receipt 与 TD 工具路径。
-
-```powershell
-powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\prod2u.ps1 preflight -CombinedPort COM5 -Bitstream .\fw.bit -TdReceipt .\td.json -SourceManifest .\source-manifest.json -BmcReplayReceipt ..\prod2u-{{BUILD_ID}}-runtime\bmc-replay-session.json -OutputDir ..\prod2u-{{BUILD_ID}}-evidence
-```
-
-需要完整 BMC gate 时,先在第二个显式串口启动 poll-response replay。运行时文件必须写在包目录外;`--receipt ..\prod2u-{{BUILD_ID}}-runtime\bmc-replay-session.json` 必须写出此次 replay session receipt:
-
-```powershell
-python -B .\prod2u_bmc_replay.py replay --port COM6 --payload .\bmc-replay-payload.json --iterations 0 --timeout-sec 0 --receipt ..\prod2u-{{BUILD_ID}}-runtime\bmc-replay-session.json --json
-```
-
-然后在包根目录运行:
-
-```powershell
-powershell.exe -NoProfile -ExecutionPolicy Bypass -File .\prod2u.ps1 all -CombinedPort COM5 -Bitstream .\fw.bit -TdReceipt .\td.json -SourceManifest .\source-manifest.json -BmcReplayReceipt ..\prod2u-{{BUILD_ID}}-runtime\bmc-replay-session.json -OutputDir ..\prod2u-{{BUILD_ID}}-evidence
-```
-
-工具只允许 `PROGRAM_SRAM`,固定 AL-Link cable 0、speed code 2(200kHz)、单次尝试、零自动重试。`all` 会自动执行这一次 SRAM 下载,随后检查启动 READY 和收集证据;不要断电。失败后保留 raw 和日志并停止。
-
-只验证 programmer 时使用 `program-only`;只采集串口时使用 `collect-only`,但后者不能形成 fresh epoch strict pass。
-
-未接第二路 BMC replay 时,BMC layer 必须保持 `not_run/blocked`。真实 PTC/FAN 负载、热性能和真实 PID 闭环不在本包 pass 范围内。Prod2U 子 gate 证据是仓库 `final-gate-v2` 的输入,不代替仓库 final gate。

+ 0 - 16
docs/td-2026.1-evidence-index.zh-CN.md

@@ -1,16 +0,0 @@
-# TD 2026.1 Evidence Index
-
-## 活入口
-
-- TD source profile:`td/uart_rs232_j6_host_sensor_real_fan_ptc_debug921_primary.prj`。
-- top:`src/top/uart_rs232_j6_host_sensor_real_fan_ptc_debug921_top.v`。
-- contract top:`src/top/system_contract_top.v`。
-- constraints:`constraints/pid_study_01.adc`、`constraints/pid_study_01.sdc`。
-
-## 输出边界
-
-TD 生成物写入 `td/build/`、`tmp/` 或 TD GUI runtime 目录。bit、bid、data、log、timing、area 不作为源码基线。
-
-## Gate 语义
-
-当前 TD gate 对最新 real FAN/PTC 主线执行离线构建/阻塞判定;真实 FAN/PTC pin 与三路临时串口冲突时只允许记录 blocked,不声明真实产品板 bitstream、下载或热闭环通过。

+ 0 - 29
docs/uart-rs232-validation-strategy.zh-CN.md

@@ -1,29 +0,0 @@
-# UART/RS232 非 ChipWatcher 验证策略
-
-## 目标
-
-验证重点从外部逻辑分析 GUI 迁移到 software evidence、UART transcript、debug UART、register dump 和直接实机 SRAM 验证。机器 gate 只声明 software safety 与通信链路通过,不声明 thermal performance。
-
-## 层级
-
-- L0 static:源码边界、schema、pin inventory、禁止旧 gate、禁止 generated artifacts。
-- L1 protocol offline:BMC loose text hex parser 覆盖 echo/no-echo、裸 hex、`0xNN`、乱码、短帧、长帧、missing。
-- L2 bit-level RTL:UART RX/TX、framing error、break、overflow、TX backpressure。
-- L3 software safety:stale 10s、90C overtemp、host disable、interlock、missing DIMM、fan fallback。
-- L4 loopback/emulator:PC emulator 与同一 BMC 协议交互。
-- L5 board SRAM:只允许 SRAM bit,采集 transcript、debug UART、register dump。
-- L6 staged thermal:25% duty 短时、逐级放开、完整 soak,必须由人工/仪器 runbook 记录 thermal performance。
-
-## 证据
-
-- serial transcript hash。
-- bitstream hash。
-- parser result。
-- debug UART event stream。
-- register dump snapshot。
-- backend capability:pyserial/jsonschema 或 PowerShell/.NET fallback。
-- safety flags。
-
-## final-gate-v2
-
-`final-gate-v2` 强制所有 required layer pass。任何 `blocked_*`、`fail_*`、缺证据或 authority overclaim 都失败。产品板 pin map 和驱动资料未导入前,完整热闭环保持 blocked。

+ 0 - 56
docs/verification-gates-v2.zh-CN.md

@@ -1,56 +0,0 @@
-# 验证 Gate V2
-
-## 顺序
-
-1. `static`。
-2. `model`。
-3. `replay`。
-4. `hdl-sim --run` 或等价 RTL simulator evidence。
-5. `formal --run`。
-6. `detector-selftest --run`。
-7. `td --top uart_rs232_j6_host_sensor_real_fan_ptc_debug921_primary`;真实 FAN/PTC pin 与当前三路调试 UART 冲突时必须 blocked。
-8. `uart-validate --strict`,receipt 通常是 `uart-board-sram-receipt-v1`。
-9. `final-gate-v2`。
-10. 分级实机闭环 runbook receipt,产品板资料未导入前保持 blocked。
-
-## 自动 Gate
-
-`python tools\pid_harness.py final-gate-v2 --receipt <uart_receipt.json> --rtl-sim --formal --detector-selftest --td-build --json`
-
-strict 规则:
-
-- required layer:`static`、`model`、`replay`、`rtl_sim`、`formal`、`detector_selftest`、`td_build`、`uart_strict`。
-- 每个 layer 的 `status` 必须是 `pass`。
-- top-level receipt 的 `status` 必须是 `pass`。
-- schema 不允许未声明 layer。
-- `blocked_*` 和 `fail_*` 不得提升为 pass。
-- authority boundary 不能声明 thermal performance pass。
-
-`final-gate-v2` 的 pass 只证明控制通讯链路和软件安全策略通过,不证明完整 thermal performance。
-
-## UART Strict Receipt
-
-`uart-board-sram-receipt-v1` 至少需要:
-
-- `programming.mode=PROGRAM_SRAM`。
-- bitstream `sha256`。
-- serial `115200 8N1`、allowlist、DTR/RTS 记录。
-- transcript `sha256`。
-- debug UART event stream。
-- register dump。
-- `counterparty=pc_emulator|real_bmc`。
-- safety flags 全部显式 false。
-
-`uart-soak-receipt-v1` 不要求 top-level transcript,但 strict 模式要求每轮 pass round 关联可验证的 UART round receipt。
-
-## 不接受项
-
-- flash、driver install/reinstall、真实 PTC/fan/BMC 未受控动作。
-- 无 allowlist 的 COM。
-- 缺 transcript hash、bitstream hash、debug UART、register dump。
-- 产品板 pin map 未导入却声明完整热闭环。
-- 只靠 preflight 或人工口述。
-
-## 后续真实闭环
-
-真实闭环按 25% duty 短时、逐级放开、完整工况 soak 分级准入。强制保留 70C 默认目标、90C 硬过温、10s stale、fan fallback、人工急停和 SRAM-only 回滚。

文件差異過大導致無法顯示
+ 0 - 48
docs/verification-plan.zh-CN.md


+ 0 - 38
schemas/bmc_uart_protocol_receipt.schema.json

@@ -1,38 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "bmc_uart_protocol_receipt.schema.json",
-  "title": "BMC UART protocol offline receipt",
-  "type": "object",
-  "required": ["schema", "status", "scenario", "counterparty", "parser", "safety", "authority_boundary"],
-  "properties": {
-    "schema": { "const": "bmc-uart-protocol-receipt-v1" },
-    "status": { "type": "string" },
-    "scenario": { "type": "string" },
-    "counterparty": { "enum": ["pc_emulator", "real_bmc"] },
-    "parser": {
-      "type": "object",
-      "required": ["status", "sample_count", "missing_mask", "raw_token_count", "rejected_echo_windows"],
-      "properties": {
-        "status": { "type": "string" },
-        "sample_count": { "type": "integer", "minimum": 0 },
-        "missing_mask": { "type": "integer", "minimum": 0 },
-        "raw_token_count": { "type": "integer", "minimum": 0 },
-        "selected_window_start": { "type": "integer" },
-        "rejected_echo_windows": { "type": "integer", "minimum": 0 }
-      },
-      "additionalProperties": true
-    },
-    "safety": {
-      "type": "object",
-      "required": ["flash_attempted", "real_ptc_fan_bmc_action_attempted", "driver_install_attempted"],
-      "properties": {
-        "flash_attempted": { "const": false },
-        "real_ptc_fan_bmc_action_attempted": { "const": false },
-        "driver_install_attempted": { "const": false }
-      },
-      "additionalProperties": true
-    },
-    "authority_boundary": { "type": "string" }
-  },
-  "additionalProperties": true
-}

+ 0 - 53
schemas/cpld_bmc_acceptance_v1_receipt.schema.json

@@ -1,53 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "cpld_bmc_acceptance_v1_receipt.schema.json",
-  "title": "CPLD BMC acceptance v1 receipt",
-  "type": "object",
-  "required": ["schema", "status", "layers", "authority_boundary"],
-  "properties": {
-    "schema": { "const": "cpld-bmc-acceptance-v1-receipt-v1" },
-    "status": { "const": "pass" },
-    "layers": {
-      "type": "object",
-      "required": ["final_gate_v2", "real_bmc_j6_windows_gate_v2"],
-      "properties": {
-        "final_gate_v2": {
-          "type": "object",
-          "required": ["status", "receipt"],
-          "properties": {
-            "status": { "const": "pass" },
-            "receipt": { "$ref": "#/$defs/artifact" }
-          },
-          "additionalProperties": true
-        },
-        "real_bmc_j6_windows_gate_v2": {
-          "type": "object",
-          "required": ["status", "receipt"],
-          "properties": {
-            "status": { "const": "pass" },
-            "receipt": { "$ref": "#/$defs/artifact" }
-          },
-          "additionalProperties": true
-        }
-      },
-      "additionalProperties": false
-    },
-    "authority_boundary": { "type": "string", "minLength": 1 }
-  },
-  "additionalProperties": true,
-  "$defs": {
-    "artifact": {
-      "type": "object",
-      "required": ["path", "sha256"],
-      "properties": {
-        "path": { "type": "string", "minLength": 1 },
-        "sha256": { "$ref": "#/$defs/sha256" }
-      },
-      "additionalProperties": true
-    },
-    "sha256": {
-      "type": "string",
-      "pattern": "^[0-9a-fA-F]{64}$"
-    }
-  }
-}

+ 0 - 72
schemas/final_gate_v2_receipt.schema.json

@@ -1,72 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "final_gate_v2_receipt.schema.json",
-  "title": "Final gate v2 receipt",
-  "type": "object",
-  "required": ["schema", "status", "layers", "authority_boundary"],
-  "properties": {
-    "schema": { "const": "final-gate-v2-receipt-v1" },
-    "status": { "const": "pass" },
-    "layers": {
-      "type": "object",
-      "required": ["static", "model", "replay", "rtl_sim", "formal", "detector_selftest", "td_build", "uart_strict"],
-      "properties": {
-        "static": {
-          "type": "object",
-          "required": ["status"],
-          "properties": { "status": { "const": "pass" } },
-          "additionalProperties": true
-        },
-        "model": {
-          "type": "object",
-          "required": ["status"],
-          "properties": { "status": { "const": "pass" } },
-          "additionalProperties": true
-        },
-        "replay": {
-          "type": "object",
-          "required": ["status"],
-          "properties": { "status": { "const": "pass" } },
-          "additionalProperties": true
-        },
-        "rtl_sim": {
-          "type": "object",
-          "required": ["status"],
-          "properties": { "status": { "const": "pass" } },
-          "additionalProperties": true
-        },
-        "formal": {
-          "type": "object",
-          "required": ["status"],
-          "properties": { "status": { "const": "pass" } },
-          "additionalProperties": true
-        },
-        "detector_selftest": {
-          "type": "object",
-          "required": ["status"],
-          "properties": { "status": { "const": "pass" } },
-          "additionalProperties": true
-        },
-        "td_build": {
-          "type": "object",
-          "required": ["status"],
-          "properties": { "status": { "const": "pass" } },
-          "additionalProperties": true
-        },
-        "uart_strict": {
-          "type": "object",
-          "required": ["status"],
-          "properties": { "status": { "const": "pass" } },
-          "additionalProperties": true
-        }
-      },
-      "additionalProperties": false,
-      "$comment": "ChipWatcher and all other undeclared layers are intentionally rejected by schema and validator.",
-      "not": {
-        "required": ["chipwatcher"]
-      }
-    },
-    "authority_boundary": { "type": "string" }
-  },
-  "additionalProperties": true
-}

+ 0 - 88
schemas/j6_host_sensor_real_fan_ptc_debug921_pin_conflict_blocked_manifest.schema.json

@@ -1,88 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "j6_host_sensor_real_fan_ptc_debug921_pin_conflict_blocked_manifest.schema.json",
-  "type": "object",
-  "required": [
-    "schema",
-    "status",
-    "generated_at",
-    "authority_boundary",
-    "required_remote_action",
-    "programming_mode",
-    "user_flow",
-    "blocked_reason",
-    "pin_inventory",
-    "pin_conflicts",
-    "non_executable_reference",
-    "remote_dependencies",
-    "sha256_inventory_policy"
-  ],
-  "properties": {
-    "schema": {
-      "const": "j6-host-sensor-real-fan-ptc-debug921-pin-conflict-blocked-package-manifest-v1"
-    },
-    "status": {
-      "const": "blocked_pin_conflict_with_locked_debug_uart"
-    },
-    "generated_at": {
-      "type": "string",
-      "minLength": 1
-    },
-    "authority_boundary": {
-      "type": "string",
-      "minLength": 1
-    },
-    "required_remote_action": {
-      "type": "string",
-      "pattern": "Do not program SRAM"
-    },
-    "programming_mode": {
-      "const": "not_applicable"
-    },
-    "user_flow": {
-      "type": "string",
-      "minLength": 1
-    },
-    "blocked_reason": {
-      "type": "string",
-      "minLength": 1
-    },
-    "pin_inventory": {
-      "type": "object",
-      "required": ["path", "sha256"],
-      "properties": {
-        "path": {
-          "const": "config/pin_inventory.fcb_fpga_mcu0611.json"
-        },
-        "sha256": {
-          "type": "string",
-          "pattern": "^[0-9a-f]{64}$"
-        }
-      }
-    },
-    "pin_conflicts": {
-      "type": "array",
-      "minItems": 6
-    },
-    "non_executable_reference": {
-      "type": "object",
-      "required": ["future_expected_host_control_commands"],
-      "properties": {
-        "future_expected_host_control_commands": {
-          "type": "array",
-          "minItems": 1,
-          "items": {
-            "type": "string"
-          }
-        }
-      }
-    },
-    "remote_dependencies": {
-      "const": "None for this blocked package."
-    },
-    "sha256_inventory_policy": {
-      "type": "string",
-      "pattern": "self-referential"
-    }
-  }
-}

+ 0 - 59
schemas/j6_host_sensor_real_fan_ptc_debug921_pin_conflict_blocked_package.schema.json

@@ -1,59 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "j6_host_sensor_real_fan_ptc_debug921_pin_conflict_blocked_package.schema.json",
-  "type": "object",
-  "required": ["schema", "status", "generated_at", "reason", "td_bitstream", "pin_map", "real_fan_ptc_hardware_status", "non_executable_reference", "authority_boundary"],
-  "properties": {
-    "schema": { "const": "j6-host-sensor-real-fan-ptc-debug921-pin-conflict-blocked-package-v1" },
-    "status": { "const": "blocked_pin_conflict_with_locked_debug_uart" },
-    "generated_at": { "type": "string", "minLength": 1 },
-    "reason": { "type": "string", "minLength": 1 },
-    "td_bitstream": {
-      "type": "object",
-      "required": ["status", "top", "top_module", "bitstream", "reason"],
-      "properties": {
-        "status": { "const": "blocked_pin_conflict_with_locked_debug_uart" },
-        "top": { "const": "uart_rs232_j6_host_sensor_real_fan_ptc_debug921_primary" },
-        "top_module": { "const": "uart_rs232_j6_host_sensor_real_fan_ptc_debug921_top" },
-        "bitstream": { "type": "null" },
-        "reason": { "type": "string", "minLength": 1 }
-      }
-    },
-    "pin_map": {
-      "type": "object",
-      "required": ["status", "ptc_count", "fan_count", "fan_fg_count", "fan_install_count", "physical_balls_verified", "usable_with_locked_debug_uart", "inventory", "conflicts"],
-      "properties": {
-        "status": { "const": "blocked_pin_conflict_with_locked_debug_uart" },
-        "ptc_count": { "const": 24 },
-        "fan_count": { "const": 4 },
-        "fan_fg_count": { "const": 8 },
-        "fan_install_count": { "const": 4 },
-        "physical_balls_verified": { "const": true },
-        "usable_with_locked_debug_uart": { "const": false },
-        "inventory": { "const": "config/pin_inventory.fcb_fpga_mcu0611.json" },
-        "conflicts": { "type": "array", "minItems": 1 }
-      }
-    },
-    "real_fan_ptc_hardware_status": {
-      "type": "object",
-      "required": ["status", "real_fan_ptc_hardware_present", "qualifies_final_gate"],
-      "properties": {
-        "status": { "const": "not_run" },
-        "real_fan_ptc_hardware_present": { "const": false },
-        "qualifies_final_gate": { "const": false }
-      }
-    },
-    "non_executable_reference": {
-      "type": "object",
-      "required": ["future_expected_host_control_commands"],
-      "properties": {
-        "future_expected_host_control_commands": {
-          "type": "array",
-          "items": { "type": "string" },
-          "minItems": 1
-        }
-      }
-    },
-    "authority_boundary": { "type": "string", "minLength": 1 }
-  }
-}

+ 0 - 49
schemas/j6_host_sensor_real_fan_ptc_debug921_pin_conflict_blocked_sha256_inventory.schema.json

@@ -1,49 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "j6_host_sensor_real_fan_ptc_debug921_pin_conflict_blocked_sha256_inventory.schema.json",
-  "type": "object",
-  "required": ["schema", "generated_at", "self_hash_policy", "inventory"],
-  "properties": {
-    "schema": {
-      "const": "j6-host-sensor-real-fan-ptc-debug921-pin-conflict-blocked-package-sha256-inventory-v1"
-    },
-    "generated_at": {
-      "type": "string",
-      "minLength": 1
-    },
-    "self_hash_policy": {
-      "const": "excluded_self_referential_file"
-    },
-    "inventory": {
-      "type": "array",
-      "minItems": 1,
-      "items": {
-        "type": "object",
-        "required": ["path", "sha256", "bytes"],
-        "properties": {
-          "path": {
-            "type": "string",
-            "minLength": 1
-          },
-          "sha256": {
-            "type": "string",
-            "pattern": "^[0-9a-f]{64}$"
-          },
-          "bytes": {
-            "type": "integer",
-            "minimum": 0
-          }
-        }
-      },
-      "contains": {
-        "type": "object",
-        "required": ["path"],
-        "properties": {
-          "path": {
-            "const": "manifest.json"
-          }
-        }
-      }
-    }
-  }
-}

+ 0 - 292
schemas/offline_fidelity_gate_v1_receipt.schema.json

@@ -1,292 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "offline_fidelity_gate_v1_receipt.schema.json",
-  "title": "Offline fidelity gate v1 receipt",
-  "type": "object",
-  "required": ["schema", "status", "generated_at", "toolchain", "layers", "coverage_matrix", "safety", "authority_boundary"],
-  "properties": {
-    "schema": { "const": "offline-fidelity-gate-v1-receipt-v1" },
-    "status": { "const": "pass" },
-    "generated_at": { "type": "string" },
-    "toolchain": {
-      "type": "object",
-      "required": ["status", "toolchain", "manifest", "cleanup_policy", "safety", "authority_boundary"],
-      "properties": {
-        "status": { "const": "pass" },
-        "toolchain": {
-          "type": "object",
-          "required": ["status", "tools"],
-          "properties": {
-            "status": { "const": "pass" },
-            "tools": {
-              "type": "object",
-              "required": ["python", "iverilog", "vvp", "verilator", "yosys", "sby", "cocotb", "td_cli"]
-            }
-          },
-          "additionalProperties": true
-        },
-        "manifest": {
-          "type": "object",
-          "required": ["install_roots", "tools", "cleanup_plan", "safety"],
-          "properties": {
-            "install_roots": { "type": "object", "minProperties": 1 },
-            "tools": { "type": "array", "minItems": 8 },
-            "cleanup_plan": {
-              "type": "object",
-              "required": ["default", "requires_owner_marker", "allowed_root"],
-              "properties": {
-                "default": { "const": "dry_run" },
-                "requires_owner_marker": { "const": true },
-                "allowed_root": { "type": "string", "minLength": 1 }
-              },
-              "additionalProperties": true
-            }
-          },
-          "additionalProperties": true
-        },
-        "cleanup_policy": {
-          "type": "object",
-          "required": ["default", "requires_owner_marker", "allowed_root"],
-          "properties": {
-            "default": { "const": "dry_run" },
-            "requires_owner_marker": { "const": true },
-            "allowed_root": { "type": "string", "minLength": 1 }
-          },
-          "additionalProperties": true
-        },
-        "safety": {
-          "type": "object",
-          "required": ["opens_com_ports", "toggles_dtr_rts", "installs_drivers", "programs_flash", "touches_ptc_fan_bmc"],
-          "properties": {
-            "opens_com_ports": { "const": false },
-            "toggles_dtr_rts": { "const": false },
-            "installs_drivers": { "const": false },
-            "programs_flash": { "const": false },
-            "touches_ptc_fan_bmc": { "const": false }
-          },
-          "additionalProperties": true
-        },
-        "authority_boundary": { "type": "string" }
-      },
-      "additionalProperties": true
-    },
-    "layers": {
-      "type": "object",
-      "required": [
-        "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"
-      ],
-      "properties": {
-        "static": { "$ref": "#/$defs/staticLayer" },
-        "model": { "$ref": "#/$defs/modelLayer" },
-        "replay": { "$ref": "#/$defs/passLayer" },
-        "protocol_fuzz": { "$ref": "#/$defs/scenarioLayer" },
-        "hdl_sim": { "$ref": "#/$defs/hdlLayer" },
-        "cocotb_virtual_lab": { "$ref": "#/$defs/cocotbLayer" },
-        "virtual_driver_lab": { "$ref": "#/$defs/virtualDriverLayer" },
-        "formal": { "$ref": "#/$defs/formalLayer" },
-        "detector_selftest": { "$ref": "#/$defs/detectorLayer" },
-        "mutation": { "$ref": "#/$defs/mutationLayer" },
-        "thermal_digital_twin": { "$ref": "#/$defs/thermalLayer" },
-        "coverage_matrix": { "$ref": "#/$defs/coverageLayer" },
-        "td_build": { "$ref": "#/$defs/tdLayer" },
-        "debug_bundle": { "$ref": "#/$defs/debugBundleLayer" }
-      },
-      "additionalProperties": false,
-      "$comment": "hardware, board, uart_strict, chipwatcher, thermal_performance_pass, and any undeclared layer are rejected."
-    },
-    "coverage_matrix": { "$ref": "#/$defs/passLayer" },
-    "safety": {
-      "type": "object",
-      "required": ["opens_com_ports", "toggles_dtr_rts", "programs_flash", "installs_drivers", "real_ptc_fan_bmc_action_attempted"],
-      "properties": {
-        "opens_com_ports": { "const": false },
-        "toggles_dtr_rts": { "const": false },
-        "programs_flash": { "const": false },
-        "installs_drivers": { "const": false },
-        "real_ptc_fan_bmc_action_attempted": { "const": false }
-      },
-      "additionalProperties": true
-    },
-    "authority_boundary": {
-      "type": "string",
-      "not": {
-        "anyOf": [
-          { "pattern": "thermal_performance_pass" },
-          { "pattern": "thermal performance pass" },
-          { "pattern": "hardware pass" },
-          { "pattern": "board pass" },
-          { "pattern": "uart_strict pass" },
-          { "pattern": "chipwatcher pass" }
-        ]
-      }
-    }
-  },
-  "not": {
-    "anyOf": [
-      { "required": ["hardware"] },
-      { "required": ["board"] },
-      { "required": ["uart_strict"] },
-      { "required": ["chipwatcher"] },
-      { "required": ["thermal_performance_pass"] }
-    ]
-  },
-  "additionalProperties": true,
-  "$defs": {
-    "passLayer": {
-      "type": "object",
-      "required": ["status"],
-      "properties": { "status": { "const": "pass" } },
-      "additionalProperties": true
-    },
-    "staticLayer": {
-      "allOf": [{ "$ref": "#/$defs/passLayer" }],
-      "required": ["status", "returncode"]
-    },
-    "modelLayer": {
-      "allOf": [{ "$ref": "#/$defs/passLayer" }],
-      "required": ["status", "tests"]
-    },
-    "scenarioLayer": {
-      "allOf": [{ "$ref": "#/$defs/passLayer" }],
-      "required": ["status", "scenarios"]
-    },
-    "hdlLayer": {
-      "allOf": [{ "$ref": "#/$defs/passLayer" }],
-      "anyOf": [{ "required": ["tests"] }, { "required": ["backend_results"] }]
-    },
-    "cocotbLayer": {
-      "allOf": [{ "$ref": "#/$defs/passLayer" }],
-      "required": ["status", "sim"]
-    },
-    "formalLayer": {
-      "allOf": [{ "$ref": "#/$defs/passLayer" }],
-      "required": ["status", "targets"]
-    },
-    "detectorLayer": {
-      "allOf": [{ "$ref": "#/$defs/passLayer" }],
-      "required": ["status", "results"]
-    },
-    "virtualDriverLayer": {
-      "allOf": [{ "$ref": "#/$defs/passLayer" }],
-      "required": ["status", "user_mode_shims", "fault_contracts", "trace_hash"],
-      "properties": {
-        "user_mode_shims": {
-          "type": "array",
-          "minItems": 6,
-          "allOf": [
-            { "contains": { "type": "object", "properties": { "name": { "const": "pyserial_loopback_url" }, "status": { "const": "pass" } }, "required": ["name", "status", "transcript"] } },
-            { "contains": { "type": "object", "properties": { "name": { "const": "socket_pipe_transport" }, "status": { "const": "pass" } }, "required": ["name", "status", "transcript"] } },
-            { "contains": { "type": "object", "properties": { "name": { "const": "bmc_text_driver" }, "status": { "const": "pass" } }, "required": ["name", "status", "transcript"] } },
-            { "contains": { "type": "object", "properties": { "name": { "const": "host_register_plane" }, "status": { "const": "pass" } }, "required": ["name", "status", "transcript"] } },
-            { "contains": { "type": "object", "properties": { "name": { "const": "debug_uart_decoder" }, "status": { "const": "pass" } }, "required": ["name", "status", "transcript"] } },
-            { "contains": { "type": "object", "properties": { "name": { "const": "fault_injection_facade" }, "status": { "const": "pass" } }, "required": ["name", "status", "transcript"] } }
-          ]
-        },
-        "fault_contracts": {
-          "type": "array",
-          "minItems": 8,
-          "allOf": [
-            { "contains": { "const": "timeout" } },
-            { "contains": { "const": "disconnect" } },
-            { "contains": { "const": "partial_read" } },
-            { "contains": { "const": "partial_write" } },
-            { "contains": { "const": "permission_denied" } },
-            { "contains": { "const": "buffer_overflow" } },
-            { "contains": { "const": "tx_backpressure" } },
-            { "contains": { "const": "rx_overflow" } }
-          ]
-        },
-        "trace_hash": { "type": "string", "pattern": "^[0-9a-fA-F]{64}$" }
-      },
-      "additionalProperties": true
-    },
-    "mutationLayer": {
-      "allOf": [{ "$ref": "#/$defs/passLayer" }],
-      "required": ["status", "mutants"],
-      "properties": {
-        "mutants": {
-          "type": "array",
-          "minItems": 6,
-          "items": {
-            "type": "object",
-            "required": ["name", "status", "mutation_status", "artifact_sha256"],
-            "properties": {
-              "status": { "const": "pass" },
-              "mutation_status": { "const": "killed" },
-              "artifact_sha256": { "type": "string", "pattern": "^[0-9a-fA-F]{64}$" }
-            },
-            "additionalProperties": true
-          }
-        }
-      },
-      "additionalProperties": true
-    },
-    "thermalLayer": {
-      "allOf": [{ "$ref": "#/$defs/passLayer" }],
-      "required": ["status", "models"],
-      "properties": {
-        "models": {
-          "type": "array",
-          "minItems": 7,
-          "items": {
-            "type": "object",
-            "required": ["name", "status", "trace_hash"],
-            "properties": {
-              "status": { "const": "pass" },
-              "trace_hash": { "type": "string", "pattern": "^[0-9a-fA-F]{64}$" },
-              "violations": { "type": "array", "maxItems": 0 }
-            },
-            "additionalProperties": true
-          }
-        }
-      },
-      "additionalProperties": true
-    },
-    "coverageLayer": {
-      "allOf": [{ "$ref": "#/$defs/passLayer" }],
-      "required": ["status", "items"],
-      "properties": {
-        "items": {
-          "type": "array",
-          "minItems": 12,
-          "allOf": [
-            { "contains": { "type": "object", "properties": { "category": { "const": "protocol" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
-            { "contains": { "type": "object", "properties": { "category": { "const": "uart_bit" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
-            { "contains": { "type": "object", "properties": { "category": { "const": "control" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
-            { "contains": { "type": "object", "properties": { "category": { "const": "safety" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
-            { "contains": { "type": "object", "properties": { "category": { "const": "debug" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
-            { "contains": { "type": "object", "properties": { "category": { "const": "virtual_driver_lab" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
-            { "contains": { "type": "object", "properties": { "category": { "const": "thermal" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
-            { "contains": { "type": "object", "properties": { "category": { "const": "fault_injection" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
-            { "contains": { "type": "object", "properties": { "category": { "const": "cocotb_virtual_lab" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
-            { "contains": { "type": "object", "properties": { "category": { "const": "formal" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
-            { "contains": { "type": "object", "properties": { "category": { "const": "mutation" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } },
-            { "contains": { "type": "object", "properties": { "category": { "const": "td_toolchain" }, "status": { "const": "pass" } }, "required": ["category", "status", "covered_by"] } }
-          ]
-        }
-      },
-      "additionalProperties": true
-    },
-    "tdLayer": {
-      "allOf": [{ "$ref": "#/$defs/passLayer" }],
-      "required": ["status", "elaboration"]
-    },
-    "debugBundleLayer": {
-      "allOf": [{ "$ref": "#/$defs/passLayer" }],
-      "anyOf": [{ "required": ["path"] }, { "required": ["bundle_dir"] }]
-    }
-  }
-}

+ 0 - 130
schemas/prod2u_evidence_manifest.schema.json

@@ -1,130 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "prod2u-evidence-manifest-v1",
-  "title": "Prod2U binary921 evidence manifest",
-  "type": "object",
-  "required": [
-    "schema",
-    "status",
-    "protocol",
-    "profile",
-    "profile_id",
-    "build_identity",
-    "programmer_receipt",
-    "startup_ready",
-    "host_command_count",
-    "host_ack_count",
-    "host_ack_matched_count",
-    "bmc_replay",
-    "artifact_hashes",
-    "real_fan_ptc_hardware_status",
-    "safety"
-  ],
-  "properties": {
-    "schema": {"const": "prod2u-evidence-manifest-v1"},
-    "status": {"enum": ["pass", "blocked_bmc_replay_not_run", "blocked", "fail"]},
-    "protocol": {"const": "binary921"},
-    "profile": {"const": "prod2u-bmc-replay-binary921"},
-    "profile_id": {"const": 3},
-    "build_identity": {
-      "type": "object",
-      "required": ["build_id", "source_manifest_sha256"],
-      "properties": {
-        "build_id": {"type": "string", "pattern": "^[0-9A-Fa-f]{8}$"},
-        "source_manifest_sha256": {"type": "string", "pattern": "^[0-9A-Fa-f]{64}$"}
-      },
-      "additionalProperties": true
-    },
-    "startup_ready": {
-      "type": "object",
-      "required": ["frame_type", "seq", "profile_id", "build_id", "post_program_epoch", "por_reason", "announcement_seq", "matching_ready_count", "selection_policy"],
-      "properties": {
-        "frame_type": {"const": 1},
-        "seq": {"const": 1},
-        "profile_id": {"const": 3},
-        "build_id": {"type": "string", "pattern": "^[0-9A-Fa-f]{8}$"},
-        "post_program_epoch": {"const": true},
-        "por_reason": {"const": 1},
-        "announcement_seq": {"type": "integer", "minimum": 0, "maximum": 2},
-        "matching_ready_count": {"type": "integer", "minimum": 1},
-        "selection_policy": {"const": "last_matching_ready"}
-      },
-      "additionalProperties": true
-    },
-    "host_command_count": {"const": 12},
-    "host_ack_count": {"const": 12},
-    "host_ack_matched_count": {"const": 12},
-    "programmer_receipt": {
-      "type": "object",
-      "required": ["path", "sha256", "status"],
-      "properties": {
-        "path": {"type": "string", "minLength": 1},
-        "sha256": {"$ref": "#/$defs/nonEmptySha256"},
-        "status": {"type": "string", "minLength": 1}
-      },
-      "additionalProperties": true
-    },
-    "bmc_replay": {
-      "type": "object",
-      "required": ["status", "bmc_source", "payload_sha256"],
-      "properties": {
-        "status": {"type": "string", "minLength": 1},
-        "bmc_source": {"type": ["string", "null"]},
-        "payload_sha256": {
-          "anyOf": [
-            {"$ref": "#/$defs/nonEmptySha256"},
-            {"type": "null"}
-          ]
-        }
-      },
-      "additionalProperties": true
-    },
-    "artifact_hashes": {
-      "type": "object",
-      "required": ["combined-rx.raw", "host-command-wire.bin"],
-      "properties": {
-        "combined-rx.raw": {"$ref": "#/$defs/nonEmptySha256"},
-        "host-command-wire.bin": {"$ref": "#/$defs/nonEmptySha256"}
-      },
-      "additionalProperties": true
-    },
-    "real_fan_ptc_hardware_status": {"const": "not_run"},
-    "safety": {
-      "type": "object",
-      "required": ["flash_attempted", "programs_nonvolatile", "driver_install_attempted", "power_cycle_attempted", "toggles_dtr_rts"],
-      "properties": {
-        "flash_attempted": {"const": false},
-        "programs_nonvolatile": {"const": false},
-        "driver_install_attempted": {"const": false},
-        "power_cycle_attempted": {"const": false},
-        "toggles_dtr_rts": {"const": false}
-      },
-      "additionalProperties": true
-    }
-  },
-  "allOf": [
-    {
-      "if": {"properties": {"status": {"const": "pass"}}, "required": ["status"]},
-      "then": {
-        "properties": {
-          "programmer_receipt": {"properties": {"status": {"const": "pass"}}},
-          "bmc_replay": {
-            "properties": {
-              "status": {"const": "pass"},
-              "bmc_source": {"const": "pc_replay_from_real_bmc_capture"},
-              "payload_sha256": {"$ref": "#/$defs/nonEmptySha256"}
-            }
-          }
-        }
-      }
-    }
-  ],
-  "additionalProperties": true,
-  "$defs": {
-    "nonEmptySha256": {
-      "type": "string",
-      "pattern": "^[0-9a-f]{64}$",
-      "not": {"const": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}
-    }
-  }
-}

+ 0 - 51
schemas/prod2u_final_gate.schema.json

@@ -1,51 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "prod2u-final-gate-v1",
-  "title": "Prod2U final gate receipt",
-  "type": "object",
-  "required": ["schema", "status", "failures", "layers", "authority_boundary"],
-  "properties": {
-    "schema": {"const": "prod2u-final-gate-v1"},
-    "status": {"enum": ["pass", "blocked", "fail"]},
-    "failures": {"type": "array", "items": {"type": "string"}},
-    "layers": {
-      "type": "object",
-      "required": ["static", "rtl_sim", "formal", "td_build", "program_sram", "fresh_epoch", "host_uart", "bmc_replay"],
-      "properties": {
-        "static": {"enum": ["pass", "blocked", "not_run", "fail"]},
-        "rtl_sim": {"enum": ["pass", "blocked", "not_run", "fail"]},
-        "formal": {"enum": ["pass", "blocked", "not_run", "fail"]},
-        "td_build": {"enum": ["pass", "blocked", "not_run", "fail"]},
-        "program_sram": {"enum": ["pass", "blocked", "not_run", "fail"]},
-        "fresh_epoch": {"enum": ["pass", "blocked", "not_run", "fail"]},
-        "host_uart": {"enum": ["pass", "blocked", "not_run", "fail"]},
-        "bmc_replay": {"enum": ["pass", "blocked", "not_run", "fail"]}
-      },
-      "additionalProperties": true
-    },
-    "authority_boundary": {"type": "string", "minLength": 1}
-  },
-  "allOf": [
-    {
-      "if": {"properties": {"status": {"const": "pass"}}, "required": ["status"]},
-      "then": {
-        "properties": {
-          "failures": {"maxItems": 0},
-          "layers": {
-            "properties": {
-              "static": {"const": "pass"},
-              "rtl_sim": {"const": "pass"},
-              "formal": {"const": "pass"},
-              "td_build": {"const": "pass"},
-              "program_sram": {"const": "pass"},
-              "fresh_epoch": {"const": "pass"},
-              "host_uart": {"const": "pass"},
-              "bmc_replay": {"const": "pass"}
-            }
-          }
-        }
-      }
-    }
-  ],
-  "additionalProperties": true
-}

+ 0 - 390
schemas/prod2u_p4_normal_host_contract_v3.schema.json

@@ -1,390 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "prod2u-p4-normal-host-contract-v3",
-  "title": "Prod2U Profile 4 Normal binary921-v3 canonical host contract",
-  "type": "object",
-  "required": [
-    "schema",
-    "profile",
-    "protocol",
-    "transport",
-    "standard_frame",
-    "boot_build_id",
-    "commands",
-    "responses",
-    "programming",
-    "safety"
-  ],
-  "properties": {
-    "schema": {
-      "const": "prod2u-p4-normal-host-contract-v3"
-    },
-    "profile": {
-      "const": "prod2u-p4-normal-actuator-temp-binary921-v3"
-    },
-    "protocol": {
-      "const": "binary921-v3"
-    },
-    "transport": {
-      "type": "object",
-      "const": {
-        "port": "COM5",
-        "baud": 921600,
-        "data_bits": 8,
-        "parity": "N",
-        "stop_bits": 1,
-        "format": "8N1",
-        "external_level": "RS232",
-        "dtr": false,
-        "rts": false
-      }
-    },
-    "standard_frame": {
-      "type": "object",
-      "const": {
-        "magic_hex": "A5 5A",
-        "version": 2,
-        "profile_id": 4,
-        "header_bytes": 14,
-        "trailer_crc_bytes": 2,
-        "offsets": {
-          "magic": [0, 1],
-          "version": 2,
-          "profile_id": 3,
-          "frame_type": 4,
-          "seq": [5, 8],
-          "timestamp": [9, 12],
-          "payload_length": 13,
-          "payload_start": 14,
-          "crc": "after_payload"
-        },
-        "seq_required": 0,
-        "timestamp_required": 0,
-        "strict_validation": {
-          "magic": true,
-          "version": true,
-          "profile": true,
-          "frame_type": true,
-          "exact_length": true,
-          "crc": true,
-          "nonzero_seq_rejected": true,
-          "nonzero_timestamp_rejected": true,
-          "replay_cache": false,
-          "duplicate_tracking": false,
-          "conflict_tracking": false
-        },
-        "crc": {
-          "algorithm": "CRC-16/CCITT-FALSE",
-          "polynomial": 4129,
-          "initial": 65535,
-          "reflect_input": false,
-          "reflect_output": false,
-          "xor_out": 0,
-          "encoding": "u16_le",
-          "coverage_start_offset": 2,
-          "coverage_end": "final_payload_byte"
-        }
-      }
-    },
-    "boot_build_id": {
-      "type": "object",
-      "const": {
-        "frame_type": 4,
-        "payload_length": 8,
-        "full_frame_length": 24,
-        "build_id_offsets": [14, 17],
-        "build_id_encoding": "u32_le",
-        "capability_offsets": [18, 21],
-        "capability": 8111,
-        "capability_wire_le": "AF 1F 00 00",
-        "announcement_count": 1,
-        "ready_semantics": false,
-        "gates_first_command": false
-      }
-    },
-    "commands": {
-      "type": "object",
-      "const": {
-        "set_output_snapshot": {
-          "frame_type": 7,
-          "command": 42,
-          "flags": 0,
-          "payload_length": 34,
-          "full_frame_length": 50,
-          "crc_coverage_offsets": [2, 47],
-          "byte_offsets": {
-            "command": 14,
-            "flags": 15,
-            "ptc": [16, 39],
-            "fan": [40, 43],
-            "solenoid": 44,
-            "x": 45,
-            "y": 46,
-            "z": 47,
-            "crc": [48, 49]
-          },
-          "accepted_values": {
-            "ptc_percent": {"minimum": 0, "maximum": 100},
-            "fan_percent": {"minimum": 0, "maximum": 100},
-            "solenoid": [0, 100],
-            "x": [0, 100],
-            "y": [0, 100],
-            "z": [0, 100]
-          },
-          "invalid_field_rejects_entire_frame": true,
-          "synchronous_outputs": ["PTC1..24", "FAN1..4", "solenoid"],
-          "solenoid_physical_semantics": {
-            "0": "P5_low_deenergized_intake_open",
-            "100": "P5_high_energized_intake_closed"
-          },
-          "hardware_qualified_motor_axes": ["X", "Y"],
-          "protocol_reserved_motor_axes": ["Z"],
-          "motor_axes_independent": true,
-          "busy_or_invalid_axis_no_queue": true,
-          "response": "HOST_ACK"
-        },
-        "get_status": {
-          "frame_type": 5,
-          "command": 36,
-          "payload_length": 4,
-          "full_frame_length": 20,
-          "payload_hex": "24 00 00 00",
-          "response": "HOST_ACK",
-          "refreshes_watchdog": false
-        },
-        "disable": {
-          "frame_type": 5,
-          "command": 38,
-          "payload_length": 4,
-          "full_frame_length": 20,
-          "payload_hex": "26 00 00 00",
-          "response": "HOST_ACK",
-          "applies_safe_state": true
-        },
-        "jog": {
-          "frame_type": 17,
-          "command": 53,
-          "payload_length": 8,
-          "full_frame_length": 24,
-          "payload_layout": "35 axis raw_dir speed_code steps_u16_le 00 00",
-          "axis_codes": {"X": 0, "Y": 1, "Z": 2},
-          "raw_dir_values": [0, 1],
-          "speed_step_per_s": {"0": 20, "1": 40, "2": 100, "3": 1000},
-          "steps_min": 1,
-          "steps_max": 160,
-          "response": "HOST_ACK"
-        },
-        "mark_closed": {
-          "frame_type": 17,
-          "command": 54,
-          "payload_length": 8,
-          "full_frame_length": 24,
-          "payload_layout": "36 02 close_dir 00 00 00 00 00",
-          "axis_fixed": 2,
-          "close_dir_values": [0, 1],
-          "hardware_qualification": "protocol_only_not_exercised",
-          "response": "HOST_ACK"
-        },
-        "get_motor_status": {
-          "frame_type": 17,
-          "command": 55,
-          "payload_length": 8,
-          "full_frame_length": 24,
-          "payload_hex": "37 00 00 00 00 00 00 00",
-          "responses": ["HOST_ACK", "MOTION_STATUS"]
-        },
-        "get_temperatures": {
-          "frame_type": 5,
-          "command": 41,
-          "payload_length": 4,
-          "full_frame_length": 20,
-          "payload_hex": "29 00 00 00",
-          "ack_sent": false,
-          "response": "TEMPERATURE_RESPONSE"
-        }
-      }
-    },
-    "responses": {
-      "type": "object",
-      "const": {
-        "host_ack": {
-          "frame_type": 6,
-          "payload_length": 8,
-          "full_frame_length": 24,
-          "byte_offsets": {
-            "ok": 14,
-            "command": 15,
-            "status": 16,
-            "detail": 17,
-            "state_hash16": [18, 19],
-            "response_type": 20,
-            "result_flags": 21,
-            "crc": [22, 23]
-          },
-          "state_hash16": {
-            "algorithm": "CRC-16/CCITT-FALSE",
-            "encoding": "u16_le",
-            "input_order": ["PTC1..24", "FAN1..4", "solenoid"],
-            "input_bytes": 29
-          },
-          "snapshot_detail_bits": {
-            "x_busy": 0,
-            "y_busy": 1,
-            "z_busy": 2,
-            "x_position_invalid": 3,
-            "y_position_invalid": 4,
-            "z_position_invalid": 5
-          },
-          "snapshot_result_flag_bits": {
-            "synchronous_outputs_committed": 0,
-            "x_accepted_or_noop": 1,
-            "y_accepted_or_noop": 2,
-            "z_accepted_or_noop": 3
-          },
-          "get_status_detail_bits": {
-            "disabled": 0,
-            "watchdog_timeout": 1
-          },
-          "status_codes": {
-            "OK": 0,
-            "UNSUPPORTED_IN_PROFILE": 1,
-            "BAD_FLAGS": 2,
-            "BAD_LENGTH": 3,
-            "BAD_VALUE": 5,
-            "BUSY": 9,
-            "PARTIAL": 22
-          },
-          "command_response_contracts": {
-            "get_status": {
-              "response_type": 0,
-              "result_flags": 0,
-              "detail_used_bits": [0, 1],
-              "detail_reserved_mask": 252,
-              "reserved_detail_bits_zero": true
-            },
-            "get_motor_status": {
-              "response_type": 18,
-              "result_flags": 8,
-              "detail": 0
-            },
-            "snapshot_ok": {
-              "ok": 1,
-              "status": 0,
-              "detail": 0,
-              "response_type": 0,
-              "result_flags": 15
-            },
-            "snapshot_partial": {
-              "ok": 1,
-              "status": 22,
-              "response_type": 0,
-              "synchronous_outputs_committed_flag_bit": 0,
-              "axis_result_flag_bits": [1, 2, 3],
-              "axis_result_flag_set_iff_not_busy_or_invalid": true,
-              "detail_axis_skip_bits": [0, 1, 2, 3, 4, 5],
-              "detail_reserved_mask": 192,
-              "reserved_detail_bits_zero": true
-            }
-          }
-        },
-        "motion_status": {
-          "frame_type": 18,
-          "payload_length": 10,
-          "full_frame_length": 26,
-          "byte_offsets": {
-            "flags": 14,
-            "valid_mask": 15,
-            "busy_mask": 16,
-            "current_xyz": [17, 19],
-            "target_xyz": [20, 22],
-            "fault_mask": 23,
-            "crc": [24, 25]
-          },
-          "position_values": [0, 100, 254, 255],
-          "intermediate_position": 254,
-          "unknown_position": 255,
-          "flag_bits": {
-            "any_busy": 0,
-            "en_active": 1,
-            "disabled": 2,
-            "watchdog_timeout": 3
-          },
-          "reserved_flag_mask": 240,
-          "reserved_flag_bits_zero": true
-        },
-        "temperature_response": {
-          "frame_type": 41,
-          "compact_frame": true,
-          "standard_envelope": false,
-          "full_frame_length": 61,
-          "raw_channel_count": 27,
-          "byte_offsets": {
-            "magic": [0, 1],
-            "version": 2,
-            "profile_id": 3,
-            "frame_type": 4,
-            "raw_u16_le": [5, 58],
-            "crc": [59, 60]
-          },
-          "has_seq": false,
-          "has_timestamp": false,
-          "has_payload_length": false,
-          "crc": {
-            "algorithm": "CRC-16/CCITT-FALSE",
-            "encoding": "u16_le",
-            "coverage_offsets": [2, 58]
-          },
-          "device_order": [
-            {
-              "device": "U6",
-              "address_7bit": 73,
-              "channels": ["Local", "Remote1", "Remote2", "Remote3", "Remote4", "Remote5", "Remote6", "Remote7", "Remote8"]
-            },
-            {
-              "device": "U24",
-              "address_7bit": 72,
-              "channels": ["Local", "Remote1", "Remote2", "Remote3", "Remote4", "Remote5", "Remote6", "Remote7", "Remote8"]
-            },
-            {
-              "device": "U25",
-              "address_7bit": 75,
-              "channels": ["Local", "Remote1", "Remote2", "Remote3", "Remote4", "Remote5", "Remote6", "Remote7", "Remote8"]
-            }
-          ],
-          "invalid_raw": 65535,
-          "celsius_formula": "int16(raw)/128.0"
-        }
-      }
-    },
-    "programming": {
-      "type": "object",
-      "const": {
-        "operation": "PROGRAM_SRAM",
-        "speed_hz": 200000,
-        "attempt_limit": 1,
-        "automatic_retry": false,
-        "flash_allowed": false
-      }
-    },
-    "safety": {
-      "type": "object",
-      "const": {
-        "ptc_actuation_allowed": false,
-        "watchdog_timeout_seconds": 5,
-        "safe_state": {
-          "ptc_percent": 0,
-          "fan_percent": [30, 30, 30, 30],
-          "solenoid": 0,
-          "solenoid_p5_level": 0,
-          "solenoid_effect": "intake_open",
-          "step_all_low": true,
-          "en_n_high": true
-        },
-        "reset_applies_safe_state": true,
-        "disable_applies_safe_state": true,
-        "watchdog_applies_safe_state": true
-      }
-    }
-  },
-  "additionalProperties": false
-}

+ 703 - 0
schemas/prod2u_p4_normal_host_contract_v4.schema.json

@@ -0,0 +1,703 @@
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema",
+  "$id": "prod2u-p4-normal-host-contract-v4",
+  "title": "Prod2U Profile 4 Normal actuator-trace host contract v4",
+  "type": "object",
+  "required": [
+    "schema",
+    "profile",
+    "protocol",
+    "host_compatibility",
+    "transport",
+    "standard_frame",
+    "boot_build_id",
+    "capability_registry",
+    "commands",
+    "responses",
+    "unsupported_commands",
+    "programming",
+    "safety"
+  ],
+  "properties": {
+    "schema": {
+      "const": "prod2u-p4-normal-host-contract-v4"
+    },
+    "profile": {
+      "const": "prod2u-p4-normal-actuator-trace-binary921-v3"
+    },
+    "protocol": {
+      "const": "binary921-v3"
+    },
+    "host_compatibility": {
+      "type": "object",
+      "const": {
+        "minimum_contract": "v4",
+        "legacy_v3_compatible": false,
+        "incompatibility_reason": "unsolicited_trace_event_frames"
+      }
+    },
+    "transport": {
+      "type": "object",
+      "const": {
+        "port": "COM5",
+        "baud": 921600,
+        "data_bits": 8,
+        "parity": "N",
+        "stop_bits": 1,
+        "format": "8N1",
+        "external_level": "RS232",
+        "dtr": false,
+        "rts": false
+      }
+    },
+    "standard_frame": {
+      "type": "object",
+      "const": {
+        "magic_hex": "A5 5A",
+        "version": 2,
+        "profile_id": 4,
+        "header_bytes": 14,
+        "trailer_crc_bytes": 2,
+        "offsets": {
+          "magic": [0, 1],
+          "version": 2,
+          "profile_id": 3,
+          "frame_type": 4,
+          "seq": [5, 8],
+          "timestamp": [9, 12],
+          "payload_length": 13,
+          "payload_start": 14,
+          "crc": "after_payload"
+        },
+        "seq_required": 0,
+        "timestamp_required": 0,
+        "strict_validation": {
+          "magic": true,
+          "version": true,
+          "profile": true,
+          "frame_type": true,
+          "exact_length": true,
+          "crc": true,
+          "nonzero_seq_rejected": true,
+          "nonzero_timestamp_rejected": true,
+          "replay_cache": false,
+          "duplicate_tracking": false,
+          "conflict_tracking": false
+        },
+        "crc": {
+          "algorithm": "CRC-16/CCITT-FALSE",
+          "polynomial": 4129,
+          "initial": 65535,
+          "reflect_input": false,
+          "reflect_output": false,
+          "xor_out": 0,
+          "encoding": "u16_le",
+          "coverage_start_offset": 2,
+          "coverage_end": "final_payload_byte"
+        }
+      }
+    },
+    "boot_build_id": {
+      "type": "object",
+      "const": {
+        "frame_type": 4,
+        "payload_length": 8,
+        "full_frame_length": 24,
+        "build_id_offsets": [14, 17],
+        "build_id_encoding": "u32_le",
+        "capability_offsets": [18, 21],
+        "capability": 8095,
+        "capability_wire_le": "9F 1F 00 00",
+        "announcement_count": 1,
+        "ready_semantics": false,
+        "gates_first_command": false,
+        "startup_epoch_order": {
+          "collector_active_before_program_sram": true,
+          "host_sends_disable_without_waiting": true,
+          "allowed_boot_window": "PROGRAM_SRAM_START_TO_FIRST_DISABLE_COMMAND_RESULT",
+          "required_prefix": ["BOOT_BUILD_ID", "EPOCH"],
+          "boot_count": 1,
+          "epoch_count": 1,
+          "epoch_event_seq": 1,
+          "late_boot_policy": "FATAL_SEND_DISABLE_ONCE_AND_TERMINATE"
+        }
+      }
+    },
+    "capability_registry": {
+      "type": "object",
+      "const": {
+        "TRACE_EVENT_V1": {"bit": 4, "mask": 16, "enabled": true},
+        "TEMPERATURE": {"bit": 5, "mask": 32, "enabled": false}
+      }
+    },
+    "commands": {
+      "type": "object",
+      "const": {
+        "set_output_snapshot": {
+          "frame_type": 7,
+          "command": 42,
+          "flags": 0,
+          "payload_length": 34,
+          "full_frame_length": 50,
+          "crc_coverage_offsets": [2, 47],
+          "byte_offsets": {
+            "command": 14,
+            "flags": 15,
+            "ptc": [16, 39],
+            "fan": [40, 43],
+            "solenoid": 44,
+            "x": 45,
+            "y": 46,
+            "z": 47,
+            "crc": [48, 49]
+          },
+          "accepted_values": {
+            "ptc_percent": {"minimum": 0, "maximum": 100},
+            "fan_percent": {"minimum": 0, "maximum": 100},
+            "solenoid": [0, 100],
+            "x": [0, 100],
+            "y": [0, 100],
+            "z": [0, 100]
+          },
+          "invalid_field_rejects_entire_frame": true,
+          "synchronous_outputs": ["PTC1..24", "FAN1..4", "solenoid"],
+          "solenoid_physical_semantics": {
+            "0": "P5_low_deenergized_intake_open",
+            "100": "P5_high_energized_intake_closed"
+          },
+          "hardware_qualified_motor_axes": ["X", "Y"],
+          "protocol_reserved_motor_axes": ["Z"],
+          "protocol_reserved_axis_semantics": {
+            "Z": {
+              "accepted_snapshot_targets": [0, 100],
+              "snapshot_effect": "ACCEPTED_NOOP",
+              "drives_step_dir_enable": false,
+              "busy": false,
+              "position_valid": false,
+              "motion_status_current": 255,
+              "motion_status_target": 255
+            }
+          },
+          "motor_axes_independent": true,
+          "busy_or_invalid_axis_no_queue": true,
+          "response": "HOST_ACK",
+          "cli_warning": "This command always sends X/Y/Z targets; X/Y default 0 requests CLOSED and may start motion, while Z 0/100 is an accepted no-op.",
+          "arms_watchdog_on_accepted": true
+        },
+        "get_status": {
+          "frame_type": 5,
+          "command": 36,
+          "payload_length": 4,
+          "full_frame_length": 20,
+          "payload_hex": "24 00 00 00",
+          "response": "HOST_ACK",
+          "refreshes_watchdog": false
+        },
+        "disable": {
+          "frame_type": 5,
+          "command": 38,
+          "payload_length": 4,
+          "full_frame_length": 20,
+          "payload_hex": "26 00 00 00",
+          "response": "HOST_ACK",
+          "applies_safe_state": true
+        },
+        "jog": {
+          "frame_type": 17,
+          "command": 53,
+          "payload_length": 8,
+          "full_frame_length": 24,
+          "payload_layout": "35 axis raw_dir speed_code steps_u16_le 00 00",
+          "axis_codes": {"X": 0, "Y": 1},
+          "unsupported_axis_codes": {"Z": 2},
+          "unsupported_axis_status": "BAD_VALUE",
+          "raw_dir_values": [0, 1],
+          "speed_step_per_s": {"0": 20, "1": 40, "2": 100, "3": 1000},
+          "steps_min": 1,
+          "steps_max": 65535,
+          "arms_watchdog_on_accepted": true,
+          "uncalibrated_jog_policy": {
+            "allowed_raw_dir_values": [0, 1],
+            "requires_limit_fast": 0,
+            "requires_limit_active": 0,
+            "power_on_limit_high_action": "MARK_CLOSED_REQUIRED_BEFORE_MOTION",
+            "static_high_auto_learning_allowed": false,
+            "static_high_jog_allowed": false
+          },
+          "limit_gate": {
+            "requires_limit_ready": true,
+            "uncalibrated_start": {
+              "limit_guard": 0,
+              "limit_fast": 0,
+              "limit_active": 0
+            },
+            "closed_start": {
+              "limit_guard": 1,
+              "limit_fast": 1,
+              "limit_active": 1
+            },
+            "inconsistent_pretrip_status": "BUSY"
+          },
+          "response": "HOST_ACK"
+        },
+        "mark_closed": {
+          "frame_type": 17,
+          "command": 54,
+          "payload_length": 8,
+          "full_frame_length": 24,
+          "payload_layout": "36 axis close_dir 00 00 00 00 00",
+          "axis_codes": {"X": 0, "Y": 1},
+          "close_dir_values": [0, 1],
+          "requires_stable_active_limit": true,
+          "requires_idle": true,
+          "requires_limit_ready": true,
+          "requires_limit_fast_high": true,
+          "requires_limit_confirmed_high": true,
+          "current_closed_evidence": "limit_fast_and_limit_active",
+          "first_registration_effect": "CLOSED_DISTANCE_ZERO_CLOSE_DIR_VALID",
+          "same_direction_repeat": "OK_IDEMPOTENT_ZERO_MOTION",
+          "opposite_direction_status": "BAD_VALUE",
+          "busy_status": "BUSY",
+          "rejection_changes_state": false,
+          "arms_watchdog_on_accepted": true,
+          "response": "HOST_ACK"
+        },
+        "get_motor_status": {
+          "frame_type": 17,
+          "command": 55,
+          "payload_length": 8,
+          "full_frame_length": 24,
+          "payload_hex": "37 00 00 00 00 00 00 00",
+          "responses": ["HOST_ACK", "MOTION_STATUS"],
+          "refreshes_watchdog": true,
+          "watchdog_refresh": {
+            "requires_valid_command": true,
+            "requires_already_armed": true,
+            "requires_disabled_false": true,
+            "requires_watchdog_timeout_false": true,
+            "can_arm_watchdog": false,
+            "can_clear_disabled": false,
+            "can_clear_watchdog_timeout": false
+          }
+        }
+      }
+    },
+    "responses": {
+      "type": "object",
+      "const": {
+        "host_ack": {
+          "frame_type": 6,
+          "payload_length": 8,
+          "full_frame_length": 24,
+          "byte_offsets": {
+            "ok": 14,
+            "command": 15,
+            "status": 16,
+            "detail": 17,
+            "state_hash16": [18, 19],
+            "response_type": 20,
+            "result_flags": 21,
+            "crc": [22, 23]
+          },
+          "state_hash16": {
+            "algorithm": "CRC-16/CCITT-FALSE",
+            "encoding": "u16_le",
+            "input_order": ["PTC1..24", "FAN1..4", "solenoid"],
+            "input_bytes": 29
+          },
+          "snapshot_detail_bits": {
+            "x_busy": 0,
+            "y_busy": 1,
+            "z_busy": 2,
+            "x_position_invalid": 3,
+            "y_position_invalid": 4,
+            "z_position_invalid": 5
+          },
+          "snapshot_result_flag_bits": {
+            "synchronous_outputs_committed": 0,
+            "x_accepted_or_noop": 1,
+            "y_accepted_or_noop": 2,
+            "z_accepted_or_noop": 3
+          },
+          "get_status_detail_bits": {
+            "disabled": 0,
+            "watchdog_timeout": 1
+          },
+          "status_codes": {
+            "OK": 0,
+            "UNSUPPORTED_IN_PROFILE": 1,
+            "BAD_FLAGS": 2,
+            "BAD_LENGTH": 3,
+            "BAD_VALUE": 5,
+            "BUSY": 9,
+            "PARTIAL": 22
+          },
+          "command_response_contracts": {
+            "get_status": {
+              "response_type": 0,
+              "result_flags": 0,
+              "detail_used_bits": [0, 1],
+              "detail_reserved_mask": 252,
+              "reserved_detail_bits_zero": true
+            },
+            "get_motor_status": {
+              "response_type": 18,
+              "result_flags": 8,
+              "detail": 0
+            },
+            "snapshot_ok": {
+              "ok": 1,
+              "status": 0,
+              "detail": 0,
+              "response_type": 0,
+              "result_flags": 15
+            },
+            "snapshot_partial": {
+              "ok": 1,
+              "status": 22,
+              "response_type": 0,
+              "synchronous_outputs_committed_flag_bit": 0,
+              "axis_result_flag_bits": [1, 2, 3],
+              "axis_result_flag_set_iff_not_busy_or_invalid": true,
+              "detail_axis_skip_bits": [0, 1, 2, 3, 4, 5],
+              "detail_reserved_mask": 192,
+              "reserved_detail_bits_zero": true
+            }
+          }
+        },
+        "motion_status": {
+          "frame_type": 18,
+          "payload_length": 10,
+          "full_frame_length": 26,
+          "byte_offsets": {
+            "flags": 14,
+            "valid_mask": 15,
+            "busy_mask": 16,
+            "current_xyz": [17, 19],
+            "target_xyz": [20, 22],
+            "fault_mask": 23,
+            "crc": [24, 25]
+          },
+          "position_values": [0, 100, 254, 255],
+          "intermediate_position": 254,
+          "unknown_position": 255,
+          "flag_bits": {
+            "any_busy": 0,
+            "en_active": 1,
+            "disabled": 2,
+            "watchdog_timeout": 3
+          },
+          "fail_closed_invariants": {
+            "any_busy_equals_busy_mask_nonzero": true,
+            "disabled_requires_en_active_zero": true,
+            "watchdog_timeout_requires_disabled": true,
+            "z_busy_valid_fault_zero": true,
+            "z_current_unknown": 255,
+            "z_target_unknown": 255
+          },
+          "reserved_flag_mask": 240,
+          "reserved_flag_bits_zero": true
+        },
+        "trace_event": {
+          "frame_type": 15,
+          "payload_length": 18,
+          "full_frame_length": 34,
+          "byte_offsets": {
+            "event_seq_u32_le": [14, 17],
+            "event_type": 18,
+            "source": 19,
+            "meta_u16_le": [20, 21],
+            "data_u64_le": [22, 29],
+            "state_hash16_u16_le": [30, 31],
+            "crc": [32, 33]
+          },
+          "event_types": {
+            "EPOCH": 1,
+            "COMMAND_RESULT": 2,
+            "CORE_STATE": 3,
+            "AXIS_STATE": 4,
+            "LIMIT_STATE": 5,
+            "SAFETY_STATE": 6,
+            "OVERFLOW": 7
+          },
+          "event_seq_initial": 1,
+          "event_seq_wraps_to": 1,
+          "command_order": ["COMMAND_RESULT", "HOST_ACK", "FOLLOW_UP"],
+          "pre_command_result_policy": {
+            "continuous_crc_valid_trace": "ACCEPT_AS_ASYNC_BACKLOG",
+            "boot_build_id": "FATAL",
+            "host_ack": "FATAL",
+            "other_followup": "FATAL"
+          },
+          "post_completion_quiet_drain": {
+            "quiet_window_ms": 10,
+            "hard_deadline_ms": 50,
+            "accepted_trace_types": [
+              "CORE_STATE",
+              "AXIS_STATE",
+              "LIMIT_STATE",
+              "SAFETY_STATE"
+            ],
+            "unexpected_frame_policy": "FATAL_SEND_DISABLE_ONCE_AND_TERMINATE",
+            "final_session_drain_required": true,
+            "failure_rx_journal_required": true
+          },
+          "artifact_evidence": {
+            "schema": "schemas/trace-events.schema.json",
+            "strict_layout_validation": true,
+            "continuous_sequence_validation": true,
+            "exact_serial_transcript_replay_equality": true,
+            "rehash_without_equality_rejected": true
+          },
+          "command_result_binding": {
+            "source": "request_frame_type",
+            "meta": "request_wire_crc16",
+            "data": "complete_host_ack_payload_u64_le"
+          },
+          "event_layouts": {
+            "EPOCH": {
+              "layout_version": 1,
+              "source": 0,
+              "meta": 0,
+              "data_fields": {
+                "build_id_u32": [0, 31],
+                "capability_u32": [32, 63]
+              },
+              "boot_identity_binding_required": true,
+              "state_hash16": "live_synchronous_output_state_hash_at_event_attempt"
+            },
+            "CORE_STATE": {
+              "layout_version": 1,
+              "source": 0,
+              "meta": "data[15:0]",
+              "data_fields": {"core_state_hash16": [0, 15]},
+              "reserved_data_bits_zero": [16, 63],
+              "event_state_hash_may_differ_from_data": true,
+              "state_hash16": "live_synchronous_output_state_hash_at_event_attempt"
+            },
+            "AXIS_STATE": {
+              "layout_version": 1,
+              "terminal_only": true,
+              "source_codes": {"X": 1, "Y": 2},
+              "meta_bits": {
+                "requested_dir": 0,
+                "live_dir": 1,
+                "close_dir": 2,
+                "close_dir_valid": 3,
+                "speed_code": [4, 5],
+                "limit_fast": 6,
+                "limit_active": 7,
+                "limit_ready": 8,
+                "busy": 9,
+                "drive_active": 10,
+                "fault": 11,
+                "position_valid": 12,
+                "recovery_segment": 13,
+                "layout_version": [14, 15]
+              },
+              "data_bits": {
+                "requested_steps_u16": [0, 15],
+                "completed_steps_u16": [16, 31],
+                "distance_steps_u16": [32, 47],
+                "stop_reason_u8": [48, 55],
+                "axis_state": [56, 58],
+                "move_kind": [59, 60],
+                "distance_valid": 61,
+                "distance_saturated": 62,
+                "terminal": 63
+              },
+              "axis_state_codes": {
+                "UNCALIBRATED": 0,
+                "CLOSED": 1,
+                "OPENING": 2,
+                "OPEN": 3,
+                "CLOSING": 4,
+                "INTERMEDIATE": 5,
+                "RECOVERY": 6,
+                "LOCKED_FAULT": 7
+              },
+              "move_kind_codes": {"IDLE": 0, "STANDARD": 1, "JOG": 2},
+              "reserved_move_kind_codes": [3],
+              "stop_reason_codes": {
+                "NONE": 0,
+                "REQUEST_COMPLETE": 1,
+                "LIMIT_CONFIRMED": 2,
+                "FAST_TRIP_UNCONFIRMED": 3,
+                "DISABLE": 4,
+                "WATCHDOG": 5,
+                "LOCKED_FAULT": 6,
+                "REVERSED_TO_CLOSE": 7,
+                "RELEASE_TIMEOUT": 8,
+                "ALREADY_CLOSED": 9,
+                "MARK_CLOSED": 10,
+                "HARD_SAFE": 11
+              },
+              "invariants": {
+                "terminal_bit": 1,
+                "stop_reason_none_invalid": true,
+                "completed_steps_lte_requested_steps": true,
+                "state_hash16": "current_synchronous_output_state_hash"
+              }
+            },
+            "LIMIT_STATE": {
+              "layout_version": 1,
+              "source": 3,
+              "meta": 0,
+              "data_bits": {
+                "y_fast": 0,
+                "x_fast": 1,
+                "y_active": 2,
+                "x_active": 3,
+                "y_ready": 4,
+                "x_ready": 5
+              },
+              "reserved_data_bits_zero": [6, 63],
+              "state_hash16": "current_synchronous_output_state_hash"
+            },
+            "SAFETY_STATE": {
+              "layout_version": 1,
+              "source": 0,
+              "meta": 0,
+              "data_bits": {
+                "disabled": 0,
+                "watchdog_timeout": 1,
+                "trace_hard_safe": 2,
+                "trace_scheduler_fault": 3
+              },
+              "reserved_data_bits_zero": [4, 63],
+              "state_hash16": "current_synchronous_output_state_hash"
+            },
+            "OVERFLOW": {
+              "layout_version": 1,
+              "source": 0,
+              "meta": 0,
+              "first_lost_event_seq_u32": [0, 31],
+              "first_lost_event_seq_nonzero": true,
+              "reserved_data_bits_zero": [32, 63],
+              "state_hash16": "live_synchronous_output_state_hash_at_event_attempt"
+            }
+          }
+        }
+      }
+    },
+    "unsupported_commands": {
+      "type": "object",
+      "const": {
+        "0x29": {
+          "request_payload_hex": "29 00 00 00",
+          "status": "UNSUPPORTED_IN_PROFILE",
+          "status_code": 1,
+          "ack_ok": false,
+          "detail": 0,
+          "response_type": 0,
+          "result_flags": 0,
+          "changes_state": false,
+          "arms_watchdog": false,
+          "refreshes_watchdog": false,
+          "trace_event": "COMMAND_RESULT"
+        }
+      }
+    },
+    "programming": {
+      "type": "object",
+      "const": {
+        "operation": "PROGRAM_SRAM",
+        "speed_hz": 200000,
+        "attempt_limit": 1,
+        "automatic_retry": false,
+        "flash_allowed": false
+      }
+    },
+    "safety": {
+      "type": "object",
+      "const": {
+        "protocol_ptc_direct_control_allowed": true,
+        "protocol_ptc_percent_range": [0, 100],
+        "hardware_gate_ptc_heating_allowed": false,
+        "hardware_gate_requires_ptc_load_disabled": true,
+        "local_temperature_feedback_available": false,
+        "local_overtemperature_protection_available": false,
+        "immediate_step_truncation_sources": [
+          "DISABLE_OR_EMERGENCY_DISABLE",
+          "WATCHDOG_EXPIRY",
+          "TRACE_INTEGRITY_HARD_SAFE_OR_SCHEDULER_FAULT"
+        ],
+        "watchdog_timeout_seconds": 5,
+        "watchdog_expiry_refresh_same_cycle_priority": "EXPIRY",
+        "per_axis_calibration_policy": {
+          "axes": ["X", "Y"],
+          "command_and_motion_independence": "PER_AXIS",
+          "same_direction_unconfirmed_learning": "PRESERVE",
+          "reverse_direction_unconfirmed_learning": "CANCEL_AND_ACCEPT",
+          "peer_drive_overlap_unconfirmed_learning": "CANCEL_BOTH_AND_ACCEPT",
+          "cancel_vs_confirm_priority": "CANCEL",
+          "canceled_fast_trip": "STOP_WITHOUT_LEARNING",
+          "canceled_confirmed_limit": "LIMIT_CONFIRMED_KEEP_UNCALIBRATED_NO_FAULT",
+          "multi_axis_snapshot_policy": "PER_AXIS_ACCEPTED_BUSY_INVALID_WITH_PARTIAL"
+        },
+        "standard_motion_policy": {
+          "standard_target_state_table": {
+            "UNCALIBRATED": {"OPEN": "INVALID", "CLOSE": "INVALID"},
+            "CLOSED": {"OPEN": "START_OPENING", "CLOSE": "IDEMPOTENT"},
+            "OPENING": {"OPEN": "IDEMPOTENT", "CLOSE": "SAFE_REVERSE_TO_CLOSING"},
+            "OPEN": {"OPEN": "IDEMPOTENT", "CLOSE": "START_CLOSING"},
+            "CLOSING": {"OPEN": "BUSY_CONTINUE_CLOSING", "CLOSE": "IDEMPOTENT"},
+            "INTERMEDIATE": {"OPEN": "INVALID", "CLOSE": "START_CLOSING"},
+            "RECOVERY": {"OPEN": "BUSY", "CLOSE": "BUSY"},
+            "LOCKED_FAULT": {"OPEN": "INVALID", "CLOSE": "INVALID"}
+          },
+          "safe_reverse": "COMPLETE_STEP_LOW_SWITCH_DIR_WAIT_1MS_THEN_CLOSE",
+          "standard_open_steps": 3200,
+          "standard_close_homing_steps": 3200,
+          "recovery_steps": 160,
+          "recovery_speed_steps_per_second": 20,
+          "release_timeout_ms": 4000
+        },
+        "distance_close_policy": {
+          "counter_bits": 16,
+          "valid_unsaturated": "RUN_RECORDED_DISTANCE",
+          "invalid": "RUN_ONE_BOUNDED_3200_STEP_HOMING",
+          "saturated": "REJECT_STANDARD_CLOSE_ALLOW_CLOSE_DIR_JOG",
+          "jog_never_truncated_by_distance": true
+        },
+        "limit_pipeline_policy": {
+          "polarity": "ACTIVE_HIGH",
+          "open_voltage_v": 0.0,
+          "closed_voltage_v": 3.3,
+          "synchronizer_stages": 3,
+          "guard_stage": 2,
+          "fast_stage": 3,
+          "confirm_us": 5000,
+          "fast_trip": "BLOCK_NEXT_RISE_COMPLETE_CURRENT_HIGH_AND_LOW",
+          "unconfirmed_result": "FAST_TRIP_UNCONFIRMED_STOP_WAIT_NEW_COMMAND",
+          "confirmed_learning_requires": [
+            "SAME_AXIS",
+            "SAME_DIR",
+            "STABLE_LOW_START",
+            "REAL_STEP",
+            "FAST_HIGH",
+            "CONFIRMED_HIGH",
+            "NO_REVERSE",
+            "NO_HARD_STOP",
+            "NO_PEER_DRIVE_OVERLAP"
+          ],
+          "canceled_learning_confirmed_result": "LIMIT_CONFIRMED_KEEP_UNCALIBRATED_NO_FAULT",
+          "canceled_learning_unconfirmed_result": "FAST_TRIP_UNCONFIRMED_KEEP_UNCALIBRATED_NO_FAULT"
+        },
+        "safe_state": {
+          "ptc_percent": 0,
+          "fan_percent": [30, 30, 30, 30],
+          "solenoid": 0,
+          "solenoid_p5_level": 0,
+          "solenoid_effect": "intake_open",
+          "step_all_low": true,
+          "en_n_high": true
+        },
+        "reset_applies_safe_state": true,
+        "disable_applies_safe_state": true,
+        "watchdog_applies_safe_state": true
+      }
+    }
+  },
+  "additionalProperties": false
+}

+ 0 - 80
schemas/prod2u_p4_normal_v3_actuator_temp_gate_receipt.schema.json

@@ -1,80 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "prod2u-p4-normal-v3-hardware-session-v1",
-  "type": "object",
-  "additionalProperties": false,
-  "required": [
-    "schema",
-    "status",
-    "profile",
-    "board_id",
-    "build_id",
-    "bitstream_sha256",
-    "core_status",
-    "temperature_status",
-    "serial",
-    "jtag",
-    "stages",
-    "final_safe_state",
-    "safety",
-    "authority_boundary"
-  ],
-  "properties": {
-    "schema": { "const": "prod2u-p4-normal-v3-hardware-session-v1" },
-    "status": { "enum": ["pass", "pass_core_temperature_pending", "fail"] },
-    "profile": { "const": "prod2u-p4-normal-actuator-temp-binary921-v3" },
-    "board_id": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$" },
-    "build_id": { "type": "string", "pattern": "^[0-9A-F]{8}$" },
-    "bitstream_sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
-    "core_status": { "enum": ["pass", "fail"] },
-    "temperature_status": { "enum": ["pass", "not_run_bus_unconfirmed", "fail"] },
-    "serial": {
-      "const": { "port": "COM5", "baud": 921600, "format": "8N1" }
-    },
-    "jtag": {
-      "type": "object",
-      "additionalProperties": false,
-      "required": ["operation", "speed_hz", "attempt_count", "retry_count"],
-      "properties": {
-        "operation": { "const": "PROGRAM_SRAM" },
-        "speed_hz": { "const": 200000 },
-        "attempt_count": { "enum": [0, 1] },
-        "retry_count": { "const": 0 }
-      }
-    },
-    "stages": {
-      "type": "array",
-      "minItems": 1,
-      "items": {
-        "type": "object",
-        "additionalProperties": false,
-        "required": ["name", "status"],
-        "properties": {
-          "name": { "type": "string", "minLength": 1 },
-          "status": { "enum": ["pass", "fail", "not_run"] },
-          "reason": { "type": "string" },
-          "details": { "type": "object" },
-          "artifact": { "type": "string" }
-        }
-      }
-    },
-    "final_safe_state": {
-      "const": {
-        "ptc_percent": 0,
-        "fan_percent": [30, 30, 30, 30],
-        "solenoid_percent": 0,
-        "step_all_low": true,
-        "en_n_high": true
-      }
-    },
-    "safety": {
-      "const": {
-        "flash_attempted": false,
-        "driver_install_attempted": false,
-        "ptc_heating_attempted": false,
-        "z_motion_attempted": false
-      }
-    },
-    "authority_boundary": { "type": "string", "minLength": 40 }
-  }
-}

+ 483 - 0
schemas/prod2u_p4_normal_v3_actuator_trace_hardware_session.schema.json

@@ -0,0 +1,483 @@
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema",
+  "$id": "prod2u-p4-normal-v3-actuator-trace-hardware-session-v1",
+  "type": "object",
+  "additionalProperties": false,
+  "required": [
+    "schema",
+    "status",
+    "profile",
+    "board_id",
+    "commit",
+    "build_id",
+    "artifacts",
+    "serial",
+    "jtag",
+    "trace",
+    "wire_order",
+    "axes",
+    "partial",
+    "watchdog",
+    "counterparty",
+    "stages",
+    "final_disable",
+    "prohibited_actions",
+    "authority_boundary"
+  ],
+  "properties": {
+    "schema": { "const": "prod2u-p4-normal-v3-actuator-trace-hardware-session-v1" },
+    "status": { "enum": ["pass", "fail"] },
+    "failures": {
+      "type": "array",
+      "minItems": 1,
+      "uniqueItems": true,
+      "items": { "type": "string", "minLength": 1 }
+    },
+    "profile": { "const": "prod2u-p4-normal-actuator-trace-binary921-v3" },
+    "board_id": { "$ref": "#/$defs/boardId" },
+    "commit": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
+    "build_id": { "type": "string", "pattern": "^[0-9A-F]{8}$" },
+    "artifacts": {
+      "type": "object",
+      "additionalProperties": false,
+      "required": [
+        "build_info_sha256",
+        "bitstream_sha256",
+        "td_receipt_sha256",
+        "serial_transcript_sha256",
+        "trace_sha256",
+        "register_checkpoint_sha256"
+      ],
+      "properties": {
+        "build_info_sha256": { "$ref": "#/$defs/sha256" },
+        "bitstream_sha256": { "$ref": "#/$defs/sha256" },
+        "td_receipt_sha256": { "$ref": "#/$defs/sha256" },
+        "serial_transcript_sha256": { "$ref": "#/$defs/sha256" },
+        "trace_sha256": { "$ref": "#/$defs/sha256" },
+        "register_checkpoint_sha256": { "$ref": "#/$defs/sha256" }
+      }
+    },
+    "serial": { "const": { "port": "COM5", "baud": 921600, "format": "8N1" } },
+    "jtag": {
+      "type": "object",
+      "additionalProperties": false,
+      "required": [
+        "operation",
+        "speed_hz",
+        "program_sram_attempted",
+        "attempt_count",
+        "retry_count",
+        "flash_attempted"
+      ],
+      "properties": {
+        "operation": { "const": "PROGRAM_SRAM" },
+        "speed_hz": { "const": 200000 },
+        "program_sram_attempted": { "type": "boolean" },
+        "attempt_count": { "enum": [0, 1] },
+        "retry_count": { "const": 0 },
+        "flash_attempted": { "const": false }
+      }
+    },
+    "trace": {
+      "type": "object",
+      "additionalProperties": false,
+      "required": [
+        "status",
+        "first_event_seq",
+        "last_event_seq",
+        "event_count",
+        "continuous_event_seq",
+        "overflow_observed",
+        "command_result_before_ack",
+        "epoch_observed",
+        "layout_versions"
+      ],
+      "properties": {
+        "status": { "enum": ["pass", "fail", "not_run"] },
+        "first_event_seq": { "type": ["integer", "null"], "minimum": 1, "maximum": 4294967295 },
+        "last_event_seq": { "type": ["integer", "null"], "minimum": 1, "maximum": 4294967295 },
+        "event_count": { "type": "integer", "minimum": 0, "maximum": 4294967295 },
+        "continuous_event_seq": { "type": "boolean" },
+        "overflow_observed": { "type": "boolean" },
+        "command_result_before_ack": { "type": "boolean" },
+        "epoch_observed": { "type": "boolean" },
+        "layout_versions": {
+          "const": {
+            "EPOCH": 1,
+            "CORE_STATE": 1,
+            "AXIS_STATE": 1,
+            "LIMIT_STATE": 1,
+            "SAFETY_STATE": 1,
+            "OVERFLOW": 1
+          }
+        }
+      }
+    },
+    "wire_order": {
+      "type": "object",
+      "additionalProperties": false,
+      "required": [
+        "status",
+        "serial_transcript_sha256",
+        "command_count",
+        "trace_event_count",
+        "first_event_seq",
+        "last_event_seq",
+        "commands"
+      ],
+      "properties": {
+        "status": { "enum": ["pass", "fail"] },
+        "serial_transcript_sha256": { "$ref": "#/$defs/sha256" },
+        "command_count": { "type": "integer", "minimum": 0, "maximum": 4294967295 },
+        "trace_event_count": { "type": "integer", "minimum": 0, "maximum": 4294967295 },
+        "first_event_seq": { "type": ["integer", "null"], "minimum": 1, "maximum": 4294967295 },
+        "last_event_seq": { "type": ["integer", "null"], "minimum": 1, "maximum": 4294967295 },
+        "commands": {
+          "type": "array",
+          "items": {
+            "type": "object",
+            "additionalProperties": false,
+            "required": [
+              "event_index",
+              "command",
+              "request_type",
+              "request_crc16",
+              "command_result_event_seq",
+              "response_frame_types",
+              "followup_type"
+            ],
+            "properties": {
+              "event_index": { "type": "integer", "minimum": 0, "maximum": 2147483647 },
+              "command": { "type": "integer", "minimum": 0, "maximum": 255 },
+              "request_type": { "type": "integer", "minimum": 0, "maximum": 255 },
+              "request_crc16": { "type": "integer", "minimum": 0, "maximum": 65535 },
+              "command_result_event_seq": { "type": "integer", "minimum": 1, "maximum": 4294967295 },
+              "response_frame_types": {
+                "type": "array",
+                "minItems": 2,
+                "items": { "type": "integer", "minimum": 0, "maximum": 255 }
+              },
+              "followup_type": { "type": ["integer", "null"], "minimum": 0, "maximum": 255 }
+            }
+          }
+        }
+      }
+    },
+    "axes": {
+      "type": "object",
+      "additionalProperties": false,
+      "required": ["x", "y"],
+      "properties": {
+        "x": { "$ref": "#/$defs/axisX" },
+        "y": { "$ref": "#/$defs/axisY" }
+      }
+    },
+    "partial": {
+      "type": "object",
+      "additionalProperties": false,
+      "required": ["status", "scenarios"],
+      "properties": {
+        "status": { "enum": ["pass", "fail", "not_run"] },
+        "scenarios": {
+          "type": "array",
+          "items": {
+            "type": "object",
+            "additionalProperties": false,
+            "required": ["accepted_axis", "busy_axis", "result"],
+            "properties": {
+              "accepted_axis": { "enum": ["X", "Y"] },
+              "busy_axis": { "enum": ["X", "Y"] },
+              "result": { "const": "PARTIAL" }
+            }
+          }
+        }
+      }
+    },
+    "watchdog": {
+      "type": "object",
+      "additionalProperties": false,
+      "required": ["status", "timeout_ms", "timeline"],
+      "properties": {
+        "status": { "enum": ["pass", "fail", "not_run"] },
+        "timeout_ms": { "const": 5000 },
+        "timeline": {
+          "type": "array",
+          "items": {
+            "type": "object",
+            "additionalProperties": false,
+            "required": ["event", "elapsed_ms"],
+            "properties": {
+              "event": { "enum": ["armed", "motor_status_refresh", "expired", "safe_state_confirmed"] },
+              "elapsed_ms": { "type": "integer", "minimum": 0, "maximum": 2147483647 }
+            }
+          }
+        }
+      }
+    },
+    "counterparty": {
+      "type": "object",
+      "additionalProperties": false,
+      "required": ["kind", "board_id", "uart_endpoint", "jtag_adapter"],
+      "properties": {
+        "kind": { "const": "prod2u-p4-normal-v3-board" },
+        "board_id": { "$ref": "#/$defs/boardId" },
+        "uart_endpoint": { "const": "COM5" },
+        "jtag_adapter": { "const": "AL-Link" }
+      }
+    },
+    "stages": {
+      "type": "array",
+      "minItems": 1,
+      "items": {
+        "type": "object",
+        "additionalProperties": false,
+        "required": ["name", "status"],
+        "properties": {
+          "name": { "type": "string", "minLength": 1 },
+          "status": { "enum": ["pass", "fail", "not_run"] },
+          "reason": { "type": "string" },
+          "details": { "type": "object" },
+          "artifact": { "type": "string" }
+        }
+      }
+    },
+    "final_disable": {
+      "type": "object",
+      "additionalProperties": false,
+      "required": [
+        "attempted",
+        "acknowledged",
+        "state_hash16",
+        "ptc_percent",
+        "fan_percent",
+        "solenoid_percent",
+        "step_all_low",
+        "en_n_high"
+      ],
+      "properties": {
+        "attempted": { "const": true },
+        "acknowledged": { "type": "boolean" },
+        "state_hash16": { "type": "string", "pattern": "^[0-9A-F]{4}$" },
+        "ptc_percent": { "type": "integer", "minimum": 0, "maximum": 100 },
+        "fan_percent": {
+          "type": "array",
+          "minItems": 4,
+          "maxItems": 4,
+          "items": { "type": "integer", "minimum": 0, "maximum": 100 }
+        },
+        "solenoid_percent": { "enum": [0, 100] },
+        "step_all_low": { "type": "boolean" },
+        "en_n_high": { "type": "boolean" }
+      }
+    },
+    "prohibited_actions": {
+      "const": {
+        "flash_attempted": false,
+        "driver_install_attempted": false,
+        "ptc_heating_attempted": false,
+        "retired_sensor_action_attempted": false,
+        "z_motion_attempted": false,
+        "limit_fault_injection_attempted": false,
+        "automatic_retry_attempted": false,
+        "second_program_sram_attempted": false
+      }
+    },
+    "authority_boundary": { "type": "string", "minLength": 80 }
+  },
+  "allOf": [
+    {
+      "if": { "properties": { "status": { "const": "pass" } } },
+      "then": {
+        "properties": {
+          "jtag": {
+            "properties": {
+              "program_sram_attempted": { "const": true },
+              "attempt_count": { "const": 1 }
+            }
+          },
+          "trace": {
+            "properties": {
+              "status": { "const": "pass" },
+              "event_count": { "minimum": 1 },
+              "continuous_event_seq": { "const": true },
+              "overflow_observed": { "const": false },
+              "command_result_before_ack": { "const": true },
+              "epoch_observed": { "const": true }
+            }
+          },
+          "wire_order": {
+            "properties": {
+              "status": { "const": "pass" },
+              "command_count": { "minimum": 1 }
+            }
+          },
+          "partial": { "properties": { "status": { "const": "pass" } } },
+          "watchdog": { "properties": { "status": { "const": "pass" } } },
+          "final_disable": {
+            "properties": {
+              "acknowledged": { "const": true },
+              "ptc_percent": { "const": 0 },
+              "fan_percent": { "const": [30, 30, 30, 30] },
+              "solenoid_percent": { "const": 0 },
+              "step_all_low": { "const": true },
+              "en_n_high": { "const": true }
+            }
+          }
+        }
+      }
+    },
+    {
+      "if": { "properties": { "status": { "const": "fail" } } },
+      "then": { "required": ["failures"] }
+    },
+    {
+      "if": {
+        "properties": {
+          "jtag": { "properties": { "attempt_count": { "const": 0 } } }
+        }
+      },
+      "then": {
+        "properties": {
+          "jtag": { "properties": { "program_sram_attempted": { "const": false } } },
+          "stages": {
+            "contains": {
+              "type": "object",
+              "required": ["name", "status"],
+              "properties": {
+                "name": { "const": "program_sram" },
+                "status": { "const": "not_run" }
+              }
+            }
+          }
+        }
+      }
+    },
+    {
+      "if": {
+        "properties": {
+          "jtag": { "properties": { "attempt_count": { "const": 1 } } }
+        }
+      },
+      "then": {
+        "properties": {
+          "jtag": { "properties": { "program_sram_attempted": { "const": true } } },
+          "stages": {
+            "contains": {
+              "type": "object",
+              "required": ["name", "status"],
+              "properties": {
+                "name": { "const": "program_sram" },
+                "status": { "enum": ["pass", "fail"] }
+              }
+            }
+          }
+        }
+      }
+    }
+  ],
+  "$defs": {
+    "boardId": { "type": "string", "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$" },
+    "sha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
+    "axisBase": {
+      "type": "object",
+      "additionalProperties": false,
+      "required": [
+        "status",
+        "axis",
+        "close_dir",
+        "limit_open_volts",
+        "limit_closed_volts",
+        "limit_active_high",
+        "requested_steps",
+        "emitted_steps",
+        "recovery_steps",
+        "stop_reason",
+        "final_state",
+        "trace_event_seqs",
+        "trace_frames_hex",
+        "distance_steps",
+        "distance_valid",
+        "distance_saturated",
+        "layout_version",
+        "open_to_close_trace_event_seqs",
+        "open_to_close_trace_frames_hex",
+        "checks"
+      ],
+      "properties": {
+        "status": { "enum": ["pass", "fail", "not_run"] },
+        "axis": { "enum": ["X", "Y"] },
+        "close_dir": { "type": ["integer", "null"], "minimum": 0, "maximum": 1 },
+        "limit_open_volts": { "type": ["number", "null"] },
+        "limit_closed_volts": { "type": ["number", "null"] },
+        "limit_active_high": { "type": "boolean" },
+        "requested_steps": { "type": "integer", "minimum": 0, "maximum": 65535 },
+        "emitted_steps": { "type": "integer", "minimum": 0, "maximum": 65695 },
+        "recovery_steps": { "type": "integer", "minimum": 0, "maximum": 160 },
+        "trace_event_seqs": {
+          "type": "array",
+          "minItems": 0,
+          "maxItems": 64,
+          "uniqueItems": true,
+          "items": { "type": "integer", "minimum": 1, "maximum": 4294967295 }
+        },
+        "trace_frames_hex": {
+          "type": "array",
+          "minItems": 0,
+          "maxItems": 64,
+          "items": { "type": "string", "pattern": "^[0-9a-f]{68}$" }
+        },
+        "distance_steps": { "type": "integer", "minimum": 0, "maximum": 65535 },
+        "distance_valid": { "type": "boolean" },
+        "distance_saturated": { "type": "boolean" },
+        "layout_version": { "const": 1 },
+        "open_to_close_trace_event_seqs": {
+          "type": "array",
+          "minItems": 0,
+          "maxItems": 2,
+          "uniqueItems": true,
+          "items": { "type": "integer", "minimum": 1, "maximum": 4294967295 }
+        },
+        "open_to_close_trace_frames_hex": {
+          "type": "array",
+          "minItems": 0,
+          "maxItems": 2,
+          "items": { "type": "string", "pattern": "^[0-9a-f]{68}$" }
+        },
+        "stop_reason": {
+          "enum": [
+            "limit_confirmed",
+            "request_complete",
+            "watchdog",
+            "disable",
+            "locked_fault",
+            "fast_trip_unconfirmed",
+            "command_rejected",
+            "already_closed",
+            "mark_closed",
+            "reversed_to_close",
+            "release_timeout",
+            "hard_safe",
+            "not_run"
+          ]
+        },
+        "final_state": {
+          "enum": ["UNCALIBRATED", "CLOSED", "OPENING", "OPEN", "CLOSING", "INTERMEDIATE", "RECOVERY", "LOCKED_FAULT", "UNKNOWN"]
+        },
+        "checks": {
+          "type": "object",
+          "additionalProperties": false,
+          "required": ["mark_closed", "jog_away", "jog_to_limit", "standard_open_close", "open_to_close"],
+          "properties": {
+            "mark_closed": { "type": "boolean" },
+            "jog_away": { "type": "boolean" },
+            "jog_to_limit": { "type": "boolean" },
+            "standard_open_close": { "type": "boolean" },
+            "open_to_close": { "type": "boolean" }
+          }
+        }
+      }
+    },
+    "axisX": { "allOf": [{ "$ref": "#/$defs/axisBase" }, { "properties": { "axis": { "const": "X" } } }] },
+    "axisY": { "allOf": [{ "$ref": "#/$defs/axisBase" }, { "properties": { "axis": { "const": "Y" } } }] }
+  }
+}

+ 289 - 0
schemas/prod2u_p4_normal_v3_final_gate_receipt.schema.json

@@ -0,0 +1,289 @@
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema",
+  "$id": "prod2u-p4-normal-v3-final-gate-v1",
+  "type": "object",
+  "additionalProperties": false,
+  "required": [
+    "schema", "generated_at", "status", "verification_run_id", "source_state", "commit", "build_id", "build_identity", "bitstream_sha256",
+    "child_receipts", "child_receipt_sha256", "child_receipt_file_sha256", "synthesis_input_binding",
+    "rx_bram_selection_binding", "failures", "safety", "authority_boundary"
+  ],
+  "properties": {
+    "schema": {"const": "prod2u-p4-normal-v3-final-gate-v1"},
+    "generated_at": {"type": "string", "minLength": 1},
+    "status": {"enum": ["pass", "fail"]},
+    "verification_run_id": {"type": ["string", "null"], "pattern": "^[0-9a-f]{32}$"},
+    "source_state": {"type": "object"},
+    "commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
+    "build_id": {"type": ["string", "null"], "pattern": "^[0-9A-F]{8}$"},
+    "build_identity": {
+      "type": "object",
+      "required": ["schema", "build_id", "build_epoch_utc", "generated_at_utc"],
+      "properties": {
+        "schema": {"const": "prod2u-p4-normal-v3-build-identity-v1"},
+        "build_id": {"type": "string", "pattern": "^[0-9A-F]{8}$"},
+        "build_epoch_utc": {"type": "integer", "minimum": 1, "maximum": 4294967295},
+        "generated_at_utc": {"type": "string", "format": "date-time"}
+      },
+      "additionalProperties": false
+    },
+    "bitstream_sha256": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
+    "child_receipts": {
+      "type": "object",
+      "required": ["offline", "td", "td_confirmation", "package"],
+      "properties": {
+        "offline": {"type": "object"},
+        "td": {"type": "object"},
+        "td_confirmation": {"type": "object"},
+        "package": {"type": "object"}
+      },
+      "additionalProperties": false
+    },
+    "child_receipt_sha256": {
+      "type": "object",
+      "required": ["offline", "td", "td_confirmation", "package"],
+      "properties": {
+        "offline": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+        "td": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+        "td_confirmation": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+        "package": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+      },
+      "additionalProperties": false
+    },
+    "child_receipt_file_sha256": {
+      "type": "object",
+      "required": ["offline", "td", "td_confirmation", "package"],
+      "properties": {
+        "offline": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+        "td": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+        "td_confirmation": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+        "package": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+      },
+      "additionalProperties": false
+    },
+    "synthesis_input_binding": {
+      "type": "object",
+      "required": [
+        "status",
+        "resource_baseline",
+        "baseline_td_receipts",
+        "baseline_td_receipt_sha256",
+        "current_synthesis_input_manifest",
+        "resource_variant_artifact_replay",
+        "baseline_only_amend",
+        "failures"
+      ],
+      "properties": {
+        "status": {"enum": ["pass", "fail"]},
+        "resource_baseline": {
+          "type": "object",
+          "additionalProperties": true
+        },
+        "baseline_td_receipts": {
+          "type": "array",
+          "maxItems": 2,
+          "items": {"type": "object"}
+        },
+        "baseline_td_receipt_sha256": {
+          "type": "array",
+          "maxItems": 2,
+          "uniqueItems": true,
+          "items": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+        },
+        "current_synthesis_input_manifest": {
+          "type": "object",
+          "additionalProperties": true
+        },
+        "resource_variant_artifact_replay": {
+          "type": "object",
+          "required": [
+            "method", "status", "commit", "parent_optimized_commit",
+            "parent_optimized_synthesis_input_hash", "changed_files",
+            "canonical_diff_sha256", "artifacts", "proof_artifacts",
+            "parent_structure_gate", "proof_targets", "failures"
+          ],
+          "properties": {
+            "method": {"const": "external_clean_clone_reconstruction"},
+            "status": {"enum": ["pass", "fail"]},
+            "commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
+            "parent_optimized_commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
+            "parent_optimized_synthesis_input_hash": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+            "changed_files": {"type": "array", "minItems": 10, "maxItems": 10},
+            "canonical_diff_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+            "artifacts": {"type": "object", "minProperties": 3},
+            "proof_artifacts": {"type": "object", "minProperties": 10, "maxProperties": 10},
+            "parent_structure_gate": {"type": "object"},
+            "proof_targets": {"type": "array", "minItems": 10, "maxItems": 10},
+            "failures": {"type": "array", "items": {"type": "string"}}
+          },
+          "additionalProperties": true
+        },
+        "baseline_only_amend": {
+          "type": "object",
+          "required": [
+            "schema", "status", "baseline_parent_commit", "reconstruction_bundle_sha256", "final_commit",
+            "allowed_changed_files", "changed_files", "parent_tree_manifest",
+            "parent_tree_sha256", "final_tree_manifest", "final_tree_sha256",
+            "failures"
+          ],
+          "properties": {
+            "schema": {"const": "prod2u-p4-normal-v3-baseline-only-amend-v1"},
+            "status": {"enum": ["pass", "fail"]},
+            "baseline_parent_commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
+            "reconstruction_bundle_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+            "final_commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
+            "allowed_changed_files": {
+              "const": ["config/prod2u_p4_normal_v3_resource_baseline.json"]
+            },
+            "changed_files": {
+              "type": "array",
+              "items": {"type": "string", "minLength": 1},
+              "uniqueItems": true
+            },
+            "parent_tree_manifest": {
+              "type": "object",
+              "propertyNames": {"type": "string", "minLength": 1},
+              "additionalProperties": {"type": "string", "minLength": 1}
+            },
+            "parent_tree_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+            "final_tree_manifest": {
+              "type": "object",
+              "propertyNames": {"type": "string", "minLength": 1},
+              "additionalProperties": {"type": "string", "minLength": 1}
+            },
+            "final_tree_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+            "failures": {"type": "array", "items": {"type": "string"}}
+          },
+          "additionalProperties": false
+        },
+        "failures": {"type": "array", "items": {"type": "string"}}
+      },
+      "additionalProperties": false
+    },
+    "rx_bram_selection_binding": {
+      "type": "object",
+      "required": [
+        "status", "decision_receipt", "decision", "selection", "failures"
+      ],
+      "properties": {
+        "status": {"enum": ["pass", "fail"]},
+        "decision_receipt": {
+          "oneOf": [
+            {"type": "null"},
+            {"$ref": "#/$defs/artifact"}
+          ]
+        },
+        "decision": {
+          "type": "object",
+          "additionalProperties": true
+        },
+        "selection": {
+          "oneOf": [
+            {"type": "null"},
+            {
+              "type": "object",
+              "required": [
+                "rx_storage_variant", "total_bram9k", "selected_synthesis_input_hash"
+              ],
+              "properties": {
+                "rx_storage_variant": {"enum": ["trace_only", "rx_bram"]},
+                "total_bram9k": {"enum": [1, 2]},
+                "selected_synthesis_input_hash": {
+                  "type": "string",
+                  "pattern": "^[0-9a-f]{64}$"
+                }
+              },
+              "additionalProperties": true
+            }
+          ]
+        },
+        "failures": {"type": "array", "items": {"type": "string"}}
+      },
+      "additionalProperties": false
+    },
+    "failures": {"type": "array", "items": {"type": "string"}},
+    "safety": {
+      "const": {"opens_serial": false, "programs_hardware": false, "installs_drivers": false}
+    },
+    "authority_boundary": {"type": "string", "minLength": 40}
+  },
+  "allOf": [
+    {
+      "if": {"properties": {"status": {"const": "pass"}}, "required": ["status"]},
+      "then": {
+        "properties": {
+          "rx_bram_selection_binding": {
+            "properties": {
+              "status": {"const": "pass"},
+              "decision_receipt": {"$ref": "#/$defs/artifact"},
+              "selection": {"type": "object"},
+              "failures": {"maxItems": 0}
+            }
+          },
+          "synthesis_input_binding": {
+            "properties": {
+              "status": {"const": "pass"},
+              "resource_baseline": {
+                "required": [
+                  "schema", "measured_commit", "build_id", "synthesis_input_hash",
+                  "resource_variant", "build_epoch_utc", "generated_at_utc"
+                ],
+                "properties": {
+                  "schema": {"const": "prod2u-p4-normal-v3-resource-baseline-v2"},
+                  "measured_commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
+                  "build_id": {"type": "string", "pattern": "^[0-9A-F]{8}$"},
+                  "synthesis_input_hash": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+                  ,"resource_variant": {"const": "trace_only_pre_optimization"}
+                  ,"build_epoch_utc": {"type": "integer", "minimum": 1, "maximum": 4294967295}
+                  ,"generated_at_utc": {"type": "string", "format": "date-time"}
+                }
+              },
+              "baseline_td_receipts": {"minItems": 2, "maxItems": 2},
+              "baseline_td_receipt_sha256": {"minItems": 2, "maxItems": 2},
+              "current_synthesis_input_manifest": {
+                "required": ["schema", "inputs", "sha256"],
+                "properties": {
+                  "schema": {"const": "prod2u-p4-normal-v3-synthesis-inputs-v1"},
+                  "inputs": {
+                    "type": "object",
+                    "minProperties": 1,
+                    "additionalProperties": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+                  },
+                  "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+                }
+              },
+              "resource_variant_artifact_replay": {
+                "properties": {
+                  "status": {"const": "pass"},
+                  "failures": {"maxItems": 0}
+                }
+              },
+              "baseline_only_amend": {
+                "properties": {
+                  "status": {"const": "pass"},
+                  "changed_files": {
+                    "const": ["config/prod2u_p4_normal_v3_resource_baseline.json"]
+                  },
+                  "failures": {"maxItems": 0}
+                }
+              },
+              "failures": {"maxItems": 0}
+            }
+          }
+        }
+      }
+    }
+  ],
+  "$defs": {
+    "artifact": {
+      "type": "object",
+      "required": ["path", "size", "sha256"],
+      "properties": {
+        "path": {"type": "string", "minLength": 1},
+        "size": {"type": "integer", "minimum": 1},
+        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+      },
+      "additionalProperties": false
+    }
+  }
+}

+ 227 - 2
schemas/prod2u_p4_normal_v3_formal_receipt.schema.json

@@ -5,10 +5,235 @@
   "required": ["schema", "status", "verification_layer", "profile", "targets"],
   "properties": {
     "schema": {"const": "prod2u-p4-normal-v3-formal-receipt-v1"},
-    "status": {"enum": ["pass", "fail", "partial", "skipped", "blocked_missing_tool"]},
+    "status": {"enum": ["pass", "fail", "partial", "skipped", "blocked_missing_tool", "blocked_invalid_work_root"]},
     "verification_layer": {"const": "formal"},
     "profile": {"const": "prod2u_p4_normal_v3"},
-    "targets": {"type": "array"}
+    "toolchain": {"$ref": "#/$defs/formalToolchainEvidence"},
+    "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"},
+    "targets": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": ["name", "status"],
+        "properties": {
+          "name": {"type": "string", "minLength": 1},
+          "status": {"type": "string", "minLength": 1},
+          "tasks": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+          "trace_files": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+          "assertion_count": {"type": "integer", "minimum": 0},
+          "cover_count": {"type": "integer", "minimum": 0},
+          "cover_required": {"type": "boolean"},
+          "cover_hit_count": {"type": "integer", "minimum": 0},
+          "cover_hit_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+          "input_evidence": {"$ref": "#/$defs/formalInputEvidence"},
+          "task_results": {
+            "type": "array",
+            "minItems": 1,
+            "items": {"$ref": "#/$defs/formalTaskResult"}
+          },
+          "evidence_failures": {"type": "array", "items": {"type": "string"}}
+        },
+        "additionalProperties": true
+      }
+    },
+    "safety": {
+      "const": {"opens_serial": false, "programs_hardware": false, "installs_drivers": false}
+    }
+  },
+  "allOf": [
+    {
+      "if": {"properties": {"status": {"const": "pass"}}, "required": ["status"]},
+      "then": {
+        "required": ["safety", "target_manifest", "toolchain"],
+        "properties": {
+          "toolchain": {
+            "properties": {
+              "status": {"const": "pass"},
+              "failures": {"maxItems": 0},
+              "sby": {
+                "properties": {
+                  "status": {"const": "pass"},
+                  "path": {"minLength": 1},
+                  "version": {"minLength": 1},
+                  "failures": {"maxItems": 0}
+                }
+              },
+              "yosys": {
+                "properties": {
+                  "status": {"const": "pass"},
+                  "path": {"minLength": 1},
+                  "version": {"minLength": 1},
+                  "failures": {"maxItems": 0}
+                }
+              },
+              "solvers": {
+                "minItems": 1,
+                "items": {
+                  "properties": {
+                    "status": {"const": "pass"},
+                    "path": {"minLength": 1},
+                    "version": {"minLength": 1},
+                    "failures": {"maxItems": 0}
+                  }
+                }
+              }
+            }
+          },
+          "target_manifest": {
+            "properties": {"status": {"const": "pass"}, "failures": {"maxItems": 0}}
+          },
+          "targets": {
+            "minItems": 1,
+            "items": {
+              "type": "object",
+              "required": [
+                "name", "status", "tasks", "trace_files", "assertion_count", "cover_count",
+                "cover_required", "cover_hit_count", "cover_hit_ids", "input_evidence", "task_results",
+                "evidence_failures"
+              ],
+              "properties": {
+                "status": {"const": "pass"},
+                "assertion_count": {"minimum": 1},
+                "evidence_failures": {"maxItems": 0},
+                "task_results": {
+                  "items": {
+                    "properties": {
+                      "status": {"const": "PASS"},
+                      "evidence_failures": {"maxItems": 0}
+                    }
+                  }
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  ],
+  "$defs": {
+    "formalTaskResult": {
+      "type": "object",
+      "required": [
+        "name", "mode", "status", "status_raw", "status_file", "workdir",
+        "trace_files", "cover_hit_ids", "configured_engines", "observed_engines",
+        "solvers", "compiled_design_json", "compiled_design_sha256",
+        "compiled_assertion_count", "compiled_assertion_ids",
+        "compiled_cover_count", "compiled_cover_ids", "evidence_failures"
+      ],
+      "properties": {
+        "name": {"type": "string", "minLength": 1},
+        "mode": {"type": "string"},
+        "status": {"type": "string", "minLength": 1},
+        "status_raw": {"type": "string"},
+        "status_file": {"type": "string", "minLength": 1},
+        "workdir": {"type": "string", "minLength": 1},
+        "trace_files": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+        "cover_hit_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+        "configured_engines": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+        "observed_engines": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+        "solvers": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+        "compiled_design_json": {"type": "string", "minLength": 1},
+        "compiled_design_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+        "compiled_assertion_count": {"type": "integer", "minimum": 0},
+        "compiled_assertion_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+        "compiled_cover_count": {"type": "integer", "minimum": 0},
+        "compiled_cover_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+        "evidence_failures": {"type": "array", "items": {"type": "string"}}
+      },
+      "allOf": [
+        {
+          "if": {"properties": {"mode": {"const": "cover"}}, "required": ["mode"]},
+          "then": {
+            "properties": {
+              "trace_files": {"minItems": 1},
+              "cover_hit_ids": {"minItems": 1},
+              "compiled_cover_ids": {"minItems": 1}
+            }
+          }
+        },
+        {
+          "if": {"properties": {"mode": {"enum": ["prove", "bmc"]}}, "required": ["mode"]},
+          "then": {
+            "properties": {
+              "compiled_assertion_count": {"minimum": 1},
+              "compiled_assertion_ids": {"minItems": 1}
+            }
+          }
+        },
+        {
+          "if": {"properties": {"mode": {"const": "cover"}}, "required": ["mode"]},
+          "then": {"properties": {"compiled_cover_count": {"minimum": 1}}}
+        }
+      ],
+      "additionalProperties": true
+    },
+    "sha256Path": {
+      "type": "object",
+      "required": ["path", "sha256"],
+      "properties": {
+        "path": {"type": "string"},
+        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+      },
+      "additionalProperties": false
+    },
+    "formalInputEvidence": {
+      "type": "object",
+      "required": ["sby", "sources", "task_engines", "sha256"],
+      "properties": {
+        "sby": {"$ref": "#/$defs/sha256Path"},
+        "sources": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/sha256Path"}},
+        "task_engines": {
+          "type": "object",
+          "minProperties": 1,
+          "additionalProperties": {
+            "type": "array",
+            "minItems": 1,
+            "items": {"type": "string", "minLength": 1},
+            "uniqueItems": true
+          }
+        },
+        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+      },
+      "additionalProperties": false
+    },
+    "formalToolEvidence": {
+      "type": "object",
+      "required": ["name", "path", "sha256", "version", "status", "failures"],
+      "properties": {
+        "name": {"type": "string", "minLength": 1},
+        "path": {"type": "string"},
+        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+        "version": {"type": "string"},
+        "status": {"enum": ["pass", "fail"]},
+        "failures": {"type": "array", "items": {"type": "string"}}
+      },
+      "additionalProperties": true
+    },
+    "formalToolchainEvidence": {
+      "type": "object",
+      "required": ["status", "sby", "yosys", "solvers", "failures"],
+      "properties": {
+        "status": {"enum": ["pass", "fail"]},
+        "sby": {"$ref": "#/$defs/formalToolEvidence"},
+        "yosys": {"$ref": "#/$defs/formalToolEvidence"},
+        "solvers": {"type": "array", "items": {"$ref": "#/$defs/formalToolEvidence"}},
+        "failures": {"type": "array", "items": {"type": "string"}}
+      },
+      "additionalProperties": false
+    },
+    "targetManifestEvidence": {
+      "type": "object",
+      "required": ["schema", "version", "sha256", "layer", "status", "failures"],
+      "properties": {
+        "schema": {"const": "prod2u-p4-verification-target-manifest-v1"},
+        "version": {"const": 1},
+        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+        "layer": {"const": "formal"},
+        "status": {"enum": ["pass", "fail"]},
+        "failures": {"type": "array", "items": {"type": "string"}}
+      },
+      "additionalProperties": true
+    }
   },
   "additionalProperties": true
 }

+ 82 - 3
schemas/prod2u_p4_normal_v3_hdl_sim_receipt.schema.json

@@ -5,11 +5,90 @@
   "required": ["schema", "status", "verification_layer", "profile", "backend", "tests"],
   "properties": {
     "schema": {"const": "prod2u-p4-normal-v3-hdl-sim-receipt-v1"},
-    "status": {"enum": ["pass", "fail", "partial", "skipped", "blocked_missing_tool"]},
+    "status": {"enum": ["pass", "fail", "partial", "skipped", "blocked_missing_tool", "blocked_invalid_work_root"]},
     "verification_layer": {"const": "hdl_sim"},
     "profile": {"const": "prod2u_p4_normal_v3"},
-    "backend": {"const": "icarus"},
-    "tests": {"type": "array"}
+    "backend": {"enum": ["icarus", "verilator", "cocotb", "all"]},
+    "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"},
+    "tests": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "required": ["name", "status"],
+        "properties": {
+          "name": {"type": "string", "minLength": 1},
+          "status": {"type": "string", "minLength": 1}
+        },
+        "additionalProperties": true
+      }
+    },
+    "backend_results": {
+      "type": "object",
+      "properties": {
+        "icarus": {"type": "object"},
+        "verilator": {"type": "object"},
+        "cocotb": {"type": "object"}
+      },
+      "additionalProperties": false
+    },
+    "safety": {
+      "const": {"opens_serial": false, "programs_hardware": false, "installs_drivers": false}
+    }
+  },
+  "allOf": [
+    {
+      "if": {"properties": {"status": {"const": "pass"}}, "required": ["status"]},
+      "then": {
+        "required": ["safety", "target_manifest"],
+        "properties": {
+          "target_manifest": {
+            "properties": {"status": {"const": "pass"}, "failures": {"maxItems": 0}}
+          },
+          "tests": {
+            "minItems": 1,
+            "items": {
+              "type": "object",
+              "required": ["name", "status"],
+              "properties": {"status": {"const": "pass"}}
+            }
+          }
+        }
+      }
+    },
+    {
+      "if": {
+        "properties": {"status": {"const": "pass"}, "backend": {"const": "all"}},
+        "required": ["status", "backend"]
+      },
+      "then": {
+        "required": ["backend_results"],
+        "properties": {
+          "backend_results": {
+            "required": ["icarus", "verilator", "cocotb"],
+            "properties": {
+              "icarus": {"properties": {"status": {"const": "pass"}}, "required": ["status"]},
+              "verilator": {"properties": {"status": {"const": "pass"}}, "required": ["status"]},
+              "cocotb": {"properties": {"status": {"const": "pass"}}, "required": ["status"]}
+            }
+          }
+        }
+      }
+    }
+  ],
+  "$defs": {
+    "targetManifestEvidence": {
+      "type": "object",
+      "required": ["schema", "version", "sha256", "layer", "status", "failures"],
+      "properties": {
+        "schema": {"const": "prod2u-p4-verification-target-manifest-v1"},
+        "version": {"const": 1},
+        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+        "layer": {"enum": ["icarus", "verilator", "cocotb", "all"]},
+        "status": {"enum": ["pass", "fail"]},
+        "failures": {"type": "array", "items": {"type": "string"}}
+      },
+      "additionalProperties": true
+    }
   },
   "additionalProperties": true
 }

+ 321 - 0
schemas/prod2u_p4_normal_v3_offline_gate_receipt.schema.json

@@ -0,0 +1,321 @@
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema",
+  "$id": "prod2u-p4-normal-v3-strict-offline-gate-v1",
+  "type": "object",
+  "additionalProperties": false,
+  "required": ["schema", "status", "verification_run_id", "commit", "source_state", "build_identity", "required_layers", "layers", "failures", "safety"],
+  "properties": {
+    "schema": {"const": "prod2u-p4-normal-v3-strict-offline-gate-v1"},
+    "generated_at": {"type": "string", "minLength": 1},
+    "status": {"enum": ["pass", "fail"]},
+    "verification_run_id": {"type": "string", "pattern": "^[0-9a-f]{32}$"},
+    "commit": {"type": "string", "pattern": "^[0-9a-f]{40}$|^$"},
+    "source_state": {"type": "object"},
+    "build_identity": {
+      "type": ["object", "null"],
+      "required": ["schema", "build_id", "build_epoch_utc", "generated_at_utc"],
+      "properties": {
+        "schema": {"const": "prod2u-p4-normal-v3-build-identity-v1"},
+        "build_id": {"type": "string", "pattern": "^[0-9A-F]{8}$"},
+        "build_epoch_utc": {"type": "integer", "minimum": 1, "maximum": 4294967295},
+        "generated_at_utc": {"type": "string", "format": "date-time"}
+      },
+      "additionalProperties": false
+    },
+    "profile": {"const": "prod2u_p4_normal_v3"},
+    "runtime_profile": {"const": "prod2u-p4-normal-actuator-trace-binary921-v3"},
+    "required_layers": {
+      "type": "array",
+      "prefixItems": [
+        {"const": "source_integrity"},
+        {"const": "unit"},
+        {"const": "hdl_sim"},
+        {"const": "formal"}
+      ],
+      "minItems": 4,
+      "maxItems": 4
+    },
+    "layers": {
+      "type": "object",
+      "required": ["source_integrity", "unit", "hdl_sim", "formal"],
+      "properties": {
+        "source_integrity": {
+          "type": "object",
+          "required": ["status", "returncode", "source_state"],
+          "properties": {
+            "status": {"type": "string"},
+            "returncode": {"type": "integer"},
+            "source_state": {"type": "object"}
+          }
+        },
+        "unit": {
+          "type": "object",
+          "required": ["status", "returncode", "modules"],
+          "properties": {
+            "status": {"type": "string"},
+            "returncode": {"type": "integer"},
+            "modules": {"type": "array", "items": {"type": "string"}}
+          }
+        },
+        "hdl_sim": {"type": "object"},
+        "formal": {"type": "object"}
+      },
+      "additionalProperties": false
+    },
+    "failures": {"type": "array", "items": {"type": "string"}},
+    "work_root": {"type": "string"},
+    "child_receipt_dir": {"type": "string"},
+    "safety": {
+      "type": "object",
+      "required": ["opens_serial", "programs_hardware", "installs_drivers"],
+      "properties": {
+        "opens_serial": {"const": false},
+        "programs_hardware": {"const": false},
+        "installs_drivers": {"const": false}
+      },
+      "additionalProperties": false
+    },
+    "authority_boundary": {"type": "string", "minLength": 40}
+  },
+  "$defs": {
+    "targetManifestEvidence": {
+      "type": "object",
+      "required": ["schema", "version", "sha256", "layer", "status", "failures"],
+      "properties": {
+        "schema": {"const": "prod2u-p4-verification-target-manifest-v1"},
+        "version": {"const": 1},
+        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+        "layer": {"enum": ["unit", "icarus", "verilator", "cocotb", "formal", "all"]},
+        "status": {"const": "pass"},
+        "failures": {"type": "array", "maxItems": 0}
+      },
+      "additionalProperties": true
+    },
+    "sha256Path": {
+      "type": "object",
+      "required": ["path", "sha256"],
+      "properties": {
+        "path": {"type": "string", "minLength": 1},
+        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+      },
+      "additionalProperties": false
+    },
+    "formalInputEvidence": {
+      "type": "object",
+      "required": ["sby", "sources", "task_engines", "sha256"],
+      "properties": {
+        "sby": {"$ref": "#/$defs/sha256Path"},
+        "sources": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/sha256Path"}},
+        "task_engines": {
+          "type": "object",
+          "minProperties": 1,
+          "additionalProperties": {
+            "type": "array",
+            "minItems": 1,
+            "items": {"type": "string", "minLength": 1},
+            "uniqueItems": true
+          }
+        },
+        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+      },
+      "additionalProperties": false
+    },
+    "formalToolEvidence": {
+      "type": "object",
+      "required": ["name", "path", "sha256", "version", "status", "failures"],
+      "properties": {
+        "name": {"type": "string", "minLength": 1},
+        "path": {"type": "string", "minLength": 1},
+        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+        "version": {"type": "string", "minLength": 1},
+        "status": {"const": "pass"},
+        "failures": {"type": "array", "maxItems": 0, "items": {"type": "string"}}
+      },
+      "additionalProperties": true
+    }
+  },
+  "allOf": [
+    {
+      "if": {"properties": {"status": {"const": "pass"}}, "required": ["status"]},
+      "then": {
+        "required": ["generated_at", "profile", "runtime_profile", "work_root", "child_receipt_dir", "authority_boundary"],
+        "properties": {
+          "build_identity": {"type": "object"},
+          "failures": {"maxItems": 0},
+          "layers": {
+            "properties": {
+              "source_integrity": {
+                "properties": {
+                  "status": {"const": "pass"},
+                  "returncode": {"const": 0},
+                  "source_state": {
+                    "required": ["clean"],
+                    "properties": {"clean": {"const": true}}
+                  }
+                }
+              },
+              "unit": {
+                "required": ["target_manifest"],
+                "properties": {
+                  "status": {"const": "pass"},
+                  "returncode": {"const": 0},
+                  "modules": {"minItems": 1},
+                  "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"}
+                }
+              },
+              "hdl_sim": {
+                "required": ["schema", "status", "verification_layer", "profile", "backend", "tests", "backend_results", "target_manifest", "safety"],
+                "properties": {
+                  "schema": {"const": "prod2u-p4-normal-v3-hdl-sim-receipt-v1"},
+                  "status": {"const": "pass"},
+                  "verification_layer": {"const": "hdl_sim"},
+                  "profile": {"const": "prod2u_p4_normal_v3"},
+                  "backend": {"const": "all"},
+                  "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"},
+                  "tests": {
+                    "type": "array",
+                    "minItems": 1,
+                    "items": {
+                      "type": "object",
+                      "required": ["name", "status"],
+                      "properties": {"status": {"const": "pass"}}
+                    }
+                  },
+                  "backend_results": {
+                    "type": "object",
+                    "required": ["icarus", "verilator", "cocotb"],
+                    "properties": {
+                      "icarus": {
+                        "required": ["status", "target_manifest"],
+                        "properties": {
+                          "status": {"const": "pass"},
+                          "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"}
+                        }
+                      },
+                      "verilator": {
+                        "required": ["status", "target_manifest"],
+                        "properties": {
+                          "status": {"const": "pass"},
+                          "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"}
+                        }
+                      },
+                      "cocotb": {
+                        "required": ["status", "target_manifest"],
+                        "properties": {
+                          "status": {"const": "pass"},
+                          "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"}
+                        }
+                      }
+                    },
+                    "additionalProperties": false
+                  },
+                  "safety": {"const": {"opens_serial": false, "programs_hardware": false, "installs_drivers": false}}
+                }
+              },
+              "formal": {
+                "required": ["schema", "status", "verification_layer", "profile", "targets", "toolchain", "target_manifest", "safety"],
+                "properties": {
+                  "schema": {"const": "prod2u-p4-normal-v3-formal-receipt-v1"},
+                  "status": {"const": "pass"},
+                  "verification_layer": {"const": "formal"},
+                  "profile": {"const": "prod2u_p4_normal_v3"},
+                  "toolchain": {
+                    "type": "object",
+                    "required": ["status", "sby", "yosys", "solvers", "failures"],
+                    "properties": {
+                      "status": {"const": "pass"},
+                      "sby": {"$ref": "#/$defs/formalToolEvidence"},
+                      "yosys": {"$ref": "#/$defs/formalToolEvidence"},
+                      "solvers": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/formalToolEvidence"}},
+                      "failures": {"type": "array", "maxItems": 0, "items": {"type": "string"}}
+                    }
+                  },
+                  "target_manifest": {"$ref": "#/$defs/targetManifestEvidence"},
+                  "targets": {
+                    "type": "array",
+                    "minItems": 1,
+                    "items": {
+                      "type": "object",
+                      "required": [
+                        "name", "status", "tasks", "trace_files", "assertion_count",
+                         "cover_count", "cover_required", "cover_hit_count", "cover_hit_ids",
+                         "input_evidence", "task_results", "evidence_failures"
+                      ],
+                      "properties": {
+                        "status": {"const": "pass"},
+                        "tasks": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+                        "trace_files": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+                        "assertion_count": {"type": "integer", "minimum": 1},
+                        "cover_count": {"type": "integer", "minimum": 0},
+                        "cover_required": {"type": "boolean"},
+                        "cover_hit_count": {"type": "integer", "minimum": 0},
+                        "cover_hit_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+                        "input_evidence": {"$ref": "#/$defs/formalInputEvidence"},
+                        "task_results": {
+                          "type": "array",
+                          "minItems": 1,
+                          "items": {
+                            "type": "object",
+                            "required": [
+                               "name", "mode", "status", "status_raw", "status_file", "workdir",
+                               "trace_files", "cover_hit_ids", "configured_engines", "observed_engines",
+                               "solvers", "compiled_design_json", "compiled_design_sha256",
+                               "compiled_assertion_count", "compiled_assertion_ids",
+                               "compiled_cover_count", "compiled_cover_ids", "evidence_failures"
+                            ],
+                            "properties": {
+                              "name": {"type": "string", "minLength": 1},
+                              "mode": {"type": "string"},
+                              "status": {"const": "PASS"},
+                              "status_raw": {"type": "string"},
+                              "status_file": {"type": "string", "minLength": 1},
+                              "workdir": {"type": "string", "minLength": 1},
+                              "trace_files": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+                              "cover_hit_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+                              "configured_engines": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+                              "observed_engines": {"type": "array", "minItems": 1, "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+                              "solvers": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+                              "compiled_design_json": {"type": "string", "minLength": 1},
+                              "compiled_design_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+                              "compiled_assertion_count": {"type": "integer", "minimum": 0},
+                              "compiled_assertion_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+                              "compiled_cover_count": {"type": "integer", "minimum": 0},
+                              "compiled_cover_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+                              "evidence_failures": {"type": "array", "maxItems": 0, "items": {"type": "string"}}
+                            },
+                            "allOf": [
+                              {
+                                "if": {"properties": {"mode": {"enum": ["prove", "bmc"]}}, "required": ["mode"]},
+                                "then": {
+                                  "properties": {
+                                    "compiled_assertion_count": {"minimum": 1},
+                                    "compiled_assertion_ids": {"minItems": 1}
+                                  }
+                                }
+                              },
+                              {
+                                "if": {"properties": {"mode": {"const": "cover"}}, "required": ["mode"]},
+                                "then": {
+                                  "properties": {
+                                    "compiled_cover_count": {"minimum": 1},
+                                    "compiled_cover_ids": {"minItems": 1}
+                                  }
+                                }
+                              }
+                            ]
+                          }
+                        },
+                        "evidence_failures": {"type": "array", "maxItems": 0, "items": {"type": "string"}}
+                      }
+                    }
+                  },
+                  "safety": {"const": {"opens_serial": false, "programs_hardware": false, "installs_drivers": false}}
+                }
+              }
+            }
+          }
+        }
+      }
+    }
+  ]
+}

+ 123 - 0
schemas/prod2u_p4_normal_v3_package_selftest_receipt.schema.json

@@ -0,0 +1,123 @@
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema",
+  "$id": "prod2u-p4-normal-v3-package-selftest-v1",
+  "type": "object",
+  "additionalProperties": false,
+  "required": [
+    "schema", "status", "generated_at", "verification_run_id", "commit", "source_state", "build_id", "build_identity",
+    "bitstream_sha256", "package_dir", "package_info_sha256", "td_receipt_sha256",
+    "td_run_id", "synthesis_input_hash", "package_file_sha256",
+    "package_file_manifest_sha256", "bound_files", "failures", "selftest", "safety"
+  ],
+  "properties": {
+    "schema": {"const": "prod2u-p4-normal-v3-package-selftest-v1"},
+    "status": {"enum": ["pass", "fail"]},
+    "generated_at": {"type": "string", "minLength": 1},
+    "verification_run_id": {"type": "string", "pattern": "^[0-9a-f]{32}$"},
+    "commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
+    "source_state": {"type": "object"},
+    "build_id": {"type": ["string", "null"], "pattern": "^[0-9A-F]{8}$"},
+    "build_identity": {
+      "type": "object",
+      "required": ["schema", "build_id", "build_epoch_utc", "generated_at_utc"],
+      "properties": {
+        "schema": {"const": "prod2u-p4-normal-v3-build-identity-v1"},
+        "build_id": {"type": ["string", "null"], "pattern": "^[0-9A-F]{8}$"},
+        "build_epoch_utc": {"type": ["integer", "null"], "minimum": 1, "maximum": 4294967295},
+        "generated_at_utc": {"type": ["string", "null"], "format": "date-time"}
+      },
+      "additionalProperties": false
+    },
+    "bitstream_sha256": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
+    "package_dir": {"type": "string", "minLength": 1},
+    "package_info_sha256": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
+    "td_receipt_sha256": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
+    "td_run_id": {"type": ["string", "null"], "pattern": "^[0-9a-f]{32}$"},
+    "synthesis_input_hash": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
+    "package_file_sha256": {
+      "type": "object",
+      "minProperties": 1,
+      "propertyNames": {"type": "string", "minLength": 1},
+      "additionalProperties": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+    },
+    "package_file_manifest_sha256": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
+    "bound_files": {
+      "type": "array",
+      "items": {"type": "string", "minLength": 1},
+      "uniqueItems": true
+    },
+    "failures": {"type": "array", "items": {"type": "string"}},
+    "selftest": {
+      "type": "object",
+      "required": [
+        "mode", "external_scripts_executed", "checked_files", "source_bound_files",
+        "file_hash_map_status", "import_probe"
+      ],
+      "properties": {
+        "mode": {"const": "internal_hash_bound_and_import_validation"},
+        "external_scripts_executed": {"const": false},
+        "checked_files": {
+          "type": "array",
+          "items": {"type": "string", "minLength": 1},
+          "uniqueItems": true
+        },
+        "source_bound_files": {
+          "type": "array",
+          "items": {"type": "string", "minLength": 1},
+          "uniqueItems": true
+        },
+        "file_hash_map_status": {"enum": ["pass", "fail"]},
+        "import_probe": {
+          "type": "object",
+          "required": ["status", "returncode"],
+          "properties": {
+            "status": {"enum": ["pass", "fail", "fail_timeout", "not_run"]},
+            "returncode": {"type": ["integer", "null"]},
+            "stdout_tail": {"type": "string"},
+            "stderr_tail": {"type": "string"}
+          },
+          "additionalProperties": false
+        }
+      },
+      "additionalProperties": false
+    },
+    "safety": {
+      "const": {"opens_serial": false, "programs_hardware": false, "installs_drivers": false}
+    }
+  },
+  "allOf": [
+    {
+      "if": {"properties": {"status": {"const": "pass"}}, "required": ["status"]},
+      "then": {
+        "properties": {
+          "build_id": {"type": "string", "pattern": "^[0-9A-F]{8}$"},
+          "build_identity": {
+            "properties": {
+              "build_id": {"type": "string", "pattern": "^[0-9A-F]{8}$"},
+              "build_epoch_utc": {"type": "integer", "minimum": 1, "maximum": 4294967295},
+              "generated_at_utc": {"type": "string", "format": "date-time"}
+            }
+          },
+          "bitstream_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+          "package_info_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+          "td_receipt_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+          "td_run_id": {"type": "string", "pattern": "^[0-9a-f]{32}$"},
+          "synthesis_input_hash": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+          "package_file_manifest_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+          "bound_files": {"minItems": 1},
+          "failures": {"maxItems": 0},
+          "selftest": {
+            "properties": {
+              "checked_files": {"minItems": 1},
+              "source_bound_files": {"minItems": 1},
+              "file_hash_map_status": {"const": "pass"},
+              "import_probe": {
+                "properties": {"status": {"const": "pass"}, "returncode": {"const": 0}}
+              }
+            }
+          }
+        }
+      }
+    }
+  ]
+}

+ 331 - 6
schemas/prod2u_p4_normal_v3_resource_baseline.schema.json

@@ -1,13 +1,32 @@
 {
   "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "prod2u-p4-normal-v3-resource-baseline-v1",
+  "$id": "prod2u-p4-normal-v3-resource-baseline-v2",
   "type": "object",
-  "required": ["schema", "profile", "device", "snapshot_commit", "policy", "samples", "envelope"],
+  "required": [
+    "schema",
+    "profile",
+    "runtime_profile",
+    "device",
+    "status",
+    "policy",
+    "architecture",
+    "rx_bram"
+  ],
   "properties": {
-    "schema": {"const": "prod2u-p4-normal-v3-resource-baseline-v1"},
+    "schema": {"const": "prod2u-p4-normal-v3-resource-baseline-v2"},
     "profile": {"const": "prod2u_p4_normal_v3"},
+    "runtime_profile": {"const": "prod2u-p4-normal-actuator-trace-binary921-v3"},
     "device": {"const": "EF2L45BG256B"},
-    "snapshot_commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
+    "status": {"enum": ["pending_measurement", "measured"]},
+    "measured_commit": {"$ref": "#/$defs/commit"},
+    "synthesis_input_hash": {"$ref": "#/$defs/sha256"},
+    "build_id": {"$ref": "#/$defs/build_id"},
+    "verification_run_id": {"type": "string", "pattern": "^[0-9a-f]{32}$"},
+    "resource_variant": {"const": "trace_only_pre_optimization"},
+    "resource_variant_lineage": {"$ref": "#/$defs/resource_variant_lineage"},
+    "resource_variant_lineage_sha256": {"$ref": "#/$defs/sha256"},
+    "build_epoch_utc": {"type": "integer", "minimum": 1, "maximum": 4294967295},
+    "generated_at_utc": {"type": "string", "format": "date-time"},
     "policy": {
       "type": "object",
       "required": ["mode", "affects_build_status"],
@@ -17,10 +36,316 @@
       },
       "additionalProperties": false
     },
-    "samples": {"type": "array", "minItems": 2},
+    "rx_bram": {
+      "type": "object",
+      "required": ["enabled", "selection", "active_total_bram9k", "reason"],
+      "properties": {
+        "enabled": {"const": false},
+        "selection": {"const": "no_candidate"},
+        "active_total_bram9k": {"const": 1},
+        "reason": {"const": "requires_real_trace_only_and_rx_bram_ab_evidence"}
+      },
+      "additionalProperties": false
+    },
+    "architecture": {
+      "type": "object",
+      "required": ["io", "dsp", "trace_bram9k"],
+      "properties": {
+        "io": {"const": 41},
+        "dsp": {"const": 0},
+        "trace_bram9k": {"const": 1}
+      },
+      "additionalProperties": false
+    },
+    "samples": {
+      "type": "array",
+      "minItems": 2,
+      "maxItems": 2,
+      "uniqueItems": true,
+      "items": {"$ref": "#/$defs/sample"}
+    },
+    "envelope": {"$ref": "#/$defs/envelope"}
+  },
+  "allOf": [
+    {
+      "if": {
+        "properties": {"status": {"const": "pending_measurement"}},
+        "required": ["status"]
+      },
+      "then": {
+        "not": {
+          "anyOf": [
+            {"required": ["measured_commit"]},
+            {"required": ["synthesis_input_hash"]},
+            {"required": ["build_id"]},
+            {"required": ["verification_run_id"]},
+            {"required": ["resource_variant"]},
+            {"required": ["resource_variant_lineage"]},
+            {"required": ["resource_variant_lineage_sha256"]},
+            {"required": ["build_epoch_utc"]},
+            {"required": ["generated_at_utc"]},
+            {"required": ["samples"]},
+            {"required": ["envelope"]}
+          ]
+        }
+      }
+    },
+    {
+      "if": {
+        "properties": {"status": {"const": "measured"}},
+        "required": ["status"]
+      },
+      "then": {
+        "required": [
+          "measured_commit",
+          "synthesis_input_hash",
+          "build_id",
+          "verification_run_id",
+          "resource_variant",
+          "resource_variant_lineage",
+          "resource_variant_lineage_sha256",
+          "build_epoch_utc",
+          "generated_at_utc",
+          "samples",
+          "envelope"
+        ]
+      }
+    }
+  ],
+  "$defs": {
+    "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+    "commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
+    "build_id": {"type": "string", "pattern": "^[0-9A-F]{8}$"},
+    "resource_variant_lineage": {
+      "type": "object",
+      "required": [
+        "method", "status", "commit", "parent_optimized_commit",
+        "parent_optimized_synthesis_input_hash", "changed_files",
+        "canonical_diff_sha256", "artifacts", "proof_artifacts",
+        "parent_structure_gate", "proof_targets", "failures"
+      ],
+      "properties": {
+        "method": {"const": "external_clean_clone_reconstruction"},
+        "status": {"const": "pass"},
+        "commit": {"$ref": "#/$defs/commit"},
+        "parent_optimized_commit": {"$ref": "#/$defs/commit"},
+        "parent_optimized_synthesis_input_hash": {"$ref": "#/$defs/sha256"},
+        "changed_files": {"type": "array", "minItems": 10, "maxItems": 10, "uniqueItems": true},
+        "canonical_diff_sha256": {"$ref": "#/$defs/sha256"},
+        "artifacts": {"type": "object", "minProperties": 3},
+        "proof_artifacts": {"type": "object", "minProperties": 10, "maxProperties": 10},
+        "parent_structure_gate": {"type": "object"},
+        "proof_targets": {"type": "array", "minItems": 10, "maxItems": 10},
+        "failures": {"type": "array", "maxItems": 0}
+      },
+      "additionalProperties": true
+    },
+    "nonnegative_integer": {"type": "integer", "minimum": 0},
+    "positive_number": {"type": "number", "exclusiveMinimum": 0},
+    "resource_values": {
+      "type": "object",
+      "required": ["lut", "reg", "packed_slices", "mslice", "bram", "dsp", "io"],
+      "properties": {
+        "lut": {"$ref": "#/$defs/nonnegative_integer"},
+        "reg": {"$ref": "#/$defs/nonnegative_integer"},
+        "packed_slices": {"$ref": "#/$defs/nonnegative_integer"},
+        "mslice": {"$ref": "#/$defs/nonnegative_integer"},
+        "bram": {"const": 1},
+        "dsp": {"const": 0},
+        "io": {"const": 41}
+      },
+      "additionalProperties": false
+    },
+    "timing_values": {
+      "type": "object",
+      "required": ["fmax_mhz", "worst_setup_slack_ns", "worst_hold_slack_ns"],
+      "properties": {
+        "fmax_mhz": {"$ref": "#/$defs/positive_number"},
+        "worst_setup_slack_ns": {"$ref": "#/$defs/positive_number"},
+        "worst_hold_slack_ns": {"$ref": "#/$defs/positive_number"}
+      },
+      "additionalProperties": false
+    },
+    "hierarchy_values": {
+      "type": "object",
+      "required": ["lut", "seq"],
+      "properties": {
+        "lut": {"$ref": "#/$defs/nonnegative_integer"},
+        "seq": {"$ref": "#/$defs/nonnegative_integer"}
+      },
+      "additionalProperties": false
+    },
+    "hierarchy_sample": {
+      "type": "object",
+      "required": [
+        "u_core",
+        "u_motors",
+        "u_x_axis",
+        "u_y_axis",
+        "u_outputs",
+        "u_trace_buffer",
+        "u_trace_event_builder",
+        "u_trace_scheduler",
+        "u_watchdog",
+        "u_protocol_rx",
+        "u_x_limit",
+        "u_y_limit"
+      ],
+      "propertyNames": {
+        "enum": [
+          "u_core",
+          "u_motors",
+          "u_x_axis",
+          "u_y_axis",
+          "u_outputs",
+          "u_trace_buffer",
+          "u_trace_event_builder",
+          "u_trace_scheduler",
+          "u_watchdog",
+          "u_protocol_rx",
+          "u_x_limit",
+          "u_y_limit"
+        ]
+      },
+      "additionalProperties": {"$ref": "#/$defs/hierarchy_values"}
+    },
+    "sample": {
+      "type": "object",
+      "required": [
+        "build_id",
+        "verification_run_id",
+        "resource_variant",
+        "build_epoch_utc",
+        "generated_at_utc",
+        "commit",
+        "run_id",
+        "work_root",
+        "generated_at",
+        "receipt_sha256",
+        "synthesis_input_hash",
+        "resource_variant_lineage_sha256",
+        "critical_warning_count",
+        "overall",
+        "timing",
+        "hierarchy"
+      ],
+      "properties": {
+        "build_id": {"$ref": "#/$defs/build_id"},
+        "verification_run_id": {"type": "string", "pattern": "^[0-9a-f]{32}$"},
+        "resource_variant": {"const": "trace_only_pre_optimization"},
+        "build_epoch_utc": {"type": "integer", "minimum": 1, "maximum": 4294967295},
+        "generated_at_utc": {"type": "string", "format": "date-time"},
+        "commit": {"$ref": "#/$defs/commit"},
+        "run_id": {"type": "string", "pattern": "^[0-9a-f]{32}$"},
+        "work_root": {"type": "string", "minLength": 1},
+        "generated_at": {"type": "string", "minLength": 1},
+        "receipt_sha256": {"$ref": "#/$defs/sha256"},
+        "synthesis_input_hash": {"$ref": "#/$defs/sha256"},
+        "resource_variant_lineage_sha256": {"$ref": "#/$defs/sha256"},
+        "critical_warning_count": {"const": 0},
+        "overall": {"$ref": "#/$defs/resource_values"},
+        "timing": {"$ref": "#/$defs/timing_values"},
+        "hierarchy": {"$ref": "#/$defs/hierarchy_sample"}
+      },
+      "additionalProperties": false
+    },
+    "numeric_envelope": {
+      "type": "object",
+      "required": ["min", "max"],
+      "properties": {
+        "min": {"$ref": "#/$defs/positive_number"},
+        "max": {"$ref": "#/$defs/positive_number"}
+      },
+      "additionalProperties": false
+    },
+    "integer_envelope": {
+      "type": "object",
+      "required": ["min", "max"],
+      "properties": {
+        "min": {"$ref": "#/$defs/nonnegative_integer"},
+        "max": {"$ref": "#/$defs/nonnegative_integer"}
+      },
+      "additionalProperties": false
+    },
+    "constant_one_envelope": {
+      "type": "object",
+      "required": ["min", "max"],
+      "properties": {"min": {"const": 1}, "max": {"const": 1}},
+      "additionalProperties": false
+    },
+    "constant_zero_envelope": {
+      "type": "object",
+      "required": ["min", "max"],
+      "properties": {"min": {"const": 0}, "max": {"const": 0}},
+      "additionalProperties": false
+    },
+    "constant_io_envelope": {
+      "type": "object",
+      "required": ["min", "max"],
+      "properties": {"min": {"const": 41}, "max": {"const": 41}},
+      "additionalProperties": false
+    },
+    "overall_envelope": {
+      "type": "object",
+      "required": ["lut", "reg", "packed_slices", "mslice", "bram", "dsp", "io"],
+      "properties": {
+        "lut": {"$ref": "#/$defs/integer_envelope"},
+        "reg": {"$ref": "#/$defs/integer_envelope"},
+        "packed_slices": {"$ref": "#/$defs/integer_envelope"},
+        "mslice": {"$ref": "#/$defs/integer_envelope"},
+        "bram": {"$ref": "#/$defs/constant_one_envelope"},
+        "dsp": {"$ref": "#/$defs/constant_zero_envelope"},
+        "io": {"$ref": "#/$defs/constant_io_envelope"}
+      },
+      "additionalProperties": false
+    },
+    "timing_envelope": {
+      "type": "object",
+      "required": ["fmax_mhz", "worst_setup_slack_ns", "worst_hold_slack_ns"],
+      "properties": {
+        "fmax_mhz": {"$ref": "#/$defs/numeric_envelope"},
+        "worst_setup_slack_ns": {"$ref": "#/$defs/numeric_envelope"},
+        "worst_hold_slack_ns": {"$ref": "#/$defs/numeric_envelope"}
+      },
+      "additionalProperties": false
+    },
+    "hierarchy_envelope_values": {
+      "type": "object",
+      "required": ["lut", "seq"],
+      "properties": {
+        "lut": {"$ref": "#/$defs/integer_envelope"},
+        "seq": {"$ref": "#/$defs/integer_envelope"}
+      },
+      "additionalProperties": false
+    },
+    "hierarchy_envelope": {
+      "type": "object",
+      "required": [
+        "u_core",
+        "u_motors",
+        "u_x_axis",
+        "u_y_axis",
+        "u_outputs",
+        "u_trace_buffer",
+        "u_trace_event_builder",
+        "u_trace_scheduler",
+        "u_watchdog",
+        "u_protocol_rx",
+        "u_x_limit",
+        "u_y_limit"
+      ],
+      "propertyNames": {"$ref": "#/$defs/hierarchy_sample/propertyNames"},
+      "additionalProperties": {"$ref": "#/$defs/hierarchy_envelope_values"}
+    },
     "envelope": {
       "type": "object",
-      "required": ["overall", "timing", "hierarchy"]
+      "required": ["overall", "timing", "hierarchy"],
+      "properties": {
+        "overall": {"$ref": "#/$defs/overall_envelope"},
+        "timing": {"$ref": "#/$defs/timing_envelope"},
+        "hierarchy": {"$ref": "#/$defs/hierarchy_envelope"}
+      },
+      "additionalProperties": false
     }
   },
   "additionalProperties": false

文件差異過大導致無法顯示
+ 929 - 16
schemas/prod2u_p4_normal_v3_td_build_receipt.schema.json


+ 123 - 0
schemas/prod2u_p4_normal_v3_trace_events.schema.json

@@ -0,0 +1,123 @@
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema",
+  "$id": "prod2u-p4-normal-v3-trace-events-v1",
+  "type": "object",
+  "additionalProperties": false,
+  "required": ["events"],
+  "properties": {
+    "events": {
+      "type": "array",
+      "items": {
+        "type": "object",
+        "additionalProperties": false,
+        "required": [
+          "event_seq",
+          "event_type",
+          "source",
+          "meta",
+          "data",
+          "state_hash16"
+        ],
+        "properties": {
+          "event_seq": {"type": "integer", "minimum": 1, "maximum": 4294967295},
+          "event_type": {
+            "enum": [
+              "EPOCH",
+              "COMMAND_RESULT",
+              "CORE_STATE",
+              "AXIS_STATE",
+              "LIMIT_STATE",
+              "SAFETY_STATE",
+              "OVERFLOW"
+            ]
+          },
+          "source": {"type": "integer", "minimum": 0, "maximum": 255},
+          "meta": {"type": "integer", "minimum": 0, "maximum": 65535},
+          "data": {"type": "integer", "minimum": 0, "maximum": 18446744073709551615},
+          "state_hash16": {"type": "integer", "minimum": 0, "maximum": 65535}
+        },
+        "oneOf": [
+          {
+            "properties": {
+              "event_type": {"const": "EPOCH"},
+              "source": {"const": 0},
+              "meta": {"const": 0},
+              "data": {"minimum": 0, "maximum": 18446744073709551615}
+            }
+          },
+          {
+            "properties": {
+              "event_type": {"const": "COMMAND_RESULT"},
+              "source": {"minimum": 0, "maximum": 255},
+              "meta": {"minimum": 0, "maximum": 65535},
+              "data": {"minimum": 0, "maximum": 18446744073709551615}
+            }
+          },
+          {
+            "properties": {
+              "event_type": {"const": "CORE_STATE"},
+              "source": {"const": 0},
+              "meta": {"minimum": 0, "maximum": 65535},
+              "data": {"minimum": 0, "maximum": 65535}
+            }
+          },
+          {
+            "properties": {
+              "event_type": {"const": "AXIS_STATE"},
+              "source": {"enum": [1, 2]},
+              "meta": {"minimum": 16384, "maximum": 32767},
+              "data": {
+                "minimum": 9223372036854775808,
+                "maximum": 18446744073709551615,
+                "not": {
+                  "anyOf": [
+                    {
+                      "minimum": 10952754293765046272,
+                      "maximum": 11529215046068469759
+                    },
+                    {
+                      "minimum": 13258597302978740224,
+                      "maximum": 13835058055282163711
+                    },
+                    {
+                      "minimum": 15564440312192434176,
+                      "maximum": 16140901064495857663
+                    },
+                    {
+                      "minimum": 17870283321406128128,
+                      "maximum": 18446744073709551615
+                    }
+                  ]
+                }
+              }
+            }
+          },
+          {
+            "properties": {
+              "event_type": {"const": "LIMIT_STATE"},
+              "source": {"const": 3},
+              "meta": {"const": 0},
+              "data": {"minimum": 0, "maximum": 63}
+            }
+          },
+          {
+            "properties": {
+              "event_type": {"const": "SAFETY_STATE"},
+              "source": {"const": 0},
+              "meta": {"const": 0},
+              "data": {"minimum": 0, "maximum": 15}
+            }
+          },
+          {
+            "properties": {
+              "event_type": {"const": "OVERFLOW"},
+              "source": {"const": 0},
+              "meta": {"const": 0},
+              "data": {"minimum": 1, "maximum": 4294967295}
+            }
+          }
+        ]
+      }
+    }
+  }
+}

+ 109 - 0
schemas/prod2u_p4_rx_bram_ab_decision_receipt.schema.json

@@ -0,0 +1,109 @@
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema",
+  "$id": "prod2u-p4-rx-bram-ab-decision-v1",
+  "type": "object",
+  "required": ["schema", "status", "generated_at", "decision", "accepted", "reason", "base_commit", "candidate_commit", "build_id", "build_epoch_utc", "verification_run_id", "producer_receipt_sha256", "equivalence_run_receipt_sha256", "equivalence_receipt_sha256", "td_receipt_sha256", "trace_only_samples", "rx_bram_samples", "envelopes", "selection", "evidence", "failures", "safety"],
+  "properties": {
+    "schema": {"const": "prod2u-p4-rx-bram-ab-decision-v1"},
+    "status": {"enum": ["pass", "fail"]},
+    "generated_at": {"type": "string"},
+    "decision": {"enum": ["accept", "reject"]},
+    "accepted": {"type": "boolean"},
+    "reason": {"type": "string", "minLength": 1},
+    "base_commit": {"type": ["string", "null"], "pattern": "^[0-9a-f]{40}$"},
+    "candidate_commit": {"type": ["string", "null"], "pattern": "^[0-9a-f]{40}$"},
+    "build_id": {"type": ["string", "null"], "pattern": "^[0-9A-F]{8}$"},
+    "build_epoch_utc": {"type": ["integer", "null"], "minimum": 1, "maximum": 4294967295},
+    "verification_run_id": {"type": ["string", "null"], "pattern": "^[0-9a-f]{32}$"},
+    "producer_receipt_sha256": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
+    "equivalence_run_receipt_sha256": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
+    "equivalence_receipt_sha256": {
+      "type": "object",
+      "required": [
+        "default_parameter_equivalence",
+        "disable_bypass_cycle_equivalence",
+        "candidate_transaction_contract"
+      ],
+      "properties": {
+        "default_parameter_equivalence": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
+        "disable_bypass_cycle_equivalence": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
+        "candidate_transaction_contract": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"}
+      },
+      "additionalProperties": false
+    },
+    "td_receipt_sha256": {"type": "array", "items": {"type": "string", "pattern": "^[0-9a-f]{64}$"}},
+    "trace_only_samples": {"type": "array"},
+    "rx_bram_samples": {"type": "array"},
+    "envelopes": {"type": "object"},
+    "selection": {
+      "oneOf": [
+        {"type": "null"},
+        {
+          "type": "object",
+          "required": ["rx_storage_variant", "total_bram9k", "bram32k", "dsp", "io", "selected_commit", "selected_synthesis_input_hash"],
+          "properties": {
+            "rx_storage_variant": {"enum": ["trace_only", "rx_bram"]},
+            "total_bram9k": {"enum": [1, 2]},
+            "bram32k": {"const": 0},
+            "dsp": {"const": 0},
+            "io": {"const": 41},
+            "selected_commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
+            "selected_synthesis_input_hash": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+          },
+          "additionalProperties": false
+        }
+      ]
+    },
+    "evidence": {
+      "type": "object",
+      "properties": {
+        "producer_receipt": {"$ref": "#/$defs/artifact"},
+        "equivalence_run_receipt": {"$ref": "#/$defs/artifact"},
+        "equivalence_receipts": {
+          "type": "object",
+          "required": ["default_parameter_equivalence", "disable_bypass_cycle_equivalence", "candidate_transaction_contract"],
+          "properties": {
+            "default_parameter_equivalence": {"$ref": "#/$defs/artifact"},
+            "disable_bypass_cycle_equivalence": {"$ref": "#/$defs/artifact"},
+            "candidate_transaction_contract": {"$ref": "#/$defs/artifact"}
+          },
+          "additionalProperties": false
+        },
+        "candidate_artifacts": {
+          "type": "object",
+          "required": ["canonical_patch", "candidate_bundle", "equivalence_inputs"],
+          "properties": {
+            "canonical_patch": {"$ref": "#/$defs/artifact"},
+            "candidate_bundle": {"$ref": "#/$defs/artifact"},
+            "equivalence_inputs": {"$ref": "#/$defs/artifact"}
+          },
+          "additionalProperties": false
+        },
+        "trace_td_receipts": {"type": "array", "minItems": 2, "maxItems": 2, "items": {"$ref": "#/$defs/artifact"}},
+        "candidate_td_receipts": {"type": "array", "minItems": 2, "maxItems": 2, "items": {"$ref": "#/$defs/artifact"}}
+      },
+      "additionalProperties": false
+    },
+    "failures": {"type": "array", "items": {"type": "string"}},
+    "safety": {"type": "object", "required": ["production_tree_modified", "td_run", "serial_opened", "jtag_opened", "programmed"], "properties": {"production_tree_modified": {"const": false}, "td_run": {"const": false}, "serial_opened": {"const": false}, "jtag_opened": {"const": false}, "programmed": {"const": false}}, "additionalProperties": false}
+  },
+  "allOf": [
+    {"if": {"properties": {"status": {"const": "pass"}}, "required": ["status"]}, "then": {"properties": {"selection": {"type": "object"}, "evidence": {"required": ["producer_receipt", "equivalence_run_receipt", "equivalence_receipts", "candidate_artifacts", "trace_td_receipts", "candidate_td_receipts"]}, "failures": {"maxItems": 0}}}},
+    {"if": {"properties": {"accepted": {"const": true}}, "required": ["accepted"]}, "then": {"properties": {"status": {"const": "pass"}, "decision": {"const": "accept"}, "selection": {"properties": {"rx_storage_variant": {"const": "rx_bram"}, "total_bram9k": {"const": 2}}}, "failures": {"maxItems": 0}}}},
+    {"if": {"properties": {"status": {"const": "pass"}, "accepted": {"const": false}}, "required": ["status", "accepted"]}, "then": {"properties": {"decision": {"const": "reject"}, "selection": {"properties": {"rx_storage_variant": {"const": "trace_only"}, "total_bram9k": {"const": 1}}}, "failures": {"maxItems": 0}}}},
+    {"if": {"properties": {"status": {"const": "fail"}}, "required": ["status"]}, "then": {"properties": {"decision": {"const": "reject"}, "accepted": {"const": false}}, "required": ["failures"]}}
+  ],
+  "$defs": {
+    "artifact": {
+      "type": "object",
+      "required": ["path", "size", "sha256"],
+      "properties": {
+        "path": {"type": "string", "minLength": 1},
+        "size": {"type": "integer", "minimum": 1},
+        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
+      },
+      "additionalProperties": false
+    }
+  },
+  "additionalProperties": false
+}

+ 35 - 0
schemas/prod2u_p4_rx_bram_candidate_producer_receipt.schema.json

@@ -0,0 +1,35 @@
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema",
+  "$id": "prod2u-p4-rx-bram-candidate-producer-v1",
+  "type": "object",
+  "required": ["schema", "status", "base_commit", "candidate_commit", "candidate_parent_commit", "build_epoch_utc", "changed_files", "candidate_root", "artifacts", "safety"],
+  "properties": {
+    "schema": {"const": "prod2u-p4-rx-bram-candidate-producer-v1"},
+    "status": {"const": "pass"},
+    "generated_at": {"type": "string"},
+    "base_commit": {"$ref": "#/$defs/commit"},
+    "candidate_commit": {"$ref": "#/$defs/commit"},
+    "candidate_parent_commit": {"$ref": "#/$defs/commit"},
+    "build_epoch_utc": {"type": "integer", "minimum": 1, "maximum": 4294967295},
+    "changed_files": {"type": "array", "minItems": 1, "uniqueItems": true, "items": {"type": "string", "minLength": 1}},
+    "candidate_root": {"type": "string", "minLength": 1},
+    "artifacts": {
+      "type": "object",
+      "required": ["canonical_patch", "candidate_bundle", "equivalence_inputs"],
+      "properties": {
+        "canonical_patch": {"$ref": "#/$defs/artifact"},
+        "candidate_bundle": {"$ref": "#/$defs/artifact"},
+        "equivalence_inputs": {"$ref": "#/$defs/artifact"}
+      },
+      "additionalProperties": false
+    },
+    "safety": {"$ref": "#/$defs/safety"}
+  },
+  "$defs": {
+    "commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
+    "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+    "artifact": {"type": "object", "required": ["path", "size", "sha256"], "properties": {"path": {"type": "string", "minLength": 1}, "size": {"type": "integer", "minimum": 1}, "sha256": {"$ref": "#/$defs/sha256"}}, "additionalProperties": false},
+    "safety": {"type": "object", "required": ["production_tree_modified", "td_run", "serial_opened", "jtag_opened", "programmed"], "properties": {"production_tree_modified": {"const": false}, "td_run": {"const": false}, "serial_opened": {"const": false}, "jtag_opened": {"const": false}, "programmed": {"const": false}}, "additionalProperties": false}
+  },
+  "additionalProperties": false
+}

+ 67 - 0
schemas/prod2u_p4_rx_bram_equivalence_receipt.schema.json

@@ -0,0 +1,67 @@
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema",
+  "$id": "prod2u-p4-rx-bram-equivalence-proof-v1",
+  "type": "object",
+  "required": ["schema", "status", "proof_kind", "base_commit", "candidate_commit", "build_epoch_utc", "candidate_patch_sha256", "assertion_count", "cover_hit_count", "cover_hit_ids", "toolchain", "raw_root", "raw_artifacts", "failures"],
+  "properties": {
+    "schema": {"const": "prod2u-p4-rx-bram-equivalence-proof-v1"},
+    "status": {"const": "pass"},
+    "proof_kind": {"enum": ["default_parameter_equivalence", "disable_bypass_cycle_equivalence", "candidate_transaction_contract"]},
+    "base_commit": {"$ref": "#/$defs/commit"},
+    "candidate_commit": {"$ref": "#/$defs/commit"},
+    "build_epoch_utc": {"type": "integer", "minimum": 1, "maximum": 4294967295},
+    "candidate_patch_sha256": {"$ref": "#/$defs/sha256"},
+    "assertion_count": {"type": "integer", "minimum": 1},
+    "cover_hit_count": {"type": "integer", "minimum": 0},
+    "cover_hit_ids": {"type": "array", "items": {"type": "string", "minLength": 1}, "uniqueItems": true},
+    "toolchain": {"$ref": "#/$defs/formalToolchain"},
+    "raw_root": {"type": "string", "minLength": 1},
+    "raw_artifacts": {"type": "object", "minProperties": 1, "additionalProperties": {"$ref": "#/$defs/artifact"}},
+    "failures": {"type": "array", "maxItems": 0}
+  },
+  "$defs": {
+    "commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
+    "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+    "formalTool": {
+      "type": "object",
+      "required": ["name", "path", "version", "sha256"],
+      "properties": {
+        "name": {"enum": ["sby", "yosys", "smtbmc", "abc", "bitwuzla"]},
+        "path": {"type": "string", "minLength": 1},
+        "version": {"type": "string", "minLength": 1},
+        "sha256": {"$ref": "#/$defs/sha256"}
+      },
+      "additionalProperties": false
+    },
+    "formalToolchain": {
+      "type": "object",
+      "required": ["status", "root", "sby", "yosys", "smtbmc", "abc", "solvers", "support_files", "support_sha256", "failures", "sha256"],
+      "properties": {
+        "status": {"const": "pass"},
+        "root": {"type": "string", "minLength": 1},
+        "sby": {"$ref": "#/$defs/formalTool"},
+        "yosys": {"$ref": "#/$defs/formalTool"},
+        "smtbmc": {"$ref": "#/$defs/formalTool"},
+        "abc": {"$ref": "#/$defs/formalTool"},
+        "solvers": {"type": "array", "minItems": 1, "maxItems": 1, "items": {"$ref": "#/$defs/formalTool"}},
+        "support_files": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/supportFile"}},
+        "support_sha256": {"$ref": "#/$defs/sha256"},
+        "failures": {"type": "array", "maxItems": 0},
+        "sha256": {"$ref": "#/$defs/sha256"}
+      },
+      "additionalProperties": false
+    },
+    "supportFile": {
+      "type": "object",
+      "required": ["path", "size", "sha256"],
+      "properties": {
+        "path": {"type": "string", "minLength": 1},
+        "size": {"type": "integer", "minimum": 1},
+        "sha256": {"$ref": "#/$defs/sha256"}
+      },
+      "additionalProperties": false
+    },
+    "artifact": {"type": "object", "required": ["name", "size", "sha256"], "properties": {"name": {"type": "string", "minLength": 1}, "size": {"type": "integer", "minimum": 1}, "sha256": {"$ref": "#/$defs/sha256"}}, "additionalProperties": false}
+  },
+  "additionalProperties": false
+}

+ 109 - 0
schemas/prod2u_p4_rx_bram_equivalence_run_receipt.schema.json

@@ -0,0 +1,109 @@
+{
+  "$schema": "https://json-schema.org/draft/2020-12/schema",
+  "$id": "prod2u-p4-rx-bram-equivalence-run-v1",
+  "type": "object",
+  "required": [
+    "schema",
+    "status",
+    "generated_at",
+    "producer_receipt",
+    "equivalence_inputs",
+    "toolchain",
+    "receipts",
+    "safety"
+  ],
+  "properties": {
+    "schema": {"const": "prod2u-p4-rx-bram-equivalence-run-v1"},
+    "status": {"const": "pass"},
+    "generated_at": {"type": "string"},
+    "producer_receipt": {"$ref": "#/$defs/artifact"},
+    "equivalence_inputs": {"$ref": "#/$defs/artifact"},
+    "toolchain": {"$ref": "#/$defs/formalToolchain"},
+    "receipts": {
+      "type": "object",
+      "required": [
+        "default_parameter_equivalence",
+        "disable_bypass_cycle_equivalence",
+        "candidate_transaction_contract"
+      ],
+      "properties": {
+        "default_parameter_equivalence": {"$ref": "#/$defs/artifact"},
+        "disable_bypass_cycle_equivalence": {"$ref": "#/$defs/artifact"},
+        "candidate_transaction_contract": {"$ref": "#/$defs/artifact"}
+      },
+      "additionalProperties": false
+    },
+    "safety": {"$ref": "#/$defs/safety"}
+  },
+  "$defs": {
+    "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
+    "formalTool": {
+      "type": "object",
+      "required": ["name", "path", "version", "sha256"],
+      "properties": {
+        "name": {"enum": ["sby", "yosys", "smtbmc", "abc", "bitwuzla"]},
+        "path": {"type": "string", "minLength": 1},
+        "version": {"type": "string", "minLength": 1},
+        "sha256": {"$ref": "#/$defs/sha256"}
+      },
+      "additionalProperties": false
+    },
+    "formalToolchain": {
+      "type": "object",
+      "required": ["status", "root", "sby", "yosys", "smtbmc", "abc", "solvers", "support_files", "support_sha256", "failures", "sha256"],
+      "properties": {
+        "status": {"const": "pass"},
+        "root": {"type": "string", "minLength": 1},
+        "sby": {"$ref": "#/$defs/formalTool"},
+        "yosys": {"$ref": "#/$defs/formalTool"},
+        "smtbmc": {"$ref": "#/$defs/formalTool"},
+        "abc": {"$ref": "#/$defs/formalTool"},
+        "solvers": {"type": "array", "minItems": 1, "maxItems": 1, "items": {"$ref": "#/$defs/formalTool"}},
+        "support_files": {"type": "array", "minItems": 1, "items": {"$ref": "#/$defs/supportFile"}},
+        "support_sha256": {"$ref": "#/$defs/sha256"},
+        "failures": {"type": "array", "maxItems": 0},
+        "sha256": {"$ref": "#/$defs/sha256"}
+      },
+      "additionalProperties": false
+    },
+    "supportFile": {
+      "type": "object",
+      "required": ["path", "size", "sha256"],
+      "properties": {
+        "path": {"type": "string", "minLength": 1},
+        "size": {"type": "integer", "minimum": 1},
+        "sha256": {"$ref": "#/$defs/sha256"}
+      },
+      "additionalProperties": false
+    },
+    "artifact": {
+      "type": "object",
+      "required": ["path", "size", "sha256"],
+      "properties": {
+        "path": {"type": "string", "minLength": 1},
+        "size": {"type": "integer", "minimum": 1},
+        "sha256": {"$ref": "#/$defs/sha256"}
+      },
+      "additionalProperties": false
+    },
+    "safety": {
+      "type": "object",
+      "required": [
+        "production_tree_modified",
+        "td_run",
+        "serial_opened",
+        "jtag_opened",
+        "programmed"
+      ],
+      "properties": {
+        "production_tree_modified": {"const": false},
+        "td_run": {"const": false},
+        "serial_opened": {"const": false},
+        "jtag_opened": {"const": false},
+        "programmed": {"const": false}
+      },
+      "additionalProperties": false
+    }
+  },
+  "additionalProperties": false
+}

+ 0 - 65
schemas/prod2u_td_build_receipt.schema.json

@@ -1,65 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "prod2u-td-build-receipt-v1",
-  "title": "Prod2U TD build receipt",
-  "type": "object",
-  "required": ["schema", "status", "top", "top_module", "pin_profile"],
-  "properties": {
-    "schema": {"const": "prod2u-td-build-receipt-v1"},
-    "status": {"enum": ["pass", "skipped", "blocked", "blocked_pin_profile_invalid", "blocked_missing_real_fan_ptc_pin_inventory", "fail", "fail_build_identity"]},
-    "top": {"const": "prod2u_bmc_replay_binary921"},
-    "top_module": {"const": "prod2u_bmc_replay_binary921_top"},
-    "pin_profile": {"const": "prod2u-bmc-replay-binary921"},
-    "build_identity": {
-      "type": "object",
-      "properties": {
-        "status": {"type": "string"},
-        "build_id": {"type": "string", "pattern": "^[0-9A-F]{8}$"},
-        "source_manifest_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
-        "staged_manifest_sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
-      },
-      "additionalProperties": true
-    },
-    "build_id": {"type": ["string", "null"], "pattern": "^[0-9A-F]{8}$"},
-    "source_manifest_sha256": {"type": ["string", "null"], "pattern": "^[0-9a-f]{64}$"},
-    "por_initialization": {
-      "type": "object",
-      "required": ["status", "por_cycles", "counter_width", "expected_init", "register_count", "failures"],
-      "properties": {
-        "status": {"enum": ["pass", "fail", "not_applicable"]},
-        "por_cycles": {"const": 1024},
-        "counter_width": {"const": 10},
-        "expected_init": {"const": "0"},
-        "register_count": {"const": 11},
-        "failures": {"type": "array", "items": {"type": "string"}}
-      },
-      "additionalProperties": true
-    },
-    "bitstream": {
-      "type": ["object", "null"],
-      "properties": {
-        "path": {"type": "string", "minLength": 1},
-        "size": {"type": "integer", "minimum": 1},
-        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"}
-      },
-      "additionalProperties": true
-    }
-  },
-  "allOf": [
-    {
-      "if": {"properties": {"status": {"const": "pass"}}, "required": ["status"]},
-      "then": {
-        "required": ["build_identity", "build_id", "source_manifest_sha256", "por_initialization", "bitstream", "resources", "timing", "timing_gate", "syn", "phy"],
-        "properties": {
-          "build_identity": {"properties": {"status": {"const": "pass"}}, "required": ["status", "build_id", "source_manifest_sha256", "staged_manifest_sha256"]},
-          "por_initialization": {"properties": {"status": {"const": "pass"}, "failures": {"maxItems": 0}}},
-          "bitstream": {"type": "object", "required": ["path", "size", "sha256"]},
-          "timing_gate": {"type": "object", "properties": {"status": {"const": "pass"}}, "required": ["status"]},
-          "syn": {"type": "object", "properties": {"returncode": {"const": 0}, "log_has_error": {"const": false}}, "required": ["returncode", "log_has_error"]},
-          "phy": {"type": "object", "properties": {"returncode": {"const": 0}, "log_has_error": {"const": false}}, "required": ["returncode", "log_has_error"]}
-        }
-      }
-    }
-  ],
-  "additionalProperties": true
-}

+ 0 - 275
schemas/real_bmc_j6_host_sensor_real_fan_ptc_debug921_v1_receipt.schema.json

@@ -1,275 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "real_bmc_j6_host_sensor_real_fan_ptc_debug921_v1_receipt.schema.json",
-  "type": "object",
-  "required": ["schema", "status", "counterparty", "diagnostic_scope", "pin_profile", "programming", "collector", "layers", "safety"],
-  "properties": {
-    "schema": { "const": "real-bmc-j6-host-sensor-real-fan-ptc-debug921-v1-receipt-v1" },
-    "status": { "type": "string" },
-    "counterparty": { "const": "real_bmc" },
-    "diagnostic_scope": { "const": "host_sensor_real_fan_ptc_debug921" },
-    "pin_profile_name": { "enum": ["temp-uart-ptc-remap", "formal-uart", "debug-photo-uart-bmc-replay", "formal-uart1-bmc-replay"] },
-    "pin_profile": { "$ref": "#/$defs/pin_profile" },
-    "programming": {
-      "type": "object",
-      "required": ["mode", "manual_programming", "jtag_speed_hz", "board_power_present_before_program", "bitstream"],
-      "properties": {
-        "mode": { "const": "PROGRAM_SRAM" },
-        "manual_programming": { "const": true },
-        "jtag_speed_hz": { "const": 200000 },
-        "board_power_present_before_program": { "const": true },
-        "bitstream": { "$ref": "#/$defs/artifact" }
-      }
-    },
-    "collector": {
-      "type": "object",
-      "required": ["host_port", "debug_port", "baud", "debug_baud", "format", "host_port_writes_to_serial", "debug_port_writes_to_serial", "opens_unknown_com_ports", "enumerates_com_ports"],
-      "properties": {
-        "host_port": { "const": "COM8" },
-        "debug_port": { "const": "COM7" },
-        "baud": { "const": 115200 },
-        "debug_baud": { "const": 921600 },
-        "format": { "const": "8N1" },
-        "host_port_writes_to_serial": { "const": true },
-        "debug_port_writes_to_serial": { "const": false },
-        "opens_unknown_com_ports": { "const": false },
-        "enumerates_com_ports": { "const": false }
-      }
-    },
-    "layers": {
-      "type": "object",
-      "required": [
-        "td_bitstream",
-        "manual_sram_programming",
-        "host_command_sequence",
-        "host_control_transcript",
-        "host_sensor_reports",
-        "debug_frame_capture",
-        "bmc_raw_sampling",
-        "pid_boundary",
-        "timeout_evidence",
-        "pin_map",
-        "safety_contract",
-        "real_fan_ptc_hardware_status",
-        "artifact_hashes"
-      ],
-      "properties": {
-        "td_bitstream": {
-          "type": "object",
-          "required": ["status", "receipt"],
-          "properties": { "status": { "type": "string" }, "receipt": { "$ref": "#/$defs/artifact" } }
-        },
-        "manual_sram_programming": {
-          "type": "object",
-          "required": ["status", "mode", "manual_programming", "jtag_speed_hz", "board_power_present_before_program", "attestation"],
-          "properties": {
-            "status": { "type": "string" },
-            "mode": { "const": "PROGRAM_SRAM" },
-            "manual_programming": { "const": true },
-            "jtag_speed_hz": { "const": 200000 },
-            "board_power_present_before_program": { "const": true },
-            "attestation": { "$ref": "#/$defs/artifact" }
-          }
-        },
-        "host_command_sequence": {
-          "type": "object",
-          "required": ["status", "commands"],
-          "properties": {
-            "status": { "type": "string" },
-            "commands": {
-              "type": "array",
-              "prefixItems": [
-                { "const": "SET PTC 01 10" },
-                { "const": "SET PTC 24 20" },
-                { "const": "SET FAN 01 40" },
-                { "const": "SET FAN 04 30" },
-                { "const": "SET PID ENABLE" },
-                { "const": "GET STATUS" },
-                { "const": "GET MAP" },
-                { "const": "GET SENSOR" },
-                { "const": "GET SENSOR" },
-                { "const": "GET SENSOR" },
-                { "const": "SET PID DISABLE" },
-                { "const": "DISABLE" }
-              ],
-              "minItems": 12,
-              "maxItems": 12
-            }
-          }
-        },
-        "host_control_transcript": {
-          "type": "object",
-          "required": ["status", "host_command_transcript"],
-          "properties": { "status": { "type": "string" }, "host_command_transcript": { "$ref": "#/$defs/artifact" } }
-        },
-        "host_sensor_reports": {
-          "type": "object",
-          "required": ["status", "host_transcript_text", "host_raw_bin", "host_sensor_report"],
-          "properties": {
-            "status": { "type": "string" },
-            "host_transcript_text": { "$ref": "#/$defs/artifact" },
-            "host_raw_bin": { "$ref": "#/$defs/artifact" },
-            "host_sensor_report": { "$ref": "#/$defs/artifact" }
-          }
-        },
-        "debug_frame_capture": {
-          "type": "object",
-          "required": ["status", "debug_transcript", "raw_bin", "raw_replay", "debug_frame_stream", "manifest"],
-          "properties": {
-            "status": { "type": "string" },
-            "debug_transcript": { "$ref": "#/$defs/artifact" },
-            "raw_bin": { "$ref": "#/$defs/artifact" },
-            "raw_replay": { "$ref": "#/$defs/artifact" },
-            "debug_frame_stream": { "$ref": "#/$defs/artifact" },
-            "manifest": { "$ref": "#/$defs/artifact" }
-          }
-        },
-        "bmc_raw_sampling": {
-          "type": "object",
-          "required": ["status", "minimum_completed_samples", "completed_samples", "bmc_timeout"],
-          "properties": {
-            "status": { "type": "string" },
-            "minimum_completed_samples": { "type": "integer", "minimum": 3 },
-            "completed_samples": { "type": "integer", "minimum": 0 },
-            "bmc_timeout": { "type": "boolean" }
-          }
-        },
-        "pid_boundary": {
-          "type": "object",
-          "required": ["status", "pid_requested", "pid_requested_ever", "pid_active", "pwm_source"],
-          "properties": {
-            "status": { "type": "string" },
-            "pid_requested": { "type": "boolean" },
-            "pid_requested_ever": { "const": true },
-            "pid_active": { "const": false },
-            "pwm_source": { "const": "host_manual" }
-          }
-        },
-        "timeout_evidence": {
-          "type": "object",
-          "required": ["status", "timeout_evidence"],
-          "properties": {
-            "status": { "type": "string" },
-            "timeout_evidence": {
-              "type": "object",
-              "required": ["timeout_s", "ptc_all_percent", "fan_all_percent"],
-              "properties": {
-                "timeout_s": { "const": 5 },
-                "ptc_all_percent": { "const": 0 },
-                "fan_all_percent": { "const": 30 }
-              }
-            }
-          }
-        },
-        "pin_map": {
-          "type": "object",
-          "required": ["status", "ptc_count", "fan_count", "fan_fg_count", "fan_install_count"],
-          "properties": {
-            "status": { "type": "string" },
-            "profile": { "enum": ["temp-uart-ptc-remap", "formal-uart", "debug-photo-uart-bmc-replay", "formal-uart1-bmc-replay"] },
-            "ptc_count": { "const": 24 },
-            "fan_count": { "const": 4 },
-            "fan_fg_count": { "const": 8 },
-            "fan_install_count": { "const": 4 },
-            "bmc_tx_ball": { "type": "string" },
-            "bmc_rx_ball": { "type": "string" },
-            "host_tx_ball": { "type": "string" },
-            "host_rx_ball": { "type": "string" },
-            "debug_rx_ball": { "type": "string" },
-            "debug_tx_ball": { "type": "string" },
-            "ptc_substitutions": { "type": "object" },
-            "reserved_future_uart": { "type": "object" }
-          }
-        },
-        "safety_contract": {
-          "type": "object",
-          "required": ["status", "pid_default_enabled", "pid_active", "bmc_controls_pwm", "debug_port_writes_to_serial", "host_port_writes_to_serial", "real_thermal_performance_claimed"],
-          "properties": {
-            "status": { "type": "string" },
-            "pid_default_enabled": { "const": false },
-            "pid_active": { "const": false },
-            "bmc_controls_pwm": { "const": false },
-            "debug_port_writes_to_serial": { "const": false },
-            "host_port_writes_to_serial": { "const": true },
-            "real_thermal_performance_claimed": { "const": false }
-          }
-        },
-        "real_fan_ptc_hardware_status": {
-          "type": "object",
-          "required": ["status", "qualifies_final_gate"],
-          "properties": {
-            "status": { "enum": ["not_run", "blocked_waiting_for_real_fan_ptc_hardware"] },
-            "real_fan_ptc_hardware_present": { "type": "boolean" },
-            "qualifies_final_gate": { "const": false }
-          }
-        },
-        "artifact_hashes": {
-          "type": "object",
-          "required": [
-            "bitstream_sha256",
-            "td_receipt_sha256",
-            "manual_sram_attestation_sha256",
-            "host_transcript_text_sha256",
-            "host_raw_bin_sha256",
-            "host_sensor_report_sha256",
-            "debug_transcript_sha256",
-            "debug_raw_bin_sha256",
-            "raw_replay_sha256",
-            "debug_frame_stream_sha256",
-            "host_command_transcript_sha256",
-            "manifest_sha256"
-          ],
-          "properties": {
-            "status": { "type": "string" }
-          },
-          "additionalProperties": true
-        }
-      }
-    },
-    "safety": {
-      "type": "object",
-      "required": ["flash_attempted", "driver_install_attempted", "programs_flash", "programs_nonvolatile", "opens_unknown_com_ports", "enumerates_com_ports", "toggles_dtr_rts", "debug_port_writes_to_serial", "host_port_writes_to_serial", "uncontrolled_real_bmc_action_attempted", "real_thermal_performance_claimed"],
-      "properties": {
-        "flash_attempted": { "const": false },
-        "driver_install_attempted": { "const": false },
-        "programs_flash": { "const": false },
-        "programs_nonvolatile": { "const": false },
-        "opens_unknown_com_ports": { "const": false },
-        "enumerates_com_ports": { "const": false },
-        "toggles_dtr_rts": { "const": false },
-        "debug_port_writes_to_serial": { "const": false },
-        "host_port_writes_to_serial": { "const": true },
-        "uncontrolled_real_bmc_action_attempted": { "const": false },
-        "real_thermal_performance_claimed": { "const": false }
-      }
-    }
-  },
-  "$defs": {
-    "pin_profile": {
-      "type": "object",
-      "required": ["name", "bmc_tx_ball", "bmc_rx_ball", "host_tx_ball", "host_rx_ball", "debug_rx_ball", "debug_tx_ball"],
-      "properties": {
-        "name": { "enum": ["temp-uart-ptc-remap", "formal-uart", "debug-photo-uart-bmc-replay", "formal-uart1-bmc-replay"] },
-        "connector": { "type": "string" },
-        "tx_ball": { "type": "string" },
-        "rx_ball": { "type": "string" },
-        "bmc_tx_ball": { "type": "string" },
-        "bmc_rx_ball": { "type": "string" },
-        "host_tx_ball": { "type": "string" },
-        "host_rx_ball": { "type": "string" },
-        "debug_rx_ball": { "type": "string" },
-        "debug_tx_ball": { "type": "string" },
-        "ptc_substitutions": { "type": "object" },
-        "reserved_future_uart": { "type": "object" }
-      }
-    },
-    "artifact": {
-      "type": "object",
-      "required": ["path", "sha256"],
-      "properties": {
-        "path": { "type": "string", "minLength": 1 },
-        "sha256": { "type": "string", "pattern": "^[0-9a-fA-F]{64}$" }
-      }
-    }
-  }
-}

+ 0 - 169
schemas/real_bmc_j6_windows_gate_v2_receipt.schema.json

@@ -1,169 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "real_bmc_j6_windows_gate_v2_receipt.schema.json",
-  "title": "Real BMC J6 Windows gate v2 receipt",
-  "type": "object",
-  "required": ["schema", "status", "counterparty", "pin_profile", "programming", "layers", "safety", "authority_boundary"],
-  "properties": {
-    "schema": { "const": "real-bmc-j6-windows-gate-v2-receipt-v1" },
-    "status": { "const": "pass" },
-    "counterparty": { "const": "real_bmc" },
-    "pin_profile": {
-      "type": "object",
-      "required": ["name", "connector", "tx_ball", "rx_ball", "debug_rx_ball", "debug_tx_ball"],
-      "properties": {
-        "name": { "enum": ["primary", "swapped"] },
-        "connector": { "const": "J6" },
-        "tx_ball": { "enum": ["T4", "R5"] },
-        "rx_ball": { "enum": ["T4", "R5"] },
-        "debug_rx_ball": { "const": "P10" },
-        "debug_tx_ball": { "const": "R10" }
-      },
-      "additionalProperties": true
-    },
-    "programming": {
-      "type": "object",
-      "required": ["mode", "manual_programming", "bitstream"],
-      "properties": {
-        "mode": { "const": "PROGRAM_SRAM" },
-        "manual_programming": { "const": true },
-        "bitstream": { "$ref": "#/$defs/artifact" }
-      },
-      "additionalProperties": true
-    },
-    "layers": {
-      "type": "object",
-      "required": [
-        "td_bitstream",
-        "manual_sram_programming",
-        "windows_serial_capture",
-        "real_bmc_protocol",
-        "safety_contract",
-        "artifact_hashes"
-      ],
-      "properties": {
-        "td_bitstream": {
-          "type": "object",
-          "required": ["status", "receipt"],
-          "properties": {
-            "status": { "const": "pass" },
-            "receipt": { "$ref": "#/$defs/artifact" }
-          },
-          "additionalProperties": true
-        },
-        "manual_sram_programming": {
-          "type": "object",
-          "required": ["status", "operator", "mode", "manual_programming", "programmed_at", "attestation"],
-          "properties": {
-            "status": { "const": "pass" },
-            "operator": { "type": "string", "minLength": 1 },
-            "mode": { "const": "PROGRAM_SRAM" },
-            "manual_programming": { "const": true },
-            "programmed_at": { "type": "string", "minLength": 1 },
-            "attestation": { "$ref": "#/$defs/artifact" }
-          },
-          "additionalProperties": true
-        },
-        "windows_serial_capture": {
-          "type": "object",
-          "required": ["status", "port", "baud", "format", "duration_s", "transcript", "event_stream", "register_dump"],
-          "properties": {
-            "status": { "const": "pass" },
-            "port": { "type": "string", "pattern": "^COM[0-9]+$" },
-            "baud": { "const": 115200 },
-            "format": { "const": "8N1" },
-            "duration_s": { "type": "integer", "minimum": 90 },
-            "transcript": { "$ref": "#/$defs/artifact" },
-            "event_stream": { "$ref": "#/$defs/artifact" },
-            "register_dump": { "$ref": "#/$defs/artifact" }
-          },
-          "additionalProperties": true
-        },
-        "real_bmc_protocol": {
-          "type": "object",
-          "required": ["status", "valid_frame_count", "source_id"],
-          "properties": {
-            "status": { "const": "pass" },
-            "valid_frame_count": { "type": "integer", "minimum": 3 },
-            "source_id": { "const": "BMC_UART_TEXT" }
-          },
-          "additionalProperties": true
-        },
-        "safety_contract": {
-          "type": "object",
-          "required": ["status", "ptc_fan_pins_exported", "real_actuator_action_attempted"],
-          "properties": {
-            "status": { "const": "pass" },
-            "ptc_fan_pins_exported": { "const": false },
-            "real_actuator_action_attempted": { "const": false }
-          },
-          "additionalProperties": true
-        },
-        "artifact_hashes": {
-          "type": "object",
-          "required": [
-            "status",
-            "bitstream_sha256",
-            "td_receipt_sha256",
-            "manual_sram_attestation_sha256",
-            "transcript_sha256",
-            "event_stream_sha256",
-            "register_dump_sha256"
-          ],
-          "properties": {
-            "status": { "const": "pass" },
-            "bitstream_sha256": { "$ref": "#/$defs/sha256" },
-            "td_receipt_sha256": { "$ref": "#/$defs/sha256" },
-            "manual_sram_attestation_sha256": { "$ref": "#/$defs/sha256" },
-            "transcript_sha256": { "$ref": "#/$defs/sha256" },
-            "event_stream_sha256": { "$ref": "#/$defs/sha256" },
-            "register_dump_sha256": { "$ref": "#/$defs/sha256" }
-          },
-          "additionalProperties": true
-        }
-      },
-      "additionalProperties": false
-    },
-    "safety": {
-      "type": "object",
-      "required": [
-        "flash_attempted",
-        "driver_install_attempted",
-        "programs_flash",
-        "opens_unknown_com_ports",
-        "toggles_dtr_rts",
-        "ptc_fan_pins_exported",
-        "real_ptc_fan_action_attempted",
-        "uncontrolled_real_bmc_action_attempted"
-      ],
-      "properties": {
-        "flash_attempted": { "const": false },
-        "driver_install_attempted": { "const": false },
-        "programs_flash": { "const": false },
-        "opens_unknown_com_ports": { "const": false },
-        "toggles_dtr_rts": { "const": false },
-        "ptc_fan_pins_exported": { "const": false },
-        "real_ptc_fan_action_attempted": { "const": false },
-        "uncontrolled_real_bmc_action_attempted": { "const": false }
-      },
-      "additionalProperties": false
-    },
-    "authority_boundary": { "type": "string", "minLength": 1 }
-  },
-  "additionalProperties": true,
-  "$defs": {
-    "artifact": {
-      "type": "object",
-      "required": ["path", "sha256"],
-      "properties": {
-        "path": { "type": "string", "minLength": 1 },
-        "sha256": { "$ref": "#/$defs/sha256" }
-      },
-      "additionalProperties": true
-    },
-    "sha256": {
-      "type": "string",
-      "pattern": "^[0-9a-fA-F]{64}$"
-    }
-  }
-}

+ 0 - 69
schemas/uart_board_sram_receipt.schema.json

@@ -1,69 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "uart_board_sram_receipt.schema.json",
-  "title": "UART board SRAM receipt",
-  "type": "object",
-  "required": ["schema", "status", "counterparty", "programming", "serial", "transcript", "debug_evidence", "safety"],
-  "properties": {
-    "schema": { "const": "uart-board-sram-receipt-v1" },
-    "status": { "type": "string" },
-    "counterparty": { "enum": ["pc_emulator", "real_bmc"] },
-    "programming": {
-      "type": "object",
-      "required": ["mode", "bitstream"],
-      "properties": {
-        "mode": { "const": "PROGRAM_SRAM" },
-        "bitstream": { "$ref": "#/$defs/artifact" }
-      },
-      "additionalProperties": true
-    },
-    "serial": { "$ref": "#/$defs/serial" },
-    "transcript": { "$ref": "#/$defs/artifact" },
-    "debug_evidence": {
-      "type": "object",
-      "required": ["event_stream", "register_dump"],
-      "properties": {
-        "event_stream": { "type": "string" },
-        "register_dump": { "type": "string" }
-      },
-      "additionalProperties": true
-    },
-    "safety": { "$ref": "#/$defs/safety" },
-    "authority_boundary": { "type": "string" }
-  },
-  "additionalProperties": true,
-  "$defs": {
-    "serial": {
-      "type": "object",
-      "required": ["port", "baud", "format", "allowlisted"],
-      "properties": {
-        "port": { "type": "string" },
-        "baud": { "const": 115200 },
-        "format": { "const": "8N1" },
-        "allowlisted": { "const": true },
-        "dtr": { "type": "boolean" },
-        "rts": { "type": "boolean" }
-      },
-      "additionalProperties": true
-    },
-    "artifact": {
-      "type": "object",
-      "required": ["path", "sha256"],
-      "properties": {
-        "path": { "type": "string" },
-        "sha256": { "type": "string", "pattern": "^[0-9a-fA-F]{64}$" }
-      },
-      "additionalProperties": true
-    },
-    "safety": {
-      "type": "object",
-      "required": ["flash_attempted", "real_ptc_fan_bmc_action_attempted", "driver_install_attempted"],
-      "properties": {
-        "flash_attempted": { "const": false },
-        "real_ptc_fan_bmc_action_attempted": { "const": false },
-        "driver_install_attempted": { "const": false }
-      },
-      "additionalProperties": true
-    }
-  }
-}

+ 0 - 50
schemas/uart_loopback_receipt.schema.json

@@ -1,50 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "uart_loopback_receipt.schema.json",
-  "title": "UART loopback receipt",
-  "type": "object",
-  "required": ["schema", "status", "counterparty", "serial", "transcript", "safety"],
-  "properties": {
-    "schema": { "const": "uart-loopback-receipt-v1" },
-    "status": { "type": "string" },
-    "counterparty": { "enum": ["pc_emulator", "real_bmc"] },
-    "serial": { "$ref": "#/$defs/serial" },
-    "transcript": { "$ref": "#/$defs/artifact" },
-    "safety": { "$ref": "#/$defs/safety" }
-  },
-  "additionalProperties": true,
-  "$defs": {
-    "serial": {
-      "type": "object",
-      "required": ["port", "baud", "format", "allowlisted"],
-      "properties": {
-        "port": { "type": "string" },
-        "baud": { "const": 115200 },
-        "format": { "const": "8N1" },
-        "allowlisted": { "type": "boolean" },
-        "dtr": { "type": "boolean" },
-        "rts": { "type": "boolean" }
-      },
-      "additionalProperties": true
-    },
-    "artifact": {
-      "type": "object",
-      "required": ["path"],
-      "properties": {
-        "path": { "type": "string" },
-        "sha256": { "type": "string", "pattern": "^[0-9a-fA-F]{64}$" }
-      },
-      "additionalProperties": true
-    },
-    "safety": {
-      "type": "object",
-      "required": ["flash_attempted", "real_ptc_fan_bmc_action_attempted", "driver_install_attempted"],
-      "properties": {
-        "flash_attempted": { "const": false },
-        "real_ptc_fan_bmc_action_attempted": { "const": false },
-        "driver_install_attempted": { "const": false }
-      },
-      "additionalProperties": true
-    }
-  }
-}

+ 0 - 39
schemas/uart_preflight_receipt.schema.json

@@ -1,39 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "uart_preflight_receipt.schema.json",
-  "title": "UART preflight receipt",
-  "type": "object",
-  "required": ["schema", "status", "serial", "enumeration", "safety", "authority_boundary"],
-  "properties": {
-    "schema": { "const": "uart-preflight-receipt-v1" },
-    "status": { "type": "string" },
-    "serial": {
-      "type": "object",
-      "required": ["baud", "format", "allowlisted", "opened"],
-      "properties": {
-        "baud": { "const": 115200 },
-        "format": { "const": "8N1" },
-        "allowlisted": { "type": "boolean" },
-        "opened": { "const": false },
-        "allowlist": { "type": "array", "items": { "type": "string" } }
-      },
-      "additionalProperties": true
-    },
-    "enumeration": { "type": "object", "additionalProperties": true },
-    "safety": { "$ref": "#/$defs/safety" },
-    "authority_boundary": { "type": "string" }
-  },
-  "additionalProperties": true,
-  "$defs": {
-    "safety": {
-      "type": "object",
-      "required": ["flash_attempted", "real_ptc_fan_bmc_action_attempted", "driver_install_attempted"],
-      "properties": {
-        "flash_attempted": { "const": false },
-        "real_ptc_fan_bmc_action_attempted": { "const": false },
-        "driver_install_attempted": { "const": false }
-      },
-      "additionalProperties": true
-    }
-  }
-}

+ 0 - 38
schemas/uart_soak_receipt.schema.json

@@ -1,38 +0,0 @@
-{
-  "$schema": "https://json-schema.org/draft/2020-12/schema",
-  "$id": "uart_soak_receipt.schema.json",
-  "title": "UART soak receipt",
-  "type": "object",
-  "required": ["schema", "status", "counterparty", "duration_hours_requested", "duration_hours_observed", "rounds", "safety"],
-  "properties": {
-    "schema": { "const": "uart-soak-receipt-v1" },
-    "status": { "type": "string" },
-    "counterparty": { "enum": ["pc_emulator", "real_bmc"] },
-    "duration_hours_requested": { "type": "number", "minimum": 0 },
-    "duration_hours_observed": { "type": "number", "minimum": 0 },
-    "rounds": {
-      "type": "array",
-      "items": {
-        "type": "object",
-        "required": ["index", "status"],
-        "properties": {
-          "index": { "type": "integer", "minimum": 1 },
-          "status": { "type": "string" },
-          "receipt": { "type": "string" }
-        },
-        "additionalProperties": true
-      }
-    },
-    "safety": {
-      "type": "object",
-      "required": ["flash_attempted", "real_ptc_fan_bmc_action_attempted", "driver_install_attempted"],
-      "properties": {
-        "flash_attempted": { "const": false },
-        "real_ptc_fan_bmc_action_attempted": { "const": false },
-        "driver_install_attempted": { "const": false }
-      },
-      "additionalProperties": true
-    }
-  },
-  "additionalProperties": true
-}

+ 0 - 161
src/rtl/actuator_domain.v

@@ -1,161 +0,0 @@
-`timescale 1ns/1ps
-
-module actuator_domain #(
-    parameter integer DW = 18,
-    parameter integer CHW = 5,
-    parameter integer CHANNEL_COUNT = 24,
-    parameter integer FAN_COUNT = 6,
-    parameter [DW-1:0] OUT_MIN = 18'd0,
-    parameter [DW-1:0] OUT_MAX = 18'd127,
-    parameter [DW-1:0] FAN_BACKGROUND_LEVEL = 18'd38,
-    parameter [DW-1:0] FAN_FALLBACK_LEVEL = 18'd127
-) (
-    input  wire                 clk,
-    input  wire                 rst_n,
-    input  wire                 pid_valid,
-    input  wire [CHW-1:0]       pid_channel,
-    input  wire signed [DW-1:0] pid_ctrl_q,
-    input  wire                 pid_fault,
-    input  wire                 global_enable,
-    input  wire                 fault_latched,
-    input  wire [3:0]           fault_code,
-    input  wire                 motor_open_req,
-    input  wire                 motor_close_req,
-    input  wire                 button_open_req,
-    input  wire                 button_close_req,
-    input  wire                 limit_open,
-    input  wire                 limit_close,
-    input  wire [FAN_COUNT-1:0] fan_tach_in,
-    input  wire                 interlock,
-    output reg                  ptc_enable,
-    output reg  [CHW-1:0]       ptc_channel,
-    output reg  [DW-1:0]        ptc_duty_or_level,
-    output reg                  ptc_force_off,
-    output reg  [3:0]           ptc_reason,
-    output reg                  fan_enable,
-    output reg  [DW-1:0]        fan_duty_or_level,
-    output reg                  fan_force_off,
-    output reg  [3:0]           fan_reason,
-    output reg                  motor_enable,
-    output reg  [1:0]           motor_dir,
-    output reg                  motor_force_off,
-    output reg  [3:0]           motor_reason,
-    output wire [CHANNEL_COUNT-1:0]    ptc_bank_enable,
-    output wire [CHANNEL_COUNT-1:0]    ptc_bank_force_off,
-    output wire [CHANNEL_COUNT*DW-1:0] ptc_bank_duty_or_level,
-    output wire [CHANNEL_COUNT-1:0]    ptc_pwm_out,
-    output wire [FAN_COUNT-1:0]        fan_pwm_enable,
-    output wire [FAN_COUNT-1:0]        fan_pwm_logic_high,
-    output wire [FAN_COUNT-1:0]        fan_pwm_drive_low,
-    output wire [FAN_COUNT*16-1:0]     fan_tach_count,
-    output wire [FAN_COUNT*16-1:0]     fan_tach_window_edges,
-    output wire [FAN_COUNT*16-1:0]     fan_rpm_estimate,
-    output wire [1:0]                  motor_state,
-    output wire [1:0]                  limit_status,
-    output wire [1:0]                  button_status
-);
-
-    wire ptc_enable_w;
-    wire [CHW-1:0] ptc_channel_w;
-    wire [DW-1:0] ptc_duty_or_level_w;
-    wire ptc_force_off_w;
-    wire [3:0] ptc_reason_w;
-    wire fan_enable_w;
-    wire [DW-1:0] fan_duty_or_level_w;
-    wire fan_force_off_w;
-    wire [3:0] fan_reason_w;
-    wire motor_enable_w;
-    wire [1:0] motor_dir_w;
-    wire motor_force_off_w;
-    wire [3:0] motor_reason_w;
-
-    ptc_output_bank #(
-        .DW(DW),
-        .CHW(CHW),
-        .CHANNEL_COUNT(CHANNEL_COUNT),
-        .OUT_MIN(OUT_MIN),
-        .OUT_MAX(OUT_MAX)
-    ) u_ptc_output_bank (
-        .clk(clk),
-        .rst_n(rst_n),
-        .pid_valid(pid_valid),
-        .pid_channel(pid_channel),
-        .pid_ctrl_q(pid_ctrl_q),
-        .pid_fault(pid_fault),
-        .global_enable(global_enable),
-        .fault_latched(fault_latched),
-        .fault_code(fault_code),
-        .ptc_enable(ptc_enable_w),
-        .ptc_channel(ptc_channel_w),
-        .ptc_duty_or_level(ptc_duty_or_level_w),
-        .ptc_force_off(ptc_force_off_w),
-        .ptc_reason(ptc_reason_w),
-        .ptc_bank_enable(ptc_bank_enable),
-        .ptc_bank_force_off(ptc_bank_force_off),
-        .ptc_bank_duty_or_level(ptc_bank_duty_or_level),
-        .ptc_pwm_out(ptc_pwm_out)
-    );
-
-    fan_tach_domain #(
-        .DW(DW),
-        .FAN_COUNT(FAN_COUNT),
-        .FAN_BACKGROUND_LEVEL(FAN_BACKGROUND_LEVEL),
-        .FAN_FALLBACK_LEVEL(FAN_FALLBACK_LEVEL)
-    ) u_fan_tach_domain (
-        .clk(clk),
-        .rst_n(rst_n),
-        .global_enable(global_enable),
-        .fault_latched(fault_latched),
-        .fault_code(fault_code),
-        .fan_tach_in(fan_tach_in),
-        .fan_enable(fan_enable_w),
-        .fan_duty_or_level(fan_duty_or_level_w),
-        .fan_force_off(fan_force_off_w),
-        .fan_reason(fan_reason_w),
-        .fan_pwm_enable(fan_pwm_enable),
-        .fan_pwm_logic_high(fan_pwm_logic_high),
-        .fan_pwm_drive_low(fan_pwm_drive_low),
-        .fan_tach_count(fan_tach_count),
-        .fan_tach_window_edges(fan_tach_window_edges),
-        .fan_rpm_estimate(fan_rpm_estimate)
-    );
-
-    motor_limit_domain u_motor_limit_domain (
-        .clk(clk),
-        .rst_n(rst_n),
-        .global_enable(global_enable),
-        .fault_latched(fault_latched),
-        .fault_code(fault_code),
-        .motor_open_req(motor_open_req),
-        .motor_close_req(motor_close_req),
-        .button_open_req(button_open_req),
-        .button_close_req(button_close_req),
-        .limit_open(limit_open),
-        .limit_close(limit_close),
-        .interlock(interlock),
-        .motor_enable(motor_enable_w),
-        .motor_dir(motor_dir_w),
-        .motor_force_off(motor_force_off_w),
-        .motor_reason(motor_reason_w),
-        .motor_state(motor_state),
-        .limit_status(limit_status),
-        .button_status(button_status)
-    );
-
-    always @(*) begin
-        ptc_enable = ptc_enable_w;
-        ptc_channel = ptc_channel_w;
-        ptc_duty_or_level = ptc_duty_or_level_w;
-        ptc_force_off = ptc_force_off_w;
-        ptc_reason = ptc_reason_w;
-        fan_enable = fan_enable_w;
-        fan_duty_or_level = fan_duty_or_level_w;
-        fan_force_off = fan_force_off_w;
-        fan_reason = fan_reason_w;
-        motor_enable = motor_enable_w;
-        motor_dir = motor_dir_w;
-        motor_force_off = motor_force_off_w;
-        motor_reason = motor_reason_w;
-    end
-
-endmodule

+ 0 - 75
src/rtl/actuator_sink.v

@@ -1,75 +0,0 @@
-`timescale 1ns/1ps
-
-module actuator_sink #(
-    parameter integer DW = 18,
-    parameter integer CHW = 5,
-    parameter integer CHANNEL_COUNT = 24,
-    parameter [DW-1:0] OUT_MIN = 18'd0,
-    parameter [DW-1:0] OUT_MAX = 18'd127
-) (
-    input  wire                 clk,
-    input  wire                 rst_n,
-    input  wire                 host_enable,
-    input  wire                 pid_valid,
-    input  wire [CHW-1:0]       pid_channel,
-    input  wire signed [DW-1:0] pid_ctrl_q,
-    input  wire                 pid_fault,
-    output reg                  act_enable,
-    output reg  [CHW-1:0]       act_channel,
-    output reg  [DW-1:0]        act_duty_or_level,
-    output reg                  act_force_off,
-    output reg  [1:0]           act_reason
-);
-
-    localparam REASON_OK = 2'd0;
-    localparam REASON_HOST_DISABLED = 2'd1;
-    localparam REASON_PID_OR_SENSOR_FAULT = 2'd2;
-    localparam REASON_CHANNEL_INVALID = 2'd3;
-    localparam [CHW-1:0] LAST_CHANNEL = CHANNEL_COUNT - 1;
-
-    reg [DW-1:0] clamped_duty;
-
-    always @(*) begin
-        if (pid_ctrl_q < $signed(OUT_MIN)) begin
-            clamped_duty = OUT_MIN;
-        end else if (pid_ctrl_q > $signed(OUT_MAX)) begin
-            clamped_duty = OUT_MAX;
-        end else begin
-            clamped_duty = pid_ctrl_q[DW-1:0];
-        end
-    end
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            act_enable <= 1'b0;
-            act_channel <= {CHW{1'b0}};
-            act_duty_or_level <= {DW{1'b0}};
-            act_force_off <= 1'b1;
-            act_reason <= REASON_HOST_DISABLED;
-        end else if (pid_valid) begin
-            act_channel <= pid_channel;
-            if (pid_channel > LAST_CHANNEL) begin
-                act_enable <= 1'b0;
-                act_duty_or_level <= {DW{1'b0}};
-                act_force_off <= 1'b1;
-                act_reason <= REASON_CHANNEL_INVALID;
-            end else if (!host_enable) begin
-                act_enable <= 1'b0;
-                act_duty_or_level <= {DW{1'b0}};
-                act_force_off <= 1'b1;
-                act_reason <= REASON_HOST_DISABLED;
-            end else if (pid_fault) begin
-                act_enable <= 1'b0;
-                act_duty_or_level <= {DW{1'b0}};
-                act_force_off <= 1'b1;
-                act_reason <= REASON_PID_OR_SENSOR_FAULT;
-            end else begin
-                act_enable <= 1'b1;
-                act_duty_or_level <= clamped_duty;
-                act_force_off <= 1'b0;
-                act_reason <= REASON_OK;
-            end
-        end
-    end
-
-endmodule

+ 0 - 771
src/rtl/binary921_diag_core.v

@@ -1,771 +0,0 @@
-`timescale 1ns/1ps
-
-module binary921_diag_core #(
-    parameter integer BMC_UART_CLKS_PER_BIT = 217,
-    parameter integer HOST_UART_CLKS_PER_BIT = 217,
-    parameter integer DEBUG_UART_CLKS_PER_BIT = 27,
-    parameter integer STARTUP_DELAY_TICKS = 250000,
-    parameter integer COMMAND_GAP_TICKS = 25000000,
-    parameter integer STATUS_PERIOD_TICKS = 25000000,
-    parameter integer HOST_TIMEOUT_TICKS = 125000000,
-    parameter integer PTC_PWM_PERIOD_TICKS = 2500000,
-    parameter integer FAN_PWM_PERIOD_TICKS = 1000,
-    parameter integer SNAPSHOT_PERIOD_TICKS = 25000000,
-    parameter integer PIN_PROFILE = 0,
-    parameter integer COMBINED_HOST_DEBUG_UART = 0,
-    parameter integer READY_REPEAT_COUNT = 3,
-    parameter [31:0] BUILD_ID = 32'h00000000
-) (
-    input  wire        sys_clk,
-    input  wire        sys_rst_n,
-    input  wire        bmc_uart_rx,
-    output wire        bmc_uart_tx,
-    input  wire        debug_uart_rx,
-    output wire        debug_uart_tx,
-    input  wire        host_uart_rx,
-    output wire        host_uart_tx,
-    output reg  [23:0] ptc_pwm_out,
-    output reg  [3:0]  fan_pwm_out,
-    input  wire [7:0]  fan_fg_in,
-    input  wire [3:0]  fan_install_in,
-    output wire [7:0]  led
-);
-    localparam [7:0] PROFILE_DEBUG = 8'd1;
-    localparam [7:0] PROFILE_FORMAL = 8'd2;
-    localparam [7:0] PROFILE_PRODUCTION = 8'd3;
-    localparam [7:0] PROFILE_ID = (PIN_PROFILE == 2) ? PROFILE_PRODUCTION : ((PIN_PROFILE == 0) ? PROFILE_DEBUG : PROFILE_FORMAL);
-    localparam [7:0] POR_REASON_CONFIG = 8'h01;
-    localparam [7:0] FT_READY = 8'h01;
-    localparam [7:0] FT_BMC_PAYLOAD = 8'h03;
-    localparam [7:0] FT_SENSOR_CACHE = 8'h04;
-    localparam [7:0] FT_HOST_CMD = 8'h05;
-    localparam [7:0] FT_HOST_ACK = 8'h06;
-    localparam [7:0] FT_PWM_STATE = 8'h07;
-    localparam [7:0] FT_PID_STATE = 8'h08;
-    localparam [7:0] FT_TIMEOUT_STATE = 8'h09;
-    localparam [7:0] FT_PIN_PROFILE = 8'h0a;
-    localparam [7:0] FT_MODULE_SNAPSHOT = 8'h0b;
-    localparam [7:0] FT_ERROR_COUNTERS = 8'h0c;
-    localparam [7:0] CMD_SET_PTC = 8'h20;
-    localparam [7:0] CMD_SET_FAN = 8'h21;
-    localparam [7:0] CMD_GET_SENSOR = 8'h22;
-    localparam [7:0] CMD_GET_MAP = 8'h23;
-    localparam [7:0] CMD_GET_STATUS = 8'h24;
-    localparam [7:0] CMD_SET_PID_REQUESTED = 8'h25;
-    localparam [7:0] CMD_DISABLE = 8'h26;
-    localparam [31:0] PTC_PWM_STEP_TICKS = (PTC_PWM_PERIOD_TICKS < 100) ? 32'd1 : (PTC_PWM_PERIOD_TICKS / 100);
-    localparam [31:0] FAN_PWM_STEP_TICKS = (FAN_PWM_PERIOD_TICKS < 100) ? 32'd1 : (FAN_PWM_PERIOD_TICKS / 100);
-
-    wire host_rx_valid;
-    wire [7:0] host_rx_data;
-    wire host_rx_ready;
-    wire host_rx_framing_error;
-    wire host_rx_break;
-    wire host_rx_overflow;
-    reg host_tx_valid;
-    reg [7:0] host_tx_data;
-    wire host_tx_ready;
-    wire host_tx_busy;
-
-    wire debug_phy_tx_ready;
-    wire debug_tx_busy;
-    wire debug_frame_tx_ready;
-    wire ack_frame_tx_ready;
-    wire debug_phy_tx_valid;
-    wire diag_tx_valid;
-    wire [7:0] diag_tx_data;
-    reg diag_start;
-    reg [7:0] diag_type;
-    reg [31:0] diag_seq;
-    reg [7:0] diag_payload_len;
-    reg [511:0] diag_payload;
-    wire diag_busy;
-    wire diag_done;
-
-    wire bmc_rx_valid;
-    wire [7:0] bmc_rx_data;
-    wire bmc_rx_ready;
-    wire bmc_rx_framing_error;
-    wire bmc_rx_break;
-    wire bmc_rx_overflow;
-    wire bmc_tx_ready;
-    wire bmc_tx_busy;
-    wire bmc_poll_tx_valid;
-    wire [7:0] bmc_poll_tx_data;
-    wire bmc_poll_ready;
-    wire bmc_poll_accept;
-    wire bmc_frame_valid;
-    wire [7:0] bmc_frame_byte;
-    wire [5:0] bmc_frame_index;
-    wire [15:0] bmc_frame_seq;
-    wire bmc_frame_done;
-    wire bmc_parser_error;
-    wire [2:0] bmc_parser_state;
-    wire [15:0] bmc_token_count;
-    wire [15:0] bmc_rejected_echo_windows;
-    wire [15:0] bmc_startup_wake_sent_count;
-    wire [15:0] bmc_poll_command_count;
-    wire [15:0] bmc_tx_byte_count;
-    wire [15:0] bmc_rx_byte_count;
-
-    wire cmd_valid;
-    wire [31:0] cmd_seq;
-    wire [7:0] cmd_id;
-    wire [7:0] cmd_ch;
-    wire [7:0] cmd_pct;
-    wire bad_host_frame;
-    wire [15:0] bad_host_frame_count;
-
-    reg [31:0] tick;
-    reg [31:0] debug_frame_seq;
-    reg [31:0] host_ack_seq;
-    reg [6:0] ptc_level [0:23];
-    reg [6:0] fan_level [0:3];
-    reg [6:0] sensor_temp [0:23];
-    reg [23:0] sensor_missing;
-    reg [7:0] valid_count;
-    reg [7:0] missing_count;
-    reg [7:0] last_status_code;
-    reg [7:0] last_cmd_id;
-    reg [7:0] last_cmd_ch;
-    reg [7:0] last_cmd_pct;
-    reg pid_requested;
-    reg timeout_active;
-    reg [31:0] host_timeout_counter;
-    reg [31:0] status_counter;
-    reg [31:0] snapshot_counter;
-    reg [31:0] startup_counter;
-    reg ready_sent;
-    reg [31:0] ready_repeat_count;
-    reg [31:0] ready_timestamp_tick;
-    reg [7:0] ready_announcement_seq;
-    reg [4:0] sensor_index;
-    reg [4:0] bmc_pair_index;
-    reg [7:0] bmc_prev_byte;
-    reg [15:0] bmc_payload_checksum;
-    reg [7:0] bmc_payload_first;
-    reg [7:0] bmc_payload_last;
-    reg [7:0] bmc_payload_count;
-    reg [15:0] command_count_seen;
-    reg [7:0] host_err_count;
-    reg [7:0] cmd_status_value;
-    reg [15:0] cmd_hash_value;
-    reg [6:0] dimm_temp_clamped;
-    reg [15:0] bmc_next_checksum;
-    reg [7:0] bmc_next_count;
-    reg [7:0] bmc_next_first;
-    reg [7:0] bmc_next_last;
-    reg [7:0] next_valid_count;
-    reg [7:0] next_missing_count;
-    reg [23:0] next_sensor_missing;
-    reg bmc_payload_pending;
-    reg sensor_cache_pending;
-    reg [31:0] ptc_pwm_counter;
-    reg [31:0] fan_pwm_counter;
-    reg bmc_tx_valid;
-    reg [7:0] bmc_tx_data;
-    reg bmc_tx_inflight;
-    reg bmc_poll_hold_valid;
-    reg [7:0] bmc_poll_hold_data;
-    reg [1:0] combined_tx_owner;
-    integer i;
-
-    localparam [1:0] COMBINED_OWNER_NONE = 2'd0;
-    localparam [1:0] COMBINED_OWNER_ACK = 2'd1;
-    localparam [1:0] COMBINED_OWNER_DIAG = 2'd2;
-    wire [31:0] diag_timestamp_tick = (diag_type == FT_READY) ? ready_timestamp_tick : tick;
-
-    uart_rx_8n1 #(.CLKS_PER_BIT(HOST_UART_CLKS_PER_BIT)) u_host_rx (
-        .clk(sys_clk),
-        .rst_n(sys_rst_n),
-        .rx_i(host_uart_rx),
-        .rx_valid(host_rx_valid),
-        .rx_data(host_rx_data),
-        .rx_ready(host_rx_ready),
-        .framing_error(host_rx_framing_error),
-        .break_detected(host_rx_break),
-        .overflow(host_rx_overflow)
-    );
-
-    uart_tx_8n1 #(.CLKS_PER_BIT(HOST_UART_CLKS_PER_BIT)) u_host_tx (
-        .clk(sys_clk),
-        .rst_n(sys_rst_n),
-        .tx_valid(host_tx_valid),
-        .tx_data(host_tx_data),
-        .tx_ready(host_tx_ready),
-        .tx_o(host_uart_tx),
-        .busy(host_tx_busy)
-    );
-
-    uart_rx_8n1 #(.CLKS_PER_BIT(BMC_UART_CLKS_PER_BIT)) u_bmc_rx (
-        .clk(sys_clk),
-        .rst_n(sys_rst_n),
-        .rx_i(bmc_uart_rx),
-        .rx_valid(bmc_rx_valid),
-        .rx_data(bmc_rx_data),
-        .rx_ready(bmc_rx_ready),
-        .framing_error(bmc_rx_framing_error),
-        .break_detected(bmc_rx_break),
-        .overflow(bmc_rx_overflow)
-    );
-
-    uart_tx_8n1 #(.CLKS_PER_BIT(BMC_UART_CLKS_PER_BIT)) u_bmc_tx (
-        .clk(sys_clk),
-        .rst_n(sys_rst_n),
-        .tx_valid(bmc_tx_valid),
-        .tx_data(bmc_tx_data),
-        .tx_ready(bmc_tx_ready),
-        .tx_o(bmc_uart_tx),
-        .busy(bmc_tx_busy)
-    );
-
-    assign bmc_poll_ready = bmc_tx_ready && !bmc_tx_inflight && !bmc_poll_hold_valid && !bmc_poll_tx_valid;
-    assign bmc_poll_accept = bmc_poll_tx_valid && bmc_tx_ready && !bmc_tx_inflight && !bmc_poll_hold_valid;
-
-    assign debug_phy_tx_valid = (COMBINED_HOST_DEBUG_UART != 0) ? 1'b0 : diag_tx_valid;
-
-    uart_tx_8n1 #(.CLKS_PER_BIT(DEBUG_UART_CLKS_PER_BIT)) u_debug_tx (
-        .clk(sys_clk),
-        .rst_n(sys_rst_n),
-        .tx_valid(debug_phy_tx_valid),
-        .tx_data(diag_tx_data),
-        .tx_ready(debug_phy_tx_ready),
-        .tx_o(debug_uart_tx),
-        .busy(debug_tx_busy)
-    );
-
-    binary921_host_rx u_host_binary_rx (
-        .clk(sys_clk),
-        .rst_n(sys_rst_n),
-        .expected_profile_id(PROFILE_ID),
-        .rx_valid(host_rx_valid),
-        .rx_data(host_rx_data),
-        .rx_ready(host_rx_ready),
-        .cmd_valid(cmd_valid),
-        .cmd_seq(cmd_seq),
-        .cmd_id(cmd_id),
-        .cmd_ch(cmd_ch),
-        .cmd_pct(cmd_pct),
-        .bad_frame(bad_host_frame),
-        .bad_frame_count(bad_host_frame_count)
-    );
-
-    bmc_uart_raw48_poll_lite #(
-        .POLL_PERIOD_TICKS(COMMAND_GAP_TICKS),
-        .STARTUP_WAKE_COUNT(3),
-        .STARTUP_WAKE_GAP_TICKS(STARTUP_DELAY_TICKS),
-        .STARTUP_POST_WAKE_DELAY_TICKS(STARTUP_DELAY_TICKS),
-        .WAIT_FOR_FRAME_BEFORE_NEXT_POLL(1)
-    ) u_bmc_poll (
-        .clk(sys_clk),
-        .rst_n(sys_rst_n),
-        .tx_ready(bmc_poll_ready),
-        .tx_valid(bmc_poll_tx_valid),
-        .tx_data(bmc_poll_tx_data),
-        .rx_valid(bmc_rx_valid),
-        .rx_data(bmc_rx_data),
-        .frame_valid(bmc_frame_valid),
-        .frame_byte(bmc_frame_byte),
-        .frame_index(bmc_frame_index),
-        .frame_seq(bmc_frame_seq),
-        .frame_done(bmc_frame_done),
-        .parser_error(bmc_parser_error),
-        .stale(),
-        .parser_state(bmc_parser_state),
-        .token_count(bmc_token_count),
-        .rejected_echo_windows(bmc_rejected_echo_windows),
-        .startup_wake_sent_count(bmc_startup_wake_sent_count),
-        .poll_command_count(bmc_poll_command_count),
-        .tx_byte_count(bmc_tx_byte_count),
-        .rx_byte_count(bmc_rx_byte_count)
-    );
-    assign bmc_rx_ready = 1'b1;
-
-    binary921_frame_tx #(.MAX_PAYLOAD_BYTES(64)) u_diag_frame_tx (
-        .clk(sys_clk),
-        .rst_n(sys_rst_n),
-        .start(diag_start),
-        .profile_id(PROFILE_ID),
-        .frame_type(diag_type),
-        .frame_seq(diag_seq),
-        .timestamp_tick(diag_timestamp_tick),
-            .payload_len(diag_payload_len),
-        .payload(diag_payload),
-        .busy(diag_busy),
-        .done(diag_done),
-        .tx_valid(diag_tx_valid),
-        .tx_data(diag_tx_data),
-        .tx_ready(debug_frame_tx_ready)
-    );
-
-    wire ack_tx_valid;
-    wire [7:0] ack_tx_data;
-    reg ack_start;
-    reg [7:0] ack_payload_len;
-    reg [511:0] ack_payload;
-    wire ack_busy;
-    wire ack_done;
-
-    binary921_frame_tx #(.MAX_PAYLOAD_BYTES(64)) u_host_ack_tx (
-        .clk(sys_clk),
-        .rst_n(sys_rst_n),
-        .start(ack_start),
-        .profile_id(PROFILE_ID),
-        .frame_type(FT_HOST_ACK),
-        .frame_seq(host_ack_seq),
-        .timestamp_tick(tick),
-        .payload_len(ack_payload_len),
-        .payload(ack_payload),
-        .busy(ack_busy),
-        .done(ack_done),
-        .tx_valid(ack_tx_valid),
-        .tx_data(ack_tx_data),
-        .tx_ready(ack_frame_tx_ready)
-    );
-
-    assign ack_frame_tx_ready = (COMBINED_HOST_DEBUG_UART != 0) ? ((combined_tx_owner == COMBINED_OWNER_ACK) && host_tx_ready) : host_tx_ready;
-    assign debug_frame_tx_ready = (COMBINED_HOST_DEBUG_UART != 0) ? ((combined_tx_owner == COMBINED_OWNER_DIAG) && host_tx_ready) : debug_phy_tx_ready;
-
-    always @* begin
-        if (COMBINED_HOST_DEBUG_UART != 0) begin
-            if (combined_tx_owner == COMBINED_OWNER_ACK) begin
-                host_tx_valid = ack_tx_valid;
-                host_tx_data = ack_tx_data;
-            end else if (combined_tx_owner == COMBINED_OWNER_DIAG) begin
-                host_tx_valid = diag_tx_valid;
-                host_tx_data = diag_tx_data;
-            end else begin
-                host_tx_valid = 1'b0;
-                host_tx_data = 8'd0;
-            end
-        end else begin
-            host_tx_valid = ack_tx_valid;
-            host_tx_data = ack_tx_data;
-        end
-    end
-
-    function [7:0] dimm_temp_value;
-        input [7:0] integer_part;
-        input [7:0] fraction_part;
-        begin
-            if (integer_part > 8'd100) begin
-                dimm_temp_value = 8'd100;
-            end else begin
-                dimm_temp_value = integer_part;
-            end
-        end
-    endfunction
-
-    function [15:0] state_hash16;
-        input [7:0] status_code;
-        begin
-            state_hash16 = {8'd0, status_code} ^
-                           {9'd0, ptc_level[0]} ^
-                           {9'd0, ptc_level[23]} ^
-                           {9'd0, fan_level[0]} ^
-                           {9'd0, fan_level[3]} ^
-                           {15'd0, pid_requested} ^
-                           {15'd0, timeout_active};
-        end
-    endfunction
-
-    function [15:0] command_hash16;
-        input [7:0] status_code;
-        input [7:0] command_value;
-        input [7:0] channel_value;
-        input [7:0] percent_value;
-        begin
-            command_hash16 = state_hash16(status_code) ^
-                             {command_value, channel_value} ^
-                             {8'd0, percent_value};
-        end
-    endfunction
-
-    function [31:0] duty_threshold;
-        input [31:0] step_ticks;
-        input [6:0] percent_value;
-        begin
-            duty_threshold = step_ticks * {25'd0, percent_value};
-        end
-    endfunction
-
-    task queue_diag_frame;
-        input [7:0] frame_type;
-        input [7:0] length;
-        input [511:0] payload_value;
-        begin
-            if (!diag_busy && !diag_start) begin
-                debug_frame_seq <= debug_frame_seq + 32'd1;
-                diag_seq <= debug_frame_seq + 32'd1;
-                diag_type <= frame_type;
-                diag_payload_len <= length;
-                diag_payload <= payload_value;
-                diag_start <= 1'b1;
-            end
-        end
-    endtask
-
-    task queue_ack;
-        input [31:0] seq_value;
-        input [7:0] command_value;
-        input [7:0] status_value;
-        input [15:0] hash_value;
-        begin
-            if (!ack_busy && !ack_start) begin
-                host_ack_seq <= seq_value;
-                ack_payload_len <= 8'd6;
-                ack_payload <= {464'd0, hash_value[15:8], hash_value[7:0], 8'd0, status_value, command_value, 8'd1};
-                ack_start <= 1'b1;
-            end
-        end
-    endtask
-
-    always @(posedge sys_clk or negedge sys_rst_n) begin
-        if (!sys_rst_n) begin
-            tick <= 32'd0;
-            debug_frame_seq <= 32'd0;
-            host_ack_seq <= 32'd0;
-            diag_start <= 1'b0;
-            diag_type <= 8'd0;
-            diag_seq <= 32'd0;
-            diag_payload_len <= 8'd0;
-            diag_payload <= 512'd0;
-            bmc_tx_valid <= 1'b0;
-            bmc_tx_data <= 8'd0;
-            bmc_tx_inflight <= 1'b0;
-            bmc_poll_hold_valid <= 1'b0;
-            bmc_poll_hold_data <= 8'd0;
-            combined_tx_owner <= COMBINED_OWNER_NONE;
-            ack_start <= 1'b0;
-            ack_payload_len <= 8'd0;
-            ack_payload <= 512'd0;
-            ready_sent <= 1'b0;
-            ready_repeat_count <= 32'd0;
-            ready_timestamp_tick <= 32'd0;
-            ready_announcement_seq <= 8'd0;
-            startup_counter <= 32'd0;
-            status_counter <= 32'd0;
-            snapshot_counter <= 32'd0;
-            host_timeout_counter <= 32'd0;
-            timeout_active <= 1'b0;
-            pid_requested <= 1'b0;
-            sensor_missing <= 24'hffffff;
-            valid_count <= 8'd0;
-            missing_count <= 8'd24;
-            last_status_code <= 8'd0;
-            last_cmd_id <= 8'd0;
-            last_cmd_ch <= 8'd0;
-            last_cmd_pct <= 8'd0;
-            sensor_index <= 5'd0;
-            bmc_pair_index <= 5'd0;
-            bmc_prev_byte <= 8'd0;
-            bmc_payload_checksum <= 16'd0;
-            bmc_payload_first <= 8'd0;
-            bmc_payload_last <= 8'd0;
-            bmc_payload_count <= 8'd0;
-            command_count_seen <= 16'd0;
-            host_err_count <= 8'd0;
-            cmd_status_value <= 8'd0;
-            cmd_hash_value <= 16'd0;
-            dimm_temp_clamped <= 7'd0;
-            bmc_next_checksum <= 16'd0;
-            bmc_next_count <= 8'd0;
-            bmc_next_first <= 8'd0;
-            bmc_next_last <= 8'd0;
-            next_valid_count <= 8'd0;
-            next_missing_count <= 8'd24;
-            next_sensor_missing <= 24'hffffff;
-            bmc_payload_pending <= 1'b0;
-            sensor_cache_pending <= 1'b0;
-            ptc_pwm_counter <= 32'd0;
-            fan_pwm_counter <= 32'd0;
-            ptc_pwm_out <= 24'd0;
-            fan_pwm_out <= 4'd0;
-            for (i = 0; i < 24; i = i + 1) begin
-                ptc_level[i] <= 7'd0;
-                sensor_temp[i] <= 7'd0;
-            end
-            for (i = 0; i < 4; i = i + 1) begin
-                fan_level[i] <= 7'd30;
-            end
-        end else begin
-            tick <= tick + 32'd1;
-            diag_start <= 1'b0;
-            ack_start <= 1'b0;
-            bmc_tx_valid <= 1'b0;
-            if (bmc_tx_inflight && bmc_tx_busy) begin
-                bmc_tx_inflight <= 1'b0;
-            end
-
-            if (COMBINED_HOST_DEBUG_UART != 0) begin
-                if (combined_tx_owner == COMBINED_OWNER_ACK) begin
-                    if (ack_done) begin
-                        combined_tx_owner <= COMBINED_OWNER_NONE;
-                    end
-                end else if (combined_tx_owner == COMBINED_OWNER_DIAG) begin
-                    if (diag_done) begin
-                        combined_tx_owner <= COMBINED_OWNER_NONE;
-                    end
-                end else if (ack_busy || ack_start || ack_tx_valid) begin
-                    combined_tx_owner <= COMBINED_OWNER_ACK;
-                end else if (diag_busy || diag_start || diag_tx_valid) begin
-                    combined_tx_owner <= COMBINED_OWNER_DIAG;
-                end
-            end else begin
-                combined_tx_owner <= COMBINED_OWNER_NONE;
-            end
-
-            if (startup_counter < STARTUP_DELAY_TICKS[31:0]) begin
-                startup_counter <= startup_counter + 32'd1;
-            end else if (ready_repeat_count < READY_REPEAT_COUNT) begin
-                if (!diag_busy && !diag_start) begin
-                    if (ready_repeat_count == 32'd0) begin
-                        debug_frame_seq <= 32'd1;
-                        ready_timestamp_tick <= tick;
-                    end
-                    diag_seq <= 32'd1;
-                    diag_type <= FT_READY;
-                    diag_payload_len <= 8'd7;
-                    diag_payload <= {
-                        456'd0,
-                        ready_announcement_seq,
-                        POR_REASON_CONFIG,
-                        BUILD_ID[31:24],
-                        BUILD_ID[23:16],
-                        BUILD_ID[15:8],
-                        BUILD_ID[7:0],
-                        PROFILE_ID
-                    };
-                    diag_start <= 1'b1;
-                    ready_repeat_count <= ready_repeat_count + 32'd1;
-                    ready_announcement_seq <= ready_announcement_seq + 8'd1;
-                    ready_sent <= 1'b1;
-                end
-            end
-
-            if (status_counter >= STATUS_PERIOD_TICKS[31:0]) begin
-                status_counter <= 32'd0;
-                queue_diag_frame(
-                    FT_ERROR_COUNTERS,
-                    8'd12,
-                    {416'd0,
-                     host_err_count,
-                     {7'd0, host_rx_framing_error | host_rx_overflow | host_rx_break},
-                     bad_host_frame_count[15:8], bad_host_frame_count[7:0],
-                     bmc_rx_byte_count[15:8], bmc_rx_byte_count[7:0],
-                     bmc_tx_byte_count[15:8], bmc_tx_byte_count[7:0],
-                     bmc_poll_command_count[15:8], bmc_poll_command_count[7:0],
-                     bmc_frame_seq[15:8], bmc_frame_seq[7:0]}
-                );
-            end else begin
-                status_counter <= status_counter + 32'd1;
-            end
-
-            if (snapshot_counter >= SNAPSHOT_PERIOD_TICKS[31:0]) begin
-                snapshot_counter <= 32'd0;
-                queue_diag_frame(
-                    FT_MODULE_SNAPSHOT,
-                    8'd24,
-                    {320'd0,
-                     fan_install_in,
-                     fan_fg_in,
-                     {1'b0, fan_level[3]}, {1'b0, fan_level[0]},
-                     {1'b0, ptc_level[23]}, {1'b0, ptc_level[0]},
-                     missing_count, valid_count,
-                     {7'd0, timeout_active}, {7'd0, pid_requested},
-                     last_status_code, last_cmd_pct, last_cmd_ch, last_cmd_id,
-                     bmc_payload_checksum[15:8], bmc_payload_checksum[7:0],
-                     bmc_payload_last, bmc_payload_first,
-                     command_count_seen[15:8], command_count_seen[7:0],
-                     host_err_count, PROFILE_ID}
-                );
-            end else begin
-                snapshot_counter <= snapshot_counter + 32'd1;
-            end
-
-            if (bad_host_frame) begin
-                host_err_count <= host_err_count + 8'd1;
-            end
-
-            if (bmc_poll_accept) begin
-                bmc_poll_hold_valid <= 1'b1;
-                bmc_poll_hold_data <= bmc_poll_tx_data;
-            end
-            if (bmc_poll_hold_valid && bmc_tx_ready && !bmc_tx_inflight) begin
-                bmc_tx_data <= bmc_poll_hold_data;
-                bmc_tx_valid <= 1'b1;
-                bmc_tx_inflight <= 1'b1;
-                bmc_poll_hold_valid <= 1'b0;
-            end
-
-            if (cmd_valid) begin
-                last_cmd_id <= cmd_id;
-                last_cmd_ch <= cmd_ch;
-                last_cmd_pct <= cmd_pct;
-                host_timeout_counter <= 32'd0;
-                timeout_active <= 1'b0;
-                command_count_seen <= command_count_seen + 16'd1;
-                cmd_status_value = 8'd0;
-                if (cmd_id == CMD_SET_PTC) begin
-                    if (cmd_ch >= 8'd1 && cmd_ch <= 8'd24 && cmd_pct <= 8'd100) begin
-                        ptc_level[cmd_ch - 8'd1] <= cmd_pct[6:0];
-                    end else begin
-                        cmd_status_value = 8'd1;
-                    end
-                end else if (cmd_id == CMD_SET_FAN) begin
-                    if (cmd_ch >= 8'd1 && cmd_ch <= 8'd4 && cmd_pct <= 8'd100) begin
-                        fan_level[cmd_ch - 8'd1] <= cmd_pct[6:0];
-                    end else begin
-                        cmd_status_value = 8'd1;
-                    end
-                end else if (cmd_id == CMD_SET_PID_REQUESTED) begin
-                    pid_requested <= cmd_ch[0];
-                end else if (cmd_id == CMD_DISABLE) begin
-                    for (i = 0; i < 24; i = i + 1) begin
-                        ptc_level[i] <= 7'd0;
-                    end
-                    for (i = 0; i < 4; i = i + 1) begin
-                        fan_level[i] <= 7'd30;
-                    end
-                end else if (cmd_id == CMD_GET_SENSOR || cmd_id == CMD_GET_MAP || cmd_id == CMD_GET_STATUS) begin
-                    cmd_status_value = 8'd0;
-                end else begin
-                    cmd_status_value = 8'd2;
-                end
-                cmd_hash_value = command_hash16(cmd_status_value, cmd_id, cmd_ch, cmd_pct);
-                last_status_code <= cmd_status_value;
-                queue_ack(cmd_seq, cmd_id, cmd_status_value, cmd_hash_value);
-                queue_diag_frame(
-                    FT_HOST_CMD,
-                    8'd3,
-                    {488'd0, cmd_pct, cmd_ch, cmd_id}
-                );
-            end else if (host_timeout_counter >= HOST_TIMEOUT_TICKS[31:0]) begin
-                timeout_active <= 1'b1;
-                for (i = 0; i < 24; i = i + 1) begin
-                    ptc_level[i] <= 7'd0;
-                end
-                for (i = 0; i < 4; i = i + 1) begin
-                    fan_level[i] <= 7'd30;
-                end
-            end else begin
-                host_timeout_counter <= host_timeout_counter + 32'd1;
-            end
-
-            if (bmc_frame_valid) begin
-                if (bmc_frame_index == 6'd0) begin
-                    bmc_payload_checksum <= 16'd0;
-                    bmc_payload_first <= bmc_frame_byte;
-                    bmc_payload_count <= 8'd0;
-                end
-                bmc_next_checksum = (bmc_frame_index == 6'd0) ? {8'd0, bmc_frame_byte} : (bmc_payload_checksum + {8'd0, bmc_frame_byte});
-                bmc_next_count = (bmc_frame_index == 6'd0) ? 8'd1 : (bmc_payload_count + 8'd1);
-                bmc_next_first = (bmc_frame_index == 6'd0) ? bmc_frame_byte : bmc_payload_first;
-                bmc_next_last = bmc_frame_byte;
-                bmc_payload_count <= bmc_next_count;
-                bmc_payload_checksum <= bmc_next_checksum;
-                bmc_payload_first <= bmc_next_first;
-                bmc_payload_last <= bmc_next_last;
-                next_sensor_missing = sensor_missing;
-                if (bmc_frame_index[0]) begin
-                    if (bmc_prev_byte == 8'hff && bmc_frame_byte == 8'hff) begin
-                        sensor_missing[bmc_pair_index] <= 1'b1;
-                        next_sensor_missing[bmc_pair_index] = 1'b1;
-                        sensor_temp[bmc_pair_index] <= 7'd0;
-                    end else begin
-                        sensor_missing[bmc_pair_index] <= 1'b0;
-                        next_sensor_missing[bmc_pair_index] = 1'b0;
-                        dimm_temp_clamped = dimm_temp_value(bmc_prev_byte, bmc_frame_byte);
-                        sensor_temp[bmc_pair_index] <= dimm_temp_clamped;
-                    end
-                    bmc_pair_index <= bmc_pair_index + 5'd1;
-                end
-                if (bmc_frame_index == 6'd0) begin
-                    bmc_pair_index <= 5'd0;
-                    next_sensor_missing = 24'hffffff;
-                end
-                bmc_prev_byte <= bmc_frame_byte;
-                if (bmc_frame_done) begin
-                    next_valid_count = 8'd0;
-                    next_missing_count = 8'd0;
-                    for (i = 0; i < 24; i = i + 1) begin
-                        if (next_sensor_missing[i]) begin
-                            next_missing_count = next_missing_count + 8'd1;
-                        end else begin
-                            next_valid_count = next_valid_count + 8'd1;
-                        end
-                    end
-                    valid_count <= next_valid_count;
-                    missing_count <= next_missing_count;
-                    bmc_payload_checksum <= bmc_next_checksum;
-                    bmc_payload_count <= bmc_next_count;
-                    bmc_payload_first <= bmc_next_first;
-                    bmc_payload_last <= bmc_next_last;
-                    bmc_payload_pending <= 1'b1;
-                    sensor_cache_pending <= 1'b1;
-                end
-            end
-
-            if (bmc_payload_pending) begin
-                queue_diag_frame(
-                    FT_BMC_PAYLOAD,
-                    8'd8,
-                    {448'd0,
-                     bmc_payload_checksum[15:8], bmc_payload_checksum[7:0],
-                     bmc_payload_last, bmc_payload_first,
-                     bmc_frame_seq[15:8], bmc_frame_seq[7:0],
-                     bmc_payload_count,
-                     8'd48}
-                );
-                if (!diag_busy && !diag_start) begin
-                    bmc_payload_pending <= 1'b0;
-                end
-            end else if (sensor_cache_pending) begin
-                queue_diag_frame(
-                    FT_SENSOR_CACHE,
-                    8'd8,
-                    {448'd0,
-                     missing_count,
-                     valid_count,
-                     sensor_missing[23:16],
-                     sensor_missing[15:8],
-                     sensor_missing[7:0],
-                     bmc_frame_seq[15:8], bmc_frame_seq[7:0],
-                     PROFILE_ID}
-                );
-                if (!diag_busy && !diag_start) begin
-                    sensor_cache_pending <= 1'b0;
-                end
-            end
-
-            if (ptc_pwm_counter >= PTC_PWM_PERIOD_TICKS[31:0] - 32'd1) begin
-                ptc_pwm_counter <= 32'd0;
-            end else begin
-                ptc_pwm_counter <= ptc_pwm_counter + 32'd1;
-            end
-            if (fan_pwm_counter >= FAN_PWM_PERIOD_TICKS[31:0] - 32'd1) begin
-                fan_pwm_counter <= 32'd0;
-            end else begin
-                fan_pwm_counter <= fan_pwm_counter + 32'd1;
-            end
-
-            for (i = 0; i < 24; i = i + 1) begin
-                ptc_pwm_out[i] <= (ptc_level[i] != 7'd0) &&
-                                  (ptc_pwm_counter < duty_threshold(PTC_PWM_STEP_TICKS, ptc_level[i]));
-            end
-            for (i = 0; i < 4; i = i + 1) begin
-                fan_pwm_out[i] <= (fan_level[i] != 7'd0) &&
-                                  (fan_pwm_counter < duty_threshold(FAN_PWM_STEP_TICKS, fan_level[i]));
-            end
-        end
-    end
-
-    assign led[0] = ~ready_sent;
-    assign led[1] = ~timeout_active;
-    assign led[2] = ~pid_requested;
-    assign led[3] = ~(bmc_frame_seq != 16'd0);
-    assign led[4] = ~(command_count_seen != 16'd0);
-    assign led[5] = ~(bad_host_frame_count != 16'd0);
-    assign led[6] = (COMBINED_HOST_DEBUG_UART != 0) ? ~host_tx_busy : ~debug_tx_busy;
-    assign led[7] = (COMBINED_HOST_DEBUG_UART != 0) ? ~(combined_tx_owner != COMBINED_OWNER_NONE) : ~debug_uart_rx;
-endmodule

+ 0 - 200
src/rtl/binary921_host_rx.v

@@ -1,200 +0,0 @@
-`timescale 1ns/1ps
-
-module binary921_host_rx (
-    input  wire        clk,
-    input  wire        rst_n,
-    input  wire [7:0]  expected_profile_id,
-    input  wire        rx_valid,
-    input  wire [7:0]  rx_data,
-    output wire        rx_ready,
-    output reg         cmd_valid,
-    output reg  [31:0] cmd_seq,
-    output reg  [7:0]  cmd_id,
-    output reg  [7:0]  cmd_ch,
-    output reg  [7:0]  cmd_pct,
-    output reg         bad_frame,
-    output reg  [15:0] bad_frame_count
-);
-    localparam [3:0] S_MAGIC0 = 4'd0;
-    localparam [3:0] S_MAGIC1 = 4'd1;
-    localparam [3:0] S_VERSION = 4'd2;
-    localparam [3:0] S_PROFILE = 4'd3;
-    localparam [3:0] S_TYPE = 4'd4;
-    localparam [3:0] S_SEQ0 = 4'd5;
-    localparam [3:0] S_SEQ1 = 4'd6;
-    localparam [3:0] S_SEQ2 = 4'd7;
-    localparam [3:0] S_SEQ3 = 4'd8;
-    localparam [3:0] S_TICK = 4'd9;
-    localparam [3:0] S_LEN = 4'd10;
-    localparam [3:0] S_PAYLOAD = 4'd11;
-    localparam [3:0] S_CRC0 = 4'd12;
-    localparam [3:0] S_CRC1 = 4'd13;
-
-    reg [3:0] state;
-    reg [1:0] tick_index;
-    reg [7:0] payload_len;
-    reg [7:0] payload_index;
-    reg [7:0] payload0;
-    reg [7:0] payload1;
-    reg [7:0] payload2;
-    reg [15:0] crc;
-    wire [15:0] crc_next;
-    reg [7:0] crc0;
-    reg [7:0] frame_type;
-
-    assign rx_ready = 1'b1;
-
-    binary921_crc16 u_crc (
-        .crc_in(crc),
-        .data(rx_data),
-        .crc_out(crc_next)
-    );
-
-    task fail_frame;
-        begin
-            state <= S_MAGIC0;
-            bad_frame <= 1'b1;
-            bad_frame_count <= bad_frame_count + 16'd1;
-            payload_index <= 8'd0;
-            payload_len <= 8'd0;
-            crc <= 16'hffff;
-        end
-    endtask
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            state <= S_MAGIC0;
-            tick_index <= 2'd0;
-            payload_len <= 8'd0;
-            payload_index <= 8'd0;
-            payload0 <= 8'd0;
-            payload1 <= 8'd0;
-            payload2 <= 8'd0;
-            frame_type <= 8'd0;
-            crc <= 16'hffff;
-            crc0 <= 8'd0;
-            cmd_valid <= 1'b0;
-            cmd_seq <= 32'd0;
-            cmd_id <= 8'd0;
-            cmd_ch <= 8'd0;
-            cmd_pct <= 8'd0;
-            bad_frame <= 1'b0;
-            bad_frame_count <= 16'd0;
-        end else begin
-            cmd_valid <= 1'b0;
-            bad_frame <= 1'b0;
-            if (rx_valid) begin
-                case (state)
-                    S_MAGIC0: begin
-                        if (rx_data == 8'ha5) begin
-                            state <= S_MAGIC1;
-                        end
-                    end
-                    S_MAGIC1: begin
-                        if (rx_data == 8'h5a) begin
-                            state <= S_VERSION;
-                            crc <= 16'hffff;
-                        end else if (rx_data == 8'ha5) begin
-                            state <= S_MAGIC1;
-                        end else begin
-                            state <= S_MAGIC0;
-                        end
-                    end
-                    S_VERSION: begin
-                        if (rx_data == 8'h01) begin
-                            crc <= crc_next;
-                            state <= S_PROFILE;
-                        end else begin
-                            fail_frame();
-                        end
-                    end
-                    S_PROFILE: begin
-                        if (rx_data == expected_profile_id) begin
-                            crc <= crc_next;
-                            state <= S_TYPE;
-                        end else begin
-                            fail_frame();
-                        end
-                    end
-                    S_TYPE: begin
-                        frame_type <= rx_data;
-                        crc <= crc_next;
-                        if (rx_data == 8'h05) begin
-                            state <= S_SEQ0;
-                        end else begin
-                            fail_frame();
-                        end
-                    end
-                    S_SEQ0: begin
-                        cmd_seq[7:0] <= rx_data;
-                        crc <= crc_next;
-                        state <= S_SEQ1;
-                    end
-                    S_SEQ1: begin
-                        cmd_seq[15:8] <= rx_data;
-                        crc <= crc_next;
-                        state <= S_SEQ2;
-                    end
-                    S_SEQ2: begin
-                        cmd_seq[23:16] <= rx_data;
-                        crc <= crc_next;
-                        state <= S_SEQ3;
-                    end
-                    S_SEQ3: begin
-                        cmd_seq[31:24] <= rx_data;
-                        crc <= crc_next;
-                        tick_index <= 2'd0;
-                        state <= S_TICK;
-                    end
-                    S_TICK: begin
-                        crc <= crc_next;
-                        if (tick_index == 2'd3) begin
-                            state <= S_LEN;
-                        end else begin
-                            tick_index <= tick_index + 2'd1;
-                        end
-                    end
-                    S_LEN: begin
-                        payload_len <= rx_data;
-                        payload_index <= 8'd0;
-                        payload0 <= 8'd0;
-                        payload1 <= 8'd0;
-                        payload2 <= 8'd0;
-                        crc <= crc_next;
-                        if (rx_data == 8'd0 || rx_data > 8'd3) begin
-                            fail_frame();
-                        end else begin
-                            state <= S_PAYLOAD;
-                        end
-                    end
-                    S_PAYLOAD: begin
-                        crc <= crc_next;
-                        if (payload_index == 8'd0) payload0 <= rx_data;
-                        if (payload_index == 8'd1) payload1 <= rx_data;
-                        if (payload_index == 8'd2) payload2 <= rx_data;
-                        if (payload_index + 8'd1 == payload_len) begin
-                            state <= S_CRC0;
-                        end
-                        payload_index <= payload_index + 8'd1;
-                    end
-                    S_CRC0: begin
-                        crc0 <= rx_data;
-                        state <= S_CRC1;
-                    end
-                    S_CRC1: begin
-                        if ({rx_data, crc0} == crc) begin
-                            cmd_id <= payload0;
-                            cmd_ch <= payload1;
-                            cmd_pct <= payload2;
-                            cmd_valid <= 1'b1;
-                            state <= S_MAGIC0;
-                        end else begin
-                            fail_frame();
-                        end
-                    end
-                    default: state <= S_MAGIC0;
-                endcase
-            end
-        end
-    end
-endmodule

+ 0 - 108
src/rtl/bmc_dimm_frame_parser.v

@@ -1,108 +0,0 @@
-`timescale 1ns/1ps
-
-module bmc_dimm_frame_parser #(
-    parameter integer DW = 18,
-    parameter integer CHW = 5,
-    parameter integer EXPECTED_DIMM_COUNT = 24,
-    parameter integer FRACTION_SCALE = 100
-) (
-    input  wire                 clk,
-    input  wire                 rst_n,
-    input  wire                 raw_valid,
-    output wire                 raw_ready,
-    input  wire [7:0]           raw_integer_byte,
-    input  wire [7:0]           raw_fraction_byte,
-    input  wire [CHW-1:0]       raw_pair_index,
-    input  wire [15:0]          frame_seq,
-    input  wire [15:0]          sample_seq_base,
-    input  wire [15:0]          age_ms,
-    input  wire                 frame_bad_length,
-    input  wire                 sample_stale,
-    input  wire                 sample_ready,
-    output reg                  dimm_valid,
-    output reg  [2:0]           source_id,
-    output reg  [15:0]          dimm_frame_seq,
-    output reg  [15:0]          dimm_sample_seq,
-    output reg  [CHW-1:0]       raw_pair_index_out,
-    output reg  [CHW-1:0]       dimm_id,
-    output reg  [CHW-1:0]       channel,
-    output reg  [7:0]           raw_integer_byte_out,
-    output reg  [7:0]           raw_fraction_byte_out,
-    output reg  signed [DW-1:0] temp_q,
-    output reg  [15:0]          temp_c_x100,
-    output reg                  missing,
-    output reg                  fault,
-    output reg                  stale,
-    output reg  [15:0]          age_ms_out,
-    output reg  [7:0]           raw_status,
-    output reg  [7:0]           parser_status
-);
-
-    localparam [7:0] RAW_STATUS_MISSING_DIMM = 8'h01;
-    localparam [7:0] RAW_STATUS_PARSER_ERROR = 8'h02;
-    localparam [7:0] RAW_STATUS_STALE = 8'h08;
-    localparam [7:0] PARSER_STATUS_OK = 8'h00;
-    localparam [7:0] PARSER_STATUS_BAD_LENGTH = 8'h01;
-    localparam [2:0] SOURCE_BMC_UART_TEXT = 3'd5;
-
-    assign raw_ready = sample_ready;
-
-    wire is_missing = (raw_integer_byte == 8'hff) && (raw_fraction_byte == 8'hff);
-    wire [15:0] integer_x100 =
-        ({8'd0, raw_integer_byte} << 6) +
-        ({8'd0, raw_integer_byte} << 5) +
-        ({8'd0, raw_integer_byte} << 2);
-    wire [15:0] converted_x100 = is_missing ? 16'd0 : integer_x100 + {8'd0, raw_fraction_byte};
-    wire [15:0] rounded_temp = is_missing ? 16'd0 :
-        {8'd0, raw_integer_byte} + ((raw_fraction_byte >= 8'd50) ? 16'd1 : 16'd0);
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            dimm_valid <= 1'b0;
-            source_id <= SOURCE_BMC_UART_TEXT;
-            dimm_frame_seq <= 16'd0;
-            dimm_sample_seq <= 16'd0;
-            raw_pair_index_out <= {CHW{1'b0}};
-            dimm_id <= {CHW{1'b0}};
-            channel <= {CHW{1'b0}};
-            raw_integer_byte_out <= 8'd0;
-            raw_fraction_byte_out <= 8'd0;
-            temp_q <= {DW{1'b0}};
-            temp_c_x100 <= 16'd0;
-            missing <= 1'b0;
-            fault <= 1'b0;
-            stale <= 1'b0;
-            age_ms_out <= 16'd0;
-            raw_status <= 8'd0;
-            parser_status <= PARSER_STATUS_OK;
-        end else begin
-            dimm_valid <= 1'b0;
-            if (raw_valid && raw_ready) begin
-                dimm_valid <= 1'b1;
-                source_id <= SOURCE_BMC_UART_TEXT;
-                dimm_frame_seq <= frame_seq;
-                dimm_sample_seq <= sample_seq_base + {11'd0, raw_pair_index};
-                raw_pair_index_out <= raw_pair_index;
-                dimm_id <= raw_pair_index;
-                channel <= raw_pair_index;
-                raw_integer_byte_out <= raw_integer_byte;
-                raw_fraction_byte_out <= raw_fraction_byte;
-                temp_q <= {{(DW-16){1'b0}}, rounded_temp};
-                temp_c_x100 <= converted_x100;
-                missing <= is_missing;
-                fault <= frame_bad_length;
-                stale <= sample_stale;
-                age_ms_out <= age_ms;
-                parser_status <= frame_bad_length ? PARSER_STATUS_BAD_LENGTH : PARSER_STATUS_OK;
-                raw_status <=
-                    (is_missing ? RAW_STATUS_MISSING_DIMM : 8'd0) |
-                    (frame_bad_length ? RAW_STATUS_PARSER_ERROR : 8'd0) |
-                    (sample_stale ? RAW_STATUS_STALE : 8'd0);
-            end
-        end
-    end
-
-    wire unused_expected_dimm_count = |EXPECTED_DIMM_COUNT;
-    wire unused_fraction_scale = |FRACTION_SCALE;
-
-endmodule

+ 0 - 385
src/rtl/bmc_uart_ascii_poll.v

@@ -1,385 +0,0 @@
-`timescale 1ns/1ps
-
-module bmc_uart_ascii_poll #(
-    parameter integer POLL_PERIOD_TICKS = 25000000,
-    parameter integer STALE_TIMEOUT_TICKS = 250000000,
-    parameter integer STARTUP_WAKE_COUNT = 3,
-    parameter integer STARTUP_WAKE_GAP_TICKS = 5000000,
-    parameter integer STARTUP_POST_WAKE_DELAY_TICKS = 12500000,
-    parameter [7:0] STARTUP_WAKE_BYTE = 8'h0d,
-    parameter integer FRAME_BYTES = 48,
-    parameter integer FRAME_BYTE_INDEX_WIDTH = 6,
-    parameter integer WAIT_FOR_FRAME_BEFORE_NEXT_POLL = 0,
-    parameter integer ALLOW_ALL_FF_FRAME = 0
-) (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       tx_ready,
-    output reg        tx_valid,
-    output reg [7:0]  tx_data,
-    input  wire       rx_valid,
-    input  wire [7:0] rx_data,
-    output reg        frame_valid,
-    output reg [7:0]  frame_byte,
-    output reg [FRAME_BYTE_INDEX_WIDTH-1:0] frame_index,
-    output reg [15:0] frame_seq,
-    output reg        frame_done,
-    output reg        parser_error,
-    output reg        stale,
-    output reg [2:0]  parser_state,
-    output reg [15:0] token_count,
-    output reg [15:0] rejected_echo_windows,
-    output reg [15:0] startup_wake_sent_count,
-    output reg [15:0] poll_command_count,
-    output reg [15:0] tx_byte_count,
-    output reg [15:0] rx_byte_count
-);
-
-    // Command text: ipmitool raw 0x36 0x6c 0xdf 0xdd 0x00 0x03
-    localparam integer COMMAND_LEN = 43;
-    localparam S_IDLE = 3'd0;
-    localparam S_SEND = 3'd1;
-    localparam S_RX = 3'd2;
-    localparam S_TOKEN = 3'd3;
-    localparam S_FRAME = 3'd4;
-    localparam TX_WAKE = 3'd0;
-    localparam TX_WAKE_GAP = 3'd1;
-    localparam TX_POST_WAKE = 3'd2;
-    localparam TX_POLL_WAIT = 3'd3;
-    localparam TX_SEND_COMMAND = 3'd4;
-    localparam [FRAME_BYTE_INDEX_WIDTH-1:0] FRAME_BYTES_W = FRAME_BYTES;
-    localparam [FRAME_BYTE_INDEX_WIDTH-1:0] FRAME_LAST_INDEX_W = FRAME_BYTES - 1;
-
-    reg [2:0] tx_state;
-    reg [31:0] tx_wait_counter;
-    reg [31:0] stale_counter;
-    reg [5:0] command_index;
-    reg [7:0] high_nibble;
-    reg have_high_nibble;
-    reg [7:0] byte_window [0:FRAME_BYTES-1];
-    reg [7:0] emit_window [0:FRAME_BYTES-1];
-    reg [FRAME_BYTE_INDEX_WIDTH-1:0] window_count;
-    reg [FRAME_BYTE_INDEX_WIDTH-1:0] emit_index;
-    reg emitting;
-    reg response_frame_accepted;
-    reg [7:0] candidate_byte;
-    reg candidate_ready;
-    reg [2:0] echo_match_count;
-    reg window_has_echo;
-    reg [5:0] valid_pair_count;
-    integer i;
-
-    function [7:0] command_char;
-        input [5:0] index;
-        begin
-            case (index)
-                6'd0: command_char = "i";
-                6'd1: command_char = "p";
-                6'd2: command_char = "m";
-                6'd3: command_char = "i";
-                6'd4: command_char = "t";
-                6'd5: command_char = "o";
-                6'd6: command_char = "o";
-                6'd7: command_char = "l";
-                6'd8: command_char = " ";
-                6'd9: command_char = "r";
-                6'd10: command_char = "a";
-                6'd11: command_char = "w";
-                6'd12: command_char = " ";
-                6'd13: command_char = "0";
-                6'd14: command_char = "x";
-                6'd15: command_char = "3";
-                6'd16: command_char = "6";
-                6'd17: command_char = " ";
-                6'd18: command_char = "0";
-                6'd19: command_char = "x";
-                6'd20: command_char = "6";
-                6'd21: command_char = "c";
-                6'd22: command_char = " ";
-                6'd23: command_char = "0";
-                6'd24: command_char = "x";
-                6'd25: command_char = "d";
-                6'd26: command_char = "f";
-                6'd27: command_char = " ";
-                6'd28: command_char = "0";
-                6'd29: command_char = "x";
-                6'd30: command_char = "d";
-                6'd31: command_char = "d";
-                6'd32: command_char = " ";
-                6'd33: command_char = "0";
-                6'd34: command_char = "x";
-                6'd35: command_char = "0";
-                6'd36: command_char = "0";
-                6'd37: command_char = " ";
-                6'd38: command_char = "0";
-                6'd39: command_char = "x";
-                6'd40: command_char = "0";
-                6'd41: command_char = "3";
-                6'd42: command_char = 8'h0a;
-                default: command_char = 8'h00;
-            endcase
-        end
-    endfunction
-
-    function is_hex_char;
-        input [7:0] ch;
-        begin
-            is_hex_char = ((ch >= "0") && (ch <= "9")) ||
-                          ((ch >= "a") && (ch <= "f")) ||
-                          ((ch >= "A") && (ch <= "F"));
-        end
-    endfunction
-
-    function [3:0] hex_value;
-        input [7:0] ch;
-        begin
-            if (ch >= "0" && ch <= "9") begin
-                hex_value = ch - "0";
-            end else if (ch >= "a" && ch <= "f") begin
-                hex_value = ch - "a" + 4'd10;
-            end else begin
-                hex_value = ch - "A" + 4'd10;
-            end
-        end
-    endfunction
-
-    function frame_window_valid;
-        input dummy;
-        integer pair_index;
-        reg [7:0] int_byte;
-        reg [7:0] frac_byte;
-        reg [5:0] present_count;
-        begin
-            present_count = 6'd0;
-            frame_window_valid = 1'b1;
-            for (pair_index = 0; pair_index < FRAME_BYTES / 2; pair_index = pair_index + 1) begin
-                int_byte = byte_window[pair_index * 2];
-                frac_byte = byte_window[(pair_index * 2) + 1];
-                if (int_byte == 8'hff && frac_byte == 8'hff) begin
-                end else if (frac_byte >= 8'd100) begin
-                    frame_window_valid = 1'b0;
-                end else begin
-                    present_count = present_count + 6'd1;
-                end
-            end
-            if (present_count == 6'd0 && ALLOW_ALL_FF_FRAME == 0) begin
-                frame_window_valid = 1'b0;
-            end
-        end
-    endfunction
-
-    function [2:0] next_echo_match;
-        input [2:0] current;
-        input [7:0] value;
-        begin
-            case (current)
-                3'd0: next_echo_match = (value == 8'h36) ? 3'd1 : 3'd0;
-                3'd1: next_echo_match = (value == 8'h6c) ? 3'd2 : ((value == 8'h36) ? 3'd1 : 3'd0);
-                3'd2: next_echo_match = (value == 8'hdf) ? 3'd3 : ((value == 8'h36) ? 3'd1 : 3'd0);
-                3'd3: next_echo_match = (value == 8'hdd) ? 3'd4 : ((value == 8'h36) ? 3'd1 : 3'd0);
-                3'd4: next_echo_match = (value == 8'h00) ? 3'd5 : ((value == 8'h36) ? 3'd1 : 3'd0);
-                3'd5: next_echo_match = (value == 8'h03) ? 3'd6 : ((value == 8'h36) ? 3'd1 : 3'd0);
-                default: next_echo_match = (value == 8'h36) ? 3'd1 : 3'd0;
-            endcase
-        end
-    endfunction
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            tx_state <= TX_WAKE;
-            tx_wait_counter <= 32'd0;
-            stale_counter <= 32'd0;
-            command_index <= 6'd0;
-            tx_valid <= 1'b0;
-            tx_data <= 8'd0;
-            frame_valid <= 1'b0;
-            frame_byte <= 8'd0;
-            frame_index <= {FRAME_BYTE_INDEX_WIDTH{1'b0}};
-            frame_seq <= 16'd0;
-            frame_done <= 1'b0;
-            parser_error <= 1'b0;
-            stale <= 1'b0;
-            parser_state <= S_IDLE;
-            token_count <= 16'd0;
-            rejected_echo_windows <= 16'd0;
-            startup_wake_sent_count <= 16'd0;
-            poll_command_count <= 16'd0;
-            tx_byte_count <= 16'd0;
-            rx_byte_count <= 16'd0;
-            high_nibble <= 8'd0;
-            have_high_nibble <= 1'b0;
-            window_count <= {FRAME_BYTE_INDEX_WIDTH{1'b0}};
-            emit_index <= {FRAME_BYTE_INDEX_WIDTH{1'b0}};
-            emitting <= 1'b0;
-            response_frame_accepted <= 1'b0;
-            candidate_byte <= 8'd0;
-            candidate_ready <= 1'b0;
-            echo_match_count <= 3'd0;
-            window_has_echo <= 1'b0;
-            valid_pair_count <= 6'd0;
-            for (i = 0; i < FRAME_BYTES; i = i + 1) begin
-                byte_window[i] <= 8'd0;
-                emit_window[i] <= 8'd0;
-            end
-        end else begin
-            tx_valid <= 1'b0;
-            frame_valid <= 1'b0;
-            frame_done <= 1'b0;
-            candidate_ready <= 1'b0;
-
-            if (stale_counter < STALE_TIMEOUT_TICKS) begin
-                stale_counter <= stale_counter + 32'd1;
-            end else begin
-                stale <= 1'b1;
-            end
-
-            if (tx_state == TX_WAKE) begin
-                if (STARTUP_WAKE_COUNT <= 0) begin
-                    tx_state <= TX_POST_WAKE;
-                    tx_wait_counter <= 32'd0;
-                end else if (tx_ready) begin
-                    tx_valid <= 1'b1;
-                    tx_data <= STARTUP_WAKE_BYTE;
-                    if (startup_wake_sent_count != 16'hffff) begin
-                        startup_wake_sent_count <= startup_wake_sent_count + 16'd1;
-                    end
-                    if (tx_byte_count != 16'hffff) begin
-                        tx_byte_count <= tx_byte_count + 16'd1;
-                    end
-                    tx_wait_counter <= 32'd0;
-                    if (startup_wake_sent_count + 16'd1 >= STARTUP_WAKE_COUNT[15:0]) begin
-                        tx_state <= TX_POST_WAKE;
-                    end else begin
-                        tx_state <= TX_WAKE_GAP;
-                    end
-                end
-            end else if (tx_state == TX_WAKE_GAP) begin
-                if (STARTUP_WAKE_GAP_TICKS <= 1 || tx_wait_counter == STARTUP_WAKE_GAP_TICKS - 1) begin
-                    tx_wait_counter <= 32'd0;
-                    tx_state <= TX_WAKE;
-                end else begin
-                    tx_wait_counter <= tx_wait_counter + 32'd1;
-                end
-            end else if (tx_state == TX_POST_WAKE) begin
-                if (STARTUP_POST_WAKE_DELAY_TICKS <= 1 || tx_wait_counter == STARTUP_POST_WAKE_DELAY_TICKS - 1) begin
-                    tx_wait_counter <= 32'd0;
-                    tx_state <= TX_SEND_COMMAND;
-                    command_index <= 6'd0;
-                end else begin
-                    tx_wait_counter <= tx_wait_counter + 32'd1;
-                end
-            end else if (tx_state == TX_POLL_WAIT) begin
-                if ((WAIT_FOR_FRAME_BEFORE_NEXT_POLL != 0) && !response_frame_accepted) begin
-                    tx_wait_counter <= 32'd0;
-                end else if (POLL_PERIOD_TICKS <= 1 || tx_wait_counter == POLL_PERIOD_TICKS - 1) begin
-                    tx_wait_counter <= 32'd0;
-                    tx_state <= TX_SEND_COMMAND;
-                    command_index <= 6'd0;
-                end else begin
-                    tx_wait_counter <= tx_wait_counter + 32'd1;
-                end
-            end else if (tx_state == TX_SEND_COMMAND && tx_ready) begin
-                tx_valid <= 1'b1;
-                tx_data <= command_char(command_index);
-                parser_state <= S_SEND;
-                if (tx_byte_count != 16'hffff) begin
-                    tx_byte_count <= tx_byte_count + 16'd1;
-                end
-                if (command_index == 6'd0) begin
-                    response_frame_accepted <= 1'b0;
-                    window_count <= {FRAME_BYTE_INDEX_WIDTH{1'b0}};
-                    echo_match_count <= 3'd0;
-                    window_has_echo <= 1'b0;
-                    have_high_nibble <= 1'b0;
-                end
-                if (command_index == COMMAND_LEN - 1) begin
-                    parser_state <= S_RX;
-                    command_index <= 6'd0;
-                    tx_state <= TX_POLL_WAIT;
-                    tx_wait_counter <= 32'd0;
-                    if (poll_command_count != 16'hffff) begin
-                        poll_command_count <= poll_command_count + 16'd1;
-                    end
-                end else begin
-                    command_index <= command_index + 6'd1;
-                end
-            end
-
-            if (rx_valid) begin
-                if (rx_byte_count != 16'hffff) begin
-                    rx_byte_count <= rx_byte_count + 16'd1;
-                end
-                parser_state <= S_TOKEN;
-                if (is_hex_char(rx_data)) begin
-                    if (!have_high_nibble) begin
-                        high_nibble <= {4'd0, hex_value(rx_data)};
-                        have_high_nibble <= 1'b1;
-                    end else begin
-                        candidate_byte <= {high_nibble[3:0], hex_value(rx_data)};
-                        candidate_ready <= 1'b1;
-                        have_high_nibble <= 1'b0;
-                        token_count <= token_count + 16'd1;
-                    end
-                end else begin
-                    have_high_nibble <= 1'b0;
-                end
-            end
-
-            if (candidate_ready) begin
-                for (i = 0; i < FRAME_BYTES - 1; i = i + 1) begin
-                    byte_window[i] = byte_window[i + 1];
-                end
-                byte_window[FRAME_BYTES - 1] = candidate_byte;
-                if (window_count < FRAME_BYTES_W) begin
-                    window_count <= window_count + {{(FRAME_BYTE_INDEX_WIDTH-1){1'b0}}, 1'b1};
-                end
-                if (next_echo_match(echo_match_count, candidate_byte) == 3'd6) begin
-                    echo_match_count <= 3'd0;
-                    window_has_echo <= 1'b0;
-                    window_count <= {FRAME_BYTE_INDEX_WIDTH{1'b0}};
-                    rejected_echo_windows <= rejected_echo_windows + 16'd1;
-                    parser_error <= 1'b0;
-                end else begin
-                    echo_match_count <= next_echo_match(echo_match_count, candidate_byte);
-                    if (!response_frame_accepted && !emitting && window_count >= FRAME_LAST_INDEX_W) begin
-                        if (window_has_echo) begin
-                            rejected_echo_windows <= rejected_echo_windows + 16'd1;
-                            window_has_echo <= 1'b0;
-                        end else if (frame_window_valid(1'b1)) begin
-                        for (i = 0; i < FRAME_BYTES; i = i + 1) begin
-                            emit_window[i] <= byte_window[i];
-                        end
-                            emitting <= 1'b1;
-                            response_frame_accepted <= 1'b1;
-                            emit_index <= {FRAME_BYTE_INDEX_WIDTH{1'b0}};
-                            frame_seq <= frame_seq + 16'd1;
-                            parser_error <= 1'b0;
-                            stale_counter <= 32'd0;
-                            stale <= 1'b0;
-                            parser_state <= S_FRAME;
-                        end else begin
-                            parser_error <= 1'b1;
-                        end
-                    end
-                end
-            end
-
-            if (emitting) begin
-                frame_valid <= 1'b1;
-                frame_index <= emit_index;
-                frame_byte <= emit_window[emit_index];
-                if (emit_index == FRAME_LAST_INDEX_W) begin
-                    emitting <= 1'b0;
-                    emit_index <= {FRAME_BYTE_INDEX_WIDTH{1'b0}};
-                    frame_done <= 1'b1;
-                    parser_state <= S_RX;
-                end else begin
-                    emit_index <= emit_index + {{(FRAME_BYTE_INDEX_WIDTH-1){1'b0}}, 1'b1};
-                end
-            end
-        end
-    end
-
-    wire [5:0] unused_valid_pair_count = valid_pair_count;
-
-endmodule

+ 0 - 73
src/rtl/bmc_uart_phy_bridge.v

@@ -1,73 +0,0 @@
-`timescale 1ns/1ps
-
-module bmc_uart_phy_bridge (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       core_tx_valid,
-    input  wire [7:0] core_tx_data,
-    output wire       core_tx_ready,
-    output reg        core_rx_valid,
-    output reg [7:0]  core_rx_data,
-    input  wire       phy_tx_ready,
-    output reg        phy_tx_valid,
-    output reg [7:0]  phy_tx_data,
-    input  wire       phy_rx_valid,
-    input  wire [7:0] phy_rx_data,
-    output reg        rx_overflow,
-    output reg        tx_overflow,
-    output wire [7:0] status
-);
-
-    reg tx_pending;
-    reg [7:0] tx_pending_data;
-
-    assign core_tx_ready = !tx_pending && phy_tx_ready;
-    assign status = {
-        4'd0,
-        tx_pending,
-        phy_tx_ready,
-        rx_overflow,
-        tx_overflow
-    };
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            core_rx_valid <= 1'b0;
-            core_rx_data <= 8'd0;
-            phy_tx_valid <= 1'b0;
-            phy_tx_data <= 8'd0;
-            rx_overflow <= 1'b0;
-            tx_overflow <= 1'b0;
-            tx_pending <= 1'b0;
-            tx_pending_data <= 8'd0;
-        end else begin
-            phy_tx_valid <= 1'b0;
-            core_rx_valid <= 1'b0;
-
-            if (phy_rx_valid) begin
-                if (core_rx_valid) begin
-                    rx_overflow <= 1'b1;
-                end
-                core_rx_data <= phy_rx_data;
-                core_rx_valid <= 1'b1;
-            end
-
-            if (tx_pending && phy_tx_ready) begin
-                phy_tx_data <= tx_pending_data;
-                phy_tx_valid <= 1'b1;
-                tx_pending <= 1'b0;
-            end else if (core_tx_valid) begin
-                if (phy_tx_ready && !tx_pending) begin
-                    phy_tx_data <= core_tx_data;
-                    phy_tx_valid <= 1'b1;
-                end else if (!tx_pending) begin
-                    tx_pending <= 1'b1;
-                    tx_pending_data <= core_tx_data;
-                end else begin
-                    tx_overflow <= 1'b1;
-                end
-            end
-        end
-    end
-
-endmodule

+ 0 - 307
src/rtl/bmc_uart_raw48_poll_lite.v

@@ -1,307 +0,0 @@
-`timescale 1ns/1ps
-
-module bmc_uart_raw48_poll_lite #(
-    parameter integer POLL_PERIOD_TICKS = 25000000,
-    parameter integer STARTUP_WAKE_COUNT = 3,
-    parameter integer STARTUP_WAKE_GAP_TICKS = 5000000,
-    parameter integer STARTUP_POST_WAKE_DELAY_TICKS = 12500000,
-    parameter [7:0] STARTUP_WAKE_BYTE = 8'h0d,
-    parameter integer WAIT_FOR_FRAME_BEFORE_NEXT_POLL = 1
-) (
-    input  wire       clk,
-    input  wire       rst_n,
-    input  wire       tx_ready,
-    output reg        tx_valid,
-    output reg [7:0]  tx_data,
-    input  wire       rx_valid,
-    input  wire [7:0] rx_data,
-    output reg        frame_valid,
-    output reg [7:0]  frame_byte,
-    output reg [5:0]  frame_index,
-    output reg [15:0] frame_seq,
-    output reg        frame_done,
-    output reg        parser_error,
-    output reg        stale,
-    output reg [2:0]  parser_state,
-    output reg [15:0] token_count,
-    output reg [15:0] rejected_echo_windows,
-    output reg [15:0] startup_wake_sent_count,
-    output reg [15:0] poll_command_count,
-    output reg [15:0] tx_byte_count,
-    output reg [15:0] rx_byte_count
-);
-
-    // Lightweight fixed-purpose replacement for bmc_uart_ascii_poll behavior in
-    // the host-sensor debug image. It sends one read-only raw command and accepts
-    // the first 48 response hex bytes after an optional command echo.
-    localparam integer COMMAND_LEN = 43;
-    localparam [2:0] TX_WAKE = 3'd0;
-    localparam [2:0] TX_WAKE_GAP = 3'd1;
-    localparam [2:0] TX_POST_WAKE = 3'd2;
-    localparam [2:0] TX_POLL_WAIT = 3'd3;
-    localparam [2:0] TX_SEND_COMMAND = 3'd4;
-    localparam [2:0] PARSER_IDLE = 3'd0;
-    localparam [2:0] PARSER_SEND = 3'd1;
-    localparam [2:0] PARSER_RX = 3'd2;
-    localparam [2:0] PARSER_TOKEN = 3'd3;
-    localparam [2:0] PARSER_FRAME = 3'd4;
-
-    reg [2:0] tx_state;
-    reg [31:0] tx_wait_counter;
-    reg [5:0] command_index;
-    reg [7:0] high_nibble;
-    reg have_high_nibble;
-    reg [7:0] echo_buffer [0:4];
-    reg [5:0] capture_count;
-    reg response_frame_accepted;
-    reg [7:0] candidate_byte;
-    reg candidate_ready;
-    integer i;
-
-    function [7:0] command_char;
-        input [5:0] index;
-        begin
-            case (index)
-                6'd0: command_char = "i";
-                6'd1: command_char = "p";
-                6'd2: command_char = "m";
-                6'd3: command_char = "i";
-                6'd4: command_char = "t";
-                6'd5: command_char = "o";
-                6'd6: command_char = "o";
-                6'd7: command_char = "l";
-                6'd8: command_char = " ";
-                6'd9: command_char = "r";
-                6'd10: command_char = "a";
-                6'd11: command_char = "w";
-                6'd12: command_char = " ";
-                6'd13: command_char = "0";
-                6'd14: command_char = "x";
-                6'd15: command_char = "3";
-                6'd16: command_char = "6";
-                6'd17: command_char = " ";
-                6'd18: command_char = "0";
-                6'd19: command_char = "x";
-                6'd20: command_char = "6";
-                6'd21: command_char = "c";
-                6'd22: command_char = " ";
-                6'd23: command_char = "0";
-                6'd24: command_char = "x";
-                6'd25: command_char = "d";
-                6'd26: command_char = "f";
-                6'd27: command_char = " ";
-                6'd28: command_char = "0";
-                6'd29: command_char = "x";
-                6'd30: command_char = "d";
-                6'd31: command_char = "d";
-                6'd32: command_char = " ";
-                6'd33: command_char = "0";
-                6'd34: command_char = "x";
-                6'd35: command_char = "0";
-                6'd36: command_char = "0";
-                6'd37: command_char = " ";
-                6'd38: command_char = "0";
-                6'd39: command_char = "x";
-                6'd40: command_char = "0";
-                6'd41: command_char = "3";
-                6'd42: command_char = 8'h0a;
-                default: command_char = 8'h00;
-            endcase
-        end
-    endfunction
-
-    function [7:0] echo_byte;
-        input [2:0] index;
-        begin
-            case (index)
-                3'd0: echo_byte = 8'h36;
-                3'd1: echo_byte = 8'h6c;
-                3'd2: echo_byte = 8'hdf;
-                3'd3: echo_byte = 8'hdd;
-                3'd4: echo_byte = 8'h00;
-                default: echo_byte = 8'h03;
-            endcase
-        end
-    endfunction
-
-    function is_hex_char;
-        input [7:0] ch;
-        begin
-            is_hex_char = ((ch >= "0") && (ch <= "9")) ||
-                          ((ch >= "a") && (ch <= "f")) ||
-                          ((ch >= "A") && (ch <= "F"));
-        end
-    endfunction
-
-    function [3:0] hex_value;
-        input [7:0] ch;
-        begin
-            if (ch >= "0" && ch <= "9") begin
-                hex_value = ch - "0";
-            end else if (ch >= "a" && ch <= "f") begin
-                hex_value = ch - "a" + 4'd10;
-            end else begin
-                hex_value = ch - "A" + 4'd10;
-            end
-        end
-    endfunction
-
-    function capture_is_echo;
-        input [7:0] last_byte;
-        begin
-            capture_is_echo =
-                echo_buffer[0] == echo_byte(3'd0) &&
-                echo_buffer[1] == echo_byte(3'd1) &&
-                echo_buffer[2] == echo_byte(3'd2) &&
-                echo_buffer[3] == echo_byte(3'd3) &&
-                echo_buffer[4] == echo_byte(3'd4) &&
-                last_byte == echo_byte(3'd5);
-        end
-    endfunction
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            tx_state <= TX_WAKE;
-            tx_wait_counter <= 32'd0;
-            command_index <= 6'd0;
-            tx_valid <= 1'b0;
-            tx_data <= 8'd0;
-            frame_valid <= 1'b0;
-            frame_byte <= 8'd0;
-            frame_index <= 6'd0;
-            frame_seq <= 16'd0;
-            frame_done <= 1'b0;
-            parser_error <= 1'b0;
-            stale <= 1'b0;
-            parser_state <= PARSER_IDLE;
-            token_count <= 16'd0;
-            rejected_echo_windows <= 16'd0;
-            startup_wake_sent_count <= 16'd0;
-            poll_command_count <= 16'd0;
-            tx_byte_count <= 16'd0;
-            rx_byte_count <= 16'd0;
-            high_nibble <= 8'd0;
-            have_high_nibble <= 1'b0;
-            capture_count <= 6'd0;
-            response_frame_accepted <= 1'b0;
-            candidate_byte <= 8'd0;
-            candidate_ready <= 1'b0;
-            for (i = 0; i < 5; i = i + 1) begin
-                echo_buffer[i] <= 8'd0;
-            end
-        end else begin
-            tx_valid <= 1'b0;
-            frame_valid <= 1'b0;
-            frame_done <= 1'b0;
-            candidate_ready <= 1'b0;
-
-            if (tx_state == TX_WAKE) begin
-                if (STARTUP_WAKE_COUNT <= 0) begin
-                    tx_state <= TX_POST_WAKE;
-                    tx_wait_counter <= 32'd0;
-                end else if (tx_ready) begin
-                    tx_valid <= 1'b1;
-                    tx_data <= STARTUP_WAKE_BYTE;
-                    tx_wait_counter <= 32'd0;
-                    startup_wake_sent_count <= startup_wake_sent_count + 16'd1;
-                    tx_byte_count <= tx_byte_count + 16'd1;
-                    if (startup_wake_sent_count + 16'd1 >= STARTUP_WAKE_COUNT[15:0]) begin
-                        tx_state <= TX_POST_WAKE;
-                    end else begin
-                        tx_state <= TX_WAKE_GAP;
-                    end
-                end
-            end else if (tx_state == TX_WAKE_GAP) begin
-                if (STARTUP_WAKE_GAP_TICKS <= 1 || tx_wait_counter == STARTUP_WAKE_GAP_TICKS - 1) begin
-                    tx_wait_counter <= 32'd0;
-                    tx_state <= TX_WAKE;
-                end else begin
-                    tx_wait_counter <= tx_wait_counter + 32'd1;
-                end
-            end else if (tx_state == TX_POST_WAKE) begin
-                if (STARTUP_POST_WAKE_DELAY_TICKS <= 1 || tx_wait_counter == STARTUP_POST_WAKE_DELAY_TICKS - 1) begin
-                    tx_wait_counter <= 32'd0;
-                    tx_state <= TX_SEND_COMMAND;
-                    command_index <= 6'd0;
-                end else begin
-                    tx_wait_counter <= tx_wait_counter + 32'd1;
-                end
-            end else if (tx_state == TX_POLL_WAIT) begin
-                if ((WAIT_FOR_FRAME_BEFORE_NEXT_POLL != 0) && !response_frame_accepted) begin
-                    tx_wait_counter <= 32'd0;
-                end else if (POLL_PERIOD_TICKS <= 1 || tx_wait_counter == POLL_PERIOD_TICKS - 1) begin
-                    tx_wait_counter <= 32'd0;
-                    tx_state <= TX_SEND_COMMAND;
-                    command_index <= 6'd0;
-                end else begin
-                    tx_wait_counter <= tx_wait_counter + 32'd1;
-                end
-            end else if (tx_state == TX_SEND_COMMAND && tx_ready) begin
-                tx_valid <= 1'b1;
-                tx_data <= command_char(command_index);
-                parser_state <= PARSER_SEND;
-                tx_byte_count <= tx_byte_count + 16'd1;
-                if (command_index == 6'd0) begin
-                    response_frame_accepted <= 1'b0;
-                    capture_count <= 6'd0;
-                    have_high_nibble <= 1'b0;
-                    parser_error <= 1'b0;
-                    stale <= 1'b0;
-                end
-                if (command_index == COMMAND_LEN - 1) begin
-                    command_index <= 6'd0;
-                    tx_state <= TX_POLL_WAIT;
-                    tx_wait_counter <= 32'd0;
-                    poll_command_count <= poll_command_count + 16'd1;
-                    parser_state <= PARSER_RX;
-                end else begin
-                    command_index <= command_index + 6'd1;
-                end
-            end
-
-            if (rx_valid) begin
-                rx_byte_count <= rx_byte_count + 16'd1;
-                parser_state <= PARSER_TOKEN;
-                if (is_hex_char(rx_data)) begin
-                    if (!have_high_nibble) begin
-                        high_nibble <= {4'd0, hex_value(rx_data)};
-                        have_high_nibble <= 1'b1;
-                    end else begin
-                        candidate_byte <= {high_nibble[3:0], hex_value(rx_data)};
-                        candidate_ready <= 1'b1;
-                        have_high_nibble <= 1'b0;
-                        token_count <= token_count + 16'd1;
-                    end
-                end else begin
-                    have_high_nibble <= 1'b0;
-                end
-            end
-
-            if (candidate_ready && !response_frame_accepted) begin
-                if (capture_count < 6'd5) begin
-                    echo_buffer[capture_count[2:0]] <= candidate_byte;
-                end
-                if (capture_count == 6'd5 && capture_is_echo(candidate_byte)) begin
-                    capture_count <= 6'd0;
-                    rejected_echo_windows <= rejected_echo_windows + 16'd1;
-                end else if (capture_count == 6'd47) begin
-                    capture_count <= 6'd0;
-                    response_frame_accepted <= 1'b1;
-                    frame_seq <= frame_seq + 16'd1;
-                    frame_valid <= 1'b1;
-                    frame_index <= capture_count;
-                    frame_byte <= candidate_byte;
-                    frame_done <= 1'b1;
-                    parser_error <= 1'b0;
-                    stale <= 1'b0;
-                    parser_state <= PARSER_FRAME;
-                end else begin
-                    frame_valid <= 1'b1;
-                    frame_index <= capture_count;
-                    frame_byte <= candidate_byte;
-                    capture_count <= capture_count + 6'd1;
-                end
-            end
-        end
-    end
-endmodule

+ 0 - 19
src/rtl/board_io_adapter.v

@@ -1,19 +0,0 @@
-`timescale 1ns/1ps
-
-module board_io_adapter #(
-    parameter integer PTC_COUNT = 24,
-    parameter integer FAN_COUNT = 8
-) (
-    input  wire [PTC_COUNT-1:0] ptc_pwm_request,
-    input  wire [FAN_COUNT-1:0] fan_pwm_logic_high,
-    input  wire [FAN_COUNT-1:0] fan_pwm_drive_low,
-    output wire [PTC_COUNT-1:0] ptc_pwm_pin_o,
-    output wire [FAN_COUNT-1:0] fan_pwm_pin_o,
-    output wire [FAN_COUNT-1:0] fan_pwm_pin_oe
-);
-
-    assign ptc_pwm_pin_o = ptc_pwm_request;
-    assign fan_pwm_pin_o = {FAN_COUNT{1'b0}};
-    assign fan_pwm_pin_oe = fan_pwm_drive_low & ~fan_pwm_logic_high;
-
-endmodule

+ 0 - 275
src/rtl/control_service_24ch.v

@@ -1,275 +0,0 @@
-`timescale 1ns/1ps
-
-module control_service_24ch #(
-    parameter integer DW = 18,
-    parameter integer CHW = 5,
-    parameter integer CHANNEL_COUNT = 24,
-    parameter signed [DW-1:0] OUT_MIN = 18'sd0,
-    parameter signed [DW-1:0] OUT_MAX = 18'sd127,
-    parameter signed [DW-1:0] POWER_LIMIT = 18'sd90,
-    parameter signed [DW-1:0] TARGET_TOLERANCE_Q = 18'sd7,
-    parameter signed [DW-1:0] KP_Q = 18'sd4,
-    parameter signed [DW-1:0] KI_Q = 18'sd1
-) (
-    input  wire                         clk,
-    input  wire                         rst_n,
-    input  wire                         sensor_valid,
-    output wire                         sensor_ready,
-    input  wire                         sensor_fault,
-    input  wire [CHW-1:0]               sensor_channel,
-    input  wire signed [DW-1:0]         sensor_temp_q,
-    input  wire [15:0]                  sensor_sample_seq,
-    input  wire                         host_enable,
-    input  wire signed [DW-1:0]         host_target_q,
-    input  wire signed [DW-1:0]         host_a0,
-    input  wire signed [DW-1:0]         host_a1,
-    input  wire signed [DW-1:0]         host_a2,
-    input  wire [1:0]                   control_mode,
-    input  wire [15:0]                  host_config_seq,
-    input  wire                         clear_history_all,
-    input  wire signed [DW-1:0]         manual_level_q,
-    output reg                          result_valid,
-    output reg  [CHW-1:0]               result_channel,
-    output reg  signed [DW-1:0]         result_error_q,
-    output reg  signed [DW-1:0]         result_ctrl_q,
-    output reg                          result_fault,
-    output reg  [15:0]                  result_sample_seq,
-    output reg  [1:0]                   result_control_mode,
-    output reg                          result_experimental,
-    output reg                          result_clamped,
-    output reg                          result_history_cleared,
-    output wire [1:0]                   state,
-    output reg  [2:0]                   cycle_phase,
-    output wire                         busy
-);
-
-    localparam [1:0] CONTROL_MODE_SAFE_OFF = 2'd0;
-    localparam [1:0] CONTROL_MODE_HYSTERESIS_PI_DEFAULT = 2'd1;
-    localparam [1:0] CONTROL_MODE_MANUAL_LEVEL = 2'd2;
-    localparam [1:0] CONTROL_MODE_INCREMENTAL_PID_EXPERIMENTAL = 2'd3;
-
-    wire sched_ready;
-    wire sched_valid;
-    wire [CHW-1:0] sched_channel;
-    wire signed [DW-1:0] sched_error_q;
-    wire signed [DW-1:0] sched_ctrl_q;
-    wire sched_done;
-    wire sched_fault;
-    wire [15:0] sched_sample_seq;
-    wire signed [DW-1:0] sched_ctrl_prev_q;
-    wire signed [DW-1:0] sched_delta_q;
-    wire sched_clamped;
-    wire sched_history_cleared;
-    wire [1:0] sched_state;
-    wire [2:0] sched_cycle_phase;
-    wire sched_busy;
-
-    pid_24ch_scheduler #(
-        .DW(DW),
-        .CHW(CHW),
-        .CHANNEL_COUNT(CHANNEL_COUNT),
-        .OUT_MIN(OUT_MIN),
-        .OUT_MAX(OUT_MAX)
-    ) u_incremental_scheduler (
-        .clk(clk),
-        .rst_n(rst_n),
-        .sensor_valid(sensor_valid && control_mode == CONTROL_MODE_INCREMENTAL_PID_EXPERIMENTAL),
-        .sensor_ready(sched_ready),
-        .sensor_fault(sensor_fault),
-        .sensor_channel(sensor_channel),
-        .sensor_temp_q(sensor_temp_q),
-        .sensor_sample_seq(sensor_sample_seq),
-        .host_enable(host_enable),
-        .host_target_q(host_target_q),
-        .host_a0(host_a0),
-        .host_a1(host_a1),
-        .host_a2(host_a2),
-        .host_mode(control_mode),
-        .host_config_seq(host_config_seq),
-        .clear_history_all(clear_history_all),
-        .pid_valid(sched_valid),
-        .pid_channel(sched_channel),
-        .pid_error_q(sched_error_q),
-        .pid_ctrl_q(sched_ctrl_q),
-        .pid_done(sched_done),
-        .pid_fault(sched_fault),
-        .pid_sample_seq(sched_sample_seq),
-        .pid_ctrl_prev_q(sched_ctrl_prev_q),
-        .pid_delta_q(sched_delta_q),
-        .pid_clamped(sched_clamped),
-        .pid_history_cleared(sched_history_cleared),
-        .pid_state(sched_state),
-        .pid_cycle_phase(sched_cycle_phase),
-        .busy(sched_busy)
-    );
-
-    localparam S_IDLE = 2'd0;
-    localparam S_UPDATE = 2'd1;
-
-    reg [1:0] local_state;
-    reg signed [DW-1:0] integral_mem [0:CHANNEL_COUNT-1];
-    reg [CHW-1:0] active_channel;
-    reg [15:0] active_sample_seq;
-    reg signed [DW-1:0] active_error;
-    reg active_fault;
-    reg active_host_enable;
-    reg [1:0] active_mode;
-    reg signed [DW-1:0] active_manual_level;
-    reg signed [(2*DW):0] raw_ctrl;
-    reg signed [DW-1:0] next_integral;
-    integer i;
-
-    assign sensor_ready = (control_mode == CONTROL_MODE_INCREMENTAL_PID_EXPERIMENTAL) ? sched_ready : (local_state == S_IDLE);
-    assign busy = (control_mode == CONTROL_MODE_INCREMENTAL_PID_EXPERIMENTAL) ? sched_busy : (local_state != S_IDLE);
-    assign state = (control_mode == CONTROL_MODE_INCREMENTAL_PID_EXPERIMENTAL) ? sched_state : local_state;
-
-    function signed [DW-1:0] clamp_output;
-        input signed [(2*DW):0] value;
-        begin
-            if (value > $signed(POWER_LIMIT)) begin
-                clamp_output = POWER_LIMIT;
-            end else if (value > $signed(OUT_MAX)) begin
-                clamp_output = OUT_MAX;
-            end else if (value < $signed(OUT_MIN)) begin
-                clamp_output = OUT_MIN;
-            end else begin
-                clamp_output = value[DW-1:0];
-            end
-        end
-    endfunction
-
-    function signed [DW-1:0] clamp_hard_output;
-        input signed [(2*DW):0] value;
-        begin
-            if (value > $signed(OUT_MAX)) begin
-                clamp_hard_output = OUT_MAX;
-            end else if (value < $signed(OUT_MIN)) begin
-                clamp_hard_output = OUT_MIN;
-            end else begin
-                clamp_hard_output = value[DW-1:0];
-            end
-        end
-    endfunction
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            local_state <= S_IDLE;
-            active_channel <= {CHW{1'b0}};
-            active_sample_seq <= 16'd0;
-            active_error <= {DW{1'b0}};
-            active_fault <= 1'b0;
-            active_host_enable <= 1'b0;
-            active_mode <= CONTROL_MODE_SAFE_OFF;
-            active_manual_level <= {DW{1'b0}};
-            raw_ctrl <= {(2*DW+1){1'b0}};
-            next_integral <= {DW{1'b0}};
-            result_valid <= 1'b0;
-            result_channel <= {CHW{1'b0}};
-            result_error_q <= {DW{1'b0}};
-            result_ctrl_q <= {DW{1'b0}};
-            result_fault <= 1'b0;
-            result_sample_seq <= 16'd0;
-            result_control_mode <= CONTROL_MODE_SAFE_OFF;
-            result_experimental <= 1'b0;
-            result_clamped <= 1'b0;
-            result_history_cleared <= 1'b0;
-            cycle_phase <= 3'd0;
-            for (i = 0; i < CHANNEL_COUNT; i = i + 1) begin
-                integral_mem[i] <= {DW{1'b0}};
-            end
-        end else begin
-            result_valid <= 1'b0;
-            result_clamped <= 1'b0;
-            result_history_cleared <= 1'b0;
-            cycle_phase <= 3'd0;
-
-            if (control_mode == CONTROL_MODE_INCREMENTAL_PID_EXPERIMENTAL) begin
-                if (sched_valid) begin
-                    result_valid <= sched_valid;
-                    result_channel <= sched_channel;
-                    result_error_q <= sched_error_q;
-                    result_ctrl_q <= sched_ctrl_q;
-                    result_fault <= sched_fault;
-                    result_sample_seq <= sched_sample_seq;
-                    result_control_mode <= CONTROL_MODE_INCREMENTAL_PID_EXPERIMENTAL;
-                    result_experimental <= 1'b1;
-                    result_clamped <= sched_clamped;
-                    result_history_cleared <= sched_history_cleared;
-                    cycle_phase <= sched_cycle_phase;
-                end
-            end else if (clear_history_all) begin
-                for (i = 0; i < CHANNEL_COUNT; i = i + 1) begin
-                    integral_mem[i] <= {DW{1'b0}};
-                end
-                result_history_cleared <= 1'b1;
-                local_state <= S_IDLE;
-            end else begin
-                case (local_state)
-                    S_IDLE: begin
-                        if (sensor_valid && sensor_ready) begin
-                            active_channel <= sensor_channel;
-                            active_sample_seq <= sensor_sample_seq;
-                            active_error <= host_target_q - sensor_temp_q;
-                            active_fault <= sensor_fault | (sensor_channel >= CHANNEL_COUNT);
-                            active_host_enable <= host_enable;
-                            active_mode <= control_mode;
-                            active_manual_level <= manual_level_q;
-                            cycle_phase <= 3'd1;
-                            local_state <= S_UPDATE;
-                        end
-                    end
-
-                    S_UPDATE: begin
-                        result_valid <= 1'b1;
-                        result_channel <= active_channel;
-                        result_sample_seq <= active_sample_seq;
-                        result_error_q <= active_error;
-                        result_fault <= active_fault;
-                        result_control_mode <= active_mode;
-                        result_experimental <= 1'b0;
-                        cycle_phase <= 3'd3;
-                        if (active_fault || !active_host_enable || active_mode == CONTROL_MODE_SAFE_OFF) begin
-                            result_ctrl_q <= {DW{1'b0}};
-                            if (active_channel < CHANNEL_COUNT) begin
-                                integral_mem[active_channel] <= {DW{1'b0}};
-                            end
-                            result_history_cleared <= 1'b1;
-                        end else if (active_mode == CONTROL_MODE_MANUAL_LEVEL) begin
-                            result_ctrl_q <= clamp_hard_output(active_manual_level);
-                            result_clamped <= active_manual_level != clamp_hard_output(active_manual_level);
-                        end else begin
-                            if (active_error <= -TARGET_TOLERANCE_Q) begin
-                                result_ctrl_q <= {DW{1'b0}};
-                                integral_mem[active_channel] <= {DW{1'b0}};
-                                result_clamped <= 1'b1;
-                                result_history_cleared <= 1'b1;
-                            end else begin
-                                if (active_error >= TARGET_TOLERANCE_Q) begin
-                                    next_integral = integral_mem[active_channel] + active_error;
-                                    raw_ctrl = ($signed(KP_Q) * $signed(active_error)) + ($signed(KI_Q) * $signed(next_integral));
-                                end else begin
-                                    next_integral = integral_mem[active_channel];
-                                    if (active_error > 0) begin
-                                        next_integral = integral_mem[active_channel] + active_error;
-                                    end
-                                    raw_ctrl = $signed(KI_Q) * $signed(next_integral);
-                                end
-                                integral_mem[active_channel] <= next_integral;
-                                result_ctrl_q <= clamp_output(raw_ctrl);
-                                result_clamped <= (raw_ctrl > $signed(POWER_LIMIT)) ||
-                                                  (raw_ctrl > $signed(OUT_MAX)) ||
-                                                  (raw_ctrl < $signed(OUT_MIN));
-                            end
-                        end
-                        local_state <= S_IDLE;
-                    end
-
-                    default: begin
-                        local_state <= S_IDLE;
-                    end
-                endcase
-            end
-        end
-    end
-
-endmodule

+ 0 - 45
src/rtl/debug_probe_bus.v

@@ -1,45 +0,0 @@
-`timescale 1ns/1ps
-
-module debug_probe_bus #(
-    parameter integer DW = 18
-) (
-    input  wire        sensor_valid,
-    input  wire        sensor_ready,
-    input  wire [2:0]  source_select,
-    input  wire [2:0]  sensor_source_id,
-    input  wire [4:0]  channel,
-    input  wire [2:0]  pid_cycle_phase,
-    input  wire [1:0]  pid_state,
-    input  wire        pid_done,
-    input  wire        pid_fault,
-    input  wire [3:0]  fault_code,
-    input  wire [3:0]  force_off_reason,
-    input  wire [23:0] ptc_pwm_out,
-    input  wire [5:0]  fan_pwm_drive_low,
-    input  wire [15:0] tach_window_edges,
-    input  wire [15:0] rpm_estimate,
-    input  wire [DW-1:0] ctrl_q,
-    output wire [127:0] probe_bus
-);
-
-    assign probe_bus = {
-        22'd0,
-        rpm_estimate,
-        tach_window_edges,
-        fan_pwm_drive_low,
-        ptc_pwm_out,
-        ctrl_q[15:0],
-        force_off_reason,
-        fault_code,
-        pid_fault,
-        pid_done,
-        pid_state,
-        pid_cycle_phase,
-        channel,
-        sensor_source_id,
-        source_select,
-        sensor_ready,
-        sensor_valid
-    };
-
-endmodule

+ 0 - 51
src/rtl/debug_register_window.v

@@ -1,51 +0,0 @@
-`timescale 1ns/1ps
-
-module debug_register_window (
-    input  wire [7:0]  reg_addr,
-    input  wire [15:0] trace_seq,
-    input  wire [15:0] event_count,
-    input  wire [7:0]  write_ptr,
-    input  wire        frozen,
-    input  wire        overflow,
-    input  wire [3:0]  last_event_type,
-    input  wire [3:0]  last_fault_code,
-    input  wire [3:0]  last_force_off_reason,
-    input  wire [4:0]  last_channel,
-    input  wire [2:0]  last_source_id,
-    input  wire [23:0] last_ptc_pwm_bitmap,
-    input  wire [5:0]  last_fan_pwm_drive_low,
-    input  wire [31:0] trace_read_data,
-    output reg         hit,
-    output reg  [7:0]  reg_data
-);
-
-    always @(*) begin
-        hit = 1'b1;
-        case (reg_addr)
-            8'h80: reg_data = trace_seq[7:0];
-            8'h81: reg_data = trace_seq[15:8];
-            8'h82: reg_data = event_count[7:0];
-            8'h83: reg_data = event_count[15:8];
-            8'h84: reg_data = {6'd0, overflow, frozen};
-            8'h85: reg_data = {4'd0, last_event_type};
-            8'h86: reg_data = {4'd0, last_fault_code};
-            8'h87: reg_data = {4'd0, last_force_off_reason};
-            8'h88: reg_data = {3'd0, last_channel};
-            8'h89: reg_data = {5'd0, last_source_id};
-            8'h8a: reg_data = last_ptc_pwm_bitmap[7:0];
-            8'h8b: reg_data = last_ptc_pwm_bitmap[15:8];
-            8'h8c: reg_data = last_ptc_pwm_bitmap[23:16];
-            8'h8d: reg_data = {2'd0, last_fan_pwm_drive_low};
-            8'h8e: reg_data = write_ptr;
-            8'h90: reg_data = trace_read_data[7:0];
-            8'h91: reg_data = trace_read_data[15:8];
-            8'h92: reg_data = trace_read_data[23:16];
-            8'h93: reg_data = trace_read_data[31:24];
-            default: begin
-                hit = 1'b0;
-                reg_data = 8'd0;
-            end
-        endcase
-    end
-
-endmodule

+ 0 - 145
src/rtl/debug_snapshot_v2.v

@@ -1,145 +0,0 @@
-`timescale 1ns/1ps
-
-module debug_snapshot_v2 #(
-    parameter integer DW = 18,
-    parameter integer CHW = 5,
-    parameter integer FAN_COUNT = 6
-) (
-    input  wire                 clk,
-    input  wire                 rst_n,
-    input  wire [2:0]           sensor_source_id,
-    input  wire                 sensor_valid,
-    input  wire                 sensor_ready,
-    input  wire                 sensor_fault,
-    input  wire                 sensor_stale,
-    input  wire [CHW-1:0]       sensor_channel,
-    input  wire signed [DW-1:0] sensor_temp_q,
-    input  wire [15:0]          sensor_sample_seq,
-    input  wire                 host_enable,
-    input  wire [15:0]          host_config_seq,
-    input  wire signed [DW-1:0] pid_error_q,
-    input  wire signed [DW-1:0] pid_ctrl_q,
-    input  wire                 pid_done,
-    input  wire                 pid_fault,
-    input  wire                 global_enable,
-    input  wire                 fault_latched,
-    input  wire [3:0]           fault_code,
-    input  wire                 ptc_enable,
-    input  wire [DW-1:0]        ptc_duty_or_level,
-    input  wire                 ptc_force_off,
-    input  wire [3:0]           ptc_reason,
-    input  wire                 fan_enable,
-    input  wire [DW-1:0]        fan_duty_or_level,
-    input  wire [23:0]          ptc_pwm_out,
-    input  wire [FAN_COUNT-1:0] fan_pwm_logic_high,
-    input  wire [FAN_COUNT-1:0] fan_pwm_drive_low,
-    input  wire [15:0]          fan_tach_count,
-    input  wire [15:0]          fan_tach_window_edges,
-    input  wire [15:0]          fan_rpm_estimate,
-    input  wire                 motor_enable,
-    input  wire [1:0]           motor_dir,
-    output reg  [15:0]          trace_seq,
-    output reg  [2:0]           snap_source_id,
-    output reg                  snap_sensor_valid,
-    output reg                  snap_sensor_ready,
-    output reg                  snap_sensor_fault,
-    output reg                  snap_sensor_stale,
-    output reg  [CHW-1:0]       snap_channel,
-    output reg  signed [DW-1:0] snap_temp_q,
-    output reg  [15:0]          snap_sample_seq,
-    output reg                  snap_host_enable,
-    output reg  [15:0]          snap_config_seq,
-    output reg  signed [DW-1:0] snap_pid_error_q,
-    output reg  signed [DW-1:0] snap_pid_ctrl_q,
-    output reg                  snap_pid_done,
-    output reg                  snap_pid_fault,
-    output reg                  snap_global_enable,
-    output reg                  snap_fault_latched,
-    output reg  [3:0]           snap_fault_code,
-    output reg                  snap_ptc_enable,
-    output reg  [DW-1:0]        snap_ptc_duty_or_level,
-    output reg                  snap_ptc_force_off,
-    output reg  [3:0]           snap_ptc_reason,
-    output reg                  snap_fan_enable,
-    output reg  [DW-1:0]        snap_fan_duty_or_level,
-    output reg  [23:0]          snap_ptc_pwm_out,
-    output reg  [FAN_COUNT-1:0] snap_fan_pwm_logic_high,
-    output reg  [FAN_COUNT-1:0] snap_fan_pwm_drive_low,
-    output reg  [15:0]          snap_fan_tach_count,
-    output reg  [15:0]          snap_fan_tach_window_edges,
-    output reg  [15:0]          snap_fan_rpm_estimate,
-    output reg                  snap_motor_enable,
-    output reg  [1:0]           snap_motor_dir
-);
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            trace_seq <= 16'd0;
-            snap_source_id <= 3'd0;
-            snap_sensor_valid <= 1'b0;
-            snap_sensor_ready <= 1'b0;
-            snap_sensor_fault <= 1'b0;
-            snap_sensor_stale <= 1'b0;
-            snap_channel <= {CHW{1'b0}};
-            snap_temp_q <= {DW{1'b0}};
-            snap_sample_seq <= 16'd0;
-            snap_host_enable <= 1'b0;
-            snap_config_seq <= 16'd0;
-            snap_pid_error_q <= {DW{1'b0}};
-            snap_pid_ctrl_q <= {DW{1'b0}};
-            snap_pid_done <= 1'b0;
-            snap_pid_fault <= 1'b0;
-            snap_global_enable <= 1'b0;
-            snap_fault_latched <= 1'b0;
-            snap_fault_code <= 4'd0;
-            snap_ptc_enable <= 1'b0;
-            snap_ptc_duty_or_level <= {DW{1'b0}};
-            snap_ptc_force_off <= 1'b1;
-            snap_ptc_reason <= 4'd1;
-            snap_fan_enable <= 1'b0;
-            snap_fan_duty_or_level <= {DW{1'b0}};
-            snap_ptc_pwm_out <= 24'd0;
-            snap_fan_pwm_logic_high <= {FAN_COUNT{1'b0}};
-            snap_fan_pwm_drive_low <= {FAN_COUNT{1'b0}};
-            snap_fan_tach_count <= 16'd0;
-            snap_fan_tach_window_edges <= 16'd0;
-            snap_fan_rpm_estimate <= 16'd0;
-            snap_motor_enable <= 1'b0;
-            snap_motor_dir <= 2'd0;
-        end else begin
-            trace_seq <= trace_seq + 16'd1;
-            snap_source_id <= sensor_source_id;
-            snap_sensor_valid <= sensor_valid;
-            snap_sensor_ready <= sensor_ready;
-            snap_sensor_fault <= sensor_fault;
-            snap_sensor_stale <= sensor_stale;
-            snap_channel <= sensor_channel;
-            snap_temp_q <= sensor_temp_q;
-            snap_sample_seq <= sensor_sample_seq;
-            snap_host_enable <= host_enable;
-            snap_config_seq <= host_config_seq;
-            snap_pid_error_q <= pid_error_q;
-            snap_pid_ctrl_q <= pid_ctrl_q;
-            snap_pid_done <= pid_done;
-            snap_pid_fault <= pid_fault;
-            snap_global_enable <= global_enable;
-            snap_fault_latched <= fault_latched;
-            snap_fault_code <= fault_code;
-            snap_ptc_enable <= ptc_enable;
-            snap_ptc_duty_or_level <= ptc_duty_or_level;
-            snap_ptc_force_off <= ptc_force_off;
-            snap_ptc_reason <= ptc_reason;
-            snap_fan_enable <= fan_enable;
-            snap_fan_duty_or_level <= fan_duty_or_level;
-            snap_ptc_pwm_out <= ptc_pwm_out;
-            snap_fan_pwm_logic_high <= fan_pwm_logic_high;
-            snap_fan_pwm_drive_low <= fan_pwm_drive_low;
-            snap_fan_tach_count <= fan_tach_count;
-            snap_fan_tach_window_edges <= fan_tach_window_edges;
-            snap_fan_rpm_estimate <= fan_rpm_estimate;
-            snap_motor_enable <= motor_enable;
-            snap_motor_dir <= motor_dir;
-        end
-    end
-
-endmodule

+ 0 - 66
src/rtl/debug_trace_recorder_bram.v

@@ -1,66 +0,0 @@
-`timescale 1ns/1ps
-
-module debug_trace_recorder_bram #(
-    parameter integer DEPTH = 64,
-    parameter integer ADDR_W = 6,
-    parameter integer EVENT_WIDTH = 128
-) (
-    input  wire                   clk,
-    input  wire                   rst_n,
-    input  wire                   clear,
-    input  wire                   write_valid,
-    input  wire [EVENT_WIDTH-1:0] event_data,
-    input  wire                   trigger_freeze,
-    input  wire [ADDR_W-1:0]      read_addr,
-    output wire [EVENT_WIDTH-1:0] read_data,
-    output reg  [ADDR_W-1:0]      write_ptr,
-    output reg  [ADDR_W:0]        write_count,
-    output reg                    frozen,
-    output reg                    overflow
-);
-
-    reg [EVENT_WIDTH-1:0] mem [0:DEPTH-1];
-    integer i;
-    localparam [ADDR_W-1:0] LAST_ADDR = DEPTH - 1;
-    localparam [ADDR_W:0] DEPTH_COUNT = DEPTH;
-
-    assign read_data = (read_addr < DEPTH) ? mem[read_addr] : {EVENT_WIDTH{1'b0}};
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            write_ptr <= {ADDR_W{1'b0}};
-            write_count <= {(ADDR_W+1){1'b0}};
-            frozen <= 1'b0;
-            overflow <= 1'b0;
-            for (i = 0; i < DEPTH; i = i + 1) begin
-                mem[i] <= {EVENT_WIDTH{1'b0}};
-            end
-        end else if (clear) begin
-            write_ptr <= {ADDR_W{1'b0}};
-            write_count <= {(ADDR_W+1){1'b0}};
-            frozen <= 1'b0;
-            overflow <= 1'b0;
-            for (i = 0; i < DEPTH; i = i + 1) begin
-                mem[i] <= {EVENT_WIDTH{1'b0}};
-            end
-        end else begin
-            if (trigger_freeze) begin
-                frozen <= 1'b1;
-            end
-            if (write_valid && !frozen && !trigger_freeze) begin
-                mem[write_ptr] <= event_data;
-                if (write_ptr == LAST_ADDR) begin
-                    write_ptr <= {ADDR_W{1'b0}};
-                end else begin
-                    write_ptr <= write_ptr + {{(ADDR_W-1){1'b0}}, 1'b1};
-                end
-                if (write_count < DEPTH_COUNT) begin
-                    write_count <= write_count + {{ADDR_W{1'b0}}, 1'b1};
-                end else begin
-                    overflow <= 1'b1;
-                end
-            end
-        end
-    end
-
-endmodule

+ 0 - 35
src/rtl/debug_trigger_unit.v

@@ -1,35 +0,0 @@
-`timescale 1ns/1ps
-
-module debug_trigger_unit (
-    input  wire       event_valid,
-    input  wire [3:0] event_type,
-    input  wire [3:0] fault_code,
-    input  wire [4:0] channel,
-    input  wire [2:0] source_id,
-    input  wire [2:0] state,
-    input  wire       manual_trigger,
-    input  wire       trigger_on_fault,
-    input  wire       trigger_on_force_off,
-    input  wire       trigger_channel_enable,
-    input  wire [4:0] trigger_channel,
-    input  wire       trigger_source_enable,
-    input  wire [2:0] trigger_source_id,
-    input  wire       trigger_state_enable,
-    input  wire [2:0] trigger_state,
-    output wire       trigger_hit,
-    output wire       freeze_capture
-);
-
-    localparam [3:0] EVENT_FORCE_OFF = 4'd5;
-
-    wire fault_match = trigger_on_fault && event_valid && (fault_code != 4'd0);
-    wire force_off_match = trigger_on_force_off && event_valid && (event_type == EVENT_FORCE_OFF);
-    wire channel_match = (!trigger_channel_enable) || (channel == trigger_channel);
-    wire source_match = (!trigger_source_enable) || (source_id == trigger_source_id);
-    wire state_match = (!trigger_state_enable) || (state == trigger_state);
-    wire qualified_match = event_valid && channel_match && source_match && state_match;
-
-    assign trigger_hit = manual_trigger || fault_match || force_off_match || qualified_match;
-    assign freeze_capture = trigger_hit;
-
-endmodule

+ 0 - 122
src/rtl/debug_uart_stream.v

@@ -1,122 +0,0 @@
-`timescale 1ns/1ps
-
-module debug_uart_stream #(
-    parameter integer CLKS_PER_BIT = 217,
-    parameter integer PAYLOAD_BYTES = 4,
-    parameter integer EVENT_WIDTH = 32
-) (
-    input  wire                   clk,
-    input  wire                   rst_n,
-    input  wire                   event_valid,
-    input  wire [EVENT_WIDTH-1:0] event_data,
-    output reg                    tx,
-    output reg                    busy,
-    output reg                    overflow,
-    output reg  [15:0]            frame_seq
-);
-
-    localparam integer TOTAL_BYTES = PAYLOAD_BYTES + 5;
-    localparam [7:0] SOF0 = 8'ha5;
-    localparam [7:0] SOF1 = 8'h5a;
-
-    reg [7:0] frame [0:TOTAL_BYTES-1];
-    reg [7:0] current_byte;
-    reg [3:0] bit_index;
-    reg [7:0] byte_index;
-    reg [15:0] clk_count;
-    reg [1:0] phase;
-    reg [7:0] checksum;
-    reg [15:0] next_frame_seq;
-    integer i;
-
-    localparam [1:0] PH_START = 2'd0;
-    localparam [1:0] PH_DATA = 2'd1;
-    localparam [1:0] PH_STOP = 2'd2;
-
-    function [7:0] event_byte;
-        input integer index;
-        begin
-            case (index)
-                0: event_byte = event_data[7:0];
-                1: event_byte = event_data[15:8];
-                2: event_byte = event_data[23:16];
-                3: event_byte = event_data[31:24];
-                default: event_byte = 8'd0;
-            endcase
-        end
-    endfunction
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            tx <= 1'b1;
-            busy <= 1'b0;
-            overflow <= 1'b0;
-            frame_seq <= 16'd0;
-            current_byte <= 8'd0;
-            bit_index <= 4'd0;
-            byte_index <= 8'd0;
-            clk_count <= 16'd0;
-            phase <= PH_START;
-            checksum <= 8'd0;
-            for (i = 0; i < TOTAL_BYTES; i = i + 1) begin
-                frame[i] <= 8'd0;
-            end
-        end else begin
-            if (event_valid && busy) begin
-                overflow <= 1'b1;
-            end
-
-            if (event_valid && !busy) begin
-                next_frame_seq = frame_seq + 16'd1;
-                frame_seq <= next_frame_seq;
-                frame[0] <= SOF0;
-                frame[1] <= SOF1;
-                frame[2] <= next_frame_seq[7:0];
-                frame[3] <= next_frame_seq[15:8];
-                checksum = SOF0 ^ SOF1 ^ next_frame_seq[7:0] ^ next_frame_seq[15:8];
-                for (i = 0; i < PAYLOAD_BYTES; i = i + 1) begin
-                    frame[4 + i] <= event_byte(i);
-                    checksum = checksum ^ event_byte(i);
-                end
-                frame[TOTAL_BYTES-1] <= checksum;
-                current_byte <= SOF0;
-                byte_index <= 8'd0;
-                bit_index <= 4'd0;
-                clk_count <= 16'd0;
-                phase <= PH_START;
-                busy <= 1'b1;
-                tx <= 1'b0;
-            end else if (busy) begin
-                if (clk_count == CLKS_PER_BIT[15:0] - 16'd1) begin
-                    clk_count <= 16'd0;
-                    if (phase == PH_START) begin
-                        phase <= PH_DATA;
-                        bit_index <= 4'd0;
-                        tx <= current_byte[0];
-                    end else if (phase == PH_DATA) begin
-                        if (bit_index == 4'd7) begin
-                            phase <= PH_STOP;
-                            tx <= 1'b1;
-                        end else begin
-                            bit_index <= bit_index + 4'd1;
-                            tx <= current_byte[bit_index + 4'd1];
-                        end
-                    end else begin
-                        if (byte_index == TOTAL_BYTES[7:0] - 8'd1) begin
-                            busy <= 1'b0;
-                            tx <= 1'b1;
-                        end else begin
-                            byte_index <= byte_index + 8'd1;
-                            current_byte <= frame[byte_index + 8'd1];
-                            phase <= PH_START;
-                            tx <= 1'b0;
-                        end
-                    end
-                end else begin
-                    clk_count <= clk_count + 16'd1;
-                end
-            end
-        end
-    end
-
-endmodule

+ 0 - 54
src/rtl/fake_host_config.v

@@ -1,54 +0,0 @@
-`timescale 1ns/1ps
-
-module fake_host_config #(
-    parameter integer DW = 18
-) (
-    input  wire                 clk,
-    input  wire                 rst_n,
-    input  wire [15:0]          sample_seq,
-    output reg                  host_enable,
-    output reg  signed [DW-1:0] host_target_q,
-    output reg  signed [DW-1:0] host_a0,
-    output reg  signed [DW-1:0] host_a1,
-    output reg  signed [DW-1:0] host_a2,
-    output reg  [1:0]           host_mode,
-    output reg  [15:0]          host_config_seq
-);
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            host_enable <= 1'b1;
-            host_target_q <= 18'sd70;
-            host_a0 <= 18'sd4;
-            host_a1 <= -18'sd1;
-            host_a2 <= 18'sd1;
-            host_mode <= 2'd3;
-            host_config_seq <= 16'd1;
-        end else if (sample_seq >= 16'd27) begin
-            host_enable <= 1'b0;
-            host_target_q <= 18'sd70;
-            host_a0 <= 18'sd3;
-            host_a1 <= -18'sd1;
-            host_a2 <= 18'sd1;
-            host_mode <= 2'd3;
-            host_config_seq <= 16'd3;
-        end else if (sample_seq >= 16'd12) begin
-            host_enable <= 1'b1;
-            host_target_q <= 18'sd70;
-            host_a0 <= 18'sd3;
-            host_a1 <= -18'sd1;
-            host_a2 <= 18'sd1;
-            host_mode <= 2'd3;
-            host_config_seq <= 16'd2;
-        end else begin
-            host_enable <= 1'b1;
-            host_target_q <= 18'sd70;
-            host_a0 <= 18'sd4;
-            host_a1 <= -18'sd1;
-            host_a2 <= 18'sd1;
-            host_mode <= 2'd3;
-            host_config_seq <= 16'd1;
-        end
-    end
-
-endmodule

+ 0 - 158
src/rtl/fake_sensor_source.v

@@ -1,158 +0,0 @@
-`timescale 1ns/1ps
-
-module fake_sensor_source #(
-    parameter integer DW = 18,
-    parameter integer CHW = 5,
-    parameter integer ADC_ZONE_COUNT = 4,
-    parameter integer CHANNEL_COUNT = 24
-) (
-    input  wire                 clk,
-    input  wire                 rst_n,
-    input  wire                 next_req,
-    input  wire                 sensor_ready,
-    output reg                  sensor_valid,
-    output reg                  sensor_fault,
-    output reg  [CHW-1:0]       sensor_channel,
-    output reg  signed [DW-1:0] sensor_temp_q,
-    output reg  [15:0]          sensor_sample_seq
-);
-
-    localparam [CHW-1:0] CHANNEL_COUNT_W = CHANNEL_COUNT[CHW-1:0];
-
-    reg [15:0] next_seq;
-    reg [CHW-1:0] replay_channel;
-    reg signed [DW-1:0] replay_temp_q;
-    reg replay_fault;
-    reg pending_valid;
-    reg replay_stale;
-    reg replay_missing;
-    reg [2:0] replay_phase;
-    reg [7:0] replay_raw_status;
-
-    wire unused_replay_stale = replay_stale;
-    wire unused_replay_missing = replay_missing;
-    wire [2:0] unused_replay_phase = replay_phase;
-    wire [7:0] unused_replay_raw_status = replay_raw_status;
-
-    task build_replay_sample;
-        input [15:0] seq;
-        output [CHW-1:0] channel;
-        output signed [DW-1:0] temp_q;
-        output fault;
-        output stale;
-        output missing;
-        output [2:0] phase;
-        output [7:0] raw_status;
-        reg [4:0] zero_based;
-        reg [4:0] zone_offset;
-        reg [15:0] long_index;
-        reg [3:0] noise_term;
-        begin
-            fault = 1'b0;
-            stale = 1'b0;
-            missing = 1'b0;
-            raw_status = 8'h10;
-            phase = seq[7:5];
-            long_index = seq - 16'd1;
-            if (seq >= 16'd1 && seq <= 16'd24) begin
-                zero_based = seq[4:0] - 5'd1;
-                channel = zero_based[CHW-1:0];
-                if (zero_based < 5'd6) begin
-                    zone_offset = zero_based;
-                    temp_q = 18'sd70 + $signed({13'd0, zone_offset});
-                end else if (zero_based < 5'd12) begin
-                    zone_offset = zero_based - 5'd6;
-                    temp_q = 18'sd78 + $signed({12'd0, zone_offset, 1'b0});
-                end else if (zero_based < 5'd18) begin
-                    zone_offset = zero_based - 5'd12;
-                    temp_q = 18'sd86 + $signed({12'd0, zone_offset, 1'b0}) + $signed({13'd0, zone_offset});
-                end else begin
-                    zone_offset = zero_based - 5'd18;
-                    temp_q = 18'sd94 + $signed({11'd0, zone_offset, 2'b00});
-                end
-            end else begin
-                channel = long_index[4:0];
-                if (channel >= CHANNEL_COUNT_W) begin
-                    channel = channel - CHANNEL_COUNT_W;
-                end
-                phase = long_index[7:5];
-                noise_term = {long_index[2:0], long_index[5]} ^ {long_index[6], long_index[4:2]};
-                case (phase)
-                    3'd0: begin
-                        temp_q = 18'sd66 + $signed({13'd0, channel});
-                    end
-                    3'd1: begin
-                        temp_q = 18'sd72 + $signed({12'd0, channel[3:0], 1'b0});
-                    end
-                    3'd2: begin
-                        temp_q = channel[0] ? 18'sd95 : 18'sd58;
-                    end
-                    3'd3: begin
-                        temp_q = 18'sd70 + $signed({14'd0, noise_term});
-                    end
-                    3'd4: begin
-                        missing = (channel == 5'd0) || (channel == 5'd5) || (channel == 5'd10);
-                        fault = missing;
-                        temp_q = missing ? 18'sd0 : 18'sd82;
-                        raw_status = missing ? 8'hff : 8'h10;
-                    end
-                    3'd5: begin
-                        stale = (channel[1:0] == 2'b00);
-                        temp_q = stale ? 18'sd89 : 18'sd76;
-                        raw_status = stale ? 8'h20 : 8'h10;
-                    end
-                    3'd6: begin
-                        fault = (channel == 5'd3);
-                        temp_q = fault ? 18'sd0 : 18'sd74;
-                        raw_status = fault ? 8'he1 : 8'h10;
-                    end
-                    default: begin
-                        temp_q = 18'sd62 + $signed({13'd0, long_index[4:0]});
-                    end
-                endcase
-            end
-        end
-    endtask
-
-    always @(posedge clk or negedge rst_n) begin
-        if (!rst_n) begin
-            sensor_valid <= 1'b0;
-            sensor_fault <= 1'b0;
-            sensor_channel <= {CHW{1'b0}};
-            sensor_temp_q <= 18'sd70;
-            sensor_sample_seq <= 16'd0;
-            pending_valid <= 1'b0;
-        end else begin
-            if (pending_valid) begin
-                sensor_valid <= 1'b1;
-                if (sensor_ready) begin
-                    pending_valid <= 1'b0;
-                    sensor_valid <= 1'b0;
-                end
-            end else if (next_req) begin
-                next_seq = sensor_sample_seq + 16'd1;
-                build_replay_sample(
-                    next_seq,
-                    replay_channel,
-                    replay_temp_q,
-                    replay_fault,
-                    replay_stale,
-                    replay_missing,
-                    replay_phase,
-                    replay_raw_status
-                );
-                sensor_valid <= 1'b1;
-                sensor_fault <= replay_fault;
-                sensor_channel <= replay_channel;
-                sensor_temp_q <= replay_temp_q;
-                sensor_sample_seq <= next_seq;
-                if (!sensor_ready) begin
-                    pending_valid <= 1'b1;
-                end
-            end else begin
-                sensor_valid <= 1'b0;
-            end
-        end
-    end
-
-endmodule

+ 0 - 0
src/rtl/fan_tach_domain.v


部分文件因文件數量過多而無法顯示