Created
February 21, 2023 14:45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Code your testbench here | |
// or browse Examples | |
// Code your testbench here | |
// or browse Examples | |
// Code your testbench here | |
// or browse Examples | |
class animal; | |
int age=-1; | |
function new(int a /*= 20*/); | |
age = a; | |
endfunction : new | |
endclass : animal | |
class lion extends animal; | |
function new(); | |
super.new(); | |
endfunction : new | |
endclass : lion | |
module test(); | |
animal a; | |
lion l; | |
initial begin | |
l = new(); // l = new() will work | |
$display("@@@@ age is %0d",l.age); | |
end | |
endmodule |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment