فهرست منبع

6400-no-pid-gui

Prod2U 3 ماه پیش
والد
کامیت
3c17f43e9c
3فایلهای تغییر یافته به همراه23 افزوده شده و 26 حذف شده
  1. 16 10
      src/control/thermal_control_core.v
  2. 3 6
      src/transport/thermal_host_command.v
  3. 4 10
      tools/6400_hex_gui.py

+ 16 - 10
src/control/thermal_control_core.v

@@ -4,6 +4,8 @@
 // Single-owner controller. Host and PID values are connector-side duties.
 // Single-owner controller. Host and PID values are connector-side duties.
 // Safety is an independent applied-output layer; board polarity is external.
 // Safety is an independent applied-output layer; board polarity is external.
 module thermal_control_core #(
 module thermal_control_core #(
+    // 6400 production is permanently manual; PID code is disabled at elaboration.
+    parameter integer ENABLE_PID = 0,
     parameter integer WATCHDOG_TICKS_OVERRIDE = 0,
     parameter integer WATCHDOG_TICKS_OVERRIDE = 0,
     parameter signed [15:0] CHANNEL_LIMIT = `FB_TEMP_CHANNEL_CLAMP,
     parameter signed [15:0] CHANNEL_LIMIT = `FB_TEMP_CHANNEL_CLAMP,
     parameter signed [15:0] HARD_LIMIT = `FB_TEMP_LANE_HARD,
     parameter signed [15:0] HARD_LIMIT = `FB_TEMP_LANE_HARD,
@@ -163,7 +165,7 @@ module thermal_control_core #(
 
 
     assign bmc_rd_index = work_index;
     assign bmc_rd_index = work_index;
     assign watchdog_active = control_state == OWNER_SAFE || control_state == OWNER_MANUAL;
     assign watchdog_active = control_state == OWNER_SAFE || control_state == OWNER_MANUAL;
-    assign pid_running = control_state == OWNER_PID && complete_valid_bmc;
+    assign pid_running = 1'b0;
     assign manual_mode = control_state == OWNER_MANUAL;
     assign manual_mode = control_state == OWNER_MANUAL;
     assign hard_protect = |lane_fault_mask;
     assign hard_protect = |lane_fault_mask;
 `ifdef FORMAL
 `ifdef FORMAL
@@ -186,12 +188,16 @@ module thermal_control_core #(
         .read_address(work_index), .read_data(manual_data)
         .read_address(work_index), .read_data(manual_data)
     );
     );
 
 
+`ifdef ENABLE_LEGACY_PID_STATE
     ef2_bram_dp #(.DATA_WIDTH(32), .ADDR_WIDTH(5), .DATA_DEPTH(32)) u_pi_state (
     ef2_bram_dp #(.DATA_WIDTH(32), .ADDR_WIDTH(5), .DATA_DEPTH(32)) u_pi_state (
         .clk(clk), .a_en(1'b1), .a_we(1'b0), .a_addr(work_index),
         .clk(clk), .a_en(1'b1), .a_we(1'b0), .a_addr(work_index),
         .a_wdata(32'd0), .a_rdata(pi_state_read_data),
         .a_wdata(32'd0), .a_rdata(pi_state_read_data),
         .b_en(1'b1), .b_we(pi_state_write), .b_addr(pi_state_write_addr),
         .b_en(1'b1), .b_we(pi_state_write), .b_addr(pi_state_write_addr),
         .b_wdata(pi_state_write_data), .b_rdata(pi_state_unused_read_data)
         .b_wdata(pi_state_write_data), .b_rdata(pi_state_unused_read_data)
     );
     );
+`else
+    assign pi_state_read_data = 32'd0;
+`endif
 
 
     thermal_output_banks u_output_banks (
     thermal_output_banks u_output_banks (
         .clk(clk), .active_bank(active_output_bank),
         .clk(clk), .active_bank(active_output_bank),
@@ -209,7 +215,7 @@ module thermal_control_core #(
         if (!rst_n) begin
         if (!rst_n) begin
             active_output_bank <= 0;
             active_output_bank <= 0;
             control_state <= OWNER_SAFE;
             control_state <= OWNER_SAFE;
-            current_target_celsius <= `DEFAULT_PID_TARGET_C;
+            current_target_celsius <= 8'd0;
             control_epoch <= 0;
             control_epoch <= 0;
             safety_override_mask <= 0;
             safety_override_mask <= 0;
             lane_fault_mask <= 0;
             lane_fault_mask <= 0;
@@ -248,7 +254,7 @@ module thermal_control_core #(
             output_control_write <= 0;
             output_control_write <= 0;
             pi_state_write <= 0;
             pi_state_write <= 0;
 
 
-            if (pid_target_commit)
+            if (ENABLE_PID && pid_target_commit)
                 current_target_celsius <= pid_target_celsius;
                 current_target_celsius <= pid_target_celsius;
             if (manual_commit_applied) begin
             if (manual_commit_applied) begin
                 manual_pending <= 1;
                 manual_pending <= 1;
@@ -307,7 +313,7 @@ module thermal_control_core #(
                         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 == OWNER_PID && bmc_stale && !stale_hold_committed) begin
+                    end else if (ENABLE_PID && control_state == OWNER_PID && bmc_stale && !stale_hold_committed) begin
                         global_fault <= 1;
                         global_fault <= 1;
                         work_index <= 0;
                         work_index <= 0;
                         commit_kind <= COMMIT_SAFE;
                         commit_kind <= COMMIT_SAFE;
@@ -348,7 +354,7 @@ module thermal_control_core #(
                         end
                         end
                         work_index <= 0;
                         work_index <= 0;
                         if (|newly_hard_mask) begin
                         if (|newly_hard_mask) begin
-                            control_state <= OWNER_PID;
+                            control_state <= OWNER_SAFE;
                             if (manual_pending) begin
                             if (manual_pending) begin
                                 manual_pending <= 0;
                                 manual_pending <= 0;
                                 manual_commit_done <= 1;
                                 manual_commit_done <= 1;
@@ -356,9 +362,9 @@ module thermal_control_core #(
                             end
                             end
                             commit_kind <= COMMIT_SAFE;
                             commit_kind <= COMMIT_SAFE;
                             work_state <= W_SAFE_FILL;
                             work_state <= W_SAFE_FILL;
-                        end else if (control_state == OWNER_PID && complete_valid_bmc) begin
+                        end else if (ENABLE_PID && control_state == OWNER_PID && complete_valid_bmc) begin
                             work_state <= W_PID_PREFETCH;
                             work_state <= W_PID_PREFETCH;
-                        end else if (control_state == OWNER_PID) begin
+                        end else if (ENABLE_PID && control_state == OWNER_PID) begin
                             commit_kind <= COMMIT_SAFE;
                             commit_kind <= COMMIT_SAFE;
                             work_state <= W_SAFE_FILL;
                             work_state <= W_SAFE_FILL;
                         end else if (control_state == OWNER_MANUAL) begin
                         end else if (control_state == OWNER_MANUAL) begin
@@ -477,7 +483,7 @@ module thermal_control_core #(
                             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 <= (control_state == OWNER_PID) ? COMMIT_PID : COMMIT_NONE;
+                        commit_kind <= 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;
@@ -514,11 +520,11 @@ module thermal_control_core #(
                             safe_pending <= 0;
                             safe_pending <= 0;
                             stale_hold_committed <= 0;
                             stale_hold_committed <= 0;
                         end else if (commit_kind == COMMIT_SAFE) begin
                         end else if (commit_kind == COMMIT_SAFE) begin
-                            control_state <= OWNER_PID;
+                            control_state <= OWNER_SAFE;
                             watchdog_remaining <= 0;
                             watchdog_remaining <= 0;
                             stale_hold_committed <= 1;
                             stale_hold_committed <= 1;
                         end else if (commit_kind == COMMIT_PID) begin
                         end else if (commit_kind == COMMIT_PID) begin
-                            control_state <= OWNER_PID;
+                            control_state <= OWNER_SAFE;
                             stale_hold_committed <= 0;
                             stale_hold_committed <= 0;
                         end
                         end
                         commit_kind <= COMMIT_NONE;
                         commit_kind <= COMMIT_NONE;

+ 3 - 6
src/transport/thermal_host_command.v

@@ -129,12 +129,9 @@ module thermal_host_command #(
                         else
                         else
                             start_ack(0, frame_type, `FB_STATUS_UNSUPPORTED, 0);
                             start_ack(0, frame_type, `FB_STATUS_UNSUPPORTED, 0);
                     end else if (frame_type == `FB_CMD_SET_PID_TARGET) begin
                     end else if (frame_type == `FB_CMD_SET_PID_TARGET) begin
-                        if (frame_length != 1)
-                            start_ack(0, frame_type, `FB_STATUS_BAD_LENGTH, 1);
-                        else begin
-                            payload_read_addr <= 0;
-                            state <= ST_PID_READ;
-                        end
+                        // PID command number is retained for wire compatibility only.
+                        // The 6400 production image never accepts or executes it.
+                        start_ack(0, frame_type, `FB_STATUS_UNSUPPORTED, 0);
                     end else begin
                     end else begin
                         start_ack(0, frame_type, `FB_STATUS_UNSUPPORTED, 0);
                         start_ack(0, frame_type, `FB_STATUS_UNSUPPORTED, 0);
                     end
                     end

+ 4 - 10
tools/6400_hex_gui.py

@@ -117,7 +117,7 @@ def run_gui() -> int:
         ("Host", "RS232/TTL 921600 8N1"), ("BMC", "RS232 115200 8N1"),
         ("Host", "RS232/TTL 921600 8N1"), ("BMC", "RS232 115200 8N1"),
         ("PTC PWM", f"{CONTRACT['fan_control']['pwm']['ptc_hz']} Hz"),
         ("PTC PWM", f"{CONTRACT['fan_control']['pwm']['ptc_hz']} Hz"),
         ("FAN PWM", f"{CONTRACT['fan_control']['pwm']['fan_hz']} Hz"),
         ("FAN PWM", f"{CONTRACT['fan_control']['pwm']['fan_hz']} Hz"),
-        ("SET_ALL watchdog", "30 s"), ("Default PID target", "70 C"),
+        ("SET_ALL watchdog", "30 s"), ("Control mode", "SAFE / MANUAL OPEN-LOOP"),
         ("FAN_BOARD_INVERT_MASK", "0x0F"),
         ("FAN_BOARD_INVERT_MASK", "0x0F"),
     ]
     ]
     for row, (key, value) in enumerate(facts):
     for row, (key, value) in enumerate(facts):
@@ -149,15 +149,9 @@ def run_gui() -> int:
     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)
     ttk.Label(get_page, text="Device replies exactly: 0x06 ACK/NACK, then 0x82 SNAPSHOT_DATA. Banks and Host port remain locked through DATA stop bit.", wraplength=1050).pack(anchor="w", padx=10)
     ttk.Label(get_page, text="Device replies exactly: 0x06 ACK/NACK, then 0x82 SNAPSHOT_DATA. Banks and Host port remain locked through DATA stop bit.", wraplength=1050).pack(anchor="w", padx=10)
 
 
-    pid_page = page("SET_PID_TARGET")
-    pid = tk.IntVar(value=70)
-    ttk.Spinbox(pid_page, from_=20, to=70, textvariable=pid, width=8).pack(anchor="w", padx=10, pady=10)
-    ttk.Button(pid_page, text="Generate SET_PID_TARGET", command=lambda: output.set(frame_hex(encode(4, bytes((pid.get(),)))))).pack(anchor="w", padx=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")
-    enabled = "Valid SET_STIMULUS preserves type/payload and receives UNSUPPORTED NACK"
-    ttk.Label(stimulus, text=enabled).pack(anchor="w", padx=10, pady=10)
+    retired = page("Retired commands")
+    ttk.Label(retired, text="PID and automatic-control commands are removed from the active 6400 product.").pack(anchor="w", padx=10, pady=10)
+    ttk.Label(retired, text="0x04 is reserved and must receive UNSUPPORTED; this GUI does not generate it.").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)