F10.2.1 Every Pass Needs a Witness

MediumImplement20 minSymbiYosys · serverReview the topic

Problem

Description

Four properties pass on a timer. Write the cover that shows each one was really exercised.

Four properties pass on a small timer. Write one state cover per property that is true only when that property is triggered, outside reset. Each cover must be reached on the timer.

Pinned interface
PortDirectionBits
clkinput1
rstinput1
arminput1
tickinput1
cancelinput1
armedoutput1
cntoutput2
fireoutput1
Full specification

The timer is armed by arm. It counts three tick cycles and then raises fire for one cycle. cancel disarms it at any time and wins over everything else.

The property file below proves at depth 12. A proof alone does not show that any trigger ever happened. Submit exactly four state covers, in the order of the properties. Cover number n must be true only in cycles where property n is triggered, outside reset.

The judge checks two things for each cover. It must be reached on the timer. It must also imply the trigger of its property, so cover(1) and a cover of the result are both rejected.

props.sv: the four proven properties, in order.
assert property (@(posedge clk) disable iff (rst) arm && !armed && !cancel |=> armed);
assert property (@(posedge clk) disable iff (rst) armed && tick && cnt == 2 && !cancel |=> fire);
assert property (@(posedge clk) disable iff (rst) armed && cancel |=> !armed && !fire);
assert property (@(posedge clk) disable iff (rst) fire |-> !armed);
The timer and its reset setting.
module top(input clk, input rst, input arm, input tick, input cancel, output reg armed=0, output reg [1:0] cnt=0, output reg fire=0);
always @(posedge clk)
  if (rst) begin armed <= 0; cnt <= 0; fire <= 0; end
  else begin
    fire <= armed && tick && cnt == 2'd2 && !cancel;
    if (cancel) begin armed <= 0; cnt <= 0; end
    else if (!armed && arm) begin armed <= 1; cnt <= 0; end
    else if (armed && tick) begin
      if (cnt == 2'd2) begin armed <= 0; cnt <= 0; end
      else cnt <= cnt + 2'd1;
    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 covers 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.

Countermodel to an Incomplete Contract

FAIL · prove · depth 12 · smtbmc yices · 1427 ms

This is a countermodel admitted by an incomplete submission. It contradicts a required obligation; it is not a claimed execution of the correct implementation. The worked solution explains the missing contract.

Recorded solver trace
01clkfreerstfreearmfreetickfreecancelarmedcnt2'b00firesampled violation
Scroll horizontally ↔

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

Sample 0: arm=0, armed=0, cancel=0, fire=0. A cover of a constant is true in this idle cycle, where no property is triggered. Each cover must be false whenever the trigger of its property is false.

Examples

A Trigger Is a Single Cycle

Property: busy && done |=> !busy. Reset is rst.
cover property (@(posedge clk) !rst && busy && done);

The cover names the cycle in which the check starts. It does not wait for the result.

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

Each property is an implication. Find the part that decides whether the check starts.

Hint 2

The properties are disabled in reset. A cover has no such switch unless you write the condition.

Hint 3

Use the property and antecedent-cover table of F10.2.

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