Description
Six of eight cross bins fill in simulation. Decide which of the other two are truly unreachable, and prove it.
Two cross bins of a covergroup stay empty in simulation. Translate each bin into a condition, with its sampling event. Assert the negation of every bin the block can never hit, and of no other bin.
Pinned interface
| Port | Direction | Bits |
|---|---|---|
| clk | input | 1 |
| rst | input | 1 |
| req | input | 1 |
| prio_in | input | 2 |
| size_in | input | 2 |
| acc | output | 1 |
| prio | output | 2 |
| size | output | 2 |
Full specification
The block accepts a request when its priority and size are allowed. acc is high for one cycle after an accepted request. prio and size hold the last request, accepted or not. The covergroup below samples them when acc is high.
After a long regression the two cross bins <0, big> and <3, big> are still empty. The team wants to waive both. A waiver needs a proof, not an empty bin.
Submit one assertion for every cross bin that the block can never hit. Submit none for a bin that it can hit. Each assertion states that the bin condition never holds. The judge searches the block for a counterexample to depth 8 and proves your file. Then it runs the file on three changed blocks in which a bin becomes reachable.
covergroup cg @(posedge clk iff acc);
cp_prio: coverpoint prio;
cp_size: coverpoint size { bins small = {[0:1]};
bins big = {[2:3]}; }
cp_x: cross cp_prio, cp_size; // eight cross bins
endgroup
module top(input clk, input rst, input req, input [1:0] prio_in, input [1:0] size_in, output reg acc=0, output reg [1:0] prio=0, output reg [1:0] size=0);
// prio: 0 best effort, 1 and 2 data, 3 control. size: 0 to 3.
wire too_big = prio_in == 2'd0 && size_in >= 2'd2; // best effort may only send small packets
always @(posedge clk)
if (rst) begin acc <= 0; prio <= 0; size <= 0; end
else begin
acc <= req && !too_big;
if (req) begin
prio <= prio_in;
size <= prio_in == 2'd3 ? 2'd0 : size_in; // control packets are always size 0
end
end
always @(posedge clk) begin if ($initstate) begin assume(rst); end else begin assume(!rst); end end
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 assertion properties 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 8 · smtbmc yices · 2529 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 2: acc=1, prio=0, size=2. Previous sample: req=1, prio_in=0, size_in=2. A best-effort request of size 2 was accepted, so the sampled values hit the cross bin of priority 0 and big. On this changed block the bin is reachable, and a waiver for it would be wrong.
Examples
A Bin as a Condition
covergroup sampled @(posedge clk iff done); cross bin <mode 2, len long>, where long is 8 to 15.
assert property (@(posedge clk) disable iff (rst) !(done && mode == 2 && len >= 8));
The sampling condition is part of the bin. Without it the condition also holds in cycles that the covergroup never samples.
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
Write each empty bin as one condition: the sampling event and one bin of each coverpoint.
Hint 2
For each condition, find the line of RTL that would have to allow it.
Hint 3
Use the item table of the "Covergroups and code coverage" section in F5.7.
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