Regarding uvm_config_db

Hi,

ERROR: This or another usage of ‘<class-spec#917>::set.$$’ inconsistent with ‘(null)’ object.
I just wanted to know the meaning of this error in detail.
why the set method is giving null value.
I set this config method in environment and get method in test case simply.

In reply to rushmitha ganji:

You should show at least a piece of code where you are doing the set to the config_db.

In reply to chr_sue:

hi,
Im trying to integrate my ral files with environment
i set this config db in top module

uvm_config_db#(reg_block)::set(null,“uvm_test_top”,“reg_model”,reg_model_v);

then , im getting it at test case:

if(!(uvm_config_db#(reg_block)::get(null,“”,“reg_model”,reg_model))) begin
uvm_fatal({get_full_name(),"::build_phase"},"RAL CONFIG OBJ GET FAILED") end reg_model=reg_block::type_id::create("reg_model",this); if(!(uvm_config_db#(reg_block)::set(this,"*","reg_model_v",reg_model))) begin uvm_fatal({get_full_name(),“::build_phase”},“RAL CONFIG OBJ SET FAILED”)
end
and then this to reg_env:

if(!(uvm_config_db#(reg_block)::get(this,“”,“reg_model_v”,reg_model_env))) begin
`uvm_fatal({get_full_name(),“::build_phase”},“CONFIG OBJ GET FAILED”)
end
…thanks in advance for the solution

In reply to GR_verif:

I do not understand where in your toplevel module the register model is available. It is a good coding practice to create your register model in your tesst. Then you can pass it to a configuration object or you can access it from the hierarchy in the env.

In reply to chr_sue:

Hi,
Yes,i’ve instantiated reg_model in top module and also created reg_model in the test case.

in top module:
reg_block reg_model_v;

in test case:
reg_model=reg_block::type_id::create(“reg_model”,this);
but still the same error.

In reply to GR_verif:

In reply to chr_sue:
Hi,
Yes,i’ve instantiated reg_model in top module and also created reg_model in the test case.
in top module:
reg_block reg_model_v;
in test case:
reg_model=reg_block::type_id::create(“reg_model”,this);
but still the same error.

This line of code

reg_block reg_model_v;

declares simply a variable of type reg_block. No object exists there. BTW the reg_model is considered as an object and not as a component.