Field/method name doesn't exists ERROR

Hello Team,

Please help me to resolve this little error.


top.sv


ifndef MYTOP define MYTOP

import uvm_pkg::;
import pkg::
;
`include “uvm_macros.svh”

module mytop;

intf in();
outf op4;

dut inst( .add(op[0].out),
.mul(op[1].out),
.in1in2(op[2].out),
.in2in1(op[3].out),

       .in1(in.in1),
       .in2(in.in2)

);

configuration cfg;

initial begin
cfg = new();
cfg.in = in;
cfg.op = op;

run_test(“test1”);

end
endmodule

`endif


configuration.sv file


ifndef GUARD_CONFIGURATION define GUARD_CONFIGURATION

import uvm_pkg::;
import pkg::
;
`include “uvm_macros.svh”

class configuration extends uvm_object;

bit [1:0]port[4]; 
virtual intf in;
virtual outf op[4];



configuration t;

virtual function uvm_object create(string name=" ");
`uvm_info(get_type_name(), “Creating the object of configuration class”, UVM_LOW);
t = new();
t.port = this.port;
t.in = this.in;
t.op = this.op;

return t;
endfunction
endclass
`endif


The error i got is:

**** Error: C:\questasim_10.2c\examples\mytop.sv(28): Field/method name (op) not in ‘cfg’**

Please help me to rectify this issue.

Thanks and Regards
Sunil Sharma

You should not have a function named “create”. This is an internal UVM function which is called to create objects and your definition will cause problems. Anything you need to do to initialize your component/object should be done in the build() function.