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, e;
  reg x, y, z;

  // Add "e" also into sensitivity list
  always @ (a, b, c, d, e) begin
    x = a | b;
    y = c ^ d;
    z = ~e;
  end

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

    #10 {a, b, c, d, e} <= $random;
    #10 {a, b, c, d, e} <= $random;
    #10 {a, b, c, d, e} <= $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.