Hi,
I am trying to access non immediate base class methods using type parameter without using the super keyword. But, I’m getting fatal error mentioned below.
Code:
class A;
function int count(int num_);
count = num_+10;
endfunction: count
endclass: A
class B extends A;
localparam type parent = A;
function int count (int num_);
count = num_+20;
endfunction: count
endclass: B
class C extends B;
localparam type parent = B;
function int count (int num_);
count = parent::parent::count(num_);//This is giving fatal error
//count = A::count(num_);//This works fine
endfunction: count
endclass: C
In top module, I’m calling c_obj.count(5) and getting below error.
Error: Fatal error in Function top_sv_unit/A::count at top.sv when c_obj.count is executed.
If I replace “parent::parent::count” with “A::count” in the count function of class C, there is no fatal error.
Can someone explain why parent::parent::count doesn’t work while directly specifying A::count works?
thank you