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

Verilog Task

Verilog Tasks

Verilog Task — a ready-to-run Verilog example.

Open in IDE
Related tutorial:
testbench.v
module tb;
  
  initial display();
  initial display();
  initial display();
  initial display();
  
`ifdef AUTOMATIC
  task automatic display();
`else    
  task display();
`endif    
    begin : MY_TASK
        integer i = 0;        
        
        i = i + 1;
        $display("i=%0d", i);
    end
  endtask
endmodule
Admin mode — edit and delete controls are visible on each row. Use the IDE to add new snippets via File → Save as Snippet.