Home System Verilog SV Classes Summary
Main Menu
System Verilog
    - Constructs
    - SV Classes
        -- Simple Class
        -- Inheritance
        -- Encapsulation
        -- this and super
        -- In Line Constraints
        -- Class Constraints
        -- Virtual Classes
        -- Parameterized Classes
        -- Summary
        -- Singleton Class
    - Functional Coverage SV
    - Examples
    - Tools
    - Links
    - Books
    - Interview Questions SV
Open Vera
Digital Concepts
Verification Basics
Interview Questions
Computer Architechture
C and C++
AsicGuru Blog
Tags Cloud
Usefull Sites
Know Your IP/Location
Local Information India
Buy Car/Inverter Batteries
Real Estate India
Sports Accessories India
Classes Summary
Share This Articale:

Summary :

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

This Articles is written/submitted by puneet (Puneet Aggarwal). You can also contribute to Asicguru.com. Click here to start

Prev << Parameterized Classes

Next >> Singleton Class

Sign In
Login with :-
| | |  
  • Bookmark