|
|
@@ -0,0 +1,106 @@
|
|
|
+`include "generated/6400/prod2u_6400_v1_params.vh"
|
|
|
+
|
|
|
+module thermal_6400_snapshot_transport_properties_formal(input wire clk);
|
|
|
+ reg rst_n = 0;
|
|
|
+ reg [1:0] reset_count = 0;
|
|
|
+ reg formal_past_valid = 0;
|
|
|
+ (* anyseq *) reg frame_valid;
|
|
|
+ (* anyseq *) reg snapshot_ready;
|
|
|
+ (* anyseq *) reg tx_done;
|
|
|
+ (* anyseq *) reg rs232_rx;
|
|
|
+ (* anyseq *) reg ttl_rx;
|
|
|
+ (* anyseq *) reg shared_tx;
|
|
|
+
|
|
|
+ wire frame_ready, frame_accept_enable;
|
|
|
+ wire snapshot_capture, tx_start, transaction_done, command_busy;
|
|
|
+ wire [7:0] tx_frame_type, tx_payload_length, ack_payload_data;
|
|
|
+ wire selected_rx, rs232_tx, ttl_tx, host_locked, port_sel;
|
|
|
+ wire snapshot_locked, snapshot_mux_ready;
|
|
|
+ reg get_active = 0;
|
|
|
+ reg [1:0] get_tx_done_count = 0;
|
|
|
+ reg capture_seen = 0;
|
|
|
+
|
|
|
+ host_port_selector #(.IDLE_UNLOCK_CLKS(255)) u_select (
|
|
|
+ .clk(clk), .rst_n(rst_n), .rs232_rx_async(rs232_rx),
|
|
|
+ .ttl_rx_async(ttl_rx), .shared_tx(shared_tx),
|
|
|
+ .transaction_done(transaction_done), .selected_rx(selected_rx),
|
|
|
+ .rs232_tx(rs232_tx), .ttl_tx(ttl_tx), .locked(host_locked),
|
|
|
+ .port_sel(port_sel), .rs232_rx_sync(), .ttl_rx_sync()
|
|
|
+ );
|
|
|
+
|
|
|
+ thermal_host_command #(.SNAPSHOT_LENGTH(`FB_SNAPSHOT_LENGTH)) u_command (
|
|
|
+ .clk(clk), .rst_n(rst_n), .frame_valid(frame_valid),
|
|
|
+ .frame_ready(frame_ready), .frame_accept_enable(frame_accept_enable),
|
|
|
+ .frame_type(`FB_CMD_GET_SNAPSHOT), .frame_length(8'd0),
|
|
|
+ .payload_read_addr(), .payload_read_data(8'd0), .manual_wr_en(),
|
|
|
+ .manual_wr_addr(), .manual_wr_data(), .manual_commit(),
|
|
|
+ .manual_commit_done(1'b0), .manual_commit_ok(1'b0),
|
|
|
+ .safety_locked(1'b0), .pid_target_commit(), .pid_target_celsius(),
|
|
|
+ .snapshot_capture(snapshot_capture), .snapshot_ready(snapshot_mux_ready),
|
|
|
+ .tx_start(tx_start), .tx_frame_type(tx_frame_type),
|
|
|
+ .tx_payload_length(tx_payload_length), .tx_payload_addr(8'd0),
|
|
|
+ .ack_payload_data(ack_payload_data), .tx_done(tx_done),
|
|
|
+ .transaction_done(transaction_done), .busy(command_busy)
|
|
|
+ );
|
|
|
+
|
|
|
+ thermal_snapshot_mux u_snapshot (
|
|
|
+ .clk(clk), .rst_n(rst_n), .capture(snapshot_capture),
|
|
|
+ .ready(snapshot_mux_ready), .locked(snapshot_locked),
|
|
|
+ .bmc_active_bank(1'b0), .ct_active_bank(1'b0),
|
|
|
+ .output_active_bank(1'b0), .bmc_locked_bank(), .ct_locked_bank(),
|
|
|
+ .output_locked_bank(), .control_state(3'd0), .fault_flags(16'd0),
|
|
|
+ .current_target(8'd70), .watchdog_active(1'b1),
|
|
|
+ .watchdog_remaining(8'd30), .pid_running(1'b0),
|
|
|
+ .manual_mode(1'b0), .hard_protect(1'b0), .bmc_stale(1'b1),
|
|
|
+ .ct_stale(1'b1), .bmc_epoch(16'd0), .ct_epoch(16'd0),
|
|
|
+ .control_epoch(16'd0), .bmc_age(16'd0), .ct_age(16'd0),
|
|
|
+ .bmc_valid_mask(24'd0), .ct_valid_mask(27'd0),
|
|
|
+ .safety_override_mask(24'd0), .lane_fault_mask(4'd0),
|
|
|
+ .global_fault(1'b0), .unlock(transaction_done), .payload_addr(8'd0),
|
|
|
+ .payload_data(), .bmc_rd_index(), .bmc_rd_raw(16'd0),
|
|
|
+ .ct_rd_index(), .ct_rd_raw(16'd0), .output_rd_addr(),
|
|
|
+ .requested_data(8'd0), .applied_data(8'd0)
|
|
|
+ );
|
|
|
+
|
|
|
+ always @(posedge clk) begin
|
|
|
+ formal_past_valid <= 1;
|
|
|
+ if (reset_count < 2) begin
|
|
|
+ rst_n <= 0;
|
|
|
+ reset_count <= reset_count + 1'b1;
|
|
|
+ get_active <= 0;
|
|
|
+ get_tx_done_count <= 0;
|
|
|
+ capture_seen <= 0;
|
|
|
+ end else begin
|
|
|
+ rst_n <= 1;
|
|
|
+ if (frame_valid && frame_ready) begin
|
|
|
+ assume(host_locked);
|
|
|
+ get_active <= 1;
|
|
|
+ get_tx_done_count <= 0;
|
|
|
+ capture_seen <= 0;
|
|
|
+ end else if (get_active && tx_done && get_tx_done_count != 3)
|
|
|
+ get_tx_done_count <= get_tx_done_count + 1'b1;
|
|
|
+ if (snapshot_capture)
|
|
|
+ capture_seen <= 1;
|
|
|
+ if (transaction_done) begin
|
|
|
+ get_active <= 0;
|
|
|
+ capture_seen <= 0;
|
|
|
+ end
|
|
|
+ end
|
|
|
+ if (rst_n && formal_past_valid && $past(rst_n)) begin
|
|
|
+ if (get_active && !transaction_done) begin
|
|
|
+ assert(host_locked);
|
|
|
+ if (capture_seen)
|
|
|
+ assert(snapshot_locked);
|
|
|
+ end
|
|
|
+ if (transaction_done && get_active) begin
|
|
|
+ assert($past(tx_done));
|
|
|
+ assert(get_tx_done_count >= 2);
|
|
|
+ assert(capture_seen);
|
|
|
+ assert(snapshot_locked);
|
|
|
+ assert(host_locked);
|
|
|
+ end
|
|
|
+ if ($past(snapshot_locked && !transaction_done))
|
|
|
+ assert(snapshot_locked);
|
|
|
+ end
|
|
|
+ end
|
|
|
+endmodule
|