Predictor is required to convert bus transactions to reg transactions only. So it is fine if bus2reg(apb2reg) adapter is available. So, reg2apb adapter is not required even if a predictor is used along with passive agent to update the reg model.
Provide more details of the example your are referring to, if you still feel otherwise.
Lest say I need only PASSIVE environment - RTL is driving apb, and lets say I just want to collect coverage on register fields
Code example shows:
if(m_cfg.m_apb_agent_cfg.active == UVM_ACTIVE) begin
reg2apb = reg2apb_adapter::type_id::create(“reg2apb”);
…
So, due to Point 1, I will use PASSIVE apb agent to monitor apb bus. Due to Point 2, I will not have reg2apb_adapter (that contains predictor, and bus2reg virtual function) => Cannot use passive part of uvm registers for register shadow model and coverage…
So this shows that we should create adapter regardless if apb agent is PASSIVE or ACTIVE, correct?
In reply to Dmitrii:
So example from Cookbook should be changed to take adapter in PASSIVE also…
Current code:
function void spi_env::connect_phase(uvm_phase phase);
if(m_cfg.m_apb_agent_cfg.active == UVM_ACTIVE) begin
reg2apb = reg2apb_adapter::type_id::create("reg2apb");
//
// Register sequencer layering part:
//
// Only set up register sequencer layering if the top level env
if(m_cfg.spi_rm.get_parent() == null) begin
m_cfg.spi_rm.APB_map.set_sequencer(m_apb_agent.m_sequencer, reg2apb);
end
end
endfunction: connect_phase
We should not have that IF in order to create adapter, correct?