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

Display Tasks: Verilog Escape Sequences

Verilog Examples

Runnable example from the Verilog Display Tasks tutorial (Verilog Escape Sequences)

Open in IDE
testbench.v
module tb;
  initial begin
    $display ("Newline character \n");
    $display ("Tab character\tstop");
    $display ("Escaping \\ \" %%");

/*
    // Compilation errors
    $display ("Without escaping \");       // ERROR : Unterminated string
    $display ("Without escaping "");       // ERROR : Unterminated string
*/
  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.