I’m sure this is something really silly, it has to be, but it’s really confusing.
I have a translation component with a sequencer and pull port. It builds them in the build phase, and I have prints to verify they are not null, those prints are the last thing in the build phase.
I also have prints in the beginning of the connect phase, and suddenly by then the items are null.
class translation extends uvm_component;
`uvm_component_utils(translation);
uvm_sequencer#(A) m_sequencer;
protected uvm_seq_item_pull_port#(A) pull_port;
function new(string name, uvm_component parent);
super.new(name, parent);
endfunction
function void build_phase(uvm_phase phase);
super.build_phase(phase);
m_sequencer = uvm_sequencer#(A)::type_id::create("m_sequencer", this);
pull_port = new("pull_port", this);
// print the sequencer and pull port, which shows non-null values
endfunction
function void connect_phase(uvm_phase phase);
// print the sequencer and pull port, which shows null values
endfunction
endclass
Any ideas as to what I need to debug/investigate here? I have never had my references just become null without anything making them null.
The only accesses of those handles from outside the translation component is in the connect phase of an environment, where the m_sequencer
member is read, but not assigned. I can’t find any reason for them to become null, especially the pull port, since no other class sees that.
SOLVED.
The issue was (somehow, I still don’t understand why) that a subclass (which did not reference the pull_port or m_sequencer) used the object param utils. I guess the uvm_object_utils macro somehow clears all child elements after the build phase since objects shouldn’t have children???