User guide
24-45
SystemVerilog Testbench Constructs
Now consider the following, assuming p1 and p2 have been declared
and p1 has been instantiated:
p2 = new p1;
The handle p2 now points to a shallow copy of the object referenced
by p1. Shallow copying creates a new object consisting of all
properties from the source object. Objects are not copied, only their
handles. That is, a shallow copy is a duplication of members, including
handles, of an object´s first level constituents in the hierarchy.
However, an object referenced by a copied handle is not, itself,
copied. That is, an object contained within an object is not copied,
only the referential handle.
Static Properties
The static keyword is used to identify a class property that is shared
with all instances of the class. A static property is not unique to a
single object (that is, all objects of the same type share the property).
A static variable is initialized once.
Syntax
static data_type variable;
Example
program test;
class Parcel;
static int count = 2;
function new();
count++;
endfunction
endclass