In reply to gaurson:
@gaurson
thanks.The issue is solved. Now there is no syntax error but when i run the testcase I get the following error:
Error-[NOA] Null object access
Please make sure that the object is newed before using it.
The object is being used before it was constructed.
It is complaining about the following line of code below:
test_mode.mode1=xxx
The complete code is:
class A;
function new(string name = “A”);
super.new(name);
endfunction:new
string mode1[3] = '{“chip”, “boundary”, “chain”};
string mode2[2] = '{“chip”, “chain”};
endclass : A
class B;
function new(string name = “B”);
super.new(name);
endfunction:new
function void print_it(string details);
A test_mode;
foreach(details[i]) begin
test_mode.mode1=xxx
$display(details[i]);
end
endfunction: print_it
endclass : B
class C;
function new(string name = “C”);
super.new(name);
endfunction:new
A test_mode;
B printing;
test_mode = new();
printing = new();
printing.print_it(test_mode.mode1);
endclass:C
Do you have any idea what is missing in the code?