Excluding Register field from register bit bash test

Hi,
I want to exclude a register field from reg_bit_bash_test instead of excluding entire register.
I tried giving the following way. it doesn’t work. Is there a way to do it?

uvm_resource_db #(bit)::set({“REG::”, this.reg_name.field_name.get_full_name()}, “NO_REG_BIT_BASH_TEST”, 1);

Thanks,
Muthu

Hi Muthu,
I just tried on my test and your command works. Could you double check your test?

I’m using
“uvm_resource_db#(bit)::set({“REG::”,this.reg_env_instname.regmodel_instname.regblockname.regfieldname.get_full_name()}, “NO_REG_BIT_BASH_TEST”,1);”

Maybe you forgot to add the env inst name? I’m also new to UVM, not sure about that much. Hope this could help.

Wenjun

uvm_resource_db#(bit)::set({"REG::", env.reg_model.REG_NAME.get_full_name()}, "NO_REG_BIT_BASH_TEST",1,this);

I have it as this and it works.

In reply to rmakam:

It is not recommended to use uvm_resource_db, even it is now working.

In reply to muthu:

I also tried the same which muthu tried in my env class. It is not working for a ref field. It is working for a Register but.

In reply to Wenjun Xue:

Can anyone please tell me what to do if null poit dereference error comes when I add
uvm_resource_db#(bit)::set({“REG::”, env.reg_model.REG_NAME.get_full_name()}, “NO_REG_BIT_BASH_TEST”,1,this);

Is there any need to call get method ,because we called set above

In reply to Prajval S Vadakannavar:

It is unclear to me what you want to do.
Bur a few remarks:
(1) Never use the uvm_resource_db. Use instead uvm_config_db.
(2) a register value is not of type bit.
(3) It looks like you want to access a single register. The RAL provides you several commands to write to a register. You should use these commands.

In reply to chr_sue:

Have a look at the UVM source file src/regs/sequences/uvm_reg_bit_bash_seq.svh
It uses the uvm_reg_single_bit_bash_seq that only allows excluding registers, not fields. You would have to make a copy of this sequence and add code for a specific field, then override with the factory.

BTW: The UVM register sequences explicitly say to use uvm_resource_db, not uvm_config_db. The exclude-flag is a bit, not a register.