This is a snippet from UVM example testbench.
In the APB agent code snippet:
function void apb_agent::connect_phase(uvm_phase phase);
m_monitor.APB = m_cfg.APB;
m_monitor.apb_index = m_cfg.apb_index;
ap = m_monitor.ap;
// Only connect the driver and the sequencer if active
if(m_cfg.active == UVM_ACTIVE) begin
m_driver.seq_item_port.connect(m_sequencer.seq_item_export);
m_driver.APB = m_cfg.APB;
end
if(m_cfg.has_functional_coverage) begin
m_monitor.ap.connect(m_fcov_monitor.analysis_export);
end
endfunction: connect_phase
I am not sure why analysis port in the agent is connected to monitor analysis port the following way:
ap = m_monitor.ap;
Shouldn’t this be done using connect method?