Write stimulus that tells a followed-by rule apart from three look-alike rules, attempt by attempt.
Hardware context: A request/acknowledge rule and three look-alike rules. Write stimulus that separates followed-by from implication and from its overlapped form.
The reference rule is go |-> (req #=# ack). Three hidden rules replace #=# with other operators. Write the stimulus module that drives req and ack.
A hidden rule is caught when some attempt gets a different verdict from the reference. Catch all three within 12 edges.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
clk | 1 | stimulus, the same for every design |
go | 1 | stimulus, the same for every design |
req | 1 | stimulus, the same for every design |
ack | 1 | stimulus, the same for every design |
reference failures | 32 | stimulus, the same for every design |
Full specification
// Drive req and ack. Change them right after a falling edge; each value is sampled at the next rising edge.
// go is 1 at edges 1, 3, 5, ...: only those edges start the rules. Finish within 12 edges (by t=120).
module stim (
input logic clk,
output logic req,
output logic ack,
output int stim_end // set to $time when your stimulus is done
);
initial begin
req = 1; ack = 1; // sampled at edge 1
@(negedge clk); // edge 2
@(negedge clk); // edge 3
stim_end = $time;
end
endmodule
The harness toggles go, so the rules start only at edges 1, 3, 5 and so on. Each attempt is decided by the next edge, and the verdicts are compared there.
Your module must compile on its own: it drives its outputs only, and cannot reach into the harness. The hidden rules each differ from the reference in one operator; their names are shown only in the results.
Examples
Example 1
A Short Stimulus- Input
Your stimulus
- Output
in_time = 1
Twelve edges are plenty: each hidden rule needs one or two well-chosen edges.
Example 2
The First Look-Alike- Input
Your stimulus
- Output
caught = 1
It succeeds where the reference fails, on some go edge. Which edge pattern makes the left side of #=# fail?
Example 3
The Second Look-Alike- Input
Your stimulus
- Output
caught = 1
It disagrees with the reference about when ack is due. A late ack shows it.
Constraints and Contract
- Drive req and ack through the ports only.
- Set stim_end by t=120 (12 edges).
- Keep the module header.
Hints
Hint 1
Which operators succeed vacuously when req is 0 at a go edge?
Hint 2
Which operator checks ack at the same edge as req, and which one edge later?
Hint 3
One go edge with ack at 0 and then 1 at the next edge separates the two followed-by forms.
What the grader checks: Your stimulus runs once against the reference rule and three hidden rules. Graded: it ends in time, and each hidden rule gives a different verdict from the reference for some attempt. The module must compile on its own.
4 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