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
| Port | Direction | Bits |
|---|---|---|
| clk | input | 1 |
| rst | input | 1 |
| coin | input | 1 |
| take | input | 1 |
| credit | output | 2 |
| gave | output | 1 |
| wrapped | output | 1 |
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 case | Local contract |
|---|---|
| The line asserted | The line is: no coin arrives at credit 3 without a take. |
| 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. |
| The line covered | The line is: no coin arrives at credit 3 without a take. |
| Execution rule | Meaning |
|---|---|
| Interface | Use the pinned port names, directions and bit widths shown above. Observed state and tracker outputs are not environment inputs. |
| Sampling | One positive edge of clk; binary values. Non-overlapping implication observes the next sample. Reset and initialization follow the source and contract above. |
| Submission | Select a cause and a numbered line for every recorded case. Checking these choices runs no engine. |
| How this is graded | The 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
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
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
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