|
@@ -0,0 +1,92 @@
|
|
|
|
|
+`include "generated/6400/prod2u_6400_v1_params.vh"
|
|
|
|
|
+
|
|
|
|
|
+module thermal_6400_core_owner_properties_formal(input wire clk);
|
|
|
|
|
+ reg rst_n = 0;
|
|
|
|
|
+ reg [1:0] reset_count = 0;
|
|
|
|
|
+ (* anyseq *) reg tick_1s;
|
|
|
|
|
+ (* anyseq *) reg manual_wr_en;
|
|
|
|
|
+ (* anyseq *) reg [4:0] manual_wr_addr;
|
|
|
|
|
+ (* anyseq *) reg [7:0] manual_wr_data;
|
|
|
|
|
+ (* anyseq *) reg manual_commit;
|
|
|
|
|
+ (* anyseq *) reg pid_target_commit;
|
|
|
|
|
+ (* anyseq *) reg [7:0] pid_target_celsius;
|
|
|
|
|
+ (* anyseq *) reg [15:0] bmc_epoch;
|
|
|
|
|
+ (* anyseq *) reg bmc_stale;
|
|
|
|
|
+ (* anyseq *) reg [23:0] bmc_valid_mask;
|
|
|
|
|
+ (* anyseq *) reg [15:0] bmc_rd_raw;
|
|
|
|
|
+ (* anyseq *) reg bmc_rd_valid;
|
|
|
|
|
+ (* anyseq *) reg snapshot_lock;
|
|
|
|
|
+
|
|
|
|
|
+ wire manual_commit_done, manual_commit_ok;
|
|
|
|
|
+ wire [4:0] bmc_rd_index;
|
|
|
|
|
+ wire [7:0] pwm_rd_data, snapshot_requested_data, snapshot_applied_data;
|
|
|
|
|
+ wire active_output_bank;
|
|
|
|
|
+ wire [2:0] control_state;
|
|
|
|
|
+ wire [7:0] current_target_celsius;
|
|
|
|
|
+ wire [15:0] control_epoch;
|
|
|
|
|
+ wire [23:0] safety_override_mask;
|
|
|
|
|
+ wire [3:0] lane_fault_mask;
|
|
|
|
|
+ wire global_fault, output_commit, watchdog_active, pid_running;
|
|
|
|
|
+ wire manual_mode, hard_protect, boot_init_complete;
|
|
|
|
|
+ wire [7:0] watchdog_remaining;
|
|
|
|
|
+
|
|
|
|
|
+ thermal_control_core #(.WATCHDOG_TICKS_OVERRIDE(3)) dut (
|
|
|
|
|
+ .clk(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_commit_done(manual_commit_done), .manual_commit_ok(manual_commit_ok),
|
|
|
|
|
+ .pid_target_commit(pid_target_commit), .pid_target_celsius(pid_target_celsius),
|
|
|
|
|
+ .bmc_epoch(bmc_epoch), .bmc_stale(bmc_stale), .bmc_valid_mask(bmc_valid_mask),
|
|
|
|
|
+ .bmc_rd_index(bmc_rd_index), .bmc_rd_raw(bmc_rd_raw), .bmc_rd_valid(bmc_rd_valid),
|
|
|
|
|
+ .ct_epoch(16'd0), .ct_stale(1'b1), .ct_valid_mask(27'd0),
|
|
|
|
|
+ .snapshot_lock(snapshot_lock), .snapshot_lock_bank(1'b0),
|
|
|
|
|
+ .pwm_rd_addr(5'd0), .pwm_rd_data(pwm_rd_data),
|
|
|
|
|
+ .snapshot_output_bank(1'b0), .snapshot_rd_addr(5'd0),
|
|
|
|
|
+ .snapshot_requested_data(snapshot_requested_data),
|
|
|
|
|
+ .snapshot_applied_data(snapshot_applied_data),
|
|
|
|
|
+ .active_output_bank(active_output_bank), .control_state(control_state),
|
|
|
|
|
+ .current_target_celsius(current_target_celsius), .control_epoch(control_epoch),
|
|
|
|
|
+ .safety_override_mask(safety_override_mask), .lane_fault_mask(lane_fault_mask),
|
|
|
|
|
+ .global_fault(global_fault), .output_commit(output_commit),
|
|
|
|
|
+ .watchdog_active(watchdog_active), .watchdog_remaining(watchdog_remaining),
|
|
|
|
|
+ .pid_running(pid_running), .manual_mode(manual_mode), .hard_protect(hard_protect),
|
|
|
|
|
+ .pwm_phase_boundary(1'b1), .pwm_scan_idle(1'b1),
|
|
|
|
|
+ .boot_init_complete(boot_init_complete)
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ always @(posedge clk) begin
|
|
|
|
|
+ if (reset_count < 2) begin
|
|
|
|
|
+ rst_n <= 0;
|
|
|
|
|
+ reset_count <= reset_count + 1'b1;
|
|
|
|
|
+ end else rst_n <= 1;
|
|
|
|
|
+
|
|
|
|
|
+ assume(manual_wr_addr < 32);
|
|
|
|
|
+ assume(manual_wr_data <= 100);
|
|
|
|
|
+ if (pid_target_commit) assume(pid_target_celsius >= 20 && pid_target_celsius <= 70);
|
|
|
|
|
+ if (!boot_init_complete) begin
|
|
|
|
|
+ assume(!manual_commit);
|
|
|
|
|
+ assume(!tick_1s);
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ if (rst_n) begin
|
|
|
|
|
+ assert(control_state == `FB_OWNER_SAFE ||
|
|
|
|
|
+ control_state == `FB_OWNER_MANUAL || control_state == `FB_OWNER_PID);
|
|
|
|
|
+ assert(watchdog_active == (control_state != `FB_OWNER_PID));
|
|
|
|
|
+ assert(manual_mode == (control_state == `FB_OWNER_MANUAL));
|
|
|
|
|
+ assert(hard_protect == (|lane_fault_mask));
|
|
|
|
|
+ assert(current_target_celsius >= 20 && current_target_celsius <= 70);
|
|
|
|
|
+ if (manual_commit_done && manual_commit_ok) begin
|
|
|
|
|
+ assert(output_commit);
|
|
|
|
|
+ assert(control_state == `FB_OWNER_MANUAL);
|
|
|
|
|
+ assert(watchdog_remaining == 3);
|
|
|
|
|
+ assert(!hard_protect);
|
|
|
|
|
+ end
|
|
|
|
|
+ if (manual_commit_done && !manual_commit_ok)
|
|
|
|
|
+ assert(!output_commit);
|
|
|
|
|
+ if (output_commit) begin
|
|
|
|
|
+ assert(active_output_bank != $past(active_output_bank));
|
|
|
|
|
+ assert(control_epoch == $past(control_epoch) + 1'b1);
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+ end
|
|
|
|
|
+endmodule
|