In reply to dave_59:
Hi Dave,
The reason I think to implement this is -:
In the source code(already written by other person), has defined function of same name with different behavior in base and extended class.
he is using extended class handle to call that function everywhere in source code.
So I was just asking is it possible to call base class function with extended class handle.
Currently workaround which I did is -:
I Added super.function_name in extended class method and then given return 0
Something like this -:
class base_class;
function void display();
// source code
$display(“Inside base”);
endfunction
endclass
class ext_class_1 extends base_class;
function int display();
super.display();
return 0;
// Source Code
$display(“Inside extended class 1”);
endfunction
endclass
module testbench();
ext_class_1 my_ext_class;
base_class my_base_class;
initial begin
my_ext_class = new();
my_ext_class.display(); // Will execute base class method “Inside base” using exthandle
end
endmodule