localmailbox#(T)m;localintm_size;protectedintm_pending_blocked_gets;// Function: new//// The ~name~ and ~parent~ are the normal uvm_component constructor arguments. // The ~parent~ should be ~null~ if the <uvm_tlm_fifo#(T)> is going to be used in a// statically elaborated construct (e.g., a module). The ~size~ indicates the// maximum size of the FIFO; a value of zero indicates no upper bound.functionnew(stringname,uvm_componentparent=null,intsize=1);super.new(name,parent);m=new(size);m_size=size;endfunction
returnm_size==0||m.num()<m_size;endfunctionvirtualfunctionbitcan_get();returnm.num()>0&&m_pending_blocked_gets==0;endfunctionvirtualfunctionbitcan_peek();returnm.num()>0;endfunction// Function: flush//// Removes all entries from the FIFO, after which <used> returns 0// and <is_empty> returns 1.virtualfunctionvoidflush();Tt;
localmailbox#(T)m;localintm_size;`ifndefUVM_USE_PROCESS_CONTAINERprotectedbitm_pending_blocked_gets[process];`elseprotectedbitm_pending_blocked_gets[process_container_c];`endif// Function -- NODOCS -- new//// The ~name~ and ~parent~ are the normal uvm_component constructor arguments. // The ~parent~ should be ~null~ if the <uvm_tlm_fifo#(T)> is going to be used in a// statically elaborated construct (e.g., a module). The ~size~ indicates the// maximum size of the FIFO; a value of zero indicates no upper bound.functionnew(stringname,uvm_componentparent=null,intsize=1);super.new(name,parent);m=new(size);
endfunction// undocumented function for clearing zombie getsprotectedfunctionvoidm_clear_zombie_gets();`ifndefUVM_USE_PROCESS_CONTAINERprocesszombie_gets[$];`elseprocess_container_czombie_gets[$];`endifforeach(m_pending_blocked_gets[i])`ifndefUVM_USE_PROCESS_CONTAINERif(i.status()==process::KILLED)`elseif(i.p.status()==process::KILLED)`endifzombie_gets.push_back(i);foreach(zombie_gets[i])m_pending_blocked_gets.delete(zombie_gets[i]);endfunction:m_clear_zombie_getsvirtualfunctionbitcan_get();m_clear_zombie_gets();returnm.num()>0&&m_pending_blocked_gets.size()==0;endfunctionvirtualfunctionbitcan_peek();returnm.num()>0;endfunction// Function -- NODOCS -- flush//// Removes all entries from the FIFO, after which <used> returns 0// and <is_empty> returns 1.virtualfunctionvoidflush();