Description
The watchdog limit is 50,000 cycles, so no bounded proof reaches a bark. Finish the change that lets the bench shrink the timer.
A watchdog limit of 50,000 cycles is half way to being a parameter. Finish the timer module so that a bench can shrink it. Two small copies must warn and bark on the exact cycle, and the default limit must stay 50,000.
Pinned interface
| Port | Direction | Bits |
|---|---|---|
| clk | input | 1 |
| rst | input | 1 |
| kick | input | 1 |
| bark_a | output | 1 |
| warn_a | output | 1 |
| bark_b | output | 1 |
| warn_b | output | 1 |
| bark_c | output | 1 |
| warn_c | output | 1 |
| quiet | output | 4 |
| limit_c | output | 16 |
| count_c | output | 16 |
Full specification
The timer barks when 50,000 cycles pass without a kick. It warns two cycles before that. Someone started to make the limit a parameter and stopped half way.
The bench below instantiates the timer three times. The limits are 6, 9 and the shipped default. Finish the tmr module so that every use of the limit follows the parameter. Submit the tmr module only. The judge owns top.
The judge proves, on the two small copies, the exact cycle of the warning and of the bark. It also checks that the default limit is still 50,000.
No bounded run reaches 50,000 cycles. So for the default copy, the judge runs a one-step induction over every value of count_o. The copy must warn from 49,998 and bark from 50,000. Keep count_o equal to the counter.
| Copy | Warn from | Bark from |
|---|---|---|
| a: LIMIT 6 | 4 quiet cycles | 6 quiet cycles |
| b: LIMIT 9 | 7 quiet cycles | 9 quiet cycles |
| c: default | 49,998 quiet cycles | 50,000 quiet cycles |
module top(input clk, input rst, input kick, output bark_a, output warn_a, output bark_b, output warn_b, output bark_c, output warn_c, output reg [3:0] quiet=0, output [15:0] limit_c, output [15:0] count_c);
// The bench shrinks two copies of the timer. The third copy keeps the shipped limit.
wire [15:0] la, lb, ca, cb;
tmr #(.LIMIT(6)) a(.clk(clk), .rst(rst), .kick(kick), .bark(bark_a), .warn(warn_a), .limit_o(la), .count_o(ca));
tmr #(.LIMIT(9)) b(.clk(clk), .rst(rst), .kick(kick), .bark(bark_b), .warn(warn_b), .limit_o(lb), .count_o(cb));
tmr c(.clk(clk), .rst(rst), .kick(kick), .bark(bark_c), .warn(warn_c), .limit_o(limit_c), .count_o(count_c));
always @(posedge clk) // cycles since the last kick or reset, up to 15
quiet <= rst || kick ? 4'd0 : quiet == 4'd15 ? 4'd15 : quiet + 4'd1;
endmodule
| 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 | Submit RTL using the starter’s format. The checks apply to this stated model and scope. |
| How this is graded | The 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 12 · smtbmc yices · 2741 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.
Samples from the measured run. Free input lanes are shaded; the terminal VCD record is omitted.
Sample 4: quiet=4, warn_a=0, bark_a=0. Previous sample: quiet=3, warn_a=0. After four quiet cycles the copy with a limit of 6 must warn. This version warns one cycle late, so its threshold is not the limit minus two. The small copy shows in a few steps what the shipped copy would hide for 50,000 cycles.
Examples
A Constant That Follows the Limit
A threshold written as a number that was computed from the limit by hand.
The same threshold written as an expression of the parameter.
A bench can only shrink what the parameter reaches. A number that was derived by hand stays at its old value.
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
Search the module for every number that was derived from 50,000.
Hint 2
Check both small copies in your head: when does each one warn?
Hint 3
Use the "Seven habits" list of F9.3: one parameter, and nothing derived from it by hand.
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