|
|
@@ -0,0 +1,90 @@
|
|
|
+# 6400-front-rear-v1 design lock
|
|
|
+
|
|
|
+Status: FROZEN for this task after the five audits in `docs/audits/`. Changes require an explicit decision-register entry and affected-audit rerun.
|
|
|
+
|
|
|
+## Product boundary
|
|
|
+
|
|
|
+- Device: EF2L45BG256B; one 25 MHz clock domain; no PLL, generated clock, gated clock, or CDC.
|
|
|
+- Four 6-DIMM execution lanes: L0 CPU0 slots 0-5, L1 CPU0 slots 6-11, L2 CPU1 slots 0-5, L3 CPU1 slots 6-11.
|
|
|
+- Three physical thermal zones: Z0=L0, Z1=L1+L2, Z2=L3.
|
|
|
+- 24 independent PTC duties, 4 front-fan duties, 4 rear-fan duties; every output is exact 500 Hz.
|
|
|
+- All 24 DIMMs are acquired, controlled, protected, simulated, and telemetered. L0-L2 are the 18-channel primary modelling cohort; L3 is a 6-channel holdout only for model fitting.
|
|
|
+- No motor, limit, door percentage, startup motor calibration, solenoid, fan FG, PLL, MCU/SoC, online learning, or Host watchdog.
|
|
|
+
|
|
|
+## Physical interfaces
|
|
|
+
|
|
|
+- BMC RS-232: UART1 / CON77, FPGA TX L10 and RX M9, 115200 8N1.
|
|
|
+- Host RS-232: UART2 / CON78, FPGA TX M10 and RX N11, 921600 8N1.
|
|
|
+- Host TTL: complete `host_ttl_rx`/`host_ttl_tx` 3.3 V interface in RTL. Its connector and balls are deliberately unbound until evidence proves them.
|
|
|
+- Host RS-232 and TTL RX each have a two-flop synchronizer. The first detected start bit selects one port for the complete request/response transaction. Only the selected TX toggles; the other remains high. Simultaneous use is out of contract.
|
|
|
+- CT7428: one open-drain I2C master on M8/N9; three devices 0x49, 0x48, 0x4B; nine registers each; all 27 values are retained with raw, converted, valid, age, source index, and epoch.
|
|
|
+- BMC poll command is exactly `ipmitool raw 0x36 0x6c 0xdf 0xdd 0x00 0x03\n`. The streaming parser accepts case-insensitive hex separated by whitespace/CR/LF, rejects malformed or non-48-byte replies, and never commits a partial snapshot. Each two-byte `FF FF` value is invalid, never 0 C.
|
|
|
+
|
|
|
+## Host wire protocol
|
|
|
+
|
|
|
+Frame: `A5 5A | TYPE | LENGTH | PAYLOAD | CRC_LOW | CRC_HIGH`. CRC-16/CCITT-FALSE covers TYPE, LENGTH, and payload. Invalid header, length, CRC, type, target, or timeout is silently discarded. There is no NACK, version, project ID, capability, sequence, transaction ID, timestamp, TLV, command queue, or parallel outstanding transaction.
|
|
|
+
|
|
|
+- `0x01 SET_TARGET`, payload length 1: `0` enters STOPPED; `20..70` atomically commits the global Celsius target; all other values are rejected. A legal commit returns `0x81 SET_TARGET_ACK`, zero payload. ACK means commit only.
|
|
|
+- `0x02 GET_SNAPSHOT`, zero payload: returns `0x82 SNAPSHOT_DATA`; DATA is the only reply.
|
|
|
+- `0x03 SET_STIMULUS`, identification and sim-debug profiles only: duration 1..255 seconds, 24 PTC duties, 4 front duties, 4 rear duties, all 0..100; legal atomic commit returns zero-payload `0x83`. Production removes the decoder path at compile time.
|
|
|
+- The Host may retry idempotent SET_TARGET after an ACK timeout. HTH permits one outstanding transaction only.
|
|
|
+
|
|
|
+The snapshot layout is generated from `contracts/6400-snapshot.yaml`, is fixed and under 200 bytes, and contains state/fault/target/source flags; BMC, CT, and control epochs and ages; 24 BMC raw pairs and valid bits; 27 CT raw values and valid bits; requested/applied PTC/front/rear duties; safety mask; lane faults; and global fault. TX locks bank IDs and streams offsets without copying the payload into flip-flops.
|
|
|
+
|
|
|
+## Control sequence
|
|
|
+
|
|
|
+Reset values: target 70 C, PTC 0, front/rear fan 10, epochs/valid/integrators clear.
|
|
|
+
|
|
|
+1. `RESET_SAFE`: enforce safe outputs, then enter `WAIT_CT_VALID`.
|
|
|
+2. `WAIT_CT_VALID`: wait for a complete valid CT scan required by the channel map.
|
|
|
+3. `PREHEAT_CT`: per-channel conservative CT feedback targets `target-5 C`; BMC polling continues.
|
|
|
+4. `WAIT_BMC_STABLE`: require three distinct complete valid BMC epochs.
|
|
|
+5. `AUTO_BMC`: one shared incremental-PI datapath updates channels 0..23 exactly once per new BMC epoch.
|
|
|
+6. `SENSOR_DEGRADED`: invalid channel disables that PTC and freezes its state; lane-level invalidity disables the lane and raises both fans; global BMC stale disables all PTC and sets all fans to 100.
|
|
|
+7. `STOPPED`: all PTC off, fan stop-safe value, acquisition and GET remain active. A later legal nonzero target restarts through the CT/BMC qualification sequence.
|
|
|
+
|
|
|
+Host connection state never changes the autonomous state machine. `host_target_seen` is telemetry only.
|
|
|
+
|
|
|
+## PI and supervision
|
|
|
+
|
|
|
+- Internal temperature unit: 0.01 C. Raw BMC bytes are always retained; until scaling evidence is complete, conversion is isolated behind the generated format contract.
|
|
|
+- One physical incremental PI datapath: `u[k]=u[k-1]+Kp*(e[k]-e[k-1])+Ki*e[k]`; Kd is zero in V1.
|
|
|
+- Coefficients have only EDGE (L0/L3) and CENTER (L1/L2) classes and are generated. Defaults are labelled `SIMULATION_DEFAULT_NOT_HARDWARE_TUNED`.
|
|
|
+- Required behavior: saturation, anti-windup, slew limiting, invalid/stale/safety freeze, epoch gating, CT-to-BMC and target-change bumpless transfer, and safe recovery.
|
|
|
+- One lane-statistics supervisor scans lanes sequentially and produces independent front/rear targets. It does not instantiate eight fan PIDs.
|
|
|
+
|
|
|
+## Safety
|
|
|
+
|
|
|
+Safety has final priority over autonomous and stimulus requests.
|
|
|
+
|
|
|
+- At 74 C: block positive integration, reduce the channel PTC, and increase lane airflow.
|
|
|
+- At 76 C: force the channel PTC off and raise both lane fans.
|
|
|
+- At or above 77 C: force all six lane PTCs off, set both lane fans to 100, and latch lane fault.
|
|
|
+- BMC stale: all 24 PTCs off and all 8 fan duties 100.
|
|
|
+- Invalid BMC channel: that PTC off and its controller frozen. Multiple invalid channels in a lane close the lane.
|
|
|
+- Recovery requires every relevant temperature at or below `target+2 C`, three distinct valid BMC epochs, and fresh sensors. Recovery starts from limited duty with reset/bumpless PI state.
|
|
|
+- Stimulus expires automatically and cannot bypass safety or maximum duty.
|
|
|
+
|
|
|
+This proves only deterministic electrical override after a sampled condition. Physical overshoot and the 77 C product objective remain NOT RUN.
|
|
|
+
|
|
|
+## PWM and storage
|
|
|
+
|
|
|
+- One global 0..99 phase, one 0..499 subcounter, one channel index, one synchronous duty read, one comparator, one 32-bit `next_bitmap`, and one 32-bit `active_bitmap`.
|
|
|
+- During each phase, scan all 32 requested/applied duties into `next_bitmap`. At the phase boundary atomically assign `active_bitmap <= next_bitmap`.
|
|
|
+- `duty=0` is always off; `100` always on; 1..99 are exact phase counts. Compile-time polarity masks drive physical pins.
|
|
|
+- BMC, CT, requested duties, snapshot view, and applicable parameters use inactive-bank writes plus a single bank-pointer flip. No large active-array copy is allowed.
|
|
|
+
|
|
|
+## Profiles
|
|
|
+
|
|
|
+- `6400-control`: production autonomous implementation; no stimulus/raw-manual path.
|
|
|
+- `6400-identification`: adds finite `SET_STIMULUS` under the same safety path.
|
|
|
+- `6400-sim-debug`: accelerated counters and observability; never a production source closure.
|
|
|
+- `legacy-door-percent`: retains the previous door product and its own nearest-scope contract; it cannot affect 6400 generation or closure.
|
|
|
+
|
|
|
+## Explicit unknowns
|
|
|
+
|
|
|
+- TTL Host physical balls/connector.
|
|
|
+- CT physical channel-to-DIMM mapping where current board evidence is insufficient.
|
|
|
+- BMC fractional byte scaling pending protocol evidence; raw bytes remain canonical.
|
|
|
+
|
|
|
+Unknowns are generated as explicit unbound/unknown fields and do not block logic simulation, Host software, lab replay, or the remaining known-pin production closure. A production TD run cannot claim a complete TTL physical interface until those pins are resolved.
|