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

Data Types: Verilog Strings

Verilog Examples

Runnable example from the Verilog Data Types tutorial (Verilog Strings)

Open in IDE
testbench.v
module testbench;
 reg [8*11:1] str1;
 reg [8*5:1] str2;
 reg [8*20:1] str3;
 
 initial begin
 str1 = "Hello World";
 str2 = "Hello World";
 str3 = "Hello World";
 
 $display ("str1 = %s", str1);
 $display ("str2 = %s", str2);
 $display ("str3 = %s", str3);
 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.