A7.5.1 Quiet During Reset, Not During the Test

MediumFixVerilator · serverReview the topic

A reset in the middle of a test causes a false failure. Fix the assertion control around the reset.

Hardware context: A handshake rule in a test that resets the design mid-run. Cancel the attempts a reset interrupts, and keep every real bug after the reset visible.

A test resets the design in the middle of the run. The bench rule says ack comes exactly three edges after req. After each reset, the rule reports a failure although the design is right.

The module reset_guard switches the assertions around the reset. Fix it. No failure may come from the reset, and every real bug after the reset must still be reported.

Signals in the Timeline

SignalWidthRole
clk1stimulus, the same for every design
rst1stimulus, the same for every design
req1stimulus, the same for every design
ack1stimulus, the same for every design
fails32stimulus, the same for every design
Full specification
The ports (keep them)
module reset_guard (
  input logic rst      // the design reset: high while the design is held in reset
);
  // your assertion control
endmodule
TimeWhat the program shown here doesExpected
25 to 55an attempt starts at 25; a reset from 27 to 47 stops ackno failure
35, 45the bench drives junk on req during the resetno failure
65 to 95a request with no ackone failure, at 95
105 to 135a request answered at 135no failure

The full check also runs a second program, after this one, with two resets and another clock. This page does not show it.

Examples

Example 1

Only the Real Bug
Input
Program: a reset from 27 to 47, a real bug at 65
Output
fails = 1

The request at 65 gets no ack. Nothing else may fail.

Example 2

Nothing from the Reset
Input
Program: up to t=70
Output
fails = 0

The attempt from 25 and the junk at 35 and 45 report nothing.

Example 3

Checking Is Back After the Reset
Input
Program: up to t=100
Output
fails = 1

The missing ack is reported at 95, before 100.

Constraints and Contract

  • Use the assertion control tasks in reset_guard. Do not change the port.
  • No failure from attempts that a reset interrupts, or from edges during a reset.
  • Every assertion checks again from the end of each reset.

Hints

Hint 1

Which task stops new attempts only, and which also cancels the ones already running?

Hint 2

A task with no arguments acts on every assertion of the design.

Hint 3

Pair each cancel with a task that starts checking again.

What the grader checks: Your module watches two fixed programs, one after the other: the one shown here and a hidden one with two resets. Graded on each: the failures of the bench rule in total and by a set time.

5 checks on Verilator · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain public samples only. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 2 steps and the final capstone

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

Only the Real Bug

Input
Program: a reset from 27 to 47, a real bug at 65
Expected output
fails = 1

The request at 65 gets no ack. Nothing else may fail.

Run samples executes all 3 public checks. Check all tests runs 5 checks on the server.

Verilator · server