Uvm_config_db get in UVM_object

In reply to chr_sue:

I think RD_LATENCY is an int in his agent config class. The problem is that he is calling uvm_config_db::get(this,) from inside the agent config class, derived from uvm_object, and that first handle has to be a class handle, derived from uvm_component.

As I said in my first reply, the correct place for this get() call is probably in the agent class. It depends on who created the configuration object, usually the test class.

The call in the agent class looks like:


class my_agent extends uvm_agent;
  virtual function void build_phase(...);
    if (! uvm_config_db #(int)::get(this, "", "RD_LATENCY", agt_cfg.RD_LATENCY))
      `uvm_fatal("NSFW", "No RD_LATENCY")

Long term, why do you want to pass RD_LATENCY “globally” so it is seen by all components? Who sets it? Does every component really need to see it? What happens if you have multiple subsystems, each with their own RD_LATENCY value?