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

bit, byte and int: longint

SystemVerilog Data Types

Runnable example from the SystemVerilog bit, byte and int tutorial (longint)

Open in IDE
testbench.sv
module tb;
   longint            m_var_s;      // By default signed, and can represent positive and negative numbers
  
  initial begin
  
    #10 m_var_s  = 0;  
    #20 m_var_s  = 2**63 - 1;  
    #30 m_var_s  = 2**63;  
    #40 m_var_s  = 2**64 - 1;  
  end
  
  initial
    $monitor("[%0t] m_var_s = 'd%0d  (0x%0h)", $time, m_var_s, m_var_s);
endmodule
Admin mode — edit and delete controls are visible on each row. Use the IDE to add new snippets via File → Save as Snippet.