You are on page 1of 1

// Code your testbench here.

// Uncomment the next line for SystemC modules.


// #include "systemc.h"
[?8/?16/?2016 5:35 PM] Farjad A. Khan:
http://www.edaplayground.com/home
program main;
class A;
integer a;
integer b;
function print();
$display("This is Class A %d,%d",a,b);
endfunction
endclass
class B extends A;
integer a;
function print();
$display("This is Class b %d,%d",a,b);
endfunction
endclass
initial begin
A A_h;
B B_h;
A_h = new();
A_h.a = 5;
A_h.print();
B_h = new();
B_h.a = 7;
B_h.b = 9;
B_h.print();
A_h.print();
end
endprogram

You might also like