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

Fill Literals: '0 and '1

SystemVerilog Data Types

Unbased unsized fill literals set every bit of a vector regardless of its width

Open in IDE
testbench.sv
module tb;
  reg [7:0]  m_var1;
  reg [15:0] m_var2;
  
  initial begin
    m_var1 = '1;
    m_var2 = '1;
  
    $display("m_var1=0x%0h  m_var2=0x%0h", m_var1, m_var2);
  
    // This does not work - Radix must be specified !
    //m_var1 = 'F0;
    //m_var2 = 'cafe;
  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.