Parcourir la source

feat-6400-front-rear-v11-30s-single-product

root il y a 3 mois
Parent
commit
a00a5b673f

+ 77 - 0
ACTIVE_TASK_LOCK.yaml

@@ -0,0 +1,77 @@
+schema: prod2u-active-task-lock-v1
+task: 6400-front-rear-v11-30s-single-product
+baseline_commit: 127db8eef879a6c0cad0e97b485c28d59944afa9
+implementation_commit: SELF_Q3_CLEAN_COMMIT
+branch: feature/6400-front-rear-v11-30s
+workspace: /data/prod2u/worktrees/6400-front-rear-v11-30s
+product: 6400-front-rear
+board: FCB_V1.1
+device: EF2L45BG256B
+clock_hz: 25000000
+pll: forbidden
+uart:
+  host_rs232: 921600_8N1
+  host_ttl: 921600_8N1_LOGICAL_ONLY_PINS_BLOCKED_EVIDENCE
+  bmc_rs232: 115200_8N1
+pins:
+  clock: J1
+  host_rs232: {tx: M10, rx: N11}
+  host_ttl: {tx: unknown, rx: unknown}
+  bmc_rs232: {tx: L10, rx: M9}
+  ct7428: {scl: M8, sda: N9}
+  front: [B1, C4, B5, A14]
+  rear: [P15, N15, M14, P5]
+  ptc: [R7, T6, R5, T4, G16, F16, R3, T2, R1, P1, N1, M1, P7, P8, N16, M16, R16, P16, T12, T13, R10, P10, P9, T9]
+polarity:
+  ptc_active_high: true
+  fan_duty_semantics: connector_high_percent
+  fan_board_invert_mask: 0x0F
+  inversion_location: board_adapter_only
+pwm:
+  ptc_hz: 500
+  fan_hz: 500
+  period_clocks: 50000
+  safe_fan_high_clocks_at_20_percent: 10000
+safe_output: {ptc_percent: 0, front_percent: 20, rear_percent: 20}
+control:
+  owners: [OWNER_SAFE, OWNER_MANUAL, OWNER_PID]
+  initial_owner: OWNER_SAFE
+  watchdog_seconds: 30
+  watchdog_500us_ticks: 60000
+  watchdog_test_override: WATCHDOG_TICKS_OVERRIDE
+  default_pid_target_c: 70
+  transitions:
+    - SAFE_timeout_to_PID_wait_new_valid_bmc_epoch
+    - SET_ALL_commit_to_MANUAL_reload_watchdog
+    - MANUAL_timeout_atomic_safe_then_PID_wait_new_valid_bmc_epoch
+    - SET_ALL_commit_wins_over_same_cycle_timeout
+    - SET_PID_TARGET_does_not_change_owner_or_feed_watchdog
+safety:
+  channel_clamp_c: 76
+  lane_hard_protect_c: 77
+  lane_release_c: 72
+  lane_release_new_epochs: 3
+commands:
+  SET_ALL: 0x01
+  GET_SNAPSHOT: 0x02
+  SET_STIMULUS_RESERVED_EXISTING: 0x03
+  SET_PID_TARGET: 0x04
+  ACK_NACK: 0x06
+  SNAPSHOT_DATA: 0x82
+ack_payload: [ok, request_type, status, detail]
+ack_status: {OK: 0, UNSUPPORTED: 1, BAD_LENGTH: 2, BAD_VALUE: 3, SAFETY_LOCKED: 4}
+profile_behavior_0x03: UNSUPPORTED_NACK
+q0_evidence:
+  adc: constraints/prod2u_6400_front_back.adc
+  registry: projects/registry.json
+  channel_map: contracts/channel-map.yaml
+  current_host_contract: generated/6400/host-contract.json
+  compatibility: protocol-compatibility.json
+blockers:
+  - HOST_TTL_PHYSICAL_PINS_BLOCKED_EVIDENCE
+pre_configuration_output: NOT_VERIFIED
+hardware: NOT_RUN
+com: NOT_RUN
+jtag: NOT_RUN
+recent_test: Q2_FOCUSED_TESTS_PASS_GENERATOR_LINT_UNIT_ICARUS_PWM_COCOTB
+next_step: Q3_clean_commit_fresh_td2026_synth_place_route_timing_bitgen

+ 9 - 0
BLOCKERS.md

@@ -0,0 +1,9 @@
+# Blockers
+
+## HOST_TTL_PHYSICAL_PINS — BLOCKED_EVIDENCE
+
+The active V1.1 ADC, `constraints/prod2u_6400_front_back.adc`, identifies itself as the `CON78 RS-232-only physical top` and constrains only Host RS-232 TX/RX at M10/N11. It contains no authoritative Host TTL connector or FPGA-ball assignments.
+
+`projects/registry.json` records `hardware_host_interfaces` as `CON78_RS232_921600_8N1` and states `logical_host_ttl_status` is `implemented_but_disabled_in_hardware_profile_until_pins_are_confirmed`.
+
+No TTL pin is guessed or added. The 921600 8N1 logical Host TTL contract may remain represented, but physical TTL delivery is `BLOCKED_EVIDENCE` until authoritative board evidence supplies the connector and balls. This blocker does not alter the confirmed RS-232, BMC, CT7428, 24 PTC, four Front, or four Rear constraints.

+ 18 - 0
QUICK_PROGRESS.md

@@ -0,0 +1,18 @@
+# 6400 V1.1 Quick Progress
+
+- Workspace: `/data/prod2u/worktrees/6400-front-rear-v11-30s`
+- Branch: `feature/6400-front-rear-v11-30s`
+- Baseline: `127db8eef879a6c0cad0e97b485c28d59944afa9`
+- Product: `6400-front-rear`; Board: `FCB V1.1`
+- Q0: PASS with `HOST_TTL_PHYSICAL_PINS=BLOCKED_EVIDENCE`.
+- Q1: PASS; single product contract/generator/RTL/HEX GUI implementation complete.
+- Q2: PASS; deterministic generation, command collision/hash checks, Verilator/Yosys, 21 unit tests, focused Icarus, three-period reset PWM, polarity and Host Cocotb passed.
+- Registry: `01 SET_ALL`, `02 GET_SNAPSHOT`, `03 SET_STIMULUS` reserved, `04 SET_PID_TARGET`, `06 ACK_NACK`, `82 SNAPSHOT_DATA`.
+- UART: Host RS232/TTL 921600 8N1; BMC RS232 115200 8N1. RS232 pins confirmed; physical TTL pins unconfirmed.
+- Pins: Front `B1/C4/B5/A14`; Rear `P15/N15/M14/P5`; all PTC constrained by V1.1 ADC.
+- Polarity: connector-side FAN duty; board adapter only; `FAN_BOARD_INVERT_MASK=0x0F`; PTC active high.
+- Safe/reset/boot/PID-wait: PTC 0%, Front 20%, Rear 20%; 500 Hz, 50,000 clocks/period.
+- Control: owner only SAFE/MANUAL/PID; watchdog 30 s; target 70 C; SET_ALL wins same-cycle timeout.
+- Last result: `FOCUSED_TESTS_PASS`; no Formal/Fuzz/Soak/Legacy run.
+- Next: Q3 clean commit and Fresh TD2026 synthesis/place/route/setup/hold/bitgen.
+- Hardware/COM/JTAG: NOT RUN. Pre-configuration pin state: NOT VERIFIED.

+ 1 - 2
contracts/6400-wire.yaml

@@ -30,8 +30,7 @@ commands:
     type: 0x03
     type: 0x03
     payload_length: 33
     payload_length: 33
     response: ACK_NACK
     response: ACK_NACK
-    profiles: [6400-identification, 6400-sim-debug]
-    production_behavior: UNSUPPORTED
+    product_behavior: UNSUPPORTED
     payload_fields:
     payload_fields:
       - {name: duration_seconds, offset: 0, count: 1, minimum: 1, maximum: 255, unit: seconds}
       - {name: duration_seconds, offset: 0, count: 1, minimum: 1, maximum: 255, unit: seconds}
       - {name: ptc_duty_percent, offset: 1, count: 24, minimum: 0, maximum: 100, unit: percent}
       - {name: ptc_duty_percent, offset: 1, count: 24, minimum: 0, maximum: 100, unit: percent}

+ 2 - 2
contracts/controller-coefficients.yaml

@@ -3,6 +3,6 @@ truth_label: SIMULATION_DEFAULT_NOT_HARDWARE_TUNED
 classes:
 classes:
   EDGE: {lanes: [0, 3], kp_q4_12: 32, ki_q4_12: 4}
   EDGE: {lanes: [0, 3], kp_q4_12: 32, ki_q4_12: 4}
   CENTER: {lanes: [1, 2], kp_q4_12: 24, ki_q4_12: 3}
   CENTER: {lanes: [1, 2], kp_q4_12: 24, ki_q4_12: 3}
-limits_centi_degC: {soft: 7400, pretrip: 7600, hard: 7700, recovery_above_target: 200}
-targets_centi_degC: {default: 7000, preheat_offset: -500, ideal_band: 100, qualification_band: 700}
+limits_centi_degC: {channel_clamp: 7600, lane_hard: 7700, lane_release: 7200}
+targets_centi_degC: {default: 7000}
 recovery_epochs: 3
 recovery_epochs: 3

+ 3 - 4
contracts/fan-control-parameters.yaml

@@ -1,9 +1,8 @@
 schema: prod2u-6400-fan-control-v3
 schema: prod2u-6400-fan-control-v3
 truth_label: EXPERIMENTAL_UNVERIFIED
 truth_label: EXPERIMENTAL_UNVERIFIED
-duty: {reset: 20, boot: 20, standby: 20, watchdog: 20, pid_wait_sensor: 20, ordinary_fault: 20, nominal: 30, warm: 50, protection: 80, hard: 100}
-temperature_centi_degC: {warm_delta_from_target: -300, protection: 7400, hard: 7700}
-invalid_lane_threshold: 2
-front_rear_independent: true
+duty: {reset: 20, boot: 20, standby: 20, watchdog: 20, pid_wait_sensor: 20, ordinary_fault: 20, hard: 100}
+temperature_centi_degC: {channel_clamp: 7600, lane_hard: 7700, lane_release: 7200}
+front_rear_independent: false
 connector_duty_semantics: high_level_percent
 connector_duty_semantics: high_level_percent
 board_invert_mask: 0x0F
 board_invert_mask: 0x0F
 pwm:
 pwm:

+ 15 - 16
docs/architecture/6400-v1-design-lock.md

@@ -1,4 +1,4 @@
-# 6400-front-rear-v1 production design lock
+# 6400-front-rear production design lock
 
 
 Status: ACTIVE destructive protocol migration, 2026-08-25. This supersedes the previous SET_TARGET-first autonomous contract.
 Status: ACTIVE destructive protocol migration, 2026-08-25. This supersedes the previous SET_TARGET-first autonomous contract.
 
 
@@ -16,19 +16,20 @@ Status: ACTIVE destructive protocol migration, 2026-08-25. This supersedes the p
 
 
 ## Safe and hard-protect outputs
 ## Safe and hard-protect outputs
 
 
-- Reset, BOOT_WAIT, standby, watchdog transition, PID_WAIT_SENSOR and ordinary non-overtemperature global fault atomically apply PTC0/FAN20.
+- Reset, boot, standby, watchdog transition, PID waiting and ordinary non-overtemperature global fault atomically apply PTC0/FAN20.
 - BMC absence or stale data never integrates and never requests full speed.
 - BMC absence or stale data never integrates and never requests full speed.
-- Only a confirmed sampled lane temperature at or above 77 C may latch HARD_PROTECT and apply lane PTC0/FAN100.
+- A valid channel at or above 76 C clamps that channel PTC Applied duty to zero. A valid channel at or above 77 C latches its lane, applies lane PTC0/FAN100, and invalidates Manual ownership.
+- A latched lane releases only after three new complete valid BMC epochs in which every valid lane temperature is at or below 72 C; release commits PTC0/FAN20 and returns ownership to PID.
 - Requested and Applied banks are separate; a safety override cannot weaken the required protection.
 - Requested and Applied banks are separate; a safety override cannot weaken the required protection.
 
 
-## Modes and watchdog
+## Owner and watchdog
 
 
-- Modes: BOOT_WAIT, MANUAL_SET_ALL, PID_WAIT_SENSOR, PID_AUTO, HARD_PROTECT.
-- Reset: BOOT_WAIT, PID off, PTC0/FAN20, watchdog elapsed zero, PID target 70 C.
-- First 10-second watchdog expiry commits safe duty, clears PI and enters PID_WAIT_SENSOR.
-- A new complete valid BMC epoch starts PID_AUTO. No BMC means no integration.
-- Legal SET_ALL atomically enters MANUAL_SET_ALL, stops/clears PID, reloads 10 seconds and ACKs after the PWM-boundary commit. Identical SET_ALL also commits/feeds/ACKs.
-- Manual expiry commits safe duty, clears PI and enters PID_WAIT_SENSOR. A SET_ALL commit wins over the same-cycle final expiry tick.
+- The only ownership values are SAFE, MANUAL and PID. Hard protection is an independent Applied-output override, not an owner.
+- Reset: SAFE, PID off, PTC0/FAN20, watchdog 30 seconds, PID target 70 C.
+- First 30-second watchdog expiry commits safe duty, clears PI and transfers ownership to PID.
+- A new complete valid BMC epoch permits PID calculation. No BMC means no integration and PTC0/FAN20.
+- Legal SET_ALL atomically enters MANUAL, freezes PID state, reloads 30 seconds and ACKs after the PWM-boundary commit. Identical SET_ALL also commits/feeds/ACKs.
+- Manual expiry commits safe duty, clears PI and transfers ownership to PID. A SET_ALL commit wins over the same-cycle final expiry tick.
 - Only legal atomically committed SET_ALL feeds watchdog. GET_SNAPSHOT, SET_PID_TARGET, SET_STIMULUS, NACK and invalid traffic do not.
 - Only legal atomically committed SET_ALL feeds watchdog. GET_SNAPSHOT, SET_PID_TARGET, SET_STIMULUS, NACK and invalid traffic do not.
 
 
 ## Host protocol
 ## Host protocol
@@ -37,7 +38,7 @@ Frame: `A5 5A | TYPE | LENGTH | PAYLOAD | CRC_LOW | CRC_HIGH`. CRC-16/CCITT-FALS
 
 
 - `0x01 SET_ALL`, length 32: PTC0..23, Front0..3, Rear0..3; all 0..100.
 - `0x01 SET_ALL`, length 32: PTC0..23, Front0..3, Rear0..3; all 0..100.
 - `0x02 GET_SNAPSHOT`, length 0.
 - `0x02 GET_SNAPSHOT`, length 0.
-- `0x03 SET_STIMULUS`, unchanged 33-byte payload. Identification/Sim Debug retain it; Production returns UNSUPPORTED.
+- `0x03 SET_STIMULUS`, existing name and 33-byte payload retained in the registry; the single product returns UNSUPPORTED.
 - `0x04 SET_PID_TARGET`, length 1, 20..70; updates only the next PID target and does not change Manual output or feed watchdog.
 - `0x04 SET_PID_TARGET`, length 1, 20..70; updates only the next PID target and does not change Manual output or feed watchdog.
 - `0x06 ACK_NACK`, length 4: `[ok, request_type, status, detail]`.
 - `0x06 ACK_NACK`, length 4: `[ok, request_type, status, detail]`.
 - `0x82 SNAPSHOT_DATA`, generated fixed layout.
 - `0x82 SNAPSHOT_DATA`, generated fixed layout.
@@ -51,10 +52,8 @@ GET_SNAPSHOT locks BMC, CT, output banks, control epoch and fixed fields before
 
 
 Snapshot includes mode, watchdog active/remaining, PID target/running, Manual flag, BMC/CT valid/stale/epochs/ages, Requested/Applied PTC/Front/Rear connector duties, faults and hard-protect state.
 Snapshot includes mode, watchdog active/remaining, PID target/running, Manual flag, BMC/CT valid/stale/epochs/ages, Requested/Applied PTC/Front/Rear connector duties, faults and hard-protect state.
 
 
-## Profiles
+## Product and GUI
 
 
-- `6400-control`: production, `0x03` valid request returns UNSUPPORTED.
-- `6400-identification`: `0x03` enabled with unchanged payload and safety path.
-- `6400-sim-debug`: accelerated simulation, never production source closure.
+- The only active product is `6400-front-rear`. Historical profile files are not active build or release inputs.
 
 
-HEX GUIs are profile-specific, generate/parse HEX only, never open a serial port, and embed the same generated Host Contract/Golden Vector SHA as the firmware package.
+The single `6400-front-rear` HEX GUI generates/parses HEX only, never opens a serial port, and embeds the same generated Host Contract/Golden Vector SHA as the firmware package.

+ 1 - 1
docs/generated/6400-channel-map.md

@@ -1,6 +1,6 @@
 # Generated 6400 channel map
 # Generated 6400 channel map
 
 
-Contract SHA-256: `e8f8a5885411ae109b465fe88bf7327e8bbcee27583b8bd77948155fdc14d26a`.
+Contract SHA-256: `b5c45e4782fcb4ec926a69870973c811f6a2c4ea3096f7511ce691e11b6fecfc`.
 
 
 | DIMM | CPU slot | Lane | Zone | PTC | BMC | CT | Cohort |
 | DIMM | CPU slot | Lane | Zone | PTC | BMC | CT | Cohort |
 | ---: | --- | ---: | ---: | ---: | ---: | --- | --- |
 | ---: | --- | ---: | ---: | ---: | ---: | --- | --- |

+ 9 - 7
docs/prod2u-6400-front-back-protocol.zh-CN.md

@@ -16,7 +16,7 @@
 | --- | --- | --- | --- |
 | --- | --- | --- | --- |
 | `01` | SET_ALL | 32 字节 | PTC0..23、Front0..3、Rear0..3,均为连接器侧高电平占空比 0..100 |
 | `01` | SET_ALL | 32 字节 | PTC0..23、Front0..3、Rear0..3,均为连接器侧高电平占空比 0..100 |
 | `02` | GET_SNAPSHOT | 0 字节 | 先返回 `06`,再返回 `82` 数据 |
 | `02` | GET_SNAPSHOT | 0 字节 | 先返回 `06`,再返回 `82` 数据 |
-| `03` | SET_STIMULUS | 33 字节 | Identification/Sim Debug 保留;Production 对合法请求返回 UNSUPPORTED |
+| `03` | SET_STIMULUS | 33 字节 | 保留既有名称与 Payload;单一 6400-front-rear 对合法请求返回 UNSUPPORTED |
 | `04` | SET_PID_TARGET | 1 字节 | 20..70 C,默认 70;不启动 PID、不改变 Manual 输出、不喂狗 |
 | `04` | SET_PID_TARGET | 1 字节 | 20..70 C,默认 70;不启动 PID、不改变 Manual 输出、不喂狗 |
 | `06` | ACK_NACK | 4 字节 | `[ok, request_type, status, detail]` |
 | `06` | ACK_NACK | 4 字节 | `[ok, request_type, status, detail]` |
 | `82` | SNAPSHOT_DATA | 201 字节 | 按生成的 `snapshot-layout.json` 解析 |
 | `82` | SNAPSHOT_DATA | 201 字节 | 按生成的 `snapshot-layout.json` 解析 |
@@ -25,17 +25,19 @@ Status:`0 OK`、`1 UNSUPPORTED`、`2 BAD_LENGTH`、`3 BAD_VALUE`、`4 SAFETY_L
 
 
 所有 CRC 正确且完整的 Host 请求恰好返回一帧 ACK/NACK;GET 成功后另发一帧 DATA。坏 Header、CRC、半帧、超时和 UART framing error 静默丢弃。
 所有 CRC 正确且完整的 Host 请求恰好返回一帧 ACK/NACK;GET 成功后另发一帧 DATA。坏 Header、CRC、半帧、超时和 UART framing error 静默丢弃。
 
 
-SET_ALL 必须收全后先完整校验。首个大于 100 的值返回 BAD_VALUE,detail 为索引;不得部分写、切 Bank、改 Mode 或喂狗。合法值写入 inactive bank,在 PWM 安全边界原子切换,进入 MANUAL_SET_ALL,清 PI、reload 10 秒,commit 后返回 OK。相同值也必须 commit/feed/ACK。
+SET_ALL 必须收全后先完整校验。首个大于 100 的值返回 BAD_VALUE,detail 为索引;不得部分写、切 Bank、改 Owner 或喂狗。合法值写入 inactive bank,在 PWM 安全边界原子切换,进入 MANUAL、冻结 PI、reload 30 秒,commit 后返回 OK。相同值也必须 commit/feed/ACK。
 
 
 GET 在 ACK 前锁存 BMC、CT、Output Bank、control epoch 和固定字段;Host 端口与 Snapshot Bank 锁保持到 `82` 最后 CRC 字节 stop bit 完成。
 GET 在 ACK 前锁存 BMC、CT、Output Bank、control epoch 和固定字段;Host 端口与 Snapshot Bank 锁保持到 `82` 最后 CRC 字节 stop bit 完成。
 
 
-## 模式与安全输出
+## Owner 与安全输出
 
 
-- 模式:BOOT_WAIT、MANUAL_SET_ALL、PID_WAIT_SENSOR、PID_AUTO、HARD_PROTECT。
+- Owner 只有 SAFE、MANUAL、PID;Hard Protect 是独立 Applied 安全覆盖,不是 Owner。
 - Reset/Boot/Standby/watchdog/PID 等待/普通非过温 global fault:PTC0、Front/Rear FAN20。
 - Reset/Boot/Standby/watchdog/PID 等待/普通非过温 global fault:PTC0、Front/Rear FAN20。
-- 只有确认采样达到 77 C 的 lane 可以进入 HARD_PROTECT:该 lane PTC0、Front/Rear FAN100。
-- BMC 无有效数据时不积分、不全速。第一次 Boot watchdog timeout 以及 Manual timeout 都原子提交安全值、清 PI、进入 PID_WAIT_SENSOR;新完整有效 BMC epoch 后进入 PID_AUTO。
-- 只有合法并完成原子提交的 SET_ALL 喂 10 秒 watchdog;SET_ALL commit 与最后 timeout tick 同周期时 SET_ALL 优先。
+- 有效通道达到 76 C 时仅 Clamp 该通道 PTC Applied=0;有效通道达到 77 C 时锁存对应 Lane,Lane PTC0、Front/Rear FAN100,并使当前 Manual Lease 失效。
+- Lane 只有在连续 3 个新完整有效 BMC Snapshot 中该 Lane 所有有效温度均不高于 72 C 才释放;释放后提交 PTC0/FAN20、Owner=PID,并等待下一新 Epoch。
+- BMC 无有效数据时 PID 不积分、不全速。第一次 Boot watchdog timeout 以及 Manual timeout 都原子提交安全值、清 PI、Owner=PID;新完整有效 BMC epoch 后才计算 PID。
+- 只有合法并完成原子提交的 SET_ALL 喂 30 秒 watchdog;SET_ALL commit 与最后 timeout tick 同周期时 SET_ALL 优先。
+- MANUAL 在无 BMC 时仍可工作;此时没有基于 BMC 的过温保护。
 
 
 ## 风扇极性
 ## 风扇极性
 
 

+ 1 - 1
generated/6400/channel-map.json

@@ -488,7 +488,7 @@
       "thermal_zone": 2
       "thermal_zone": 2
     }
     }
   ],
   ],
-  "contract_sha256": "e8f8a5885411ae109b465fe88bf7327e8bbcee27583b8bd77948155fdc14d26a",
+  "contract_sha256": "b5c45e4782fcb4ec926a69870973c811f6a2c4ea3096f7511ce691e11b6fecfc",
   "fan_output_vector_order": [
   "fan_output_vector_order": [
     "front0",
     "front0",
     "front1",
     "front1",

+ 1 - 1
generated/6400/contract-sha256.txt

@@ -1 +1 @@
-e8f8a5885411ae109b465fe88bf7327e8bbcee27583b8bd77948155fdc14d26a
+b5c45e4782fcb4ec926a69870973c811f6a2c4ea3096f7511ce691e11b6fecfc

+ 5 - 9
generated/6400/controller-coefficients.json

@@ -17,20 +17,16 @@
       ]
       ]
     }
     }
   },
   },
-  "contract_sha256": "e8f8a5885411ae109b465fe88bf7327e8bbcee27583b8bd77948155fdc14d26a",
+  "contract_sha256": "b5c45e4782fcb4ec926a69870973c811f6a2c4ea3096f7511ce691e11b6fecfc",
   "limits_centi_degC": {
   "limits_centi_degC": {
-    "hard": 7700,
-    "pretrip": 7600,
-    "recovery_above_target": 200,
-    "soft": 7400
+    "channel_clamp": 7600,
+    "lane_hard": 7700,
+    "lane_release": 7200
   },
   },
   "recovery_epochs": 3,
   "recovery_epochs": 3,
   "schema": "prod2u-6400-controller-coefficients-v1",
   "schema": "prod2u-6400-controller-coefficients-v1",
   "targets_centi_degC": {
   "targets_centi_degC": {
-    "default": 7000,
-    "ideal_band": 100,
-    "preheat_offset": -500,
-    "qualification_band": 700
+    "default": 7000
   },
   },
   "truth_label": "SIMULATION_DEFAULT_NOT_HARDWARE_TUNED"
   "truth_label": "SIMULATION_DEFAULT_NOT_HARDWARE_TUNED"
 }
 }

+ 5 - 9
generated/6400/fan-control-parameters.json

@@ -3,21 +3,17 @@
   "actual_rpm_status": "NOT_RUN",
   "actual_rpm_status": "NOT_RUN",
   "board_invert_mask": 15,
   "board_invert_mask": 15,
   "connector_duty_semantics": "high_level_percent",
   "connector_duty_semantics": "high_level_percent",
-  "contract_sha256": "e8f8a5885411ae109b465fe88bf7327e8bbcee27583b8bd77948155fdc14d26a",
+  "contract_sha256": "b5c45e4782fcb4ec926a69870973c811f6a2c4ea3096f7511ce691e11b6fecfc",
   "duty": {
   "duty": {
     "boot": 20,
     "boot": 20,
     "hard": 100,
     "hard": 100,
-    "nominal": 30,
     "ordinary_fault": 20,
     "ordinary_fault": 20,
     "pid_wait_sensor": 20,
     "pid_wait_sensor": 20,
-    "protection": 80,
     "reset": 20,
     "reset": 20,
     "standby": 20,
     "standby": 20,
-    "warm": 50,
     "watchdog": 20
     "watchdog": 20
   },
   },
-  "front_rear_independent": true,
-  "invalid_lane_threshold": 2,
+  "front_rear_independent": false,
   "pre_configuration_output_status": "NOT_VERIFIED",
   "pre_configuration_output_status": "NOT_VERIFIED",
   "pwm": {
   "pwm": {
     "carrier_backend": "shared_equal_frequency_control_reset_independent_v2",
     "carrier_backend": "shared_equal_frequency_control_reset_independent_v2",
@@ -32,9 +28,9 @@
   "pwm_high_level_status": "PWM_HIGH_LEVEL_UNVERIFIED",
   "pwm_high_level_status": "PWM_HIGH_LEVEL_UNVERIFIED",
   "schema": "prod2u-6400-fan-control-v3",
   "schema": "prod2u-6400-fan-control-v3",
   "temperature_centi_degC": {
   "temperature_centi_degC": {
-    "hard": 7700,
-    "protection": 7400,
-    "warm_delta_from_target": -300
+    "channel_clamp": 7600,
+    "lane_hard": 7700,
+    "lane_release": 7200
   },
   },
   "truth_label": "EXPERIMENTAL_UNVERIFIED"
   "truth_label": "EXPERIMENTAL_UNVERIFIED"
 }
 }

+ 1 - 1
generated/6400/fixed-point.json

@@ -6,7 +6,7 @@
     "integer_bits": 4,
     "integer_bits": 4,
     "signed_bits": 16
     "signed_bits": 16
   },
   },
-  "contract_sha256": "e8f8a5885411ae109b465fe88bf7327e8bbcee27583b8bd77948155fdc14d26a",
+  "contract_sha256": "b5c45e4782fcb4ec926a69870973c811f6a2c4ea3096f7511ce691e11b6fecfc",
   "error": {
   "error": {
     "signed_bits": 16,
     "signed_bits": 16,
     "unit": "centi_degC"
     "unit": "centi_degC"

+ 1 - 1
generated/6400/golden-vectors.json

@@ -1,5 +1,5 @@
 {
 {
-  "contract_sha256": "e8f8a5885411ae109b465fe88bf7327e8bbcee27583b8bd77948155fdc14d26a",
+  "contract_sha256": "b5c45e4782fcb4ec926a69870973c811f6a2c4ea3096f7511ce691e11b6fecfc",
   "frames": {
   "frames": {
     "bad_length_01_nack": "A55A060400010220C77F",
     "bad_length_01_nack": "A55A060400010220C77F",
     "bad_value_01_index_7_nack": "A55A0604000103077318",
     "bad_value_01_index_7_nack": "A55A0604000103077318",

+ 13 - 47
generated/6400/host-contract.json

@@ -1,6 +1,6 @@
 {
 {
   "canonical_profiles": {
   "canonical_profiles": {
-    "6400-control": {
+    "6400-front-rear": {
       "allowed_commands": [
       "allowed_commands": [
         "SET_ALL",
         "SET_ALL",
         "GET_SNAPSHOT",
         "GET_SNAPSHOT",
@@ -9,28 +9,6 @@
       "production": true,
       "production": true,
       "simulation_only": false,
       "simulation_only": false,
       "stimulus": false
       "stimulus": false
-    },
-    "6400-identification": {
-      "allowed_commands": [
-        "SET_ALL",
-        "GET_SNAPSHOT",
-        "SET_STIMULUS",
-        "SET_PID_TARGET"
-      ],
-      "production": false,
-      "simulation_only": false,
-      "stimulus": true
-    },
-    "6400-sim-debug": {
-      "allowed_commands": [
-        "SET_ALL",
-        "GET_SNAPSHOT",
-        "SET_STIMULUS",
-        "SET_PID_TARGET"
-      ],
-      "production": false,
-      "simulation_only": true,
-      "stimulus": true
     }
     }
   },
   },
   "channel_map": {
   "channel_map": {
@@ -716,7 +694,7 @@
     "product": "6400-front-rear-v1",
     "product": "6400-front-rear-v1",
     "schema": "prod2u-6400-channel-map-v1"
     "schema": "prod2u-6400-channel-map-v1"
   },
   },
-  "contract_sha256": "e8f8a5885411ae109b465fe88bf7327e8bbcee27583b8bd77948155fdc14d26a",
+  "contract_sha256": "b5c45e4782fcb4ec926a69870973c811f6a2c4ea3096f7511ce691e11b6fecfc",
   "controller_coefficients": {
   "controller_coefficients": {
     "classes": {
     "classes": {
       "CENTER": {
       "CENTER": {
@@ -737,18 +715,14 @@
       }
       }
     },
     },
     "limits_centi_degC": {
     "limits_centi_degC": {
-      "hard": 7700,
-      "pretrip": 7600,
-      "recovery_above_target": 200,
-      "soft": 7400
+      "channel_clamp": 7600,
+      "lane_hard": 7700,
+      "lane_release": 7200
     },
     },
     "recovery_epochs": 3,
     "recovery_epochs": 3,
     "schema": "prod2u-6400-controller-coefficients-v1",
     "schema": "prod2u-6400-controller-coefficients-v1",
     "targets_centi_degC": {
     "targets_centi_degC": {
-      "default": 7000,
-      "ideal_band": 100,
-      "preheat_offset": -500,
-      "qualification_band": 700
+      "default": 7000
     },
     },
     "truth_label": "SIMULATION_DEFAULT_NOT_HARDWARE_TUNED"
     "truth_label": "SIMULATION_DEFAULT_NOT_HARDWARE_TUNED"
   },
   },
@@ -760,17 +734,13 @@
     "duty": {
     "duty": {
       "boot": 20,
       "boot": 20,
       "hard": 100,
       "hard": 100,
-      "nominal": 30,
       "ordinary_fault": 20,
       "ordinary_fault": 20,
       "pid_wait_sensor": 20,
       "pid_wait_sensor": 20,
-      "protection": 80,
       "reset": 20,
       "reset": 20,
       "standby": 20,
       "standby": 20,
-      "warm": 50,
       "watchdog": 20
       "watchdog": 20
     },
     },
-    "front_rear_independent": true,
-    "invalid_lane_threshold": 2,
+    "front_rear_independent": false,
     "pre_configuration_output_status": "NOT_VERIFIED",
     "pre_configuration_output_status": "NOT_VERIFIED",
     "pwm": {
     "pwm": {
       "carrier_backend": "shared_equal_frequency_control_reset_independent_v2",
       "carrier_backend": "shared_equal_frequency_control_reset_independent_v2",
@@ -785,9 +755,9 @@
     "pwm_high_level_status": "PWM_HIGH_LEVEL_UNVERIFIED",
     "pwm_high_level_status": "PWM_HIGH_LEVEL_UNVERIFIED",
     "schema": "prod2u-6400-fan-control-v3",
     "schema": "prod2u-6400-fan-control-v3",
     "temperature_centi_degC": {
     "temperature_centi_degC": {
-      "hard": 7700,
-      "protection": 7400,
-      "warm_delta_from_target": -300
+      "channel_clamp": 7600,
+      "lane_hard": 7700,
+      "lane_release": 7200
     },
     },
     "truth_label": "EXPERIMENTAL_UNVERIFIED"
     "truth_label": "EXPERIMENTAL_UNVERIFIED"
   },
   },
@@ -826,7 +796,7 @@
     }
     }
   },
   },
   "golden_vectors": {
   "golden_vectors": {
-    "contract_sha256": "e8f8a5885411ae109b465fe88bf7327e8bbcee27583b8bd77948155fdc14d26a",
+    "contract_sha256": "b5c45e4782fcb4ec926a69870973c811f6a2c4ea3096f7511ce691e11b6fecfc",
     "frames": {
     "frames": {
       "bad_length_01_nack": "A55A060400010220C77F",
       "bad_length_01_nack": "A55A060400010220C77F",
       "bad_value_01_index_7_nack": "A55A0604000103077318",
       "bad_value_01_index_7_nack": "A55A0604000103077318",
@@ -847,7 +817,7 @@
   "schema": "prod2u-6400-host-contract-v3",
   "schema": "prod2u-6400-host-contract-v3",
   "snapshot": {
   "snapshot": {
     "byte_order": "little",
     "byte_order": "little",
-    "contract_sha256": "e8f8a5885411ae109b465fe88bf7327e8bbcee27583b8bd77948155fdc14d26a",
+    "contract_sha256": "b5c45e4782fcb4ec926a69870973c811f6a2c4ea3096f7511ce691e11b6fecfc",
     "fields": [
     "fields": [
       {
       {
         "name": "mode",
         "name": "mode",
@@ -1148,11 +1118,7 @@
           }
           }
         ],
         ],
         "payload_length": 33,
         "payload_length": 33,
-        "production_behavior": "UNSUPPORTED",
-        "profiles": [
-          "6400-identification",
-          "6400-sim-debug"
-        ],
+        "product_behavior": "UNSUPPORTED",
         "response": "ACK_NACK",
         "response": "ACK_NACK",
         "type": 3
         "type": 3
       }
       }

+ 9 - 10
generated/6400/prod2u_6400_v1_params.vh

@@ -1,6 +1,6 @@
 `ifndef PROD2U_6400_V1_PARAMS_VH
 `ifndef PROD2U_6400_V1_PARAMS_VH
 `define PROD2U_6400_V1_PARAMS_VH
 `define PROD2U_6400_V1_PARAMS_VH
-// Generated contract SHA-256: e8f8a5885411ae109b465fe88bf7327e8bbcee27583b8bd77948155fdc14d26a
+// Generated contract SHA-256: b5c45e4782fcb4ec926a69870973c811f6a2c4ea3096f7511ce691e11b6fecfc
 `define FB_CLOCK_HZ 25000000
 `define FB_CLOCK_HZ 25000000
 `define FB_PTC_COUNT 24
 `define FB_PTC_COUNT 24
 `define FB_FRONT_FAN_COUNT 4
 `define FB_FRONT_FAN_COUNT 4
@@ -40,9 +40,9 @@
 `define FB_STATUS_BAD_VALUE 8'd3
 `define FB_STATUS_BAD_VALUE 8'd3
 `define FB_STATUS_SAFETY_LOCKED 8'd4
 `define FB_STATUS_SAFETY_LOCKED 8'd4
 `define FB_SNAPSHOT_LENGTH 201
 `define FB_SNAPSHOT_LENGTH 201
-`define FB_TEMP_SOFT 7400
-`define FB_TEMP_PRETRIP 7600
-`define FB_TEMP_HARD 7700
+`define FB_TEMP_CHANNEL_CLAMP 7600
+`define FB_TEMP_LANE_HARD 7700
+`define FB_TEMP_LANE_RELEASE 7200
 `define FB_TEMP_DEFAULT_TARGET 7000
 `define FB_TEMP_DEFAULT_TARGET 7000
 `define FB_EDGE_KP_Q4_12 32
 `define FB_EDGE_KP_Q4_12 32
 `define FB_EDGE_KI_Q4_12 4
 `define FB_EDGE_KI_Q4_12 4
@@ -52,13 +52,12 @@
 `define FAN_STANDBY_DUTY `FAN_SAFE_DUTY
 `define FAN_STANDBY_DUTY `FAN_SAFE_DUTY
 `define FB_FAN_RESET `FAN_STANDBY_DUTY
 `define FB_FAN_RESET `FAN_STANDBY_DUTY
 `define FB_FAN_HARD 100
 `define FB_FAN_HARD 100
-`define SET_ALL_WATCHDOG_SECONDS 10
+`define CONTROL_WATCHDOG_SECONDS 30
+`define SET_ALL_WATCHDOG_SECONDS `CONTROL_WATCHDOG_SECONDS
 `define DEFAULT_PID_TARGET_C 70
 `define DEFAULT_PID_TARGET_C 70
-`define FB_MODE_BOOT_WAIT 3'd0
-`define FB_MODE_MANUAL_SET_ALL 3'd1
-`define FB_MODE_PID_WAIT_SENSOR 3'd2
-`define FB_MODE_PID_AUTO 3'd3
-`define FB_MODE_HARD_PROTECT 3'd4
+`define FB_OWNER_SAFE 3'd0
+`define FB_OWNER_MANUAL 3'd1
+`define FB_OWNER_PID 3'd2
 `define FB_SNAPSHOT_MODE_OFFSET 0
 `define FB_SNAPSHOT_MODE_OFFSET 0
 `define FB_SNAPSHOT_FAULT_FLAGS_OFFSET 1
 `define FB_SNAPSHOT_FAULT_FLAGS_OFFSET 1
 `define FB_SNAPSHOT_WATCHDOG_ACTIVE_OFFSET 3
 `define FB_SNAPSHOT_WATCHDOG_ACTIVE_OFFSET 3

+ 1 - 1
generated/6400/snapshot-layout.json

@@ -1,6 +1,6 @@
 {
 {
   "byte_order": "little",
   "byte_order": "little",
-  "contract_sha256": "e8f8a5885411ae109b465fe88bf7327e8bbcee27583b8bd77948155fdc14d26a",
+  "contract_sha256": "b5c45e4782fcb4ec926a69870973c811f6a2c4ea3096f7511ce691e11b6fecfc",
   "fields": [
   "fields": [
     {
     {
       "name": "mode",
       "name": "mode",

+ 24 - 0
products/6400-front-rear/project.json

@@ -0,0 +1,24 @@
+{
+  "schema": "prod2u-6400-profile-v1",
+  "project_id": "6400-front-rear",
+  "product": "6400-front-rear",
+  "top": "prod2u_6400_rs232_only_top",
+  "device": "EF2L45BG256B",
+  "clock_hz": 25000000,
+  "source_closure": "products/6400-front-rear/source-closure.json",
+  "board_id": "fcb_fpga_mcu_v1_1_20260625",
+  "board_evidence": "external:FCB_FPGA+MCU_V1.1_20260625.brd",
+  "board_evidence_sha256": "db02938f7943b2ae532aa18208f61588364d32a70a0cc72f74b4a94aaab7e258",
+  "constraints": "constraints/prod2u_6400_front_back.adc",
+  "timing_constraints": "constraints/prod2u_6400_front_back.sdc",
+  "stimulus": false,
+  "host_interfaces": ["host_rs232"],
+  "host_rs232_connector": "CON78",
+  "ttl_pin_status": "disabled_in_rs232_only_hardware_profile_unbound",
+  "ct_physical_map_status": "unknown",
+  "control_watchdog_seconds": 30,
+  "default_pid_target_c": 70,
+  "fan_safe_connector_duty": 20,
+  "fan_board_invert_mask": "0x0F",
+  "pll": false
+}

+ 33 - 0
products/6400-front-rear/source-closure.json

@@ -0,0 +1,33 @@
+{
+  "schema": "prod2u-source-closure-v1",
+  "project_id": "6400-front-rear",
+  "top_module": "prod2u_6400_rs232_only_top",
+  "sources": [
+    "generated/6400/prod2u_6400_v1_params.vh",
+    "src/common/uart_rx_byte.v",
+    "src/common/uart_tx_byte.v",
+    "src/common/crc16_serial.v",
+    "src/common/ef2_bram_dp.v",
+    "src/common/frame_rx.v",
+    "src/common/frame_tx.v",
+    "src/common/payload_ram.v",
+    "src/modules/shared_500us_tick.v",
+    "src/modules/i2c_word_reader.v",
+    "src/rtl/prod2u_por.v",
+    "src/rtl/prod2u_p4_i2c_stop_start_read.v",
+    "src/transport/host_port_selector.v",
+    "src/transport/thermal_host_command.v",
+    "src/acquisition/bmc_poll_engine.v",
+    "src/acquisition/bmc_ascii_snapshot.v",
+    "src/acquisition/ct7428_snapshot.v",
+    "src/control/thermal_output_banks.v",
+    "src/control/manual_set_all_bank.v",
+    "src/control/thermal_control_core.v",
+    "src/actuator/pwm_bitmap_engine.v",
+    "src/actuator/fan_board_output_adapter.v",
+    "src/telemetry/thermal_snapshot_mux.v",
+    "src/top/prod2u_6400_v1_top.v",
+    "src/top/prod2u_6400_rs232_only_top.v"
+  ],
+  "forbidden_substrings": ["door_", "motor", "limit_gate", "EF2_PHY_PLL", "SET_TARGET", "8'h81", "8'h42", "stimulus_atomic_bank"]
+}

+ 8 - 8
projects/registry.json

@@ -39,14 +39,14 @@
     "6400": {
     "6400": {
       "alias": "6400",
       "alias": "6400",
       "aliases": ["prod2u-6400-front-back"],
       "aliases": ["prod2u-6400-front-back"],
-      "project_id": "6400-control",
-      "profile": "6400-control",
-      "validation_profile": "6400-control",
-      "project_profile": "6400-control",
-      "semantic_profile": "6400-front-rear-v1",
+      "project_id": "6400-front-rear",
+      "profile": "6400-front-rear",
+      "validation_profile": "6400-front-rear",
+      "project_profile": "6400-front-rear",
+      "semantic_profile": "6400-front-rear",
       "display_name": "6400 V1.1 front/rear production controller",
       "display_name": "6400 V1.1 front/rear production controller",
-      "project_config": "products/6400-control/project.json",
-      "project_json": "products/6400-control/project.json",
+      "project_config": "products/6400-front-rear/project.json",
+      "project_json": "products/6400-front-rear/project.json",
       "verification_targets": "config/prod2u_6400_verification_targets_v1.json",
       "verification_targets": "config/prod2u_6400_verification_targets_v1.json",
       "features": {
       "features": {
         "motors": false,
         "motors": false,
@@ -55,7 +55,7 @@
         "get_motor_status": false
         "get_motor_status": false
       },
       },
       "requirements": "docs/prod2u-6400-front-back-protocol.zh-CN.md",
       "requirements": "docs/prod2u-6400-front-back-protocol.zh-CN.md",
-      "source_closure": "products/6400-control/source-closure.json",
+      "source_closure": "products/6400-front-rear/source-closure.json",
       "generated_dir": "generated/6400",
       "generated_dir": "generated/6400",
       "top_module": "prod2u_6400_rs232_only_top",
       "top_module": "prod2u_6400_rs232_only_top",
       "top_file": "src/top/prod2u_6400_rs232_only_top.v",
       "top_file": "src/top/prod2u_6400_rs232_only_top.v",

+ 21 - 0
protocol-compatibility.json

@@ -0,0 +1,21 @@
+{
+  "schema": "prod2u-6400-protocol-compatibility-v1",
+  "product": "6400-front-rear",
+  "scan_baseline": "127db8eef879a6c0cad0e97b485c28d59944afa9",
+  "set_all_type": "0x01",
+  "get_type": "0x02",
+  "type_0x03_current_meaning": "SET_STIMULUS",
+  "type_0x03_product_behavior": "UNSUPPORTED_NACK",
+  "set_pid_target_type": "0x04",
+  "ack_nack_type": "0x06",
+  "ack_nack_source": "fallback_contract_format_no_active_mrdimm_unified_ack_found",
+  "ack_nack_payload": ["ok", "request_type", "status", "detail"],
+  "snapshot_data_type": "0x82",
+  "collisions": [],
+  "legacy_response_types_removed_from_active_6400": ["0x81", "0x83", "0x42"],
+  "evidence": [
+    "generated/6400/host-contract.json: current 0x03 SET_STIMULUS and legacy per-command responses",
+    "projects/registry.json: active 6400 physical interface and generated contract path",
+    "hth-platform internal protocol scan: no active unified ACK/NACK contract available"
+  ]
+}

+ 118 - 45
src/control/thermal_control_core.v

@@ -1,11 +1,13 @@
 `timescale 1ns/1ps
 `timescale 1ns/1ps
 `include "generated/6400/prod2u_6400_v1_params.vh"
 `include "generated/6400/prod2u_6400_v1_params.vh"
 
 
-// Deterministic five-mode controller. Host and PID values are connector-side
-// duties. The only physical fan polarity conversion is outside this module.
+// Single-owner controller. Host and PID values are connector-side duties.
+// Safety is an independent applied-output layer; board polarity is external.
 module thermal_control_core #(
 module thermal_control_core #(
     parameter integer ENABLE_STIMULUS = 0,
     parameter integer ENABLE_STIMULUS = 0,
-    parameter signed [15:0] HARD_LIMIT = 16'sd7700,
+    parameter integer WATCHDOG_TICKS_OVERRIDE = 0,
+    parameter signed [15:0] CHANNEL_LIMIT = `FB_TEMP_CHANNEL_CLAMP,
+    parameter signed [15:0] HARD_LIMIT = `FB_TEMP_LANE_HARD,
     parameter [7:0] FAN_SAFE_DUTY = `FAN_SAFE_DUTY,
     parameter [7:0] FAN_SAFE_DUTY = `FAN_SAFE_DUTY,
     parameter [7:0] WATCHDOG_SECONDS = `SET_ALL_WATCHDOG_SECONDS
     parameter [7:0] WATCHDOG_SECONDS = `SET_ALL_WATCHDOG_SECONDS
 ) (
 ) (
@@ -59,16 +61,17 @@ module thermal_control_core #(
     input  wire         pwm_scan_idle,
     input  wire         pwm_scan_idle,
     output reg          boot_init_complete
     output reg          boot_init_complete
 );
 );
-    localparam [2:0] BOOT_WAIT = `FB_MODE_BOOT_WAIT;
-    localparam [2:0] MANUAL_SET_ALL = `FB_MODE_MANUAL_SET_ALL;
-    localparam [2:0] PID_WAIT_SENSOR = `FB_MODE_PID_WAIT_SENSOR;
-    localparam [2:0] PID_AUTO = `FB_MODE_PID_AUTO;
-    localparam [2:0] HARD_PROTECT = `FB_MODE_HARD_PROTECT;
+    localparam [2:0] OWNER_SAFE = `FB_OWNER_SAFE;
+    localparam [2:0] OWNER_MANUAL = `FB_OWNER_MANUAL;
+    localparam [2:0] OWNER_PID = `FB_OWNER_PID;
+    localparam [7:0] WATCHDOG_LOAD = WATCHDOG_TICKS_OVERRIDE != 0 ?
+        WATCHDOG_TICKS_OVERRIDE[7:0] : WATCHDOG_SECONDS;
 
 
     localparam [3:0] W_INIT = 0, W_IDLE = 1, W_MANUAL_COPY = 2,
     localparam [3:0] W_INIT = 0, W_IDLE = 1, W_MANUAL_COPY = 2,
         W_PID_PREFETCH = 3, W_PID_WRITE = 4, W_FAN_WRITE = 5,
         W_PID_PREFETCH = 3, W_PID_WRITE = 4, W_FAN_WRITE = 5,
         W_APPLY_PREFETCH = 6, W_APPLY_WRITE = 7, W_SAFE_FILL = 8,
         W_APPLY_PREFETCH = 6, W_APPLY_WRITE = 7, W_SAFE_FILL = 8,
-        W_COMMIT_WAIT = 9, W_STIM_COPY = 10;
+        W_COMMIT_WAIT = 9, W_STIM_COPY = 10,
+        W_SAFETY_PREFETCH = 11, W_SAFETY_CHECK = 12;
     localparam [1:0] COMMIT_NONE = 0, COMMIT_MANUAL = 1,
     localparam [1:0] COMMIT_NONE = 0, COMMIT_MANUAL = 1,
         COMMIT_SAFE = 2, COMMIT_PID = 3;
         COMMIT_SAFE = 2, COMMIT_PID = 3;
 
 
@@ -76,6 +79,9 @@ module thermal_control_core #(
     reg [1:0] commit_kind;
     reg [1:0] commit_kind;
     reg [4:0] work_index;
     reg [4:0] work_index;
     reg [15:0] last_bmc_epoch;
     reg [15:0] last_bmc_epoch;
+    reg [3:0] epoch_hard_mask;
+    reg [3:0] epoch_above_release_mask;
+    reg [1:0] lane_release_count [0:3];
     reg manual_pending;
     reg manual_pending;
     reg safe_pending;
     reg safe_pending;
     reg stimulus_running;
     reg stimulus_running;
@@ -109,13 +115,18 @@ module thermal_control_core #(
         (work_index < 18) ? 2 : 3;
         (work_index < 18) ? 2 : 3;
     wire [1:0] output_lane = work_index[1:0];
     wire [1:0] output_lane = work_index[1:0];
     wire complete_valid_bmc = !bmc_stale && (&bmc_valid_mask);
     wire complete_valid_bmc = !bmc_stale && (&bmc_valid_mask);
+    wire any_valid_bmc = !bmc_stale && (|bmc_valid_mask);
     wire new_bmc_epoch = bmc_epoch != last_bmc_epoch;
     wire new_bmc_epoch = bmc_epoch != last_bmc_epoch;
+    wire channel_over_76 = bmc_rd_valid && bmc_temperature >= CHANNEL_LIMIT;
+    wire channel_over_77 = bmc_rd_valid && bmc_temperature >= HARD_LIMIT;
+    wire channel_above_release = bmc_rd_valid && bmc_temperature > `FB_TEMP_LANE_RELEASE;
+    wire [3:0] channel_lane_bit = 4'b0001 << channel_lane;
 
 
     assign bmc_rd_index = work_index;
     assign bmc_rd_index = work_index;
     assign stimulus_active = stimulus_running;
     assign stimulus_active = stimulus_running;
-    assign watchdog_active = control_state == BOOT_WAIT || control_state == MANUAL_SET_ALL;
-    assign pid_running = control_state == PID_AUTO || control_state == HARD_PROTECT;
-    assign manual_mode = control_state == MANUAL_SET_ALL;
+    assign watchdog_active = control_state == OWNER_SAFE || control_state == OWNER_MANUAL;
+    assign pid_running = control_state == OWNER_PID && complete_valid_bmc;
+    assign manual_mode = control_state == OWNER_MANUAL;
     assign hard_protect = |lane_fault_mask;
     assign hard_protect = |lane_fault_mask;
 
 
     manual_set_all_bank u_manual_bank (
     manual_set_all_bank u_manual_bank (
@@ -155,7 +166,7 @@ module thermal_control_core #(
     always @(posedge clk or negedge rst_n) begin
     always @(posedge clk or negedge rst_n) begin
         if (!rst_n) begin
         if (!rst_n) begin
             active_output_bank <= 0;
             active_output_bank <= 0;
-            control_state <= BOOT_WAIT;
+            control_state <= OWNER_SAFE;
             current_target_celsius <= `DEFAULT_PID_TARGET_C;
             current_target_celsius <= `DEFAULT_PID_TARGET_C;
             control_epoch <= 0;
             control_epoch <= 0;
             safety_override_mask <= 0;
             safety_override_mask <= 0;
@@ -163,12 +174,14 @@ module thermal_control_core #(
             global_fault <= 0;
             global_fault <= 0;
             output_commit <= 0;
             output_commit <= 0;
             manual_commit_done <= 0;
             manual_commit_done <= 0;
-            watchdog_remaining <= WATCHDOG_SECONDS;
+            watchdog_remaining <= WATCHDOG_LOAD;
             boot_init_complete <= 0;
             boot_init_complete <= 0;
             work_state <= W_INIT;
             work_state <= W_INIT;
             commit_kind <= COMMIT_NONE;
             commit_kind <= COMMIT_NONE;
             work_index <= 0;
             work_index <= 0;
             last_bmc_epoch <= 0;
             last_bmc_epoch <= 0;
+            epoch_hard_mask <= 0;
+            epoch_above_release_mask <= 0;
             manual_pending <= 0;
             manual_pending <= 0;
             safe_pending <= 0;
             safe_pending <= 0;
             stimulus_running <= 0;
             stimulus_running <= 0;
@@ -182,6 +195,7 @@ module thermal_control_core #(
             output_control_data <= 0;
             output_control_data <= 0;
             output_control_read_addr <= 0;
             output_control_read_addr <= 0;
             for (i = 0; i < 24; i = i + 1) pi_integral[i] <= 0;
             for (i = 0; i < 24; i = i + 1) pi_integral[i] <= 0;
+            for (i = 0; i < 4; i = i + 1) lane_release_count[i] <= 0;
         end else begin
         end else begin
             output_commit <= 0;
             output_commit <= 0;
             manual_commit_done <= 0;
             manual_commit_done <= 0;
@@ -207,7 +221,7 @@ module thermal_control_core #(
 
 
             // SET_ALL acceptance dominates a simultaneous final watchdog tick.
             // SET_ALL acceptance dominates a simultaneous final watchdog tick.
             if (manual_commit_applied) begin
             if (manual_commit_applied) begin
-                watchdog_remaining <= WATCHDOG_SECONDS;
+                watchdog_remaining <= WATCHDOG_LOAD;
             end else if (watchdog_active && tick_1s && !manual_pending) begin
             end else if (watchdog_active && tick_1s && !manual_pending) begin
                 if (watchdog_remaining > 1)
                 if (watchdog_remaining > 1)
                     watchdog_remaining <= watchdog_remaining - 1'b1;
                     watchdog_remaining <= watchdog_remaining - 1'b1;
@@ -222,7 +236,6 @@ module thermal_control_core #(
                     output_init_write <= 1;
                     output_init_write <= 1;
                     output_init_addr <= work_index;
                     output_init_addr <= work_index;
                     output_init_data <= (work_index < 24) ? 16'h0000 : {FAN_SAFE_DUTY, FAN_SAFE_DUTY};
                     output_init_data <= (work_index < 24) ? 16'h0000 : {FAN_SAFE_DUTY, FAN_SAFE_DUTY};
-                    if (work_index < 24) pi_integral[work_index] <= 0;
                     if (work_index == 31) begin
                     if (work_index == 31) begin
                         work_index <= 0;
                         work_index <= 0;
                         work_state <= W_IDLE;
                         work_state <= W_IDLE;
@@ -233,8 +246,6 @@ module thermal_control_core #(
                     if (manual_pending) begin
                     if (manual_pending) begin
                         manual_pending <= 0;
                         manual_pending <= 0;
                         work_index <= 0;
                         work_index <= 0;
-                        control_state <= MANUAL_SET_ALL;
-                        safety_override_mask <= 0;
                         global_fault <= 0;
                         global_fault <= 0;
                         commit_kind <= COMMIT_MANUAL;
                         commit_kind <= COMMIT_MANUAL;
                         work_state <= W_MANUAL_COPY;
                         work_state <= W_MANUAL_COPY;
@@ -247,32 +258,89 @@ module thermal_control_core #(
                         work_index <= 0;
                         work_index <= 0;
                         commit_kind <= COMMIT_MANUAL;
                         commit_kind <= COMMIT_MANUAL;
                         work_state <= W_STIM_COPY;
                         work_state <= W_STIM_COPY;
-                    end else if ((control_state == PID_AUTO || control_state == HARD_PROTECT) && bmc_stale) begin
+                    end else if (control_state == OWNER_PID && bmc_stale) begin
                         global_fault <= 1;
                         global_fault <= 1;
                         work_index <= 0;
                         work_index <= 0;
                         commit_kind <= COMMIT_SAFE;
                         commit_kind <= COMMIT_SAFE;
                         work_state <= W_SAFE_FILL;
                         work_state <= W_SAFE_FILL;
-                    end else if (control_state == PID_WAIT_SENSOR && complete_valid_bmc && new_bmc_epoch) begin
+                    end else if (any_valid_bmc && new_bmc_epoch) begin
                         last_bmc_epoch <= bmc_epoch;
                         last_bmc_epoch <= bmc_epoch;
                         work_index <= 0;
                         work_index <= 0;
                         safety_override_mask <= 0;
                         safety_override_mask <= 0;
+                        epoch_hard_mask <= 0;
+                        epoch_above_release_mask <= 0;
                         global_fault <= 0;
                         global_fault <= 0;
-                        work_state <= W_PID_PREFETCH;
-                    end else if ((control_state == PID_AUTO || control_state == HARD_PROTECT) &&
-                                 complete_valid_bmc && new_bmc_epoch) begin
-                        last_bmc_epoch <= bmc_epoch;
+                        work_state <= W_SAFETY_PREFETCH;
+                    end
+                end
+                W_SAFETY_PREFETCH: begin
+                    work_state <= W_SAFETY_CHECK;
+                end
+                W_SAFETY_CHECK: begin
+                    if (channel_over_76)
+                        safety_override_mask[work_index] <= 1;
+                    if (channel_over_77)
+                        epoch_hard_mask <= epoch_hard_mask | channel_lane_bit;
+                    if (channel_above_release)
+                        epoch_above_release_mask <= epoch_above_release_mask | channel_lane_bit;
+                    if (work_index == 23) begin
+                        for (i = 0; i < 4; i = i + 1) begin
+                            if ((((epoch_hard_mask |
+                                  (channel_over_77 ? channel_lane_bit : 4'd0)) >> i) & 4'd1) != 0) begin
+                                lane_fault_mask[i] <= 1;
+                                lane_release_count[i] <= 0;
+                                safety_override_mask[i*6 +: 6] <= 6'h3F;
+                            end else if (lane_fault_mask[i]) begin
+                                if (!complete_valid_bmc ||
+                                    ((((epoch_above_release_mask |
+                                       (channel_above_release ? channel_lane_bit : 4'd0)) >> i) & 4'd1) != 0)) begin
+                                    lane_release_count[i] <= 0;
+                                    safety_override_mask[i*6 +: 6] <= 6'h3F;
+                                end else if (lane_release_count[i] == 2) begin
+                                    lane_fault_mask[i] <= 0;
+                                    lane_release_count[i] <= 0;
+                                end else begin
+                                    lane_release_count[i] <= lane_release_count[i] + 1'b1;
+                                    safety_override_mask[i*6 +: 6] <= 6'h3F;
+                                end
+                            end
+                        end
                         work_index <= 0;
                         work_index <= 0;
-                        safety_override_mask <= 0;
-                        global_fault <= 0;
-                        work_state <= W_PID_PREFETCH;
+                        if (|lane_fault_mask || |epoch_hard_mask || channel_over_77) begin
+                            control_state <= OWNER_PID;
+                            commit_kind <= COMMIT_SAFE;
+                            work_state <= W_SAFE_FILL;
+                        end else if (control_state == OWNER_PID && complete_valid_bmc) begin
+                            work_state <= W_PID_PREFETCH;
+                        end else if (control_state == OWNER_PID) begin
+                            commit_kind <= COMMIT_SAFE;
+                            work_state <= W_SAFE_FILL;
+                        end else if (control_state == OWNER_MANUAL) begin
+                            commit_kind <= COMMIT_NONE;
+                            output_control_read_addr <= 0;
+                            work_state <= W_APPLY_PREFETCH;
+                        end else begin
+                            work_state <= W_IDLE;
+                        end
+                    end else begin
+                        work_index <= work_index + 1'b1;
+                        work_state <= W_SAFETY_PREFETCH;
                     end
                     end
                 end
                 end
                 W_MANUAL_COPY, W_STIM_COPY: begin
                 W_MANUAL_COPY, W_STIM_COPY: begin
                     output_control_write <= 1;
                     output_control_write <= 1;
                     output_control_addr <= work_index;
                     output_control_addr <= work_index;
-                    output_control_data <= {(work_state == W_MANUAL_COPY) ? manual_data : stimulus_data,
-                                            (work_state == W_MANUAL_COPY) ? manual_data : stimulus_data};
-                    if (work_index < 24) pi_integral[work_index] <= 0;
+                    if (work_index < 24)
+                        output_control_data <= {
+                            (work_state == W_MANUAL_COPY) ? manual_data : stimulus_data,
+                            (lane_fault_mask[channel_lane] ||
+                             (!bmc_stale && safety_override_mask[work_index])) ? 8'd0 :
+                                ((work_state == W_MANUAL_COPY) ? manual_data : stimulus_data)};
+                    else
+                        output_control_data <= {
+                            (work_state == W_MANUAL_COPY) ? manual_data : stimulus_data,
+                            lane_fault_mask[output_lane] ? 8'd100 :
+                                ((work_state == W_MANUAL_COPY) ? manual_data : stimulus_data)};
                     if (work_index == 31) begin
                     if (work_index == 31) begin
                         work_index <= 0;
                         work_index <= 0;
                         work_state <= W_COMMIT_WAIT;
                         work_state <= W_COMMIT_WAIT;
@@ -281,7 +349,8 @@ module thermal_control_core #(
                 W_SAFE_FILL: begin
                 W_SAFE_FILL: begin
                     output_control_write <= 1;
                     output_control_write <= 1;
                     output_control_addr <= work_index;
                     output_control_addr <= work_index;
-                    output_control_data <= (work_index < 24) ? 16'h0000 : {FAN_SAFE_DUTY, FAN_SAFE_DUTY};
+                    output_control_data <= (work_index < 24) ? 16'h0000 :
+                        {FAN_SAFE_DUTY, lane_fault_mask[output_lane] ? 8'd100 : FAN_SAFE_DUTY};
                     if (work_index < 24) pi_integral[work_index] <= 0;
                     if (work_index < 24) pi_integral[work_index] <= 0;
                     if (work_index == 31) begin
                     if (work_index == 31) begin
                         work_index <= 0;
                         work_index <= 0;
@@ -298,11 +367,6 @@ module thermal_control_core #(
                         output_control_data <= 16'h0000;
                         output_control_data <= 16'h0000;
                         safety_override_mask[work_index] <= 1;
                         safety_override_mask[work_index] <= 1;
                         pi_integral[work_index] <= 0;
                         pi_integral[work_index] <= 0;
-                    end else if (bmc_temperature >= HARD_LIMIT) begin
-                        output_control_data <= 16'h0000;
-                        safety_override_mask[work_index] <= 1;
-                        lane_fault_mask[channel_lane] <= 1;
-                        pi_integral[work_index] <= 0;
                     end else begin
                     end else begin
                         output_control_data <= {pid_duty, pid_duty};
                         output_control_data <= {pid_duty, pid_duty};
                         pi_integral[work_index] <= (pid_sum <= 0) ? 0 : (pid_sum >= 100) ? 100 : pid_sum[15:0];
                         pi_integral[work_index] <= (pid_sum <= 0) ? 0 : (pid_sum >= 100) ? 100 : pid_sum[15:0];
@@ -318,7 +382,8 @@ module thermal_control_core #(
                 W_FAN_WRITE: begin
                 W_FAN_WRITE: begin
                     output_control_write <= 1;
                     output_control_write <= 1;
                     output_control_addr <= work_index;
                     output_control_addr <= work_index;
-                    output_control_data <= {8'd30, lane_fault_mask[output_lane] ? 8'd100 : 8'd30};
+                    output_control_data <= {FAN_SAFE_DUTY,
+                        lane_fault_mask[output_lane] ? 8'd100 : FAN_SAFE_DUTY};
                     if (work_index == 31) begin
                     if (work_index == 31) begin
                         work_index <= 0;
                         work_index <= 0;
                         output_control_read_addr <= 0;
                         output_control_read_addr <= 0;
@@ -332,15 +397,23 @@ module thermal_control_core #(
                 W_APPLY_WRITE: begin
                 W_APPLY_WRITE: begin
                     output_control_write <= 1;
                     output_control_write <= 1;
                     output_control_addr <= work_index;
                     output_control_addr <= work_index;
-                    if (work_index < 24)
+                    if (work_index < 24 && control_state == OWNER_MANUAL)
+                        output_control_data <= {manual_data,
+                            (lane_fault_mask[channel_lane] || safety_override_mask[work_index]) ?
+                                8'd0 : manual_data};
+                    else if (work_index < 24)
                         output_control_data <= {output_control_requested,
                         output_control_data <= {output_control_requested,
-                            lane_fault_mask[channel_lane] ? 8'd0 : output_control_requested};
+                            (lane_fault_mask[channel_lane] || safety_override_mask[work_index]) ?
+                                8'd0 : output_control_requested};
+                    else if (control_state == OWNER_MANUAL)
+                        output_control_data <= {manual_data,
+                            lane_fault_mask[output_lane] ? 8'd100 : manual_data};
                     else
                     else
                         output_control_data <= {output_control_requested,
                         output_control_data <= {output_control_requested,
                             lane_fault_mask[output_lane] ? 8'd100 : output_control_requested};
                             lane_fault_mask[output_lane] ? 8'd100 : output_control_requested};
                     if (work_index == 31) begin
                     if (work_index == 31) begin
                         work_index <= 0;
                         work_index <= 0;
-                        commit_kind <= COMMIT_PID;
+                        commit_kind <= (control_state == OWNER_PID) ? COMMIT_PID : COMMIT_NONE;
                         work_state <= W_COMMIT_WAIT;
                         work_state <= W_COMMIT_WAIT;
                     end else begin
                     end else begin
                         work_index <= work_index + 1'b1;
                         work_index <= work_index + 1'b1;
@@ -354,13 +427,13 @@ module thermal_control_core #(
                     control_epoch <= control_epoch + 1'b1;
                     control_epoch <= control_epoch + 1'b1;
                     if (commit_kind == COMMIT_MANUAL) begin
                     if (commit_kind == COMMIT_MANUAL) begin
                         manual_commit_done <= 1;
                         manual_commit_done <= 1;
-                        control_state <= MANUAL_SET_ALL;
-                        watchdog_remaining <= WATCHDOG_SECONDS;
+                        control_state <= OWNER_MANUAL;
+                        watchdog_remaining <= WATCHDOG_LOAD;
                     end else if (commit_kind == COMMIT_SAFE) begin
                     end else if (commit_kind == COMMIT_SAFE) begin
-                        control_state <= PID_WAIT_SENSOR;
+                        control_state <= OWNER_PID;
                         watchdog_remaining <= 0;
                         watchdog_remaining <= 0;
-                    end else begin
-                        control_state <= (|lane_fault_mask) ? HARD_PROTECT : PID_AUTO;
+                    end else if (commit_kind == COMMIT_PID) begin
+                        control_state <= OWNER_PID;
                     end
                     end
                     commit_kind <= COMMIT_NONE;
                     commit_kind <= COMMIT_NONE;
                     work_state <= W_IDLE;
                     work_state <= W_IDLE;

+ 30 - 9
tests/sim/thermal_control_core_tb.v

@@ -24,7 +24,7 @@ module thermal_control_core_tb;
     always #5 clk = ~clk;
     always #5 clk = ~clk;
     always @(posedge clk) if (output_commit) commits <= commits + 1;
     always @(posedge clk) if (output_commit) commits <= commits + 1;
 
 
-    thermal_control_core dut (
+    thermal_control_core #(.WATCHDOG_TICKS_OVERRIDE(10)) dut (
         .clk(clk), .rst_n(rst_n), .tick_1s(tick),
         .clk(clk), .rst_n(rst_n), .tick_1s(tick),
         .manual_wr_en(manual_wr), .manual_wr_addr(manual_addr),
         .manual_wr_en(manual_wr), .manual_wr_addr(manual_addr),
         .manual_wr_data(manual_data), .manual_commit(manual_commit),
         .manual_wr_data(manual_data), .manual_commit(manual_commit),
@@ -61,6 +61,15 @@ module thermal_control_core_tb;
             if (timeout == 500) $fatal(1, "commit timeout mode=%0d work=%0d", mode, dut.work_state);
             if (timeout == 500) $fatal(1, "commit timeout mode=%0d work=%0d", mode, dut.work_state);
         end
         end
     endtask
     endtask
+    task wait_manual_commit;
+        integer timeout;
+        begin
+            timeout = 0;
+            while (!manual_done && timeout < 500) begin @(negedge clk); timeout = timeout + 1; end
+            if (timeout == 500) $fatal(1, "manual commit timeout mode=%0d work=%0d", mode, dut.work_state);
+            @(negedge clk);
+        end
+    endtask
     task check_duty;
     task check_duty;
         input [4:0] address;
         input [4:0] address;
         input [7:0] expected;
         input [7:0] expected;
@@ -97,19 +106,19 @@ module thermal_control_core_tb;
         // A new complete valid BMC epoch starts PID; absence never integrates.
         // A new complete valid BMC epoch starts PID; absence never integrates.
         bmc_stale = 0; bmc_epoch = 1;
         bmc_stale = 0; bmc_epoch = 1;
         i = commits; wait_commit(i);
         i = commits; wait_commit(i);
-        if (mode != 3 || !pid_running) $fatal;
+        if (mode != 2 || !pid_running) $fatal;
 
 
         // SET_PID_TARGET changes only the next PID target.
         // SET_PID_TARGET changes only the next PID target.
         @(negedge clk); pid_target = 65; pid_commit = 1;
         @(negedge clk); pid_target = 65; pid_commit = 1;
         @(negedge clk); pid_commit = 0;
         @(negedge clk); pid_commit = 0;
-        if (current_target != 65 || mode != 3) $fatal;
+        if (current_target != 65 || mode != 2) $fatal;
 
 
-        // SET_ALL atomically enters Manual, resets PI and reloads 10 seconds.
+        // SET_ALL atomically enters Manual, freezes PI and reloads the test override.
         stage_manual();
         stage_manual();
         i = commits;
         i = commits;
         @(negedge clk); manual_commit = 1;
         @(negedge clk); manual_commit = 1;
         @(negedge clk); manual_commit = 0;
         @(negedge clk); manual_commit = 0;
-        wait_commit(i);
+        wait_manual_commit();
         if (mode != 1 || !manual_mode || watchdog_remaining != 10) $fatal;
         if (mode != 1 || !manual_mode || watchdog_remaining != 10) $fatal;
         check_duty(0, 50); check_duty(24, 0); check_duty(25, 20);
         check_duty(0, 50); check_duty(24, 0); check_duty(25, 20);
         check_duty(26, 50); check_duty(27, 100);
         check_duty(26, 50); check_duty(27, 100);
@@ -121,7 +130,7 @@ module thermal_control_core_tb;
         i = commits;
         i = commits;
         @(negedge clk); manual_commit = 1; tick = 1;
         @(negedge clk); manual_commit = 1; tick = 1;
         @(negedge clk); manual_commit = 0; tick = 0;
         @(negedge clk); manual_commit = 0; tick = 0;
-        wait_commit(i);
+        wait_manual_commit();
         if (mode != 1 || watchdog_remaining != 10) $fatal;
         if (mode != 1 || watchdog_remaining != 10) $fatal;
 
 
         // Manual timeout returns atomically to safe PID_WAIT_SENSOR.
         // Manual timeout returns atomically to safe PID_WAIT_SENSOR.
@@ -131,13 +140,25 @@ module thermal_control_core_tb;
         if (mode != 2 || manual_mode) $fatal;
         if (mode != 2 || manual_mode) $fatal;
         check_duty(0, 0); check_duty(24, 20);
         check_duty(0, 0); check_duty(24, 20);
 
 
+        // A valid 76 C channel is clamped without changing Manual ownership.
+        stage_manual();
+        i = commits;
+        @(negedge clk); manual_commit = 1;
+        @(negedge clk); manual_commit = 0;
+        wait_manual_commit();
+        bmc_raw[0] = {8'd76, 8'd0}; bmc_epoch = 2;
+        i = commits; wait_commit(i);
+        if (mode != 1 || hard_protect || !safety[0]) $fatal;
+        check_duty(0, 0); check_duty(1, 50); check_duty(24, 0);
+
         // Only confirmed 77 C hard protection may force lane fans to 100.
         // Only confirmed 77 C hard protection may force lane fans to 100.
         bmc_raw[0] = {8'd77, 8'd0}; bmc_epoch = 2;
         bmc_raw[0] = {8'd77, 8'd0}; bmc_epoch = 2;
+        bmc_epoch = 3;
         i = commits; wait_commit(i);
         i = commits; wait_commit(i);
-        if (mode != 4 || !hard_protect || !lane_fault[0]) $fatal;
+        if (mode != 2 || !hard_protect || !lane_fault[0]) $fatal;
         check_duty(0, 0); check_duty(24, 100); check_duty(28, 100);
         check_duty(0, 0); check_duty(24, 100); check_duty(28, 100);
-        check_duty(25, 30);
-        $display("PASS: boot/manual/watchdog/PID wait/77C hard-protect modes");
+        check_duty(25, 20);
+        $display("PASS: SAFE/MANUAL/PID watchdog, 76C clamp, 77C hard-protect");
         $finish;
         $finish;
     end
     end
 endmodule
 endmodule

+ 5 - 1
tests/unit/test_6400_v1_contract.py

@@ -131,7 +131,11 @@ def test_generated_standby_duty_reaches_the_production_core() -> None:
     assert "parameter [7:0] FAN_STANDBY_DUTY = `FAN_STANDBY_DUTY" in top
     assert "parameter [7:0] FAN_STANDBY_DUTY = `FAN_STANDBY_DUTY" in top
     assert ".FAN_SAFE_DUTY(FAN_STANDBY_DUTY)" in top
     assert ".FAN_SAFE_DUTY(FAN_STANDBY_DUTY)" in top
     assert "parameter [7:0] FAN_SAFE_DUTY = `FAN_SAFE_DUTY" in core
     assert "parameter [7:0] FAN_SAFE_DUTY = `FAN_SAFE_DUTY" in core
-    assert "SET_ALL_WATCHDOG_SECONDS 10" in (ROOT / "generated/6400/prod2u_6400_v1_params.vh").read_text()
+    params = (ROOT / "generated/6400/prod2u_6400_v1_params.vh").read_text()
+    assert "CONTROL_WATCHDOG_SECONDS 30" in params
+    assert "FB_OWNER_SAFE 3'd0" in params
+    assert "FB_OWNER_MANUAL 3'd1" in params
+    assert "FB_OWNER_PID 3'd2" in params
     assert "DEFAULT_PID_TARGET_C 70" in (ROOT / "generated/6400/prod2u_6400_v1_params.vh").read_text()
     assert "DEFAULT_PID_TARGET_C 70" in (ROOT / "generated/6400/prod2u_6400_v1_params.vh").read_text()
 
 
 
 

+ 7 - 7
tests/unit/test_6400_v1_source_closure.py

@@ -8,7 +8,7 @@ ROOT = Path(__file__).resolve().parents[2]
 
 
 
 
 def test_production_closure_excludes_legacy_and_stimulus_wrapper() -> None:
 def test_production_closure_excludes_legacy_and_stimulus_wrapper() -> None:
-    closure = json.loads((ROOT / "products/6400-control/source-closure.json").read_text())
+    closure = json.loads((ROOT / "products/6400-front-rear/source-closure.json").read_text())
     sources = "\n".join(closure["sources"])
     sources = "\n".join(closure["sources"])
     assert "identification" not in sources
     assert "identification" not in sources
     for forbidden in ("door_", "motor", "host_watchdog", "EF2_PHY_PLL"):
     for forbidden in ("door_", "motor", "host_watchdog", "EF2_PHY_PLL"):
@@ -17,14 +17,14 @@ def test_production_closure_excludes_legacy_and_stimulus_wrapper() -> None:
     assert "src/top/prod2u_6400_rs232_only_top.v" in closure["sources"]
     assert "src/top/prod2u_6400_rs232_only_top.v" in closure["sources"]
     assert "src/actuator/fan_boot_safety_controller.v" not in closure["sources"]
     assert "src/actuator/fan_boot_safety_controller.v" not in closure["sources"]
     assert "src/control/manual_set_all_bank.v" in closure["sources"]
     assert "src/control/manual_set_all_bank.v" in closure["sources"]
-    assert "src/control/stimulus_atomic_bank.v" in closure["sources"]
+    assert "src/control/stimulus_atomic_bank.v" not in closure["sources"]
 
 
     runner = (ROOT / "tools/run_6400_v1.py").read_text(encoding="utf-8")
     runner = (ROOT / "tools/run_6400_v1.py").read_text(encoding="utf-8")
     assert "select -assert-none t:stimulus_atomic_bank" in runner
     assert "select -assert-none t:stimulus_atomic_bank" in runner
 
 
 
 
 def test_known_pins_are_unique_and_ttl_is_disabled_in_rs232_only_hardware() -> None:
 def test_known_pins_are_unique_and_ttl_is_disabled_in_rs232_only_hardware() -> None:
-    project = json.loads((ROOT / "products/6400-control/project.json").read_text())
+    project = json.loads((ROOT / "products/6400-front-rear/project.json").read_text())
     assert project["ttl_pin_status"] == "disabled_in_rs232_only_hardware_profile_unbound"
     assert project["ttl_pin_status"] == "disabled_in_rs232_only_hardware_profile_unbound"
     assert project["host_interfaces"] == ["host_rs232"]
     assert project["host_interfaces"] == ["host_rs232"]
     assert project["host_rs232_connector"] == "CON78"
     assert project["host_rs232_connector"] == "CON78"
@@ -35,14 +35,14 @@ def test_known_pins_are_unique_and_ttl_is_disabled_in_rs232_only_hardware() -> N
 
 
 
 
 def test_no_host_watchdog_or_pll_in_6400_sources() -> None:
 def test_no_host_watchdog_or_pll_in_6400_sources() -> None:
-    closure = json.loads((ROOT / "products/6400-control/source-closure.json").read_text())
+    closure = json.loads((ROOT / "products/6400-front-rear/source-closure.json").read_text())
     text = "\n".join((ROOT / source).read_text(errors="ignore") for source in closure["sources"] if source.endswith(".v"))
     text = "\n".join((ROOT / source).read_text(errors="ignore") for source in closure["sources"] if source.endswith(".v"))
     assert "host_watchdog" not in text
     assert "host_watchdog" not in text
     assert "EF2_PHY_PLL" not in text
     assert "EF2_PHY_PLL" not in text
 
 
 
 
 def test_active_td_and_packaging_exclude_historical_interleaved_tree() -> None:
 def test_active_td_and_packaging_exclude_historical_interleaved_tree() -> None:
-    closure = json.loads((ROOT / "products/6400-control/source-closure.json").read_text())
+    closure = json.loads((ROOT / "products/6400-front-rear/source-closure.json").read_text())
     joined = "\n".join(closure["sources"])
     joined = "\n".join(closure["sources"])
     for forbidden in (
     for forbidden in (
         "src/generated/6400",
         "src/generated/6400",
@@ -53,8 +53,8 @@ def test_active_td_and_packaging_exclude_historical_interleaved_tree() -> None:
         assert forbidden not in joined
         assert forbidden not in joined
 
 
     target = resolve_target("6400")
     target = resolve_target("6400")
-    assert target.project_config == ROOT / "products/6400-control/project.json"
-    assert target.source_closure == ROOT / "products/6400-control/source-closure.json"
+    assert target.project_config == ROOT / "products/6400-front-rear/project.json"
+    assert target.source_closure == ROOT / "products/6400-front-rear/source-closure.json"
     assert target.generated_dir == ROOT / "generated/6400"
     assert target.generated_dir == ROOT / "generated/6400"
     assert target.top_module == "prod2u_6400_rs232_only_top"
     assert target.top_module == "prod2u_6400_rs232_only_top"
 
 

+ 5 - 13
tests/unit/test_encode_6400_hex.py

@@ -11,23 +11,15 @@ ROOT = Path(__file__).resolve().parents[2]
 def test_set_all_pid_and_get_match_generated_golden_vectors() -> None:
 def test_set_all_pid_and_get_match_generated_golden_vectors() -> None:
     encoder = Encoder()
     encoder = Encoder()
     golden = encoder.contract["golden_vectors"]["frames"]
     golden = encoder.contract["golden_vectors"]["frames"]
-    assert encoder.set_all("6400-control", [0] * 24, [20] * 4, [20] * 4).hex().upper() == golden["set_all_safe"]
-    assert encoder.set_pid_target("6400-control", 70).hex().upper() == golden["set_pid_target_70"]
-    assert encoder.get_snapshot("6400-control").hex().upper() == golden["get_snapshot"]
+    assert encoder.set_all("6400-front-rear", [0] * 24, [20] * 4, [20] * 4).hex().upper() == golden["set_all_safe"]
+    assert encoder.set_pid_target("6400-front-rear", 70).hex().upper() == golden["set_pid_target_70"]
+    assert encoder.get_snapshot("6400-front-rear").hex().upper() == golden["get_snapshot"]
 
 
 
 
-def test_profile_isolation_and_stimulus_layout() -> None:
+def test_single_product_rejects_reserved_stimulus() -> None:
     encoder = Encoder()
     encoder = Encoder()
     with pytest.raises(ValueError, match="not supported"):
     with pytest.raises(ValueError, match="not supported"):
-        encoder.set_stimulus("6400-control", 1, [0] * 24, [0] * 4, [0] * 4)
-    result = encoder.set_stimulus(
-        "6400-identification", 3, list(range(24)), [10, 20, 30, 40], [50, 60, 70, 80]
-    )
-    assert result[2:4] == bytes((0x03, 33))
-    assert result[4] == 3
-    assert list(result[5:29]) == list(range(24))
-    assert list(result[29:33]) == [10, 20, 30, 40]
-    assert list(result[33:37]) == [50, 60, 70, 80]
+        encoder.set_stimulus("6400-front-rear", 1, [0] * 24, [0] * 4, [0] * 4)
 
 
 
 
 def test_only_canonical_profile_names_are_accepted() -> None:
 def test_only_canonical_profile_names_are_accepted() -> None:

+ 8 - 7
tools/6400_hex_gui.py

@@ -110,12 +110,15 @@ def run_gui() -> int:
 
 
     summary = page("Build / Contract")
     summary = page("Build / Contract")
     facts = [
     facts = [
+        ("Product", "6400-front-rear"), ("Board", "FCB V1.1"),
         ("Profile", profile), ("CPLD commit", METADATA["commit"]),
         ("Profile", profile), ("CPLD commit", METADATA["commit"]),
         ("Contract SHA", CONTRACT["contract_sha256"]),
         ("Contract SHA", CONTRACT["contract_sha256"]),
         ("Bitstream SHA", METADATA["bitstream_sha256"]),
         ("Bitstream SHA", METADATA["bitstream_sha256"]),
         ("Host", "RS232/TTL 921600 8N1"), ("BMC", "RS232 115200 8N1"),
         ("Host", "RS232/TTL 921600 8N1"), ("BMC", "RS232 115200 8N1"),
-        ("PWM", f"{CONTRACT['fan_control']['pwm']['fan_hz']} Hz"),
-        ("SET_ALL watchdog", "10 s"), ("Default PID target", "70 C"),
+        ("PTC PWM", f"{CONTRACT['fan_control']['pwm']['ptc_hz']} Hz"),
+        ("FAN PWM", f"{CONTRACT['fan_control']['pwm']['fan_hz']} Hz"),
+        ("SET_ALL watchdog", "30 s"), ("Default PID target", "70 C"),
+        ("FAN_BOARD_INVERT_MASK", "0x0F"),
     ]
     ]
     for row, (key, value) in enumerate(facts):
     for row, (key, value) in enumerate(facts):
         ttk.Label(summary, text=key + ":", width=24).grid(row=row, column=0, sticky="w", padx=8, pady=5)
         ttk.Label(summary, text=key + ":", width=24).grid(row=row, column=0, sticky="w", padx=8, pady=5)
@@ -139,6 +142,8 @@ def run_gui() -> int:
 
 
     ttk.Button(set_page, text="Generate SET_ALL", command=make_set_all).grid(row=5, column=0, columnspan=2, pady=10)
     ttk.Button(set_page, text="Generate SET_ALL", command=make_set_all).grid(row=5, column=0, columnspan=2, pady=10)
     ttk.Label(set_page, text="Order: PTC0..23, Front0..3, Rear0..3. Values are connector high-level duty.").grid(row=5, column=2, columnspan=6, sticky="w")
     ttk.Label(set_page, text="Order: PTC0..23, Front0..3, Rear0..3. Values are connector high-level duty.").grid(row=5, column=2, columnspan=6, sticky="w")
+    ttk.Label(set_page, text="MANUAL OPEN-LOOP — BMC TEMPERATURE MAY BE UNAVAILABLE", foreground="red").grid(row=6, column=0, columnspan=8, sticky="w", padx=8)
+    ttk.Label(set_page, text="MANUAL WITHOUT BMC HAS NO BMC-BASED OVERTEMPERATURE PROTECTION", foreground="red").grid(row=7, column=0, columnspan=8, sticky="w", padx=8)
 
 
     get_page = page("GET reply 06 -> 82")
     get_page = page("GET reply 06 -> 82")
     ttk.Button(get_page, text="Generate GET_SNAPSHOT", command=lambda: output.set(frame_hex(encode(2)))).pack(anchor="w", padx=10, pady=10)
     ttk.Button(get_page, text="Generate GET_SNAPSHOT", command=lambda: output.set(frame_hex(encode(2)))).pack(anchor="w", padx=10, pady=10)
@@ -151,12 +156,8 @@ def run_gui() -> int:
     ttk.Label(pid_page, text="Updates the next PID_AUTO target only; it does not start PID, change Manual output, or feed watchdog.").pack(anchor="w", padx=10, pady=10)
     ttk.Label(pid_page, text="Updates the next PID_AUTO target only; it does not start PID, change Manual output, or feed watchdog.").pack(anchor="w", padx=10, pady=10)
 
 
     stimulus = page("0x03 profile behavior")
     stimulus = page("0x03 profile behavior")
-    enabled = "SET_STIMULUS enabled with unchanged 33-byte payload" if profile != "6400-control" else "Production: valid SET_STIMULUS receives UNSUPPORTED NACK"
+    enabled = "Valid SET_STIMULUS preserves type/payload and receives UNSUPPORTED NACK"
     ttk.Label(stimulus, text=enabled).pack(anchor="w", padx=10, pady=10)
     ttk.Label(stimulus, text=enabled).pack(anchor="w", padx=10, pady=10)
-    if profile != "6400-control":
-        duration = tk.IntVar(value=1)
-        ttk.Spinbox(stimulus, from_=1, to=255, textvariable=duration, width=8).pack(anchor="w", padx=10)
-        ttk.Button(stimulus, text="Generate SET_STIMULUS from current 32 duties", command=lambda: output.set(frame_hex(encode(3, bytes((duration.get(),)) + bytes(v.get() for v in variables))))).pack(anchor="w", padx=10, pady=10)
 
 
     parser = page("ACK/NACK + Snapshot parser")
     parser = page("ACK/NACK + Snapshot parser")
     parse_input = tk.Text(parser, height=8)
     parse_input = tk.Text(parser, height=8)

+ 1 - 1
tools/build_6400_hex_gui.py

@@ -20,7 +20,7 @@ def sha(path: Path) -> str:
 
 
 def main() -> int:
 def main() -> int:
     parser = argparse.ArgumentParser()
     parser = argparse.ArgumentParser()
-    parser.add_argument("--profile", choices=("6400-control", "6400-identification"), required=True)
+    parser.add_argument("--profile", choices=("6400-front-rear",), default="6400-front-rear")
     parser.add_argument("--output-dir", type=Path, required=True)
     parser.add_argument("--output-dir", type=Path, required=True)
     parser.add_argument("--bitstream-sha256", required=True)
     parser.add_argument("--bitstream-sha256", required=True)
     args = parser.parse_args()
     args = parser.parse_args()

+ 1 - 1
tools/fw_cli.py

@@ -231,7 +231,7 @@ def main(argv: list[str] | None = None) -> int:
     pkg.add_argument("--kind", default="source", choices=("source", "review", "firmware"))
     pkg.add_argument("--kind", default="source", choices=("source", "review", "firmware"))
     pkg.add_argument(
     pkg.add_argument(
         "--profile",
         "--profile",
-        choices=("6400-control", "6400-identification", "6400-sim-debug"),
+        choices=("6400-front-rear",),
     )
     )
     pkg.add_argument("--td-receipt", type=Path)
     pkg.add_argument("--td-receipt", type=Path)
     args = parser.parse_args(argv)
     args = parser.parse_args(argv)

+ 9 - 22
tools/generate_6400_v1.py

@@ -271,9 +271,9 @@ def verilog_header(layout_rows: list[dict[str, Any]], snapshot_size: int, wire:
         "`define FB_STATUS_BAD_VALUE 8'd3",
         "`define FB_STATUS_BAD_VALUE 8'd3",
         "`define FB_STATUS_SAFETY_LOCKED 8'd4",
         "`define FB_STATUS_SAFETY_LOCKED 8'd4",
         f"`define FB_SNAPSHOT_LENGTH {snapshot_size}",
         f"`define FB_SNAPSHOT_LENGTH {snapshot_size}",
-        f"`define FB_TEMP_SOFT {int(limits['soft'])}",
-        f"`define FB_TEMP_PRETRIP {int(limits['pretrip'])}",
-        f"`define FB_TEMP_HARD {int(limits['hard'])}",
+        f"`define FB_TEMP_CHANNEL_CLAMP {int(limits['channel_clamp'])}",
+        f"`define FB_TEMP_LANE_HARD {int(limits['lane_hard'])}",
+        f"`define FB_TEMP_LANE_RELEASE {int(limits['lane_release'])}",
         f"`define FB_TEMP_DEFAULT_TARGET {int(target['default'])}",
         f"`define FB_TEMP_DEFAULT_TARGET {int(target['default'])}",
         f"`define FB_EDGE_KP_Q4_12 {int(classes['EDGE']['kp_q4_12'])}",
         f"`define FB_EDGE_KP_Q4_12 {int(classes['EDGE']['kp_q4_12'])}",
         f"`define FB_EDGE_KI_Q4_12 {int(classes['EDGE']['ki_q4_12'])}",
         f"`define FB_EDGE_KI_Q4_12 {int(classes['EDGE']['ki_q4_12'])}",
@@ -283,13 +283,12 @@ def verilog_header(layout_rows: list[dict[str, Any]], snapshot_size: int, wire:
         "`define FAN_STANDBY_DUTY `FAN_SAFE_DUTY",
         "`define FAN_STANDBY_DUTY `FAN_SAFE_DUTY",
         "`define FB_FAN_RESET `FAN_STANDBY_DUTY",
         "`define FB_FAN_RESET `FAN_STANDBY_DUTY",
         f"`define FB_FAN_HARD {int(fan['duty']['hard'])}",
         f"`define FB_FAN_HARD {int(fan['duty']['hard'])}",
-        "`define SET_ALL_WATCHDOG_SECONDS 10",
+        "`define CONTROL_WATCHDOG_SECONDS 30",
+        "`define SET_ALL_WATCHDOG_SECONDS `CONTROL_WATCHDOG_SECONDS",
         "`define DEFAULT_PID_TARGET_C 70",
         "`define DEFAULT_PID_TARGET_C 70",
-        "`define FB_MODE_BOOT_WAIT 3'd0",
-        "`define FB_MODE_MANUAL_SET_ALL 3'd1",
-        "`define FB_MODE_PID_WAIT_SENSOR 3'd2",
-        "`define FB_MODE_PID_AUTO 3'd3",
-        "`define FB_MODE_HARD_PROTECT 3'd4",
+        "`define FB_OWNER_SAFE 3'd0",
+        "`define FB_OWNER_MANUAL 3'd1",
+        "`define FB_OWNER_PID 3'd2",
     ]
     ]
     for row in layout_rows:
     for row in layout_rows:
         macro = row["name"].upper()
         macro = row["name"].upper()
@@ -351,24 +350,12 @@ def generate(output: Path) -> dict[Path, bytes]:
         },
         },
     }
     }
     canonical_profiles = {
     canonical_profiles = {
-        "6400-control": {
+        "6400-front-rear": {
             "allowed_commands": ["SET_ALL", "GET_SNAPSHOT", "SET_PID_TARGET"],
             "allowed_commands": ["SET_ALL", "GET_SNAPSHOT", "SET_PID_TARGET"],
             "production": True,
             "production": True,
             "stimulus": False,
             "stimulus": False,
             "simulation_only": False,
             "simulation_only": False,
         },
         },
-        "6400-identification": {
-            "allowed_commands": ["SET_ALL", "GET_SNAPSHOT", "SET_STIMULUS", "SET_PID_TARGET"],
-            "production": False,
-            "stimulus": True,
-            "simulation_only": False,
-        },
-        "6400-sim-debug": {
-            "allowed_commands": ["SET_ALL", "GET_SNAPSHOT", "SET_STIMULUS", "SET_PID_TARGET"],
-            "production": False,
-            "stimulus": True,
-            "simulation_only": True,
-        },
     }
     }
     host = {
     host = {
         "schema": "prod2u-6400-host-contract-v3",
         "schema": "prod2u-6400-host-contract-v3",

+ 7 - 22
tools/package_target.py

@@ -103,12 +103,9 @@ def _resolve_6400_profile(target_name: str, profile_name: str | None) -> str:
         if profile_name is not None and profile_name != target_name:
         if profile_name is not None and profile_name != target_name:
             raise SystemExit("6400 package blocked: target/profile mismatch")
             raise SystemExit("6400 package blocked: target/profile mismatch")
         return target_name
         return target_name
-    if target_name == "6400-sim-debug" or profile_name == "6400-sim-debug":
-        raise SystemExit("6400 package blocked: Sim-Debug cannot produce a hardware package")
     if target_name != "6400" or profile_name not in HARDWARE_PROFILES:
     if target_name != "6400" or profile_name not in HARDWARE_PROFILES:
         raise SystemExit(
         raise SystemExit(
-            "6400 package blocked: explicitly select --profile "
-            "6400-control or 6400-identification"
+            "6400 package blocked: explicitly select --profile 6400-front-rear"
         )
         )
     return profile_name
     return profile_name
 
 
@@ -278,11 +275,7 @@ def build_target_package(
         "schema": "prod2u-target-package-v1",
         "schema": "prod2u-target-package-v1",
         "target_alias": target_alias,
         "target_alias": target_alias,
         "profile": selected_profile,
         "profile": selected_profile,
-        "firmware_role": (
-            "production"
-            if selected_profile == "6400-control"
-            else "identification" if selected_profile == "6400-identification" else "legacy"
-        ),
+        "firmware_role": "production" if is_6400 else "legacy",
         "project_id": project_id,
         "project_id": project_id,
         "top": top_module,
         "top": top_module,
         "kind": kind,
         "kind": kind,
@@ -373,13 +366,13 @@ def build_target_package(
                 f"{_sha256(bitstream_path)}  {bitstream_name}\n",
                 f"{_sha256(bitstream_path)}  {bitstream_name}\n",
                 encoding="ascii",
                 encoding="ascii",
             )
             )
-            role = "生产" if selected_profile == "6400-control" else "Identification 专用"
+            role = "生产"
             instruction_header = (
             instruction_header = (
                 DO_NOT_PROGRAM_LINE
                 DO_NOT_PROGRAM_LINE
                 if blocked
                 if blocked
                 else (
                 else (
                     PRODUCTION_PROGRAM_LINE
                     PRODUCTION_PROGRAM_LINE
-                    if selected_profile == "6400-control"
+                    if is_6400
                     else IDENTIFICATION_PROGRAM_LINE
                     else IDENTIFICATION_PROGRAM_LINE
                 )
                 )
             )
             )
@@ -393,11 +386,7 @@ def build_target_package(
                 "请审核 BITSTREAM-SHA256.txt 与 TD-BUILD-RECEIPT.json 后再冻结制品。\n"
                 "请审核 BITSTREAM-SHA256.txt 与 TD-BUILD-RECEIPT.json 后再冻结制品。\n"
                 f"Host 串口仅使用 CON78 RS-232 921600 8N1;每条合法命令先独立 ACK;Profile={selected_profile}。\n"
                 f"Host 串口仅使用 CON78 RS-232 921600 8N1;每条合法命令先独立 ACK;Profile={selected_profile}。\n"
                 "本包只包含 6400 固件,不能用于 MRDIMM 门控板。\n"
                 "本包只包含 6400 固件,不能用于 MRDIMM 门控板。\n"
-                + (
-                    "本固件含 SET_STIMULUS,仅限 Identification,不得作为 Production。\n"
-                    if selected_profile == "6400-identification"
-                    else "Production 固件不包含 SET_STIMULUS(stimulus=false)。\n"
-                )
+                + "本固件对保留的 SET_STIMULUS 返回 UNSUPPORTED NACK。\n"
                 + "\n"
                 + "\n"
                 "注意:本次交付未执行真实 JTAG/硬件烧录,硬件验证状态为 NOT RUN。\n",
                 "注意:本次交付未执行真实 JTAG/硬件烧录,硬件验证状态为 NOT RUN。\n",
                 encoding="utf-8",
                 encoding="utf-8",
@@ -457,11 +446,7 @@ def _selftest(zip_path: Path) -> None:
         if manifest.get("target_alias") == "6400" and manifest.get("kind") == "firmware":
         if manifest.get("target_alias") == "6400" and manifest.get("kind") == "firmware":
             profile_name = manifest["profile"]
             profile_name = manifest["profile"]
             profile = HARDWARE_PROFILES[profile_name]
             profile = HARDWARE_PROFILES[profile_name]
-            expected_name = (
-                "prod2u_6400_front_back.bit"
-                if profile_name == "6400-control"
-                else "prod2u_6400_identification.bit"
-            )
+            expected_name = "prod2u_6400_front_back.bit"
             bit = dest / expected_name
             bit = dest / expected_name
             if not bit.is_file() or _sha256(bit) != manifest.get("bitstream_sha256"):
             if not bit.is_file() or _sha256(bit) != manifest.get("bitstream_sha256"):
                 raise SystemExit("package selftest: 6400 bitstream identity mismatch")
                 raise SystemExit("package selftest: 6400 bitstream identity mismatch")
@@ -558,7 +543,7 @@ def main(argv: list[str] | None = None) -> int:
     parser.add_argument("--kind", choices=("source", "review", "firmware"), default="source")
     parser.add_argument("--kind", choices=("source", "review", "firmware"), default="source")
     parser.add_argument(
     parser.add_argument(
         "--profile",
         "--profile",
-        choices=("6400-control", "6400-identification", "6400-sim-debug"),
+        choices=("6400-front-rear",),
     )
     )
     parser.add_argument("--td-receipt", type=Path)
     parser.add_argument("--td-receipt", type=Path)
     parser.add_argument("--output-dir", type=Path, default=ROOT / "dist")
     parser.add_argument("--output-dir", type=Path, default=ROOT / "dist")

+ 1 - 1
tools/run_6400_soak.py

@@ -21,7 +21,7 @@ except ModuleNotFoundError:
 
 
 ROOT = Path(__file__).resolve().parents[1]
 ROOT = Path(__file__).resolve().parents[1]
 TEST_DIR = ROOT / "tests/cocotb"
 TEST_DIR = ROOT / "tests/cocotb"
-CLOSURE = ROOT / "products/6400-control/source-closure.json"
+CLOSURE = ROOT / "products/6400-front-rear/source-closure.json"
 WRAPPER = TEST_DIR / "prod2u_6400_v1_cocotb_top.v"
 WRAPPER = TEST_DIR / "prod2u_6400_v1_cocotb_top.v"
 
 
 
 

+ 5 - 19
tools/run_6400_td.py

@@ -17,11 +17,11 @@ import time
 
 
 
 
 ROOT = Path(__file__).resolve().parents[1]
 ROOT = Path(__file__).resolve().parents[1]
-DEFAULT_PROFILE = "6400-control"
+DEFAULT_PROFILE = "6400-front-rear"
 HARDWARE_PROFILES = {
 HARDWARE_PROFILES = {
-    "6400-control": {
-        "project": "products/6400-control/project.json",
-        "closure": "products/6400-control/source-closure.json",
+    "6400-front-rear": {
+        "project": "products/6400-front-rear/project.json",
+        "closure": "products/6400-front-rear/source-closure.json",
         "td_project": "td/prod2u_6400_front_back.prj",
         "td_project": "td/prod2u_6400_front_back.prj",
         "td_files": (
         "td_files": (
             "td/syn/prod2u_6400_front_back.tcl",
             "td/syn/prod2u_6400_front_back.tcl",
@@ -33,20 +33,6 @@ HARDWARE_PROFILES = {
         "stimulus": False,
         "stimulus": False,
         "hardware_host_interfaces": ("host_rs232",),
         "hardware_host_interfaces": ("host_rs232",),
     },
     },
-    "6400-identification": {
-        "project": "products/6400-identification/project.json",
-        "closure": "products/6400-identification/source-closure.json",
-        "td_project": "td/prod2u_6400_identification.prj",
-        "td_files": (
-            "td/syn/prod2u_6400_identification.tcl",
-            "td/phy/prod2u_6400_identification.tcl",
-            "td/bitgen/prod2u_6400_identification.tcl",
-        ),
-        "artifact_basename": "prod2u_6400_identification",
-        "production": False,
-        "stimulus": True,
-        "hardware_host_interfaces": ("host_rs232",),
-    },
 }
 }
 # Backward-compatible aliases for callers importing the production defaults.
 # Backward-compatible aliases for callers importing the production defaults.
 PROJECT = ROOT / str(HARDWARE_PROFILES[DEFAULT_PROFILE]["project"])
 PROJECT = ROOT / str(HARDWARE_PROFILES[DEFAULT_PROFILE]["project"])
@@ -318,7 +304,7 @@ def main(argv: list[str] | None = None) -> int:
     commit = git("rev-parse", "HEAD")
     commit = git("rev-parse", "HEAD")
     tree = git("rev-parse", "HEAD^{tree}")
     tree = git("rev-parse", "HEAD^{tree}")
     stamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
     stamp = datetime.now(timezone.utc).strftime("%Y%m%dT%H%M%SZ")
-    run_kind = "6400-td" if profile_name == DEFAULT_PROFILE else "6400-identification-td"
+    run_kind = "6400-td"
     run_id = f"{run_kind}-{stamp}-{commit[:8]}"
     run_id = f"{run_kind}-{stamp}-{commit[:8]}"
     run_root = args.run_root or Path(os.environ.get("PROD2U_TD_RUN_ROOT", "/data/prod2u/cpld-runs")) / run_id
     run_root = args.run_root or Path(os.environ.get("PROD2U_TD_RUN_ROOT", "/data/prod2u/cpld-runs")) / run_id
     for stage in ("syn", "phy", "bitgen"):
     for stage in ("syn", "phy", "bitgen"):

+ 1 - 2
tools/run_6400_v1.py

@@ -13,11 +13,10 @@ import tempfile
 
 
 
 
 ROOT = Path(__file__).resolve().parents[1]
 ROOT = Path(__file__).resolve().parents[1]
-CLOSURE = ROOT / "products/6400-control/source-closure.json"
+CLOSURE = ROOT / "products/6400-front-rear/source-closure.json"
 TESTBENCHES = (
 TESTBENCHES = (
     "host_port_selector_tb",
     "host_port_selector_tb",
     "bmc_ascii_snapshot_tb",
     "bmc_ascii_snapshot_tb",
-    "stimulus_atomic_bank_tb",
     "thermal_control_core_tb",
     "thermal_control_core_tb",
     "thermal_host_command_v2_tb",
     "thermal_host_command_v2_tb",
 )
 )