Przeglądaj źródła

6400-host-i2c-con36

Prod2U 3 miesięcy temu
rodzic
commit
cd21950b82

Plik diff jest za duży
+ 2603 - 0
config/board_viewer_annotations.fcb_fpga_mcu_v1_1.json


+ 2 - 0
constraints/prod2u_6400_front_back.adc

@@ -4,6 +4,8 @@ set_pin_assignment { bmc_rs232_tx } { LOCATION = L10; IOSTANDARD = LVCMOS33; PUL
 set_pin_assignment { bmc_rs232_rx } { LOCATION = M9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
 set_pin_assignment { host_rs232_tx } { LOCATION = M10; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
 set_pin_assignment { host_rs232_rx } { LOCATION = N11; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
+set_pin_assignment { host_i2c_scl } { LOCATION = B12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
+set_pin_assignment { host_i2c_sda } { LOCATION = C12; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
 set_pin_assignment { temp_scl } { LOCATION = M8; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
 set_pin_assignment { temp_sda } { LOCATION = N9; IOSTANDARD = LVCMOS33; PULLTYPE = NONE; }
 set_pin_assignment { ptc_pwm_out[0] } { LOCATION = R7; IOSTANDARD = LVCMOS33; }

+ 16 - 0
docs/electrical/host-i2c-pin-evidence-lock.md

@@ -0,0 +1,16 @@
+# 6400 Host-I2C V1.1 evidence lock
+
+Board-viewer evidence cross-verifies two independent CON36 GPIO paths:
+
+| Role | Connector | Net | Series | Pull-up option | FPGA bank/ball | I/O |
+| --- | --- | --- | --- | --- | --- | --- |
+| SDA | CON36.3 | FAN_GPIO15 | R674 | R948 to +3V3 | BANK0_GPIO15 / C12 | LVCMOS33 |
+| SCL | CON36.4 | FAN_GPIO16 | R675 | R949 to +3V3 | BANK0_GPIO16 / B12 | LVCMOS33 |
+
+Evidence source: `tools/board-viewer/generated-v1_1/board-data.json`.
+
+Evidence SHA-256: `22de83156505752fb5cd07f7744083714711555a809e843ffb30afc3db9742f9`.
+
+The paths are suitable for logic binding and open-drain SDA when the external pull-up option is populated. The current board-viewer data does not prove BOM population or external pull-up voltage at the assembled board. Therefore the production electrical status remains `BLOCKED_EVIDENCE` until that assembly fact is verified.
+
+CT7428 remains an independent master on M8/N9. Host-I2C is not connected to the CT bus.

+ 56 - 0
generated/6400/host-i2c-pin-evidence.json

@@ -0,0 +1,56 @@
+{
+  "schema": "6400-host-i2c-pin-evidence-v1",
+  "board": "FCB V1.1",
+  "source": "tools/board-viewer/generated-v1_1/board-data.json",
+  "evidence_sha256": "22de83156505752fb5cd07f7744083714711555a809e843ffb30afc3db9742f9",
+  "status": "CANDIDATE_LOGIC_BINDING_PULLUP_BOM_UNVERIFIED",
+  "host_i2c": {
+    "address_7bit": "0x2A",
+    "register_address_width_bits": 16,
+    "scl_input_only": true,
+    "sda_open_drain": true,
+    "clock_stretching": false
+  },
+  "pins": [
+    {
+      "role": "SDA",
+      "connector": "CON36",
+      "connector_pin": 3,
+      "board_net": "FAN_GPIO15",
+      "series_resistor": "R674",
+      "pullup_resistor": "R948",
+      "pullup_voltage": "+3V3 option; assembly unverified",
+      "fpga_bank_net": "BANK0_GPIO15",
+      "fpga_ball": "C12",
+      "io_voltage": "LVCMOS33",
+      "existing_load": "CON36 auxiliary GPIO connector and connector-side ESD",
+      "existing_active_driver": "none in current 6400 top; external load not electrically measured",
+      "bidirectional_capability": true,
+      "open_drain_suitability": "yes with external pull-up populated",
+      "current_product_conflict": "not mapped to PTC/FAN/UART/BMC/CT in current closure",
+      "evidence_source": "board-viewer cross-verified path CON36.3 -> R674 -> U3.C12",
+      "evidence_sha256": "22de83156505752fb5cd07f7744083714711555a809e843ffb30afc3db9742f9",
+      "confidence": "medium"
+    },
+    {
+      "role": "SCL",
+      "connector": "CON36",
+      "connector_pin": 4,
+      "board_net": "FAN_GPIO16",
+      "series_resistor": "R675",
+      "pullup_resistor": "R949",
+      "pullup_voltage": "+3V3 option; assembly unverified",
+      "fpga_bank_net": "BANK0_GPIO16",
+      "fpga_ball": "B12",
+      "io_voltage": "LVCMOS33",
+      "existing_load": "CON36 auxiliary GPIO connector and connector-side ESD",
+      "existing_active_driver": "none in current 6400 top; external load not electrically measured",
+      "bidirectional_capability": true,
+      "open_drain_suitability": "input-only SCL; external pull-up required",
+      "current_product_conflict": "not mapped to PTC/FAN/UART/BMC/CT in current closure",
+      "evidence_source": "board-viewer cross-verified path CON36.4 -> R675 -> U3.B12",
+      "evidence_sha256": "22de83156505752fb5cd07f7744083714711555a809e843ffb30afc3db9742f9",
+      "confidence": "medium"
+    }
+  ]
+}

+ 3 - 1
products/6400-front-rear/source-closure.json

@@ -17,6 +17,8 @@
     "src/rtl/prod2u_p4_i2c_stop_start_read.v",
     "src/transport/host_port_selector.v",
     "src/transport/thermal_host_command.v",
+    "src/transport/host_i2c_register_slave.v",
+    "src/transport/host_i2c_register_bank.v",
     "src/acquisition/bmc_poll_engine.v",
     "src/acquisition/bmc_ascii_snapshot.v",
     "src/acquisition/ct7428_snapshot.v",
@@ -29,5 +31,5 @@
     "src/top/prod2u_6400_v1_top.v",
     "src/top/prod2u_6400_rs232_only_top.v"
   ],
-  "forbidden_substrings": ["door_", "motor", "limit_gate", "EF2_PHY_PLL", "SET_TARGET", "8'h81", "8'h42", "stimulus_atomic_bank"]
+  "forbidden_substrings": ["door_", "motor", "limit_gate", "EF2_PHY_PLL", "SET_TARGET", "8'h81", "8'h42", "stimulus_atomic_bank", "PID", "pid_", "pi_"]
 }

+ 4 - 0
src/top/prod2u_6400_rs232_only_top.v

@@ -10,6 +10,8 @@ module prod2u_6400_rs232_only_top (
     output wire host_rs232_tx,
     input wire bmc_rs232_rx,
     output wire bmc_rs232_tx,
+    input wire host_i2c_scl,
+    inout wire host_i2c_sda,
     output wire [23:0] ptc_pwm_out,
     output wire [3:0] front_fan_pwm_out,
     output wire [3:0] rear_fan_pwm_out,
@@ -26,6 +28,8 @@ module prod2u_6400_rs232_only_top (
         .host_ttl_tx(host_ttl_tx_unused),
         .bmc_rs232_rx(bmc_rs232_rx),
         .bmc_rs232_tx(bmc_rs232_tx),
+        .host_i2c_scl(host_i2c_scl),
+        .host_i2c_sda(host_i2c_sda),
         .ptc_pwm_out(ptc_pwm_out),
         .front_fan_pwm_out(front_fan_pwm_out),
         .rear_fan_pwm_out(rear_fan_pwm_out),

+ 53 - 3
src/top/prod2u_6400_v1_top.v

@@ -15,6 +15,8 @@ module prod2u_6400_v1_top #(
     output wire        host_ttl_tx,
     input  wire        bmc_rs232_rx,
     output wire        bmc_rs232_tx,
+    input  wire        host_i2c_scl,
+    inout  wire        host_i2c_sda,
     output wire [23:0] ptc_pwm_out,
     output wire [3:0]  front_fan_pwm_out,
     output wire [3:0]  rear_fan_pwm_out,
@@ -155,11 +157,30 @@ module prod2u_6400_v1_top #(
     wire [7:0] watchdog_remaining;
     wire manual_mode;
     wire hard_protect;
+    wire i2c_sda_drive_low;
+    wire i2c_write_strobe;
+    wire [15:0] i2c_write_address;
+    wire [7:0] i2c_write_data;
+    wire i2c_command_strobe;
+    wire [7:0] i2c_command_data;
+    wire [15:0] i2c_read_address;
+    wire [7:0] i2c_read_data;
+    wire i2c_response_valid;
+    wire [7:0] i2c_response_ok;
+    wire [7:0] i2c_response_command;
+    wire [7:0] i2c_response_status;
+    wire [7:0] i2c_response_detail;
+    wire [15:0] i2c_snapshot_length;
+    wire i2c_manual_wr_en;
+    wire [4:0] i2c_manual_wr_addr;
+    wire [7:0] i2c_manual_wr_data;
+    wire i2c_manual_commit;
     wire [15:0] fault_flags = {8'd0, pwm_deadline_miss, bmc_parser_error, ct_stale,
         bmc_stale, global_fault, |lane_fault_mask, host_rx_error, bmc_rx_error};
 
     assign temp_scl = ct_scl_drive_low ? 1'b0 : 1'bz;
     assign temp_sda = ct_sda_drive_low ? 1'b0 : 1'bz;
+    assign host_i2c_sda = i2c_sda_drive_low ? 1'b0 : 1'bz;
     assign ptc_pwm_out = logical_bitmap[23:0];
 
     fan_board_output_adapter #(.BOARD_INVERT_MASK(`FAN_BOARD_INVERT_MASK)) u_fan_board_adapter (
@@ -215,6 +236,32 @@ module prod2u_6400_v1_top #(
         .ack_payload_data(ack_payload_data), .tx_done(host_response_done),
         .transaction_done(host_transaction_done), .busy(host_command_busy)
     );
+
+    host_i2c_register_slave #(.SLAVE_ADDRESS(7'h2A)) u_host_i2c_slave (
+        .clk(sys_clk), .rst_n(rst_n), .scl_i(host_i2c_scl), .sda_io(host_i2c_sda),
+        .write_strobe(i2c_write_strobe), .write_address(i2c_write_address), .write_data(i2c_write_data),
+        .command_strobe(i2c_command_strobe), .command_data(i2c_command_data),
+        .read_address(i2c_read_address), .read_data(i2c_read_data),
+        .response_valid(i2c_response_valid), .response_ok(i2c_response_ok),
+        .response_command(i2c_response_command), .response_status(i2c_response_status),
+        .response_detail(i2c_response_detail), .snapshot_length(i2c_snapshot_length),
+        .snapshot_data(8'd0), .sda_drive_low(i2c_sda_drive_low), .busy()
+    );
+    host_i2c_register_bank u_host_i2c_bank (
+        .clk(sys_clk), .rst_n(rst_n), .write_strobe(i2c_write_strobe),
+        .write_address(i2c_write_address), .write_data(i2c_write_data),
+        .command_strobe(i2c_command_strobe), .command_data(i2c_command_data),
+        .read_address(i2c_read_address), .read_data(i2c_read_data),
+        .response_valid(i2c_response_valid), .response_ok(i2c_response_ok),
+        .response_command(i2c_response_command), .response_status(i2c_response_status),
+        .response_detail(i2c_response_detail), .snapshot_length(i2c_snapshot_length),
+        .snapshot_data(8'd0), .manual_wr_en(i2c_manual_wr_en),
+        .manual_wr_addr(i2c_manual_wr_addr), .manual_wr_data(i2c_manual_wr_data),
+        .manual_commit(i2c_manual_commit), .manual_commit_done(manual_commit_done),
+        .manual_commit_ok(manual_commit_ok), .hard_protect(hard_protect),
+        .manual_active(manual_mode), .watchdog_active(watchdog_active),
+        .bmc_valid(&bmc_valid_mask), .bmc_stale(bmc_stale), .snapshot_valid(snapshot_locked)
+    );
     assign frame_tx_payload_data = (tx_frame_type == `FB_RSP_ACK_NACK) ?
         ack_payload_data : snapshot_payload_data;
     frame_tx #(.PAYLOAD_IDX_BITS(8), .EXTERNAL_CRC(1), .PAYLOAD_READ_LATENCY(1)) u_frame_tx (
@@ -287,8 +334,10 @@ module prod2u_6400_v1_top #(
 
     thermal_control_core #(.FAN_SAFE_DUTY(FAN_STANDBY_DUTY)) u_control (
         .clk(sys_clk), .rst_n(rst_n), .tick_1s(tick_1s),
-        .manual_wr_en(manual_wr_en), .manual_wr_addr(manual_wr_addr),
-        .manual_wr_data(manual_wr_data), .manual_commit(manual_commit),
+        .manual_wr_en(manual_wr_en | i2c_manual_wr_en),
+        .manual_wr_addr(i2c_manual_wr_en ? i2c_manual_wr_addr : manual_wr_addr),
+        .manual_wr_data(i2c_manual_wr_en ? i2c_manual_wr_data : manual_wr_data),
+        .manual_commit(manual_commit | i2c_manual_commit),
         .manual_commit_done(manual_commit_done), .manual_commit_ok(manual_commit_ok),
         .bmc_epoch(bmc_epoch), .bmc_stale(bmc_stale), .bmc_valid_mask(bmc_valid_mask),
         .bmc_rd_index(bmc_control_index), .bmc_rd_raw(bmc_control_raw),
@@ -343,7 +392,8 @@ module prod2u_6400_v1_top #(
         bmc_poll_count, bmc_snapshot_commit, ct_snapshot_commit, ct_i2c_busy, ct_control_raw,
         ct_control_valid, bmc_snapshot_valid, ct_snapshot_valid, output_commit,
         pwm_boundary, pwm_boundary_advance, pwm_phase, pwm_scan_idle, host_crc_request_conflict,
-        boot_init_complete, watchdog_active, watchdog_remaining, manual_mode, hard_protect};
+        boot_init_complete, watchdog_active, watchdog_remaining, manual_mode, hard_protect,
+        i2c_response_valid, i2c_response_ok, i2c_response_status};
 
 `ifdef FORMAL
     always @(posedge sys_clk) begin

+ 110 - 0
src/transport/host_i2c_register_bank.v

@@ -0,0 +1,110 @@
+`timescale 1ns/1ps
+
+// 16-bit register bank for the Host-I2C frontend. Application semantics are
+// reported through the response registers; bus ACK is handled by the slave.
+module host_i2c_register_bank (
+    input  wire       clk,
+    input  wire       rst_n,
+    input  wire       write_strobe,
+    input  wire [15:0] write_address,
+    input  wire [7:0] write_data,
+    input  wire       command_strobe,
+    input  wire [7:0] command_data,
+    input  wire [15:0] read_address,
+    output reg [7:0]  read_data,
+    output reg        response_valid,
+    output reg [7:0]  response_ok,
+    output reg [7:0]  response_command,
+    output reg [7:0]  response_status,
+    output reg [7:0]  response_detail,
+    output reg [15:0] snapshot_length,
+    input  wire [7:0] snapshot_data,
+    output reg        manual_wr_en,
+    output reg [4:0]  manual_wr_addr,
+    output reg [7:0]  manual_wr_data,
+    output reg        manual_commit,
+    input  wire       manual_commit_done,
+    input  wire       manual_commit_ok,
+    input  wire        hard_protect,
+    input  wire        manual_active,
+    input  wire        watchdog_active,
+    input  wire        bmc_valid,
+    input  wire        bmc_stale,
+    input  wire        snapshot_valid
+);
+    reg [7:0] staging [0:31];
+    reg [31:0] written_mask;
+    reg pending_commit;
+    reg [7:0] pending_command;
+    reg [15:0] snapshot_base;
+    integer i;
+
+    always @* begin
+        read_data = 8'd0;
+        if (read_address >= 16'h0100 && read_address <= 16'h011F)
+            read_data = staging[read_address[4:0]];
+        else if (read_address == 16'h0000)
+            read_data = {snapshot_valid, hard_protect, bmc_stale, bmc_valid, watchdog_active, manual_active, response_valid, pending_commit};
+        else if (read_address == 16'h0001) read_data = response_ok;
+        else if (read_address == 16'h0002) read_data = response_command;
+        else if (read_address == 16'h0003) read_data = response_status;
+        else if (read_address == 16'h0004) read_data = response_detail;
+        else if (read_address == 16'h0005) read_data = 8'd0;
+        else if (read_address == 16'h0006) read_data = written_mask[7:0];
+        else if (read_address == 16'h0007) read_data = snapshot_length[7:0];
+        else if (read_address == 16'h0008) read_data = snapshot_length[15:8];
+        else if (read_address >= 16'h0200 && read_address <= 16'h02FF)
+            read_data = snapshot_data;
+    end
+
+    always @(posedge clk or negedge rst_n) begin
+        if (!rst_n) begin
+            written_mask <= 0; pending_commit <= 0; pending_command <= 0;
+            response_valid <= 0; response_ok <= 0; response_command <= 0;
+            response_status <= 0; response_detail <= 0; snapshot_length <= 0;
+            snapshot_base <= 0; manual_wr_en <= 0; manual_wr_addr <= 0;
+            manual_wr_data <= 0; manual_commit <= 0;
+            for (i = 0; i < 32; i = i + 1) staging[i] <= 0;
+        end else begin
+            manual_wr_en <= 0;
+            manual_commit <= 0;
+            if (write_strobe && write_address >= 16'h0100 && write_address <= 16'h011F) begin
+                staging[write_address[4:0]] <= write_data;
+                if (write_data <= 100) begin
+                    written_mask[write_address[4:0]] <= 1'b1;
+                    manual_wr_en <= 1;
+                    manual_wr_addr <= write_address[4:0];
+                    manual_wr_data <= write_data;
+                end
+            end
+            if (command_strobe) begin
+                response_valid <= 0;
+                response_command <= command_data;
+                pending_command <= command_data;
+                if (command_data == 8'h01) begin
+                    if (hard_protect) begin
+                        response_ok <= 0; response_status <= 4; response_detail <= 0;
+                    end else if (written_mask != 32'hFFFFFFFF) begin
+                        response_ok <= 0; response_status <= 2; response_detail <= 0;
+                    end else begin
+                        pending_commit <= 1; manual_commit <= 1;
+                    end
+                end else if (command_data == 8'h02) begin
+                    response_ok <= 1; response_status <= 0; response_detail <= 0;
+                    response_valid <= 1; snapshot_length <= 16'd201;
+                end else begin
+                    response_ok <= 0; response_status <= 1; response_detail <= 0;
+                    response_valid <= 1;
+                end
+            end
+            if (pending_commit && manual_commit_done) begin
+                pending_commit <= 0;
+                response_ok <= manual_commit_ok ? 1 : 0;
+                response_status <= manual_commit_ok ? 0 : 4;
+                response_detail <= 0;
+                response_valid <= 1;
+                if (manual_commit_ok) written_mask <= 0;
+            end
+        end
+    end
+endmodule

+ 167 - 0
src/transport/host_i2c_register_slave.v

@@ -0,0 +1,167 @@
+`timescale 1ns/1ps
+
+// Synchronous 7-bit I2C slave. SCL is sampled by the 25 MHz system clock;
+// SDA is open-drain (low or Hi-Z only). No derived clock or clock stretching.
+module host_i2c_register_slave #(
+    parameter [6:0] SLAVE_ADDRESS = 7'h2A
+) (
+    input  wire       clk,
+    input  wire       rst_n,
+    input  wire       scl_i,
+    inout  wire       sda_io,
+    output reg        write_strobe,
+    output reg [15:0] write_address,
+    output reg [7:0]  write_data,
+    output reg        command_strobe,
+    output reg [7:0]  command_data,
+    output reg [15:0] read_address,
+    input  wire [7:0] read_data,
+    input  wire        response_valid,
+    input  wire [7:0]  response_ok,
+    input  wire [7:0]  response_command,
+    input  wire [7:0]  response_status,
+    input  wire [7:0]  response_detail,
+    input  wire [15:0] snapshot_length,
+    input  wire [7:0]  snapshot_data,
+    output wire       sda_drive_low,
+    output wire       busy
+);
+    reg scl_m, scl_s, scl_d;
+    reg sda_m, sda_s, sda_d;
+    wire scl_rise = scl_s && !scl_d;
+    wire scl_fall = !scl_s && scl_d;
+    wire start_cond = sda_d && !sda_s && scl_s;
+    wire stop_cond = !sda_d && sda_s && scl_s;
+
+    localparam [3:0] ST_IDLE = 0, ST_ADDR = 1, ST_ADDR_ACK = 2,
+        ST_REG_H = 3, ST_REG_H_ACK = 4, ST_REG_L = 5, ST_REG_L_ACK = 6,
+        ST_WRITE = 7, ST_WRITE_ACK = 8, ST_READ = 9, ST_READ_ACK = 10;
+    reg [3:0] state;
+    reg [7:0] shift;
+    reg [3:0] bit_count;
+    reg [6:0] address_seen;
+    reg rw_seen;
+    reg [15:0] reg_ptr;
+    reg [7:0] tx_byte;
+    reg [3:0] tx_bit;
+    reg drive_low;
+    reg read_phase;
+
+    assign sda_drive_low = drive_low;
+    assign sda_io = drive_low ? 1'b0 : 1'bz;
+    assign busy = state != ST_IDLE;
+
+    always @(posedge clk or negedge rst_n) begin
+        if (!rst_n) begin
+            scl_m <= 1'b1; scl_s <= 1'b1; scl_d <= 1'b1;
+            sda_m <= 1'b1; sda_s <= 1'b1; sda_d <= 1'b1;
+            state <= ST_IDLE; shift <= 0; bit_count <= 0;
+            address_seen <= 0; rw_seen <= 0; reg_ptr <= 0;
+            tx_byte <= 0; tx_bit <= 0; drive_low <= 0; read_phase <= 0;
+            write_strobe <= 0; write_address <= 0; write_data <= 0;
+            command_strobe <= 0; command_data <= 0; read_address <= 0;
+        end else begin
+            scl_m <= scl_i; scl_s <= scl_m; scl_d <= scl_s;
+            sda_m <= sda_io; sda_s <= sda_m; sda_d <= sda_s;
+            write_strobe <= 1'b0;
+            command_strobe <= 1'b0;
+
+            if (start_cond) begin
+                state <= ST_ADDR; bit_count <= 0; shift <= 0; drive_low <= 0;
+            end else if (stop_cond) begin
+                state <= ST_IDLE; bit_count <= 0; drive_low <= 0;
+            end else begin
+                case (state)
+                    ST_IDLE: begin drive_low <= 0; end
+                    ST_ADDR: begin
+                        if (scl_rise) begin
+                            shift <= {shift[6:0], sda_s};
+                            if (bit_count == 7) begin
+                                address_seen <= shift[7:1];
+                                rw_seen <= shift[0];
+                                drive_low <= (shift[7:1] == SLAVE_ADDRESS);
+                                state <= ST_ADDR_ACK;
+                                bit_count <= 0;
+                            end else bit_count <= bit_count + 1'b1;
+                        end
+                    end
+                    ST_ADDR_ACK: begin
+                        if (scl_fall) begin
+                            drive_low <= 0;
+                            if (address_seen != SLAVE_ADDRESS) state <= ST_IDLE;
+                            else if (rw_seen) begin
+                                read_phase <= 1'b1; tx_bit <= 0; tx_byte <= read_data;
+                                read_address <= reg_ptr; state <= ST_READ;
+                            end else begin
+                                read_phase <= 1'b0; state <= ST_REG_H;
+                            end
+                        end
+                    end
+                    ST_REG_H: begin
+                        if (scl_rise) begin
+                            shift <= {shift[6:0], sda_s};
+                            if (bit_count == 7) begin
+                                reg_ptr[15:8] <= {shift[6:0], sda_s};
+                                bit_count <= 0; drive_low <= 1; state <= ST_REG_H_ACK;
+                            end else bit_count <= bit_count + 1'b1;
+                        end
+                    end
+                    ST_REG_H_ACK: begin
+                        if (scl_fall) begin drive_low <= 0; state <= ST_REG_L; end
+                    end
+                    ST_REG_L: begin
+                        if (scl_rise) begin
+                            shift <= {shift[6:0], sda_s};
+                            if (bit_count == 7) begin
+                                reg_ptr[7:0] <= {shift[6:0], sda_s};
+                                bit_count <= 0; drive_low <= 1; state <= ST_REG_L_ACK;
+                            end else bit_count <= bit_count + 1'b1;
+                        end
+                    end
+                    ST_REG_L_ACK: begin
+                        if (scl_fall) begin drive_low <= 0; state <= ST_WRITE; end
+                    end
+                    ST_WRITE: begin
+                        if (scl_rise) begin
+                            shift <= {shift[6:0], sda_s};
+                            if (bit_count == 7) begin
+                                write_address <= reg_ptr;
+                                write_data <= {shift[6:0], sda_s};
+                                write_strobe <= 1'b1;
+                                if (reg_ptr == 16'h0010) begin
+                                    command_data <= {shift[6:0], sda_s};
+                                    command_strobe <= 1'b1;
+                                end
+                                reg_ptr <= reg_ptr + 1'b1;
+                                bit_count <= 0; drive_low <= 1; state <= ST_WRITE_ACK;
+                            end else bit_count <= bit_count + 1'b1;
+                        end
+                    end
+                    ST_WRITE_ACK: begin
+                        if (scl_fall) begin drive_low <= 0; state <= ST_WRITE; end
+                    end
+                    ST_READ: begin
+                        if (scl_fall) begin
+                            drive_low <= !tx_byte[7-tx_bit];
+                        end else if (scl_rise) begin
+                            if (tx_bit == 7) begin
+                                drive_low <= 0; state <= ST_READ_ACK; tx_bit <= 0;
+                            end else tx_bit <= tx_bit + 1'b1;
+                        end
+                    end
+                    ST_READ_ACK: begin
+                        if (scl_rise) begin
+                            if (!sda_s) begin
+                                reg_ptr <= reg_ptr + 1'b1;
+                                read_address <= reg_ptr + 1'b1;
+                                tx_byte <= snapshot_data;
+                                state <= ST_READ;
+                            end else begin drive_low <= 0; state <= ST_IDLE; end
+                        end
+                    end
+                    default: begin state <= ST_IDLE; drive_low <= 0; end
+                endcase
+            end
+        end
+    end
+endmodule

Plik diff jest za duży
+ 100008 - 0
tools/board-viewer/generated-v1_1/board-data.json