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

Min/Typ/Max Delays

Verilog Gate Level Modeling

How to specify min/typ/max delays for rise/fall transitions

Open in IDE
design.v
module des (	input 	a, b,
            	output out1, out2);

  and #(2:3:4, 3:4:5) o1 (out1, a, b);
  bufif0 #(5:6:7, 6:7:8, 7:8:9) b1 (out2, a, b);

endmodule
testbench.v
module tb;
  reg a, b;
  wire out1, out2;
  
  des d0 (.out1(out1), .out2(out2), .a(a), .b(b));
  
  initial begin
    {a, b} <= 0;
    
    $monitor ("T=%0t a=%0b b=%0b and=%0b bufif0=%0b", $time, a, b, out1, out2);
    
    #10 a <= 1;
    #10 b <= 1;
    #10 a <= 0;
    #10 b <= 0;
  end
  
  initial begin
    $dumpvars;
    $dumpfile("dump.vcd");
  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.