A3.7.2 Followed-By Against Implication

MediumBreak ItVerilator · serverReview the topic

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

SignalWidthRole
clk1stimulus, the same for every design
go1stimulus, the same for every design
req1stimulus, the same for every design
ack1stimulus, the same for every design
reference failures32stimulus, the same for every design
Full specification
Your module (the harness drives clk and go)
// 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

Report a problem with this page

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

A Short Stimulus

Input
Your stimulus
Expected output
in_time = 1

Twelve edges are plenty: each hidden rule needs one or two well-chosen edges.

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

Verilator · server