Ready-to-run snippets

Code Examples

Ready-to-run Verilog, SystemVerilog, and UVM examples. Click any to open it live in the IDE.

← All examples

Delay Control: Implicit Event Expression List

Verilog Examples

Runnable example from the Verilog Delay Control tutorial (Implicit Event Expression List)

Open in IDE
testbench.v
module tb;
  reg a, b, c, d;
  reg x, y;

  // Event expr/sensitivity list is formed by all the
  // signals inside () after @ operator and in this case
  // it is a, b, c or d
  always @ (a, b, c, d) begin
    x = a | b;
    y = c ^ d;
  end

  initial begin
    $monitor ("T=%0t a=%0b b=%0b c=%0b d=%0b x=%0b y=%0b", $time, a, b, c, d, x, y);
    {a, b, c, d} <= 0;

    #10 {a, b, c, d} <= $random;
    #10 {a, b, c, d} <= $random;
    #10 {a, b, c, d} <= $random;
  end
endmodule
Admin mode — edit and delete controls are visible on each row. Use the IDE to add new snippets via File → Save as Snippet.