class parent;
int a = 10;
endclass
class child extends parent;
int b = 10;
endclass
module main;
parent P;
child C;
P = new();
C = new();
initial begin
$display("a=%d\n",C.a);
end
endmodule
I tried to run this code using Synopsys VCS. It is giving an error at the object creation after the handle declaration. The error is as follows:
Error-[SE] Syntax error Following verilog source has syntax error : "class.sv", 20: token is '=' P = new();