Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

system verilog class

• A class is a user-defined data type that includes data (class


properties), functions and tasks that operate on data.

• functions and tasks are called as methods, both are


members of the class.classes allow objects to be
dynamically created, deleted, assigned and accessed via
object handles.
this keyword
• this keyword is used to refer to class properties. this
keyword is used to unambiguously refer to class
properties or methods of the current instance.
• this keyword shall only be used within non-static
class methods
• this keyword refers to the object handle in which it
is invoked
class constructors
static class members
• Class members can be created with the
keyword static. the class can have static
properties and static methods (functions and
tasks). a single copy of static variables is
shared across multiple instances.
• static properties
• only one version of a variable is required to be shared by all instances.
These class properties are created using the keyword static.
• Syntax
• static <data_type> <property_name>;
• Static Methods
• a static method can access only static properties of the class and access
to the non-static properties is illegal and lead to a compilation error.
• Syntax
• static task/function <method_name>;
class assignment
ANY DOUBTS?

You might also like