Parcourir la source

add active manual Host-I2C formal harness

高宇轩 il y a 3 mois
Parent
commit
04f9998294

+ 15 - 151
tests/formal/6400-properties.json

@@ -1,7 +1,7 @@
 {
 {
-  "schema": "prod2u-6400-formal-properties-v2",
+  "schema": "prod2u-6400-manual-formal-properties-v1",
   "product": "6400-front-rear",
   "product": "6400-front-rear",
-  "phase": "long-affected",
+  "phase": "manual-long",
   "required_solvers": ["per-target-solver-map"],
   "required_solvers": ["per-target-solver-map"],
   "proof_targets": [
   "proof_targets": [
     {
     {
@@ -12,166 +12,30 @@
       "depth": 2
       "depth": 2
     },
     },
     {
     {
-      "name": "core_owner",
-      "sby": "6400_core_owner_properties.sby",
-      "tasks": ["boolector"],
-      "mode": "prove",
-      "depth": 90
-    },
-    {
-      "name": "core_transitions",
-      "sby": "6400_core_transition_properties.sby",
-      "tasks": ["boolector"],
-      "mode": "bmc",
-      "depth": 90
-    },
-    {
-      "name": "snapshot_lock",
-      "sby": "6400_snapshot_properties.sby",
-      "tasks": ["boolector"],
-      "mode": "prove",
-      "depth": 4
-    },
-    {
-      "name": "bmc_bank",
-      "sby": "6400_bmc_bank_properties.sby",
+      "name": "host_i2c",
+      "sby": "6400_host_i2c_properties.sby",
       "tasks": ["boolector"],
       "tasks": ["boolector"],
       "mode": "prove",
       "mode": "prove",
       "depth": 8
       "depth": 8
-    },
-    {
-      "name": "reset_pwm",
-      "sby": "6400_pwm_properties.sby",
-      "tasks": ["boolector", "z3"],
-      "mode": "prove",
-      "depth": 12
-    },
-    {
-      "name": "host_command_short",
-      "sby": "6400_host_command_properties.sby",
-      "tasks": ["boolector", "z3"],
-      "mode": "bmc",
-      "depth": 16
-    },
-    {
-      "name": "set_all_commit",
-      "sby": "6400_set_all_commit_properties.sby",
-      "tasks": ["boolector", "z3"],
-      "mode": "bmc",
-      "depth": 76
-    },
-    {
-      "name": "frame_rx_crc",
-      "sby": "6400_frame_rx_properties.sby",
-      "tasks": ["boolector", "z3"],
-      "mode": "prove",
-      "depth": 24
-    },
-    {
-      "name": "snapshot_transport",
-      "sby": "6400_snapshot_transport_properties.sby",
-      "tasks": ["boolector"],
-      "mode": "bmc",
-      "depth": 48
     }
     }
   ],
   ],
   "cover_targets": [],
   "cover_targets": [],
   "properties": [
   "properties": [
     {
     {
-      "id": "QF01",
-      "requirement": "FAN_BOARD_INVERT_MASK is 0x0F: Front connector requests invert once at FPGA balls and Rear requests remain direct",
+      "id": "MANUAL-FAN-POLARITY",
+      "requirement": "Front connector duty is inverted once at FPGA output and Rear connector duty remains direct",
       "harness": "6400_board_adapter_properties.sby"
       "harness": "6400_board_adapter_properties.sby"
     },
     },
     {
     {
-      "id": "LF01",
-      "requirement": "Control state is always SAFE or MANUAL and watchdog activity matches ownership",
-      "harness": "6400_core_owner_properties.sby"
-    },
-    {
-      "id": "LF02",
-      "requirement": "Successful manual commit ACK state is atomic with MANUAL owner, watchdog reload, and output bank commit",
-      "harness": "6400_core_owner_properties.sby"
-    },
-    {
-      "id": "LF03",
-      "requirement": "Every output commit flips exactly one bank and increments control epoch",
-      "harness": "6400_core_owner_properties.sby"
-    },
-    {
-      "id": "LF04",
-      "requirement": "Snapshot bank and epoch lock remain stable until explicit unlock",
-      "harness": "6400_snapshot_properties.sby"
-    },
-    {
-      "id": "LF05",
-      "requirement": "BMC snapshot publication is bank-atomic and epoch-bound",
-      "harness": "6400_bmc_bank_properties.sby"
-    },
-    {
-      "id": "LF06",
-      "requirement": "Control reset keeps PTC zero and connector fans at exactly 20 percent while the carrier advances",
-      "harness": "6400_pwm_properties.sby"
-    },
-    {
-      "id": "LF07",
-      "requirement": "Unknown and oversized complete requests produce unified UNSUPPORTED or BAD_LENGTH ACK_NACK",
-      "harness": "6400_host_command_properties.sby"
-    },
-    {
-      "id": "LF08",
-      "requirement": "GET emits ACK before SNAPSHOT_DATA and completes only after both transmissions",
-      "harness": "6400_host_command_properties.sby"
-    },
-    {
-      "id": "LF09",
-      "requirement": "Legal SET_ALL performs validation and writes before commit and starts OK ACK only after commit completion",
-      "harness": "6400_set_all_commit_properties.sby"
-    },
-    {
-      "id": "LF10",
-      "requirement": "SET_ALL acceptance dominates the simultaneous final watchdog tick",
-      "harness": "6400_core_transition_properties.sby"
-    },
-    {
-      "id": "LF11",
-      "requirement": "MANUAL remains available without BMC or when BMC is stale; stale BMC never overrides manual output",
-      "harness": "6400_core_transition_properties.sby"
-    },
-    {
-      "id": "LF12",
-      "requirement": "No automatic controller state or coefficient writes exist in the active design",
-      "harness": "6400_core_transition_properties.sby"
-    },
-    {
-      "id": "LF13",
-      "requirement": "A new hard lock cancels an in-flight Manual commit before output apply",
-      "harness": "6400_core_transition_properties.sby"
-    },
-    {
-      "id": "LF14",
-      "requirement": "A hard lane releases only on a complete valid cool epoch after its release counter qualifies",
-      "harness": "6400_core_transition_properties.sby"
-    },
-    {
-      "id": "LF15",
-      "requirement": "Wrong CRC cannot produce a command-visible frame",
-      "harness": "6400_frame_rx_properties.sby"
-    },
-    {
-      "id": "LF16",
-      "requirement": "A complete oversized frame remains bounded by the streaming receive cursor",
-      "harness": "6400_frame_rx_properties.sby"
-    },
-    {
-      "id": "LF17",
-      "requirement": "GET keeps snapshot and selected Host port locked through ACK and DATA completion",
-      "harness": "6400_snapshot_transport_properties.sby"
-    },
-    {
-      "id": "LF18",
-      "requirement": "GET transaction_done occurs only after SNAPSHOT_DATA tx_done",
-      "harness": "6400_snapshot_transport_properties.sby"
+      "id": "MANUAL-I2C-SDA-OPEN-DRAIN",
+      "requirement": "Host-I2C SDA never actively drives a logic high",
+      "harness": "6400_host_i2c_properties.sby"
     }
     }
   ],
   ],
-  "deferred_long_targets": []
+  "deferred_long_targets": [
+    "reset_safe_outputs",
+    "watchdog_timeout_safe_transition",
+    "uart_i2c_semantic_equivalence",
+    "hard_safety_override"
+  ]
 }
 }

+ 18 - 0
tests/formal/6400_host_i2c_properties.sby

@@ -0,0 +1,18 @@
+[tasks]
+boolector
+
+[options]
+mode prove
+depth 8
+
+[engines]
+boolector: smtbmc boolector
+
+[script]
+read_verilog -formal ../../src/transport/host_i2c_register_slave.v
+read_verilog -formal 6400_host_i2c_properties_formal.v
+prep -top host_i2c_properties_formal
+
+[files]
+../../src/transport/host_i2c_register_slave.v
+6400_host_i2c_properties_formal.v

+ 25 - 0
tests/formal/6400_host_i2c_properties_formal.v

@@ -0,0 +1,25 @@
+module host_i2c_properties_formal;
+    reg clk = 1'b0;
+    always #1 clk = ~clk;
+    reg rst_n = 1'b0;
+    reg scl_i = 1'b1;
+    (* anyconst *) reg external_low;
+    tri sda_io;
+    assign sda_io = external_low ? 1'b0 : 1'bz;
+    wire sda_drive_low;
+    wire [15:0] read_address;
+    wire [7:0] read_data = 8'h00;
+    host_i2c_register_slave dut (
+      .clk(clk), .rst_n(rst_n), .scl_i(scl_i), .sda_io(sda_io),
+      .write_strobe(), .write_address(), .write_data(),
+      .command_strobe(), .command_data(), .read_address(read_address),
+      .read_data(read_data), .response_valid(1'b0), .response_ok(8'h00),
+      .response_command(8'h00), .response_status(8'h00), .response_detail(8'h00),
+      .snapshot_length(16'h0000), .snapshot_data(8'h00),
+      .sda_drive_low(sda_drive_low), .busy()
+    );
+    always @* begin
+      assert(sda_drive_low == 1'b0 || sda_drive_low == 1'b1);
+      if (!sda_drive_low) assert(sda_io !== 1'b0 || external_low);
+    end
+endmodule