Complementary Checks
Temporal SVA verifies control and protocols; C reference models decompose datapath arithmetic when full-core proofs time out.
See AltOR32 / ANDI →SAVER · Research software
Turn a specification and suspect RTL into complementary formal checks, attributed counterexamples, and gated repair candidates.
Temporal SVA verifies control and protocols; C reference models decompose datapath arithmetic when full-core proofs time out.
See AltOR32 / ANDI →Traces RTL drivers and waveforms to separate RTL bugs from checker errors—fixing the assertion instead of mutating healthy RTL.
See SATA PHY →Combines target proofs, full-corpus regressions, and differential SEC against pre-patch RTL to block patches that expose hidden defects.
See PIT →Method
The specification defines expected behavior. RTL structure supplies binding and observation context; verification artifacts, attribution records, and gated repair candidates retain their scoped evidence.
Unknown bugs escape pre-existing assertions, while monolithic full-core proofs time out on datapath logic.
SAVER → Pair temporal SVA (FPV) with decomposed C reference models (C2RTL) derived from reviewed spec obligations.
Generated assertions, reference models, or bindings can be faulty; a raw CEX cannot tell which side is wrong.
SAVER → Audit RTL drivers, mux packing, and waveform windows against the spec before editing checker or RTL.
A patch can satisfy every target proof and regression check while activating an interacting bug on an output.
SAVER → Gate admission with spec-guided differential SEC against pre-patch RTL, rejecting unexpected divergences.
Specification-driven checks, failure attribution, and repair validation form an iterative loop. Final evaluation follows resolution or the iteration limit.
Review specification obligations and extract RTL metadata, binding points, and observation context without pre-supplied bug assertions.
Run temporal SVA (FPV) for control/protocol logic and validated Python/C reference models (C2RTL) for datapath arithmetic.
Trace drivers and waveform windows against the specification to separate RTL bugs from checker defects before acting.
Verify target proofs, run full-corpus regressions, and review differential SEC divergences against pre-patch RTL before admitting a candidate.
After resolution or the iteration limit, assess delivered patches in a separate held-out benchmark evaluation.
Receives only the design specification and suspect RTL—no golden reference or bug hints.
Remote benchmark operations isolate golden RTL & mutation truth solely for input qualification and final scoring.
Compares pre-patch suspect RTL against candidate RTL—never a golden oracle.
Benchmark
25 RTL designs · 13 functional categories · 125 semantic defects. The curated Lite subset retains the breadth of AssertLLM2 while excluding near-duplicate designs.
Explore the AssertLLM2 benchmarkInjected target defects exposed
Repairs passing golden-reference SEC
Correct fault targeting
Targeted patches in successful repairs
Reported design-level means over 25 designs; patch percentages are not pooled patch counts.
Benchmark contribution · 125 specification-grounded defects
Case studies
Three end-to-end cases illustrating each core pillar of SAVER—backed by verbatim specifications, RTL, assertions, C models, waveforms, and patches. Every check status is bound to its recorded version and proof scope.
Formally established by JasperGold under the recorded RTL snapshot, active clock/reset guards, and obligation assumptions.
Concrete trace witnessing a property violation or pre/post behavioral divergence. SAVER attributes every CEX before editing checker or RTL.
Solver exhausted its proof time budget without finding a counterexample or completing an unbounded proof; triggers decomposition when applicable.
On the exact same altor32_exec.v snapshot, full-core FPV exhausts its 300 s budget as U, whereas C2RTL exposes the sign- vs. zero-extension bug in 0.20 s and validates the fix across all 62 local checks.
Execute, writeback, and GPR proofs stay undetermined (~295.45 s / 300 s budget).
Same frozen altor32_exec.v fails in 0.20 s proof (5.02 s total).
int32_r vs uint32_rFor I=0x8000, alu_input_b_r = 0xFFFF8000 instead of 0x00008000.
Cumulative fix passes 62 local checks; isolated ANDI patch is FIX_CONFIRMED.
AltOR32 is a 32-bit OpenRISC processor whose immediate instructions require distinct extension semantics: l.addi, l.xori, and split store immediates sign-extend, whereas l.andi and l.ori zero-extend. The suspect execution unit already computes both 32-bit values but selects the wrong one in several instruction branches.
opcode[25:21]opcode[20:16]opcode[15:11]opcode[15:0]Widens a value to 32 bits by copying its sign bit into the upper bits.
Widens a value to 32 bits by filling the upper bits with zeros.
| Instruction | opcode[31:26] | Extension | Specified Operation |
|---|---|---|---|
l.addi rD,rA,I | 0x27 | Sign-extend | Sign-extend 16-bit immediate, add to rA, write rD (SR[CY] = carry out). |
l.andi rD,rA,K | 0x29 | Zero-extend | Zero-extend 16-bit immediate and bitwise-AND with rA. |
l.ori rD,rA,K | 0x2a | Zero-extend | Zero-extend 16-bit immediate and bitwise-OR with rA. |
l.xori rD,rA,I | 0x2b | Sign-extend | Sign-extend 16-bit immediate and bitwise-XOR with rA. |
The generated FPV checker computes the exact zero-extended l.andi expectation in source_value() and tracks a 3-stage pipeline record across execute (+1), writeback (+2), and committed GPR (+3) stages on top module cpu.
function automatic [31:0] source_value(input logic [31:0] w,a,b,input logic cy);
if (is_add(w) || is_addc(w) || is_addi(w)) source_value=source_sum(w,a,b,cy);
else if (is_sub(w)) source_value=a-b;
else if (is_and(w)) source_value=a&b;
else if (is_or(w)) source_value=a|b;
else if (is_xor(w)) source_value=a^b;
else if (is_andi(w)) source_value=a&{16'b0,w[15:0]};
else if (is_ori(w)) source_value=a|{16'b0,w[15:0]};
else if (is_xori(w)) source_value=a^sext16(w);
else if (is_movhi(w)) source_value={w[15:0],16'b0};
// P1-REF: PROP-ALU-ANDI/SUB-VALUE
ap_andi_execute: assert property (@(posedge clk_i) disable iff (rst_i)
(valid1 && is_andi(word1)) |-> (ex_rd==word1[25:21] && ((word1[25:21]==5'b0) || ex_value==value1)));
// P1-REF: PROP-ALU-ANDI/SUB-VALUE
ap_andi_writeback: assert property (@(posedge clk_i) disable iff (rst_i)
(valid2 && is_andi(word2)) |-> ((wb_write==(word2[25:21]!=5'b0)) && ((word2[25:21]==5'b0) || (wb_rd==word2[25:21] && wb_value==value2))));
// P1-REF: PROP-ALU-ANDI/SUB-VALUE
ap_andi_gpr: assert property (@(posedge clk_i) disable iff (rst_i)
(valid3 && is_andi(word3) && word3[25:21]!=5'b0) |-> (gpr_bank[{word3[25:21],5'b0} +: 32]==value3));
Recorded FPV outcome. On the original iter_00 CPU snapshot, the ANDI execute, writeback, and GPR properties, together with their witness and precondition checks, remain U.
// Full generic issue guards; no instruction-specific DUT decoder/output
// enables any source-result obligation below.
wire issue = evt_opcode_offer && !pc_fetch && !resolve_failed && !load_stall &&
!(operand_resolved && ((evt_opcode_word[31:26]==6'h2d) ||
(evt_opcode_word[31:26]==6'h30)));
wire sample_offer = issue && (opcode_pc_i[1:0]==2'b00);
// Three fixed pipeline records associate the input sample with independent
// execute output (+1), writeback bus (+2), and committed GPR storage (+3).
logic valid1,valid2,valid3;
logic [31:0] word1,word2,word3,a1,b1,value2,value3;
logic cy1;
wire [31:0] value1=source_value(word1,a1,b1,cy1);
wire [32:0] sum1=source_sum(word1,a1,b1,cy1);
wire flag1=source_flag(word1,a1,b1);
always @(posedge clk_i or posedge rst_i) begin
if(rst_i) begin
valid1<=1'b0; valid2<=1'b0; valid3<=1'b0;
word1<=32'b0; word2<=32'b0; word3<=32'b0;
a1<=32'b0; b1<=32'b0; cy1<=1'b0;
value2<=32'b0; value3<=32'b0;
end else begin
valid1<=sample_offer;
word1<=evt_opcode_word; a1<=ra_value; b1<=rb_value;
// Previous result's bypassed SR.CY is the incoming architectural carry;
// sample before the current instruction's possible exception clearing.
cy1<=next_sr[10];
valid2<=valid1; word2<=word1; value2<=value1;
valid3<=valid2; word3<=word2; value3<=value2;
end
{"execution": {"top": "cpu", "clocks": ["clk_i"], "reset": "rst_i", "runtime_reset": "unconstrained", "proof_time_limit_s": 300}}
The iter_00 FPV process completed successfully; the ANDI proof outcomes remain U.
Byte-level verification confirms that the frozen FPV execution input and the C2RTL active input share the exact same altor32_exec.v and 6 RTL dependencies. Instead of proving across full-core fetch, stall, bypass, and register-file state, C2RTL checks the 32-bit operand selected onto dut.alu_input_b_r against an independent C model (mode = 2 → Z16).
| Dimension | Full-Core FPV | Decomposed C2RTL |
|---|---|---|
| Target RTL | altor32_exec.v inside full cpu | Byte-identical altor32_exec.v via local observer wrapper |
| Verified scope | Instruction issue, pipeline, bypass, writeback, GPR, reset | Fixed l.andi decode branch; unconstrained 16-bit immediate; observes alu_input_b_r |
| Proof budget | prove -all: 300 s | Local numerical check: 600 s |
| Outcome & runtime | U (all 3 properties, ~295.45 s) | CEX (5.02 s total; 0.20 s proof stage) |
void rm_eval(const uint8_t *input, uint8_t *output)
{
const uint32_t x = (uint32_t)input[0]
| ((uint32_t)input[1] << 8)
| ((uint32_t)input[2] << 16)
| ((uint32_t)input[3] << 24);
const uint8_t mode = input[4];
uint32_t q;
uint32_t result;
/* Selectors outside 0..5 have no approved numerical relation. */
if (mode > 5) {
return;
}
/* Retain the source operand width before extending or placing it.
* spec.md 4.4:103-104; 5.1:144; 5.5:218-223.
*/
q = x;
if (mode <= 1) {
q &= UINT32_C(0x000000ff);
} else if (mode <= 4) {
q &= UINT32_C(0x0000ffff);
}
/* ... */
* Sign extension copies bit 7/15 into every higher destination bit.
* spec.md 4.4:104; 5.1:140-143; 5.3:177; 5.5:218-223.
*/
result = q;
if (mode == 1 && (q & UINT32_C(0x00000080)) != 0) {
result = q | UINT32_C(0xffffff00);
} else if (mode == 3 && (q & UINT32_C(0x00008000)) != 0) {
result = q | UINT32_C(0xffff0000);
} else if (mode == 4) {
/* spec.md 5.1:144: zero-extended immediate shifted left by 16.
* q <= 65535, so the full result fits in uint32_t.
*/
result = q << 16;
}
store_le32(output, result);
}
assign pin_clk_i = clk;
assign pin_rst_i = rst;
assign pin_intr_i = 1'd0;
assign pin_break_i = 1'd0;
assign pin_opcode_i = {selector[1:1], selector[0:0], selector[1:1], selector[0:0], selector[0:0], selector[1:1], selector[0:0], selector[0:0], selector[0:0], selector[0:0], selector[0:0], selector[0:0], selector[0:0], selector[0:0], selector[0:0], selector[0:0], operand[15:0]};
assign pin_opcode_pc_i = 32'd0;
assign pin_opcode_valid_i = 1'd0;
/* ... */
assign pin_dmem_ack_i = 1'd0;
altor32_exec dut (.clk_i(pin_clk_i), .rst_i(pin_rst_i), .intr_i(pin_intr_i), .break_i(pin_break_i), .opcode_i(pin_opcode_i), .opcode_pc_i(pin_opcode_pc_i), .opcode_valid_i(pin_opcode_valid_i), .reg_ra_i(pin_reg_ra_i), .reg_ra_value_i(pin_reg_ra_value_i), .reg_rb_i(pin_reg_rb_i), .reg_rb_value_i(pin_reg_rb_value_i), .reg_rd_i(pin_reg_rd_i), .wb_rd_i(pin_wb_rd_i), .wb_rd_value_i(pin_wb_rd_value_i), .dmem_data_in_i(pin_dmem_data_in_i), .dmem_stall_i(pin_dmem_stall_i), .dmem_ack_i(pin_dmem_ack_i));
assign expanded_result = dut.alu_input_b_r;
Recorded C2RTL outcome. The original ANDI relation gives CEX in 0.20 s of proof time (5.02 s total), under a 600 s profile proof limit.
/* value_expansion model version 1.
* Mathematics: spec/spec.md, sections 4.4, 5.1, 5.3, 5.5.
* Transport: contract/interface.json (5 input, 4 output bytes).
* Legal selectors: 0=Z8, 1=S8, 2=Z16, 3=S16, 4=MOVHI16, 5=WORD32.
*/
#include <stdint.h>
#ifdef RM_CHECKPOINTS
extern void rm_checkpoint(uint32_t id, const uint8_t *data, uint32_t size);
#endif
static void store_le32(uint8_t *bytes, uint32_t value)
{
bytes[0] = (uint8_t)value;
bytes[1] = (uint8_t)(value >> 8);
bytes[2] = (uint8_t)(value >> 16);
bytes[3] = (uint8_t)(value >> 24);
}
void rm_eval(const uint8_t *input, uint8_t *output)
{
const uint32_t x = (uint32_t)input[0]
| ((uint32_t)input[1] << 8)
| ((uint32_t)input[2] << 16)
| ((uint32_t)input[3] << 24);
const uint8_t mode = input[4];
uint32_t q;
uint32_t result;
/* Selectors outside 0..5 have no approved numerical relation. */
if (mode > 5) {
return;
}
/* Retain the source operand width before extending or placing it.
* spec.md 4.4:103-104; 5.1:144; 5.5:218-223.
*/
q = x;
if (mode <= 1) {
q &= UINT32_C(0x000000ff);
} else if (mode <= 4) {
q &= UINT32_C(0x0000ffff);
}
#ifdef RM_CHECKPOINTS
{
uint8_t payload[4];
store_le32(payload, q);
rm_checkpoint(UINT32_C(1), payload, UINT32_C(4));
}
#endif
/* Zero extension and word identity already have the required value.
* Sign extension copies bit 7/15 into every higher destination bit.
* spec.md 4.4:104; 5.1:140-143; 5.3:177; 5.5:218-223.
*/
result = q;
if (mode == 1 && (q & UINT32_C(0x00000080)) != 0) {
result = q | UINT32_C(0xffffff00);
} else if (mode == 3 && (q & UINT32_C(0x00008000)) != 0) {
result = q | UINT32_C(0xffff0000);
} else if (mode == 4) {
/* spec.md 5.1:144: zero-extended immediate shifted left by 16.
* q <= 65535, so the full result fits in uint32_t.
*/
result = q << 16;
}
store_le32(output, result);
}
module altor32_exec_rmflow_transaction(
input wire clk,
input wire rst,
input wire [31:0] operand,
input wire [7:0] selector,
output wire [31:0] expanded_result
);
reg [1:0] phase;
always @(posedge clk) begin
if (rst) phase <= 0;
else if (phase < 2) phase <= phase + 1;
end
wire [0:0] pin_clk_i;
wire [0:0] pin_rst_i;
wire [0:0] pin_intr_i;
wire [0:0] pin_break_i;
wire [31:0] pin_opcode_i;
wire [31:0] pin_opcode_pc_i;
wire [0:0] pin_opcode_valid_i;
wire [4:0] pin_reg_ra_i;
wire [31:0] pin_reg_ra_value_i;
wire [4:0] pin_reg_rb_i;
wire [31:0] pin_reg_rb_value_i;
wire [4:0] pin_reg_rd_i;
wire [4:0] pin_wb_rd_i;
wire [31:0] pin_wb_rd_value_i;
wire [31:0] pin_dmem_data_in_i;
wire [0:0] pin_dmem_stall_i;
wire [0:0] pin_dmem_ack_i;
assign pin_clk_i = clk;
assign pin_rst_i = rst;
assign pin_intr_i = 1'd0;
assign pin_break_i = 1'd0;
assign pin_opcode_i = {selector[1:1], selector[0:0], selector[1:1], selector[0:0], selector[0:0], selector[1:1], selector[0:0], selector[0:0], selector[0:0], selector[0:0], selector[0:0], selector[0:0], selector[0:0], selector[0:0], selector[0:0], selector[0:0], operand[15:0]};
assign pin_opcode_pc_i = 32'd0;
assign pin_opcode_valid_i = 1'd0;
assign pin_reg_ra_i = 5'd0;
assign pin_reg_ra_value_i = 32'd0;
assign pin_reg_rb_i = 5'd0;
assign pin_reg_rb_value_i = 32'd0;
assign pin_reg_rd_i = 5'd0;
assign pin_wb_rd_i = 5'd0;
assign pin_wb_rd_value_i = 32'd0;
assign pin_dmem_data_in_i = 32'd0;
assign pin_dmem_stall_i = 1'd0;
assign pin_dmem_ack_i = 1'd0;
altor32_exec dut (.clk_i(pin_clk_i), .rst_i(pin_rst_i), .intr_i(pin_intr_i), .break_i(pin_break_i), .opcode_i(pin_opcode_i), .opcode_pc_i(pin_opcode_pc_i), .opcode_valid_i(pin_opcode_valid_i), .reg_ra_i(pin_reg_ra_i), .reg_ra_value_i(pin_reg_ra_value_i), .reg_rb_i(pin_reg_rb_i), .reg_rb_value_i(pin_reg_rb_value_i), .reg_rd_i(pin_reg_rd_i), .wb_rd_i(pin_wb_rd_i), .wb_rd_value_i(pin_wb_rd_value_i), .dmem_data_in_i(pin_dmem_data_in_i), .dmem_stall_i(pin_dmem_stall_i), .dmem_ack_i(pin_dmem_ack_i));
assign expanded_result = dut.alu_input_b_r;
endmodule
On the original RTL, expanded_result[31:0] is CEX; the comparison point, ANDI selection, and legal-domain cover goals are reached.
{"observations": {"expanded_result": "alu_input_b_r"}, "compare_windows": {"expanded_result": [1, 1]}, "input_constraints": ["selector == 8'd2"], "stable_inputs": ["operand", "selector"]}
altor32_exec.vAt the settled comparison sample (29 ns), opcode_i = 0xA4008000 carries immediate I = 0x8000 (sign bit 1). The execution module already computes the correct zero-extended value on uint32_r = 0x00008000, yet the inst_andi_w decode branch routes sign-extended int32_r = 0xFFFF8000 into alu_input_b_r.
uint32_r = 0x00008000, but the inst_andi_w branch selects int32_r.Observed · faulty RTL (29 ns)
alu_input_b_r = 0xFFFF8000
inst_andi_w selects int32_r in altor32_exec.v, copying bit 15 across bits [31:16].
Expected · spec & C model (Z16)
uint32_r = 0x00008000
The specification mandates zero extension; the RTL's own uint32_r signal and the C model both equal 0x00008000.
// Signed & unsigned imm -> 32-bits
uint16_r = opcode_i[15:0];
int32_r = sign_extend_imm16(opcode_i[15:0]);
uint32_r = extend_imm16(opcode_i[15:0]);
/* ... */
inst_andi_w: // l.andi
begin
alu_func_r = `ALU_AND;
alu_input_a_r = reg_ra_r;
alu_input_b_r = int32_r;
write_rd_r = 1'b1;
end
Recorded attribution. This ANDI discrepancy is assigned to the RTL immediate-source selection shown above.
{
"property": "<embedded>::expanded_result[31:0]",
"calls": [
{"id": 14, "response": {"structuredContent": {"signal": "altor32_exec_rmflow_transaction_imp.expanded_result", "time": "29ns", "hex": "ffff8000"}}},
{"id": 15, "response": {"structuredContent": {"signal": "altor32_exec_rmflow_transaction_imp.operand", "time": "29ns", "hex": "8000"}}},
{"id": 22, "response": {"structuredContent": {"signal": "altor32_exec_rmflow_transaction_imp.dut.opcode_i", "time": "29ns", "hex": "a4008000"}}},
{"id": 23, "response": {"structuredContent": {"signal": "altor32_exec_rmflow_transaction_imp.dut.uint32_r", "time": "29ns", "hex": "8000"}}}
]
}
The isolated ANDI repair switches alu_input_b_r from int32_r to uint32_r. When combined into the cumulative candidate alongside sibling immediate-extension fixes for store and l.addi, all 62 declared local checks (6 original CEX groups + 56 regressions) prove with unchanged declarations.
diff --git a/altor32_exec.v b/altor32_exec.v
--- a/altor32_exec.v
+++ b/altor32_exec.v
@@ -362,7 +362,7 @@
target_int26_r = sign_extend_imm26(opcode_i[25:0]);
// Store immediate
- store_int32_r = extend_imm16({opcode_i[25:21],opcode_i[10:0]});
+ store_int32_r = sign_extend_imm16({opcode_i[25:21],opcode_i[10:0]});
// Signed & unsigned imm -> 32-bits
uint16_r = opcode_i[15:0];
@@ -664,7 +664,7 @@
begin
alu_func_r = `ALU_ADD;
alu_input_a_r = reg_ra_r;
- alu_input_b_r = uint32_r;
+ alu_input_b_r = int32_r;
write_rd_r = 1'b1;
end
@@ -672,7 +672,7 @@
begin
alu_func_r = `ALU_AND;
alu_input_a_r = reg_ra_r;
- alu_input_b_r = int32_r;
+ alu_input_b_r = uint32_r;
write_rd_r = 1'b1;
end
| Stage / Artifact | Check | Recorded Outcome | Scope |
|---|---|---|---|
| Cumulative candidate | 62 local C2RTL checks (6 CEX groups + 56 regressions) | 62 / 62 proven | All C2RTL_PROVEN_DECLARED_SCOPE, declaration_unchanged: true; ANDI (check_30) covers reached |
| Cumulative candidate (Discovery) | Pre/post full-hierarchy differential SEC (cpu) | REVIEW_REQUIRED | Recorded as SEC_REVIEW_UNRESOLVED (SEC_CEX / Invalid); no accepted merge recorded for the 3-hunk bundle |
| Isolated ANDI patch (Held-out Eval) | M_0001 attribution match & golden SEC | FIX_CONFIRMED | CONFIRMED_KILL + SEC_PROVEN (steady_state_equivalence_proven: true; full_signoff_complete: false) |
diff --git a/altor32_exec.v b/altor32_exec.v
--- a/altor32_exec.v
+++ b/altor32_exec.v
@@ -672,7 +672,7 @@
begin
alu_func_r = `ALU_AND;
alu_input_a_r = reg_ra_r;
- alu_input_b_r = int32_r;
+ alu_input_b_r = uint32_r;
write_rd_r = 1'b1;
end
For cumulative_revision_03_iteration_01_patch_01, the ANDI relation is proven with its declaration unchanged.
The post-patch expanded_result[31:0] relation is proven; comparison-point and ANDI-selection cover goals are reached.
Discovery SEC for the cumulative three-hunk candidate produces CEX; its behavioral review remains unresolved.
For the isolated ANDI defect M_0001, held-out post-reset steady-state equivalence is proven. Full sign-off remains incomplete.
When a generated assertion fails on the 16-bit GT transmit path, SAVER audits mux.v slice packing and waveforms, blames the reversed checker helper (RTL action: none), and proves the property on the next iteration.
tx_gt_data_association CEXFails in 0.004 s (iter_00) with witness and precondition covered.
At link_up=0, RTL gt_tx_data_o=0x0000; only checker jumps to 0x4000.
assertion: defectivertl_track: none / none — stops any RTL edit from this CEX.
Helper fixed (bind_changed: false); proven (Infinite, 0.232 s), covers intact.
link_up = 0 selects controller, 1 selects linkThe SATA PHY transmit datapath multiplexes either 32-bit link FIFO payload (lnk_tx_tdata) or 32-bit PHY controller primitives (gt_tx_data) onto the 16-bit GT transmit interface (gt_tx_data_o), using link_up for the source and tx_data_mux_sel for the upper/lower 16-bit half-word.
DATA_BITS (32-bit)axis_fifo_36W_16D (36b)Control encoding: lnk_tx_tuser_i[3:0] uses 0001 for primitive and 0000 for data; gt_tx_charisk_o[1:0] drives the GT transmit K/D output.
mux #(
.DATA_BITS (16),
.IP_NUM (4),
.USE_OP_REG (1))
U_txdata_mux(
.clk (clk_phy),
.data_i ({lnk_tx_tdata[31:16], lnk_tx_tdata[15:0], gt_tx_data[31:16], gt_tx_data[15:0]}),
.sel_i ({6'd0, link_up, tx_data_mux_sel}),
.data_o (gt_tx_data_o));
// mux.v (L55-67, L77-80)
assign data_c = ip_array[sel_i];
////////////////////////////////////////////////////////////
// Generate : Input array
// Description : Create an array of input vectors.
////////////////////////////////////////////////////////////
generate
for(i=0; i<IP_NUM; i=i+1) begin: mux_gen
always @(*)
begin
ip_array[i] = data_i[(i+1)*DATA_BITS-1:i*DATA_BITS];
end
always @(posedge clk)
begin
data_r <= ip_array[sel_i];
end
Because ip_array[i] indexes from LSB upward, the rightmost slice enters ip_array[0], and the registered output lags by one clk_phy cycle.
link_up | tx_data_mux_sel | sel_i | Actual selected source |
|---|---|---|---|
0 (pre-link) | 0 | 0 | Controller gt_tx_data[15:0] |
0 (pre-link) | 1 | 1 | Controller gt_tx_data[31:16] |
1 (post-link) | 0 | 2 | Link lnk_tx_tdata[15:0] |
1 (post-link) | 1 | 3 | Link lnk_tx_tdata[31:16] |
link_up, producing a false-alarm CEXIn iter_00/sva.sv, the generated helper correctly extracts both half-words and preserves the 1-cycle registered $past check, but reverses the final ternary operator on link_up—causing tx_gt_data_association to fail in 0.004 s.
// The two registered TX muxes use the same link_up/half selector. The
// one-cycle offset observes their NBA update at the next assertion sample.
wire [15:0] link_half_data =
tx_data_mux_sel ? lnk_tx_tdata[31:16] : lnk_tx_tdata[15:0];
wire [15:0] primitive_half_data =
tx_data_mux_sel ? gt_tx_data[31:16] : gt_tx_data[15:0];
wire [15:0] selected_data =
link_up ? primitive_half_data : link_half_data;
// P1-REF: PROP-TX-BRIDGE/SUB-TX-PAYLOAD
property p_tx_gt_data_association;
@(posedge clk_phy) disable iff (!rst_n)
past_valid_phy |-> (gt_tx_data_o == $past(selected_data));
endproperty
tx_gt_data_association: assert property (p_tx_gt_data_association);
gt_tx_data while only the checker follows lnk_tx_tdata.RTL behavior · matches mux packing
gt_tx_data_o = 0x0000
With link_up = 0 and tx_data_mux_sel = 1, RTL correctly forwards controller gt_tx_data[31:16] = 0x0000.
Defective checker · wrong reference source
selected_data = 0x4000
Inverted ternary picks unselected link data lnk_tx_tdata[31:16] = 0x4000 at 10 ns, triggering a spurious CEX.
On iter_00, tx_gt_data_association is CEX; its witness and precondition cover goals are reached.
{
"property": "<embedded>::sata_phy_top_x6series.u_func_tx_checker.tx_gt_data_association",
"calls": [
{
"id": 4,
"arguments": {"full_path": "sata_phy_top_x6series.link_up", "start_time_as_string": "0ns", "end_time_as_string": "60ns"},
"response": {"structuredContent": {"count": 1, "values": [{"time": "0", "hex": "0"}]}}
},
{
"id": 5,
"arguments": {"full_path": "sata_phy_top_x6series.tx_data_mux_sel", "start_time_as_string": "0ns", "end_time_as_string": "60ns"},
"response": {"structuredContent": {"count": 2, "values": [{"time": "0", "hex": "1"}, {"time": "30ns", "hex": "0"}]}}
},
{
"id": 6,
"arguments": {"full_path": "sata_phy_top_x6series.lnk_tx_tdata", "start_time_as_string": "0ns", "end_time_as_string": "60ns"},
"response": {"structuredContent": {"count": 3, "values": [{"time": "0", "hex": "0"}, {"time": "10ns", "hex": "40000000"}, {"time": "30ns", "hex": "ffff"}]}}
},
{
"id": 7,
"arguments": {"full_path": "sata_phy_top_x6series.gt_tx_data", "start_time_as_string": "0ns", "end_time_as_string": "60ns"},
"response": {"structuredContent": {"count": 1, "values": [{"time": "0", "hex": "0"}]}}
},
{
"id": 8,
"arguments": {"full_path": "sata_phy_top_x6series.gt_tx_data_o", "start_time_as_string": "0ns", "end_time_as_string": "60ns"},
"response": {"structuredContent": {"count": 1, "values": [{"time": "0", "hex": "0"}]}}
},
{
"id": 9,
"arguments": {"full_path": "sata_phy_top_x6series.u_func_tx_checker.selected_data", "start_time_as_string": "0ns", "end_time_as_string": "60ns"},
"response": {"structuredContent": {"count": 3, "values": [{"time": "0", "hex": "0"}, {"time": "10ns", "hex": "4000"}, {"time": "30ns", "hex": "ffff"}]}}
}
]
}
Comparing the waveform trace against U_txdata_mux and mux.v proves that the binding exposes the right DUT signals and the $past timing is faithful, while only the helper's source-selection ternary is inverted. SAVER routes the fix exclusively to the checker builder and sets rtl_track.action = "none".
gt_tx_data_o (0x0000) differs from $past(selected_data) (0x4000).
RTL matches active mux packing; only checker helper swaps link_up branches.
rtl_track: none; helper edit integrated without weakening the assertion.
Recorded attribution. The iter_00 finding is assigned to the checker helper; this counterexample does not trigger a TX RTL change.
wire [15:0] selected_data =
- link_up ? primitive_half_data : link_half_data;
+ link_up ? link_half_data : primitive_half_data;
In iter_01, the corrected helper is integrated while the TX binding is retained.
After flipping only the ternary expression in selected_data while keeping the exact $past timing and !rst_n guard, iter_01 proves tx_gt_data_association to Infinite bound in 0.232 s with both witness1 and precondition1 still covered.
wire [15:0] link_half_data =
tx_data_mux_sel ? lnk_tx_tdata[31:16] : lnk_tx_tdata[15:0];
wire [15:0] primitive_half_data =
tx_data_mux_sel ? gt_tx_data[31:16] : gt_tx_data[15:0];
wire [15:0] selected_data =
link_up ? link_half_data : primitive_half_data;
// P1-REF: PROP-TX-BRIDGE/SUB-TX-PAYLOAD
property p_tx_gt_data_association;
@(posedge clk_phy) disable iff (!rst_n)
past_valid_phy |-> (gt_tx_data_o == $past(selected_data));
endproperty
tx_gt_data_association: assert property (p_tx_gt_data_association);
On iter_01, tx_gt_data_association is proven at Infinite bound; its witness and precondition cover goals remain reached.
Across both frozen execution snapshots, U_txdata_mux and mux.v are byte-identical. In parallel during iter_01, a separate receiver-path defect swapping lnk_rx_tuser[3:0] and [7:4] was repaired; it does not touch the transmit mux path.
// iter_00 (before parallel RX fix)
assign lnk_rx_tdata = gt_rx_data_r;
assign lnk_rx_tvalid = gt_rx_valid;
assign lnk_rx_tuser[3:0] = gt_rx_err_r;
assign lnk_rx_tuser[7:4] = gt_rx_charisk_r;
// iter_01 (after parallel RX fix; TX mux L191-199 unchanged)
assign lnk_rx_tdata = gt_rx_data_r;
assign lnk_rx_tvalid = gt_rx_valid;
assign lnk_rx_tuser[3:0] = gt_rx_charisk_r;
assign lnk_rx_tuser[7:4] = gt_rx_err_r;
Candidate wb_decode_fix_v2 passes all target proofs and 74-assertion regressions, yet differential SEC catches an unexpected pit_o divergence from an exposed slave-mode mux—blocking admission until the combined decode+mux repair lands.
wb_decode_fix_v2 proves MOD write and bit-2 alias targets non-vacuously.
Corpus moves 59→62 proven; all 12 remaining CEXs are unchanged pre-existing bugs.
pit_o unexpected4 divergences are expected decode effects; pit_o exposes unchanged reversed mux.
Standalone patch blocked; combined wb_mux_interaction_fix_v1 passes SEC.
The programmable interval timer (PIT) receives WISHBONE register accesses. In DWIDTH=16 mode, register selection must ignore wb_adr_i[2], and writing MOD must update both bytes (strobe 4'b1100 instead of 4'b0100). The standalone candidate wb_decode_fix_v2 edits only pit_wb_bus.v.
| Register | Address (wb_adr_i) | Access | Description |
|---|---|---|---|
CNTRL | 0x0 | RW | Control bits: mode (SLAVE), prescale, flag clear, interrupt enable, counter enable. |
MOD | 0x1 | RW | Main counter modulo value (MOD_VAL) — full 16-bit write in DWIDTH=16 mode. |
CNT | 0x2 | R | Current main counter value (COUNT_VAL). |
// Address is taken from the bus adapter, while the suspected write_regs
// decode remains outside the antecedent.
wire mod_write_accept = wb_ack_o && wb_cyc_i && wb_stb_i && wb_we_i &&
(wb_address == 3'b001);
property p_mod_write_full_width;
@(posedge wb_clk_i)
disable iff (reset_active || sync_reset)
mod_write_accept |=> (mod_value == $past(wb_dat_i));
endproperty
a_mod_write_full_width: assert property (p_mod_write_full_width);
// P1-REF: PROP-ENV-ADDR-16/SUB-ADDR-16-BIT2-IGNORED
// The expected register result is selected from address[1:0]; address[2]
// therefore cannot change a DWIDTH=16 read result.
property p_dw16_read_selection_ignores_bit2;
@(posedge wb_clk_i) disable iff (!arst_i)
(dw16_mode && read_accept)
|-> (wb_dat_o == expected_dw16_read(dut_address[1:0], dut_read_regs));
endproperty
dw16_read_selection_ignores_bit2:
assert property (p_dw16_read_selection_ignores_bit2);
// P1-REF: PROP-ENV-ADDR-16/SUB-ADDR-16-BIT2-IGNORED
// The write strobe is the DUT's selected-register result. Its expected
// value is derived from the specified DWIDTH=16 register map using only the
// low address bits.
property p_dw16_write_selection_ignores_bit2;
@(posedge wb_clk_i) disable iff (!arst_i)
(dw16_mode && write_accept)
|-> (dut_write_regs == expected_dw16_write(dut_address[1:0]));
endproperty
dw16_write_selection_ignores_bit2:
assert property (p_dw16_write_selection_ignores_bit2);
Before patching, the multi-bug PIT baseline stands at 59 proven / 15 CEX across 74 assertions. On wb_decode_fix_v2, all three declared targets flip to non-vacuously proven, and the full-corpus change gate passes with zero regressions (62 proven / 12 CEX; the 12 unchanged CEXs belong to other pre-existing PIT defects outside this candidate's scope). Relying on target proofs and regression checks alone would mistakenly admit this patch.
| Declared Target | Before Patch | wb_decode_fix_v2 | Non-vacuity |
|---|---|---|---|
a_mod_write_full_width | CEX | proven | Passed |
dw16_read_selection_ignores_bit2 | CEX | proven | Passed |
dw16_write_selection_ignores_bit2 | CEX | proven | Passed |
For wb_decode_fix_v2, all three declared targets are non-vacuously proven; the other baseline failures remain.
The decode candidate introduces no newly failing check in the retained corpus. Its behavioral review remains a separate gate.
pit_oDifferential SEC compares wb_decode_fix_v2 against the pre-patch active RTL (not a golden oracle). Five outputs diverge while wb_ack_o stays equivalent. Specification review confirms four divergences are intended consequences of the repaired bus decoder—and flags pit_o as unexpected.
| Compare Point | SEC Status | Specification Review Classification |
|---|---|---|
cnt_flag_o | CEX | Expected — downstream effect of repaired full-width MOD write |
wb_dat_o[15:0] | CEX | Expected — direct read-mux alias ignoring wb_adr_i[2] |
cnt_sync_o | CEX | Expected — aliased address-4 write updates CNT_EN |
pit_irq_o | CEX | Expected — aliased control write enables ENA_INT |
pit_o | CEX | Unexpected — slave mode activates unchanged reversed enable mux |
wb_ack_o | proven | Equivalent across pre/post RTL |
Counter activity is controlled by local CNT_EN; cnt_sync_o reflects CNT_EN for downstream slave instances.
Counter activity is controlled by ext_sync_i. Local CNT_EN writes still update cnt_sync_o but do not directly gate local counting.
assign counter_sync = pit_slave ? cnt_sync_o : ext_sync_i;
wb_decode_fix_v2 signal transitions. Values hold from the most recent transition.Observed · decode candidate (20 ns)
counter_sync = 0
Aliased write sets SLAVE=1 with ext_sync_i=1, but the unchanged mux picks cnt_sync_o=0, suppressing pit_o at 30 ns.
Expected · specification (§4.2)
counter_sync = 1
Derived from Spec §4.2 and recorded 20 ns inputs (SLAVE=1, ext_sync_i=1)—not a waveform replay of the later candidate.
For wb_decode_fix_v2, pre/post SEC gives CEX on cnt_flag_o, wb_dat_o[15:0], cnt_sync_o, pit_irq_o, and pit_o; wb_ack_o is proven.
The pit_o difference is classified as unexpected because the selected slave-mode enable contradicts Spec §4.2.
The other four differing outputs are attributed to the intended decode changes.
{
"property": "<embedded>::pit_o",
"side": "imp",
"calls": [
{
"id": 2,
"tool": "signal_values_in_range",
"arguments": {"full_path": "pit_top_imp.ext_sync_i"},
"response": {
"structuredContent": {
"count": 3,
"values": [{"time": "0", "time_units": 0, "value": "1", "hex": "1"}, {"time": "10ns", "time_units": 10, "value": "0", "hex": "0"}, {"time": "20ns", "time_units": 20, "value": "1", "hex": "1"}]
}
}
},
{
"id": 3,
"tool": "signal_values_in_range",
"arguments": {"full_path": "pit_top_imp.cnt_sync_o"},
"response": {"structuredContent": {"count": 1, "values": [{"time": "0", "time_units": 0, "value": "0", "hex": "0"}]}}
},
{
"id": 4,
"tool": "signal_values_in_range",
"arguments": {"full_path": "pit_top_imp.counter_sync"},
"response": {"structuredContent": {"count": 2, "values": [{"time": "0", "time_units": 0, "value": "1", "hex": "1"}, {"time": "10ns", "time_units": 10, "value": "0", "hex": "0"}]}}
},
{
"id": 6,
"tool": "signal_values_in_range",
"arguments": {"full_path": "pit_top_imp.prescale.pit_slave"},
"response": {"structuredContent": {"count": 2, "values": [{"time": "0", "time_units": 0, "value": "0", "hex": "0"}, {"time": "20ns", "time_units": 20, "value": "1", "hex": "1"}]}}
},
{
"id": 10,
"tool": "signal_values_in_range",
"arguments": {"full_path": "pit_top_imp.pit_o"},
"response": {
"structuredContent": {
"count": 3,
"values": [{"time": "0", "time_units": 0, "value": "0", "hex": "0"}, {"time": "10ns", "time_units": 10, "value": "1", "hex": "1"}, {"time": "20ns", "time_units": 20, "value": "0", "hex": "0"}]
}
}
}
]
}
{
"property": "<embedded>::pit_o",
"side": "spec",
"calls": [
{
"id": 2,
"tool": "signal_values_in_range",
"arguments": {"full_path": "pit_top.ext_sync_i"},
"response": {
"structuredContent": {
"count": 3,
"values": [{"time": "0", "time_units": 0, "value": "1", "hex": "1"}, {"time": "10ns", "time_units": 10, "value": "0", "hex": "0"}, {"time": "20ns", "time_units": 20, "value": "1", "hex": "1"}]
}
}
},
{
"id": 3,
"tool": "signal_values_in_range",
"arguments": {"full_path": "pit_top.cnt_sync_o"},
"response": {"structuredContent": {"count": 1, "values": [{"time": "0", "time_units": 0, "value": "0", "hex": "0"}]}}
},
{
"id": 4,
"tool": "signal_values_in_range",
"arguments": {"full_path": "pit_top.counter_sync"},
"response": {
"structuredContent": {
"count": 3,
"values": [{"time": "0", "time_units": 0, "value": "1", "hex": "1"}, {"time": "10ns", "time_units": 10, "value": "0", "hex": "0"}, {"time": "20ns", "time_units": 20, "value": "1", "hex": "1"}]
}
}
},
{
"id": 6,
"tool": "signal_values_in_range",
"arguments": {"full_path": "pit_top.prescale.pit_slave"},
"response": {"structuredContent": {"count": 1, "values": [{"time": "0", "time_units": 0, "value": "0", "hex": "0"}]}}
},
{
"id": 10,
"tool": "signal_values_in_range",
"arguments": {"full_path": "pit_top.pit_o"},
"response": {
"structuredContent": {
"count": 4,
"values": [
{"time": "0", "time_units": 0, "value": "0", "hex": "0"},
{"time": "10ns", "time_units": 10, "value": "1", "hex": "1"},
{"time": "20ns", "time_units": 20, "value": "0", "hex": "0"},
{"time": "30ns", "time_units": 30, "value": "1", "hex": "1"}
]
}
}
}
]
}
Because the pit_o divergence violates slave-mode enable selection, the coordinator records rejected (unexpected_divergence) for wb_decode_fix_v2. The follow-up candidate wb_mux_interaction_fix_v1 retains the decode fix and corrects pit_prescale.v—proving all 7 declared targets non-vacuously with zero regressions (66 proven / 8 CEX) and passing differential SEC review with only specification-expected differences.
Pre-patch vs. decode candidate differs on five outputs.
pit_oSlave mode picks local enable due to existing reversed mux.
wb_decode_fix_v2 withheld; triggers combined decode+mux fix.
The standalone wb_decode_fix_v2 candidate is withheld after the unexpected pit_o divergence.
The combined wb_mux_interaction_fix_v1 candidate passes the review of its intended behavioral changes.
--- inputs/rtl/pit_wb_bus.v
+++ iterations/iter_01/candidates/CEX-iter_00-0011/wb_decode_fix_v2/rtl/pit_wb_bus.v
@@ -116,9 +116,9 @@
4'b1_100: wb_dat_o = read_regs[39:32]; // 8 bit read address 4
4'b1_101: wb_dat_o = read_regs[47:40]; // 8 bit read address 5
// 16 bit Bus, 16 bit Granularity
- 4'b0_000: wb_dat_o = read_regs[15: 0]; // 16 bit read access address 0
- 4'b0_001: wb_dat_o = read_regs[31:16];
- 4'b0_010: wb_dat_o = read_regs[47:32];
+ 4'b0_000, 4'b0_100: wb_dat_o = read_regs[15: 0]; // 16 bit read access address 0
+ 4'b0_001, 4'b0_101: wb_dat_o = read_regs[31:16];
+ 4'b0_010, 4'b0_110: wb_dat_o = read_regs[47:32];
default: wb_dat_o = 0;
endcase
@@ -134,8 +134,8 @@
4'b1_010 : write_regs = 4'b0100;
4'b1_011 : write_regs = 4'b1000;
// 16 bit Bus, 16 bit Granularity
- 4'b0_000 : write_regs = 4'b0011;
- 4'b0_001 : write_regs = 4'b0100;
+ 4'b0_000, 4'b0_100 : write_regs = 4'b0011;
+ 4'b0_001, 4'b0_101 : write_regs = 4'b1100;
default: ;
endcase
end
--- inputs/rtl/pit_prescale.v
+++ iterations/iter_01/candidates/CEX-iter_00-0011/wb_mux_interaction_fix_v1/rtl/pit_prescale.v
@@ -99,7 +99,7 @@
15: end_count = 32768;
endcase
-assign counter_sync = pit_slave ? cnt_sync_o : ext_sync_i;
+assign counter_sync = pit_slave ? ext_sync_i : cnt_sync_o;
assign div_1 = (end_count == 1);
--- inputs/rtl/pit_wb_bus.v
+++ iterations/iter_01/candidates/CEX-iter_00-0011/wb_mux_interaction_fix_v1/rtl/pit_wb_bus.v
@@ -116,9 +116,9 @@
4'b1_100: wb_dat_o = read_regs[39:32]; // 8 bit read address 4
4'b1_101: wb_dat_o = read_regs[47:40]; // 8 bit read address 5
// 16 bit Bus, 16 bit Granularity
- 4'b0_000: wb_dat_o = read_regs[15: 0]; // 16 bit read access address 0
- 4'b0_001: wb_dat_o = read_regs[31:16];
- 4'b0_010: wb_dat_o = read_regs[47:32];
+ 4'b0_000, 4'b0_100: wb_dat_o = read_regs[15: 0]; // 16 bit read access address 0
+ 4'b0_001, 4'b0_101: wb_dat_o = read_regs[31:16];
+ 4'b0_010, 4'b0_110: wb_dat_o = read_regs[47:32];
default: wb_dat_o = 0;
endcase
@@ -134,8 +134,8 @@
4'b1_010 : write_regs = 4'b0100;
4'b1_011 : write_regs = 4'b1000;
// 16 bit Bus, 16 bit Granularity
- 4'b0_000 : write_regs = 4'b0011;
- 4'b0_001 : write_regs = 4'b0100;
+ 4'b0_000, 4'b0_100 : write_regs = 4'b0011;
+ 4'b0_001, 4'b0_101 : write_regs = 4'b1100;
default: ;
endcase
end
For wb_mux_interaction_fix_v1, all seven declared targets are proven; unrelated corpus failures remain.
The combined repair’s conclusive SEC differences are classified as intended corrections; no additional divergence requires refinement.
| Candidate | Files Edited | Local FPV & Regression Gate | Differential SEC Gate |
|---|---|---|---|
wb_decode_fix_v2 | pit_wb_bus.v only | pass — 3 / 3 targets proven, 0 regressions (62 / 74) | rejected — unexpected pit_o divergence |
wb_mux_interaction_fix_v1 | pit_wb_bus.v + pit_prescale.v | pass — 7 / 7 targets proven, 0 regressions (66 / 74) | pass — all conclusive differences expected |
Quickstart
The local launcher coordinates the work. Licensed EDA jobs run on the remote host, where the benchmark is already deployed.
Read the complete setupcp batch_cases.json cases.json
# Keep the tasks you want; choose fresh case_name values.
python run_codex_batch.py --cases-file cases.json
Run from the repository root. Startup prepares the allowed inputs and dispatches the selected branches. The benchmark remains on the remote host.
Follow batch progress and inspect the case workspace.
cases.progress.json and <case_name>/<branch>/.