|
@@ -3,6 +3,7 @@
|
|
|
module thermal_6400_core_owner_properties_formal(input wire clk);
|
|
module thermal_6400_core_owner_properties_formal(input wire clk);
|
|
|
reg rst_n = 0;
|
|
reg rst_n = 0;
|
|
|
reg [1:0] reset_count = 0;
|
|
reg [1:0] reset_count = 0;
|
|
|
|
|
+ reg formal_past_valid = 0;
|
|
|
(* anyseq *) reg tick_1s;
|
|
(* anyseq *) reg tick_1s;
|
|
|
(* anyseq *) reg manual_wr_en;
|
|
(* anyseq *) reg manual_wr_en;
|
|
|
(* anyseq *) reg [4:0] manual_wr_addr;
|
|
(* anyseq *) reg [4:0] manual_wr_addr;
|
|
@@ -29,6 +30,12 @@ module thermal_6400_core_owner_properties_formal(input wire clk);
|
|
|
wire global_fault, output_commit, watchdog_active, pid_running;
|
|
wire global_fault, output_commit, watchdog_active, pid_running;
|
|
|
wire manual_mode, hard_protect, boot_init_complete;
|
|
wire manual_mode, hard_protect, boot_init_complete;
|
|
|
wire [7:0] watchdog_remaining;
|
|
wire [7:0] watchdog_remaining;
|
|
|
|
|
+ wire [3:0] formal_work_state;
|
|
|
|
|
+ wire [1:0] formal_commit_kind;
|
|
|
|
|
+ wire formal_manual_commit_applied, formal_manual_pending, formal_safe_pending;
|
|
|
|
|
+ wire formal_stale_hold_committed, formal_pi_state_write;
|
|
|
|
|
+ wire formal_complete_valid_bmc;
|
|
|
|
|
+ wire [3:0] formal_epoch_above_release_mask;
|
|
|
|
|
|
|
|
thermal_control_core #(.WATCHDOG_TICKS_OVERRIDE(3)) dut (
|
|
thermal_control_core #(.WATCHDOG_TICKS_OVERRIDE(3)) dut (
|
|
|
.clk(clk), .rst_n(rst_n), .tick_1s(tick_1s),
|
|
.clk(clk), .rst_n(rst_n), .tick_1s(tick_1s),
|
|
@@ -51,10 +58,20 @@ module thermal_6400_core_owner_properties_formal(input wire clk);
|
|
|
.watchdog_active(watchdog_active), .watchdog_remaining(watchdog_remaining),
|
|
.watchdog_active(watchdog_active), .watchdog_remaining(watchdog_remaining),
|
|
|
.pid_running(pid_running), .manual_mode(manual_mode), .hard_protect(hard_protect),
|
|
.pid_running(pid_running), .manual_mode(manual_mode), .hard_protect(hard_protect),
|
|
|
.pwm_phase_boundary(1'b1), .pwm_scan_idle(1'b1),
|
|
.pwm_phase_boundary(1'b1), .pwm_scan_idle(1'b1),
|
|
|
- .boot_init_complete(boot_init_complete)
|
|
|
|
|
|
|
+ .boot_init_complete(boot_init_complete),
|
|
|
|
|
+ .formal_work_state_o(formal_work_state),
|
|
|
|
|
+ .formal_commit_kind_o(formal_commit_kind),
|
|
|
|
|
+ .formal_manual_commit_applied_o(formal_manual_commit_applied),
|
|
|
|
|
+ .formal_manual_pending_o(formal_manual_pending),
|
|
|
|
|
+ .formal_safe_pending_o(formal_safe_pending),
|
|
|
|
|
+ .formal_stale_hold_committed_o(formal_stale_hold_committed),
|
|
|
|
|
+ .formal_pi_state_write_o(formal_pi_state_write),
|
|
|
|
|
+ .formal_complete_valid_bmc_o(formal_complete_valid_bmc),
|
|
|
|
|
+ .formal_epoch_above_release_mask_o(formal_epoch_above_release_mask)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
always @(posedge clk) begin
|
|
always @(posedge clk) begin
|
|
|
|
|
+ formal_past_valid <= 1;
|
|
|
if (reset_count < 2) begin
|
|
if (reset_count < 2) begin
|
|
|
rst_n <= 0;
|
|
rst_n <= 0;
|
|
|
reset_count <= reset_count + 1'b1;
|
|
reset_count <= reset_count + 1'b1;
|
|
@@ -87,6 +104,47 @@ module thermal_6400_core_owner_properties_formal(input wire clk);
|
|
|
assert(active_output_bank != $past(active_output_bank));
|
|
assert(active_output_bank != $past(active_output_bank));
|
|
|
assert(control_epoch == $past(control_epoch) + 1'b1);
|
|
assert(control_epoch == $past(control_epoch) + 1'b1);
|
|
|
end
|
|
end
|
|
|
|
|
+ if (formal_past_valid && $past(rst_n)) begin
|
|
|
|
|
+ // SET_ALL staging suppresses a simultaneous final timeout, but
|
|
|
|
|
+ // does not feed the watchdog before the safe output commit.
|
|
|
|
|
+ if ($past(formal_manual_commit_applied && tick_1s &&
|
|
|
|
|
+ watchdog_remaining == 1)) begin
|
|
|
|
|
+ assert(watchdog_remaining == 1 ||
|
|
|
|
|
+ (watchdog_remaining == 3 && manual_commit_done &&
|
|
|
|
|
+ manual_commit_ok && output_commit));
|
|
|
|
|
+ end
|
|
|
|
|
+ // Persistent PID stale hold cannot churn the output bank/epoch.
|
|
|
|
|
+ if ($past(control_state == `FB_OWNER_PID && bmc_stale &&
|
|
|
|
|
+ formal_stale_hold_committed && formal_work_state == 1)) begin
|
|
|
|
|
+ assert(!output_commit);
|
|
|
|
|
+ assert(control_epoch == $past(control_epoch));
|
|
|
|
|
+ assert(active_output_bank == $past(active_output_bank));
|
|
|
|
|
+ end
|
|
|
|
|
+ // MANUAL is not displaced merely because BMC is stale.
|
|
|
|
|
+ if ($past(control_state == `FB_OWNER_MANUAL && bmc_stale &&
|
|
|
|
|
+ !tick_1s && !formal_safe_pending && !formal_manual_pending &&
|
|
|
|
|
+ formal_work_state == 1))
|
|
|
|
|
+ assert(control_state == `FB_OWNER_MANUAL);
|
|
|
|
|
+ // PI BRAM writes occur only in init/safe-clear/PID-update states.
|
|
|
|
|
+ if (formal_pi_state_write)
|
|
|
|
|
+ assert($past(formal_work_state) == 0 ||
|
|
|
|
|
+ $past(formal_work_state) == 4 ||
|
|
|
|
|
+ $past(formal_work_state) == 8);
|
|
|
|
|
+ // A hard lock at the final Manual boundary cancels the vector.
|
|
|
|
|
+ if ($past(formal_work_state == 9 && formal_commit_kind == 1 &&
|
|
|
|
|
+ hard_protect)) begin
|
|
|
|
|
+ assert(manual_commit_done);
|
|
|
|
|
+ assert(!manual_commit_ok);
|
|
|
|
|
+ assert(!output_commit);
|
|
|
|
|
+ assert(control_state != `FB_OWNER_MANUAL);
|
|
|
|
|
+ end
|
|
|
|
|
+ // A lane latch may clear only after the third complete cool epoch.
|
|
|
|
|
+ if (($past(lane_fault_mask) & ~lane_fault_mask) != 0) begin
|
|
|
|
|
+ assert($past(formal_complete_valid_bmc));
|
|
|
|
|
+ assert(($past(formal_epoch_above_release_mask) &
|
|
|
|
|
+ ($past(lane_fault_mask) & ~lane_fault_mask)) == 0);
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
endmodule
|
|
endmodule
|