Jump to content

Recommended Posts

Posted

Want to set attribute NO_REG_TESTS for few Status resigters, so that when reset sequence will disable reading the register.

I have made

uvm_resource_db#(bit)::set({"REG::",regmodel.debug_status.get_full_name(),".*"},"NO_REG_TESTS",1,this);

uvm_resource_db#(bit)::set({"REG::",regmodel.debug_status.get_full_name(),".*"},"NO_REG_HW_RESET_TEST",1,this);

in environment but still i could see debug_status register being tested.

Can anyone give me the solution how to set this attributes.

-Akshay Rao

Posted (edited)

Do you make the two uvm_resource_db#(bit)::set in the test_base::build_phase(uvn_phase phase) when creating the regmodel?

They should work well. Following code snippet is uvm_reg_hw_reset_seq source code. see the bold parts~

class uvm_reg_hw_reset_seq extends uvm_reg_sequence #(uvm_sequence #(uvm_reg_item));

`uvm_object_utils(uvm_reg_hw_reset_seq)

function new(string name="uvm_reg_hw_reset_seq");

super.new(name);

endfunction

virtual task body();

uvm_reg regs[$];

uvm_reg_map maps[$];

if (model == null) begin

`uvm_error("uvm_reg_hw_reset_seq", "Not block or system specified to run sequence on");

return;

end

uvm_report_info("STARTING_SEQ",{"\n\nStarting ",get_name()," sequence...\n"},UVM_LOW);

if (uvm_resource_db#(bit)::get_by_name({"REG::",model.get_full_name()},

"NO_REG_TESTS", 0) != null ||

uvm_resource_db#(bit)::get_by_name({"REG::",model.get_full_name()},

"NO_REG_HW_RESET_TEST", 0) != null )

return;

Edited by Roman
Posted (edited)

Remove the ".*" after the end of the register full name in the concatenation. The resource must target the register, not anything below it.

Hi Janick,

At page 656 of the UVM1.1 class reference spec, 25.2 uvm_reg_hw_reset_seq , it mentioned it should use the following ".*" after the end of the register full name in the concatenation

If bit-type resource named “NO_REG_TESTS” or “NO_REG_HW_RESET_TEST” in the

“REG::” namespace matches the full name of the block or register, the block or register

is not tested.

uvm_resource_db#(bit)::set({"REG::",regmodel.blk.get_full_name(),".*"},

"NO_REG_TESTS", 1, this);

Edited by Roman
Posted

The example uses BLOCKNAME.get_full_name() and the ".*" will thus match the registers in contains.

The user uses REGNAME.get_full_name() and the ".*" would match the fields it contains -- which is not the scope where the resource is looked up.

Posted

Ok , thanks . I miss this trick in this case.

regmodel.debug _status seems to be not good style. I think we should make all registers and memory into the block, and then build the block in the regmodel. Not build register directly in the regmodel, right?

Posted

You can also add to your XML for the debug_status register, this:

<vendorExtensions:name>NO_REG_HW_RESET_TEST</vendorExtensions:name>

<vendorExtensions:name>NO_REG_TESTS</vendorExtensions:name>

These commands can be for registers or blocks (register files). This may not be flexible if the generator doesn't know this vendorExtension.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...