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
| Signal | Width | Role |
|---|---|---|
clk | 1 | stimulus, the same for every design |
rst | 1 | stimulus, the same for every design |
req | 1 | stimulus, the same for every design |
ack | 1 | stimulus, the same for every design |
fails | 32 | stimulus, the same for every design |
Full specification
module reset_guard (
input logic rst // the design reset: high while the design is held in reset
);
// your assertion control
endmodule
| Time | What the program shown here does | Expected |
|---|---|---|
| 25 to 55 | an attempt starts at 25; a reset from 27 to 47 stops ack | no failure |
| 35, 45 | the bench drives junk on req during the reset | no failure |
| 65 to 95 | a request with no ack | one failure, at 95 |
| 105 to 135 | a request answered at 135 | no 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