Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

using virtual on an already virtual method

Status
Not open for further replies.

rbhangal

Newbie level 1
Joined
Apr 8, 2015
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
7
Each of these functions are in a separate derived class extending ... lets say uvm_test

Code:
//example 1
class AAA extends uvm_test
   //code...
   virtual function void build_phase (uvm_phase phase)
      //code...
   endfunction
  //code...
endclass
Code:
//example 2
class BBB extends uvm_test
   //code...
   function void build_phase (uvm_phase phase)
      //code...
   endfunction
  //code...
endclass
In example 1, we use virtual when overriding an already virtual method, in example 2, we do not use the virtual keyword... I have seen examples both ways and no one seems to explain the usage of virtual in these specific cases. Is this a matter of style or is there a reason for using/not using the virtual keyword here? Can someone explain this to me? Thank you.
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top