ConfigDB Lookup Failure

Hi,

I have a situation where I have a register access sequence that requires me to pass it a pointer to a reg model so that it can perform register access. It has a configdb get() call like so at the top of the sequence body:

uvm_config_db#(uvm_reg_block)::get(get_sequencer(), "", "reg_model", temp_reg_block)

I then reference the appropriate sequencer in my sequencer start() call in the test body.

At my base test class connect phase, I perform the related configdb set() call to provide the reg model pointer. At the beginning I did a global set to make sure the access went through:

uvm_config_db #(uvm_reg_block)::set(null, "*", "reg_model", env_h.agent_h.reg_model_cast);

This works (duh)

I want to be specific as to who can see the particular reg model in question, so I want to set my path as specifically as I can instead:

uvm_config_db #(uvm_reg_block)::set(null, "env_h.agent_h.sequencer", "reg_model", env_h.agent_h.reg_model_cast);

However the confidb lookup fails in the test. I checked the path and it appears to be correct. I have tried various other combos like [this, ""], [null, ".sequencer"], [uvm_root::get(), “.env_h.”]*, to have anything more specific but all of these lookups fail.

Perhaps this is down to me misunderstanding how configdb works. Can anybody enlighten me?

Thanks!

In reply to silverace99:

Make sure that the name used when creating the components match the variable name. The config_db will use the component name when doing the lookup. It is common that the variable name doesn’t match the name used in ‘create’ which is overlooked by the user.

Also, I prefer to assign the register model handle to the sequencer since there is a significant performance penalty when doing config_db get() calls. If you call the sequence many times, you will see a performance degradation.

In reply to cgales:

In reply to silverace99:
Make sure that the name used when creating the components match the variable name. The config_db will use the component name when doing the lookup. It is common that the variable name doesn’t match the name used in ‘create’ which is overlooked by the user.
Also, I prefer to assign the register model handle to the sequencer since there is a significant performance penalty when doing config_db get() calls. If you call the sequence many times, you will see a performance degradation.

For the first part, I do always match the names to the variable names during creation. This time, I am then casting that object into a parent class pointer (uvm_reg_block) and feeding that cast pointer to the configdb set. Probably shouldn’t make a difference right?

As to the second part, it is autogenerated code not to be modified, so I’m working with what I’ve got.

In reply to silverace99:

If the return code of the get() call is indicating failure when specifying a specific path, but works when using “*”, then the path specified is the issue.

When calling set(), ‘null’ shouldn’t be used unless it is outside the UVM environment (typically for the interfaces).

I would try:


uvm_config_db #(uvm_reg_block)::set(this, "env_h.agent_h.sequencer", "reg_model", env_h.agent_h.reg_model_cast);

You can also enable +UVM_CONFIG_DB_TRACE to see if that helps.

In reply to cgales:

Thanks.

I did some standalone experimentation on EDA Playground and everything works the way I expect in that environment based on your advice, But when I run it in my own evironment I’m getting lookup failures. There may be a problem in my own environment, maybe the compiler (VCS).