F1.3.1 One Line, Three Verbs

EasyDebug10 minRecorded formal evidenceReview the topic

Problem

Description

One line about a coin counter is used three ways. Each run gives a result. Say what each result tells you.

One line about a coin counter appears after assert, after assume and after cover. Each bench has a recorded result. Choose what each result tells you about the line, and select the source line that holds the verb.

Pinned interface
PortDirectionBits
clkinput1
rstinput1
coininput1
takeinput1
creditoutput2
gaveoutput1
wrappedoutput1
Full specification

The block counts coins in two bits and gives one item per take while credit is left. The same line appears in three benches: once after assert, once after assume and once after cover.

For every card, choose what the recorded result tells you about the line. Then select the source line that holds the verb.

Recorded caseLocal contract
The line assertedThe line is: no coin arrives at credit 3 without a take.
The line assumedThe line is: no coin arrives at credit 3 without a take. The companion trace is a cover on the same bench: credit reaches 3.
The line coveredThe line is: no coin arrives at credit 3 without a take.
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.

The Line Asserted

The line is: no coin arrives at credit 3 without a take.

FAIL · bmc · depth 12 · 1304 ms

Recorded solver trace
012345clkfreerstfreecoinfreetakecredit2'b002'b012'b102'b112'b00gavewrappedsampled 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, coin, take, output reg [1:0] credit=0, output reg gave=0, output reg wrapped=0);
  2  always @(posedge clk)
  3    if (rst) begin credit <= 0; gave <= 0; wrapped <= 0; end
  4    else begin
  5      gave <= take && credit != 2'd0;
  6      if (coin && !take && credit == 2'd3) wrapped <= 1;     // a coin was lost
  7      credit <= credit + coin - (take && credit != 2'd0);     // two bits: a fourth coin wraps to zero
  8    end
  9  always @(posedge clk) begin if ($initstate) begin assume(rst); end else begin assume(!rst); end end
 10  endmodule
 11  // props.sv
 12  assert property (@(posedge clk) disable iff (rst) !(coin && !take && credit == 3));

The Line Assumed

The line is: no coin arrives at credit 3 without a take. The companion trace is a cover on the same bench: credit reaches 3.

PASS · bmc · depth 12 · 899 ms

Recorded companion trace
012345clkfreerstfreecoinfreetakecredit2'b002'b012'b102'b11gavewrapped
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 5

Numbered source and task
  1  module top(input clk, input rst, coin, take, output reg [1:0] credit=0, output reg gave=0, output reg wrapped=0);
  2  always @(posedge clk)
  3    if (rst) begin credit <= 0; gave <= 0; wrapped <= 0; end
  4    else begin
  5      gave <= take && credit != 2'd0;
  6      if (coin && !take && credit == 2'd3) wrapped <= 1;     // a coin was lost
  7      credit <= credit + coin - (take && credit != 2'd0);     // two bits: a fourth coin wraps to zero
  8    end
  9  always @(posedge clk) if (!rst) assume(!(coin && !take && credit == 3));
 10  always @(posedge clk) begin if ($initstate) begin assume(rst); end else begin assume(!rst); end end
 11  endmodule
 12  // props.sv
 13  assert property (@(posedge clk) disable iff (rst) !wrapped);

The Line Covered

The line is: no coin arrives at credit 3 without a take.

PASS · cover · depth 12 · 1664 ms

Recorded solver trace
012clkfreerstfreecoinfreetakecredit2'b00gavewrapped
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, coin, take, output reg [1:0] credit=0, output reg gave=0, output reg wrapped=0);
  2  always @(posedge clk)
  3    if (rst) begin credit <= 0; gave <= 0; wrapped <= 0; end
  4    else begin
  5      gave <= take && credit != 2'd0;
  6      if (coin && !take && credit == 2'd3) wrapped <= 1;     // a coin was lost
  7      credit <= credit + coin - (take && credit != 2'd0);     // two bits: a fourth coin wraps to zero
  8    end
  9  always @(posedge clk) begin if ($initstate) begin assume(rst); end else begin assume(!rst); end end
 10  endmodule
 11  // props.sv
 12  cover property (@(posedge clk) !rst && !(coin && !take && credit == 3));

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

Ask who must make the line true in each bench: the design, the solver or one chosen run.

Hint 2

A passing bench is not always a statement about the line you are reading. Find the assertion in it.

Hint 3

Use the three-verb table of F1.3.

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

The line asserted
The line assumed
The line covered

Recorded evidence · no engine run

Recent Submissions