Jump to content

Using get_reg_by_name() API for registers instantiated in a UVM register file


Recommended Posts

I want to use the get_reg_by_name() API to get the registers instantiated inside a register file class extended from uvm_reg_file. This register file class is instantiated inside a uvm_reg_block class type. I am getting compilation error when trying to do as follows:

<reg block>.<reg file>.get_reg_by_name("<reg name>")

Please let me know how can I use the get_reg_by_name() function in this case?

 

Link to comment
Share on other sites

  • 1 month later...

UVM reg file is a grouping of similar registers.

Internally the registers would have been configured into the parent reg map.

Meaning the target register should be accessible through the parent reg map of reg file.

You could:

<reg_block>.get_registers(regs);

Loop through regs to find the target register.

 

Link to comment
Share on other sites

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...