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:
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:
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?
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 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.
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 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).