0

I have some forces (interface to dut) in my tb_top file.

For example:

      // rx forces and assignments
   assign rx_vif.chind2 = dut.rx_fe.chind2;
      initial begin
                force dut.rx_fe.x = rx_vif.x;
      end
   end

I want to execute above only if the rx_agent is active.

For this I have to get the rx_agent_config object to the tb_top like this:

  if(!uvm_config_db #(rx_agent_config)::get(this, "", "db_rx_agent_config", m_rx_cfg)) begin
            `uvm_error("top", "rx_agent_config not found")
  end//if

THhe code for set:

 uvm_config_db #(rx_agent_config)::set(this, "*", "db_rx_agent_config", m_cfg.m_rx_agent_cfg);

What should I write instead of this (in the get function)?

sara8d
  • 403
  • 4
  • 17
  • 32

1 Answers1

0

Supposed that your component name is "comp" in ENV, and the env is named "env" in the uvm_test, so in test bench top module, you should use below code to get the configuration handle

uvm_config_db#(rx_agent_cfg)::get(null, "uvm_test_top.env.comp", "db_rx_agent_cfg", rx_cfg);

Because the earliest time you could set "rx_agent_cfg" in the uvm_config_db is 0 time in build_phase, so it is safe to do get after a #0 delay in the initial block.