Professional Documents
Culture Documents
System Verilog Classes - 1
System Verilog Classes - 1
A class is a user-defined data type that includes properties (data types) &methods (functions
and tasks) that operate on data.
the class allow objects to be dynamically created, deleted, assigned and accessed via object
handles.
Class Declaration:
class sv_class;
//class properties
int x;
//method-1
x = i;
endtask
//method-2
return x;
endfunction
endclass
initial begin
//class declaration/instance and object.
Sv_class class_1=new();
Sv_class class_2=new();
end
endmodule
o/p:
class_1 :: Value of x =10