F4.4.3 The Free Variable That Lied

MediumDebug20 minRecorded formal evidenceReview the topic

Problem

Description

Three trackers use one free port index to check four sticky error flags. One passes on a faulty block and one fails on a good block. Explain both.

Three trackers check four sticky error flags through one free port index. One passes on a faulty block, one fails on a good block and one is honest. Choose what each result means and select the line that causes it.

Pinned interface
PortDirectionBits
clkinput1
rstinput1
badinput1
ackinput1
idxinput2
erroutput4
watchoutput2
Full specification

Each port has a sticky error flag. bad sets the flag of port idx, and ack clears it. Each card shows a block, a tracker with a free index f_p, and a recorded run at depth 12. watch is a copy of f_p.

For every card, choose what the result means. Then select one line. For a misleading result, select the line that causes it. For an honest result, select the line of the check.

Recorded caseLocal contract
Tracker AContract: a flag stays set until its own port is acknowledged. The companion trace is a cover on the same bench: only the flag of port 3 is set.
Tracker BContract: a flag stays set until its own port is acknowledged. This design has no fault. The trace is the reported failure. watch shows the free index.
Tracker CContract: a flag stays set until its own port is acknowledged. The companion trace is a cover on the same bench: only the flag of port 3 is set.
Execution ruleMeaning
InterfaceUse the pinned port names, directions and bit widths shown above. Observed state and tracker outputs are not environment inputs.
SamplingOne positive edge of clk; binary values. Non-overlapping implication observes the next sample. Reset and initialization follow the source and contract above.
SubmissionSelect a cause and a numbered line for every recorded case. Checking these choices runs no engine.
How this is gradedThe cause and responsible line must agree with each recorded local contract. A timeout or induction candidate must not be diagnosed as a reachable RTL failure.

Tracker A

Contract: a flag stays set until its own port is acknowledged. The companion trace is a cover on the same bench: only the flag of port 3 is set.

PASS · bmc · depth 12 · 623 ms

Recorded companion trace
0123clkfreerstfreebadfreeackfreeidx2'b002'b112'b00err4'b00004'b1000watch2'b10
Scroll horizontally ↔

Samples from the separately reported companion check. Free input lanes are shaded; the terminal VCD record is omitted.

Companion check: PASS · reported step 3

Numbered source and task
  1  module top(input clk, input rst, input bad, input ack, input [1:0] idx, output reg [3:0] err=0, output [1:0] watch);
  2  always @(posedge clk)
  3    if (rst) err <= 0;
  4    else begin
  5      if (bad) err[idx] <= 1;
  6      if (ack) begin
  7        err[idx] <= 0;
  8        if (idx[0]) err[3] <= 0;
  9      end
 10    end
 11  // the tracker: one port stands for all four
 12  (* anyconst *) reg [1:0] f_p;
 13  assign watch = f_p;
 14  reg f_s=0;
 15  always @(posedge clk) begin
 16    if ($initstate) begin assume(rst); end else begin assume(!rst); end
 17    if (rst) f_s <= 0;
 18    else if (ack && idx == f_p) f_s <= 0;
 19    else if (bad && idx == f_p) f_s <= 1;
 20    assume(f_p == 2'd2);
 21    if (!rst) assert(err[f_p] == f_s);
 22  end
 23  endmodule

Tracker B

Contract: a flag stays set until its own port is acknowledged. This design has no fault. The trace is the reported failure. `watch` shows the free index.

FAIL · bmc · depth 12 · 627 ms

Recorded solver trace
0123clkfreerstfreebadfreeackfreeidx2'b102'b112'b00err4'b00004'b1000watch2'b002'b112'b00sampled violation
Scroll horizontally ↔

Samples from the measured run. Free input lanes are shaded; the terminal VCD record is omitted.

Numbered source and task
  1  module top(input clk, input rst, input bad, input ack, input [1:0] idx, output reg [3:0] err=0, output [1:0] watch);
  2  always @(posedge clk)
  3    if (rst) err <= 0;
  4    else begin
  5      if (bad) err[idx] <= 1;
  6      if (ack) begin
  7        err[idx] <= 0;
  8      end
  9    end
 10  // the tracker: one port stands for all four
 11  wire [1:0] f_p = $anyseq;
 12  assign watch = f_p;
 13  reg f_s=0;
 14  always @(posedge clk) begin
 15    if ($initstate) begin assume(rst); end else begin assume(!rst); end
 16    if (rst) f_s <= 0;
 17    else if (ack && idx == f_p) f_s <= 0;
 18    else if (bad && idx == f_p) f_s <= 1;
 19    if (!rst) assert(err[f_p] == f_s);
 20  end
 21  endmodule

Tracker C

Contract: a flag stays set until its own port is acknowledged. The companion trace is a cover on the same bench: only the flag of port 3 is set.

PASS · bmc · depth 12 · 555 ms

Recorded companion trace
0123clkfreerstfreebadfreeackfreeidx2'b002'b112'b00err4'b00004'b1000watch2'b00
Scroll horizontally ↔

Samples from the separately reported companion check. Free input lanes are shaded; the terminal VCD record is omitted.

Companion check: PASS · reported step 3

Numbered source and task
  1  module top(input clk, input rst, input bad, input ack, input [1:0] idx, output reg [3:0] err=0, output [1:0] watch);
  2  always @(posedge clk)
  3    if (rst) err <= 0;
  4    else begin
  5      if (bad) err[idx] <= 1;
  6      if (ack) begin
  7        err[idx] <= 0;
  8      end
  9    end
 10  // the tracker: one port stands for all four
 11  (* anyconst *) reg [1:0] f_p;
 12  assign watch = f_p;
 13  reg f_s=0;
 14  always @(posedge clk) begin
 15    if ($initstate) begin assume(rst); end else begin assume(!rst); end
 16    if (rst) f_s <= 0;
 17    else if (ack && idx == f_p) f_s <= 0;
 18    else if (bad && idx == f_p) f_s <= 1;
 19    if (!rst) assert(err[f_p] == f_s);
 20  end
 21  endmodule

Requirements

  • Use the published ports and widths. The checker and the DUT variants are owned by the judge.
  • Do not add assumptions unless the statement explicitly asks for one. A passing assertion without a reachable trigger is insufficient.

Hints

Hint 1

Read how each tracker declares f_p, and what else it says about it.

Hint 2

In each trace, follow watch from step to step.

Hint 3

Use the two mistakes in the "When a free variable misleads" section of F4.4.

Single clock, binary values, synchronous reset. The judge checks the pinned interface, reachability and the declared proof or bound. UNKNOWN, resource limits and timeouts remain inconclusive.

The recordings are fixed. Checking a diagnosis does not run an engine.

More problems on this topic

Report a problem with this page

Worked solution

Opening the solution ends an unsolved rated attempt. Solving it first costs nothing.

Your Diagnosis

Tracker A
Tracker B
Tracker C

Recorded evidence · no engine run

Recent Submissions