F10.1.2 Make the Lies Fail

HardFix35 minSymbiYosys · serverReview the topic

Problem

Description

This property file passes on three faulty designs. Rewrite each lying property so that every fault fails.

A property file passes on a good bus-grant block and on three faulty ones. Rewrite its three checks so that the good block proves and every faulty block fails. One tick of clk is one phase of the block clock.

Pinned interface
PortDirectionBits
clkinput1
rstinput1
startinput1
retryinput1
overrideinput1
phoutput1
busyoutput1
midoutput1
owneroutput1
g0output1
g1output1
gseloutput1
ovroutput1
Full specification

The block grants a bus to one of two lines for a transfer. ph is the block clock clk1: the design updates on the ticks of clk where ph is 1. So one tick of clk is one phase of clk1.

The contract has three rules. A transfer keeps busy high for four cycles of clk1. While mid is high, the grant line of the current owner does not change. g0 and g1 are never high together.

The starter file checks all three rules and passes. It also passes on three faulty blocks. The first has a three-cycle transfer. In the second, the owner moves in the middle of a transfer. The third grants both lines under an override. ovr is the override value that the grant lines used. Submit a property file that proves the good block and fails all three.

Sample points of posedge clk1 are the ticks where ph is 1, two ticks apart. Write the per-line rule once for owner == 0 and once for owner == 1.

This engine takes |->, |=>, ##n, a final ##[m:n] and $past, $stable or $rose on outputs. It has no [*n]: write busy ##1 busy or busy ##2 busy instead.

The good block. The judge also runs three faulty versions that you do not see.
module top(input clk, input rst, input start, input retry, input override, output reg ph=0, output reg busy=0, output reg mid=0, output reg owner=0, output reg g0=0, output reg g1=0, output reg gsel=0, output reg ovr=0);
reg [1:0] cnt=0;
wire go   = !busy && start;
wire last = busy && cnt == 2'd3;
wire nb   = go || (busy && !last);                    // next busy
wire [1:0] ncnt = busy && !last ? cnt + 2'd1 : 2'd0;
wire no   = last ? !owner : owner;                       // next owner
always @(posedge clk) begin
  ph <= !ph;                                          // clk1 = ph: two ticks of clk per clk1 cycle
  if (rst) begin busy <= 0; cnt <= 0; owner <= 0; mid <= 0; g0 <= 0; g1 <= 0; gsel <= 0; ovr <= 0; end
  else if (ph) begin                                  // a rising edge of clk1
    busy <= nb; cnt <= ncnt; owner <= no;
    ovr  <= override;                                 // the override that the grant lines used
    mid  <= nb && ncnt != 2'd0;                       // every cycle of a transfer after the first
    g0   <= nb ? !no : override;                      // override parks the grant on line 0 while idle
    g1   <= nb && no;
    gsel <= nb ? 1'b1 : no ? 1'b0 : override;         // the owner's line: g0 or g1, chosen by owner
  end
end
always @(posedge clk) begin if ($initstate) begin assume(rst); end else begin assume(!rst); end end
endmodule

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.
SubmissionSubmit properties using the starter’s format. The checks apply to this stated model and scope.
How this is gradedThe reference obligations, independent reachability checks and fault checks must all succeed. An unresolved proof or resource limit is inconclusive and is never a rated miss.

Measured Counterexample

FAIL · bmc · depth 20 · smtbmc yices · 1390 ms

This measured failing run uses the published interface. Follow the sampled violation back to the preceding inputs and state. The worked solution below explains the required behaviour and the failure mechanisms.

Recorded solver trace
012345678910clkfreerstfreestartfreeretryfreeoverridephbusymidownerg0g1gselovrsampled violation
Scroll horizontally ↔

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

Sample 9: ph=1, busy=0. Previous sample: ph=0, busy=0. This faulty block keeps busy high for six ticks, which are three cycles of the block clock. The fourth sample point, where ph is 1, finds busy low. A check that counts four ticks ends two cycles earlier and never reads this sample.

Examples

A Transfer on the Tick Axis

start is high at a tick where ph is 1 and busy is 0.
busy is high for the next eight ticks of clk, which are four cycles of clk1.

A check that counts four ticks only sees the first two cycles.

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

For each starter line, find a faulty block that it cannot see. Ask which samples the line reads.

Hint 2

gsel already follows the owner. A stability check needs one fixed line on both samples.

Hint 3

The third line came from a function behind ovr ||. Ask when its condition switches the check off.

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.

INCONCLUSIVE never counts as acceptance or a rated miss. Run previews the same checks that Submit uses.

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 Property File

SymbiYosys · server

Recent Submissions