Files
retroSoC/rtl/mini/formal/apu_p9_formal_props.sv
T
maksyuki 3ac9e73ab9 feat: refactor tests for mailbox and environment validation
- Updated mailbox purpose tests to reflect new write order and sequence handling.
- Added tests to ensure Linux-ready values match LP contract and constants match Linux helper.
- Introduced tests to verify that offset changes do not hide stale Linux helpers.
- Enhanced environment tests to report current locked launcher and runtime versions.
- Added checks for SBT launcher presence in environment labels.
- Improved full diagram tests to validate storage geometry and RSA vector configurations.
- Expanded register tests to ensure crypto interrupt registers publish all events and lifecycle annotations preserve security boundaries.
- Modified script tools tests to include Vexii generation validation and updated workflow assertions.
2026-09-30 10:51:04 +08:00

54 lines
1.6 KiB
Systemverilog

// Copyright (c) 2026 Yuchi Miao <miaoyuchi@ict.ac.cn>
// SPDX-License-Identifier: MulanPSL-2.0
module apu_p9_formal;
(* anyseq *) (* gclk *)reg clk_i;
wire rst_n_i;
wire f_past_valid;
wire busy;
wire valid;
wire lock;
wire [31:0] actual_crc;
wire [63:0] coefficient_id;
wire [31:0] status;
wire [ 5:0] error_code;
wire done;
wire abort_done;
wire dma_request_valid;
wire [31:0] dma_request_address;
wire [31:0] dma_request_bytes;
wire store_active;
wire store_req;
wire store_write;
wire [13:0] store_addr;
apu_p9_formal_design u_design (.*);
always @(posedge clk_i) begin
if (rst_n_i) begin
assert (valid == lock);
assert (!(done && abort_done));
assert (!store_req || store_active);
assert (!store_req || (store_addr < 14'd15360));
if (store_write) assert (store_active && busy);
if (valid) begin
assert (actual_crc == 32'h25e7_c27d);
assert (coefficient_id == 64'h806c_780d_8a0b_038d);
assert (status[2:1] == 2'b11);
end
if (done && valid) assert (!busy);
if (done && (error_code != 6'd0)) begin
assert (!valid);
assert (!lock);
end
if (dma_request_valid) begin
assert (busy);
assert ((dma_request_address == 32'h1000_0000) || (dma_request_address == 32'h1000_0040));
assert ((dma_request_bytes == 32'd64) || (dma_request_bytes == 32'd61440));
end
end
cover (rst_n_i && dma_request_valid);
cover (rst_n_i && abort_done && !done);
end
endmodule