I'm trying to understand forever
statement in raise_objection()/drop_objection()
.
I thought that the forever
statement will be finished after drop_objection()
. But, the below forever
statement does not finish.
forever begin
q_trans_addr.push_back(trans.addr);
end
So the simulation be hanged. It couldn't finish. What am I supposed to do to finish if I want to use forever
statement in run_phase()
?
class component_b extends uvm_component;
transaction trans;
int m_num_rx;
logic [31:0] q_trans_addr[$];
uvm_tlm_analysis_fifo#(transaction) m_analysis_fifo;
`uvm_component_utils(component_b)
function new(string name, uvm_component parent);
super.new(name, parent);
m_analysis_fifo = new("m_analysis_fifo",this);
endfunction
virtual task run_phase(uvm_phase phase);
phase.raise_objection(this);
repeat(m_num_rx) begin
#300;
`uvm_info(get_type_name(), $sformatf(" COMPB Before calling analysis fifo get method"), UVM_LOW)
m_analysis_fifo.get(trans);
end
forever begin
q_trans_addr.push_back(trans.addr);
end
phase.drop_objection(this);
endtask
endclass