Summary :
- Inheritance using extends
- Single parent only
- Encapsulation
- All members globally visible by default
- local members are only visible in the class declaration
- protected members are visible in the class declaration and any subclasses
- Randomization with randomize method
- By default, randomizes properties qualified with rand or randc only
- Constraints can be defined:
- “in-line” using with
- as separate class properties using constraint blocks
- Constraints can be relational, conditional or weighted (dist)
- A virtual class cannot be instantiated, only used as a base class for inheritance.
- Polymorphism allows a object handle of a given class type to contain any inherited class instance.
- Virtual methods
Simulator calls method according to the handle contents, not type.
Allow subclass methods to be accessed off a parent class type variable - Virtual method templates
- Placeholder for name/arguments of a method
Implementation must be provided by a subclass for method to be used. - Parameterized class
Parameterized for type as well as size, width etc.