Sfoglia il codice sorgente

feat(v3.3.0): deep serial LUT/Slice RTL optimization, UART +/-2% skew TB, board-viewer & 3-board protocol doc sync

Prod2U Recovery 6 giorni fa
parent
commit
b473cb32c2

+ 1 - 1
VERSION

@@ -1 +1 @@
-3.2.0
+3.3.0

+ 1 - 1
VERSION.json

@@ -1,6 +1,6 @@
 {
   "schema": "prod2u-version-v3",
-  "version": "3.2.0",
+  "version": "3.3.0",
   "release_branch": "dev",
   "clock_hz": 25000000,
   "host_baud": 921600,

File diff suppressed because it is too large
+ 56 - 29
docs/CPLD_通讯协议v2.0.md


+ 1 - 1
projects/registry.json

@@ -93,7 +93,7 @@
       "production_bitstream": "requires_qualified_receipt",
       "hardware_host_interfaces": [
         "CON78_RS232_921600_8N1",
-        "CON146_TTL_921600_8N1"
+        "CON140_TTL_921600_8N1"
       ],
       "unbound_interfaces": [],
       "frame_protocol": "A5 5A | TYPE:u8 | LENGTH:u8 | PAYLOAD | CRC_L | CRC_H (CRC-16/CCITT-FALSE)"

+ 24 - 24
src/acquisition/bmc_ascii_poll.v

@@ -74,14 +74,19 @@ module bmc_ascii_poll #(
     localparam integer DRAIN_BITS = $clog2(DRAIN_CLKS + 1);
 
     localparam integer POLL_CLKS = (CLOCK_HZ * POLL_SECONDS < 1) ? 1 : CLOCK_HZ * POLL_SECONDS;
-    localparam integer POLL_BITS = $clog2(POLL_CLKS + 1);
-    localparam integer ROUND_BITS = $clog2(ROUND_TIMEOUT_CLKS + 1);
+    localparam integer TIMER_MAX_1 = (POLL_CLKS >= ROUND_TIMEOUT_CLKS) ? POLL_CLKS : ROUND_TIMEOUT_CLKS;
+    localparam integer TIMER_MAX   = (TIMER_MAX_1 >= DRAIN_CLKS) ? TIMER_MAX_1 : DRAIN_CLKS;
+    localparam integer TIMER_BITS  = (TIMER_MAX <= 1) ? 1 : $clog2(TIMER_MAX);
+    /* verilator lint_off WIDTH */
+    localparam [TIMER_BITS-1:0] POLL_LAST  = POLL_CLKS - 1;
+    localparam [TIMER_BITS-1:0] ROUND_LAST = ROUND_TIMEOUT_CLKS - 1;
+    localparam [TIMER_BITS-1:0] DRAIN_LAST = DRAIN_CLKS - 1;
+    /* verilator lint_on WIDTH */
 
     reg [2:0] state;
     reg [5:0] command_index;
-    reg [POLL_BITS-1:0]  poll_counter;
-    reg [ROUND_BITS-1:0] round_counter;
-    reg [DRAIN_BITS-1:0] drain_counter;
+    // Single shared timer across mutually exclusive ST_WAIT / ST_DRAIN / ST_RECV
+    reg [TIMER_BITS-1:0] timer_cnt;
 
     // One small block RAM replaces the resettable 24-byte FF array. The
     // completed-pair count defines the valid prefix, so RAM needs no reset.
@@ -135,9 +140,7 @@ module bmc_ascii_poll #(
         if (!rst_n) begin
             state           <= ST_WAIT;
             command_index   <= 6'd0;
-            poll_counter    <= {POLL_BITS{1'b0}};
-            round_counter   <= {ROUND_BITS{1'b0}};
-            drain_counter   <= {DRAIN_BITS{1'b0}};
+            timer_cnt       <= {TIMER_BITS{1'b0}};
             tx_valid        <= 1'b0;
             tx_data         <= 8'd0;
             wr_en           <= 1'b0;
@@ -202,11 +205,9 @@ module bmc_ascii_poll #(
             case (state)
             ST_WAIT: begin
                 tx_valid <= 1'b0;
-                if (poll_counter + 1'b1 >= POLL_CLKS[POLL_BITS-1:0]) begin
-                    poll_counter    <= {POLL_BITS{1'b0}};
+                if (timer_cnt == POLL_LAST) begin
+                    timer_cnt       <= {TIMER_BITS{1'b0}};
                     command_index   <= 6'd0;
-                    round_counter   <= {ROUND_BITS{1'b0}};
-                    drain_counter   <= {DRAIN_BITS{1'b0}};
                     cur_word_len    <= 2'd0;
                     cur_word_hex    <= 1'b1;
                     cur_word_val    <= 8'd0;
@@ -217,13 +218,12 @@ module bmc_ascii_poll #(
                     poll_start      <= 1'b1;
                     state           <= ST_SEND;
                 end else begin
-                    poll_counter <= poll_counter + 1'b1;
+                    timer_cnt <= timer_cnt + 1'b1;
                 end
             end
 
             ST_SEND: begin
-                round_counter <= {ROUND_BITS{1'b0}};
-                drain_counter <= {DRAIN_BITS{1'b0}};
+                timer_cnt <= {TIMER_BITS{1'b0}};
                 if (!tx_valid) begin
                     tx_valid <= 1'b1;
                     tx_data  <= get_cmd_byte(command_index);
@@ -238,20 +238,20 @@ module bmc_ascii_poll #(
             end
 
             ST_DRAIN: begin
-                if (drain_counter + 1'b1 >= DRAIN_CLKS[DRAIN_BITS-1:0]) begin
-                    drain_counter <= {DRAIN_BITS{1'b0}};
-                    round_counter <= {ROUND_BITS{1'b0}};
-                    state         <= ST_RECV;
+                if (timer_cnt == DRAIN_LAST) begin
+                    timer_cnt <= {TIMER_BITS{1'b0}};
+                    state     <= ST_RECV;
                 end else begin
-                    drain_counter <= drain_counter + 1'b1;
+                    timer_cnt <= timer_cnt + 1'b1;
                 end
             end
 
             ST_RECV: begin
-                if (round_counter + 1'b1 >= ROUND_TIMEOUT_CLKS[ROUND_BITS-1:0]) begin
-                    state <= ST_FLUSH;
+                if (timer_cnt == ROUND_LAST) begin
+                    timer_cnt <= {TIMER_BITS{1'b0}};
+                    state     <= ST_FLUSH;
                 end else begin
-                    round_counter <= round_counter + 1'b1;
+                    timer_cnt <= timer_cnt + 1'b1;
                 end
             end
 
@@ -278,7 +278,7 @@ module bmc_ascii_poll #(
                     poll_count   <= poll_count + 1'b1;
                     round_failed <= (valid_count == 5'd0);
                     poll_done    <= 1'b1;
-                    poll_counter <= {POLL_BITS{1'b0}};
+                    timer_cnt    <= {TIMER_BITS{1'b0}};
                     state        <= ST_WAIT;
                 end else begin
                     commit_index <= commit_index + 1'b1;

+ 4 - 1
src/actuator/pwm_bitmap_engine.v

@@ -70,7 +70,10 @@ module pwm_bitmap_engine #(
         phase_boundary <= 0;
 
         if (rst_n && runtime_duty_ready && capture_valid) begin
-            next_bitmap[capture_addr] <= duty_rd_data > build_phase_8;
+            if (CHANNEL_COUNT > 1)
+                next_bitmap <= {(duty_rd_data > build_phase_8), next_bitmap[CHANNEL_COUNT-1:1]};
+            else
+                next_bitmap <= (duty_rd_data > build_phase_8);
             if (capture_addr == LAST_CHANNEL)
                 runtime_scan_complete <= 1;
         end

+ 8 - 7
src/common/crc16_serial.v

@@ -12,7 +12,7 @@ module crc16_serial (
 );
     reg        active;
     reg        busy_reg;
-    reg [3:0]  bit_index;
+    reg [2:0]  bit_index;
     reg [7:0]  data_reg;
     reg [15:0] crc_reg;
 
@@ -33,7 +33,7 @@ module crc16_serial (
         if (!rst_n) begin
             active <= 1'b0;
             busy_reg <= 1'b0;
-            bit_index <= 4'd0;
+            bit_index <= 3'd0;
             data_reg <= 8'd0;
             crc_reg <= 16'hFFFF;
             data_done <= 1'b0;
@@ -46,16 +46,17 @@ module crc16_serial (
             end else if (active) begin
                 if (!busy_reg && data_valid) begin
                     data_reg <= data;
-                    bit_index <= 4'd0;
+                    bit_index <= 3'd0;
                     busy_reg <= 1'b1;
                 end else if (busy_reg) begin
-                    crc_reg <= crc_bit(crc_reg, data_reg[7 - bit_index]);
-                    if (bit_index == 4'd7) begin
-                        bit_index <= 4'd0;
+                    crc_reg <= crc_bit(crc_reg, data_reg[7]);
+                    data_reg <= {data_reg[6:0], 1'b0};
+                    if (bit_index == 3'd7) begin
+                        bit_index <= 3'd0;
                         busy_reg <= 1'b0;
                         data_done <= 1'b1;
                     end else begin
-                        bit_index <= bit_index + 4'd1;
+                        bit_index <= bit_index + 3'd1;
                     end
                 end
             end

+ 41 - 29
src/common/frame_rx.v

@@ -22,13 +22,13 @@ module frame_rx #(
     output reg        frame_valid,
     input  wire       frame_ready,
     output reg [7:0]  frame_type,
-    output reg [15:0] frame_length,
+    output wire [15:0] frame_length,
     /* verilator lint_off UNUSEDSIGNAL */
     input  wire [15:0] payload_read_addr,
     input  wire [7:0] payload_read_data,
     /* verilator lint_on UNUSEDSIGNAL */
     output reg        payload_wr_en,
-    output reg [15:0] payload_wr_addr,
+    output wire [15:0] payload_wr_addr,
     output reg [7:0]  payload_wr_data,
     output wire       crc_start_o,
     output wire       crc_data_valid_o,
@@ -58,11 +58,11 @@ module frame_rx #(
     localparam [3:0] ST_CRC_HIGH = 4'd11;
     localparam [3:0] ST_HOLD = 4'd12;
     localparam integer GAP_BITS = (INTER_BYTE_TIMEOUT_CYCLES <= 1) ? 1 : $clog2(INTER_BYTE_TIMEOUT_CYCLES + 1);
-    // MAX_PAYLOAD is the local RAM size; the declared 16-bit length is
-    // always trusted and consumed in full so oversized declared lengths
-    // (up to 65535) are CRC-checked and discarded, never truncated at a
-    // byte-width boundary and never treated as a new frame.
-    localparam [15:0] MAX_PAYLOAD_WORD = MAX_PAYLOAD[15:0];
+    localparam integer LEN_W = USE_LENGTH8 ? 8 : 16;
+    // MAX_PAYLOAD is the local RAM size; the declared length is always trusted
+    // and consumed in full so oversized declared lengths are CRC-checked and
+    // discarded, never truncated and never treated as a new frame.
+    localparam [LEN_W:0] MAX_PAYLOAD_EXT = MAX_PAYLOAD[LEN_W:0];
     generate
         if (LENGTH_BYTES != 1 && LENGTH_BYTES != 2) begin : g_bad_length_bytes
             ERROR_frame_rx_LENGTH_bytes_must_be_1_or_2 bad_length_bytes();
@@ -72,19 +72,32 @@ module frame_rx #(
     reg poisoned;
     wire error_now=(UART_ERRORS_ENABLED!=0) && byte_error;
     wire receive_byte=byte_valid || error_now;
-    reg [15:0] payload_index;
+    reg [LEN_W-1:0] frame_length_r;
+    reg [LEN_W-1:0] payload_index;
+    reg [LEN_W-1:0] payload_wr_addr_r;
     reg [7:0] received_crc_low;
     reg [GAP_BITS-1:0] gap_counter;
     /* verilator lint_off WIDTH */
     wire gap_expired = gap_counter >= INTER_BYTE_TIMEOUT_CYCLES - 1;
     /* verilator lint_on WIDTH */
 
+    generate
+        if (LENGTH_BYTES == 1) begin : g_len8_out
+            assign frame_length    = {8'h00, frame_length_r};
+            assign payload_wr_addr = {8'h00, payload_wr_addr_r};
+        end else begin : g_len16_out
+            assign frame_length    = frame_length_r;
+            assign payload_wr_addr = payload_wr_addr_r;
+        end
+    endgenerate
+
     wire crc_busy;
     wire crc_data_done;
     wire [15:0] crc_value;
     wire crc_start = (state == ST_WAIT_5A) && byte_valid && !error_now && (byte_data == 8'h5A);
     wire crc_data_valid = receive_byte && !crc_busy &&
-        ((state == ST_TYPE) || (state == ST_LENGTH_LOW) || (state == ST_LENGTH_HIGH) || (state == ST_PAYLOAD));
+        ((state == ST_TYPE) || (state == ST_LENGTH_LOW) ||
+         ((USE_LENGTH8 == 0) && (state == ST_LENGTH_HIGH)) || (state == ST_PAYLOAD));
 
     assign crc_start_o = crc_start;
     assign crc_data_valid_o = crc_data_valid;
@@ -110,12 +123,12 @@ module frame_rx #(
             poisoned<=0;
             frame_valid <= 1'b0;
             frame_type <= 8'd0;
-            frame_length <= 16'd0;
-            payload_index <= 16'd0;
+            frame_length_r <= {LEN_W{1'b0}};
+            payload_index <= {LEN_W{1'b0}};
             received_crc_low <= 8'd0;
             gap_counter <= {GAP_BITS{1'b0}};
             payload_wr_en <= 1'b0;
-            payload_wr_addr <= 16'd0;
+            payload_wr_addr_r <= {LEN_W{1'b0}};
             payload_wr_data <= 8'd0;
         end else if (state == ST_HOLD) begin
             payload_wr_en <= 1'b0;
@@ -145,7 +158,7 @@ module frame_rx #(
             if (receive_byte) begin
                 gap_counter <= {GAP_BITS{1'b0}};
                 if(error_now) poisoned<=1;
-                if(error_now && (state==ST_WAIT_A5 || state==ST_WAIT_5A || state==ST_TYPE || state==ST_LENGTH_LOW || state==ST_LENGTH_HIGH))
+                if(error_now && (state==ST_WAIT_A5 || state==ST_WAIT_5A || state==ST_TYPE || state==ST_LENGTH_LOW || ((USE_LENGTH8 == 0) && state==ST_LENGTH_HIGH)))
                     state<=ST_WAIT_A5;
                 else case (state)
                     ST_WAIT_A5: begin
@@ -164,23 +177,20 @@ module frame_rx #(
                     end
                     ST_LENGTH_LOW: begin
                         if (!crc_busy) begin
-                            frame_length[7:0] <= byte_data;
-                            // In 8-bit-length mode the single LENGTH byte
-                            // completes the header; high byte stays zero.
-                            if (USE_LENGTH8 != 0) frame_length[15:8] <= 8'h00;
+                            frame_length_r[7:0] <= byte_data;
                             state <= ST_LENGTH_LOW_CRC_WAIT;
                         end
                     end
                     ST_LENGTH_HIGH: begin
-                        if (!crc_busy) begin
-                            frame_length[15:8] <= byte_data;
+                        if (USE_LENGTH8 == 0 && !crc_busy) begin
+                            frame_length_r[LEN_W-1 -: 8] <= byte_data;
                             state <= ST_LENGTH_HIGH_CRC_WAIT;
                         end
                     end
                     ST_PAYLOAD: begin
                         if (!crc_busy) begin
-                            payload_wr_en <= payload_index < MAX_PAYLOAD_WORD;
-                            payload_wr_addr <= payload_index;
+                            payload_wr_en <= ({1'b0, payload_index} < MAX_PAYLOAD_EXT);
+                            payload_wr_addr_r <= payload_index;
                             payload_wr_data <= byte_data;
                             state <= ST_PAYLOAD_CRC_WAIT;
                         end
@@ -209,9 +219,9 @@ module frame_rx #(
                         // 8-bit-length mode skips the second LENGTH byte and
                         // goes straight to the payload/CRC extent check.
                         if (USE_LENGTH8 != 0) begin
-                            if (frame_length == 0) state <= ST_CRC_LOW;
+                            if (frame_length_r == {LEN_W{1'b0}}) state <= ST_CRC_LOW;
                             else begin
-                                payload_index <= 16'd0;
+                                payload_index <= {LEN_W{1'b0}};
                                 state <= ST_PAYLOAD;
                             end
                         end else begin
@@ -219,16 +229,18 @@ module frame_rx #(
                         end
                     end
                     ST_LENGTH_HIGH_CRC_WAIT: begin
-                        if (frame_length == 0) state <= ST_CRC_LOW;
-                        else begin
-                            payload_index <= 16'd0;
-                            state <= ST_PAYLOAD;
+                        if (USE_LENGTH8 == 0) begin
+                            if (frame_length_r == {LEN_W{1'b0}}) state <= ST_CRC_LOW;
+                            else begin
+                                payload_index <= {LEN_W{1'b0}};
+                                state <= ST_PAYLOAD;
+                            end
                         end
                     end
                     ST_PAYLOAD_CRC_WAIT: begin
-                        if (payload_index + 16'd1 >= frame_length) state <= ST_CRC_LOW;
+                        if (payload_index == (frame_length_r - {{(LEN_W-1){1'b0}}, 1'b1})) state <= ST_CRC_LOW;
                         else begin
-                            payload_index <= payload_index + 16'd1;
+                            payload_index <= payload_index + {{(LEN_W-1){1'b0}}, 1'b1};
                             state <= ST_PAYLOAD;
                         end
                     end

+ 13 - 9
src/common/frame_tx.v

@@ -45,6 +45,7 @@ module frame_tx #(
     localparam [3:0] ST_LENGTH_HIGH = 4'd12;
     localparam [3:0] ST_LENGTH_HIGH_CRC_WAIT = 4'd13;
     localparam integer USE_LENGTH8 = (LENGTH_BYTES == 1);
+    localparam integer LEN_W = USE_LENGTH8 ? 8 : 16;
     localparam [3:0] ST_PAYLOAD = 4'd7;
     localparam [3:0] ST_PAYLOAD_CRC_WAIT = 4'd8;
     localparam [3:0] ST_CRC_LOW = 4'd9;
@@ -53,7 +54,7 @@ module frame_tx #(
 
     reg [3:0] state;
     reg [7:0] type_reg;
-    reg [15:0] length_reg;
+    reg [LEN_W-1:0] length_reg;
     reg [PAYLOAD_IDX_BITS-1:0] payload_index;
     reg crc_start_reg;
     wire crc_busy;
@@ -61,7 +62,8 @@ module frame_tx #(
     wire [15:0] crc_value;
     wire crc_start = crc_start_reg;
     wire crc_data_valid = busy && byte_valid && byte_ready && !crc_busy &&
-        ((state == ST_TYPE) || (state == ST_LENGTH_LOW) || (state == ST_LENGTH_HIGH) || (state == ST_PAYLOAD));
+        ((state == ST_TYPE) || (state == ST_LENGTH_LOW) ||
+         ((USE_LENGTH8 == 0) && (state == ST_LENGTH_HIGH)) || (state == ST_PAYLOAD));
 
     assign crc_start_o = crc_start;
     assign crc_data_valid_o = crc_data_valid;
@@ -93,7 +95,7 @@ module frame_tx #(
         if (!rst_n) begin
             state <= ST_IDLE;
             type_reg <= 8'd0;
-            length_reg <= 16'd0;
+            length_reg <= {LEN_W{1'b0}};
             payload_index <= {PAYLOAD_IDX_BITS{1'b0}};
             busy <= 1'b0;
             byte_valid <= 1'b0;
@@ -107,7 +109,7 @@ module frame_tx #(
                 byte_valid <= 1'b0;
                 if (start) begin
                     type_reg <= frame_type;
-                    length_reg <= payload_length;
+                    length_reg <= payload_length[LEN_W-1:0];
                     payload_index <= {PAYLOAD_IDX_BITS{1'b0}};
                     busy <= 1'b1;
                     crc_start_reg <= 1'b1;
@@ -137,14 +139,16 @@ module frame_tx #(
             end else if (crc_data_done) begin
                 case (state)
                     ST_TYPE_CRC_WAIT: state <= ST_LENGTH_LOW;
-                    ST_LENGTH_LOW_CRC_WAIT: state <= ST_LENGTH_HIGH;
+                    ST_LENGTH_LOW_CRC_WAIT: if (USE_LENGTH8 == 0) state <= ST_LENGTH_HIGH;
                     ST_LENGTH_HIGH_CRC_WAIT: begin
                         payload_index <= {PAYLOAD_IDX_BITS{1'b0}};
-                        state <= (length_reg == 0) ? ST_CRC_LOW :
+                        state <= (length_reg == {LEN_W{1'b0}}) ? ST_CRC_LOW :
                             ((PAYLOAD_READ_LATENCY != 0) ? ST_PAYLOAD_FETCH : ST_PAYLOAD);
                     end
                     ST_PAYLOAD_CRC_WAIT: begin
-                        if (payload_index + 1 >= length_reg) state <= ST_CRC_LOW;
+                        /* verilator lint_off WIDTH */
+                        if (({1'b0, payload_index} + 1'b1) >= length_reg) state <= ST_CRC_LOW;
+                        /* verilator lint_on WIDTH */
                         else begin
                             payload_index <= payload_index + 1'b1;
                             state <= (PAYLOAD_READ_LATENCY != 0) ?
@@ -159,7 +163,7 @@ module frame_tx #(
                 byte_valid <= 1'b0;
                 state <= ST_PAYLOAD;
             end else if ((state == ST_TYPE_CRC_WAIT) ||
-                         (state == ST_LENGTH_LOW_CRC_WAIT) ||
+                         ((USE_LENGTH8 == 0) && (state == ST_LENGTH_LOW_CRC_WAIT)) ||
                          (state == ST_LENGTH_HIGH_CRC_WAIT) ||
                          (state == ST_PAYLOAD_CRC_WAIT)) begin
                 byte_valid <= 1'b0;
@@ -170,7 +174,7 @@ module frame_tx #(
                     ST_5A: byte_data <= 8'h5A;
                     ST_TYPE: byte_data <= type_reg;
                     ST_LENGTH_LOW: byte_data <= length_reg[7:0];
-                    ST_LENGTH_HIGH: byte_data <= length_reg[15:8];
+                    ST_LENGTH_HIGH: byte_data <= (USE_LENGTH8 != 0) ? 8'h00 : length_reg[LEN_W-1 -: 8];
                     ST_PAYLOAD: byte_data <= payload_data;
                     ST_CRC_LOW: byte_data <= crc_value[7:0];
                     ST_CRC_HIGH: byte_data <= crc_value[15:8];

+ 1 - 1
src/common/uart_rx_byte.v

@@ -75,7 +75,7 @@ module uart_rx_byte #(
 
                 ST_DATA: begin
                     if (bit_counter == 0) begin
-                        data_reg[bit_index] <= rx_sync_pipe[1];
+                        data_reg <= {rx_sync_pipe[1], data_reg[7:1]};
                         bit_counter <= BIT_LAST;
                         if (bit_index == 3'd7) begin
                             state <= ST_STOP;

+ 5 - 4
src/common/uart_tx_byte.v

@@ -15,13 +15,13 @@ module uart_tx_byte #(
     /* verilator lint_off WIDTH */
     localparam [COUNTER_BITS-1:0] BIT_LAST = CLKS_PER_BIT - 1;
     /* verilator lint_on WIDTH */
-    reg [9:0] frame_bits;
+    reg [8:0] shift_reg;
     reg [3:0] bit_index;
     reg [COUNTER_BITS-1:0] bit_counter;
 
     always @(posedge clk or negedge rst_n) begin
         if (!rst_n) begin
-            frame_bits <= 10'b1111111111;
+            shift_reg <= 9'b111111111;
             bit_index <= 4'd0;
             bit_counter <= {COUNTER_BITS{1'b0}};
             tx_o <= 1'b1;
@@ -32,7 +32,7 @@ module uart_tx_byte #(
             if (!busy) begin
                 tx_o <= 1'b1;
                 if (byte_valid) begin
-                    frame_bits <= {1'b1, byte_data, 1'b0};
+                    shift_reg <= {1'b1, byte_data};
                     bit_index <= 4'd0;
                     bit_counter <= BIT_LAST;
                     tx_o <= 1'b0;
@@ -46,7 +46,8 @@ module uart_tx_byte #(
                 end else begin
                     bit_index <= bit_index + 1'b1;
                     bit_counter <= BIT_LAST;
-                    tx_o <= frame_bits[bit_index + 1'b1];
+                    tx_o <= shift_reg[0];
+                    shift_reg <= {1'b1, shift_reg[8:1]};
                 end
             end else begin
                 bit_counter <= bit_counter - 1'b1;

+ 18 - 12
src/control/m6400_transaction_core.v

@@ -10,7 +10,9 @@ module m6400_transaction_core #(
     parameter integer EXTRA_IO_ENABLE = 0,
     parameter integer BMC_COUNT = 24,
     parameter integer CT_COUNT = 27,
-    parameter [31:0]  BEACON_PERIOD = 32'd125_000_000
+    parameter [31:0]  BEACON_PERIOD = 32'd125_000_000,
+    parameter [7:0]   DIAG_FORMAT = 8'd1,
+    parameter [7:0]   DIAG_BOARD_ID = 8'h64
 )(
     input  wire         clk,
     input  wire         rst_n,
@@ -82,6 +84,10 @@ module m6400_transaction_core #(
     localparam integer EXTRA_BYTES = (EXTRA_IO_ENABLE != 0) ? 4 : 0;
     localparam integer TOTAL_COUNT = DUTY_COUNT + BMC_COUNT + CT_COUNT + EXTRA_BYTES;
     localparam [7:0]   SET_EXT_LEN = DUTY_COUNT[7:0] + 8'd1;
+    localparam integer BEACON_BITS = (BEACON_PERIOD <= 32'd2) ? 2 : $clog2(BEACON_PERIOD);
+    /* verilator lint_off WIDTH */
+    localparam [BEACON_BITS-1:0] BEACON_LAST = BEACON_PERIOD - 32'd1;
+    /* verilator lint_on WIDTH */
 
     reg [119:0] diagnostic_shift;
     reg [3:0]   state;
@@ -95,8 +101,8 @@ module m6400_transaction_core #(
     reg         gd_sample_buttons;
     wire        gd_ready;
 
-    reg [31:0]  beacon_cnt;
-    reg         beacon_trigger;
+    reg [BEACON_BITS-1:0] beacon_cnt;
+    reg                   beacon_trigger;
 
     assign get_busy = (state == ST_GET_WAIT) || (state == ST_AUTO_GD_WAIT);
     assign gd_start = gd_start_r;
@@ -154,7 +160,7 @@ module m6400_transaction_core #(
             nack_reason      <= 8'd0;
             stage_buzzer     <= 1'b0;
             buzzer_ctrl_out  <= 1'b0;
-            beacon_cnt       <= 32'd0;
+            beacon_cnt       <= {BEACON_BITS{1'b0}};
             beacon_trigger   <= 1'b0;
             diagnostic_shift <= 120'd0;
         end else begin
@@ -168,11 +174,11 @@ module m6400_transaction_core #(
                 buzzer_ctrl_out <= 1'b0;
 
             if (BEACON_PERIOD != 32'd0) begin
-                if (beacon_cnt >= BEACON_PERIOD - 1) begin
-                    beacon_cnt     <= 32'd0;
+                if (beacon_cnt == BEACON_LAST) begin
+                    beacon_cnt     <= {BEACON_BITS{1'b0}};
                     beacon_trigger <= 1'b1;
                 end else begin
-                    beacon_cnt <= beacon_cnt + 32'd1;
+                    beacon_cnt <= beacon_cnt + {{(BEACON_BITS-1){1'b0}}, 1'b1};
                 end
             end
 
@@ -235,7 +241,7 @@ module m6400_transaction_core #(
                     end else if (beacon_trigger) begin
                         // Autonomous periodic debug/telemetry broadcast (never feeds watchdog,
                         // and NEVER samples/reports EPB1/SB1/SB2 button states autonomously).
-                        beacon_cnt        <= 32'd0;
+                        beacon_cnt        <= {BEACON_BITS{1'b0}};
                         beacon_trigger    <= 1'b0;
                         req_ready         <= 1'b0;
                         gd_sample_buttons <= 1'b0;
@@ -321,15 +327,15 @@ module m6400_transaction_core #(
                 end
                 ST_DIAG_WRITE: begin
                     // Reply RAM bytes 96..115 (separate from GET bytes 0..89).
-                    // Bytes 0..4 are constant identity (format=1, board=0x64, fw=3.2.0);
+                    // Bytes 0..4 are constant identity (DIAG_FORMAT, DIAG_BOARD_ID, fw=3.3.0);
                     // bytes 5..19 shift from the 120-bit dynamic snapshot.
                     nack_we   <= 1'b1;
                     nack_addr <= 8'd96 + wr_index;
                     case (wr_index)
-                        8'd0: nack_data <= 8'd1;
-                        8'd1: nack_data <= 8'h64;
+                        8'd0: nack_data <= DIAG_FORMAT;
+                        8'd1: nack_data <= DIAG_BOARD_ID;
                         8'd2: nack_data <= 8'd3;
-                        8'd3: nack_data <= 8'd2;
+                        8'd3: nack_data <= 8'd3;
                         8'd4: nack_data <= 8'd0;
                         default: begin
                             nack_data        <= diagnostic_shift[7:0];

+ 13 - 8
src/control/mrdimm_transaction_core.v

@@ -102,8 +102,13 @@ module mrdimm_transaction_core #(
     reg [15:0] slot_steps;
     reg [15:0] slot_half;
 
-    reg [31:0] beacon_cnt;
-    reg        beacon_trigger;
+    localparam integer BEACON_BITS = (BEACON_PERIOD <= 32'd2) ? 2 : $clog2(BEACON_PERIOD);
+    /* verilator lint_off WIDTH */
+    localparam [BEACON_BITS-1:0] BEACON_LAST = BEACON_PERIOD - 32'd1;
+    /* verilator lint_on WIDTH */
+
+    reg [BEACON_BITS-1:0] beacon_cnt;
+    reg                   beacon_trigger;
 
     wire [7:0] diag_flags = {4'b0, buzzer_ctrl_out, watchdog_expired, diag_bank_valid, (diag_motor_active != 12'd0)};
 
@@ -147,7 +152,7 @@ module mrdimm_transaction_core #(
             slot_action                <= 8'd0;
             slot_steps                 <= 16'd0;
             slot_half                  <= 16'd0;
-            beacon_cnt                 <= 32'd0;
+            beacon_cnt                 <= {BEACON_BITS{1'b0}};
             beacon_trigger             <= 1'b0;
         end else begin
             watchdog_reload     <= 1'b0;
@@ -163,11 +168,11 @@ module mrdimm_transaction_core #(
                 buzzer_ctrl_out <= 1'b0;
 
             if (BEACON_PERIOD != 32'd0) begin
-                if (beacon_cnt >= BEACON_PERIOD - 1) begin
-                    beacon_cnt     <= 32'd0;
+                if (beacon_cnt == BEACON_LAST) begin
+                    beacon_cnt     <= {BEACON_BITS{1'b0}};
                     beacon_trigger <= 1'b1;
                 end else begin
-                    beacon_cnt <= beacon_cnt + 32'd1;
+                    beacon_cnt <= beacon_cnt + {{(BEACON_BITS-1){1'b0}}, 1'b1};
                 end
             end
 
@@ -228,7 +233,7 @@ module mrdimm_transaction_core #(
                     end else if (beacon_trigger) begin
                         // Always-on lightweight debug output: BEACON (0x51, 0B) +
                         // DIAGNOSTIC (0x52, 8B) without feeding watchdog or sampling hood_switch.
-                        beacon_cnt      <= 32'd0;
+                        beacon_cnt      <= {BEACON_BITS{1'b0}};
                         beacon_trigger  <= 1'b0;
                         diag_write_mode <= 1'b1;
                         idx             <= 4'd0;
@@ -462,7 +467,7 @@ module mrdimm_transaction_core #(
                             3'd0: nack_reply_data <= 8'd2;   // format 2 = MRDIMM lean diag
                             3'd1: nack_reply_data <= 8'h80;  // board_id = MRDIMM/8000
                             3'd2: nack_reply_data <= 8'd3;   // fw major = 3
-                            3'd3: nack_reply_data <= 8'd2;   // fw minor = 2
+                            3'd3: nack_reply_data <= 8'd3;   // fw minor = 3
                             3'd4: nack_reply_data <= 8'd0;   // fw patch = 0
                             3'd5: nack_reply_data <= diag_flags;
                             3'd6: nack_reply_data <= diag_motor_active[7:0];

+ 24 - 17
src/rtl/prod2u_p4_i2c_stop_start_read.v

@@ -62,8 +62,14 @@ module prod2u_p4_i2c_stop_start_read #(
     // Production values 125/25000 require only 7/15 counter bits.
     localparam integer PHASE_COUNT_BITS = (HALF_PERIOD_CLKS <= 1) ? 1 : $clog2(HALF_PERIOD_CLKS);
     localparam integer TIMEOUT_COUNT_BITS = (TIMEOUT_CLKS <= 1) ? 1 : $clog2(TIMEOUT_CLKS);
+    /* verilator lint_off WIDTH */
+    localparam [PHASE_COUNT_BITS-1:0] HALF_LAST = HALF_PERIOD_CLKS - 1;
+    localparam [TIMEOUT_COUNT_BITS-1:0] TIMEOUT_LAST = TIMEOUT_CLKS - 1;
+    /* verilator lint_on WIDTH */
     reg [PHASE_COUNT_BITS-1:0] phase_count;
     reg [TIMEOUT_COUNT_BITS-1:0] timeout_count;
+    wire phase_done = (phase_count == HALF_LAST);
+    wire timeout_hit = (timeout_count == TIMEOUT_LAST);
     reg [6:0] device_addr;
     reg [7:0] register_addr;
     reg [7:0] tx_byte;
@@ -145,7 +151,7 @@ module prod2u_p4_i2c_stop_start_read #(
                 end
             end else if (state != ST_IDLE && state != ST_RESPONSE &&
                          state != ST_ABORT_SCL_HIGH && state != ST_ABORT_RELEASE &&
-                         timeout_count >= TIMEOUT_CLKS - 1) begin
+                         timeout_hit) begin
                 state <= ST_RESPONSE;
                 phase_count <= {PHASE_COUNT_BITS{1'b0}};
                 timeout_count <= {TIMEOUT_COUNT_BITS{1'b0}};
@@ -183,7 +189,7 @@ module prod2u_p4_i2c_stop_start_read #(
                     scl_drive_low <= 1'b0;
                     sda_drive_low <= 1'b0;
                     if (scl_sample && sda_sample) begin
-                        if (phase_count >= HALF_PERIOD_CLKS - 1) begin
+                        if (phase_done) begin
                             phase_count <= {PHASE_COUNT_BITS{1'b0}};
                             sda_drive_low <= 1'b1;
                             tx_stage <= (state == ST_BUS_WAIT_WRITE) ?
@@ -199,7 +205,7 @@ module prod2u_p4_i2c_stop_start_read #(
 
                 ST_START_HOLD: begin
                     if (scl_sample) begin
-                        if (phase_count >= HALF_PERIOD_CLKS - 1) begin
+                        if (phase_done) begin
                             phase_count <= {PHASE_COUNT_BITS{1'b0}};
                             tx_byte <= (tx_stage == TX_READ_ADDRESS) ?
                                 {device_addr, 1'b1} : {device_addr, 1'b0};
@@ -214,9 +220,9 @@ module prod2u_p4_i2c_stop_start_read #(
 
                 ST_TX_BIT_LOW: begin
                     if (phase_count == 0) begin
-                        sda_drive_low <= ~tx_byte[bit_index];
+                        sda_drive_low <= ~tx_byte[7];
                     end
-                    if (phase_count >= HALF_PERIOD_CLKS - 1) begin
+                    if (phase_done) begin
                         phase_count <= {PHASE_COUNT_BITS{1'b0}};
                         scl_drive_low <= 1'b0;
                         state <= ST_TX_BIT_HIGH;
@@ -227,7 +233,7 @@ module prod2u_p4_i2c_stop_start_read #(
 
                 ST_TX_BIT_HIGH: begin
                     if (scl_sample) begin
-                        if (tx_byte[bit_index] && !sda_sample) begin
+                        if (tx_byte[7] && !sda_sample) begin
                             state <= ST_RESPONSE;
                             timeout_count <= {TIMEOUT_COUNT_BITS{1'b0}};
                             response_valid <= 1'b1;
@@ -235,13 +241,14 @@ module prod2u_p4_i2c_stop_start_read #(
                             response_error <= ERROR_ARBITRATION_LOST;
                             scl_drive_low <= 1'b0;
                             sda_drive_low <= 1'b0;
-                        end else if (phase_count >= HALF_PERIOD_CLKS - 1) begin
+                        end else if (phase_done) begin
                             phase_count <= {PHASE_COUNT_BITS{1'b0}};
                             scl_drive_low <= 1'b1;
                             if (bit_index == 3'd0) begin
                                 state <= ST_TX_ACK_LOW;
                             end else begin
                                 bit_index <= bit_index - 3'd1;
+                                tx_byte <= {tx_byte[6:0], 1'b0};
                                 state <= ST_TX_BIT_LOW;
                             end
                         end else begin
@@ -254,7 +261,7 @@ module prod2u_p4_i2c_stop_start_read #(
                     if (phase_count == 0) begin
                         sda_drive_low <= 1'b0;
                     end
-                    if (phase_count >= HALF_PERIOD_CLKS - 1) begin
+                    if (phase_done) begin
                         phase_count <= {PHASE_COUNT_BITS{1'b0}};
                         scl_drive_low <= 1'b0;
                         state <= ST_TX_ACK_HIGH;
@@ -265,7 +272,7 @@ module prod2u_p4_i2c_stop_start_read #(
 
                 ST_TX_ACK_HIGH: begin
                     if (scl_sample) begin
-                        if (phase_count >= HALF_PERIOD_CLKS - 1) begin
+                        if (phase_done) begin
                             phase_count <= {PHASE_COUNT_BITS{1'b0}};
                             scl_drive_low <= 1'b1;
                             if (sda_sample) begin
@@ -301,7 +308,7 @@ module prod2u_p4_i2c_stop_start_read #(
                     if (phase_count == 0) begin
                         sda_drive_low <= 1'b0;
                     end
-                    if (phase_count >= HALF_PERIOD_CLKS - 1) begin
+                    if (phase_done) begin
                         phase_count <= {PHASE_COUNT_BITS{1'b0}};
                         scl_drive_low <= 1'b0;
                         state <= ST_RX_BIT_HIGH;
@@ -312,7 +319,7 @@ module prod2u_p4_i2c_stop_start_read #(
 
                 ST_RX_BIT_HIGH: begin
                     if (scl_sample) begin
-                        if (phase_count >= HALF_PERIOD_CLKS - 1) begin
+                        if (phase_done) begin
                             phase_count <= {PHASE_COUNT_BITS{1'b0}};
                             rx_shift <= {rx_shift[14:0], sda_sample};
                             scl_drive_low <= 1'b1;
@@ -332,7 +339,7 @@ module prod2u_p4_i2c_stop_start_read #(
                     if (phase_count == 0) begin
                         sda_drive_low <= (rx_byte_index == 1'b0);
                     end
-                    if (phase_count >= HALF_PERIOD_CLKS - 1) begin
+                    if (phase_done) begin
                         phase_count <= {PHASE_COUNT_BITS{1'b0}};
                         scl_drive_low <= 1'b0;
                         state <= ST_RX_ACK_HIGH;
@@ -343,7 +350,7 @@ module prod2u_p4_i2c_stop_start_read #(
 
                 ST_RX_ACK_HIGH: begin
                     if (scl_sample) begin
-                        if (phase_count >= HALF_PERIOD_CLKS - 1) begin
+                        if (phase_done) begin
                             phase_count <= {PHASE_COUNT_BITS{1'b0}};
                             scl_drive_low <= 1'b1;
                             if (rx_byte_index == 1'b0) begin
@@ -364,7 +371,7 @@ module prod2u_p4_i2c_stop_start_read #(
                 ST_STOP_LOW: begin
                     scl_drive_low <= 1'b1;
                     sda_drive_low <= 1'b1;
-                    if (phase_count >= HALF_PERIOD_CLKS - 1) begin
+                    if (phase_done) begin
                         phase_count <= {PHASE_COUNT_BITS{1'b0}};
                         scl_drive_low <= 1'b0;
                         state <= ST_STOP_SCL_HIGH;
@@ -375,7 +382,7 @@ module prod2u_p4_i2c_stop_start_read #(
 
                 ST_STOP_SCL_HIGH: begin
                     if (scl_sample) begin
-                        if (phase_count >= HALF_PERIOD_CLKS - 1) begin
+                        if (phase_done) begin
                             phase_count <= {PHASE_COUNT_BITS{1'b0}};
                             sda_drive_low <= 1'b0;
                             state <= ST_STOP_RELEASE;
@@ -389,7 +396,7 @@ module prod2u_p4_i2c_stop_start_read #(
                     scl_drive_low <= 1'b0;
                     sda_drive_low <= 1'b0;
                     if (scl_sample && sda_sample) begin
-                        if (phase_count >= HALF_PERIOD_CLKS - 1) begin
+                        if (phase_done) begin
                             phase_count <= {PHASE_COUNT_BITS{1'b0}};
                             if (after_stop_read && pending_error == ERROR_NONE) begin
                                 after_stop_read <= 1'b0;
@@ -421,7 +428,7 @@ module prod2u_p4_i2c_stop_start_read #(
                 ST_ABORT_SCL_HIGH: begin
                     scl_drive_low <= 1'b0;
                     sda_drive_low <= 1'b1;
-                    if (scl_sample || timeout_count >= TIMEOUT_CLKS - 1) begin
+                    if (scl_sample || timeout_hit) begin
                         timeout_count <= {TIMEOUT_COUNT_BITS{1'b0}};
                         state <= ST_ABORT_RELEASE;
                     end

+ 1 - 1
tests/board_viewer/fixtures/candidate_count_expectation.json

@@ -5,7 +5,7 @@
     "board_data_path": "tools/board-viewer/generated/board-data.json",
     "board_data_sha256": "b6a65aa6c8bef596a2dff92c28f7139c079358300e4468fc221206781be5bf4a",
     "build_info_path": "tools/board-viewer/generated/build-info.json",
-    "build_info_sha256": "6eae5a905278f71a1c331e0740616d7be0080d4709ef3ef99427a45b2e39c37a",
+    "build_info_sha256": "e8a689ac4d87a451c8d14a839d99ee843178d075df6395d520069cf2734f807c",
     "board_data_asset_sha256": "b6a65aa6c8bef596a2dff92c28f7139c079358300e4468fc221206781be5bf4a",
     "brd_sha256": "269b5bab2f2e1215b9392079a003badc34238ae3cbe8e5094c9a11bba8b84ebb"
   },

+ 1 - 1
tests/sim/prod2u_v3_protocol_tb.v

@@ -165,7 +165,7 @@ module prod2u_v3_protocol_tb;
                     if(!pending_auto) $fatal(1,"unexpected unpaired diagnostic");
                     pending_auto=0;diag_count=diag_count+1;
                     if(wire_bytes[p]!==1 || wire_bytes[p+1]!==8'h64 ||
-                       wire_bytes[p+2]!==3 || wire_bytes[p+3]!==2 || wire_bytes[p+4]!==0)
+                       wire_bytes[p+2]!==3 || wire_bytes[p+3]!==3 || wire_bytes[p+4]!==0)
                         $fatal(1,"diagnostic format/product/version identity");
                     if(wire_bytes[rx_base+3]!==20) $fatal(1,"diagnostic length");
                     if(wire_bytes[p+5][5]) begin

+ 463 - 0
tests/sim/uart_921600_skew_tb.v

@@ -0,0 +1,463 @@
+`timescale 1ns/1ps
+
+// =============================================================================
+// 1:1 UART High-Baud Clock-Skew, Burst, Framing-Error & Dual-Port Stress TB
+// Verifies host_uart_endpoint at ALL four production baud divisors (25 MHz):
+//   - 921600 bps (CLKS_PER_BIT = 27, actual 925926 bps, +0.47%)
+//   - 460800 bps (CLKS_PER_BIT = 54)
+//   - 230400 bps (CLKS_PER_BIT = 109)
+//   - 115200 bps (CLKS_PER_BIT = 217)
+// Under:
+//   1) Nominal baud timing + back-to-back burst frames (0 idle gap between frames)
+//   2) +2.0% faster host clock skew and -2.0% slower host clock skew
+//   3) Framing-error injection (bad stop bit) followed by clean immediate recovery
+//   4) Byte-level 0xA5 RS232 <-> TTL port handoff + idle noise rejection
+//   5) Full-duplex simultaneous TX reply broadcast on both RS232 and TTL
+// =============================================================================
+module uart_921600_skew_tb;
+    reg clk = 1'b0;
+    always #20 clk = ~clk; // 25 MHz (40 ns period)
+
+    integer total_failures = 0;
+
+    // -------------------------------------------------------------------------
+    // Shared CRC-16/CCITT-FALSE reference function
+    // -------------------------------------------------------------------------
+    function [15:0] crc16_step;
+        input [15:0] crc_in;
+        input [7:0]  data_byte;
+        integer k;
+        reg [15:0] c;
+        begin
+            c = crc_in ^ {data_byte, 8'h00};
+            for (k = 0; k < 8; k = k + 1) begin
+                if (c[15]) c = {c[14:0], 1'b0} ^ 16'h1021;
+                else       c = {c[14:0], 1'b0};
+            end
+            crc16_step = c;
+        end
+    endfunction
+
+    // -------------------------------------------------------------------------
+    // Instantiate 4 endpoints (one per production baud rate)
+    // -------------------------------------------------------------------------
+    reg rst_n = 1'b0;
+
+    // 921600 (div 27)
+    reg  rs232_rx_921 = 1'b1, ttl_rx_921 = 1'b1;
+    wire rs232_tx_921, ttl_tx_921;
+    wire req_valid_921; reg req_ready_921 = 1'b0;
+    wire [7:0] req_type_921, req_len_921;
+    wire ram_we_921; wire [7:0] ram_wa_921, ram_wd_921;
+    wire [7:0] ram_ra_921;
+    reg  tx_start_921 = 1'b0; reg [7:0] tx_type_921 = 8'd0, tx_len_921 = 8'd0;
+    wire tx_busy_921, tx_done_921;
+    wire [7:0] tx_ra_921;
+    reg  [7:0] req_mem_921 [0:127];
+    reg  [7:0] tx_mem_921  [0:127];
+    reg  [7:0] tx_rd_921 = 8'd0;
+    always @(posedge clk) begin
+        if (ram_we_921 && ram_wa_921 < 8'd128) req_mem_921[ram_wa_921] <= ram_wd_921;
+        tx_rd_921 <= tx_mem_921[tx_ra_921[6:0]];
+    end
+    host_uart_endpoint #(.CLKS_PER_BIT(27), .INTER_BYTE_TIMEOUT_CYCLES(5000)) dut_921 (
+        .clk(clk), .rst_n(rst_n),
+        .rs232_rx(rs232_rx_921), .rs232_tx(rs232_tx_921),
+        .ttl_rx(ttl_rx_921), .ttl_tx(ttl_tx_921),
+        .req_valid(req_valid_921), .req_ready(req_ready_921),
+        .req_type(req_type_921), .req_length(req_len_921),
+        .req_ram_wr_en(ram_we_921), .req_ram_wr_addr(ram_wa_921), .req_ram_wr_data(ram_wd_921),
+        .req_ram_rd_addr(ram_ra_921), .req_ram_rd_data(8'd0),
+        .tx_start(tx_start_921), .tx_type(tx_type_921), .tx_length(tx_len_921),
+        .tx_busy(tx_busy_921), .tx_done(tx_done_921),
+        .tx_ram_rd_addr(tx_ra_921), .tx_ram_rd_data(tx_rd_921)
+    );
+
+    // 460800 (div 54)
+    reg  rs232_rx_460 = 1'b1, ttl_rx_460 = 1'b1;
+    wire rs232_tx_460, ttl_tx_460;
+    wire req_valid_460; reg req_ready_460 = 1'b0;
+    wire [7:0] req_type_460, req_len_460;
+    wire ram_we_460; wire [7:0] ram_wa_460, ram_wd_460, ram_ra_460, tx_ra_460;
+    wire tx_busy_460, tx_done_460;
+    host_uart_endpoint #(.CLKS_PER_BIT(54), .INTER_BYTE_TIMEOUT_CYCLES(10000)) dut_460 (
+        .clk(clk), .rst_n(rst_n),
+        .rs232_rx(rs232_rx_460), .rs232_tx(rs232_tx_460),
+        .ttl_rx(ttl_rx_460), .ttl_tx(ttl_tx_460),
+        .req_valid(req_valid_460), .req_ready(req_ready_460),
+        .req_type(req_type_460), .req_length(req_len_460),
+        .req_ram_wr_en(ram_we_460), .req_ram_wr_addr(ram_wa_460), .req_ram_wr_data(ram_wd_460),
+        .req_ram_rd_addr(ram_ra_460), .req_ram_rd_data(8'd0),
+        .tx_start(1'b0), .tx_type(8'd0), .tx_length(8'd0),
+        .tx_busy(tx_busy_460), .tx_done(tx_done_460),
+        .tx_ram_rd_addr(tx_ra_460), .tx_ram_rd_data(8'd0)
+    );
+
+    // 230400 (div 109)
+    reg  rs232_rx_230 = 1'b1, ttl_rx_230 = 1'b1;
+    wire rs232_tx_230, ttl_tx_230;
+    wire req_valid_230; reg req_ready_230 = 1'b0;
+    wire [7:0] req_type_230, req_len_230;
+    wire ram_we_230; wire [7:0] ram_wa_230, ram_wd_230, ram_ra_230, tx_ra_230;
+    wire tx_busy_230, tx_done_230;
+    host_uart_endpoint #(.CLKS_PER_BIT(109), .INTER_BYTE_TIMEOUT_CYCLES(20000)) dut_230 (
+        .clk(clk), .rst_n(rst_n),
+        .rs232_rx(rs232_rx_230), .rs232_tx(rs232_tx_230),
+        .ttl_rx(ttl_rx_230), .ttl_tx(ttl_tx_230),
+        .req_valid(req_valid_230), .req_ready(req_ready_230),
+        .req_type(req_type_230), .req_length(req_len_230),
+        .req_ram_wr_en(ram_we_230), .req_ram_wr_addr(ram_wa_230), .req_ram_wr_data(ram_wd_230),
+        .req_ram_rd_addr(ram_ra_230), .req_ram_rd_data(8'd0),
+        .tx_start(1'b0), .tx_type(8'd0), .tx_length(8'd0),
+        .tx_busy(tx_busy_230), .tx_done(tx_done_230),
+        .tx_ram_rd_addr(tx_ra_230), .tx_ram_rd_data(8'd0)
+    );
+
+    // 115200 (div 217)
+    reg  rs232_rx_115 = 1'b1, ttl_rx_115 = 1'b1;
+    wire rs232_tx_115, ttl_tx_115;
+    wire req_valid_115; reg req_ready_115 = 1'b0;
+    wire [7:0] req_type_115, req_len_115;
+    wire ram_we_115; wire [7:0] ram_wa_115, ram_wd_115, ram_ra_115, tx_ra_115;
+    wire tx_busy_115, tx_done_115;
+    host_uart_endpoint #(.CLKS_PER_BIT(217), .INTER_BYTE_TIMEOUT_CYCLES(40000)) dut_115 (
+        .clk(clk), .rst_n(rst_n),
+        .rs232_rx(rs232_rx_115), .rs232_tx(rs232_tx_115),
+        .ttl_rx(ttl_rx_115), .ttl_tx(ttl_tx_115),
+        .req_valid(req_valid_115), .req_ready(req_ready_115),
+        .req_type(req_type_115), .req_length(req_len_115),
+        .req_ram_wr_en(ram_we_115), .req_ram_wr_addr(ram_wa_115), .req_ram_wr_data(ram_wd_115),
+        .req_ram_rd_addr(ram_ra_115), .req_ram_rd_data(8'd0),
+        .tx_start(1'b0), .tx_type(8'd0), .tx_length(8'd0),
+        .tx_busy(tx_busy_115), .tx_done(tx_done_115),
+        .tx_ram_rd_addr(tx_ra_115), .tx_ram_rd_data(8'd0)
+    );
+
+    // -------------------------------------------------------------------------
+    // Precise real-time UART byte driver (supports arbitrary baud skew in ns!)
+    // -------------------------------------------------------------------------
+    task automatic send_uart_byte_921;
+        input        use_ttl;
+        input [7:0]  b;
+        input real   bit_ns;
+        input        bad_stop;
+        integer bit_i;
+        begin
+            if (use_ttl) ttl_rx_921 = 1'b0; else rs232_rx_921 = 1'b0;
+            #(bit_ns);
+            for (bit_i = 0; bit_i < 8; bit_i = bit_i + 1) begin
+                if (use_ttl) ttl_rx_921 = b[bit_i]; else rs232_rx_921 = b[bit_i];
+                #(bit_ns);
+            end
+            if (use_ttl) ttl_rx_921 = bad_stop ? 1'b0 : 1'b1;
+            else         rs232_rx_921 = bad_stop ? 1'b0 : 1'b1;
+            #(bit_ns);
+            if (bad_stop) begin
+                if (use_ttl) ttl_rx_921 = 1'b1; else rs232_rx_921 = 1'b1;
+                #(bit_ns * 2.0);
+            end
+        end
+    endtask
+
+    task automatic send_frame_921;
+        input        use_ttl;
+        input [7:0]  ftype;
+        input [7:0]  flen;
+        input [7:0]  seed;
+        input real   bit_ns;
+        integer idx;
+        reg [15:0] crc;
+        reg [7:0]  val;
+        begin
+            crc = 16'hFFFF;
+            crc = crc16_step(crc, ftype);
+            crc = crc16_step(crc, flen);
+            send_uart_byte_921(use_ttl, 8'hA5, bit_ns, 1'b0);
+            send_uart_byte_921(use_ttl, 8'h5A, bit_ns, 1'b0);
+            send_uart_byte_921(use_ttl, ftype, bit_ns, 1'b0);
+            send_uart_byte_921(use_ttl, flen,  bit_ns, 1'b0);
+            for (idx = 0; idx < flen; idx = idx + 1) begin
+                val = seed + idx[7:0];
+                crc = crc16_step(crc, val);
+                send_uart_byte_921(use_ttl, val, bit_ns, 1'b0);
+            end
+            send_uart_byte_921(use_ttl, crc[7:0],  bit_ns, 1'b0);
+            send_uart_byte_921(use_ttl, crc[15:8], bit_ns, 1'b0);
+        end
+    endtask
+
+    task automatic send_byte_aux;
+        input integer which; // 0=460, 1=230, 2=115
+        input [7:0]   b;
+        input real    bit_ns;
+        integer bit_i;
+        begin
+            case (which)
+                0: rs232_rx_460 = 1'b0;
+                1: rs232_rx_230 = 1'b0;
+                2: rs232_rx_115 = 1'b0;
+            endcase
+            #(bit_ns);
+            for (bit_i = 0; bit_i < 8; bit_i = bit_i + 1) begin
+                case (which)
+                    0: rs232_rx_460 = b[bit_i];
+                    1: rs232_rx_230 = b[bit_i];
+                    2: rs232_rx_115 = b[bit_i];
+                endcase
+                #(bit_ns);
+            end
+            case (which)
+                0: rs232_rx_460 = 1'b1;
+                1: rs232_rx_230 = 1'b1;
+                2: rs232_rx_115 = 1'b1;
+            endcase
+            #(bit_ns);
+        end
+    endtask
+
+    task automatic send_ping_aux;
+        input integer which;
+        input real    bit_ns;
+        begin
+            // A5 5A 03 00 5C 48 (valid 0B HEARTBEAT)
+            send_byte_aux(which, 8'hA5, bit_ns);
+            send_byte_aux(which, 8'h5A, bit_ns);
+            send_byte_aux(which, 8'h03, bit_ns);
+            send_byte_aux(which, 8'h00, bit_ns);
+            send_byte_aux(which, 8'h5C, bit_ns);
+            send_byte_aux(which, 8'h48, bit_ns);
+        end
+    endtask
+
+    task wait_and_ack_921;
+        input [7:0] exp_type;
+        input [7:0] exp_len;
+        input [7:0] exp_seed;
+        input [8*32-1:0] label;
+        integer guard;
+        integer k;
+        begin
+            guard = 0;
+            while (!req_valid_921 && guard < 20000) begin
+                @(posedge clk);
+                guard = guard + 1;
+            end
+            if (!req_valid_921) begin
+                $display("FAIL %0s: timeout waiting for req_valid_921", label);
+                total_failures = total_failures + 1;
+            end else begin
+                if (req_type_921 !== exp_type || req_len_921 !== exp_len) begin
+                    $display("FAIL %0s: type=%02h len=%0d expected %02h/%0d",
+                             label, req_type_921, req_len_921, exp_type, exp_len);
+                    total_failures = total_failures + 1;
+                end
+                for (k = 0; k < exp_len; k = k + 1) begin
+                    if (req_mem_921[k] !== (exp_seed + k[7:0])) begin
+                        $display("FAIL %0s: payload[%0d]=%02h expected %02h",
+                                 label, k, req_mem_921[k], (exp_seed + k[7:0]));
+                        total_failures = total_failures + 1;
+                    end
+                end
+                @(negedge clk);
+                req_ready_921 = 1'b1;
+                @(posedge clk);
+                @(negedge clk);
+                req_ready_921 = 1'b0;
+            end
+        end
+    endtask
+
+    // -------------------------------------------------------------------------
+    // TX byte-capture monitor for 921600 RS232 & TTL mirror verification
+    // -------------------------------------------------------------------------
+    reg [7:0] rx_cap_rs232 [0:31];
+    reg [7:0] rx_cap_ttl   [0:31];
+    integer   cap_cnt_rs232 = 0;
+    integer   cap_cnt_ttl   = 0;
+
+    task automatic capture_tx_byte;
+        input        is_ttl;
+        output [7:0] out_b;
+        integer bit_i;
+        real    bit_ns;
+        begin
+            bit_ns = 1080.0; // 27 * 40ns = 1080ns exact FPGA TX bit period
+            if (is_ttl) @(negedge ttl_tx_921);
+            else        @(negedge rs232_tx_921);
+            #(bit_ns * 1.5);
+            for (bit_i = 0; bit_i < 8; bit_i = bit_i + 1) begin
+                out_b[bit_i] = is_ttl ? ttl_tx_921 : rs232_tx_921;
+                #(bit_ns);
+            end
+        end
+    endtask
+
+    // Nominal 921600 bit period = 1e9 / 921600 = 1085.0694 ns
+    // +2.0% faster host clock   = 1085.0694 / 1.02 = 1063.79 ns
+    // -2.0% slower host clock   = 1085.0694 * 1.02 = 1106.77 ns
+    real bit_921_nom;
+    real bit_921_fast;
+    real bit_921_slow;
+    integer i, guard;
+    reg [7:0] b_rs, b_tl;
+    reg [15:0] tx_crc;
+
+    initial begin
+        bit_921_nom  = 1000000000.0 / 921600.0;
+        bit_921_fast = bit_921_nom / 1.02;
+        bit_921_slow = bit_921_nom * 1.02;
+
+        for (i = 0; i < 128; i = i + 1) begin
+            req_mem_921[i] = 8'd0;
+            tx_mem_921[i]  = 8'hA0 + i[7:0];
+        end
+
+        repeat (10) @(posedge clk);
+        rst_n = 1'b1;
+        repeat (10) @(posedge clk);
+
+        // 1. 921600 nominal (real PC 921600 vs FPGA 925926 +0.47%): 36B SET_ALL on RS232
+        fork
+            send_frame_921(1'b0, 8'h01, 8'd36, 8'h10, bit_921_nom);
+            wait_and_ack_921(8'h01, 8'd36, 8'h10, "921600_nom_RS232_36B");
+        join
+
+        // 2. 921600 +2.0% faster host skew: 69B SET_ALL on TTL (immediate RS232->TTL handoff!)
+        fork
+            send_frame_921(1'b1, 8'h01, 8'd69, 8'h20, bit_921_fast);
+            wait_and_ack_921(8'h01, 8'd69, 8'h20, "921600_plus2pct_TTL_69B");
+        join
+
+        // 3. 921600 -2.0% slower host skew: 36B SET_ALL back on RS232 (TTL->RS232 handoff!)
+        fork
+            send_frame_921(1'b0, 8'h01, 8'd36, 8'h40, bit_921_slow);
+            wait_and_ack_921(8'h01, 8'd36, 8'h40, "921600_minus2pct_RS232_36B");
+        join
+
+        // 4. Back-to-back 0-gap burst of 4 frames on 921600 while simultaneously transmitting TX reply!
+        tx_crc = crc16_step(crc16_step(16'hFFFF, 8'h83), 8'd4);
+        tx_crc = crc16_step(crc16_step(crc16_step(crc16_step(tx_crc, 8'hA0), 8'hA1), 8'hA2), 8'hA3);
+        @(negedge clk);
+        tx_type_921  = 8'h83;
+        tx_len_921   = 8'd4;
+        tx_start_921 = 1'b1;
+        @(posedge clk);
+        @(negedge clk);
+        tx_start_921 = 1'b0;
+
+        fork
+            begin
+                send_frame_921(1'b0, 8'h03, 8'd4, 8'h51, bit_921_nom);
+                send_frame_921(1'b0, 8'h02, 8'd0, 8'h00, bit_921_nom);
+                send_frame_921(1'b0, 8'h03, 8'd4, 8'h61, bit_921_nom);
+                send_frame_921(1'b0, 8'h01, 8'd32, 8'h71, bit_921_nom);
+            end
+            begin
+                wait_and_ack_921(8'h03, 8'd4,  8'h51, "921600_burst_0");
+                wait_and_ack_921(8'h02, 8'd0,  8'h00, "921600_burst_1");
+                wait_and_ack_921(8'h03, 8'd4,  8'h61, "921600_burst_2");
+                wait_and_ack_921(8'h01, 8'd32, 8'h71, "921600_burst_3");
+            end
+            begin : cap_rs
+                integer i_rs;
+                for (i_rs = 0; i_rs < 10; i_rs = i_rs + 1) begin
+                    capture_tx_byte(1'b0, b_rs);
+                    rx_cap_rs232[i_rs] = b_rs;
+                end
+            end
+            begin : cap_tl
+                integer i_tl;
+                for (i_tl = 0; i_tl < 10; i_tl = i_tl + 1) begin
+                    capture_tx_byte(1'b1, b_tl);
+                    rx_cap_ttl[i_tl] = b_tl;
+                end
+            end
+        join
+
+        // Verify full-duplex mirrored TX frame (A5 5A 83 04 A0 A1 A2 A3 CRC_LO CRC_HI)
+        if (rx_cap_rs232[0] !== 8'hA5 || rx_cap_rs232[1] !== 8'h5A ||
+            rx_cap_rs232[2] !== 8'h83 || rx_cap_rs232[3] !== 8'h04 ||
+            rx_cap_rs232[4] !== 8'hA0 || rx_cap_rs232[7] !== 8'hA3 ||
+            rx_cap_rs232[8] !== tx_crc[7:0] || rx_cap_rs232[9] !== tx_crc[15:8]) begin
+            $display("FAIL 921600_tx_rs232: got %02h %02h %02h %02h ... %02h %02h exp crc %02h %02h",
+                     rx_cap_rs232[0], rx_cap_rs232[1], rx_cap_rs232[2], rx_cap_rs232[3],
+                     rx_cap_rs232[8], rx_cap_rs232[9], tx_crc[7:0], tx_crc[15:8]);
+            total_failures = total_failures + 1;
+        end
+        for (i = 0; i < 10; i = i + 1) begin
+            if (rx_cap_ttl[i] !== rx_cap_rs232[i]) begin
+                $display("FAIL 921600_tx_mirror[%0d]: ttl=%02h rs232=%02h",
+                         i, rx_cap_ttl[i], rx_cap_rs232[i]);
+                total_failures = total_failures + 1;
+            end
+        end
+
+        // 5. Framing-error injection mid-frame on RS232 + noise on TTL -> clean recovery on next frame
+        send_uart_byte_921(1'b0, 8'hA5, bit_921_nom, 1'b0);
+        send_uart_byte_921(1'b0, 8'h5A, bit_921_nom, 1'b0);
+        send_uart_byte_921(1'b0, 8'h01, bit_921_nom, 1'b1); // bad stop bit!
+        // Non-A5 garbage on TTL should NOT lock ownership
+        send_uart_byte_921(1'b1, 8'h00, bit_921_nom, 1'b0);
+        send_uart_byte_921(1'b1, 8'hFF, bit_921_nom, 1'b0);
+        #(bit_921_nom * 4.0);
+        if (req_valid_921) begin
+            $display("FAIL framing_err: spurious req_valid after framing error");
+            total_failures = total_failures + 1;
+        end
+        // Immediate clean frame on TTL must succeed without waiting 10 ms!
+        fork
+            send_frame_921(1'b1, 8'h03, 8'd4, 8'h90, bit_921_nom);
+            wait_and_ack_921(8'h03, 8'd4, 8'h90, "921600_post_ferr_TTL_recovery");
+        join
+
+        // 6. Verify 460800 / 230400 / 115200 fallback baud rates at +/-2.0% skew in parallel!
+        fork
+            begin : blk_460
+                integer g460;
+                send_ping_aux(0, (1000000000.0 / 460800.0) * 1.02);
+                g460 = 0; while (!req_valid_460 && g460 < 40000) begin @(posedge clk); g460 = g460 + 1; end
+                if (!req_valid_460 || req_type_460 !== 8'h03) begin
+                    $display("FAIL 460800_minus2pct"); total_failures = total_failures + 1;
+                end else begin @(negedge clk); req_ready_460 = 1'b1; @(posedge clk); @(negedge clk); req_ready_460 = 1'b0; end
+                send_ping_aux(0, (1000000000.0 / 460800.0) / 1.02);
+                g460 = 0; while (!req_valid_460 && g460 < 40000) begin @(posedge clk); g460 = g460 + 1; end
+                if (!req_valid_460 || req_type_460 !== 8'h03) begin
+                    $display("FAIL 460800_plus2pct"); total_failures = total_failures + 1;
+                end else begin @(negedge clk); req_ready_460 = 1'b1; @(posedge clk); @(negedge clk); req_ready_460 = 1'b0; end
+            end
+            begin : blk_230
+                integer g230;
+                send_ping_aux(1, (1000000000.0 / 230400.0) * 1.02);
+                g230 = 0; while (!req_valid_230 && g230 < 80000) begin @(posedge clk); g230 = g230 + 1; end
+                if (!req_valid_230 || req_type_230 !== 8'h03) begin
+                    $display("FAIL 230400_minus2pct"); total_failures = total_failures + 1;
+                end else begin @(negedge clk); req_ready_230 = 1'b1; @(posedge clk); @(negedge clk); req_ready_230 = 1'b0; end
+                send_ping_aux(1, (1000000000.0 / 230400.0) / 1.02);
+                g230 = 0; while (!req_valid_230 && g230 < 80000) begin @(posedge clk); g230 = g230 + 1; end
+                if (!req_valid_230 || req_type_230 !== 8'h03) begin
+                    $display("FAIL 230400_plus2pct"); total_failures = total_failures + 1;
+                end else begin @(negedge clk); req_ready_230 = 1'b1; @(posedge clk); @(negedge clk); req_ready_230 = 1'b0; end
+            end
+            begin : blk_115
+                integer g115;
+                send_ping_aux(2, (1000000000.0 / 115200.0) * 1.02);
+                g115 = 0; while (!req_valid_115 && g115 < 160000) begin @(posedge clk); g115 = g115 + 1; end
+                if (!req_valid_115 || req_type_115 !== 8'h03) begin
+                    $display("FAIL 115200_minus2pct"); total_failures = total_failures + 1;
+                end else begin @(negedge clk); req_ready_115 = 1'b1; @(posedge clk); @(negedge clk); req_ready_115 = 1'b0; end
+                send_ping_aux(2, (1000000000.0 / 115200.0) / 1.02);
+                g115 = 0; while (!req_valid_115 && g115 < 160000) begin @(posedge clk); g115 = g115 + 1; end
+                if (!req_valid_115 || req_type_115 !== 8'h03) begin
+                    $display("FAIL 115200_plus2pct"); total_failures = total_failures + 1;
+                end else begin @(negedge clk); req_ready_115 = 1'b1; @(posedge clk); @(negedge clk); req_ready_115 = 1'b0; end
+            end
+        join
+
+        if (total_failures == 0) begin
+            $display("uart_921600_skew_tb PASS: 921600/460800/230400/115200 +/-2%% skew, burst, framing-error recovery, and RS232<->TTL handoff verified");
+        end else begin
+            $fatal(1, "uart_921600_skew_tb FAIL (%0d errors)", total_failures);
+        end
+        $finish;
+    end
+endmodule

+ 3 - 3
tests/unit/test_gui_v3_ssr_diagnostic.py

@@ -113,12 +113,12 @@ def test_diagnostic_does_not_complete_get_or_set_and_survives_fragmentation():
             assert tracker.tx_state == "WAIT_GET_DATA"
     # MRDIMM rejects 20B 6400-v2 diagnostic, but accepts 8B MRDIMM format-2 diagnostic
     assert not any(kind == "FRAME_VALID" for kind, _ in StreamReceiver("mrdimm-chamber").feed_bytes(diag))
-    mr_diag = gui.encode_frame(0x52, bytes([2, 0x80, 3, 2, 0, 0x0B, 0x03, 0x00]))
+    mr_diag = gui.encode_frame(0x52, bytes([2, 0x80, 3, 3, 0, 0x0B, 0x03, 0x00]))
     mr_evts = StreamReceiver("mrdimm-chamber").feed_bytes(mr_diag)
     assert sum(kind == "FRAME_VALID" for kind, _ in mr_evts) == 1
     mr_parsed = gui.Model("mrdimm-chamber").parse(mr_diag)[0]
     assert mr_parsed["kind"] == "diagnostic"
-    assert mr_parsed["diagnostic"]["firmware_version"] == "3.2.0"
+    assert mr_parsed["diagnostic"]["firmware_version"] == "3.3.0"
     assert mr_parsed["diagnostic"]["motor_any_active"] is True
     assert mr_parsed["diagnostic"]["duty_bank_valid"] is True
     assert mr_parsed["diagnostic"]["watchdog_expired"] is False
@@ -237,7 +237,7 @@ def test_chamber_curve_store_and_direct_image_export(tmp_path):
 def test_pwm_unified_20hz_and_thermal_test_session_continuous_recording():
     assert gui.PWM_FREQUENCY_HZ == 20
     assert gui.PWM_PERIOD_MS == 50.0
-    assert gui.SOFTWARE_VERSION == "3.2.0"
+    assert gui.SOFTWARE_VERSION == "3.3.0"
 
     cfg = gui.ChamberMappingConfig.default("6400-v2")
     store = gui.TemperatureCurveStore()

+ 2 - 2
tools/_vendor/prod2u_status.py

@@ -1,9 +1,9 @@
 """Status decoding for the two Prod2U products matching the single frame protocol.
 
 GET_DATA:
-- 6400 V2 (v3.2.0): 90 bytes (0..85 unchanged + 86 estop_btn + 87 hood_open_btn + 88 hood_close_btn + 89 buzzer_state); backward-compat with 88/86 bytes
+- 6400 V2 (v3.3.0): 90 bytes (0..85 unchanged + 86 estop_btn + 87 hood_open_btn + 88 hood_close_btn + 89 buzzer_state); backward-compat with 88/86 bytes
 - 6400 V1: 83 bytes (PTC0..23, Front0..3, Rear0..3, BMC0..23, CT0..26)
-- MRDIMM (v3.2.0): 65 bytes (0..62 unchanged + 63 hood_switch + 64 buzzer_state); backward-compat with 63 bytes
+- MRDIMM (v3.3.0): 65 bytes (0..62 unchanged + 63 hood_switch + 64 buzzer_state); backward-compat with 63 bytes
 DIAGNOSTIC (0x52):
 - 6400 V2: 20 bytes (format 1, board_id 0x64)
 - MRDIMM: 8 bytes (format 2, board_id 0x80)

+ 1 - 1
tools/board-viewer/README.zh-CN.md

@@ -1,4 +1,4 @@
-# 本地电路板查看器(3.2.0)
+# 本地电路板查看器(3.3.0)
 
 查看当前 MRDIMM V1.2、6400 V2.0 主板及风扇子板的连接器、FPGA 球位、板内网络和电气说明。页面也保留 V1.1 历史参考视图;选择板版本后再查针脚,不能混用同名连接器的电压和用途。
 

+ 1 - 1
tools/board-viewer/generate_v2_0_assets.py

@@ -2023,7 +2023,7 @@ def generate_v2_0_mainboard() -> None:
     build_info = {
         "schema": "board-viewer-build-info-v1",
         "generated_at": datetime.now(timezone.utc).isoformat(),
-        "generator_version": "3.2.0",
+        "generator_version": "3.3.0",
         "toolchain": {"python": sys.version.split()[0], "kicad": "not_used"},
         "sources": {
             **_generator_sources(),

+ 4 - 4
tools/board-viewer/generated-v2_0/build-info.json

@@ -1,7 +1,7 @@
 {
   "schema": "board-viewer-build-info-v1",
-  "generated_at": "2026-11-24T03:32:08.650760+00:00",
-  "generator_version": "3.2.0",
+  "generated_at": "2026-11-24T09:06:31.477234+00:00",
+  "generator_version": "3.3.0",
   "toolchain": {
     "python": "3.13.5",
     "kicad": "not_used"
@@ -9,7 +9,7 @@
   "sources": {
     "generator_v20": {
       "path": "tools/board-viewer/generate_v2_0_assets.py",
-      "sha256": "1092a715230ca70e041e3b014ff95e5a98d56778998a787621925644d21315d1"
+      "sha256": "5031f5ffaa7fceedc685708233f9a4d145741980907ac7343de829a7ef35849d"
     },
     "generator_annotations": {
       "path": "tools/board-viewer/board_viewer/annotations.py",
@@ -62,7 +62,7 @@
       "bytes": 3933224
     },
     "import-report.json": {
-      "sha256": "5a1c1afd61bb1856d122dd05cb4a4df4df9ecf4b3c0d377997e39584dac69f00",
+      "sha256": "b9eee051ddd83020accd6c7c84b5a5c56d346abea20da2bb7c618fd5f22e7bec",
       "bytes": 485
     },
     "board-mask-edge.svg": {

+ 1 - 1
tools/board-viewer/generated-v2_0/import-report.json

@@ -5,7 +5,7 @@
   "source_format": "allegro_brd",
   "output_file": "board-data.json",
   "errors": [],
-  "timestamp": "2026-11-24T03:32:08.624533+00:00",
+  "timestamp": "2026-11-24T09:06:31.371929+00:00",
   "stats": {
     "connectors": 41,
     "jumpers": 18,

+ 3 - 3
tools/board-viewer/generated-v2_0_fan/build-info.json

@@ -1,6 +1,6 @@
 {
   "schema": "board-viewer-build-info-v1",
-  "generated_at": "2026-11-24T03:32:09.627195+00:00",
+  "generated_at": "2026-11-24T09:06:32.887067+00:00",
   "generator_version": "2.1.0",
   "toolchain": {
     "python": "3.13.5",
@@ -9,7 +9,7 @@
   "sources": {
     "generator_v20": {
       "path": "tools/board-viewer/generate_v2_0_assets.py",
-      "sha256": "1092a715230ca70e041e3b014ff95e5a98d56778998a787621925644d21315d1"
+      "sha256": "5031f5ffaa7fceedc685708233f9a4d145741980907ac7343de829a7ef35849d"
     },
     "generator_annotations": {
       "path": "tools/board-viewer/board_viewer/annotations.py",
@@ -50,7 +50,7 @@
       "bytes": 193774
     },
     "import-report.json": {
-      "sha256": "bed4ac392097218942c33a9b8cf559ebdeda4edaa9ddf8eb6c2dd56280028ff6",
+      "sha256": "cbfeda16d231acbc3ff439df29b1041a4f695556ae1cf36944e2aa30fb287018",
       "bytes": 390
     },
     "board-mask-edge.svg": {

+ 1 - 1
tools/board-viewer/generated-v2_0_fan/import-report.json

@@ -5,7 +5,7 @@
   "source_format": "allegro_brd",
   "output_file": "board-data.json",
   "errors": [],
-  "timestamp": "2026-11-24T03:32:09.625148+00:00",
+  "timestamp": "2026-11-24T09:06:32.884989+00:00",
   "stats": {
     "connectors": 7,
     "fuses": 4

+ 23 - 23
tools/board-viewer/web/cpld-arch-data.mjs

@@ -1,7 +1,7 @@
 /**
- * Reviewed dev v3.2.0 notes. Board facts come from generated native-BRD data + V3.0 PDF;
+ * Reviewed dev v3.3.0 notes. Board facts come from generated native-BRD data + V3.0 PDF;
  * these project notes are maintained text, not parsed RTL or measured hardware.
- * Current production targets: 6400 V2.0 and MRDIMM V1.2. V1.1 is historical.
+ * Mainline dev targets: 6400 V2.0 and MRDIMM V1.2. 6400 V1.1 is maintained on standalone branch `6400-v1.1` (No-MCU + BMC NET + Windows Adaptive PID).
  */
 export const CPLD_CHIP_SPEC = {
   "vendor": "Anlogic (安路科技)",
@@ -156,49 +156,49 @@ export const BOARD_VERSION_COMM_MATRIX = {
   },
   "v1_1": {
     "versionKey": "v1_1",
-    "badge": "6400 V1.1 历史配置(本轮未作为生产目标重验)",
+    "badge": "6400 V1.1 独立分支版(6400-v1.1,无MCU + BMC NET + Windows自适应PID)",
     "topModule": "prod2u_6400_final_top",
     "topFile": "src/top/prod2u_6400_final_top.v",
     "constraintFile": "constraints/prod2u_6400_front_back.adc",
-    "boardSize": "430.0 × 75.0 mm (基于 V1.1/V1.2 共版 PCB)",
-    "hostBaudDefault": "历史编译参数;不代表本轮生产镜像。",
+    "boardSize": "430.0 × 75.0 mm (基于 FCB_FPGA+MCU_V1.1_20260625.brd)",
+    "hostBaudDefault": "独立分支 6400-v1.1 编译可选 921600/460800/230400/115200 8N1(分频 27/54/109/217),默认 921600。",
     "hostTtl": {
       "connector": "CON30",
       "txPin": "CON30.4 (FAN_GPIO4) ← U3.A10 (host_ttl_tx)",
-      "rxPin": "CON30.3 (FAN_GPIO3) → U3.B9 (host_ttl_rx)",
-      "peerDevice": "外部 3.3V TTL 上位机串口 (CON30.1 为 GND,已锁定取代旧 I2C CON36)",
+      "rxPin": "CON30.3 (FAN_GPIO3) → U3.B9 (host_ttl_rx, PULLUP)",
+      "peerDevice": "Windows 上位机 3.3V TTL 串口直连(无板载 MCU 介入,CON30.1 为 GND)",
       "jumpQuery": "CON30"
     },
     "hostRs232": {
       "connector": "CON78",
-      "txPin": "CON78.1 ← U23 (MAX3232) ← U3.M10 (host_rs232_tx)",
-      "rxPin": "CON78.2 → U23 (MAX3232) → U3.N11 (host_rs232_rx)",
-      "peerDevice": "上位机 PC RS-232 串口",
+      "txPin": "CON78.1 ← U23 (TRSF3232E) ← U3.M10 (host_rs232_tx)",
+      "rxPin": "CON78.2 → U23 (TRSF3232E) → U3.N11 (host_rs232_rx, PULLUP)",
+      "peerDevice": "Windows 上位机 PC RS-232 串口直连(运行自适应 PID 温控 EXE)",
       "jumpQuery": "CON78"
     },
     "bmcUart": {
-      "connector": "CON77",
-      "txPin": "CON77.1 ← U22 (MAX3232) ← U3.L10 (bmc_rs232_tx)",
-      "rxPin": "CON77.2 → U22 (MAX3232) → U3.M9 (bmc_rs232_rx)",
-      "baud": "115200 8N1",
-      "pollCmd": "历史配置请查其匹配版本源码和合同,不据当前板卡推断。",
-      "jumpQuery": "CON77"
+      "connector": "不经 CPLD BMC 串口(Windows 经 BMC NET 直接采集)",
+      "txPin": "CON77 在 6400-v1.1 无MCU 方案中彻底移除(释放约 350+ LUT)",
+      "rxPin": "DIMM 温度由 Windows 上位机通过 BMC NET(IPMI v2.0 RMCP+ UDP:623)直接读取",
+      "baud": "BMC NET (UDP:623 / Cipher Suite 17)",
+      "pollCmd": "Windows 上位机直接向 BMC 网口发送 raw 0x36 0x6c 0xdf 0xdd 0x00 0x03(0.25°C 精度);CPLD 83B GET_DATA 的 BMC 槽恒填 0xFF。",
+      "jumpQuery": "CON78"
     },
     "ct7428I2c": {
-      "pins": "U3.M8 (temp_scl) / U3.N9 (temp_sda)",
-      "chips": "3 颗 CT7428 (U6, U24, U25) 扫描 27 通道温度 (CON53..98)",
+      "pins": "U3.M8 (temp_scl) / U3.N9 (temp_sda);备用总线 B14/A15 固定高阻",
+      "chips": "3 颗 CT7428 (U6=0x49, U24=0x48, U25=0x4B) 扫描全部 27 通道温度 (CON53..98)",
       "rate": "100 kHz I2C (HALF_PERIOD_CLKS=125)",
       "jumpQuery": "CON53"
     },
     "thermalPwm": {
-      "freq": "500 Hz (100 相位 × 500 clks)",
+      "freq": "20 Hz 统一热控 PWM(50 ms 周期,100 相位 × 12,500 clks @ 25 MHz)",
       "ptcChannels": "24 路 +12V PTC 加热输出 (CON18, CON27, CON28, CON29 各 6 路),高电平有效,默认 0%",
       "fanChannels": "4 前风扇 (CON25.7 B1, CON8.7 C4, CON24.7 B5, CON26.7 A14,板级反相) + 4 后风扇 (CON64.4 P15, CON66.4 N15, CON62.4 M14, CON60.4 P5,板级同相),单一反相点 FAN_BOARD_INVERT_MASK = 8'h0F",
       "ssrChannels": "无",
       "jumpQuery": "CON25"
     },
     "motorSpec": "无步进电机",
-    "watchdogSpec": "历史配置说明;当前生产目标是6400 V2.0及MRDIMM V1.2。"
+    "watchdogSpec": "独立分支 6400-v1.1(不合入主线 dev):30s 看门狗超时回退 PTC=0%、FAN=20%;每 1s 自动输出 0x42(83B)+0x52(20B, format=3, board_id=0x61)。"
   }
 };
 
@@ -623,14 +623,14 @@ const TOPICS = {
       ],
       [
         "自动输出",
-        "6400约每5s主动0x42状态快照;MRDIMM约每5s主动0x51零载荷信标。都不喂看门狗。"
+        "6400 V2.0每1s主动0x42(90B,按钮字节恒0)+0x52(20B);MRDIMM每5s主动0x51(0B)+0x52(8B);6400 V1.1独立分支每1s主动0x42(83B)+0x52(20B)。均不喂看门狗。"
       ]
     ]
   },
   "proto_payload_map": {
     "title": "SET_ALL (36B/69B)、GET_DATA (90B/65B) 与 MOTOR_DONE 字节映射",
     "file": "contracts/6400-v2-wire.yaml",
-    "summary": "整数多字节字段使用小端。v3.2.0 末尾新增急停/开关罩按钮检测(仅GET_ALL)与蜂鸣器控制字节。",
+    "summary": "整数多字节字段使用小端。v3.3.0 延续急停/开关罩按钮检测(仅GET_ALL)、蜂鸣器控制字节及深度串行移位降LUT重构。",
     "kvTable": [
       [
         "6400 V2 SET36",
@@ -881,7 +881,7 @@ export function getCpldTopicDetail(topicId, boardVersion = "v2_0") {
   if (topicId === "curr_overview") {
     return {
       title: `${curr.badge} · 项目接口说明`, file: curr.topFile, tag: curr.topModule,
-      summary: `项目说明以dev v3.2.0为基准;原生板数据、电气图V3.0、当前ADC和实板线束分别核对。${curr.watchdogSpec}`,
+      summary: `项目说明以dev v3.3.0为基准;原生板数据、电气图V3.0、当前ADC和实板线束分别核对。${curr.watchdogSpec}`,
       jumpPills: [curr.hostTtl, curr.hostRs232, curr.bmcUart].map(x => ({label:x.connector, query:x.jumpQuery})),
       kvTable: [["顶层/约束", `${curr.topModule} · ${curr.constraintFile}`],
         ["Host波特率", curr.hostBaudDefault],

+ 7 - 7
tools/prod2u_gui.py

@@ -47,7 +47,7 @@ PWM_PERIOD_MS = 50.0
 SOFTWARE_VERSION = (
     (ROOT / "VERSION").read_text(encoding="utf-8").strip()
     if (ROOT / "VERSION").is_file()
-    else "3.2.0"
+    else "3.3.0"
 )
 
 FRAME_TYPE_NAMES = {
@@ -2376,25 +2376,25 @@ def self_test(product: str) -> int:
         p_done_bl = model.parse(done_bl)[0]
         assert p_done_bl["axis"] == 4 and p_done_bl["reason"] == "BOTH_LIMITS" and p_done_bl["steps_done"] == 0
 
-        # V3.2.0 65B GET_DATA (hood_switch=1, buzzer=1) + 8B DIAGNOSTIC
+        # V3.3.0 65B GET_DATA (hood_switch=1, buzzer=1) + 8B DIAGNOSTIC
         mr_status = bytes([20] * 4 + [0] * 4 + [255] * 51 + [0, 0, 0, 0, 1, 1])
         mr_dec = model.state(mr_status)
         assert mr_dec["hood_switch"] is True and mr_dec["buzzer"] is True
-        mr_diag = bytes([2, 0x80, 3, 2, 0, 0x0B, 0x05, 0x00])
+        mr_diag = bytes([2, 0x80, 3, 3, 0, 0x0B, 0x05, 0x00])
         p_diag = model.parse(encode_frame(FrameType.DIAGNOSTIC, mr_diag))[0]["diagnostic"]
-        assert p_diag["supported"] and p_diag["firmware_version"] == "3.2.0" and p_diag["buzzer_on"] and p_diag["active_axes"] == [0, 2]
+        assert p_diag["supported"] and p_diag["firmware_version"] == "3.3.0" and p_diag["buzzer_on"] and p_diag["active_axes"] == [0, 2]
 
     if product == "6400-v2":
-        # V3.2.0 90B GET_DATA (EPB1=1, SB1=1, SB2=0, buzzer=1)
+        # V3.3.0 90B GET_DATA (EPB1=1, SB1=1, SB2=0, buzzer=1)
         status = bytes([0] * 24 + [20] * 8 + [255] * 51 + [0, 25, 100, 1, 1, 0, 1])
         decoded = model.state(status)
         assert decoded["ssr"] == [0, 25, 100]
         assert decoded["estop_btn"] is True and decoded["hood_open_btn"] is True
         assert decoded["hood_close_btn"] is False and decoded["buzzer"] is True
         assert len(decoded["ct"]["raw"]) == 27
-        diagnostic = bytes([1, 0x64, 3, 2, 0, 0x23, 0, 0, 0x4C, 0, 0, 0x80, 0x0C, 25, 1, 0, 1, 1, 0, 48])
+        diagnostic = bytes([1, 0x64, 3, 3, 0, 0x23, 0, 0, 0x4C, 0, 0, 0x80, 0x0C, 25, 1, 0, 1, 1, 0, 48])
         d_parsed = model.parse(encode_frame(FrameType.DIAGNOSTIC, diagnostic))[0]["diagnostic"]
-        assert d_parsed["temperature_c"] == 25 and d_parsed["buzzer_on"] is True and d_parsed["firmware_version"] == "3.2.0"
+        assert d_parsed["temperature_c"] == 25 and d_parsed["buzzer_on"] is True and d_parsed["firmware_version"] == "3.3.0"
 
     # 5. Chamber mapping default + custom configuration & curve image generation
     cmap = ChamberMappingConfig.default(product)

+ 1 - 1
tools/pwm_scope.py

@@ -211,7 +211,7 @@ def show_map(style=None):
     st = style or Style(enabled=sys.stdout.isatty() and not os.environ.get("NO_COLOR"))
     top, mid, sep, bot, row, _ = _box_helpers(st)
 
-    print(top(f"6400V2.0 示波器与温度测试 (脚本 v{SCRIPT_VERSION} / 适配固件 3.2.0)"))
+    print(top(f"6400V2.0 示波器与温度测试 (脚本 v{SCRIPT_VERSION} / 适配固件 3.3.0)"))
     print(row(
         f"{st.bold('协议')}: SET36 / GET90 (921600 8N1)     "
         f"{st.bold('统一频率')}: 20Hz (周期 50.00ms, 1% = 0.50ms)"

+ 1 - 1
tools/thermal_test_server.py

@@ -56,7 +56,7 @@ def detect_container_privileges() -> dict[str, Any]:
         "privileged": is_privileged,
         "device_nodes": dev_nodes,
         "pwm_unified_hz": 20,
-        "software_version": getattr(gui, "SOFTWARE_VERSION", "3.2.0"),
+        "software_version": getattr(gui, "SOFTWARE_VERSION", "3.3.0"),
         "protocol": {"6400-v2": "SET36/GET90 (EPB1+SB1+SB2+4kHz80% buzzer)", "mrdimm": "SET69/GET65+DIAG8 (4kHz80% buzzer)"},
     }