Use the output of a module inside a class (including task (generator)

In reply to saketa:

You are facing a name issue in the resource database. This is your set command:
uvm_resource_db#(virtual sdm_if)::set(“env”, “SDM_if_if”, dut.SDM_if_if0);
You are storing the interface under the name ‘SDM_if_if’.
The read command from the resource db is:
uvm_resource_db#(virtual SDM_if)::read_by_name(get_full_name(), “SDM_if”, m_if);
And you are trying to read from the name ‘SDM_if’ in the env. But there is no entry in the resource db for this name. You have to adopt the names.
By the way, I’m not sure which methodology you are following. But this definitely not what UVM is proposing. It looks like Mentor Graphic’s early days AVM. I’d recommend to refine your code and moving to UVM.

Hope this helps.