In reply to chr_sue:
In reply to cyy0825:
Do you have somewhereelse an objection mechanism implemented. If not the simulation stucks at run time zero.
Thank you.
I don’t have an objection mechanism implemented in other places.
I think I’ve seen somewhere that if there’s no objection raised then the run_phase will just end. That kinda explains it. But then I modified the code a little bit to add a while(1) loop, I saw different results when putting while(1) loop in different places. (Theoretically both case should be able to finish I think?)
- Putting it before seq.start, the uvm_info inside the while loop is printed forever and test hang.
//---------------------------------------
// run_phase - starting the test
//---------------------------------------
task run_phase(uvm_phase phase);
//phase.raise_objection(this); -------> comment out
while(1) begin
`uvm_info(get_type_name(), "Before seq.start", UVM_LOW) // ----------> New print added
end
seq.start(env.mem_agnt.sequencer);
`uvm_info(get_type_name(), "After seq.start", UVM_LOW) // ----------> New print added
//phase.drop_objection(this); --------> comment out
//set a drain-time for the environment if desired
phase.phase_done.set_drain_time(this, 50);
endtask : run_phase
- Putting it after seq.start, the uvm_info never printed and test was able to finish (PASS).
//---------------------------------------
// run_phase - starting the test
//---------------------------------------
task run_phase(uvm_phase phase);
//phase.raise_objection(this); -------> comment out
`uvm_info(get_type_name(), "Before seq.start", UVM_LOW) // ----------> New print added
seq.start(env.mem_agnt.sequencer);
while(1) begin
`uvm_info(get_type_name(), "After seq.start", UVM_LOW) // ----------> New print added
end
//phase.drop_objection(this); --------> comment out
//set a drain-time for the environment if desired
phase.phase_done.set_drain_time(this, 50);
endtask : run_phase