Reg2apb and PASSIVE agent

In example code, reg2apb is created only if agent is ACTIVE.

In case I just want to have predictor (passive agent provide info to predictor that keeps register model “aligned” with RTL):

  • do I still need to have reg2apb adapter? I guess yes. Then the code should always create it, not only for PASSIVE configs…

In reply to apr:

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.

In reply to S.P.Rajkumar.V:

Here are more detailed analysis:

  1. Lest say I need only PASSIVE environment - RTL is driving apb, and lets say I just want to collect coverage on register fields
  2. Code example shows:
    if(m_cfg.m_apb_agent_cfg.active == UVM_ACTIVE) begin
    reg2apb = reg2apb_adapter::type_id::create(“reg2apb”);
  3. 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 apr:

In reply to S.P.Rajkumar.V:

So this shows that we should create adapter regardless if apb agent is PASSIVE or ACTIVE, correct?

Yes, you should create a ‘reg2apb_adapter’ in both cases.

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?