Home System Verilog Interview Questions SV abstract class
Main Menu
Home
System Verilog
    - Constructs
    - SV Classes
    - Functional Coverage SV
    - Examples
    - Tools
    - Links
    - Books
    - Interview Questions SV
        -- What is callback
        -- What is factory pattern
        -- Logic Reg wire
        -- Need Clocking Block
        -- Ways to avoid race
        -- Coverage Questions
        -- OOP
        -- Need of virtual interface
        -- abstract class
        -- Part 1
        -- Part 2
Verilog
Methodologies
Open Vera
Digital Concepts
Verification Basics
Protocols
Scripting
Articles
Videos
Interview Questions
Computer Architechture
C and C++
Blog/Article
AsicGuru Blog
Tags Cloud
Ads
Usefull Sites
Know Your IP/Location
Local Information India
Buy Car/Inverter Batteries
Real Estate India
Sports Accessories India
What is the use of the abstract class?
Share This Articale:

What is the use of the abstract class?

 

A virtual class is a temple or place holder for the child classes. A virtual class is also called as the abstract class. A virtual class is declared with a virtual keyword like :
virtual class base;
endclass;
A virtual class instance or object can not be constucted but you can define the hadle to the virtual class.

A virtual class is a temple or place holder for the child classes. A virtual class is also called as the abstract class. A virtual class is declared with a virtual keyword like :

virtual class base;

   virtual task1;

   endtask;

   virtual task2;

   endtask;

endclass;

A virtual class instance or object can not be constucted but you can define the hadle to the virtual class.

 

virtual class baseframe;
  ...
  virtual function void iam();
  endfunction
  ...
endclass

class shortframe extends baseframe;
  ...
  function void iam();
    $display ("Short Frame");
  endfunction
endclass

class longframe extends baseframe;
  ...
  function void iam();
    $display ("Long Frame");
  endfunction
endclass

baseframe two;  // OK

initial begin
  two = new(4); // ERROR
  ...



Find more about it here : http://www.asicguru.com/system-verilog/sv-classes/virtual-classes/96/

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


Prev << Need of virtual interface

Next >> Part 1

 
Login/Register
Register
Sign In
Login with :-
gmail-yahoo-twitter-facebook
| | |  
  •  
  • Bookmark
    ADS